Flow and tide boundaries¶
Flow and tide boundary condition settings (front, back, left, right, tideloc, zs0 and related parameters).
XBeach flow and tide boundary condition parameter configurations.
This module contains models for flow and tide boundary condition parameters.
Flow Boundary Conditions: - FlowBoundaryConditions: Flow boundary types and parameters for shallow water equations
Tide Boundary Conditions: - TideBoundaryConditions: Tide/surge boundary parameters (tideloc, tidetype, zs0, paulrevere)
Note: Wave boundary condition parameters are now defined in data/boundary/base.py and integrated directly into the wave boundary data classes.
FrontType
module-attribute
¶
FrontType = Literal[
"abs_1d",
"abs_2d",
"wall",
"wlevel",
"nonh_1d",
"waveflume",
]
LeftRightType
module-attribute
¶
LeftRightType = Literal[
"neumann", "wall", "no_advec", "neumann_v", "abs_1d"
]
FlowBoundaryConditions
pydantic-model
¶
FlowBoundaryConditions(**data: Any)
Bases: XBeachBaseModel
Flow boundary condition parameters for shallow water equations.
Controls boundary conditions at all domain boundaries: offshore (front), bay side (back), and lateral (left/right). These parameters determine how flow, water levels, and waves interact with the domain boundaries.
The default absorbing-generating (abs_2d) boundary condition is recommended for most applications as it allows waves to pass through with minimal reflection.
Fields:
-
front(Optional[FrontType]) -
back(Optional[BackType]) -
left(Optional[LeftRightType]) -
right(Optional[LeftRightType]) -
lateralwave(Optional[LateralWaveType]) -
nc(Optional[int]) -
highcomp(Optional[bool])
front
pydantic-field
¶
Seaward boundary condition type. abs_1d/abs_2d = absorbing-generating (weakly-reflective), wall = no flux, wlevel = water level specification, nonh_1d = non-hydrostatic, waveflume = flume experiments (XBeach default: abs_2d)
back
pydantic-field
¶
Bay side boundary condition type. wall = no flux, abs_1d/abs_2d = absorbing-generating, wlevel = water level specification (XBeach default: abs_2d)
left
pydantic-field
¶
left: Optional[LeftRightType] = None
Lateral boundary at ny+1. neumann = no gradient, wall = no flux, no_advec = advective terms only, neumann_v = copy velocity from adjacent cell, abs_1d = absorbing (XBeach default: neumann)
right
pydantic-field
¶
right: Optional[LeftRightType] = None
Lateral boundary at 0. neumann = no gradient, wall = no flux, no_advec = advective terms only, neumann_v = copy velocity from adjacent cell, abs_1d = absorbing (XBeach default: neumann)
lateralwave
pydantic-field
¶
lateralwave: Optional[LateralWaveType] = None
Lateral wave boundary type. neumann = zero longshore gradient (may cause shadow zones), wavecrest = zero gradient along wave crest (better for surfbeat), cyclic = periodic boundary (XBeach default: neumann)
nc
pydantic-field
¶
Smoothing distance for estimating mean current (umean) at the offshore boundary, defined as number of grid cells (XBeach default: ny+1)
highcomp
pydantic-field
¶
Switch for high-order compensation at the boundary. Enables additional correction terms for improved accuracy (XBeach default: 0)
check_for_typos
classmethod
¶
Suggest the closest field name for an unknown input key.
A field can be given by its name or, like in pydantic, by its alias.
get
¶
Return the params dict with file fetching for nested components.
This method handles two types of nested components: 1. Components with explicit parameter fields: Need special handling to extract the field value and merge remaining params 2. Discriminated union components: Already flattened by the serializer
The default implementation: - For components with explicit fields: includes that field in return dict - For discriminated unions or leaf components: returns standard params - For parent components: processes XBeachBaseModel children recursively
XBeachDataBlob fields are fetched into destdir and written as the file name under the field name. Override this method only for other file handling, such as fetching several files from a directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
destdir
|
str | Path
|
Directory path for file operations. |
required |
Returns:
| Type | Description |
|---|---|
Flat dictionary of XBeach parameters.
|
|
TideBoundaryConditions
pydantic-model
¶
TideBoundaryConditions(**data: Any)
Bases: XBeachBaseModel
Tide and surge boundary condition parameters.
Controls how tidal and surge water levels are applied at the domain boundaries. XBeach supports up to four time-varying tidal signals applied to the four corners (offshore-right, offshore-left, backshore-left, backshore-right).
The tideloc parameter determines how many tide signals are used: - 0: Uniform water level (zs0 value applied everywhere) - 1: One time-varying signal (applied to offshore boundary) - 2: Two time-varying signals (requires paulrevere to specify application) - 4: Four time-varying signals (one per corner)
Fields:
-
tideloc(Optional[TideLocType]) -
tidetype(Optional[TideTypeType]) -
zs0(Optional[float]) -
paulrevere(Optional[PaulRevereType])
tideloc
pydantic-field
¶
tideloc: Optional[TideLocType] = None
Number of tide/surge boundary locations. 0 = uniform water level (zs0), 1 = one signal at offshore, 2 = two signals (sea/land corners), 4 = four signals (all corners) (XBeach default: 0 if zs0 set, else 2)
tidetype
pydantic-field
¶
tidetype: Optional[TideTypeType] = None
Type of tide boundary condition. instant = instantaneous water level, velocity = velocity boundary, hybrid = combination (XBeach default: velocity)
zs0
pydantic-field
¶
Initial/constant water level (m). Used when tideloc=0 for uniform water level, or as backshore boundary value when tideloc=1 (XBeach default: 0.0)
paulrevere
pydantic-field
¶
paulrevere: Optional[PaulRevereType] = None
Specifies which boundary receives tide signals when tideloc=2. land = one signal to land corners, one to sea corners; sea = opposite assignment (XBeach default: land)
check_for_typos
classmethod
¶
Suggest the closest field name for an unknown input key.
A field can be given by its name or, like in pydantic, by its alias.
get
¶
Return the params dict with file fetching for nested components.
This method handles two types of nested components: 1. Components with explicit parameter fields: Need special handling to extract the field value and merge remaining params 2. Discriminated union components: Already flattened by the serializer
The default implementation: - For components with explicit fields: includes that field in return dict - For discriminated unions or leaf components: returns standard params - For parent components: processes XBeachBaseModel children recursively
XBeachDataBlob fields are fetched into destdir and written as the file name under the field name. Override this method only for other file handling, such as fetching several files from a directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
destdir
|
str | Path
|
Directory path for file operations. |
required |
Returns:
| Type | Description |
|---|---|
Flat dictionary of XBeach parameters.
|
|