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

Functions

 config ()
 runner (config)
Drawing drawing ()
 prepared (config, runner, drawing)
 _check (prep, key)
 test_dome_dial_matches_the_regulator_relation_by_hand (prepared, drawing)
 test_the_engine_boundary_says_its_drop_is_at_lossless_lines (prepared)
 test_t0_fit_reproduces_enginedesign_at_t0 (config, runner, drawing)
 test_the_line_exit_loses_exactly_the_borda_dump (config)
 test_the_card_matches_enginedesign_on_solves_it_never_saw (prepared, config)
 test_a_card_for_another_engine_fails_its_check (prepared, config)
 test_native_engine_is_not_enginedesign (config, runner, drawing)
 test_preflight_refuses_a_load_that_does_not_fit (config, runner, drawing)
 test_preflight_refuses_a_drawing_without_the_engines_fuel (config, runner, drawing)
 test_settings_ignore_unknown_keys_and_nulls ()
 burned (prepared, runner)
 burned_static (prepared)
 test_a_burn_conserves_propellant (burned, prepared, config)
 test_the_tank_that_runs_dry_is_the_one_the_load_says (burned, config)
 test_a_card_burn_runs_enginedesigns_engine_all_the_way (burned_static)
 test_the_replay_loop_needs_its_feedback_and_closes (burned)
 test_delivered_numbers_are_the_replays (burned)
 test_the_hand_off_is_what_forward_and_flight_read (burned)
 test_a_burn_starts_at_its_lockup_and_reports_its_provenance (burned, drawing)
 test_the_api_runs_a_burn (config, drawing, monkeypatch, tmp_path)

Variables

 feedtwin = pytest.importorskip("feedtwin", reason="lib/feedtwin is not installed (pip install -e ../lib/feedtwin)")
str FIXTURE = Path(__file__).parent / "fixtures" / "ethalox_6500N_doublet_cad_2026-09-28.yaml"
str GN2 = "copv_study_gn2"
 pytestmark

Detailed Description

Layer X: the feed twin and this engine, burned together (engine/layerx).

What these check, and against what:

* The dome dial Layer X solves for is checked against the regulator relation
  written out by hand from the drawing's own numbers: bias, supply-pressure
  effect, gauge zero. It is not checked against the twin's solver.
* The engine card (phase 2) has to reproduce EngineDesign on solves it was not
  fitted to, through the whole burn the twin runs on it, and has to fail its
  check against an engine it was not built from.
* The boundary between the twin's lines and the card is the line exit. What
  EngineDesign loses between the line exit and its manifold is exactly the
  Borda dump of the line's velocity head, checked by hand.
* The T-0 fit (phase 1, kept for comparison) has to make the twin reproduce
  EngineDesign exactly at the calibration point: chamber pressure, thrust, and
  the line-exit-to-chamber drop at EngineDesign's flows.
* A burn has to conserve propellant. Mass that left the tanks equals mass the
  chamber burned, step by step. The tank that runs dry first has to be the one
  the load ratio and the delivered O/F say it is.
* Preflight has to refuse a load that does not fit and a drawing that carries the
  wrong propellant, naming the problem rather than raising.

Physics in the twin itself is covered by lib/feedtwin's suite and by
scripts/physics_benchmark.py. These tests cover the seam.

Function Documentation

◆ _check()

◆ burned()

test_layerx.burned ( prepared,
runner )
The default: card engine, closed against EngineDesign's eroding-chamber replay.

Definition at line 238 of file test_layerx.py.

◆ burned_static()

test_layerx.burned_static ( prepared)
The twin's pass alone, as-built throat: the engine card and nothing else.

Definition at line 244 of file test_layerx.py.

◆ config()

test_layerx.config ( void )

Definition at line 57 of file test_layerx.py.

◆ drawing()

Drawing test_layerx.drawing ( )

Definition at line 67 of file test_layerx.py.

◆ prepared()

test_layerx.prepared ( config,
runner,
drawing )

Definition at line 73 of file test_layerx.py.

◆ runner()

test_layerx.runner ( config)

Definition at line 62 of file test_layerx.py.

◆ test_a_burn_conserves_propellant()

test_layerx.test_a_burn_conserves_propellant ( burned,
prepared,
config )

Definition at line 249 of file test_layerx.py.

References max.

◆ test_a_burn_starts_at_its_lockup_and_reports_its_provenance()

test_layerx.test_a_burn_starts_at_its_lockup_and_reports_its_provenance ( burned,
drawing )

Definition at line 355 of file test_layerx.py.

◆ test_a_card_burn_runs_enginedesigns_engine_all_the_way()

test_layerx.test_a_card_burn_runs_enginedesigns_engine_all_the_way ( burned_static)
At instants across the burn, the twin's chamber and flows against EngineDesign solved at
the same injector-inlet pressures and the same (as-built) geometry. The card's own error is
~0.01 %; the twin's network solve (its 1e-4 tolerance) adds a few hundredths. 0.2 % is the
phase-2 tolerance.

Definition at line 280 of file test_layerx.py.

◆ test_a_card_for_another_engine_fails_its_check()

test_layerx.test_a_card_for_another_engine_fails_its_check ( prepared,
config )
A card is a sampled engine. Check it against a different one -- a 3 % larger throat --
and the check has to say so; served for the new config it is not even the same card.

Definition at line 174 of file test_layerx.py.

◆ test_delivered_numbers_are_the_replays()

test_layerx.test_delivered_numbers_are_the_replays ( burned)

Definition at line 314 of file test_layerx.py.

◆ test_dome_dial_matches_the_regulator_relation_by_hand()

test_layerx.test_dome_dial_matches_the_regulator_relation_by_hand ( prepared,
drawing )
lockup = dome + atmosphere + bias - S x p_bottle (gauge), all in psi.

Every number is read off the drawing JSON directly, not through feedtwin:
PR-DOME's dome_bias 50 psi and supply_coefficient 17 psi/1000 psi. The
supply effect is measured from zero inlet (the drawing's inlet_reference is
not read). The bottle is 4500 psig, the gauge zero is 101325 Pa, and
PR-CTRL adds no bias of its own.

Definition at line 84 of file test_layerx.py.

◆ test_native_engine_is_not_enginedesign()

test_layerx.test_native_engine_is_not_enginedesign ( config,
runner,
drawing )
The gap the calibration closes is real: the twin's own Reynolds-law Cd
drops a different pressure across the injector at EngineDesign's flows.

Definition at line 189 of file test_layerx.py.

References _check().

◆ test_preflight_refuses_a_drawing_without_the_engines_fuel()

test_layerx.test_preflight_refuses_a_drawing_without_the_engines_fuel ( config,
runner,
drawing )

Definition at line 216 of file test_layerx.py.

References _check().

◆ test_preflight_refuses_a_load_that_does_not_fit()

test_layerx.test_preflight_refuses_a_load_that_does_not_fit ( config,
runner,
drawing )

Definition at line 208 of file test_layerx.py.

References _check().

◆ test_settings_ignore_unknown_keys_and_nulls()

test_layerx.test_settings_ignore_unknown_keys_and_nulls ( )

Definition at line 229 of file test_layerx.py.

◆ test_t0_fit_reproduces_enginedesign_at_t0()

test_layerx.test_t0_fit_reproduces_enginedesign_at_t0 ( config,
runner,
drawing )

Definition at line 119 of file test_layerx.py.

◆ test_the_api_runs_a_burn()

test_layerx.test_the_api_runs_a_burn ( config,
drawing,
monkeypatch,
tmp_path )

Definition at line 379 of file test_layerx.py.

References time.time().

◆ test_the_card_matches_enginedesign_on_solves_it_never_saw()

test_layerx.test_the_card_matches_enginedesign_on_solves_it_never_saw ( prepared,
config )

Definition at line 162 of file test_layerx.py.

◆ test_the_engine_boundary_says_its_drop_is_at_lossless_lines()

test_layerx.test_the_engine_boundary_says_its_drop_is_at_lossless_lines ( prepared)
The card's reference is EngineDesign solved with the line exit at the lockup itself, so LOX and
fuel read the same drop by construction (153.1 / 153.1 psi on LE4 (3)) where the burn, after the
drawing's lines, gives ~114 / 108. It was printed as the drop "at T-0".

Definition at line 107 of file test_layerx.py.

References _check().

◆ test_the_hand_off_is_what_forward_and_flight_read()

test_layerx.test_the_hand_off_is_what_forward_and_flight_read ( burned)

Definition at line 329 of file test_layerx.py.

◆ test_the_line_exit_loses_exactly_the_borda_dump()

test_layerx.test_the_line_exit_loses_exactly_the_borda_dump ( config)
EngineDesign at the line exit (its line losses zeroed) drops, between the line exit
and its still manifold, exactly K_exit rho v^2/2 at the exit bore -- by hand from the
config's own density and bore.

Definition at line 142 of file test_layerx.py.

◆ test_the_replay_loop_needs_its_feedback_and_closes()

test_layerx.test_the_replay_loop_needs_its_feedback_and_closes ( burned)
EngineDesign's replay erodes the throat; the twin's first pass, at the as-built throat,
is percents off it. Fed the replay's throat history the twin agrees to a few tenths of a
percent, and the history stops moving. A loop that never applied the history would fail
the second half.

Definition at line 297 of file test_layerx.py.

References max.

◆ test_the_tank_that_runs_dry_is_the_one_the_load_says()

test_layerx.test_the_tank_that_runs_dry_is_the_one_the_load_says ( burned,
config )
Load ratio below the delivered O/F means LOX runs out first, and above
it, fuel. Independent of how either was computed.

Definition at line 270 of file test_layerx.py.

Variable Documentation

◆ feedtwin

test_layerx.feedtwin = pytest.importorskip("feedtwin", reason="lib/feedtwin is not installed (pip install -e ../lib/feedtwin)")

Definition at line 36 of file test_layerx.py.

◆ FIXTURE

str test_layerx.FIXTURE = Path(__file__).parent / "fixtures" / "ethalox_6500N_doublet_cad_2026-09-28.yaml"

Definition at line 45 of file test_layerx.py.

◆ GN2

str test_layerx.GN2 = "copv_study_gn2"

Definition at line 46 of file test_layerx.py.

◆ pytestmark

test_layerx.pytestmark
Initial value:
1= pytest.mark.skipif(
2 not (shipped_drawings_dir() / f"{GN2}.json").is_file(),
3 reason="feed-twin's shipped drawings are not next to this checkout",
4)

Definition at line 50 of file test_layerx.py.