-
Notifications
You must be signed in to change notification settings - Fork 194
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
static_column_depth
interface
#3841
base: main
Are you sure you want to change the base?
Conversation
ImmersedBoundaries
bottom_height
interface
Correction: |
Is There's a naming issue. We had previously referred to "z" as "height". Usually this doesn't matter but when it does, eg in realistic contexts and using nonlinear equation of state, then we are trying to be consistent with the literature where "z" is the "geopotential height". We can change the user-facing naming and notation for sure but it has to be done carefully and with consensus. I think this PR makes some big changes to notation and language that could have wide-ranging impacts on how we communicate about numerical models. |
|
||
struct GridFittedBottom{H, I} <: AbstractGridFittedBottom{H} | ||
bottom_height :: H | ||
z_bottom :: H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though we want to refer to z
as the coordinate and height as a positive value.
At least, this is the direction we are taking in ClimaOcean where we are distinguishing very carefully between z
and h
or height
.
In this case, this is technically a coordinate, not a height, for example we have now
@inline z_bottom(i, j, ibg::GFBIBG) = @inbounds ibg.immersed_boundary.bottom_height[i, j, 1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I though we want to refer to z as the coordinate and height as a positive value.
Usually "z" is called "geopotential height". In the way it's usually used, height can be positive or negative; the point is that it increases as we go upwards away from the center of the Earth (as opposed to "depth" which increases downwards). What would you call "z" instead? Altitude?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is technically a coordinate, not a height
Another name for z is "height coordinate".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As someone who hasn't used immersed boundaries that much, I always find it a bit confusing that it's called bottom height because it makes me think I'm meant to put in a positive "height" from the bottom of the domain, but I would know that "z" is meant to be from the top
Co-authored-by: Gregory L. Wagner <[email protected]>
validation/multi_region/multi_region_near_global_quarter_degree.jl
Outdated
Show resolved
Hide resolved
@@ -55,6 +55,7 @@ using Oceananigans.ImmersedBoundaries: z_bottom | |||
import Oceananigans.Grids: required_halo_size_x, required_halo_size_y, required_halo_size_z | |||
import Oceananigans.Architectures: on_architecture | |||
|
|||
import Oceananigans.ImmersedBoundaries: z_bottom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's the new rearrangement of the modules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have changed z_bottom to be only in TurbulenceClosures
as it is the only module in which is needed / used and all similar methods (z_top
, depth
, height_above_bottom
...) are defined only there
full_Δz = Δzᶜᶜᶜ(i, j, k, ibg.underlying_grid) | ||
partial_Δz = z - zb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should go in a different PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new numerical bottom height is located at by convention at z⁻ + Δz * (1 - ϵ)
so ϵ * full_Δz
== z - h
removing the necessity of the max. I thought this change can clean up the partial cell code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually, there is a bug here with how the immersed bottom height is computed. I have corrected it
The dependency on OrthogonalSphericalShellGrids here is blocking the progress (the |
Shall we do this? In case we want to do it I have prepared CliMA/OrthogonalSphericalShellGrids.jl#47. |
This PR should be ready to merge |
This PR introduces an interface for
column_height
that returns the height of the water column.This is simply
grid.Lz
in regular grids.For
AbstractGridFittedBottom
immersed grids, the column height is readily read from the immersed boundary, provided that the immersed boundary represents the numerical bottom rather than the physical bottom.Therefore, this PR changes the constructor of the
ImmersedBoundaryGrid
to store the z-coordinate of the last immersed cell. In this way, the bottom height is also uniquely defined forGridFittedBottom
, removing the necessity of having aCenterImmersedCondition
and aInterfaceImmersedCondition
.An immediate application of this interface is in the
SplitExplicitFreeSurface
where the bottom_height was previously stored.