zoomy_core.model.models.model_derivation module

zoomy_core.model.models.model_derivation module#

Three-Phase PDE Model Derivation: Phase 1.

Derives basis-independent shallow water moment equations from the full 3D INS. The user controls modeling assumptions (hydrostatic, material) explicitly.

Usage:

state = StateSpace(dimension=2) # 2 = xz plane pre_projected = derive_shallow_moments(state, material=Newtonian(state)) # pre_projected contains tagged terms ready for ANY basis (Phase 3)

class zoomy_core.model.models.model_derivation.TaggedTerm(expr, role, origin='')#

Bases: object

A single term in the projected equations with its role tagged.

Roles:
  • ‘temporal’: d(hα)/dt terms → define the mass matrix

  • ‘flux’: d(F)/dx terms → go into Model.flux()

  • ‘nonconservative’: B(Q)·dQ/dx terms → go into Model.nonconservative_matrix()

  • ‘source’: algebraic in Q → go into Model.source()

Parameters:
  • expr (Expression) –

  • role (Literal['temporal', 'flux', 'nonconservative', 'source']) –

  • origin (str) –

expr: Expression#
role: Literal['temporal', 'flux', 'nonconservative', 'source']#
origin: str = ''#
class zoomy_core.model.models.model_derivation.PreProjectedEquations(state, continuity=<factory>, x_momentum=<factory>, y_momentum=<factory>, assumptions_applied=<factory>, dimension=1)#

Bases: object

Basis-independent shallow water equations, ready for projection onto any basis.

Each equation is a list of TaggedTerms. The terms are in abstract form: they contain u(t,x,z), w(t,x,z), h(t,x), b(t,x) as SymPy Functions, NOT yet expanded into basis coefficients.

The vertical coordinate is z (not yet mapped to ζ). Integration over depth [b, b+H] has been performed via IBP where needed. Kinematic BCs, hydrostatic pressure, and stress BCs have been applied.

Parameters:
state: StateSpace#
continuity: List[TaggedTerm]#
x_momentum: List[TaggedTerm]#
y_momentum: List[TaggedTerm]#
assumptions_applied: List[str]#
dimension: int = 1#
property horizontal_dim#
all_equations()#
Return type:

Dict[str, List[TaggedTerm]]

summary()#
zoomy_core.model.models.model_derivation.derive_shallow_moments(state, material=None, slip_length=None)#

Derive the pre-projected shallow water moment equations from the full INS.

Steps: 1. Start from FullINS (continuity, x/y/z momentum) 2. Apply material model (Newtonian by default) 3. Apply hydrostatic assumption: simplify z-momentum → p(z) 4. Substitute hydrostatic pressure into x/y-momentum 5. Depth-integrate with IBP on z-derivatives 6. Apply kinematic BCs to boundary terms 7. Apply stress BCs (slip at bottom, free at top) 8. Tag each term (temporal, flux, NC, source)

Returns PreProjectedEquations ready for basis projection (Pass 2).

Parameters:
  • state (StateSpace) –

  • slip_length (Optional[Symbol]) –

Return type:

PreProjectedEquations