Files
pipe-system-simulation-test/src/cryo_tank/config.py
T

58 lines
1.5 KiB
Python

# src/cryo_tank/config.py
"""
Configuration for the cryogenic LN2 tank simulation.
Pure data module -- no functions, no side effects.
"""
import math
# ---------- Tank geometry ----------
V_TOTAL = 420.1e-3 # m^3 (420.1 L)
H_TANK = 0.5 # m (cylinder height)
A_CROSS = V_TOTAL / H_TANK # m^2 (cross-section area)
D_TANK = math.sqrt(4 * A_CROSS / math.pi) # m (diameter)
A_SIDE = math.pi * D_TANK * H_TANK # m^2 (side wall)
A_CAP = A_CROSS # m^2 (top or bottom cap)
A_TOTAL = A_SIDE + 2 * A_CAP # m^2 (total surface)
# ---------- Tank limits ----------
P_WORKING = 0.17e6 # Pa (working pressure, absolute)
P_MAX = 0.8e6 # Pa (max bearing pressure)
# ---------- Initial conditions ----------
T_INIT = 78.0 # K
ULLAGE_FRACTION = 0.30 # gas pocket = 30% of V_TOTAL
# ---------- Inlet / outlet ----------
MDOT_IN_LN2 = 1.144 # kg/s
T_IN_LN2 = 77.0 # K
MDOT_OUT_LN2 = 1.1895 # kg/s
T_IN_HE = 100.0 # K
# ---------- Heat transfer ----------
H_CONV_SURFACE = 0.0 # W/(m^2*K) liquid-to-ullage surface convection
T_ENV = 300.0 # K ambient temperature
# ---------- Simulation control ----------
T_END = 3600.0 # s (1 hour)
RTOL = 1e-8
ATOL = 1e-10
# ---------- Output ----------
OUTPUT_DIR = "results/cryo_tank"
# ---------- Validation ----------
assert V_TOTAL > 0
assert H_TANK > 0
assert 0 < ULLAGE_FRACTION < 1
assert P_WORKING > 0
assert P_MAX > P_WORKING
assert T_INIT > 0
assert MDOT_IN_LN2 >= 0
assert MDOT_OUT_LN2 >= 0
assert T_IN_LN2 > 0
assert T_IN_HE > 0
assert H_CONV_SURFACE >= 0
assert T_ENV > 0
assert T_END > 0