forked from mvernacc/aerospike-nozzle-design-gui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nozzle_solver_test.py
34 lines (24 loc) · 920 Bytes
/
nozzle_solver_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Aerospike Nozzle Design Solver Tests
# Matthew Vernacchia - MIT Rocket Team
# 2014 Jan 17
from nozzle_solver import *
import time
for Pa in [101e3, 50e3, 25e3, 10e3, 1e3]:
alt = get_alt_from_Pa(Pa)
print 'Atmo pressure of %.0f KPa at %.0f m altitude'%(Pa/1e3, alt)
test_params = EngineParameters(Tc=1900, Pc=5e6, molar_m=20.18, gamma=1.27, Re=0.015, er=12)
Me = get_Mach(test_params)
print 'Test params exit Mach number = %.2f (should be 3.64)'%(Me)
Pe = get_Pe(test_params)
print 'Test params exit pressure = %.2f (should be 40283.20 Pa)'%(Pe)
Re = get_Re_from_mass_flow(test_params, 0.2196)
print 'Test params exit radius = %.4f (should be 0.0150 m)'%(Re)
Re = get_Re_from_thrust(test_params, 470)
print 'Test params exit radius = %.4f (should be about 0.0150 m)'%(Re)
ns = NozzleSolver()
ns.solve(test_params, 57e3)
ns.plot()
print 'plotted once'
ns.plot()
print 'plotted twice'
time.sleep(10)