STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_injector_stream_flow.py
Go to the documentation of this file.
1"""The injector's feed-loss / orifice closure is a root per stream, not a relaxed fixed point.
2
3At a fixed Pc the two streams do not interact. The old loop relaxed both together at w = 0.35
4with a 1e-6 step test: it stopped ~2e-6 short of the root, and whenever the chamber solver probed
5a Pc above one tank it ran all 150 steps (that stream's flow shrinking by 0.65 a step, never
6"converging") and logged a warning each time -- ~12,000 lines in one Layer 1 run.
7"""
8import logging
9
10import pytest
11
12PSI = 6894.757
13
14
16 from engine.pipeline.io import load_config
17 from engine.core.injectors.impinging import ImpingingInjector
18
19 cfg = load_config("configs/ethalox_6500N.yaml")
20 if getattr(cfg.injector, "plate", None) is not None:
21 cfg.injector.plate.manifold_model = "plenum" # the plenum closure; rings: test_injector_ring_manifold
22 return ImpingingInjector(cfg)
23
24
25@pytest.mark.parametrize("pc_psi", [300.0, 420.0, 500.0])
27 P_tank = 584.27 * PSI
28 mo, mf, d = _injector().solve(P_tank, P_tank, pc_psi * PSI)
29 assert mo > 0 and mf > 0
30 assert mo == pytest.approx(d["mdot_from_bernoulli_O"], rel=1e-10)
31 assert mf == pytest.approx(d["mdot_from_bernoulli_F"], rel=1e-10)
32 assert d["P_injector_O"] == pytest.approx(P_tank - d["delta_p_feed_O"], rel=1e-12)
33 assert d["delta_p_injector_F"] == pytest.approx(d["P_injector_F"] - pc_psi * PSI, rel=1e-12)
34
35
37 caplog.set_level(logging.WARNING)
38 mo, mf, d = _injector().solve(584.27 * PSI, 380.0 * PSI, 400.0 * PSI)
39 assert mf == 0.0
40 assert mo > 0.0
41 assert d["feed_orifice_coupling_iterations"] < 40
42 assert not [r for r in caplog.records if "feed-orifice" in r.getMessage() or "stream flow" in r.getMessage()]
test_a_tank_at_or_below_pc_does_not_flow_and_does_not_iterate(caplog)
test_returned_flow_is_the_bernoulli_flow_at_the_returned_head(pc_psi)