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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657 | # Applied Python PRISM
# (PRISM) PaRametrIc System Model
#
# Written by Charlie Taylor <cet@appliedpython.com>
# Oct,21 2005
from prism.MassItem import MassItem
from prism.isp.cea import CEA_Isp
from math import *
from prism.utils import Constants
from prism.Summary import Summary
from prism.props import Materials
from prism.isp import Nozzle_Eff
from prism.utils import mensuration
from prism.props import Inc_liquid
from prism.engines import ValveSolenoid
from prism.isp import separated_Cf
from prism.utils.Goal import Goal
from prism.pov import POV_Items, POV_Basics
class Engine_Ablative( MassItem ):
def __init__(self, name="engine", mass_lbm=0.0, oxName='N2O4', fuelName='MMH',
tburn = 100.0, hasNozzleExt=1,
cxw=1.25, Pc=150.0, Fvac=100.0, WtIgnAssy=0.0,
epsNozExt=6.0, eps=50.0, mr=1.6, CR=2.5, LoverDt=4.0, LchamMin=1.5, xlnOverLcham=0.5,
etaERE=0.97, etaNoz=0.99, isBell=1, pcentBell=80.0, etaKinInp=1.0,
halfAngDeg=15.0, useFastCEALookup=0, Number=1,
matlInj="SS", cxwInj=1.0, cxwMisc=1.0, cxwValves=1.0, valveMassInp=0,
matlStruct="Ti", calcEtaNoz=1, thkStructMin=0.02, SFstructure=2.0,
matlNozExt="Cb103", thkNozExtMin=0.02,
matlAbl="SiPhen_B", SFablative=1.0,
refCharCham=0.87, refCharThrt=1.15, refCharNoz=0.087, refCharNozEps=7.5,
refCharPc=105.0, refCharTburn=434.0,
thkAblThrtMin=0.030, thkAblChamMin=0.030, thkAblNozMin=0.020,
suppressGasWarning=0, InACan=0, Pamb=0.0 ):
MassItem.__init__(self, name, type="inert")
self.Number = Number # number of engines
self.oxName = oxName
self.fuelName = fuelName
self.iprop = oxName + '/' + fuelName
self.Fvac = Fvac
self.Pc = Pc
self.eps = eps
self.WtIgnAssy = WtIgnAssy
self.hasNozzleExt = hasNozzleExt
if epsNozExt>eps:
self.epsNozExt = eps
else:
self.epsNozExt = epsNozExt
self.mr = mr
self.CR = CR
self.xlnOverLcham = xlnOverLcham
self.LoverDt = LoverDt
self.LchamMin = LchamMin
self.cxw = cxw
self.cxwValves = cxwValves
self.valveMassInp = valveMassInp
self.etaERE = etaERE
self.etaKinInp = etaKinInp
self.Pamb = Pamb
self.isBell = isBell
self.pcentBell = pcentBell
self.halfAngDeg = halfAngDeg
self.etaNoz = etaNoz
self.calcEtaNoz = calcEtaNoz
self.matlInj = matlInj
self.thkStructMin = thkStructMin
self.cxwInj = cxwInj
self.rhoInj, self.syInj, self.eInj, tmingInj = Materials.getMatlProps(matlInj)
self.cxwMisc = cxwMisc
self.matlStruct = matlStruct
self.rhoNoz, self.syNoz, self.eNoz, self.tmingNoz = Materials.getMatlProps(matlStruct)
self.SFstructure = SFstructure
self.matlNozExt = matlNozExt
self.rhoNozExt, self.syNozExt, self.eNozExt, self.tmingNozExt = Materials.getMatlProps(matlNozExt)
self.thkNozExtMin = thkNozExtMin
self.tburn = tburn
self.matlAbl = matlAbl
self.rhoAbl, self.syAbl, self.eAbl, self.tmingAbl = Materials.getMatlProps(matlAbl)
self.SFablative=SFablative
self.refCharCham=refCharCham
self.refCharThrt=refCharThrt
self.refCharNoz=refCharNoz
self.refCharPc=refCharPc
self.refCharTburn=refCharTburn
self.refCharNozEps=refCharNozEps
self.thkAblThrtMin=thkAblThrtMin
self.thkAblChamMin=thkAblChamMin
self.thkAblNozMin=thkAblNozMin
self.suppressGasWarning = suppressGasWarning
self.InACan = InACan
# assume storable liquids for the Ablative engine
self.FlObj = Inc_liquid.Inc_liquid(symbol=fuelName,T=530.0,P=20.0,suppressGasWarning=self.suppressGasWarning)
self.OxObj = Inc_liquid.Inc_liquid(symbol=oxName,T=530.0,P=20.0,suppressGasWarning=self.suppressGasWarning)
if self.OxObj.Q=="GAS":
isGas=1
else:
isGas=0
if not self.valveMassInp:
self.ValveOx = ValveSolenoid.ValveSolenoid( name='ox valve', Number=1, cxw=cxwValves, isGas=isGas )
if self.FlObj.Q=="GAS" :
isGas=1
else:
isGas=0
if not self.valveMassInp:
self.ValveFl = ValveSolenoid.ValveSolenoid( name='fuel valve', Number=1, cxw=cxwValves, isGas=isGas )
self.ispObj = CEA_Isp.CEA_Isp( oxName=oxName, fuelName=fuelName, useFastLookup=useFastCEALookup ) # create isp calculating object
self.reCalc()
def getPOV_Item(self):
# be sure to include pov_h, pov_w, and pov_d calcs in reCalc
if hasattr( self, 'texture'):
texture = self.texture
else:
if self.InACan:
texture = POV_Basics.Texture( colorName="Brown" )
else:
texture = POV_Basics.Texture( colorName="Coral" )
#sIn = POV_Items.TCA_Bell( xlc=self.xlc , xln=self.xln, CR=self.CR,
# Rt=self.Dt/2., eps=self.eps, pcentBell=self.pcentBell, texture=texture)
sIn = POV_Items.TCA_Bell( xlc=self.xlc , xln=self.xln, CR=self.CR,
Rt=self.Dt/2., eps=self.eps, pcentBell=self.pcentBell, texture=texture,
isBell=self.isBell, halfAngDeg=self.halfAngDeg)
return sIn
def getPOV_ItemOutside(self):
# be sure to include pov_h, pov_w, and pov_d calcs in reCalc
if hasattr( self, 'texture'):
texture = self.texture
else:
texture = POV_Basics.Texture( colorName="Brown" )
if self.InACan:
shell = POV_Items.HollowCylinder( OD=self.RmaxInACan*2. ,
thickness=self.thkExitInACan, height=self.xlc+self.xln+self.Lnoz,
texture=texture )
return shell
else:
RtOut = self.Dt/2. + self.thkAblThrt + self.thkCham
RcOut = self.Dcham/2.0 + self.thkAblCham + self.thkCham
CRout = (RcOut/RtOut)**2
epsOut = ((self.Dexit/2.0 + self.thkAblNoz + self.thkCham)/RtOut)**2
pcBellOut = self.Lnoz/(sqrt(epsOut)-1.0) / (RtOut/100.0/tan(15.0*pi/180.0))
sOut = POV_Items.TCA_Bell( xlc=self.xlc , xln=self.xln, CR=CRout,
Rt=RtOut, eps=epsOut, pcentBell=pcBellOut, texture=texture)
return sOut
def set_Dexit(self, DexitGoal=40., epsMax=150.0):
'''Find area ratio (eps) that gives Dexit=DexitGoal'''
# calc divert engine area ratio
def newDexit( e ):
self.eps = e
self.reCalc()
return self.Dexit
G = Goal(goalVal=DexitGoal, minX=1.1, maxX=epsMax,
funcOfX=newDexit, tolerance=1.0E-5, maxLoops=40, failValue=epsMax)
eps, ierror = G()
self.eps = eps
self.reCalc()
def set_Dthrt(self, DthrtGoal=10., pcMin=50.0, pcMax=5000.0):
'''Find area ratio (Pc) that gives Dthrt=DthrtGoal'''
# calc divert engine area ratio
def newDthrt( Pc ):
self.Pc = Pc
self.reCalc()
return self.Dt
G = Goal(goalVal=DthrtGoal, minX=pcMin, maxX=pcMax,
funcOfX=newDthrt, tolerance=1.0E-5, maxLoops=40, failValue=pcMax)
Pc, ierror = G()
self.Pc = Pc
self.reCalc()
def reCalc(self, autoCalc=1):
self.autoCalc = autoCalc
# set design variables
self.IspODE,self.CstarODE,self.Tc, self.mw, self.gam = \
self.ispObj.get_IvacCstrTc_ThtMwGam( Pc=self.Pc, MR=self.mr, eps=self.eps)
#self.IspODE,self.CstarODE,self.Tc = \
# self.ispObj.get_IvacCstrTc(Pc=self.Pc, MR=self.mr, eps=self.eps)
self.PcOvPexit = self.ispObj.get_PcOvPe(Pc=self.Pc, MR=self.mr, eps=self.eps)
self.Pexit = self.Pc / self.PcOvPexit
if self.calcEtaNoz:
if self.isBell:
isConical=0
else:
isConical=1
self.etaBL,self.etaDiv,self.etaKin, etaCf = \
Nozzle_Eff.calcNozzleEfficiency(Pc=self.Pc, Fvac=self.Fvac, eps=self.eps,
epsAtt=self.eps, isConical=isConical, pcentBell=self.pcentBell, halfAngleDeg=self.halfAngDeg,
iprop=self.iprop, mr=self.mr, etaKinInp=self.etaKinInp,
adjBL=1.0, adjKin=1.0, adjDiv=1.0, isRegenCham=0, isRegenNoz=0 )
self.etaNoz = etaCf
self.effIsp = self.etaERE * self.etaNoz
self.Isp = self.IspODE * self.effIsp
self.Cstar = self.CstarODE * self.etaERE
self.Cfvac = self.Isp * 32.174 / self.Cstar
self.wdotTot = self.Fvac / self.Isp
self.wdotOx = self.wdotTot * self.mr / (1.0 + self.mr)
self.wdotFl = self.wdotTot - self.wdotOx
self.volDotOx = self.wdotOx / self.OxObj.rho
self.volDotFl = self.wdotFl / self.FlObj.rho
if self.valveMassInp:
self.WtValves = self.valveMassInp
else:
self.ValveOx.cuInchPerSec = self.volDotOx
self.ValveFl.cuInchPerSec = self.volDotFl
self.ValveOx.reCalc()
self.ValveFl.reCalc()
self.WtValves = self.ValveOx.mass_lbm + self.ValveFl.mass_lbm
if self.FlObj.Q=="GAS" or self.OxObj.Q=="GAS":
ftPerSec = 300.0 # through valve
else:
ftPerSec = 30.0 # through valve
self.dFlowFl = sqrt( 4.0 * self.volDotFl/ pi / ftPerSec)
self.dFlowOx = sqrt( 4.0 * self.volDotOx / pi / ftPerSec)
# weight of two identical valves
#self.WtValves = 2.0 * 0.268 * (self.dFlow/1.279)**2
#if self.WtValves < 0.2: # minimum of 45 grams per valve (90 total)
# self.WtValves = 0.2
#self.WtValves *= self.cxwValves
self.WtMisc = 0.319 * ((self.dFlowOx/1.279)**2 + (self.dFlowFl/1.279)**2) / 2.0 # scale miscellaneous like valve
if self.WtMisc < 0.1:
self.WtMisc = 0.1
self.WtMisc *= self.cxwMisc
self.At = self.Cstar* self.wdotTot / self.Pc / Constants.gc
self.Dt = sqrt( self.At / pi ) * 2.0
self.Dcham = self.Dt * sqrt( self.CR )
self.Lcham = self.Dt * self.LoverDt
if self.Lcham < self.LchamMin:
self.Lcham = self.LchamMin
self.Dexit = self.Dt * sqrt( self.eps )
self.DnozAttach = self.Dt * sqrt( self.epsNozExt )
self.xln = self.xlnOverLcham * self.Lcham
self.xlc = self.Lcham - self.xln
if self.isBell:
self.Lnoz = (sqrt(self.eps)-1.0)*self.pcentBell*(self.Dt/2.0)/100.0/tan(15.0*pi/180.0)
# curve fit of ratio to minimum length rao nozzle
self.ratmlr = (self.pcentBell/100.0) * 1612.1/(self.eps + 1009.0)
self.SAnoz = self.Dt**2/4.*(3.368*(self.eps+10.875)**1.2606 + \
self.eps*(self.ratmlr-1.25)*10.75)
self.SAatt = self.Dt**2/4.*(1.537+1.303*(self.ratmlr-1.25))*\
self.epsNozExt**1.705*(0.4558+1.678*exp(-.056305*self.eps))
else:
self.Lnoz = (sqrt(self.eps)-1.0)*(self.Dt/2.0)/tan(self.halfAngDeg*pi/180.0)
r1 = self.Dt/2.0
r2 = self.Dexit/2.0
self.SAnoz = pi * sqrt((r1-r2)**2 + self.Lnoz**2) * (r1+r2)
HATT = (ra-r1)/tan(self.halfAngDeg*pi/180.0)
ra = self.DnozAttach/2.0
self.SAatt = pi*(r1+ra)*sqrt(HATT**2+(ra-r1)**2)
# if there's a nozzle extension, weigh it
if (self.epsNozExt < self.eps) and self.hasNozzleExt:
# there is a nozzle extension
self.thkNozExt = self.thkNozExtMin
self.WtNozExt = self.rhoNozExt * self.thkNozExt * (self.SAnoz-self.SAatt)
else:
# no nozzle extension
self.WtNozExt = 0.0
self.SAatt = self.SAnoz
# calculate ablative
self.thkAblCham = self.Pc**0.4 * self.tburn**0.5 * self.refCharCham * self.SFablative\
/ (self.refCharPc**0.4 * self.refCharTburn**0.5)
self.thkAblThrt = self.Pc**0.2 * self.tburn**0.77 * self.refCharThrt * self.SFablative\
/ (self.refCharPc**0.2 * self.refCharTburn**0.77)
if self.hasNozzleExt:
epsCalc = self.epsNozExt
else:
epsCalc = self.eps
self.thkAblNoz = exp(-0.0247*epsCalc) * self.tburn**0.5 * self.refCharNoz * self.SFablative\
/ (exp(-0.0247*self.refCharNozEps) * self.refCharTburn**0.5)
if self.thkAblThrt < self.thkAblThrtMin:
self.thkAblThrt = self.thkAblThrtMin
if self.thkAblCham < self.thkAblChamMin:
self.thkAblCham = self.thkAblChamMin
if self.thkAblNoz < self.thkAblNozMin:
self.thkAblNoz = self.thkAblNozMin
# apply the InACan design... make constant outside
if self.InACan:
Rmax = max( self.Dcham/2.+self.thkAblCham, self.Dt/2.+self.thkAblThrt, self.Dexit/2.+self.thkAblNoz)
self.thkAblThrt = Rmax - self.Dt/2.
self.thkAblCham = Rmax - self.Dcham/2.
self.thkAblNoz = Rmax - self.Dexit/2.
self.RmaxInACan = Rmax
self.thkExitInACan = Rmax - self.Dexit/2.
self.ODcham = self.Dcham + 2.0*self.thkAblCham # correct right after structural calc
# calculate chamber Ablative Volume
VolumeChamAbl = mensuration.solidCylVol( self.ODcham, self.xlc )\
+ mensuration.solidFrustrumVol( self.ODcham, (self.Dt+2.0*self.thkAblThrt), self.xln )\
- mensuration.solidCylVol( self.Dcham, self.xlc )\
- mensuration.solidFrustrumVol( self.Dcham, self.Dt, self.xln )
self.WtAblCham = VolumeChamAbl * self.rhoAbl
# calculate Nozzle Ablative Volume
sqrtNozExt = sqrt( epsCalc )
aveThkNozAbl = (self.thkAblThrt + sqrtNozExt*self.thkAblNoz) / (1.0 + sqrtNozExt)
VolumeNozAbl = aveThkNozAbl * self.SAatt
self.WtAblNoz = VolumeNozAbl * self.rhoAbl
# calculate structural thickness
self.thkCham = 0.06 * (25000./self.syNoz) * (self.Pc/1000.0) * (self.ODcham/1.48) * self.SFstructure
if self.thkCham < self.thkStructMin:
self.thkCham = self.thkStructMin
# correct OD for structural thickness
self.ODcham += 2.0*self.thkCham
self.thkNoz = (self.thkCham*0.9 + 3.5*self.tmingNoz) * self.SFstructure / 4.5
if self.thkNoz < self.thkStructMin:
self.thkNoz = self.thkStructMin
self.WtNoz = self.thkNoz * self.SAatt * self.rhoNoz
VolChamber = mensuration.cylVol( self.thkCham, self.Dcham, self.Lcham/2.0 ) + \
mensuration.coneVol( self.thkCham, self.Dcham, self.Dt, self.Lcham/2.0 )
self.WtChamber = VolChamber * self.rhoNoz # chamber is made of same matl as nozzle
thkMultAcc = 0.05 + 0.25/self.Dcham
VolAcustic = mensuration.cylVol( thkMultAcc*self.Dcham, self.Dcham, self.Lcham/2.0 )
self.WtAcustic = VolAcustic * self.rhoNoz
# the injector ht also gets smaller with increased Dcham
htMultDCham = min(1.5, 1.25/self.Dcham)
htInj = self.Dcham*htMultDCham
VolInj = mensuration.solidCylVol( self.Dcham*1.1 , htInj )
if self.InACan:
thkFlange = min( (self.ODcham - self.Dcham*1.1)/2.0, htInj/2.0 )
VolFlange = mensuration.cylVol( thkFlange, self.Dcham*1.1, self.thkCham*1.5 )
self.WtCanFlange = self.rhoInj * VolFlange
else:
self.WtCanFlange = 0.0
self.WtInj = self.rhoInj * VolInj * self.cxwInj
self.Lengine = self.Lnoz + self.Lcham + self.Dcham # use Dcham as an inj face fwd length
# add up parts
self.mass_lbm = self.WtNoz + self.WtChamber + self.WtInj + self.WtAcustic + \
self.WtMisc + self.WtAblCham + self.WtAblNoz + self.WtNozExt + self.WtIgnAssy +\
self.WtCanFlange
self.mass_lbm = self.Number * ( self.mass_lbm * self.cxw + self.WtValves )
self.FtoW = self.Fvac * self.Number / self.mass_lbm
self.PfaceOvPc =(1. + .25/self.CR**1.8) # multiply time Pc to get PcFace
self.PcFace = self.Pc * self.PfaceOvPc
if self.Pamb > 0.0:
CfOvCfvacAtEsep, CfOvCfvac, Cfsep, CfiVac, CfiAmbSimple, CfVac, epsSep, Psep = \
separated_Cf.sepNozzleCf(self.gam, self.eps, self.Pc, self.Pamb)
if self.Pexit > Psep:
self.IspAmb = self.Isp - self.Cstar*self.Pamb*self.eps/self.Pc/32.174
self.CfAmb = self.IspAmb * 32.174 / self.Cstar
else:
IspODEepsSep,CstarODE,Tc = \
self.ispObj.get_IvacCstrTc(Pc=self.Pc, MR=self.mr, eps=epsSep)
CfvacAtEsep = self.Cfvac * IspODEepsSep / self.IspODE
self.CfAmb = CfvacAtEsep * CfOvCfvacAtEsep
self.IspAmb = self.CfAmb * self.Cstar / 32.174
# figure out mode of nozzle operation
if self.Pexit > Psep:
if self.Pexit > self.Pamb:
self.mode = 'UnderExpanded (Pe=%g)'%self.Pexit
else:
self.mode = 'OverExpanded (Pe=%g)'%self.Pexit
else:
self.mode = 'Separated (Psep=%g, epsSep=%g)'%(Psep,epsSep)
# calc ambient thrust
self.Famb = self.wdotTot * self.IspAmb
else:
self.IspAmb = self.Isp
self.Famb = self.Fvac
def buildSummary(self):
summList = []
summ = Summary( summName='Bipropellant Engine',
componentName=self.name, mass_lbm=self.mass_lbm, type=self.type)
summ.addAssumption( 'Propellants : ' + self.oxName + ' / ' + self.fuelName )
summ.addAssumption( 'NASA CEA Code for ODE performance ')
summ.addAssumption( 'Physical Weight Model ')
summ.addAssumption( 'Injector Material is ' + self.matlInj)
summ.addAssumption( 'Structural Material is ' + self.matlStruct)
summ.addAssumption( 'Ablative Material is ' + self.matlAbl)
if (self.epsNozExt < self.eps) and self.hasNozzleExt:
summ.addAssumption( 'Nozzle Extension Material is ' + self.matlNozExt)
if self.isBell:
summ.addAssumption( 'Bell Nozzle with Percent Bell = %g'%self.pcentBell)
else:
summ.addAssumption( 'Conical Nozzle with Half Angle = %g deg'%self.halfAngDeg )
if self.InACan:
summ.addAssumption( 'Uses the Canister Design for the chamber and nozzle')
if self.Number>1:
summ.addAssumption( 'Mass is for %i engines total'%self.Number )
#summ.addInput(self, label='generic param', value=0.0, units='', format='%g')
summ.addInput('Fvac', self.Fvac, 'lbf', '%g')
summ.addInput('tburn', self.tburn, 'sec', '%.1f')
summ.addInput('Pc', self.Pc, 'psia', '%.1f')
summ.addInput('eps', self.eps, '', '%g')
if (self.epsNozExt < self.eps) and self.hasNozzleExt:
summ.addInput('epsNozExt',self.epsNozExt,'','%g')
if self.isBell:
summ.addInput('%Bell', self.pcentBell, '%', '%.2f')
else:
summ.addInput('halfAngDeg', self.halfAngDeg, 'deg', '%.2f')
summ.addInput('mr', self.mr, '', '%g')
summ.addInput('CR', self.CR, '', '%g')
summ.addInput('LoverDt', self.LoverDt, '', '%g')
summ.addInput('LchamMin',self.LchamMin, 'in', '%.3f')
summ.addInput('xlnOverLcham', self.xlnOverLcham, '', '%g')
summ.addInput('thkStructMin',self.thkStructMin, 'in', '%.3f')
summ.addInput('thkAblThrtMin',self.thkAblThrtMin, 'in', '%.3f')
summ.addInput('thkAblChamMin',self.thkAblChamMin, 'in', '%.3f')
summ.addInput('thkAblNozMin',self.thkAblNozMin, 'in', '%.3f')
summ.addInput('cxwInj', self.cxwInj, '', '%g')
summ.addInput('cxwValves', self.cxwValves, '', '%g')
summ.addInput('cxwMisc', self.cxwMisc, '', '%g')
summ.addInput('cxw', self.cxw, '', '%g')
summ.addInput('etaERE', self.etaERE, '', '%g')
if not self.calcEtaNoz:
summ.addInput('etaNoz', self.etaNoz, '', '%g')
if self.Pamb > 0.0:
summ.addInput('Pamb', self.Pamb, 'psia', '%g')
# outputs
summ.addOutput('Isp', self.Isp, 'sec', '%g')
summ.addOutput('Cstar', self.Cstar, 'ft/sec', '%.1f')
if self.calcEtaNoz:
summ.addOutput('etaBL', self.etaBL, '', '%g')
summ.addOutput('etaDiv', self.etaDiv, '', '%g')
summ.addOutput('etaKin', self.etaKin, '', '%g')
summ.addOutput('etaNoz', self.etaNoz, '', '%g')
summ.addOutput('effIsp', self.effIsp, '', '%g')
summ.addOutput('IspODE', self.IspODE, 'sec', '%g')
summ.addOutput('CstarODE', self.CstarODE, 'ft/sec', '%.1f')
summ.addOutput('Tc', self.Tc, 'degR', '%.1f')
summ.addOutput('PcFace', self.PcFace, 'psia', '%g')
summ.addOutput('Pexit', self.Pexit, 'psia', '%g')
summ.addOutput('wdotTot', self.wdotTot, 'lbm/sec', '%g')
summ.addOutput('wdotOx ', self.wdotOx , 'lbm/sec', '%g')
summ.addOutput('wdotFl', self.wdotFl, 'lbm/sec', '%g')
summ.addOutput('rhoFl', self.FlObj.rho, 'lbm/cuin', '%.4f')
summ.addOutput('rhoOx', self.OxObj.rho, 'lbm/cuin', '%.4f')
summ.addOutput('volDotOx ', self.volDotOx , 'cuin/sec', '%g')
summ.addOutput('volDotFl', self.volDotFl, 'cuin/sec', '%g')
summ.addOutput('dFlowOx',self.dFlowOx,'in','%.3f')
summ.addOutput('dFlowFl',self.dFlowFl,'in','%.3f')
summ.addOutput('At', self.At, 'sqin', '%g')
summ.addOutput('Dt', self.Dt, 'in', '%.3f')
summ.addOutput('ODcham', self.ODcham, 'in', '%.3f')
summ.addOutput('Dcham', self.Dcham, 'in', '%.3f')
summ.addOutput('Dexit', self.Dexit, 'in', '%.3f')
summ.addOutput('Lcham', self.Lcham, 'in', '%.3f')
summ.addOutput('xlc', self.xlc, 'in', '%.3f')
summ.addOutput('xln', self.xln, 'in', '%.3f')
summ.addOutput('Lnoz', self.Lnoz, 'in', '%.3f')
summ.addOutput('Lengine', self.Lengine, 'in', '%.3f')
summ.addOutput('rhoInj', self.rhoInj, 'lbm/cuin', '%.3f')
summ.addOutput('rhoNoz', self.rhoNoz, 'lbm/cuin', '%.3f')
summ.addOutput('rhoAbl', self.rhoAbl, 'lbm/cuin', '%.3f')
summ.addOutput('thkCham', self.thkCham, 'in', '%.3f')
summ.addOutput('thkNoz', self.thkNoz, 'in', '%.3f')
summ.addOutput('thkAblCham', self.thkAblCham, 'in', '%.3f')
summ.addOutput('thkAblThrt', self.thkAblThrt, 'in', '%.3f')
summ.addOutput('thkAblNoz', self.thkAblNoz, 'in', '%.3f')
summ.addOutput('WtNozStruct', self.WtNoz, 'lbm', '%.3f')
summ.addOutput('WtChamberStruct', self.WtChamber, 'lbm', '%.3f')
summ.addOutput('WtAblCham', self.WtAblCham, 'lbm', '%.3f')
summ.addOutput('WtAblNoz', self.WtAblNoz, 'lbm', '%.3f')
summ.addOutput('WtInj', self.WtInj, 'lbm', '%.3f')
summ.addOutput('WtAcustic',self.WtAcustic, 'lbm', '%.3f')
summ.addOutput('WtCanFlange', self.WtCanFlange, 'lbm', '%.3f')
summ.addOutput('WtValves(2)',self.WtValves, 'lbm', '%.3f')
summ.addOutput('WtMisc',self.WtMisc, 'lbm', '%.3f')
summ.addOutput('WtNozExt',self.WtNozExt, 'lbm', '%.3f')
summ.addOutput('WtIgnAssy',self.WtIgnAssy,'lbm', '%.3f')
summ.addOutput( 'wt/Engine', self.mass_lbm/self.Number, 'lbm', '%.3f' )
if self.Number>1:
summ.addOutput('F/W', self.Number * self.Fvac/self.mass_lbm, 'lbf/lbm', '%.3f')
else:
summ.addOutput('F/W', self.Fvac/self.mass_lbm, 'lbf/lbm', '%.3f')
if self.Pamb > 0.0:
summ.addOutput('IspAmb', self.IspAmb, 'sec', '%g')
summ.addOutput('Famb', self.Famb, 'lbf', '%g')
summ.addOutput('nozzle condition', self.mode, '', '%s')
summList.append( summ )
# ======== now valves
if not self.valveMassInp:
summList.append( self.ValveOx.buildSummary() )
summList.append( self.ValveFl.buildSummary() )
return summList
if __name__ == "__main__": #self test
print "Actual Transtage engine mass =",211,"lbm"
h = Engine_Ablative(name="Transtage Ablative Engine", mass_lbm=0.0, oxName='N2O4', fuelName='MMH',
tburn = 434.0, SFstructure=4.0,
cxw=1.29, Pc=105.0, Fvac=8240.0, eps=40.0, mr=2.0, CR=2.5, LoverDt=2.5,
etaERE=0.97, matlInj="Al", cxwInj=1.0, isBell=1, pcentBell=67.45,
halfAngDeg=15.0, useFastCEALookup=0, Number=1, calcEtaNoz=1)
print h.getMassStr()
print
print h.getSummary()
print "============================================================="
print "Actual Apollo Subscale engine mass =",95,"lbm"
h = Engine_Ablative(name="Subscale Apollo", mass_lbm=0.0, oxName='N2O4', fuelName='MMH',
tburn = 2000.0,epsNozExt=6.0,
cxw=1.225, Pc=100.0, Fvac=2200.0, eps=60.0, mr=2.0, CR=2.5, LoverDt=2.5,
etaERE=0.97, matlInj="SS", cxwInj=1.0, isBell=1, pcentBell=67.45,
halfAngDeg=15.0, useFastCEALookup=0, Number=1, calcEtaNoz=1,
matlStruct="SiPhen_B",matlAbl="SiPhen_B",matlNozExt="Cb103",)
print h.getMassStr()
print
print h.getSummary()
print "============================================================="
print "Estimated GOX/GCH4 Engine mass =",18,"lbm"
h = Engine_Ablative(name="GOX/Ethanol RCS Engine", mass_lbm=0.0, oxName='O2', fuelName='Ethanol',
tburn = 200.0,epsNozExt=20.0, WtIgnAssy=13.5, valveMassInp=2.2,
cxw=1.0, Pc=100.0, Fvac=100.0, eps=25.0, mr=1.5, CR=2.5, LoverDt=2.5,
etaERE=0.97, matlInj="SS", cxwInj=1.0, isBell=1, pcentBell=80.0, cxwMisc=0.25,
halfAngDeg=15.0, useFastCEALookup=0, Number=24, calcEtaNoz=1,
matlStruct="SiPhen_B",matlAbl="SiPhen_B",matlNozExt="Cb103",suppressGasWarning=1)
print h.getMassStr()
print
print h.getSummary()
print "============================================================="
print "Estimated GOX/GCH4 Engine mass =",18,"lbm"
h = Engine_Ablative(name="GOX/GCH4 RCS Engine", mass_lbm=0.0, oxName='O2', fuelName='CH4',
tburn = 200.0,epsNozExt=20.0, WtIgnAssy=13.5, valveMassInp=2.2, cxwMisc=0.25,
cxw=1.0, Pc=100.0, Fvac=100.0, eps=20.0, mr=2.5, CR=2.5, LoverDt=2.5,
etaERE=0.97, matlInj="SS", cxwInj=1.0, isBell=1, pcentBell=80.0,
halfAngDeg=15.0, useFastCEALookup=0, Number=1, calcEtaNoz=1,
matlStruct="SiPhen_B",matlAbl="SiPhen_B",matlNozExt="Cb103",suppressGasWarning=1,
Pamb=14.7)
#h.set_Dthrt( DthrtGoal=1., pcMin=50.0, pcMax=5000.0)
print h.getMassStr()
print
print h.getSummary()
|