RobinBoundaryCondition
to complement Gradient
and Value
boundary conditions
#4490
Labels
RobinBoundaryCondition
to complement Gradient
and Value
boundary conditions
#4490
We need to implement
RobinBoundaryCondition
, which is a boundary condition of the formfor two inputs$a$ and $b$ . On a staggered grid and a "right boundary" (eg $$i=N+1$$ ) this condition looks like
which implies a rule for the halo point,
@joernc, @shriyafruitwala
Right now we have two boundary conditions which invoke rules for filling halos:
Gradient
andValue
. The way it's currently implemented, these boundary conditions imply rules for determining the across-boundary gradient, eg:Oceananigans.jl/src/BoundaryConditions/fill_halo_regions_value_gradient.jl
Line 9 in 2dc85f0
for
GradientBoundaryCondition
, wheregetbc
returnsg
for user inputGradientBoundaryCondition(g)
. Another example isValueBoundaryCondition(v)
,Oceananigans.jl/src/BoundaryConditions/fill_halo_regions_value_gradient.jl
Line 12 in 2dc85f0
This implementation has the effect that reconstruction/interpolation across the boundary returns
v
.We can rewrite the algebra for RobinBoundaryCondition to fit this pattern, which (I think) yields
So we can either refactor how boundary conditions are implemented (first formula) or re-use the infrastructure by just adding a line (above formula).
If we want extra credit, we can allow the$a$ and $b$ . I think for that we actually want to refactor
getbc
infrastructure to work for the two Robin valuesgetbc
first --- it's weird thatgetbc
takes in theBoundaryCondition
, when it looks like a simpler implementation would invokeso the first step might be to do this refactor, then implement
RobinBoundaryCondition
.The text was updated successfully, but these errors were encountered: