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

Functions

 _p (value, unit, source="estimated")
 test_the_feed_walk_takes_the_lines_to_the_engine_and_nothing_else ()
 _burn (n=20, dt=0.05, mdot=(1.9, 1.25), loaded=(6.0, 4.0))
 test_a_consistent_burn_closes_and_counts_its_lines_by_hand ()
 test_a_leak_shows_as_exactly_its_own_size ()
 test_the_burned_mass_counts_each_step_by_its_own_length ()
 _pressurise (n=300, gas="Nitrogen", bottle_L=4.6871, p_b0=300e5, tank_L=15.1, fill0=0.95, p_u0=40e5, T0=293.15, burn_s=3.5)
 pressurised ()
 test_the_pressurant_balance_closes_on_an_independent_integration (pressurised)
 test_a_wrong_ullage_volume_does_not_close (pressurised)
 test_the_energy_balance_closes_to_the_quadrature_of_the_work (pressurised)
 test_heat_into_the_ullage_shows_as_the_unclosed_part (pressurised)
 test_vapour_in_the_ullage_is_refused_rather_than_booked_as_error (pressurised)
 test_check_never_raises_and_says_what_it_could_not_do ()
 test_convergence_lists_every_pass_against_its_tolerance ()
 test_limits_grade_the_balances (pressurised)
 test_the_reference_run_conserves_what_it_must ()

Variables

 CP = pytest.importorskip("CoolProp.CoolProp")
float PSI = 6894.757293168361
str RUNS = Path(__file__).resolve().parents[1] / ".userdata" / "local" / "engine" / "layerx" / "runs"
str REFERENCE = RUNS / "20261002-231658-7e47d1.json"
dict DOC

Detailed Description

Conservation checks on a Layer X burn (engine/layerx/diag/vv.py).

What these check, and against what:

* **Propellant mass** on a hand-built burn: the balance closes when the numbers do, and a leak shows
  as exactly its own size. The trapped liquid is checked by hand: pi/4 d^2 L of the drawing's
  tank-to-engine lines at CoolProp's saturated density, the fill and vent lines left out.
* **Pressurant mass and gas-side energy** on a pressurisation integrated here, independently of the
  twin: a bottle feeds an ullage that grows as the liquid leaves, explicit Euler, every state from
  CoolProp's (rho, u). Mass is conserved by construction and the first law holds step by step, so the
  checks must close to the quadrature error of the boundary work (~1e-4 of it). Leaving the work
  out, or the ullage volume wrong, must not close.
* **The 2026-10-02 reference run** (read only, skipped when absent): the twin's own bookkeeping
  closes, the pressurant to round-off.

Function Documentation

◆ _burn()

◆ _p()

test_layerx_vv._p ( value,
unit,
source = "estimated" )
protected

Definition at line 35 of file test_layerx_vv.py.

◆ _pressurise()

test_layerx_vv._pressurise ( n = 300,
gas = "Nitrogen",
bottle_L = 4.6871,
p_b0 = 300e5,
tank_L = 15.1,
fill0 = 0.95,
p_u0 = 40e5,
T0 = 293.15,
burn_s = 3.5 )
protected
A bottle feeding one ullage that grows as the liquid leaves; adiabatic everywhere. The flow
holds the ullage's density (what a regulator nearly does). Explicit Euler on (m, U) of each
volume, h out of the bottle at the step's start, work p dV at the step's start.

Definition at line 120 of file test_layerx_vv.py.

References record().

Referenced by pressurised(), and test_heat_into_the_ullage_shows_as_the_unclosed_part().

◆ pressurised()

test_layerx_vv.pressurised ( )

Definition at line 172 of file test_layerx_vv.py.

References _pressurise().

◆ test_a_consistent_burn_closes_and_counts_its_lines_by_hand()

test_layerx_vv.test_a_consistent_burn_closes_and_counts_its_lines_by_hand ( )

Definition at line 79 of file test_layerx_vv.py.

References _burn().

◆ test_a_leak_shows_as_exactly_its_own_size()

test_layerx_vv.test_a_leak_shows_as_exactly_its_own_size ( )

Definition at line 94 of file test_layerx_vv.py.

References _burn().

◆ test_a_wrong_ullage_volume_does_not_close()

test_layerx_vv.test_a_wrong_ullage_volume_does_not_close ( pressurised)

Definition at line 185 of file test_layerx_vv.py.

◆ test_check_never_raises_and_says_what_it_could_not_do()

test_layerx_vv.test_check_never_raises_and_says_what_it_could_not_do ( )

Definition at line 244 of file test_layerx_vv.py.

References check().

◆ test_convergence_lists_every_pass_against_its_tolerance()

test_layerx_vv.test_convergence_lists_every_pass_against_its_tolerance ( )

Definition at line 253 of file test_layerx_vv.py.

References check().

◆ test_heat_into_the_ullage_shows_as_the_unclosed_part()

test_layerx_vv.test_heat_into_the_ullage_shows_as_the_unclosed_part ( pressurised)
Warm the ullage gas at the end by 2 K at fixed density: that energy was never in the
balance, so R falls by it (R is minus the heat the walls gave the gas).

Definition at line 209 of file test_layerx_vv.py.

References _pressurise().

◆ test_limits_grade_the_balances()

test_layerx_vv.test_limits_grade_the_balances ( pressurised)

Definition at line 266 of file test_layerx_vv.py.

References check().

◆ test_the_burned_mass_counts_each_step_by_its_own_length()

test_layerx_vv.test_the_burned_mass_counts_each_step_by_its_own_length ( )
Each recorded flow is the end-of-step sample of its own step: mdot[i] * dt[i]. The flow
climbs here (as it does when the tanks rise) so that pairing a flow with any other step's
length -- the neighbour's, or a constant -- changes the sum; with a constant flow it would not.

Definition at line 102 of file test_layerx_vv.py.

References _burn().

◆ test_the_energy_balance_closes_to_the_quadrature_of_the_work()

test_layerx_vv.test_the_energy_balance_closes_to_the_quadrature_of_the_work ( pressurised)

Definition at line 192 of file test_layerx_vv.py.

◆ test_the_feed_walk_takes_the_lines_to_the_engine_and_nothing_else()

test_layerx_vv.test_the_feed_walk_takes_the_lines_to_the_engine_and_nothing_else ( )

Definition at line 58 of file test_layerx_vv.py.

◆ test_the_pressurant_balance_closes_on_an_independent_integration()

test_layerx_vv.test_the_pressurant_balance_closes_on_an_independent_integration ( pressurised)

Definition at line 176 of file test_layerx_vv.py.

◆ test_the_reference_run_conserves_what_it_must()

test_layerx_vv.test_the_reference_run_conserves_what_it_must ( )

Definition at line 280 of file test_layerx_vv.py.

References check().

◆ test_vapour_in_the_ullage_is_refused_rather_than_booked_as_error()

test_layerx_vv.test_vapour_in_the_ullage_is_refused_rather_than_booked_as_error ( pressurised)

Definition at line 230 of file test_layerx_vv.py.

References _burn().

Variable Documentation

◆ CP

test_layerx_vv.CP = pytest.importorskip("CoolProp.CoolProp")

Definition at line 25 of file test_layerx_vv.py.

◆ DOC

dict test_layerx_vv.DOC
Initial value:
1= {
2 "nodes": [
3 {"id": "OXT", "data": {"componentType": "TANK", "fluid": "oxygen", "params": {}}},
4 {"id": "FILL", "data": {"componentType": "SOL", "fluid": "oxygen", "params": {}}},
5 {"id": "VENT", "data": {"componentType": "SOL", "fluid": "helium", "params": {}}},
6 {"id": "MVO", "data": {"componentType": "SOL", "fluid": "oxygen", "params": {}}},
7 {"id": "ENG", "data": {"componentType": "ENGINE", "params": {}}},
8 ],
9 "edges": [
10 {"id": "l_fill", "source": "FILL", "target": "OXT", "data": {"params": {"length": _p(0.4, "m"), "bore": _p(12.7, "mm")}}},
11 {"id": "l_vent", "source": "OXT", "target": "VENT", "data": {"params": {"length": _p(0.4, "m"), "bore": _p(9.525, "mm")}}},
12 {"id": "l_ox1", "source": "OXT", "target": "MVO", "data": {"params": {"length": _p(2.0, "in"), "bore": _p(10.92, "mm")}}},
13 {"id": "l_ox2", "source": "MVO", "target": "ENG", "data": {"params": {"length": _p(0.07, "m"), "bore": _p(10.92, "mm")}}},
14 ],
15}

Definition at line 41 of file test_layerx_vv.py.

◆ PSI

float test_layerx_vv.PSI = 6894.757293168361

Definition at line 30 of file test_layerx_vv.py.

◆ REFERENCE

str test_layerx_vv.REFERENCE = RUNS / "20261002-231658-7e47d1.json"

Definition at line 32 of file test_layerx_vv.py.

◆ RUNS

str test_layerx_vv.RUNS = Path(__file__).resolve().parents[1] / ".userdata" / "local" / "engine" / "layerx" / "runs"

Definition at line 31 of file test_layerx_vv.py.