36 model = assemble_model(
37 read_diagram(json.loads(STAND.read_text()), name=
"ethalox_stand"),
38 diagram_id=
"ethalox_stand.json",
40 session = open_session(
41 model, load_machine(tables=TABLES), setup=burn_setup(**setup)
43 session.prime(tank_psi=550.0, copv_psi=4500.0, state=
"Ready")
53 """Every tank exactly as ``Tank.initial_state`` built it before the setting."""
55 for sim
in session.tanks.values():
56 rho = sim.tank.liquid.get(
"rho", T=sim.state.liquid_temperature, q=0.0)
57 expected = sim.tank.initial_state(
58 pressure=from_psig(550.0),
59 liquid_mass=sim.tank.geometry.total_volume * 0.95 * rho,
60 liquid_temperature=sim.state.liquid_temperature,
61 gas_temperature=293.15,
65 assert sim.state == expected, sim.id
66 assert not any(
"upper wall at T-0" in note
for note
in session.assumptions)
91 """0.1 s shut in, wall at 150 K against gas at 293 K: the gas cools by
92 hA mean(T_gas - T_wall) t / (m cv) more than with the warm wall."""
93 hold, step = 0.1, 0.02
95 sim = cold.tanks[
"OXT"]
97 T0 = sim.tank.gas_temperature(start)
98 cv = sim.tank.gas.get(
"cv", p=sim.pressure, T=T0)
99 for session
in (warm, cold):
100 for _
in range(int(round(hold / step))):
102 T_warm = warm.tanks[
"OXT"].tank.gas_temperature(warm.tanks[
"OXT"].state)
103 T_cold = sim.tank.gas_temperature(sim.state)
105 (T0 - start.ullage.wall_temperature)
106 + (T_cold - sim.state.ullage.wall_temperature)
108 hand = sim.tank.wall_conductance * gap * hold / (start.ullage.mass * cv)
109 assert T_warm - T_cold == pytest.approx(hand, rel=0.05)
111 assert cold.tanks[
"OXT"].pressure < warm.tanks[
"OXT"].pressure - 5.0 * 6894.757