zoomy_core.model.models.material

zoomy_core.model.models.material#

ClosureState, the single full-access state object s handed to every composable stress closure f(s) (see closures.py). It gives the closure sigma-aware derivatives, model parameters and the fields at the bulk or at a boundary trace.

Module Contents#

Classes#

ClosureState

Full-access state s for a closure f(s): fields by name (bulk expression or trace at an interface), sigma-aware dz/dx, and parameters par.

ProfileField

A field given by its vertical profile expr in var (e.g. a modal sum in zeta), with the FunctionFamily interface expr / at(value) a ClosureState reads.

API#

class zoomy_core.model.models.material.ClosureState(fields, *, params=None, h=None, x=None, zeta=None, at=None, alias=None, boundary_tag=None, horiz=None, base=None)#

Full-access state s for a closure f(s): fields by name (bulk expression or trace at an interface), sigma-aware dz/dx, and parameters par.

Built from m.functions or an explicit {name: FunctionFamily} map; used by Closure subclasses during the Model -> SystemModel lift.

Initialization

Store the field map, parameters, sigma frame and (optionally) the boundary frame.

Args

  • fields: m.functions namespace or {name: FunctionFamily} map.

  • at: None for the bulk, 0 for the bed trace, 1 for the surface trace.

  • alias: field-name rebind (e.g. {"u": "v"}) so one closure serves every horizontal row.

  • boundary_tag: "b" or "eta", selects the opaque slope symbols of the boundary frame.

  • horiz: horizontal coordinates of the model.

  • base: bottom z_0 of the sigma map z = z_0 + h zeta; needed only by dx_phys and interface_slopes.

property par#

Model parameter namespace (s.par.rho, …).

property zeta#

Sigma coordinate zeta in [0, 1], for position-dependent closures.

property depth#

Layer depth h (the sigma-map scale).

dz(e)#

Physical vertical derivative d_z e = (1/h) d_zeta e of the expression e.

dx(e)#

Horizontal derivative d_x e of e at fixed zeta.

dx_phys(e, xd)#

Physical horizontal derivative of the bulk expression e at fixed z under the sigma map z = z_0 + h zeta: d_xd e - (d_xd z_0 + zeta d_xd h)/h d_zeta e.

trace(e)#

The bulk expression e at this state’s trace zeta = at (e in the bulk).

bulk(alias=None)#

This state in the bulk (at=None), optionally with a field-name alias.

property horizontal#

Horizontal coordinates of the model.

property horizontal_velocity#

Bulk horizontal velocity [u, (v,)] (no alias), whatever the trace of this state.

property vertical_velocity#

Bulk vertical velocity w (no alias), whatever the trace of this state.

property interface_slopes#

Physical slopes d_e(z_0 + at h) of this trace’s interface (d_e b at the bed, d_e eta at the surface), one per horizontal direction.

property normal#

Outward unit boundary normal [n_x, (n_y,) n_z] in the opaque slopes; reduces to z_hat under small_slope_scaling.

property tangents#

Axis-fixed unit tangent basis [t_x, (t_y,)] of the boundary, t_a = (e_a + sigma_a z_hat)/sqrt(1 + sigma_a^2).

get_normal_tangential(vec)#

Project a 3-D vector onto the boundary frame {n, t_a}.

Returns

(f_n, [f_t1, (f_t2)]), the normal and per-axis tangential components.

property u_tangent#

Tangential velocity per axis, [u.t_x, (u.t_y,)].

velocity_at(zeta_value)#

Full velocity vector [u, (v,) w] evaluated at sigma-height zeta_value instead of the boundary trace (for wall functions reading u(zeta_p)).

u_tangent_at(zeta_value)#

Tangential velocity per axis with the velocity read at sigma-height zeta_value.

property u_normal#

Wall-normal velocity u.n.

class zoomy_core.model.models.material.ProfileField(expr, var)#

A field given by its vertical profile expr in var (e.g. a modal sum in zeta), with the FunctionFamily interface expr / at(value) a ClosureState reads.

Initialization

Store the profile and its vertical variable.

at(value)#

The profile at var = value.