-
Notifications
You must be signed in to change notification settings - Fork 5
Add mountain wave validation case #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Should the new validation script be run in CI? Maybe after #67, because that touches the Validation workflow |
One issue with always running validation in CI is that there will probably need to be some heavy validation cases. So we may not be able to run them all (or at least not all the time... maybe infrequently, eg nightly or weekly) Another thought is that I think its nice to implement validation cases as "examples" which get built into the documentation (Oceananigans does this to some extent, though we may be able to do an even better job here). However one may want to have additional validation cases that are not examples. Some of the non-example validation cases could be lightweight enough to run regularly in CI. Maybe we can flesh out a strategy that incorporates these considerations? |
|
Yes. Agree. It's bit tricky to run the validation cases in a CI. Especially if validation cases also start plotting things and one needs to visually inspect to ensure that nothing changed. An idea would be that validation scripts finish at plus perhaps a very simple test after (eg something to ensure the flow is not nonsense?) And then different scripts for plotting? It does make the validation directory a bit more complex... |
|
Possibly we want to implement validation tests as regression tests. |
Great work @kaiyuan-cheng ! This is indeed a challenging test for z-coordinate, so it is quite useful. My two big comments are 1) can we see what the solution looks like at high resolution (I understand that we need to get GPU working for that --- I will look at that in parallel) and 2) can we investigate whether vertical grid stretching helps? Some more detail below. Here are my takeaways:
here are my existing questions:
a few comments:
At some point we should open an issue to discuss the pros and cons. Tagging @OsKnoth, @bischtob because he basically told me all of the points that I made above 😂 |
|
Also tagging @simone-silvestri since I suspect he will be intrigued by acoustic substepping AND terrain following coordinate implementations (whose work could possibly inform the ocean model as well) --- although my hunch is that maintaining restful hydrostatic balance is harder in the ocean due to (1) bigger topography relative to depth (it goes to the top) and (2) possibly, equation of state difficulties. |
|
@kaiyuan-cheng can you also push your changes to this PR so we can see your code? |
I pushed it last night. Here is the link. Let me know if you have trouble accessing it. |
Yes, but this is not an ideal solution as it will increase the computational cost significantly (more vertical grids, together with smaller dt).
I think we probably will need a terrain-following coordinate.
Totally.
I guess stretching grid will help, but I expect it will still require a finer grid (and a smaller dt) to resolve the topography compared to a terrain-following coordinate, which will increase the computational cost.
I think it depends on the slope of the terrain.
I guess a terrain-following coordinate would better capture weather phenomena related to topography, such as orographic precipitation and foehn winds. By "better", I mean more computationally efficient.
Agree.
Agree.
|
The key question is whether we require high resolution for other reasons (ie to resolve microphysical / turbulence interactions). In the case that we already would like to use high resolution for fidelity, then we do not accept any additional cost for resolving the topography. However, if we decide that we would like to use a low resolution for a particular case, then it may not be worth it to increase the resolution massively merely to resolve the topography, and those cases are better served by a terrain following coordinate. Note that the terrain following coordinate will also increase the computational cost somewhat (we might expect something like a 2-10x slowdown per time-step --- hopefully closer to 2x). So this increased cost has to be balanced against the cost savings of lower resolution. High resolution yields benefits everywhere (not only for resolving topography), so it would be better to use a higher resolution in the case that the two options are 1) high resolution with immersed boundary, which is appropriate for the terrain or 2) terrain following coordinate with lower resolution. @OsKnoth has written papers about the benefits of cut cell immersed boundary methods so he might have more to add about the pros and cons. Generally I would expect that immersed boundary starts to make more sense if one is considering steeper, larger terrain/obstacles (relative to domain height); for example simulations of flow around buildings, very large and steep mountains, etc. This Schar case is rather extreme in that we have a domain 20 km deep but the topography is only 250 m high. |
|
@kaiyuan-cheng can you add a sponge layer at the top, and sponge layers on the side of the domain (making the domain bigger)? If it is too expensive, you can try running on GPU. (The sponge layer may only need to be on the vertical velocity component). Also let us know what resolution you are using. I think the typical resolution is dx = 500, dz = 300. |
I believe I have a sponge layer set up at the top of the domain (quite thick; 1/2 of the height, as suggested by a couple of studies running a similar simulation). As for the lateral boundary, we probably don't need a sponge layer, as the information of interest has not yet propagated across the entire domain. I also tested a setup with the horizontal domain size doubled, but the solution didn’t change much. For the vertical domain size, however, a larger model height gives a solution closer to the analytical solution, which suggests that the current sponge layer configuration does not eliminate wave reflection effectively. The resolution I am using is dx = 1 km and dz = 25 m. I also tested a stretching vertical coordinate, which reduces nz by more than 50% and still runs pretty well. |
|
There's a helper in Oceananigans called |
|
@kaiyuan-cheng I updated the validation case to use a discrete form |
|
@navidcy Thank you for the updates! |


cc @kaiyuan-cheng