You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
are redundant with the boundary conditions on the velocity fields. In other words, the pressure boundary conditions depend on the boundary conditions applied to the velocity field. There should not, therefore, be separate boundary condition types for the pressure solver. In particular, periodic boundary conditions on the velocity fields imply periodic boundary conditions on the pressure solver, while non-periodic boundary conditions on the velocity fields imply Neumann boundary conditions for the pressure solver.
The redundant implementation of boundary condition complicates model instantiation (the boundary conditions on the Poisson solver should be inferred from the boundary conditions on the velocity field, rather than specified independently), and is a source of fragility (because a physically invalid combination of boundary conditions on the velocity field and pressure solver can be specified).
The text was updated successfully, but these errors were encountered:
glwagner
changed the title
PoissonBCs are redundant
PoissonBCs for pressure solver are redundant
Jul 11, 2019
Agreed. We could address this when we refactor halo regions to dispatch on boundary conditions. Would then be good to add some code that asserts that the velocity boundary conditions are compatible with the boundary conditions we support (and with each other).
Right. I think consistency checking would be a nice feature. I think that’d be best implemented in the constructor for ModelBoundaryConditions.
When consistent/valid boundary conditions are ensured, we can then safely infer the Poisson pressure solver type from the velocity boundary conditions without the need for an intermediate PoissonBCs type.
The
PoissonBCs
:https://github.com/climate-machine/Oceananigans.jl/blob/c961d3904700e73b1a4aebb71ebcc3f518693014/src/poisson_solvers.jl#L4
are redundant with the boundary conditions on the velocity fields. In other words, the pressure boundary conditions depend on the boundary conditions applied to the velocity field. There should not, therefore, be separate boundary condition types for the pressure solver. In particular, periodic boundary conditions on the velocity fields imply periodic boundary conditions on the pressure solver, while non-periodic boundary conditions on the velocity fields imply Neumann boundary conditions for the pressure solver.
The redundant implementation of boundary condition complicates model instantiation (the boundary conditions on the Poisson solver should be inferred from the boundary conditions on the velocity field, rather than specified independently), and is a source of fragility (because a physically invalid combination of boundary conditions on the velocity field and pressure solver can be specified).
The text was updated successfully, but these errors were encountered: