STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
engine.layerx.diag.saturation Namespace Reference

Functions

float saturation_pressure (str fluid, float T_K)
float saturated_liquid_density (str fluid, float T_K)
Mapping[str, Any] _derived (Any prep, Mapping[str, Any] result)
Optional[str] side_fluid (Any prep, Mapping[str, Any] result, Optional[str] side)
Optional[str] node_fluid (Any prep, Mapping[str, Any] result, str nid, Optional[str] side)
Optional[float] _branch_bore (Any prep, str bid)
float _peak_flow (Mapping[str, Any] net, str nid, int n, np.ndarray firing)
Dict[str, Any] build_saturation (Mapping[str, Any] result, Any prep=None, Any config=None, *, float flag_margin_psi=DEFAULT_FLAG_MARGIN_PSI, float dead_leg_kg_s=DEAD_LEG_KG_S)
Dict[str, Any] orifice_geometry (Any config, str side)
np.ndarray cd_effective (np.ndarray mdot, np.ndarray dp_psi, float area, float rho)
Dict[str, Any] build_cavitation (Mapping[str, Any] result, Any prep=None, Any config=None, *, float flip_l_over_d_max=DEFAULT_FLIP_LD_MAX, float near_margin=DEFAULT_CAVITATION_MARGIN)

Variables

tuple NURICK_SOURCE
float DEFAULT_FLAG_MARGIN_PSI = 25.0
float DEAD_LEG_KG_S = 1.0e-3
float DEFAULT_CAVITATION_MARGIN = 0.2
float DEFAULT_FLIP_LD_MAX = 5.0

Detailed Description

Saturation margin at every liquid node, and cavitation at the injector orifices.

``build_saturation(result, prep=None, config=None, ...)`` -> ``diagnostics.saturation``;
``build_cavitation(result, prep=None, config, ...)`` -> ``diagnostics.cavitation``
(DATA-CONTRACT 3).

**Saturation.** At each liquid node of the recorded network, per twin step,
``margin = p_node - P_sat(T_node)`` with ``P_sat`` CoolProp's (oxygen on the LOX side, ethanol on the
fuel side; the node's own fluid where the prepared model knows it). Node pressures are total
pressures in the twin's lumped-K convention (AUDIT 9.6 B4), so where the drawing gives the bores
of the branches at a node the static margin is reported too: the total less the largest dynamic
head ``mdot^2 / (2 rho A^2)`` of the flowing branches at that node, at the saturated-liquid
density (the twin's own liquid basis). The minimum and its time are taken over the firing steps:
before Fire the lines downstream of the shut mains are held at 101.325 kPa by the twin (they would
be gas-filled on the stand; AUDIT 9.5 4), which is not a margin anyone has. ``ENG.chamber`` is not a
liquid node and is never included.

**Cavitation.** Nurick (1976), "Orifice Cavitation and Its Effect on Spray Mixing", J. Fluids
Eng. 98(4): once the static pressure at the vena contracta reaches the vapour pressure, a sharp
orifice's flow follows ``Cd = Cc sqrt(K)`` with ``K = (p_up - p_v) / (p_up - p_c)``, so it cavitates
below ``K_crit = (Cd / Cc)^2``; ``Cc = (1/Cc0^2 - 11.4 r/d)^-1/2``. This module does not restate
that: it calls EngineDesign's own implementation, ``engine.core.discharge.cavitation_margin`` (the
same ``Cc0`` and r/d law the Forward report uses), per step, with ``p_up`` the manifold pressure
(``series.*.manifold_psia``), ``p_c`` the chamber's, ``p_v`` CoolProp's at the line-exit liquid
temperature, and ``Cd`` the orifices' effective Cd that step,
``mdot / (n A_jet sqrt(2 rho dp_inj))`` at the config density (the card's injector basis).
``K_incipient`` in the contract is that ``K_crit``: below it the vena contracta is at vapour
pressure in Nurick's model. Bubbles can appear somewhat above it; no allowance is added.

**Hydraulic flip.** A flip needs a cavitating orifice (K below K_crit) whose separated region
reaches the exit before the flow reattaches, which a long bore prevents. The L/d below which that
happens is taken as an explicit input, ``flip_l_over_d_max``, default 5.0 *assumed* (the repo's
injector plan, ``docs/injector_face_and_manifold_plan.md``: "L/d >= 5 preferred for a sharp
entry"); the value Nurick reports was not verified for this module and is not cited. ``flip_risk``
is true when an orifice cavitates on any firing step and its L/d is at or under that threshold.

Function Documentation

◆ _branch_bore()

Optional[float] engine.layerx.diag.saturation._branch_bore ( Any prep,
str bid )
protected

Definition at line 118 of file saturation.py.

Referenced by build_saturation().

◆ _derived()

Mapping[str, Any] engine.layerx.diag.saturation._derived ( Any prep,
Mapping[str, Any] result )
protected

Definition at line 96 of file saturation.py.

Referenced by build_cavitation(), and side_fluid().

◆ _peak_flow()

float engine.layerx.diag.saturation._peak_flow ( Mapping[str, Any] net,
str nid,
int n,
np.ndarray firing )
protected
The largest |mass flow| [kg/s] through any branch at node ``nid`` over the firing steps.

Definition at line 129 of file saturation.py.

References max.

Referenced by build_saturation().

◆ build_cavitation()

Dict[str, Any] engine.layerx.diag.saturation.build_cavitation ( Mapping[str, Any] result,
Any prep = None,
Any config = None,
* ,
float flip_l_over_d_max = DEFAULT_FLIP_LD_MAX,
float near_margin = DEFAULT_CAVITATION_MARGIN )
``diagnostics.cavitation``. Never raises. Needs ``config`` (the orifices) and the series;
the network only for the line-exit liquid temperature (else ``series.*.liquid_K``).

Definition at line 280 of file saturation.py.

References _derived(), cd_effective(), orifice_geometry(), saturation_pressure(), and side_fluid().

◆ build_saturation()

Dict[str, Any] engine.layerx.diag.saturation.build_saturation ( Mapping[str, Any] result,
Any prep = None,
Any config = None,
* ,
float flag_margin_psi = DEFAULT_FLAG_MARGIN_PSI,
float dead_leg_kg_s = DEAD_LEG_KG_S )
``diagnostics.saturation``. Never raises.

Definition at line 142 of file saturation.py.

References _branch_bore(), _peak_flow(), min, node_fluid(), saturated_liquid_density(), and saturation_pressure().

◆ cd_effective()

np.ndarray engine.layerx.diag.saturation.cd_effective ( np.ndarray mdot,
np.ndarray dp_psi,
float area,
float rho )
mdot / (A sqrt(2 rho dp)): the orifices' effective Cd on the twin's flow and orifice drop.

Definition at line 273 of file saturation.py.

Referenced by build_cavitation().

◆ node_fluid()

Optional[str] engine.layerx.diag.saturation.node_fluid ( Any prep,
Mapping[str, Any] result,
str nid,
Optional[str] side )

Definition at line 108 of file saturation.py.

References side_fluid().

Referenced by build_saturation().

◆ orifice_geometry()

Dict[str, Any] engine.layerx.diag.saturation.orifice_geometry ( Any config,
str side )
The config's orifices on one network side: n, d_jet, area (all holes), angle, spacing, L/d,
r/d, config density.

Definition at line 252 of file saturation.py.

Referenced by build_cavitation().

◆ saturated_liquid_density()

float engine.layerx.diag.saturation.saturated_liquid_density ( str fluid,
float T_K )

Definition at line 87 of file saturation.py.

Referenced by build_saturation().

◆ saturation_pressure()

float engine.layerx.diag.saturation.saturation_pressure ( str fluid,
float T_K )
P_sat(T) [Pa] by CoolProp; NaN above the critical point or out of range.

Definition at line 77 of file saturation.py.

Referenced by build_cavitation(), and build_saturation().

◆ side_fluid()

Optional[str] engine.layerx.diag.saturation.side_fluid ( Any prep,
Mapping[str, Any] result,
Optional[str] side )
The propellant on a network side (``ox``/``fuel``), from the drawing's roles.

Definition at line 101 of file saturation.py.

References _derived().

Referenced by build_cavitation(), and node_fluid().

Variable Documentation

◆ DEAD_LEG_KG_S

float engine.layerx.diag.saturation.DEAD_LEG_KG_S = 1.0e-3

Definition at line 61 of file saturation.py.

◆ DEFAULT_CAVITATION_MARGIN

float engine.layerx.diag.saturation.DEFAULT_CAVITATION_MARGIN = 0.2

Definition at line 66 of file saturation.py.

◆ DEFAULT_FLAG_MARGIN_PSI

float engine.layerx.diag.saturation.DEFAULT_FLAG_MARGIN_PSI = 25.0

Definition at line 56 of file saturation.py.

◆ DEFAULT_FLIP_LD_MAX

float engine.layerx.diag.saturation.DEFAULT_FLIP_LD_MAX = 5.0

Definition at line 71 of file saturation.py.

◆ NURICK_SOURCE

tuple engine.layerx.diag.saturation.NURICK_SOURCE
Initial value:
1= ("Nurick, W. H. (1976), 'Orifice Cavitation and Its Effect on Spray Mixing', J. Fluids Eng. "
2 "98(4), 681-687: Cd = Cc sqrt(K), K = (p_up - p_v)/(p_up - p_c), cavitating below "
3 "K_crit = (Cd/Cc)^2; Cc = (1/Cc0^2 - 11.4 r/d)^-1/2 -- as implemented in "
4 "engine.core.discharge.cavitation_margin")

Definition at line 51 of file saturation.py.