-
Notifications
You must be signed in to change notification settings - Fork 195
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
set! should enforce incompressibility when setting an initial condition for an Incompressible model #1027
Comments
There is a comment about divergent initial conditions here: https://clima.github.io/OceananigansDocumentation/stable/model_setup/setting_initial_conditions/ A related issue is #951 . We could somehow change the behavior of I'm not sure I agree about printing a warning based on some metric diagnosed from the velocity field passed to |
We could use a kwarg like |
How exactly would we enforce incompressibility? Should we perform a pressure correction step? Something like function set!(model; enforce_incompressibility=false, kwargs...
# everything else in `set!`
if enforce_incompressibility
calculate_pressure_correction!(model, 1.0)
pressure_correct_velocities!(model, 1.0)
end
return nothing
end (This syntax will work once #1057 is merged). The "1.0" is a pseudo-timestep that is technically irrelevant (but can't be Oceananigans.jl/src/TimeSteppers/runge_kutta_3.jl Lines 73 to 74 in c35af73
I suppose this projects the user-defined velocity field onto an incompressible field, which is more or less what we want? It seems better than recomputing |
Yeah that seems like a nice solution! Especially as it relies on existing functionality. To recompute w from continuity we'd have to add back in some kernels. |
For example, here:
Oceananigans.jl/examples/two_dimensional_turbulence.jl
Line 38 in 6b2cea3
clearly the initial condition is not incompressible.
set!
should somehow remove the compressible part of the initial conditions and perhaps also print out a warning so that the user knows that the model is not initialized exactly with the fields they provided?The text was updated successfully, but these errors were encountered: