zoomy_core.model.state#
StateSpace + MassMomentum — physical-coordinate flow scaffolding.
Per the new design:
StateSpacedeclares only coordinates —t, x, y (if dim >= 2), z. Parameters (g,rho,nu,lambda) live on theModel, not here. σ-frame coordinates (zeta,zeta_ref) are registered later bySigmaTransformwhen it is applied; the pristine StateSpace knows nothing about σ-frame.MassMomentumowns ALL physics state (flow fieldsu, v, w, p; stress tensortau; free-surface geometryh, b, eta) and builds the continuity / momentum.x / momentum.z balance equations. Its constructor takes the Model’sparametersZstruct so the gravity / density Symbols are the same Symbol identity as on the Model — no translation maps needed downstream.
Minimal reimplementation: matches the canonical notebook usage
(thesis/notebooks/legacy/modeling/transparent_derivations/{sme,vam, ml_sme,ml_vam}_clean.py), no legacy import.
Module Contents#
Classes#
Coordinate scaffold — t, x, [y,] z. |
|
The free-surface incompressible mass + momentum balance: owns the flow, depth, bathymetry, free-surface and stress-tensor fields and builds the continuity and momentum equations. |
API#
- class zoomy_core.model.state.StateSpace(dimension=2)#
Coordinate scaffold — t, x, [y,] z.
Carries only the spatial / temporal coordinate Symbols. No flow fields, no parameters, no σ-frame. σ-frame coordinates (
zeta,zeta_ref) get attached bySigmaTransformwhen applied.Initialization
- property has_y#
- property coords_h#
- property args_h#
- property args_3d#
- class zoomy_core.model.state.MassMomentum(state, parameters)#
The free-surface incompressible mass + momentum balance: owns the flow, depth, bathymetry, free-surface and stress-tensor fields and builds the continuity and momentum equations.
Args
state:StateSpacecoordinate scaffold, read-only here.parameters: The Model’s parameterZstruct; must containgandrho.
Initialization
- register_on(model)#
Register continuity,
momentum.x(and.yif 3D),momentum.z, and the trivial∂_t b = 0bottom equation onmodel— and exposemodel.momentumas a vector-of- equations proxy so the legacymodel.momentum.x/model.momentum.zaccess pattern (from the oldSystemAPI inmodels/legacy/derived_system.py) keeps working.After
register_on(model):model.continuity—Equationfor the continuity balance.model.momentum.x/model.momentum.z(and.yin 3D) —Equationper axis.model.momentum.remove("z")— drop a single axis (calls through toModel.remove_equation).model.bottom— trivial∂_t b = 0leaf.
Returns
selfso the construction chains:m.src = MassMomentum(state, params, h_positive=True).register_on(m)