zoomy_core.model.derivation.system_extract#
Classifies the additive terms of a derivation Model’s residuals into SystemModel slots (mass
matrix, flux, hydrostatic pressure, nonconservative matrix, source, diffusion matrix). It is the
bridge from the derivation Model to SystemModel.from_model.
Module Contents#
Classes#
Opaque provenance marker wrapping a viscous diffusive flux |
|
Opaque marker wrapping a pressure-flux argument; |
Functions#
Assumptions declared on a field’s Function head ( |
|
Extract the operator matrices (mass, flux, hydrostatic pressure, nonconservative, source,
diffusion) from a Model’s residuals, one evolution row per state field. Raises |
API#
- class zoomy_core.model.derivation.system_extract.ViscousDiffusion#
Bases:
sympy.FunctionOpaque provenance marker wrapping a viscous diffusive flux
d_x(ViscousDiffusion(D d_x Q_j)). It routes the whole rank-4 compound, including foreign-state cross pieces, intodiffusion_matrixrather thanflux.- nargs#
1
- classmethod eval(arg)#
Leave the marker unevaluated; a zero argument collapses to zero.
- class zoomy_core.model.derivation.system_extract.HydrostaticPressure#
Bases:
sympy.FunctionOpaque marker wrapping a pressure-flux argument;
d_x(HydrostaticPressure(P))routes tohydrostatic_pressurewhile any other conservatived_x(F)routes toflux. The model applies it explicitly, never inferred from gravity.- nargs#
1
- classmethod eval(arg)#
Leave the marker unevaluated.
- zoomy_core.model.derivation.system_extract.head_assumptions(field) dict#
Assumptions declared on a field’s Function head (
realplus its strongest sign predicate), so that e.g.h > 0survives into the SystemModel. Only declared fields inherit; derived aux symbols do not.
- zoomy_core.model.derivation.system_extract.extract_system_operators(model, Q, Qaux=None, dae=False)#
Extract the operator matrices (mass, flux, hydrostatic pressure, nonconservative, source, diffusion) from a Model’s residuals, one evolution row per state field. Raises
ValueErrorfor fields outsideQandQaux, unresolved integrals, unroutable terms, and (unlessdae) a mass matrix that is not the identity.Args
model: Model after the full closure pipeline.Q: Applied state fields, one per evolution row.Qaux: Applied auxiliary fields;Nonetakes every field not inQ.dae: Keep a non-diagonal or singular mass matrix (index-1 DAE) instead of raising.
Returns
Dict of
SystemModelkeyword arguments (time, space, state, aux_state, parameters, flux, hydrostatic_pressure, nonconservative_matrix, source, mass_matrix, diffusion_matrix, ...) plus theunclassifiedremainders.