zoomy_core.model.state

zoomy_core.model.state#

StateSpace + MassMomentum — physical-coordinate flow scaffolding.

Per the new design:

  • StateSpace declares 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.

  • MassMomentum owns ALL physics state (flow fields u, v, w, p; stress tensor tau; free-surface geometry h, 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.

Module Contents#

Classes#

StateSpace

Coordinate scaffold — t, x, [y,] z.

MassMomentum

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 by SigmaTransform when 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: StateSpace coordinate scaffold, read-only here.

  • parameters: The Model’s parameter Zstruct; must contain g and rho.

Initialization

register_on(model)#

Register continuity, momentum.x (and .y if 3D), momentum.z, and the trivial ∂_t b = 0 bottom equation on model — and expose model.momentum as a vector-of- equations proxy so the legacy model.momentum.x / model.momentum.z access pattern (from the old System API in models/legacy/derived_system.py) keeps working.

After register_on(model):

  • model.continuity — Equation for the continuity balance.

  • model.momentum.x / model.momentum.z (and .y in 3D) — Equation per axis.

  • model.momentum.remove("z") — drop a single axis (calls through to Model.remove_equation).

  • model.bottom — trivial ∂_t b = 0 leaf.

Returns self so the construction chains:

m.src = MassMomentum(state, params, h_positive=True).register_on(m)