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#
Full-access state |
|
A field given by its vertical profile |
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
sfor a closuref(s): fields by name (bulk expression or trace at an interface), sigma-awaredz/dx, and parameterspar.Built from
m.functionsor an explicit{name: FunctionFamily}map; used byClosuresubclasses during the Model -> SystemModel lift.Initialization
Store the field map, parameters, sigma frame and (optionally) the boundary frame.
Args
fields:m.functionsnamespace or{name: FunctionFamily}map.at:Nonefor the bulk,0for the bed trace,1for 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: bottomz_0of the sigma mapz = z_0 + h zeta; needed only bydx_physandinterface_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 eof the expressione.
- dx(e)#
Horizontal derivative
d_x eofeat fixed zeta.
- dx_phys(e, xd)#
Physical horizontal derivative of the bulk expression
eat fixed z under the sigma mapz = z_0 + h zeta:d_xd e - (d_xd z_0 + zeta d_xd h)/h d_zeta e.
- trace(e)#
The bulk expression
eat this state’s tracezeta = at(ein the bulk).
- bulk(alias=None)#
This state in the bulk (
at=None), optionally with a field-namealias.
- 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 bat the bed,d_e etaat the surface), one per horizontal direction.
- property normal#
Outward unit boundary normal
[n_x, (n_y,) n_z]in the opaque slopes; reduces toz_hatundersmall_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-heightzeta_valueinstead of the boundary trace (for wall functions readingu(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
exprinvar(e.g. a modal sum in zeta), with theFunctionFamilyinterfaceexpr/at(value)aClosureStatereads.Initialization
Store the profile and its vertical variable.
- at(value)#
The profile at
var = value.