23from test_pid_drawn_freely
import P, _le4_like, _machine, line, node
33 """LE4's layout: a helium bottle, a regulator, one manifold to two
34 press solenoids, mains into a fixed-pressure engine."""
35 payload: Any = _le4_like()
36 for n
in payload[
"nodes"]:
38 n[
"data"][
"fluidType"] =
"helium"
39 n[
"data"][
"params"] = {
40 "pressure": P(4500,
"psi"),
41 "temperature": P(293,
"K"),
42 "volume": P(4.7,
"L"),
44 payload[
"nodes"].append(
50 "setpoint": P(560,
"psi"),
52 "bore": P(7.75,
"mm"),
53 "flow_droop": P(20,
"psi"),
54 "rated_flow": P(0.02,
"kg/s"),
58 payload[
"edges"] = [e
for e
in payload[
"edges"]
if e[
"id"] !=
"kb-mf"] + [
59 line(
"kb-rg",
"KB",
"RG", to_port=
"l"),
60 line(
"rg-mf",
"RG",
"MF", from_port=
"r"),
62 model = assemble_model(read_diagram(payload, name=
"he manifold"), diagram_id=
"t")
65 n.id: n.label
for n
in model.diagram.nodes
if n.id
in model.built.actuators
68 model, machine, bind(machine, labels, roles=model.built.valve_roles)
70 session.prime(tank_psi=575.0, copv_psi=4500.0, state=
"Ready", hold_s=1.0)
74def _burn(session: Session, seconds: float = 2.0) -> list[float]:
75 for symbol
in session.model.built.actuators:
76 session.set_valve(symbol,
True)
77 ullage = session.model.built.tanks[
"OT"].ullage
79 while session.t < seconds:
80 trace.append(psig(session.step(0.02).pressures[ullage]))
138 """Engine Abort with the fuel loaded and the LOX tank empty (the whole LOX
139 chill window): the fuel drains by gravity through its open main, and its
140 press path is the manifold, vented through the empty LOX tank. That
141 "supply" sits at atmosphere with the tank, so the band was met and the
142 drain over a step beat a tenth of it: 0.27 ms couplings, 33-79 per 20 ms
143 step, the panel 40x slower than real time. A vent one node further on
144 carries nothing across a regulated supply."""
145 from test_ignore_gse
import TABLES, _ids, _session
147 if not TABLES.is_dir():
148 pytest.skip(
"no state machine tables")
150 session = _session(
True)
151 session.state =
"Fuel Fill"
154 fuel = session.tanks[ids[
"Eth-Tank"]]
155 assert fuel.state.liquid_mass > 4.0
156 assert session.tanks[ids[
"LOX-Tank"]].state.liquid_mass == 0.0
157 session.command_state(
"Engine Abort")
158 start = fuel.state.liquid_mass
163 most =
max(most, session.solver_log[-1].couplings)
164 worst =
max(worst, abs(psig(fuel.pressure)))
165 assert start - fuel.state.liquid_mass > 0.01,
"the fuel drains"
166 assert abs(psig(fuel.pressure)) < 0.1,
"at atmosphere"
167 assert most <= 2, f
"{most} coupling steps in one 20 ms step"
171 assert worst < 0.05, f
"the fuel ullage rang {worst:.3f} psi off the air"