代码仓库移植

This commit is contained in:
ljz committed 2026-06-03 15:41:04 +08:00
commit 0f57ba94f3
44 files changed
+7119

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
# src/cryo_tank/config.py
"""
Configuration for the cryogenic LN2 tank simulation.
Pure data module -- no functions, no side effects.
"""
import math
# ---------- Gas constants ----------
R_UNIVERSAL = 8314.46 # J/(kmol*K)
M_N2 = 28.014 # kg/kmol
M_HE = 4.0026 # kg/kmol
R_HE = R_UNIVERSAL / M_HE # 2077.1 J/(kg*K)
R_N2 = R_UNIVERSAL / M_N2 # 296.8 J/(kg*K)
# ---------- 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 = 50.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