zoomy_core.model.models.swe#
Shallow water equations with bed (SWE), 1D or 2D, as a Model with state [b, h, hu(, hv)].
Level-0 member of the moment hierarchy; lifted to a SystemModel via SystemModel.from_model.
Module Contents#
Classes#
Shallow water + bed + optional Manning friction, written directly as depth-averaged
operators. Declares the function groups interpolate / project / reconstruction and the
boundaries |
API#
- class zoomy_core.model.models.swe.SWE(**kw)#
Bases:
zoomy_core.model.derivative_workflow.StructuredDerivativeModelShallow water + bed + optional Manning friction, written directly as depth-averaged operators. Declares the function groups interpolate / project / reconstruction and the boundaries
wall(free slip) andinflow.Initialization
Build the model;
dimension=2addshv, andparametersoverrides defaults one by one.- dimension#
‘Integer(…)’
- variables#
[‘b’, (‘h’, ‘nonnegative’), ‘hu’]
- parameters#
None
- reconstruction_variables()#
Well-balanced reconstruction map: replace
hby the free surfaceb + h, other fields unchanged.
- flux()#
Conservative flux of mass and momentum,
hu^2/h + g h^2/2on the diagonal.
- nonconservative_matrix()#
Bed-slope product: the momentum rows pick up
g h d_d b.
- source()#
Manning friction on the momentum rows (zero for
n_m = 0), withvel_epsregularizing|u|so the source Jacobian stays finite at rest.
- update_variables()#
Cap each momentum component to
h_wet * 4 sqrt(g h)(h_wet = max(h - wet_dry_eps, 0)) at the wet/dry front;handbare never modified.
- update_variables_jacobian_wrt_variables()#
Zero Jacobian of
update_variables(only the IMEX Newton consumes it, and it does not apply the cap).
- declare_system_roles(sm)#
Declare the free-surface roles (depth
h, bedb, gravityg, momentumhu/hv) on the SystemModelsm.