Coverage for rocketisp\stream_tubes.py : 92%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
else: from rocketisp.mock.cea_obj import CEA_Obj from rocketisp.mock.separated_Cf import sepNozzleCf
'''Subsonic Shape Factor from COMBUSTION EFFECTS ON FILM COOLING manual Figure 5, page 88 https://ntrs.nasa.gov/citations/19770014416 "Mixing Layer Profile Shape Factor Correlations"''' # from the definintion of effectiveness and the fact that effectiveness=1 return 1.0 / (1.0 + WentrOvWcool) else: # curve fit of COMBUSTION EFFECTS ON FILM COOLING manual figure 5 subsonic curve
""" Given MRcore, MRbarrier, fracFFC, cstar_c and cstar_b, solve the throat area split between the core and barrier. """
else:
""" A BarrierStream is typically used to evaluate fuel film cooling, see: https://ntrs.nasa.gov/citations/19770014416 COMBUSTION EFFECTS ON FILM COOLING, 24 Feb 1977 by Aerojet Liquid Rocket Co.
:param coreObj: core stream tube object, CoreStream :param pcentFFC: percent fuel film cooling ( FFC flowrate / total fuel flowrate) :param ko: entrainment constant (typical value is 0.035, range from 0.03 to 0.06) :type coreObj: CoreStream :type pcentFFC: float :type ko: float :return: BarrierStream object :rtype: BarrierStream
:ivar MRbarrier: barrier mixture ratio :ivar MRwall: mixture ratio at wall :ivar Twallgas: degR, temperature of gas at wall :ivar TcODE_b: degR, average ideal ODE temperature of barrier gas :ivar WentrOvWcool: ratio of entrained flow rate to FFC flow rate :ivar IspDel_b: sec, delivered vacuum barrier Isp :ivar IspODF_b: sec, ideal frozen barrier Isp :ivar IspODK_b: sec, vacuum kinetic Isp of barrier :ivar fracKin_b: fraction of kinetic completion in barrier :ivar IspODE_b: sec. ideal equilibrium barrier Isp :ivar cstarERE_b: ft/s, delivered cstar :ivar cstarODE_b: ft/s, ideal equilibrium cstar """ """ A BarrierStream, see: https://ntrs.nasa.gov/citations/19770014416 COMBUSTION EFFECTS ON FILM COOLING, 24 Feb 1977 by Aerojet Liquid Rocket Co.
"""
# get input descriptions and units from doc string
return getattr(self, name ) # let it raise exception if no name attr.
""" Estimate entrained core flow into film cooled stream tube and calculate performance of barrier stream tube. """
# figure out entrainment fraction and MRbarrier based on geometry and pcentFFC
# an approximation for equation 27 in COMBUSTION EFFECTS ON FILM COOLING, page 20
# use a ref. flow rate of 1.0... will generate ratios from ref flow rate
# shape factor comes from a curve fit of COMBUSTION EFFECTS ON FILM COOLING Figure 5, page 88
# effectiveness come from equation 17 in COMBUSTION EFFECTS ON FILM COOLING, page 15
#wdotFuelEntr = wdotFuelTot * (fracEntr - (fracEntr * fracFFC))
#print('self.WentrOvWcool=%g'%self.WentrOvWcool,' fracEntr=%g'%fracEntr, # ' MRcore=%g'%self.coreObj.MRcore, ' effnessFC=%g'%self.effnessFC, # ' MRbarrier=%g'%self.MRbarrier, ' MReng=%g'%MReng)
# using eqn (2) on page 7 (pdf 21) of COMBUSTION EFFECTS ON FILM COOLING # film cooling effectiveness is always equal to the # mass fraction of the injected film coolant gas within the gas mixture directly # adjacent to the wall.
# ........... calc ideal performance parameters self.ceaObj.get_IvacCstrTc_ChmMwGam( Pc=self.coreObj.Pc, MR=self.MRbarrier, eps=self.geomObj.eps)
eps=self.geomObj.eps)
else: # use user effKin to set IspODK Rthrt=self.geomObj.Rthrt, pcentBell=self.geomObj.pcentBell, MR=self.MRbarrier)
# ........ make final summary efficiencies
else:
else:
""" print to standard output, the current state of BarrierStream instance. """ print( self.get_summ_str() )
fillchar='.', max_banner=76, intro_str=''):
""" return string of the current state of BarrierStream instance. """
M = self.get_model_summ_obj() return M.summ_str(alpha_ordered=alpha_ordered, numbered=numbered, add_trailer=add_trailer, fillchar=fillchar, max_banner=max_banner, intro_str=intro_str)
M = self.get_model_summ_obj() return M.html_table_str( alpha_ordered=alpha_ordered, numbered=numbered, intro_str=intro_str)
""" return ModelSummary object for current state of BarrierStream instance. """
# function to add parameters from __doc__ string to ModelSummary
else:
''' add_param('MRbarrier', desc='barrier mixture ratio') add_param('MRwall', desc='mixture ratio at wall') add_param('Twallgas', units='degR', desc='temperature of gas at wall', fmt='%.0f') add_param('TcODE_b', units='degR', desc='average ideal ODE temperature of barrier gas', fmt='%.0f') #add_param('effnessFC', desc='effectiveness from equation 17 in COMBUSTION EFFECTS ON FILM COOLING, page 15') add_param('WentrOvWcool', desc='ratio of entrained flow rate to FFC flow rate') add_param('IspDel_b', units='sec', desc='delivered vacuum barrier Isp', fmt='%.1f') add_param('IspODF_b', units='sec', desc='ideal frozen barrier Isp', fmt='%.1f') add_param('IspODK_b', units='sec', desc='vacuum kinetic Isp of barrier', fmt='%.1f') add_param('fracKin_b', desc='fraction of kinetic completion in barrier') add_param('IspODE_b', units='sec', desc='ideal equilibrium barrier Isp', fmt='%.1f') add_param('cstarERE_b', units='ft/s', desc='delivered cstar', fmt='%.1f') add_param('cstarODE_b', units='ft/s', desc='ideal equilibrium cstar', fmt='%.1f') '''
""" Core stream tube of liquid bipropellant thruster.
:param geomObj: Geometry that describes thruster :param effObj: Efficiencies object to hold individual efficiencies :param oxName: name of oxidizer (e.g. N2O4, LOX) :param fuelName: name of fuel (e.g. MMH, LH2) :param MRcore: mixture ratio of core flow (ox flow rate / fuel flow rate) :param Pc: psia, chamber pressure :param CdThroat: Cd of throat (RocketThruster object may override) :param Pamb: psia, ambient pressure (for example sea level is 14.7 psia) :param adjCstarODE: multiplier on NASA CEA code value of cstar ODE (default is 1.0) :param adjIspIdeal: multiplier on NASA CEA code value of Isp ODE (default is 1.0) :param pcentFFC: percent fuel film cooling (if > 0 then add BarrierStream) :param ko: entrainment constant (passed to BarrierStream object, range from 0.03 to 0.06) :param ignore_noz_sep: flag to force nozzle flow separation to be ignored (USE WITH CAUTION) :type geomObj: Geometry :type effObj: Efficiencies :type oxName: str :type fuelName: str :type MRcore: float :type Pc: float :type CdThroat: float :type Pamb: float :type adjCstarODE: float :type adjIspIdeal: float :type pcentFFC: float :type ko: float :type ignore_noz_sep: bool :return: CoreStream object :rtype: CoreStream
:ivar FvacTotal: lbf, total vacuum thrust :ivar FvacCore: lbf, vacuum thrust due to core stream tube :ivar MRthruster: total thruster mixture ratio') :ivar IspDel: sec, <=== thruster delivered vacuum Isp ===> :ivar Pexit: psia, nozzle exit pressure :ivar IspDel_core: sec, delivered Isp of core stream tube :ivar IspODF: sec, core frozen Isp :ivar IspODK: sec, core one dimensional kinetic Isp :ivar IspODE: sec, core one dimensional equilibrium Isp :ivar cstarERE: ft/s, delivered core cstar :ivar cstarODE: ft/s, core ideal cstar :ivar CfVacIdeal: ideal vacuum thrust coefficient :ivar CfVacDel: delivered vacuum thrust coefficient :ivar CfAmbDel: delivered ambient thrust coefficient :ivar wdotTot: lbm/s, total propellant flow rate (ox+fuel) :ivar wdotOx: lbm/s, total oxidizer flow rate :ivar wdotFl: lbm/s, total fuel flow rate :ivar TcODE: degR, ideal core gas temperature :ivar MWchm: g/gmole, core gas molecular weight :ivar gammaChm: core gas ratio of specific heats (Cp/Cv)
"""
oxName='N2O4', fuelName='MMH', MRcore=1.9, Pc=500, CdThroat=0.995, Pamb=0.0, adjCstarODE=1.0, adjIspIdeal=1.0, pcentFFC=0.0, ko=0.035, ignore_noz_sep=False):
# make CEA object
# ... if pcentFFC > 0.0, then there's barrier cooling else:
# barrier might need some performance parameters from CoreStream
else:
# get input descriptions and units from doc string
""" reset the value of CdThroat If re_evaluate is True, then call self.evaluate() after resetting the efficiency. """
""" reset the value of any existing attribute of CoreStream instance. If re_evaluate is True, then call self.evaluate() after resetting the value of the attribute. """ else: raise Exception('Attempting to set un-authorized CoreStream attribute named "%s"'%name )
# make CEA object self.ceaObj = CEA_Obj(oxName=self.oxName, fuelName=self.fuelName)
"""Calc basic Isp values from CEA and calc implied IspODK from current effKin value."""
# calc ideal CEA performance parameters self.ceaObj.get_IvacCstrTc_ChmMwGam( Pc=self.Pc, MR=self.MRcore, eps=self.geomObj.eps)
eps=self.geomObj.eps)
# use user effKin to set IspODK (or most recent update) #self.IspODK = calc_IspODK(self.ceaObj, Pc=self.Pc, eps=self.geomObj.eps, # Rthrt=self.geomObj.Rthrt, # pcentBell=self.geomObj.pcentBell, # MR=self.MRcore)
# fraction of equilibrium kinetics obtained
""" Assume that all efficiencies have been set, either by original user value or an update by an efficiency model. """
# make final summary efficiencies
# want a Core-Only ERE in case a barrier calc is done
self.barrierObj.pcentFFC / 100.0, cstarERE_core, self.barrierObj.cstarERE_b )
else:
else:
#self.cstarDel = self.Pc * self.Atcore * self.CdThroat * 32.174 / self.wdotTot
# do any nozzle ambient performance calcs here else: sepNozzleCf(self.gammaChm, self.geomObj.eps, self.Pc, self.Pamb) #print('epsSep=%g, Psep=%g'%(epsSep, self.Psep)) #print('========= Pexit=%g'%self.Pexit, ' Psep=%g'%self.Psep, ' epsSep=%g'%epsSep)
# if not separated, use theoretical equation for back-pressure correction #print('----------------> subtraction term =', self.cstarERE * self.Pamb * self.geomObj.eps / self.Pc / 32.174) else: # if separated, use Kalt and Badal estimate of ambient thrust coefficient # NOTE: there are better, more modern methods available self.ceaObj.get_IvacCstrTc(Pc=self.Pc, MR=self.MRcore, eps=epsSep)
#print('--------------> effPamb=%g'%effPamb, ' IspODEepsSep=%g'%IspODEepsSep, ' IspODE=%g'%self.IspODE)
#print('========= Pamb=%g'%self.Pamb, ' IspAmb=%g'%self.IspAmb) # figure out mode of nozzle operation else: else:
""" print to standard output, the current state of CoreStream instance. """
fillchar='.', max_banner=76, intro_str=''): """ return string of the current state of CoreStream instance. """
add_trailer=add_trailer, fillchar=fillchar, max_banner=max_banner, intro_str=intro_str) else:
add_trailer=add_trailer, fillchar=fillchar, max_banner=max_banner, intro_str=intro_str) + se + sb
M = self.get_model_summ_obj()
Me = self.effObj.get_model_summ_obj() se = '\n' + Me.html_table_str(alpha_ordered=False, assumptions_first=False)
if self.add_barrier: Mb = self.barrierObj.get_model_summ_obj() sb = '\n' + Mb.html_table_str(alpha_ordered=alpha_ordered, numbered=numbered, intro_str=intro_str) else: sb = ''
return M.html_table_str( alpha_ordered=alpha_ordered, numbered=numbered, intro_str=intro_str)\ + se + sb
""" return ModelSummary object for current state of CoreStream instance. """
else:
# parameters that are NOT attributes OR are conditional
add_param('Fambient', units='lbf', desc='total ambient thrust') add_param('IspAmb', units='sec', desc='delivered ambient Isp' ) M.add_out_comment('Fambient', '%s'%self.noz_mode) M.add_out_comment('IspAmb', '%s'%self.noz_mode )
add_param('IspDelPulse', units='sec', desc='delivered pulsing Isp')
category='At Injector Face') category='At Injector Face') category='At Injector Face')
category='After Entrainment') category='After Entrainment') category='After Entrainment')
category='After Entrainment') category='After Entrainment') category='After Entrainment')
#add_param('xxx', units='xxx', desc='xxx')
CR=2.5, eps=150, pcentBell=80, RupThroat=1.5, RdwnThroat=1.0, RchmConv=1.0, cham_conv_deg=30, LchmOvrDt=3.10, LchmMin=2.0, LchamberInp=16)
Pc=150, CdThroat=0.995, Pamb=14.7, pcentFFC=14.0, ko=0.035) #core.reset_attr('Pc', 456) |