Skip to content

Physics

Physics and the components it holds: the wave model, bed friction, numerics, constants, vegetation, wave-current interaction and wind settings.

rompy_xbeach.components.physics.physics

XBeach physical processes configuration.

logger module-attribute

logger = logging.getLogger(__name__)

Physics pydantic-model

Physics(**data: Any)

Bases: XBeachBaseModel

XBeach physical processes configuration.

XBeach supports a variety of physical processes from generic, like waves and flow, to very specific, like ship motions and point discharge. Each process can be switched on or off. The commonly used processes are turned on by default.

This class allows configuration of all physical process switches in XBeach. Most fields default to None, meaning XBeach's built-in defaults will be used unless explicitly specified. The exception is wavemodel, which is required — XBeach will not run without a wave model specified.

See https://xbeach.readthedocs.io/en/latest/xbeach_manual.html#physical-processes for more information.

Example

Minimal valid Physics requires a wavemodel:

from rompy_xbeach.components.physics import Physics
from rompy_xbeach.components.physics.wavemodel import Surfbeat

physics = Physics(wavemodel=Surfbeat())

Fields:

Validators:

model_type pydantic-field

model_type: Literal['physics'] = 'physics'

Model type discriminator

wavemodel pydantic-field

wavemodel: Union[Stationary, Surfbeat, Nonh]

Wave model configuration: Stationary, Surfbeat or Nonh. This field is required — XBeach will not run without a wave model.

advection pydantic-field

advection: Optional[bool] = None

Include advection in flow solver (XBeach default: 1)

avalanching pydantic-field

avalanching: Optional[bool] = None

Turn on avalanching (XBeach default: the value of morphology)

bedfriction pydantic-field

Bed friction formulation (XBeach default: manning)

cyclic pydantic-field

cyclic: Optional[bool] = None

Turn on cyclic boundary conditions (XBeach default: 0)

flow pydantic-field

flow: Optional[bool] = None

Turn on flow calculation (XBeach default: 1)

gwflow pydantic-field

gwflow: Optional[bool] = None

Turn on groundwater flow (XBeach default: 0)

lwave pydantic-field

lwave: Optional[bool] = None

Turn on short wave forcing on NLSW equations and boundary conditions (XBeach default: 1)

roller pydantic-field

roller: Optional[Union[bool, Roller]] = None

Switch to enable roller model (XBeach default: 1)

setbathy pydantic-field

setbathy: Optional[bool] = None

Turn on timeseries of prescribed bathy input (XBeach default: 0)

ships pydantic-field

ships: Optional[bool] = None

Turn on ship waves (XBeach default: 0)

single_dir pydantic-field

single_dir: Optional[bool] = None

Turn on stationary model for refraction, surfbeat based on mean direction (XBeach default: 1 for surfbeat on a 2D grid, otherwise 0)

snells pydantic-field

snells: Optional[bool] = None

Turn on Snell's law for wave refraction (XBeach default: 0)

swave pydantic-field

swave: Optional[bool] = None

Turn on short waves (XBeach default: 1)

swrunup pydantic-field

swrunup: Optional[bool] = None

Turn on short wave runup (XBeach default: 0)

vegetation pydantic-field

vegetation: Optional[Union[bool, Vegetation]] = None

Turn on interaction of waves and flow with vegetation (XBeach default: 0)

viscosity pydantic-field

viscosity: Optional[Union[bool, Viscosity]] = None

Include viscosity in flow solver. Can be True/False to enable/disable, or a Viscosity object to enable with custom parameters (XBeach default: 1)

wci pydantic-field

Switch to turn on wave-current interaction (XBeach default: 0)

wind pydantic-field

wind: Optional[Union[bool, Wind]] = None

Include wind in flow solver. Can be True/False to enable/disable, or a Wind object to enable with custom parameters like Cd (XBeach default: 0)

flow_numerics pydantic-field

flow_numerics: Optional[FlowNumerics] = None

Flow numerical parameters (eps, hmin, deltahmin, umin, secorder, etc.)

wave_numerics pydantic-field

wave_numerics: Optional[WaveNumerics] = None

Wave numerical parameters (scheme, maxiter, maxerror, wavint)

constants pydantic-field

constants: Optional[PhysicalConstants] = None

Physical constants (g, rho, depthscale)

coriolis pydantic-field

coriolis: Optional[Coriolis] = None

Coriolis force parameters (lat, wearth)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

swave_must_be_false_if_nonh pydantic-validator

swave_must_be_false_if_nonh() -> Physics

Warn if swave is not False when wavemodel is Nonh.

Note: The legacy nonh parameter is deprecated in XBeach. Use wavemodel=Nonh(...) instead, which outputs wavemodel = nonh.

log_default_enabled_processes pydantic-validator

log_default_enabled_processes() -> Physics

Logging for default-enabled processes that are not explicitly set.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

rompy_xbeach.components.physics.wavemodel

XBeach wavemodel parameter configurations.

This module contains all models used by the Physics.wavemodel field, including:

  • Breaker formulation models (used by wave models)
  • Wave model configurations (Stationary, Surfbeat, Nonh)

Roller pydantic-model

Roller(**data: Any)

Bases: XBeachBaseModel

Roller model configuration.

When used in Physics.roller field, this enables the roller model (roller=1) and allows specification of roller-specific parameters.

Fields:

roller pydantic-field

roller: Literal[True] = True

Enable roller model

beta pydantic-field

beta: Optional[float] = None

Breaker slope coefficient in roller model (XBeach default: 0.08)

rfb pydantic-field

rfb: Optional[bool] = None

Switch to feed back maximum wave surface slope in roller energy balance (XBeach default: 0)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

ShortWaveFriction pydantic-model

ShortWaveFriction(**data: Any)

Bases: XBeachBaseModel

Short wave friction model configuration.

XBeach allows the user to specify a short wave friction coefficient that is used to calculate the dissipation of short wave energy due to bottom friction. This friction coefficient can be specified as a constant value or spatially varying through a file.

It is set in the wavfric field of a breaker formulation. XBeach reads the parameters fw and fwfile.

See https://xbeach.readthedocs.io/en/latest/xbeach_manual.html#bottom-friction for more information.

Fields:

Validators:

fw pydantic-field

fw: Optional[float] = None

Wave friction coefficient used in Reniers formulation for dissipation (XBeach default: 0.0)

fwfile pydantic-field

fwfile: Optional[XBeachDataBlob] = None

File with spatially varying wave friction coefficients, used instead of fw

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_mutually_exclusive pydantic-validator

check_mutually_exclusive()

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

WaveDissipation pydantic-model

WaveDissipation(**data: Any)

Bases: XBeachBaseModel

Base class for wave dissipation formulations with common breaking parameters.

These parameters apply to all breaker formulations and control the dissipation process characteristics such as delay, viscosity effects, and wave runup.

Fields:

breakerdelay pydantic-field

breakerdelay: Optional[float] = None

Switch to enable breaker delay model (XBeach default: 1.0)

breakviscfac pydantic-field

breakviscfac: Optional[float] = None

Factor to increase viscosity during breaking (XBeach default: 1.5)

breakvisclen pydantic-field

breakvisclen: Optional[float] = None

Ratio between local depth and length scale in extra breaking viscosity (XBeach default: 1.0)

delta pydantic-field

delta: Optional[float] = None

Fraction of wave height to add to water depth (XBeach default: 0.0)

facrun pydantic-field

facrun: Optional[float] = None

Calibration coefficient for short wave runup (XBeach default: 1.0)

facsd pydantic-field

facsd: Optional[float] = None

Fraction of the local wave length to use for shoaling delay depth (XBeach default: 1.0)

fwcutoff pydantic-field

fwcutoff: Optional[float] = None

Depth greater than which the bed friction factor is not applied (XBeach default: 1000.0 m)

gammax pydantic-field

gammax: Optional[float] = None

Maximum ratio of wave height to water depth (XBeach default: 2.0)

shoaldelay pydantic-field

shoaldelay: Optional[bool] = None

Switch to enable shoaling delay (XBeach default: 0)

wavfric pydantic-field

wavfric: Optional[ShortWaveFriction] = None

Short wave friction specification

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

Janssen pydantic-model

Janssen(**data: Any)

Bases: WaveDissipation

Janssen & Battjes (2007) breaker model configuration.

Fields:

model_type pydantic-field

model_type: Literal['janssen'] = 'janssen'

Model type discriminator

params property

params: dict

Return the XBeach parameters as a flat dictionary.

breakerdelay pydantic-field

breakerdelay: Optional[float] = None

Switch to enable breaker delay model (XBeach default: 1.0)

breakviscfac pydantic-field

breakviscfac: Optional[float] = None

Factor to increase viscosity during breaking (XBeach default: 1.5)

breakvisclen pydantic-field

breakvisclen: Optional[float] = None

Ratio between local depth and length scale in extra breaking viscosity (XBeach default: 1.0)

delta pydantic-field

delta: Optional[float] = None

Fraction of wave height to add to water depth (XBeach default: 0.0)

facrun pydantic-field

facrun: Optional[float] = None

Calibration coefficient for short wave runup (XBeach default: 1.0)

facsd pydantic-field

facsd: Optional[float] = None

Fraction of the local wave length to use for shoaling delay depth (XBeach default: 1.0)

fwcutoff pydantic-field

fwcutoff: Optional[float] = None

Depth greater than which the bed friction factor is not applied (XBeach default: 1000.0 m)

gammax pydantic-field

gammax: Optional[float] = None

Maximum ratio of wave height to water depth (XBeach default: 2.0)

shoaldelay pydantic-field

shoaldelay: Optional[bool] = None

Switch to enable shoaling delay (XBeach default: 0)

wavfric pydantic-field

wavfric: Optional[ShortWaveFriction] = None

Short wave friction specification

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

Baldock pydantic-model

Baldock(**data: Any)

Bases: WaveDissipation

Baldock breaker model configuration.

Fields:

model_type pydantic-field

model_type: Literal['baldock'] = 'baldock'

Model type discriminator

gamma pydantic-field

gamma: Optional[float] = None

Breaker parameter gamma (XBeach default: 0.78)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

breakerdelay pydantic-field

breakerdelay: Optional[float] = None

Switch to enable breaker delay model (XBeach default: 1.0)

breakviscfac pydantic-field

breakviscfac: Optional[float] = None

Factor to increase viscosity during breaking (XBeach default: 1.5)

breakvisclen pydantic-field

breakvisclen: Optional[float] = None

Ratio between local depth and length scale in extra breaking viscosity (XBeach default: 1.0)

delta pydantic-field

delta: Optional[float] = None

Fraction of wave height to add to water depth (XBeach default: 0.0)

facrun pydantic-field

facrun: Optional[float] = None

Calibration coefficient for short wave runup (XBeach default: 1.0)

facsd pydantic-field

facsd: Optional[float] = None

Fraction of the local wave length to use for shoaling delay depth (XBeach default: 1.0)

fwcutoff pydantic-field

fwcutoff: Optional[float] = None

Depth greater than which the bed friction factor is not applied (XBeach default: 1000.0 m)

gammax pydantic-field

gammax: Optional[float] = None

Maximum ratio of wave height to water depth (XBeach default: 2.0)

shoaldelay pydantic-field

shoaldelay: Optional[bool] = None

Switch to enable shoaling delay (XBeach default: 0)

wavfric pydantic-field

wavfric: Optional[ShortWaveFriction] = None

Short wave friction specification

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

Roelvink1 pydantic-model

Roelvink1(**data: Any)

Bases: WaveDissipation

Roelvink (1993a) breaker model configuration.

Fields:

model_type pydantic-field

model_type: Literal['roelvink1'] = 'roelvink1'

Model type discriminator

alpha pydantic-field

alpha: Optional[float] = None

Wave dissipation coefficient (XBeach default: 1.38)

gamma pydantic-field

gamma: Optional[float] = None

Breaker parameter gamma (XBeach default: 0.55)

n pydantic-field

n: Optional[float] = None

Power in roelvink dissipation model (Xbeach default: 10.0)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

breakerdelay pydantic-field

breakerdelay: Optional[float] = None

Switch to enable breaker delay model (XBeach default: 1.0)

breakviscfac pydantic-field

breakviscfac: Optional[float] = None

Factor to increase viscosity during breaking (XBeach default: 1.5)

breakvisclen pydantic-field

breakvisclen: Optional[float] = None

Ratio between local depth and length scale in extra breaking viscosity (XBeach default: 1.0)

delta pydantic-field

delta: Optional[float] = None

Fraction of wave height to add to water depth (XBeach default: 0.0)

facrun pydantic-field

facrun: Optional[float] = None

Calibration coefficient for short wave runup (XBeach default: 1.0)

facsd pydantic-field

facsd: Optional[float] = None

Fraction of the local wave length to use for shoaling delay depth (XBeach default: 1.0)

fwcutoff pydantic-field

fwcutoff: Optional[float] = None

Depth greater than which the bed friction factor is not applied (XBeach default: 1000.0 m)

gammax pydantic-field

gammax: Optional[float] = None

Maximum ratio of wave height to water depth (XBeach default: 2.0)

shoaldelay pydantic-field

shoaldelay: Optional[bool] = None

Switch to enable shoaling delay (XBeach default: 0)

wavfric pydantic-field

wavfric: Optional[ShortWaveFriction] = None

Short wave friction specification

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

Roelvink2 pydantic-model

Roelvink2(**data: Any)

Bases: Roelvink1

Roelvink (1993a) extended breaker model configuration.

Fields:

model_type pydantic-field

model_type: Literal['roelvink2'] = 'roelvink2'

Model type discriminator

params property

params: dict

Return the XBeach parameters as a flat dictionary.

breakerdelay pydantic-field

breakerdelay: Optional[float] = None

Switch to enable breaker delay model (XBeach default: 1.0)

breakviscfac pydantic-field

breakviscfac: Optional[float] = None

Factor to increase viscosity during breaking (XBeach default: 1.5)

breakvisclen pydantic-field

breakvisclen: Optional[float] = None

Ratio between local depth and length scale in extra breaking viscosity (XBeach default: 1.0)

delta pydantic-field

delta: Optional[float] = None

Fraction of wave height to add to water depth (XBeach default: 0.0)

facrun pydantic-field

facrun: Optional[float] = None

Calibration coefficient for short wave runup (XBeach default: 1.0)

facsd pydantic-field

facsd: Optional[float] = None

Fraction of the local wave length to use for shoaling delay depth (XBeach default: 1.0)

fwcutoff pydantic-field

fwcutoff: Optional[float] = None

Depth greater than which the bed friction factor is not applied (XBeach default: 1000.0 m)

gammax pydantic-field

gammax: Optional[float] = None

Maximum ratio of wave height to water depth (XBeach default: 2.0)

shoaldelay pydantic-field

shoaldelay: Optional[bool] = None

Switch to enable shoaling delay (XBeach default: 0)

wavfric pydantic-field

wavfric: Optional[ShortWaveFriction] = None

Short wave friction specification

alpha pydantic-field

alpha: Optional[float] = None

Wave dissipation coefficient (XBeach default: 1.38)

gamma pydantic-field

gamma: Optional[float] = None

Breaker parameter gamma (XBeach default: 0.55)

n pydantic-field

n: Optional[float] = None

Power in roelvink dissipation model (Xbeach default: 10.0)

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

RoelvinkDaly pydantic-model

RoelvinkDaly(**data: Any)

Bases: WaveDissipation

Daly et al. (2010) breaker model configuration.

Fields:

model_type pydantic-field

model_type: Literal['roelvink_daly'] = 'roelvink_daly'

Model type discriminator

gamma2 pydantic-field

gamma2: Optional[float] = None

End of breaking parameter (XBeach default: 0.34)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

breakerdelay pydantic-field

breakerdelay: Optional[float] = None

Switch to enable breaker delay model (XBeach default: 1.0)

breakviscfac pydantic-field

breakviscfac: Optional[float] = None

Factor to increase viscosity during breaking (XBeach default: 1.5)

breakvisclen pydantic-field

breakvisclen: Optional[float] = None

Ratio between local depth and length scale in extra breaking viscosity (XBeach default: 1.0)

delta pydantic-field

delta: Optional[float] = None

Fraction of wave height to add to water depth (XBeach default: 0.0)

facrun pydantic-field

facrun: Optional[float] = None

Calibration coefficient for short wave runup (XBeach default: 1.0)

facsd pydantic-field

facsd: Optional[float] = None

Fraction of the local wave length to use for shoaling delay depth (XBeach default: 1.0)

fwcutoff pydantic-field

fwcutoff: Optional[float] = None

Depth greater than which the bed friction factor is not applied (XBeach default: 1000.0 m)

gammax pydantic-field

gammax: Optional[float] = None

Maximum ratio of wave height to water depth (XBeach default: 2.0)

shoaldelay pydantic-field

shoaldelay: Optional[bool] = None

Switch to enable shoaling delay (XBeach default: 0)

wavfric pydantic-field

wavfric: Optional[ShortWaveFriction] = None

Short wave friction specification

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

Stationary pydantic-model

Stationary(**data: Any)

Bases: XBeachBaseModel

Stationary wave model configuration.

Efficiently solves wave-averaged equations but neglects infragravity waves. Useful for conditions where incident waves are relatively small and/or short.

Fields:

model_type pydantic-field

model_type: Literal['stationary'] = 'stationary'

Model type discriminator

breaktype pydantic-field

breaktype: Optional[Union[Baldock, Janssen]] = None

Type of breaker formulation for the stationary wave model

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

Surfbeat pydantic-model

Surfbeat(**data: Any)

Bases: XBeachBaseModel

Surfbeat (instationary) wave model configuration.

Resolves short wave variations on the wave group scale (short wave envelope) and the long waves associated with them. This is the XBeach default mode.

Fields:

model_type pydantic-field

model_type: Literal['surfbeat'] = 'surfbeat'

Model type discriminator

breaktype pydantic-field

breaktype: Optional[
    Union[Roelvink1, Roelvink2, RoelvinkDaly]
] = None

Type of breaker formulation for the surfbeat wave model

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

Nonh pydantic-model

Nonh(**data: Any)

Bases: XBeachBaseModel

Non-hydrostatic (wave-resolving) wave model configuration (XBeach Table 42).

Uses non-linear shallow water equations with a pressure correction term, allowing modeling of propagation and decay of individual waves.

Wave breaking is implemented using the Hydrostatic Front Approximation (HFA), where the non-hydrostatic pressure term is disabled when waves exceed a certain steepness, after which bore-like breaking takes over.

Note

XBeach has a legacy nonh parameter (0/1 switch) that is deprecated. The XBeach source code shows that if nonh=1 is specified, XBeach logs a warning and internally sets wavemodel=nonh. Setting both nonh=1 and a different wavemodel causes XBeach to halt with an error.

Use this Nonh class via Physics(wavemodel=Nonh(...)) instead of the legacy nonh parameter. This outputs wavemodel = nonh in params.txt.

These are advanced options and it is recommended not to change them unless you have specific requirements.

References

Smit et al. (2014), McCall et al. (2014), Zijlema et al. (2011)

Fields:

model_type pydantic-field

model_type: Literal['nonh'] = 'nonh'

Model type discriminator

Topt pydantic-field

Topt: Optional[float] = None

Absolute period to optimize coefficient (XBeach default: 10.0 s)

breakviscfac pydantic-field

breakviscfac: Optional[float] = None

Factor to increase viscosity during breaking (XBeach default: 1.5)

breakvisclen pydantic-field

breakvisclen: Optional[float] = None

Ratio between local depth and length scale in extra breaking viscosity (XBeach default: 1.0)

dispc pydantic-field

dispc: Optional[float] = None

Coefficient in front of the vertical pressure gradient (XBeach default: -1.0)

kdmin pydantic-field

kdmin: Optional[float] = None

Minimum value of kd (pi/dx > min(kd)) (XBeach default: 0.0)

maxbrsteep pydantic-field

maxbrsteep: Optional[float] = None

Maximum wave steepness criterium for breaking (XBeach default: 0.4)

nhbreaker pydantic-field

nhbreaker: Optional[int] = None

Non-hydrostatic breaker model (XBeach default: 2)

nhlay pydantic-field

nhlay: Optional[float] = None

Layer distribution in the nonhydrostatic model (XBeach default: 0.33)

nonhq3d pydantic-field

nonhq3d: Optional[bool] = None

Turn on reduced two-layer non-hydrostatic model for improved dispersive behavior (XBeach default: 0)

reformsteep pydantic-field

reformsteep: Optional[float] = None

Wave steepness criterium to reform after breaking. XBeach default: 0.25 * maxbrsteep

secbrsteep pydantic-field

secbrsteep: Optional[float] = None

Secondary maximum wave steepness criterium. XBeach default: 0.5 * maxbrsteep

solver pydantic-field

solver: Optional[Literal['sip', 'tridiag']] = None

Solver used to solve the linear system (XBeach default: tridiag)

solver_acc pydantic-field

solver_acc: Optional[float] = None

Accuracy with respect to the right-hand side used in termination criterion: ||b-ax|| < acc*||b|| (XBeach default: 0.005)

solver_maxit pydantic-field

solver_maxit: Optional[int] = None

Maximum number of iterations in the linear sip solver (XBeach default: 30)

solver_urelax pydantic-field

solver_urelax: Optional[float] = None

Underrelaxation parameter (XBeach default: 0.92)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

rompy_xbeach.components.physics.friction

XBeach bed friction parameter configurations.

This module contains models for bed friction formulations used to calculate bed shear stress in the shallow water equations.

logger module-attribute

logger = logging.getLogger(__name__)

HorizontalViscosity module-attribute

HorizontalViscosity = Viscosity

Viscosity pydantic-model

Viscosity(**data: Any)

Bases: XBeachBaseModel

Horizontal viscosity configuration.

XBeach uses the Smagorinsky (1963) model by default to compute horizontal viscosity, accounting for momentum exchange at spatial scales smaller than the computational grid. Alternatively, a user-defined constant viscosity can be specified.

The nuh parameter has dual meaning depending on smag: - If smag=1 (default): nuh is the Smagorinsky constant (default: 0.1) - If smag=0: nuh is the horizontal background viscosity in m²/s

When this class is used in Physics.viscosity, it automatically enables viscosity in the flow solver (viscosity=1).

References

Smagorinsky, J. (1963). General circulation experiments with the primitive equations: I. The basic experiment. Monthly weather review, 91(3), 99-164.

Fields:

Validators:

viscosity pydantic-field

viscosity: Literal[True] = True

Enable viscosity in flow solver

smag pydantic-field

smag: Optional[bool] = None

Switch for Smagorinsky subgrid model for viscosity. If enabled (1), nuh is the Smagorinsky constant. If disabled (0), nuh is the constant horizontal viscosity (XBeach default: 1)

nuh pydantic-field

nuh: Optional[float] = None

Horizontal viscosity parameter. Meaning depends on smag: If smag=1: Smagorinsky constant (dimensionless, XBeach default: 0.1). If smag=0: Horizontal background viscosity (m2/s, XBeach default: 0.1)

nuhfac pydantic-field

nuhfac: Optional[float] = None

Viscosity switch for roller induced turbulent horizontal viscosity (XBeach default: 1.0)

nuhv pydantic-field

nuhv: Optional[float] = None

Longshore viscosity enhancement factor, following Svendsen (XBeach default: 1.0)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

validate_viscosity_consistency pydantic-validator

validate_viscosity_consistency() -> Viscosity

Validate that viscosity parameters are used consistently.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

FrictionModifiers pydantic-model

FrictionModifiers(**data: Any)

Bases: XBeachBaseModel

Mixin class for XBeach-G friction modification parameters.

These parameters apply to all friction formulations and modify the bed shear stress calculation through acceleration, infiltration, and turbulence effects.

Fields:

friction_acceleration pydantic-field

friction_acceleration: Optional[
    Literal["none", "mccall", "nielsen"]
] = None

Turn on or off the effect of acceleration on bed roughness. Applies to all friction formulations (XBeach default: none). Options: none, mccall, nielsen

friction_infiltration pydantic-field

friction_infiltration: Optional[bool] = None

Turn on or off the effect of infiltration on bed roughness following Conley and Inman. Applies to all friction formulations (XBeach default: 0)

friction_turbulence pydantic-field

friction_turbulence: Optional[bool] = None

Turn on or off the effect of turbulence on bed roughness following Reniers and van Thiel. Applies to all friction formulations (XBeach default: 0)

gamma_turb pydantic-field

gamma_turb: Optional[float] = None

Calibration factor for turbulence contribution to bed roughness (XBeach default: 1.0)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

BedFriction pydantic-model

BedFriction(**data: Any)

Bases: FrictionModifiers

Base class for bed friction formulations with common parameters.

Most bed friction formulations allow specification of a friction coefficient either as a single value or spatially varying via a file. Additional parameters control depth cutoffs and XBeach-G specific friction modifications that apply to all friction formulations.

Fields:

Validators:

bedfriccoef pydantic-field

bedfriccoef: Optional[float] = None

Bed friction coefficient. The default value depends on the formulation: chezy=55 m^(1/2)/s, cf=0.003 (-), manning=0.02 s/m^(1/3), white-colebrook=0.01 m.

bedfricfile pydantic-field

bedfricfile: Optional[XBeachDataBlob] = None

Bed friction file with spatially varying friction coefficients. If specified, overrides bedfriccoef.

params property

params: dict

Return the XBeach parameters as a flat dictionary.

friction_acceleration pydantic-field

friction_acceleration: Optional[
    Literal["none", "mccall", "nielsen"]
] = None

Turn on or off the effect of acceleration on bed roughness. Applies to all friction formulations (XBeach default: none). Options: none, mccall, nielsen

friction_infiltration pydantic-field

friction_infiltration: Optional[bool] = None

Turn on or off the effect of infiltration on bed roughness following Conley and Inman. Applies to all friction formulations (XBeach default: 0)

friction_turbulence pydantic-field

friction_turbulence: Optional[bool] = None

Turn on or off the effect of turbulence on bed roughness following Reniers and van Thiel. Applies to all friction formulations (XBeach default: 0)

gamma_turb pydantic-field

gamma_turb: Optional[float] = None

Calibration factor for turbulence contribution to bed roughness (XBeach default: 1.0)

check_mutually_exclusive pydantic-validator

check_mutually_exclusive()

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

Cf pydantic-model

Cf(**data: Any)

Bases: BedFriction

Dimensionless friction coefficient formulation.

Uses a constant dimensionless friction coefficient (c_f) to calculate bed shear stress. XBeach default bedfriccoef: 0.003 (range: 0.001-0.1).

Fields:

Validators:

model_type pydantic-field

model_type: Literal['cf'] = 'cf'

Model type discriminator

params property

params: dict

Return the XBeach parameters as a flat dictionary.

friction_acceleration pydantic-field

friction_acceleration: Optional[
    Literal["none", "mccall", "nielsen"]
] = None

Turn on or off the effect of acceleration on bed roughness. Applies to all friction formulations (XBeach default: none). Options: none, mccall, nielsen

friction_infiltration pydantic-field

friction_infiltration: Optional[bool] = None

Turn on or off the effect of infiltration on bed roughness following Conley and Inman. Applies to all friction formulations (XBeach default: 0)

friction_turbulence pydantic-field

friction_turbulence: Optional[bool] = None

Turn on or off the effect of turbulence on bed roughness following Reniers and van Thiel. Applies to all friction formulations (XBeach default: 0)

gamma_turb pydantic-field

gamma_turb: Optional[float] = None

Calibration factor for turbulence contribution to bed roughness (XBeach default: 1.0)

bedfriccoef pydantic-field

bedfriccoef: Optional[float] = None

Bed friction coefficient. The default value depends on the formulation: chezy=55 m^(1/2)/s, cf=0.003 (-), manning=0.02 s/m^(1/3), white-colebrook=0.01 m.

bedfricfile pydantic-field

bedfricfile: Optional[XBeachDataBlob] = None

Bed friction file with spatially varying friction coefficients. If specified, overrides bedfriccoef.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

check_mutually_exclusive pydantic-validator

check_mutually_exclusive()

Chezy pydantic-model

Chezy(**data: Any)

Bases: BedFriction

Chezy bed friction formulation.

Uses the Chezy coefficient (C) to calculate bed shear stress. A typical Chezy value is in the order of 55 m^(1/2)/s. XBeach default bedfriccoef: 55 m^(1/2)/s (range: 20-100).

Fields:

Validators:

model_type pydantic-field

model_type: Literal['chezy'] = 'chezy'

Model type discriminator

params property

params: dict

Return the XBeach parameters as a flat dictionary.

friction_acceleration pydantic-field

friction_acceleration: Optional[
    Literal["none", "mccall", "nielsen"]
] = None

Turn on or off the effect of acceleration on bed roughness. Applies to all friction formulations (XBeach default: none). Options: none, mccall, nielsen

friction_infiltration pydantic-field

friction_infiltration: Optional[bool] = None

Turn on or off the effect of infiltration on bed roughness following Conley and Inman. Applies to all friction formulations (XBeach default: 0)

friction_turbulence pydantic-field

friction_turbulence: Optional[bool] = None

Turn on or off the effect of turbulence on bed roughness following Reniers and van Thiel. Applies to all friction formulations (XBeach default: 0)

gamma_turb pydantic-field

gamma_turb: Optional[float] = None

Calibration factor for turbulence contribution to bed roughness (XBeach default: 1.0)

bedfriccoef pydantic-field

bedfriccoef: Optional[float] = None

Bed friction coefficient. The default value depends on the formulation: chezy=55 m^(1/2)/s, cf=0.003 (-), manning=0.02 s/m^(1/3), white-colebrook=0.01 m.

bedfricfile pydantic-field

bedfricfile: Optional[XBeachDataBlob] = None

Bed friction file with spatially varying friction coefficients. If specified, overrides bedfriccoef.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

check_mutually_exclusive pydantic-validator

check_mutually_exclusive()

Manning pydantic-model

Manning(**data: Any)

Bases: BedFriction

Manning bed friction formulation.

Uses the Manning coefficient (n) to calculate bed shear stress. Manning can be seen as a depth-dependent Chezy value. A typical Manning value is in the order of 0.02 s/m^(1/3). XBeach default bedfriccoef: 0.02 s/m^(1/3) (range: 0.01-0.05).

This is the default XBeach bed friction formulation.

Fields:

Validators:

model_type pydantic-field

model_type: Literal['manning'] = 'manning'

Model type discriminator

mincf pydantic-field

mincf: Optional[float] = None

Minimum dimensionless friction coefficient for Manning formulation (XBeach default: 0)

maxcf pydantic-field

maxcf: Optional[float] = None

Maximum dimensionless friction coefficient for Manning formulation (XBeach default: 0.04)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

friction_acceleration pydantic-field

friction_acceleration: Optional[
    Literal["none", "mccall", "nielsen"]
] = None

Turn on or off the effect of acceleration on bed roughness. Applies to all friction formulations (XBeach default: none). Options: none, mccall, nielsen

friction_infiltration pydantic-field

friction_infiltration: Optional[bool] = None

Turn on or off the effect of infiltration on bed roughness following Conley and Inman. Applies to all friction formulations (XBeach default: 0)

friction_turbulence pydantic-field

friction_turbulence: Optional[bool] = None

Turn on or off the effect of turbulence on bed roughness following Reniers and van Thiel. Applies to all friction formulations (XBeach default: 0)

gamma_turb pydantic-field

gamma_turb: Optional[float] = None

Calibration factor for turbulence contribution to bed roughness (XBeach default: 1.0)

bedfriccoef pydantic-field

bedfriccoef: Optional[float] = None

Bed friction coefficient. The default value depends on the formulation: chezy=55 m^(1/2)/s, cf=0.003 (-), manning=0.02 s/m^(1/3), white-colebrook=0.01 m.

bedfricfile pydantic-field

bedfricfile: Optional[XBeachDataBlob] = None

Bed friction file with spatially varying friction coefficients. If specified, overrides bedfriccoef.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

check_mutually_exclusive pydantic-validator

check_mutually_exclusive()

WhiteColebrook pydantic-model

WhiteColebrook(**data: Any)

Bases: BedFriction

White-Colebrook bed friction formulation.

Uses the geometrical roughness of Nikuradse (k_s) to calculate bed shear stress. The White-Colebrook formulation has a log relation with the water depth. A typical k_s value is in the order of 0.01 - 0.15 m. XBeach default bedfriccoef: 0.01 m (range: 3.5e-5-0.9).

Fields:

Validators:

model_type pydantic-field

model_type: Literal['white-colebrook'] = 'white-colebrook'

Model type discriminator

mincf pydantic-field

mincf: Optional[float] = None

Minimum dimensionless friction coefficient for White-Colebrook formulation (XBeach default: 0)

maxcf pydantic-field

maxcf: Optional[float] = None

Maximum dimensionless friction coefficient for White-Colebrook formulation (XBeach default: 0.04)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

friction_acceleration pydantic-field

friction_acceleration: Optional[
    Literal["none", "mccall", "nielsen"]
] = None

Turn on or off the effect of acceleration on bed roughness. Applies to all friction formulations (XBeach default: none). Options: none, mccall, nielsen

friction_infiltration pydantic-field

friction_infiltration: Optional[bool] = None

Turn on or off the effect of infiltration on bed roughness following Conley and Inman. Applies to all friction formulations (XBeach default: 0)

friction_turbulence pydantic-field

friction_turbulence: Optional[bool] = None

Turn on or off the effect of turbulence on bed roughness following Reniers and van Thiel. Applies to all friction formulations (XBeach default: 0)

gamma_turb pydantic-field

gamma_turb: Optional[float] = None

Calibration factor for turbulence contribution to bed roughness (XBeach default: 1.0)

bedfriccoef pydantic-field

bedfriccoef: Optional[float] = None

Bed friction coefficient. The default value depends on the formulation: chezy=55 m^(1/2)/s, cf=0.003 (-), manning=0.02 s/m^(1/3), white-colebrook=0.01 m.

bedfricfile pydantic-field

bedfricfile: Optional[XBeachDataBlob] = None

Bed friction file with spatially varying friction coefficients. If specified, overrides bedfriccoef.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

check_mutually_exclusive pydantic-validator

check_mutually_exclusive()

WhiteColebrookGrainsize pydantic-model

WhiteColebrookGrainsize(**data: Any)

Bases: FrictionModifiers

White-Colebrook grain size bed friction formulation.

Based on the relation between the D90 of the top bed layer and the geometrical roughness of Nikuradse. The user does not have to specify a value for the bed friction coefficient as it is computed from the sediment grain size distribution.

This formulation is the XBeach-G default. Like other friction formulations, it supports friction limits (mincf/maxcf) and inherits XBeach-G friction modifiers (fwcutoff, acceleration, infiltration, turbulence) from FrictionModifiers.

Note: This formulation does NOT use bedfriccoef or bedfricfile as it computes friction from the sediment grain size (D90).

Fields:

model_type pydantic-field

model_type: Literal["white-colebrook-grainsize"] = (
    "white-colebrook-grainsize"
)

Model type discriminator

mincf pydantic-field

mincf: Optional[float] = None

Minimum dimensionless friction coefficient for grain size formulation (XBeach default: 0)

maxcf pydantic-field

maxcf: Optional[float] = None

Maximum dimensionless friction coefficient for grain size formulation (XBeach default: 0.04)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

friction_acceleration pydantic-field

friction_acceleration: Optional[
    Literal["none", "mccall", "nielsen"]
] = None

Turn on or off the effect of acceleration on bed roughness. Applies to all friction formulations (XBeach default: none). Options: none, mccall, nielsen

friction_infiltration pydantic-field

friction_infiltration: Optional[bool] = None

Turn on or off the effect of infiltration on bed roughness following Conley and Inman. Applies to all friction formulations (XBeach default: 0)

friction_turbulence pydantic-field

friction_turbulence: Optional[bool] = None

Turn on or off the effect of turbulence on bed roughness following Reniers and van Thiel. Applies to all friction formulations (XBeach default: 0)

gamma_turb pydantic-field

gamma_turb: Optional[float] = None

Calibration factor for turbulence contribution to bed roughness (XBeach default: 1.0)

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

rompy_xbeach.components.physics.numerics

XBeach numerical scheme parameter configurations.

This module contains models for numerical scheme parameters used in wave and non-hydrostatic computations.

logger module-attribute

logger = logging.getLogger(__name__)

WaveNumerics pydantic-model

WaveNumerics(**data: Any)

Bases: XBeachBaseModel

Wave action balance numerical parameters.

These parameters control the numerical aspects of the wave action balance solver, including the numerical scheme and convergence criteria.

The Warming and Beam (1976) scheme is used by default to overcome undesired effects of steepening of wave groups through a small additional diffusion term.

References

Beam, R. M., & Warming, R. F. (1976). An implicit finite-difference algorithm for hyperbolic systems in conservation-law form. Journal of computational physics, 22(1), 87-110.

Fields:

scheme pydantic-field

scheme: Optional[
    Literal[
        "upwind_1", "lax_wendroff", "upwind_2", "warmbeam"
    ]
] = None

Numerical scheme for wave propagation. Options: upwind_1 (first-order upwind), lax_wendroff (Lax-Wendroff), upwind_2 (second-order upwind), warmbeam (Warming-Beam) (XBeach default: warmbeam)

maxiter pydantic-field

maxiter: Optional[int] = None

Maximum number of iterations in wave stationary solver (XBeach default: 500)

maxerror pydantic-field

maxerror: Optional[float] = None

Maximum wave height error in wave stationary iteration (XBeach default: 0.0005 m)

wavint pydantic-field

wavint: Optional[float] = None

Interval between wave module calls in seconds (only in stationary wave mode, XBeach default: 600.0 s)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

FlowNumerics pydantic-model

FlowNumerics(**data: Any)

Bases: XBeachBaseModel

Flow numerical parameters.

These parameters control numerical aspects of the shallow water equations, particularly handling of very shallow water and wet/dry transitions.

The threshold parameters (eps, hmin, umin) prevent unrealistic behavior in shallow water by setting minimum values for depth and velocity calculations.

Fields:

Validators:

eps pydantic-field

eps: Optional[float] = None

Threshold water depth above which cells are considered wet (XBeach default: 0.005 m)

epsi pydantic-field

epsi: Optional[float] = None

Ratio of mean current to time varying current through offshore boundary (XBeach default: -1.0)

eps_sd pydantic-field

eps_sd: Optional[float] = None

Threshold velocity difference to determine conservation of energy head versus momentum (XBeach default: 0.5 m/s)

hmin pydantic-field

hmin: Optional[float] = None

Threshold water depth above which Stokes drift is included (XBeach default: 0.0 m). See also deltahmin and oldhmin

oldhu pydantic-field

oldhu: Optional[bool] = None

Switch to enable old hu calculation (XBeach default: 0)

secorder pydantic-field

secorder: Optional[bool] = None

Use second order corrections to advection/non-linear terms based on MacCormack scheme (XBeach default: 0)

umin pydantic-field

umin: Optional[float] = None

Threshold velocity for upwind velocity detection and for vmag2 in equilibrium sediment concentration (XBeach default: 0.0 m/s)

deltahmin pydantic-field

deltahmin: Optional[float] = None

Dimensionless coefficient to determine the threshold water depth above which Stokes drift is included (XBeach default: 0.1)

oldhmin pydantic-field

oldhmin: Optional[bool] = None

Switch to apply the old hmin parameter instead of deltahmin. If 1, hmin is used directly as minimum water depth (XBeach default: 0)

defuse pydantic-field

defuse: Optional[bool] = None

Switch to enable diffusion in the flow solver to prevent numerical instabilities (XBeach default: 1)

dtset pydantic-field

dtset: Optional[float] = None

Fixed timestep (s). If > 0, overrides automatic timestep calculation. Use with caution - may cause instabilities (XBeach default: 0.0, automatic)

maxdtfac pydantic-field

maxdtfac: Optional[float] = None

Maximum factor for timestep increase in explosion prevention mechanism. For surfbeat/stationary: 10-200 (default 50). For nonh: 100-1000 (default 500)

cfl pydantic-field

cfl: Optional[float] = None

Maximum Courant-Friedrichs-Lewy number for timestep control. Lower values give more stability but slower computation (XBeach default: 0.7)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

warn_if_oldhmin_and_deltahmin pydantic-validator

warn_if_oldhmin_and_deltahmin()

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

rompy_xbeach.components.physics.constants

XBeach physical constants and Coriolis force parameter configurations.

This module contains models for physical constants and Coriolis force parameters.

PhysicalConstants pydantic-model

PhysicalConstants(**data: Any)

Bases: XBeachBaseModel

Physical constants used in XBeach computations.

These fundamental physical constants are used throughout XBeach calculations. The depthscale parameter allows scaling of various depth-related thresholds for laboratory-scale simulations.

Fields:

depthscale pydantic-field

depthscale: Optional[float] = None

Depth scale of (lab) test simulated. Affects eps, hmin, hswitch and dzmax. A value lower than 1 increases the cut-off values (XBeach default: 1.0 for field scale)

g pydantic-field

g: Optional[float] = None

Gravitational acceleration (m/s²) (XBeach default: 9.81)

rho pydantic-field

rho: Optional[float] = None

Density of water (kg/m³) (XBeach default: 1025.0)

rhoa pydantic-field

rhoa: Optional[float] = None

Density of air (kg/m³) (XBeach default: 1.25)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

Coriolis pydantic-model

Coriolis(**data: Any)

Bases: XBeachBaseModel

Coriolis force parameters.

The Coriolis force affects the shallow water equations and becomes important for large-scale coastal applications or long simulation times. The effect depends on the latitude of the model location.

The Coriolis parameter f is calculated as: f = 2 * wearth * sin(lat)

Fields:

lat pydantic-field

lat: Optional[float] = None

Latitude at model location for computing Coriolis force (XBeach default: 0.0 degrees, no Coriolis effect)

wearth pydantic-field

wearth: Optional[float] = None

Angular velocity of Earth calculated as 1/rotation_time. Default is 1/24 hour⁻¹ (XBeach default: 0.04167 hour⁻¹)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

rompy_xbeach.components.physics.vegetation

XBeach vegetation parameter configurations.

This module contains the Vegetation model used by the Physics.vegetation field.

Vegetation pydantic-model

Vegetation(**data: Any)

Bases: XBeachBaseModel

Vegetation model configuration.

The presence of aquatic vegetation within the area of wave propagation or wave breaking results in an additional dissipation mechanism for short waves. This is modeled using the approach of [Mendez and Losada, 2004], which was adjusted by [Suzuki et al., 2012] to take into account vertically heterogeneous vegetation, see [van Rooijen et al., 2015]. The short wave dissipation due to vegetation is calculated as function of the local wave height and several vegetation parameters. The vegetation can be schematized in a number of vertical elements with each pecific property. In this way the wave damping effect of vegetation such as mangrove trees, with a relatively dense root system but sparse stem area, can be modeled. The dissipation term is then computed as the sum of the dissipation per vegetation layer ([Suzuki et al., 2012])

See https://xbeach.readthedocs.io/en/latest/xbeach_manual.html#vegetation for more information.

Fields:

vegetation pydantic-field

vegetation: Literal[True] = True

Enable vegetation model

nveg pydantic-field

nveg: Optional[int] = None

Number of vegetation species

veggiefile pydantic-field

veggiefile: Optional[XBeachDataBlob] = None

Name of veggie species list file

veggiemapfile pydantic-field

veggiemapfile: Optional[XBeachDataBlob] = None

Name of veggie species map file

vegcanflo pydantic-field

vegcanflo: Optional[bool] = None

Include incanopy flow (XBeach default: 0)

vegnonlin pydantic-field

vegnonlin: Optional[bool] = None

Include non-linear wave effect (XBeach default: 0)

veguntow pydantic-field

veguntow: Optional[bool] = None

Include undertow in phase-averaged vegetation (XBeach default: 1)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

rompy_xbeach.components.physics.wci

XBeach wave-current interaction parameter configurations.

This module contains models for wave-current interaction parameters.

logger module-attribute

logger = logging.getLogger(__name__)

WaveCurrentInteraction pydantic-model

WaveCurrentInteraction(**data: Any)

Bases: XBeachBaseModel

Wave-current interaction parameters.

Wave-current interaction (WCI) accounts for the feedback of currents on wave propagation. When enabled, currents affect the wave celerity and direction through Doppler shifting.

The WCI computation is limited to specific depth ranges (hwci to hwcimax) to avoid numerical issues in very shallow or deep water.

References

Dingemans et al. (1987). Water wave propagation over uneven bottoms.

Fields:

wci pydantic-field

wci: Literal[True] = True

Enable wave-current interaction

cats pydantic-field

cats: Optional[float] = None

Current averaging time scale for wave-current interaction, in terms of mean wave periods (XBeach default: 4.0)

hwci pydantic-field

hwci: Optional[float] = None

Minimum depth until which wave-current interaction is used (XBeach default: 0.1 m)

hwcimax pydantic-field

hwcimax: Optional[float] = None

Maximum depth until which wave-current interaction is used (XBeach default: 100.0 m)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.

rompy_xbeach.components.physics.wind

XBeach wind parameter configurations.

This module contains models for wind-related physics parameters. Note: This is separate from forcing.py which handles wind data specification.

Wind pydantic-model

Wind(**data: Any)

Bases: XBeachBaseModel

Wind physics parameters.

These parameters control how wind forcing affects the hydrodynamics. The wind stress is calculated as: tau = rhoa * Cd * |W| * W

Note

This class defines wind physics parameters, not wind forcing data. Wind velocity and direction are specified via: - Config.input.wind for data-driven wind (WindGrid, WindStation, WindPoint) - Direct windv/windth parameters for constant wind

The air density rhoa is defined in PhysicalConstants as it is a material property rather than a tuning parameter.

Examples:

Enable wind with XBeach's default parameters, or set the drag coefficient:

from rompy_xbeach.components.physics import Physics
from rompy_xbeach.components.physics.wavemodel import Surfbeat
from rompy_xbeach.components.physics.wind import Wind

print(Physics(wavemodel=Surfbeat(), wind=True).get("."))
print(Physics(wavemodel=Surfbeat(), wind=Wind(Cd=0.003)).get("."))
{'wavemodel': 'surfbeat', 'wind': 1}
{'wavemodel': 'surfbeat', 'wind': 1, 'Cd': 0.003}

Fields:

wind pydantic-field

wind: Literal[True] = True

Enable wind in flow solver (always True when using Wind class)

Cd pydantic-field

Cd: Optional[float] = None

Wind drag coefficient for wind stress calculation. tau = rhoa * Cd * |W| * W (XBeach default: 0.002)

params property

params: dict

Return the XBeach parameters as a flat dictionary.

check_for_typos classmethod

check_for_typos(data: Any) -> Any

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.

dump_inputs_dict

dump_inputs_dict() -> dict

Return the original inputs as a dictionary.

dump_inputs_json

dump_inputs_json() -> str

Return the original inputs as a JSON string.

get

get(destdir: str | Path) -> dict

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.