Boundary conditions¶
Boundaries are imposed through ghost cells, set independently per axis with
Config.bc_x and Config.bc_y. In 2D the available kinds are:
|
Meaning |
|---|---|
|
zero-gradient (transmissive): waves leave with little reflection |
|
reflective solid wall: zero normal flux (a closed basin) |
|
open outflow (“waterfall”): water leaves the domain freely, nothing enters |
|
wrap-around |
Note
"dirichlet" (a prescribed state) exists only in the 1D solver via
Config.bc_x_left / bc_x_right. In 2D, prescribed water levels are imposed
with a StageBoundary forcing instead (see
forcings), which is the right tool for tides and storm surge.
Choosing boundaries¶
Closed basin / lake:
wallon all sides.Rainfall runoff:
fallon the downhill edge(s) so runoff leaves the domain;wallelsewhere. Seeexamples/ex04.Idealized wave tests:
extrapolateto let waves exit cleanly, orperiodicfor traveling-wave studies.Coastal surge: an open
extrapolate/fallboundary on the seaward side combined with aStageBoundarythat drives the tide/surge stage on the wet coastline cells.
Discharge inlets¶
A river hydrograph enters through add_inflow(): a set of edge cells, a prescribed discharge \(Q(t)\) split across them by depth, imposed on their ghost cells as a normal unit discharge with the depth taken from the interior. Call it once per inlet.
Sponge and coastal ring¶
The application-scale runs close the outer rectangle with an open-boundary sponge and drive the coastline with a gauge-fed stage ring; both belong to the compressed solver and are described under forcings.
Example¶
from geoswe import Config
cfg = Config(bc_x="fall", bc_y="wall") # drains in x, walls in y
An unknown kind raises when the Config is built. The
compressed mesh does not use these kinds: its edge is
closed by the state stored in its ghost halo.
For distributed runs, interior subdomain boundaries are handled automatically by the MPI halo exchange; only the physical domain edges use these BC kinds (see multi-GPU & MPI).