-
Notifications
You must be signed in to change notification settings - Fork 235
zspacing
does not adjust for immersed boundaries
#4435
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
Comments
which underlying function is being called for zspacings? |
Seems to be Oceananigans.jl/src/AbstractOperations/grid_metrics.jl Lines 156 to 160 in 4e38f12
|
Hmmm, I guess it's a bug introduced with zstar, what if you try with function rspacings(grid, ℓx, ℓy, ℓz)
LX, LY, LZ = map(typeof, (ℓx, ℓy, ℓz))
Δx_op = KernelFunctionOperation{LX, LY, LZ}(Δr, grid, ℓx, ℓy, ℓz)
return Δr_op
end |
I think this bug was introduced by the transition to z*, since Oceananigans.jl/src/ImmersedBoundaries/partial_cell_bottom.jl Lines 154 to 205 in 4e38f12
|
I also think that it's warranted to clean up the names in We need to define |
Here's a doubt that I have. In the first example, would we also expect a different result for |
No, the dz is not affected by a grid fitted bottom (because the bottom is fitted), so the dz will not be zero inside the immersed boundary |
the abstraction for the currently implemented immersed boundaries has two components:
if we do have cut cells in the future, we'll need some additional things I think. |
This seems to work. Although your version has a small typo so I'm pasting a working version here for reference: import Oceananigans: rspacings
using Oceananigans.Operators: Δr
function rspacings(grid, ℓx, ℓy, ℓz)
LX, LY, LZ = map(typeof, (ℓx, ℓy, ℓz))
Δr_op = KernelFunctionOperation{LX, LY, LZ}(Δr, grid, ℓx, ℓy, ℓz)
return Δr_op
end Output:
|
I don't think we want |
I'm happy to create a PR that fixes this and adds tests, but can I get some guidance on the best to do so? I'm a bit out of the loop on the current system of defining vertical coordinates and their spacings, so I'm unsure on what the best approach is here. |
Ok, here is a summary of how things work with a time-dependent grid:
For a static grid, |
I noticed that
zspacing
is blind to whether or not the grid has an immersed boundary. For example:I would expect
dz
to be zero in atk=1
(inside the immersed boundary), 1/6 atk=2
and 1/3 atk=3
. @glwagner suggested that this is a bug.The text was updated successfully, but these errors were encountered: