What's the best way to avoid CFL-related instabilities in the early simulation steps of LES #1361
-
I'm running a LES of the upper ocean with a Smagorinsky closure. In the beginning of the simulations the Courant number varies a lot (probably because of the small-scale noise) so I have to set the CFL to something really small to get passed that. (Something like 0.02!) The problem is that eventually the Courant number stabilizes and I get stuck with a simulation that takes much smaller steps than it could, and therefore doesn't use computational resources efficiently. In other codes that I know this is generally counter-acted by starting the first couple hundred steps of an LES with a constant eddy diffusivity, and only then turning on the LES closure. Is there an easy way to do that with Oceananigans? Sorry if I missed something, but I searched the docs and couldn't find anything. Ideally I'd wanna avoid starting a very brief simulation with a constant viscosity and then pickup that simulation with another script to run it "for real". Alternatively having a time-dependent CFL limit might work, but that seems unnecessarily convoluted... Thoughts? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 23 replies
-
I've used a time-dependent CFL in the past with some good results. It's easy to implement in the simulation progress function but a bit awkward. This is how I did it for the stratified Couette flow validation experiment (the script needs some real TLC): Oceananigans.jl/validation/stratified_couette_flow/stratified_couette_flow.jl Lines 237 to 244 in cadfdae Switching model properties is not allowed since that would modify the model's Julia type. You also might not want to create two models as that would allocate twice as much memory. Might not be too hard to write a function like new_model = switch_out_model(old_model, closure=new_closure, ...) that constructs and returns a new model using all the arrays from the old model to avoid allocating any new memory. It would perform a somewhat similar job to the checkpointer |
Beta Was this translation helpful? Give feedback.
I've used a time-dependent CFL in the past with some good results. It's easy to implement in the simulation progress function but a bit awkward. This is how I did it for the stratified Couette flow validation experiment (the script needs some real TLC):
Oceananigans.jl/validation/stratified_couette_flow/stratified_couette_flow.jl
Lines 237 to 244 in cadfdae
Switching model properties is not allowed since that would modi…