Rompy-XBeach¶
Python interface for the XBeach coastal morphodynamic model
Rompy-xbeach provides a type-safe, Pythonic way to configure and run XBeach simulations. It is part of the rompy ecosystem for regional ocean modelling.
Features¶
- Type-safe configuration — Pydantic models validate parameters before running XBeach, catching errors early with clear messages
- Data interfaces — Automatic generation of boundary condition files from various data sources (NetCDF, THREDDS, local files)
- Structured organisation — Related parameters grouped into logical components for better discoverability
- YAML support — Define configurations declaratively for reproducibility
- IDE support — Full autocomplete and type hints in modern editors
Quick Example¶
from rompy_xbeach import Config
from rompy_xbeach.components import Physics, Sediment, Output
from rompy_xbeach.components.physics import Surfbeat, BedFriction
from rompy_xbeach.components.sediment import Morphology
config = Config(
grid=grid,
bathy=bathy,
physics=Physics(
wavemodel=Surfbeat(),
bedfriction=BedFriction(bedfriccoef=0.01),
),
sediment=Sediment(
morphology=Morphology(morfac=10),
),
output=Output(outputformat="netcdf", tintg=3600),
)
This generates a valid params.txt file:
Why Rompy-XBeach?¶
XBeach uses a flat params.txt file with ~250 parameters. While flexible, this can be:
- Error-prone — Typos in parameter names silently ignored
- Hard to discover — Which parameters exist? What are valid values?
- Difficult to validate — Invalid combinations only fail at runtime
Rompy-xbeach addresses these by:
- Validating at construction — Invalid values raise clear errors immediately
- Grouping related parameters — Find morphology settings under
sediment.morphology - Enforcing constraints — Can't set non-hydrostatic parameters on a surfbeat model
- Providing defaults — Sensible XBeach defaults with documentation
Documentation Structure¶
-
Getting Started
Install rompy-xbeach and run your first simulation
-
User Guide
Learn the architecture and how to configure XBeach models
-
Components
Detailed reference for each component (Physics, Sediment, Output, etc.)
-
API Reference
Complete API documentation generated from source code
-
Examples
Interactive Jupyter notebooks demonstrating rompy-xbeach features
-
Developer
Contributing guidelines and development setup
Part of the Rompy Ecosystem¶
Rompy-xbeach is a plugin for rompy, the regional ocean modelling framework. Other model plugins include:
- rompy-swan — SWAN spectral wave model
- rompy-schism — SCHISM unstructured grid model