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 | # 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.engines.SA_Nozzle import getEngineSurfaceArea
from prism.pov import POV_Items, POV_Basics
class Engine_Regen( MassItem ):
def __init__(self, name="regen engine", mass_lbm=0.0, oxName='LOX', fuelName='Ethanol',
cxw=1.25, Pc=550.0, Fvac=10000.0, eps=25.0, mr=1.8, DtInp=None,
CR=2.5, LoverDt=4.0, LchamMin=1.5, xlnOverLcham=0.5,
etaERE=0.97, etaNoz=0.99, matlInj="SS", cxwInj=1.0, cxwValves=1.0, isBell=1, pcentBell=80.0,
halfAngDeg=15.0, useFastCEALookup=0, Number=1, etaKinInp=1.0,
calcEtaNoz=1, thkNozExtMin=0.03, matlNozExt="Cb103", minBipropValveWt=0.2,
inputIspDel=0, IspDel=300.0, valvesMassInput=None, Pamb=0.0,
epsNozExt=6.0, SFcloseout=2.0, matlCloseout='Ni', matlGasWall="CuZr",
thkMinCloseout=0.05, thkMinGasWall=0.05, aveLandWidth=0.05, aveChannelWidth=0.05,
aveChannelHeight=0.05):
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.DtInp = DtInp # if DtInp is input, then Fvac is calculated
self.Pc = Pc
self.eps = eps
self.mr = mr
self.CR = CR
self.xlnOverLcham = xlnOverLcham
self.LoverDt = LoverDt
self.LchamMin = LchamMin
self.cxw = cxw
self.cxwValves = cxwValves
self.minBipropValveWt = minBipropValveWt
self.etaERE = etaERE
self.etaKinInp = etaKinInp
self.Pamb = Pamb
self.inputIspDel = inputIspDel
self.IspDel = IspDel
self.isBell = isBell
self.pcentBell = pcentBell
self.halfAngDeg = halfAngDeg
self.etaNoz = etaNoz
self.calcEtaNoz = calcEtaNoz
self.matlInj = matlInj
self.thkNozExtMin = thkNozExtMin
self.cxwInj = cxwInj
self.rhoInj, self.syInj, self.eInj, tmingInj = Materials.getMatlProps(matlInj)
self.matlNozExt = matlNozExt
self.rhoNozExt, self.syNozExt, self.eNozExt, self.tmingNozExt = Materials.getMatlProps(matlNozExt)
self.epsNozExt = epsNozExt
self.SFcloseout = SFcloseout
self.matlCloseout = matlCloseout
self.matlGasWall = matlGasWall
self.thkMinCloseout = thkMinCloseout
self.thkMinGasWall = thkMinGasWall
self.aveLandWidth = aveLandWidth
self.aveChannelWidth = aveChannelWidth
self.aveChannelHeight = aveChannelHeight
self.rhoCloseout, self.syCloseout, self.eCloseout, self.tmingCloseout = Materials.getMatlProps(matlCloseout)
self.rhoGasWall, self.syGasWall, self.eGasWall, self.tmingGasWall = Materials.getMatlProps(matlGasWall)
# assume storable liquids for the FFC engine
self.FlObj = Inc_liquid.Inc_liquid(symbol=fuelName,T=None,P=Pc*1.5)
self.OxObj = Inc_liquid.Inc_liquid(symbol=oxName,T=None,P=Pc*1.5)
# assume identical ox and fuel valves
self.valvesMassInput = valvesMassInput # if input, then do NOT calculate
if valvesMassInput:
self.Valves = None
else:
self.Valves = ValveSolenoid.ValveSolenoid( name='biprop valves', Number=2, cxw=cxwValves )
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:
texture = POV_Basics.Texture( colorName="Coral" )
s = 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 s
def reCalc(self, autoCalc=1):
self.autoCalc = autoCalc
# set design variables
if self.DtInp:
self.Dt = self.DtInp
self.At = pi * self.Dt**2/4.0 # used in calcNozzleEfficiency
else:
self.Dt = None
self.At = None # used in calcNozzleEfficiency
#self.IspODE,self.CstarODE,self.Tc = \
# self.ispObj.get_IvacCstrTc(Pc=self.Pc, MR=self.mr, eps=self.eps)
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.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, At=self.At,
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
# if isp delivered is input, correct etaNoz to reflect that input
if self.inputIspDel:
self.Isp = self.IspDel
self.effIsp = self.Isp / self.IspODE
self.etaNoz = self.effIsp / self.etaERE
else:
self.effIsp = self.etaERE * self.etaNoz
self.Isp = self.IspODE * self.effIsp
# even if Isp is input, use CEA cstar to calculate throat diameter
self.Cstar = self.CstarODE * self.etaERE
if self.DtInp:
self.wdotTot = self.Pc * self.At * 32.174 / self.Cstar
self.Fvac = self.wdotTot * self.Isp
else:
self.wdotTot = self.Fvac / self.Isp
self.At = self.Cstar* self.wdotTot / self.Pc / Constants.gc
self.Dt = sqrt( self.At / pi ) * 2.0
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.Valves:
self.Valves.cuInchPerSec = max( self.volDotOx, self.volDotFl )
self.Valves.reCalc()
self.WtValves = self.Valves.mass_lbm
else:
self.WtValves = self.valvesMassInput
ftPerSec = 30.0 # through valve
dCharFl = sqrt( 4.0 * self.volDotFl/ pi / ftPerSec)
dCharOx = sqrt( 4.0 * self.volDotOx / pi / ftPerSec)
self.dChar = max( dCharFl, dCharOx)
# weight of two identical valves
#self.WtValves = 2.0 * 0.268 * (self.dChar/1.279)**2
#if self.WtValves < self.minBipropValveWt: # minimum of 45 (0.2 lbm) grams per valve (90 total)
# self.WtValves = self.minBipropValveWt
#self.WtValves *= self.cxwValves
self.WtMisc = 0.319 * (self.dChar/1.279)**2 # scale miscellaneous like valve
#if self.WtMisc < 0.1:
# self.WtMisc = 0.1
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.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.SANozExt = self.Dt**2/4.*(3.368*(self.eps+10.875)**1.2606 + \
self.eps*(self.ratmlr-1.25)*10.75)
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.SANozExt = pi * sqrt((r1-r2)**2 + self.Lnoz**2) * (r1+r2)
# calc surface area of engine and nozzle
SAENG, SACHM, SATotalNoz, SAAttach = getEngineSurfaceArea( isBell=self.isBell,
eps=self.eps, epsNozExt=self.epsNozExt, pcentBell=self.pcentBell,
Dthrt=self.Dt, halfAngDeg=self.halfAngDeg, xln=self.xln, xlc=self.xlc, CR=self.CR)
self.SANozExt = SATotalNoz - SAAttach
self.SAChamber = SACHM
self.SANozRegen = SAAttach
self.SAGasWall = SACHM + SAAttach # regen cooled gas wall
self.WtGasWall = self.rhoGasWall * self.SAGasWall * self.thkMinGasWall
self.WtCloseout = self.rhoCloseout * self.SAGasWall * self.thkMinCloseout
self.WtChannels = self.rhoGasWall * self.SAGasWall * self.aveChannelHeight * \
self.aveLandWidth / (self.aveLandWidth+self.aveChannelWidth)
self.thkNozExt = (self.thkMinCloseout*0.9 + 3.5*self.tmingNozExt) / 4.5
if self.thkNozExt < self.thkNozExtMin:
self.thkNozExt = self.thkNozExtMin
self.WtNozExt = self.thkNozExt * self.SANozExt * self.rhoNozExt
self.WtChamber = self.WtGasWall + self.WtCloseout + self.WtChannels
thkMultAcc = 0.05 + 0.25/self.Dcham
VolAccustic = mensuration.cylVol( thkMultAcc*self.Dcham, self.Dcham, self.Dcham/4.0 )
self.WtAcoustic = VolAccustic * self.rhoGasWall
# the injector ht also gets smaller with increased Dcham
htMultDCham = min(1.0, 1.5/self.Dcham)
htInj = self.Dcham*htMultDCham
VolInj = mensuration.solidCylVol( self.Dcham*1.1 , htInj )
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.WtNozExt + self.WtChamber + self.WtInj + self.WtAcoustic + self.WtMisc
self.mass_lbm = self.Number * ( self.mass_lbm * self.cxw + self.WtValves )
self.FtoW = self.Fvac * self.Number / self.mass_lbm
self.pov_h = self.Lengine
self.pov_w = max( self.Dexit, self.Dcham )
self.pov_d = self.pov_w
# get sea level performance
#CfSL, CfOverCfvacSL, modeSL = separated_Cf.ambientCf(gam=self.gam, epsTot=self.eps, Pc=self.pc, Pamb=14.7)
self.Cfvac = self.Isp * 32.174 / self.Cstar
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
self.PfaceOvPc =(1. + .25/self.CR**1.8) # multiply time Pc to get PcFace
self.PcFace = self.Pc * self.PfaceOvPc
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( '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.Number>1:
summ.addAssumption( 'Mass is for %i engines total'%self.Number )
#summ.addInput(self, label='generic param', value=0.0, units='', format='%g')
if self.DtInp:
summ.addInput('Dt', self.Dt, 'in', '%.3f')
else:
summ.addInput('Fvac', self.Fvac, 'lbf', '%g')
summ.addInput('Pc', self.Pc, 'psia', '%.1f')
summ.addInput('eps', self.eps, '', '%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('xlnOverLcham', self.xlnOverLcham, '', '%g')
summ.addInput('thkMinGasWall', self.thkMinGasWall, 'in', '%.3f')
summ.addInput('thkMinCloseout', self.thkMinCloseout, 'in', '%.3f')
summ.addInput('aveLandWidth', self.aveLandWidth, 'in', '%.3f')
summ.addInput('aveChannelWidth', self.aveChannelWidth, 'in', '%.3f')
summ.addInput('aveChannelHeight', self.aveChannelHeight, 'in', '%.3f')
summ.addInput('LoverDt', self.LoverDt, '', '%g')
summ.addInput('LchamMin',self.LchamMin, 'in', '%.3f')
summ.addInput('cxwInj', self.cxwInj, '', '%g')
summ.addInput('cxwValves', self.cxwValves, '', '%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
if self.DtInp:
summ.addOutput('Fvac', self.Fvac, 'lbf', '%g')
summ.addOutput('Isp', self.Isp, 'sec', '%g')
summ.addOutput('Cstar', self.Cstar, 'ft/sec', '%.1f')
if self.inputIspDel:
summ.addOutput('etaNoz', self.etaNoz, '', '%g')
elif 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('DFlow',self.dChar,'in','%.3f')
summ.addOutput('At', self.At, 'sqin', '%g')
if not self.DtInp:
summ.addOutput('Dt', self.Dt, '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('rhoNozExt', self.rhoNozExt, 'lbm/cuin', '%.3f')
summ.addOutput('thkNozExt', self.thkNozExt, 'in', '%.3f')
summ.addOutput('WtNozExt', self.WtNozExt, 'lbm', '%.3f')
summ.addOutput('...WtChannels', self.WtChannels, 'lbm', '%.3f')
summ.addOutput('...WtCloseout', self.WtCloseout, 'lbm', '%.3f')
summ.addOutput('...WtGasWall', self.WtGasWall, 'lbm', '%.3f')
summ.addOutput('WtChamber', self.WtChamber, 'lbm', '%.3f')
summ.addOutput('WtInj', self.WtInj, 'lbm', '%.3f')
summ.addOutput('WtAcoustic',self.WtAcoustic, 'lbm', '%.3f')
summ.addOutput('WtValves(2)',self.WtValves, 'lbm', '%.3f')
summ.addOutput('WtMisc',self.WtMisc, 'lbm', '%.3f')
if self.Number>1:
summ.addOutput( 'wt/Engine', self.mass_lbm/self.Number, 'lbm', '%.3f' )
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 self.Valves:
summList.append( self.Valves.buildSummary() )
return summList
if __name__ == "__main__": #self test
h = Engine_Regen(name="OME engine", mass_lbm=0.0, oxName='N2O4', fuelName='MMH',
cxw=1.25, Pc=125.0, Fvac=6000.0, eps=55.0, mr=1.65, DtInp=None,
CR=2.5, LoverDt=4.0, LchamMin=1.5, xlnOverLcham=0.5,
etaERE=0.97, etaNoz=0.99, matlInj="SS", cxwInj=1.0, cxwValves=4.0, isBell=1, pcentBell=80.0,
halfAngDeg=15.0, useFastCEALookup=0, Number=1, etaKinInp=1.0,
calcEtaNoz=1, thkNozExtMin=0.04, matlNozExt="Cb103", minBipropValveWt=0.2,
inputIspDel=0, IspDel=300.0, valvesMassInput=None, Pamb=0.0,
epsNozExt=6.0, SFcloseout=2.0, matlCloseout='Ni', matlGasWall="SS",
thkMinCloseout=0.045, thkMinGasWall=0.035, aveLandWidth=0.05, aveChannelWidth=0.05,
aveChannelHeight=0.1)
print "Calculated = ",h.getMassStr()
print "w/o valves= %.3f lbm"%(h.mass_lbm - h.WtValves,)
print
print h.getSummary()
print
|