zoomy_core.model.state module#
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 the Model, not here. σ-frame coordinates (zeta, zeta_ref) are registered later by SigmaTransform when 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’s parameters Zstruct 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.
- class zoomy_core.model.state.StateSpace(dimension=2)#
Bases:
objectCoordinate 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.- property has_y#
- property coords_h#
- property args_h#
- property args_3d#
- class zoomy_core.model.state.MassMomentum(state, parameters)#
Bases:
objectThe free-surface incompressible mass + momentum balance.
Owns the physics state of the system — flow fields, depth / bathymetry / free-surface, stress tensor — and builds the continuity / momentum.x / momentum.z balance equations using the Model’s parameters (gravity
g, densityrho).- Parameters:
state (
StateSpace) – Coordinate scaffold. Read-only on this end.parameters (Zstruct) – The Model’s parameter Symbols Zstruct. Must contain at least
g(gravity) andrho(density). These Symbols flow directly into the balance equations — no copies, no remap.attributes (Exposed) –
------------------ –
self.state –
self.parameters –
self.u –
self.v –
self.w –
(t (self.p (Function calls on) –
x –
[y –
]z)) –
components) (self.tau (Zstruct of stress-tensor) –
self.h –
self.b –
(depth (self.eta) –
bathymetry –
surface) (free) –
:param self.continuity (
Expression): :param self.momentum (Zstruct with .x [: :param .y]: :param .z Expressions):- 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)