STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
test_blowdown_quick.py
Go to the documentation of this file.
1"""Quick verification test for blowdown solver."""
2import numpy as np
3import sys
4sys.path.insert(0, '/home/adnan/EngineDesign')
5
6from copv.blowdown_solver import simulate_blowdown
7
8# Simple test: constant mass flow
9times = np.linspace(0, 5, 100)
10mdot = np.ones(100) * 1.0 # 1 kg/s
11
12# Simulate blowdown (no real gas for simplicity)
13results = simulate_blowdown(
14 times=times,
15 mdot=mdot,
16 P_initial_Pa=500 * 6894.76, # 500 psi to Pa
17 rho_propellant=1140.0, # LOX density
18 V_tank_total=0.1, # 100L tank
19 m_propellant_initial=50.0, # 50 kg initial
20 R_pressurant=296.803,
21 T_initial_K=300.0,
22 n_polytropic=1.2,
23 use_real_gas=False,
24 Z_interp=None,
25)
26
27print("✓ Blowdown solver test passed!")
28print(f" Initial pressure: {results['P_Pa'][0] / 6894.76:.1f} psi")
29print(f" Final pressure: {results['P_Pa'][-1] / 6894.76:.1f} psi")
30print(f" Pressure decreased: {results['P_Pa'][0] > results['P_Pa'][-1]}")
31print(f" Gas mass constant: {results['m_gas_kg']:.3f} kg")
32print(f" Temperature range: {results['T_K'].min():.1f} - {results['T_K'].max():.1f} K")