Description
In order to answer some lingering design questions about the dycore (the main two being whether metric terms should be DSSed and how velocity should be reconstructed), we need to add a quantitative test of topography to our CI. This test should compare the velocities generated by our model against a known analytic solution, or at least a close approximation of the true solution, and it should generate plots that allow us to easily distinguish dycores with slightly different numerics.
In the literature, the standard test problem for topography is flow over an isolated mountain in a long periodic channel. (Usually the mountain has either the Schar profile or the Agnesi profile, since both of those have simple Fourier transforms.) A derivation of the approximate solution for this problem is outlined in this documentation for the COSMO model. Ideally, our test should be able to reproduce the contour plots from this paper, with a comparable amount of deviation from the analytic solution. It would also be helpful to reproduce the streamline plots from this general overview of mountain waves, since we don't currently have any visualizations of wind direction.
Lastly, we want to plot the RMSE of each velocity component by elevation, and then check that the overall RMSE is below some chosen threshold. If this does not allow us to easily distinguish between different dycore numerics, we can instead plot the overall RMSE as a function of spatial resolution, and then check that it converges to 0 at the expected rate.
Update on 6/28:
The analytic solution from the COSMO documentation did not have sufficient accuracy to resolve the errors in the Schar mountain test. A solution that is more visually similar to our numerical simulations can be found in Numerical Consistency of Metric Terms in Terrain-Following Coordinates by Klemp and Skamarock. However, this derivation in this paper involves several assumptions that we do not need to make (e.g., the Boussinesq approximation), so I've derived a new approximation that uses the same minimal assumptions as the COSMO documentation, which can be viewed in this Overleaf document.
TODO
- [ ] Finish implementing analytic solution and error analysis pipeline
- [ ] Add support for 2D simulations on GPUs so that the numerical solution can be computed quickly
- [ ] Add some plotting utilities to ClimaAnalysis to improve visualizations of solutions and errors
- [ ] Check whether disabling the DSS of metric terms (and adding DSS of implicit solve increments) reduces errors
- [ ] Check whether Oswald's velocity reconstruction results in lower errors than Simon's (with the kinetic energy correction)
- [ ] Decide on a set of quantitative tests to keep in our CI pipeline, or in the longruns pipeline if we need an accurate convergence order test