Should the time step wizard take into account of background velocity in calculation of CFL number? #3354
Replies: 5 comments 8 replies
-
You are right! Indeed, the CFL calculation should account for additional velocities. Seems like we have to update the It should be possible by changing the model-specific and to pass total velocities as done here |
Beta Was this translation helpful? Give feedback.
-
Yes. |
Beta Was this translation helpful? Give feedback.
-
@zhihua-zheng this is a bona fide issue, do you mind if I convert to an issue? Would you like to try to fix it? |
Beta Was this translation helpful? Give feedback.
-
I think all that needs to be change is this one line: which can be changed to: cell_advection_timescale(model::NonhydrostaticModel) = cell_advection_timescale(model.grid, total_velocities(model)) since we defined Oceananigans.jl/src/Models/NonhydrostaticModels/nonhydrostatic_model.jl Lines 224 to 227 in cc51ff0 (plus |
Beta Was this translation helpful? Give feedback.
-
Because Oceananigans.jl/src/Models/NonhydrostaticModels/nonhydrostatic_model.jl Lines 223 to 227 in cc51ff0 is included by this line below? Sorry, I'm new to Julia and the code structure seems a bit convoluted. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I'm running a case similar to this example, which has a background velocity from the thermal wind shear. However, I find this setup usually has some numerical instabilities at the beginning. I was wondering if that's related to the time step wizard's adjustment of
Δt
being too large. From the calculation ofcell_advection_timescale
here,Oceananigans.jl/src/Advection/cell_advection_timescale.jl
Lines 13 to 27 in d0b7ec8
it seems like it does not use the background velocity.
For this use case, should the time step wizard include the background velocity to calculate a new
Δt
?Beta Was this translation helpful? Give feedback.
All reactions