-
Notifications
You must be signed in to change notification settings - Fork 186
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
Boundary conditions cannot be enforced with closure = nothing
#1630
Comments
closure = nothing
closure = nothing
Good point, but no-normal flow boundary conditions should still be enforced, even without any closure scheme, right? |
That's a good point ! Yes, we still have "first order" boundary conditions on wall-normal velocity components. Technically we could "enforce" these by "refusing" to update those velocities (but this isn't how the algorithm works, so we do need fill_halo_regions! for wall-normal velocity bcs). |
Glad we agree. If we have a warning maybe we can specify so the user knows no-normal flow is still enforced? |
I think the warning should read
|
That is very clear and accurate. Agreed! |
I understand why |
When you turn off closure you reduce the order of the differential equations and therefore no longer have the freedom to impose anything else but no-normal flow. It is due entirely to the order of the differential equations and not do to whether the boundary conditiosn are flux, gradient or value. Does that make sense? |
Ah, that makes sense. I'd never thought of that... I agree with the suggestion of adding a warning btw |
@francispoulin explained the situation well for Oceananigans uses a weak formulation of PDEs via the finite volume method. We evolve the average value of fields, integrated over a cell volume. In this integral formulation there are two contributions to the tendency of a field: fluxes across cell interfaces (advective and diffusive usually, but also possibly others via user-defined forcing), and interior "sources" (such as pressure gradients, Coriolis forces, gravitational forces). When users invoke Something different happens when A further subtlety is that So we should probably amend the warning to read:
|
Thanks @glwagner for the detailed explanation and putting it context of the finite volume formulation, which is critical to Oceanangians. I'm happy with the new suggestion. It occurs to me that there is some mention of finite volume in the docs, but not really a derivation. If we wanted the user to be able to understand all the details, would it be worth while having the derivation of the finite volume method? If yes I'd be happy to do some of this as I do think it would add some clarity. But only if there is a consensus. |
I definitely agree with that, but if you're looking for consensus, it might be best to create a separate issue to vote this out. |
I'm closing this issue because I'm judging that it's not of current, timely relevance to Oceananigans development. If you would like to make it a higher priority or if you think the issue was closed in error please feel free to re-open. |
In
test_dynamics.jl
, an experiment is set up with inhomogeneous boundary conditions on temperature:Oceananigans.jl/test/test_dynamics.jl
Lines 310 to 312 in f83fce8
while using
closure = nothing
:Oceananigans.jl/test/test_dynamics.jl
Lines 314 to 321 in f83fce8
This is at best misleading --- with
closure = nothing
, boundary conditions are not enforced. It may also be innocuous though, because there is no diffusive flux anywhere -- not only across boundaries.It may in fact make sense to throw a warning when using
closure = nothing
with non-default boundary conditions ("Boundary conditions are not enforced whenisnothing(closure)
").The text was updated successfully, but these errors were encountered: