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

Functions

str _cp_version ()
float jt_temperature_change (str fluid, float p_in_pa, float T_in_K, float p_out_pa)
float density (str fluid, float p_pa, float T_K)
float temperature_from_state (str fluid, float rho, float p_pa)
float isentropic_temperature (str fluid, float p0_pa, float T0_K, float p_pa)
Dict[str, float] bottle_floor (str fluid, float mdot, float p_out_pa, float cv, float xT, float min_differential_pa, float p_b_end_pa, float T_b_end_K, float p_in_end_pa, float T_in_end_K, float line_drop_end_pa)
float regulator_inlet_floor (str fluid, float mdot, float p_out_pa, float T_in_K, float cv, float xT=DEFAULT_XT, float min_differential_pa=0.0)
Mapping[str, Any] _derived (Any prep, Mapping[str, Any] result)
Dict[str, Any] build_pressurant (Mapping[str, Any] result, Any prep=None, Any config=None, *, Optional[str] gas=None, Optional[float] volume_m3=None, Optional[Mapping[str, Any]] regulator=None, Optional[float] xT=None)

Variables

tuple COOLPROP_SOURCE
int FLOOR_ITERS = 50
float FLOOR_TOL_PA = 1.0

Detailed Description

The pressurant: what the bottle held, what the burn took, what it needed, and the
Joule-Thomson temperature change across the regulator.

``build_pressurant(result, prep=None, config=None, ...)`` -> ``diagnostics.pressurant``
(DATA-CONTRACT 3).

* **Mass** comes from the bottle's vessel state (``series.copv_mass_kg``, ``series.copv_psia``),
  never from network nodes (AUDIT 5.5: vessel states and node values differ). ``loaded_kg`` is
  the first recorded sample (the bottle at the start of the lead-in; Layer X assumes it full after
  the tanks are pressed, AUDIT D13), ``residual_kg`` the sample at the last firing step,
  ``used_kg`` their difference.
* **Bottle gas temperature** is the vessel's own: CoolProp T at (rho = m / V, p) with V the
  drawing's bottle volume. It is a state the twin integrates; this recovers it from the two it
  records.
* **Required mass to burnout** = used + what must stay in the bottle for the regulator still to
  pass the burnout flow at the burnout outlet pressure. The floor at the regulator inlet is the
  larger of (outlet + the drawing's ``min_inlet_differential``) and the inlet pressure at which the
  wide-open seat's IEC 60534-2-1 capacity (``engine.layerx.diag.regulator.iec_gas_flow``) equals
  the burnout flow. The bottle is taken on from its burnout state to that floor **adiabatically**:
  for a rigid vessel with outflow only and no heat, the first law ``d(m u) = h dm`` with
  ``v = V/m`` gives ``du = -p dv``, i.e. ``ds = 0`` for the gas left inside, so the bottle follows
  its burnout isentrope ``T_b(p) = T(p, s(p_end, T_end))`` (CoolProp). The regulator inlet gas is
  that bottle gas throttled isenthalpically through the bottle-to-regulator line (the twin's own
  adiabatic-line walk), and the line's drop, recorded at burnout, is carried to the floor at the
  same flow as a loss-coefficient drop ``K mdot^2 / (2 rho A^2)``: scaled by the inlet density at
  burnout over that at the floor. The three are solved together (fixed point). ``unusable_kg`` is
  CoolProp's density at the floor bottle state, times V; ``margin_kg`` = loaded - required =
  residual - unusable. Holding the bottle at its burnout temperature and the line at its burnout
  drop instead (``unusable_held_T_kg``) is the other bound: it is what a bottle wall that kept the
  gas at its burnout temperature would give, and it understates the unusable mass (the LE4 He
  bottle tracks its isentrope to ~2 % over the burn, ``bottle_T_end_isentropic_K``).
* **Joule-Thomson** across the regulator is an isenthalpic throttle: the steady-flow energy
  equation with no heat, no work and the kinetic-energy change neglected gives h_out = h_in, so
  ``T_out = T(p_out, h(p_in, T_in))`` (CoolProp). Helium above its inversion temperature (~40 K)
  warms on throttling; nitrogen at room temperature cools. ``jt_dT_K`` is computed on the
  regulator's inlet node state and outlet node pressure; ``twin_dT_K`` is the twin's own walked
  temperature change across the same branch, for comparison.

Function Documentation

◆ _cp_version()

str engine.layerx.diag.pressurant._cp_version ( )
protected

Definition at line 59 of file pressurant.py.

◆ _derived()

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

Definition at line 188 of file pressurant.py.

Referenced by build_pressurant().

◆ bottle_floor()

Dict[str, float] engine.layerx.diag.pressurant.bottle_floor ( str fluid,
float mdot,
float p_out_pa,
float cv,
float xT,
float min_differential_pa,
float p_b_end_pa,
float T_b_end_K,
float p_in_end_pa,
float T_in_end_K,
float line_drop_end_pa )
The bottle state at which the regulator, wide open, just passes ``mdot`` to ``p_out``.

Solves together (fixed point on the regulator inlet pressure):

* regulator inlet ``p_in`` = :func:`regulator_inlet_floor` at the inlet gas temperature ``T_in``;
* bottle ``p_b = p_in + dp_line``, ``dp_line = line_drop_end * rho_in_end / rho_in`` (a
  loss-coefficient drop at the same mass flow scales as 1/rho);
* bottle ``T_b`` on the burnout isentrope (:func:`isentropic_temperature`);
* ``T_in = T(p_in, h(p_b, T_b))``: the bottle gas throttled through the adiabatic line.

Returns {p_b, T_b, p_in, T_in, line_drop, iterations, converged} in Pa and K.

Definition at line 116 of file pressurant.py.

References density(), isentropic_temperature(), max, and regulator_inlet_floor().

Referenced by build_pressurant().

◆ build_pressurant()

Dict[str, Any] engine.layerx.diag.pressurant.build_pressurant ( Mapping[str, Any] result,
Any prep = None,
Any config = None,
* ,
Optional[str] gas = None,
Optional[float] volume_m3 = None,
Optional[Mapping[str, Any]] regulator = None,
Optional[float] xT = None )
``diagnostics.pressurant``. Never raises.

``gas`` and ``volume_m3`` default to the drawing's (``derived.pressurant_gas``,
``derived.copv_volume_L``, from ``prep`` or the result's provenance). ``regulator`` is
``diagnostics.regulator`` when already built (its Cv and x_T are reused). Needs
``result["network"]`` only for the regulator's inlet state (JT, floor); without it, those
keys are null and the mass budget stands.

Definition at line 195 of file pressurant.py.

References _derived(), bottle_floor(), density(), isentropic_temperature(), jt_temperature_change(), max, regulator_inlet_floor(), and temperature_from_state().

◆ density()

float engine.layerx.diag.pressurant.density ( str fluid,
float p_pa,
float T_K )

Definition at line 81 of file pressurant.py.

Referenced by bottle_floor(), and build_pressurant().

◆ isentropic_temperature()

float engine.layerx.diag.pressurant.isentropic_temperature ( str fluid,
float p0_pa,
float T0_K,
float p_pa )
T [K] at ``p`` on the isentrope through (p0, T0) (CoolProp); NaN out of range. The gas left
in a rigid vessel discharging with no heat follows it (first law: ``d(mu) = h dm`` -> ``ds = 0``).

Definition at line 99 of file pressurant.py.

Referenced by bottle_floor(), and build_pressurant().

◆ jt_temperature_change()

float engine.layerx.diag.pressurant.jt_temperature_change ( str fluid,
float p_in_pa,
float T_in_K,
float p_out_pa )
Isenthalpic throttle from (p_in, T_in) to p_out: T_out - T_in [K] (CoolProp). NaN if out of
range.

Definition at line 68 of file pressurant.py.

Referenced by build_pressurant().

◆ regulator_inlet_floor()

float engine.layerx.diag.pressurant.regulator_inlet_floor ( str fluid,
float mdot,
float p_out_pa,
float T_in_K,
float cv,
float xT = DEFAULT_XT,
float min_differential_pa = 0.0 )
Lowest regulator inlet pressure [Pa] at which the wide-open seat (IEC 60534-2-1) still
passes ``mdot`` to ``p_out``, and at least ``p_out + min_differential``.

Definition at line 163 of file pressurant.py.

References max.

Referenced by bottle_floor(), and build_pressurant().

◆ temperature_from_state()

float engine.layerx.diag.pressurant.temperature_from_state ( str fluid,
float rho,
float p_pa )

Definition at line 90 of file pressurant.py.

Referenced by build_pressurant().

Variable Documentation

◆ COOLPROP_SOURCE

tuple engine.layerx.diag.pressurant.COOLPROP_SOURCE
Initial value:
1= ("CoolProp (Bell, Wronski, Quoilin & Lemort, 'Pure and Pseudo-pure Fluid Thermophysical "
2 "Property Evaluation and the Open-Source Thermophysical Property Library CoolProp', "
3 "Ind. Eng. Chem. Res. 53(6), 2498-2508, 2014)")

Definition at line 54 of file pressurant.py.

◆ FLOOR_ITERS

int engine.layerx.diag.pressurant.FLOOR_ITERS = 50

Definition at line 112 of file pressurant.py.

◆ FLOOR_TOL_PA

float engine.layerx.diag.pressurant.FLOOR_TOL_PA = 1.0

Definition at line 113 of file pressurant.py.