Coverage for rocketcea\cea_obj.py : 87%

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
#!/usr/bin/env python # -*- coding: ascii -*-
RocketCEA wraps the NASA FORTRAN CEA code and provides some useful tools.
RocketCEA makes direct calls to the FORTRAN CEA code in "rocket" mode to calculate Isp, Cstar, Tcham etc. and provides tools to help determine useful mixture ratio range, optimum MR and more.
See the NASA CEA code at: `<https://www.grc.nasa.gov/WWW/CEAWeb/>`_
RocketCEA Copyright (C) 2005-2018 Applied Python
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-----------------------
"""
# # python >=3.8 needs to be given permission to import DLL files.
# for multi-file projects see LICENSE file for authorship info # for single file projects, insert following information
except: # automodule doc builds fail on ReadTheDocs w/o some error handling. if os.environ.get('READTHEDOCS',False): print('Allowing py_cea import to fail on READTHEDOCS.') py_cea = None else: # go ahead and raise the error. import rocketcea.py_cea as py_cea
# # gravitational conversion factor
# hold CEA_Cache objects by propellant name """Returns internal cache of previously called calculations."""
'''make sure that trailing blanks are on added lines''' #print( '"'+ln[:77]+'"' )
"""::
#: Add or Replace a propellant. #: name = string name (e.g. oxName, fuelName or propName) #: card_str = a single multiline string containing CEA input card for new propellant #: propD = dictionary to receive new propellant (e.g. oxCards, fuelCards or propCards) """
"""Add a new Fuel Card"""
"""Add a new Oxidizer Card"""
"""Add a new Propellant Card"""
"""Create the cache object that saves previous calculations in RAM to speed repetitive calls."""
# keep track of size, assume faster than a len( xxDict ) call
# do not check for existence, assume usage logic handles that #print( 'in setIsp, desc=',desc,' isp=',isp )
# do not check for existence, assume usage logic handles that
# do not check for existence, assume usage logic handles that
""" RocketCEA wraps the NASA FORTRAN CEA code to calculate Isp, cstar, and Tcomb """
useFastLookup=0, # depricated makeOutput=0, make_debug_prints=False): """ #: Create the base CEA wrapper object. #: Fast Lookup is depricated. #: fac_CR = Contraction Ratio of finite area combustor (None=infinite) #: if make_debug_prints is True, print debugging info to terminal. """
#print('Creating CEA_Obj with finite area combustor CR = ', self.fac_CR) else:
# do NOT allow "-" or "+" as part of the name
oxName = 'G' + oxName[:-3] if self.make_debug_prints: print('Ox name changed to',oxName) fuelName = 'G' + fuelName[:-3] if self.make_debug_prints: print('Fuel name changed to',fuelName) propName = 'G' + propName[:-3] if self.make_debug_prints: print('Propellant name changed to',propName)
# may want to interpolate tables of CEA runs for speed print('WARNING... useFastLookup is no longer supported.')
#check for propellant (mono or solid) vs. fuel and ox
tempList = fuelCards[ propName ] if type(tempList) == type(''): tempList = [tempList]
propList = [] for p in tempList: propList.append( p.replace(' fuel ',' name ' ) )
self.cea_deck.append( propList ) self.desc += ' ' + propName if self.make_debug_prints: print("fuel Cards converted into prop Cards") for card in self.cea_deck: if type(card) == type(''): print(card) else: for c in card: print(c) tempList = [tempList]
print("ox Cards converted into prop Cards") for card in self.cea_deck: if type(card) == type(''): print(card) else: for c in card: print(c) else: print('ERROR... bad propellant name (%s) in cea_obj.py'%propName)
#check for fuel
else:
#check for oxidizer
else:
#thisPath = py_cea.__file__ #print('py_cea.__file__ =' + py_cea.__file__) #print('here =' + here) #dataPath = os.path.dirname( thisPath ) #sp = dataPath.split('\\') #dataPath = '/'.join( sp ) + '/ ' # be sure to leave extra space #self.pathPrefix = here + os.sep + ' ' # be sure to leave extra space # dataPath
os.mkdir( ROCKETCEA_DATA_DIR, 0o777 )
if os.path.exists( os.path.join(here, fname) ): shutil.copyfile( os.path.join(here, fname), os.path.join(ROCKETCEA_DATA_DIR, fname) )
#shutil.copyfile( os.path.join(here, 'f.inp'), os.path.join(ROCKETCEA_DATA_DIR, 'f.inp') ) #shutil.copyfile( os.path.join(here, 'f.out'), os.path.join(ROCKETCEA_DATA_DIR, 'f.out') ) #shutil.copyfile( os.path.join(here, 'temp.dat'), os.path.join(ROCKETCEA_DATA_DIR, 'temp.dat') ) #shutil.copyfile( os.path.join(here, 'thermo.lib'), os.path.join(ROCKETCEA_DATA_DIR, 'thermo.lib') ) #shutil.copyfile( os.path.join(here, 'trans.lib'), os.path.join(ROCKETCEA_DATA_DIR, 'trans.lib') )
#self.pathPrefix = self.pathPrefix.replace('\\','/')
# make a cache object for this propellant combo if it does not already exist
ERphi=None, ERr=None, frozenAtThroat=0, short_output=0, show_transport=0, pc_units='psia', output='calories', show_mass_frac=False): ''' Set up card deck and call CEA FORTRAN code.::
#: Pc = combustion end pressure (psia) #: eps = Nozzle Expansion Area Ratio #: if PcOvPe has a value, use it instead of eps to run case #: ERphi = Equivalence ratios in terms of fuel-to-oxidant weight ratios. #: ERr = Chemical equivalence ratios in terms of valences. #: pc_units = 'psia', 'bar', 'atm', 'mmh'(mm of mercury) #: frozen flag (0=equilibrium, 1=frozen) #: frozenAtThroat flag, 0=frozen in chamber, 1=frozen at throat '''
global _last_called, _NLines_Max_ever
else: # might be a list of strings
#if self.desc==self.oxName + ' / ' + self.fuelName: # temp_prop_case = self.oxName + '_/_' + self.fuelName #else: # temp_prop_case = self.desc
#set_py_cea_line(N,"prob case="+self.desc+" ")
#print( "prob case="+self.desc+" " )
else: else: else:
# ======================== make input strings for single or multiple values ================== # i.e. get_full_cea_output may input lists for eps, PcOvPe, Pc, MR, or subar
"""allow number, list or None. Return empty string for error or None.""" except: pass try: # e.g. " supar=%s, "% ','.join( ['%g'%v for v in eps] ) rtn_str = param + '%s, '%','.join( ['%g'%v for v in val] ) except: rtn_str = ''
return rtn_str
# ------------ Eps String ------------
# ------------ Pc String -------------
# ------------ Subsonic Area Ration String ----------
# ------------ Pc/Pe String -------------
# ------------------------------------------------ # set up rocket line with Pc, PC/Pe and Epsilon
# ------------ Finite Area Combustor String ------
#print('In setupCards, fac_CR =', self.fac_CR)
else:
# use ER,phi as an input instead of MR # phi = Equivalence ratios in terms of fuel-to-oxidant weight ratios # use ER,r as an input instead of MR # r = Chemical equivalence ratios in terms of valences else: # use MR as input
# ------------ Mixture Ratio String -------------
else:
line += " short " line += " massf "
# make sure to overwrite any lines from previous calls
# now call CEA
except: print("ERROR reading data file for",self.desc)
print("reading cea isp data files for",self.desc,_PrintCountDict[self.desc],'times') else: #print("reading cea isp data files for",self.desc)
if self.makeOutput: print("NOTICE... making an output file")
# Before calling CEA, init values to zero so bad run can be detected
# set species concentrations to 0.0 prior to calcs #for k,p in enumerate(py_cea.cdata.prod): # for i in range(3): # py_cea.comp.en[k-1,i] = 0.0 # py_cea.therm.mw[k-1] = 0.0 # if k>=50: # break
#print( 'calling py_cea with pathPrefix and myfile=' ) #print( '"'+self.pathPrefix+'"',' and ', '"'+myfile+'"' )
frozen=0, frozenAtThroat=0, short_output=0, show_transport=1, pc_units='psia', output='calories', show_mass_frac=False, fac_CR=None): """ Get the full output file created by CEA. Return as a string.::
#: Pc = combustion end pressure #: eps = Nozzle Expansion Area Ratio #: pc_units = 'psia', 'bar', 'atm', 'mmh'(mm of mercury) #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat #: fac_CR = Contraction Ratio of finite area combustor, (None=infinite) """
# regardless of how run was set up, change makeOutput flag True
# Allow user to override fac_CR from CEA_Obj __init__ self.fac_CR = fac_CR
frozen=frozen, frozenAtThroat=frozenAtThroat, short_output=short_output, show_transport=show_transport, pc_units=pc_units, output=output, show_mass_frac=show_mass_frac)
""" Get the pressure ratio of Pinjector / Pchamber.::
#: Pc = combustion end pressure (psia) #: fac_CR = Contraction Ratio of finite area combustor, (None=infinite) """
# Allow user to override fac_CR from CEA_Obj __init__
print('ERROR in get_Pinj_over_Pcomb... Need value for fac_CR') raise Exception('ERROR in get_Pinj_over_Pcomb... Need value for fac_CR')
"""Returns IspVac(sec) if CEA_Obj is simply called like a function.""" return self.get_Isp(Pc=Pc, MR=MR, eps=eps, frozen=frozen, frozenAtThroat=frozenAtThroat)
"""::
#: Return the tuple (IspVac, Cstar, Tcomb)in(sec, ft/sec, degR) #: Pc = combustion end pressure (psia) #: eps = Nozzle Expansion Area Ratio #: MR is only used for ox/fuel combos. #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """
except: IspVac = None
# don't bother looking at Cstar and Tc if there's no Isp except: Cstar = None TcK = None
#print( "py_cea.rockt.vaci",py_cea.rockt.vaci ) #print('py_cea.rockt.cstr',py_cea.rockt.cstr) #print( 'py_cea.rockt.app', py_cea.rockt.app )
#print( "py_cea.prtout.ttt",py_cea.prtout.ttt )
"""::
#: Return the tuple (IspFrozen, Cstar, Tcomb)in(sec, ft/sec, degR) #: Pc = combustion end pressure (psia) #: eps = Nozzle Expansion Area Ratio #: MR is only used for ox/fuel combos. #: frozenAtThroat flag, 0=frozen in chamber, 1=frozen at throat """
"""::
#: return the tuple (IspVac, Cstar, Tcomb, mw, gam)in(sec, ft/sec, degR, lbm/lbmole, -) #: Pc = combustion end pressure (psia) #: eps = Nozzle Expansion Area Ratio #: mw and gam apply to nozzle exit. #: MR is only used for ox/fuel combos. #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """
#print( "py_cea.rockt.vaci",py_cea.rockt.vaci )
"""::
#: return the tuple (IspVac, Cstar, Tcomb, mw, gam)in(sec, ft/sec, degR, lbm/lbmole, -) #: Pc = combustion end pressure (psia) #: eps = Nozzle Expansion Area Ratio #: mw and gam apply to chamber. #: MR is only used for ox/fuel combos. """
#print( "py_cea.rockt.vaci",py_cea.rockt.vaci )
"""::
#: return the tuple (IspVac, Cstar, Tcomb, mw, gam)in(sec, ft/sec, degR, lbm/lbmole, -) #: Pc = combustion end pressure (psia) #: eps = Nozzle Expansion Area Ratio #: mw and gam apply to throat. #: MR is only used for ox/fuel combos. """
#print( "py_cea.rockt.vaci",py_cea.rockt.vaci )
"""::
#: return IspVac (sec) #: Pc = combustion end pressure (psia) #: eps = Nozzle Expansion Area Ratio #: MR is only used for ox/fuel combos. #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """ except: IspVac = None
#print( 'py_cea.rockt.vaci',py_cea.rockt.vaci ) #print( 'py_cea.rockt.cstr',py_cea.rockt.cstr )
"""::
#: return Cstar (ft/sec) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. """ except: Cstar = None
"""::
#: return Tcomb (degR) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. """
"""::
#: return Pc / Pexit. #: Pc = combustion end pressure (psia) #: eps = Nozzle Expansion Area Ratio #: MR is only used for ox/fuel combos. #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """
#print( 'py_cea.rockt.app',py_cea.rockt.app ) #Pexit = py_cea.prtout.ppp[ self.i_exit ]*14.7/1.01325 #return Pc/Pexit
"""::
#: Given a Pc/Pexit, return the Area Ratio that applies. #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """ #print( 'py_cea.rockt.aeat',py_cea.rockt.aeat )
"""::
#: return Pc/Pexit at throat. #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. """
"""::
#: return nozzle exit mach number. #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """
"""::
#: Return mach numbers at the chamber #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: fac_CR = Contraction Ratio of finite area combustor, (None=infinite) """ # Allow user to override fac_CR from CEA_Obj __init__ save_fac_CR = self.fac_CR if fac_CR is not None: self.fac_CR = fac_CR
if self.fac_CR is None: print('ERROR in get_Chamber_MachNumber... Need value for fac_CR') raise Exception('ERROR in get_Chamber_MachNumber... Need value for fac_CR')
self.setupCards( Pc=Pc, MR=MR )
self.fac_CR = save_fac_CR # restore fac_CR
M = py_cea.rockt.vmoc[ 1 ] return M
"""::
#: Return a list of temperatures at the chamber, throat and exit (degR) #: (Note frozen flag determins whether Texit is equilibrium or Frozen temperature) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen flag (0=equilibrium, 1=frozen) #: frozenAtThroat flag, 0=frozen in chamber, 1=frozen at throat """ #self.setupCards( Pc=Pc, MR=MR, eps=eps)
# convert from Kelvin to Rankine #tempList = 1.8 * py_cea.prtout.ttt[:3] tempList = list( py_cea.prtout.ttt[1:4] ) else:
"""::
#: Return a list of sonic velocities at the chamber, throat and exit (ft/sec) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """ # convert from m/sec into ft/sec else:
"""::
#: Return the sonic velocity in the chamber (ft/sec) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio """
"""::
#: Return a list of entropies at the chamber, throat and exit CAL/(G)(K) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """ self.setupCards( Pc=Pc, MR=MR, eps=eps, frozen=frozen, frozenAtThroat=frozenAtThroat)
if self.fac_CR is not None: sList = list(py_cea.prtout.ssum[1:4]) else: sList = list(py_cea.prtout.ssum[:3])
for i,s in enumerate( sList ): sList[i] = s * 8314.51 / 4184.0 # convert into CAL/(G)(K) return sList
"""::
#: Return a list of enthalpies at the chamber, throat and exit (BTU/lbm) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """
else:
frozen=0, frozenAtThroat=0, min_fraction=0.000005): """::
#: Returns species mass fractions at the injector face, chamber, throat and exit. #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen flag (0=equilibrium, 1=frozen) #: frozenAtThroat flag, 0=frozen in chamber, 1=frozen at throat #: Returns 2 dictionaries #: molWtD dictionary: index=species: value=molecular weight #: massFracD dictionary: index=species: value=[massfrac_injface, massfrac_chm, massfrac_tht, massfrac_exit] """
#for i in range(3):
else:
frozen=0, frozenAtThroat=0, min_fraction=0.000005): """::
#: Returns species mole fractions at the injector face, chamber, throat and exit. #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen flag (0=equilibrium, 1=frozen) #: frozenAtThroat flag, 0=frozen in chamber, 1=frozen at throat #: Returns 2 dictionaries #: molWtD dictionary: index=species: value=molecular weight #: moleFracD dictionary: index=species: value=[molefrac_injface, molefrac_chm, molefrac_tht, molefrac_exit] """
#for i in range(3):
else:
"""::
#: Return the enthalpy in the chamber (BTU/lbm) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio """
"""::
#: Return a list of densities at the chamber, throat and exit(lbm/cuft) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """
else:
"""::
#: Return the density in the chamber(lbm/cuft) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio """
"""::
#: Return a list of heat capacities at the chamber, throat and exit(BTU/lbm degR) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """ # convert from m/sec into ft/sec else:
"""::
#: Return the heat capacity in the chamber(BTU/lbm degR) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen flag (0=equilibrium, 1=frozen) """
"""::
#: Return the IspVac for the throat(sec). #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: frozen = flag (0=equilibrium, 1=frozen) """ except: IspVac = None return IspVac
#print( 'py_cea.rockt.vaci',py_cea.rockt.vaci ) #print( 'py_cea.rockt.cstr',py_cea.rockt.cstr )
"""::
#: return the tuple (mw, gam) for the chamber (lbm/lbmole, -) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio """ #common /prtout/ cpr,dlvpt,dlvtp,gammas,hsum,ppp,ssum,totn,ttt,vlm,wm,pltout
"""::
#: return the tuple (mw, gam) for the throat (lbm/lbmole, -) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen = flag (0=equilibrium, 1=frozen) """ #common /prtout/ cpr,dlvpt,dlvtp,gammas,hsum,ppp,ssum,totn,ttt,vlm,wm,pltout
"""::
#: return the tuple (mw, gam) for the nozzle exit (lbm/lbmole, -) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen = flag (0=equilibrium, 1=frozen) #: frozenAtThroat = flag 0=frozen in chamber, 1=frozen at throat """ #common /prtout/ cpr,dlvpt,dlvtp,gammas,hsum,ppp,ssum,totn,ttt,vlm,wm,pltout
'''Returns BOTH ERr and ERphi (valence basis and mass basis respectively)''' #common /miscr/ a,atwt,avgdr,boltz,b0,eqrat,...
"""::
#: return the value of mixture ratio that applies to the input equivalence ratio. #: Can be ERr or ERphi (valence basis and mass basis respectively) """ #common /miscr/ a,atwt,avgdr,boltz,b0,eqrat,...
else: print('WARNING... ERROR in call to getMRforER. No ER value input') MR = 0.0 #ERROR
#self.setupCards( Pc=100.0, MR=1.0, eps=40.0 ) # fix any mismatches in system from ER call
"""Return a string description of the propellant(s). e.g. 'LOX / MMH'"""
frozen=0, frozenAtThroat=0): """::
#: return the tuple (IspAmb, mode) #: Use throat gam to run ideal separation calculations. #: mode is a string containing, UnderExpanded, OverExpanded, or Separated #: Pc = combustion end pressure (psia) #: Pamb ambient pressure (e.g. sea level=14.7 psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen flag, 0=equilibrium, 1=frozen #: frozenAtThroat flag, 0=frozen in chamber, 1=frozen at throat """
#PcOvPe = py_cea.rockt.app[ self.i_exit ] #print( "=============== Pexit ", Pexit, py_cea.prtout.ppp[ self.i_exit ]/1.01325, py_cea.prtout.ppp[ self.i_exit ] ) # ==================================
sepNozzleCf(gam, eps, Pc, Pamb)
# if not separated, use theoretical equation for back-pressure correction else: # if separated, use Kalt and Badal estimate of ambient thrust coefficient # NOTE: there are better, more modern methods available self.get_IvacCstrTc(Pc=Pc, MR=MR, eps=epsSep)
# figure out mode of nozzle operation else: else:
"""::
#: Return the Thrust Coefficient (CF) for equilibrium chemistry and ambient pressure #: Pc = combustion end pressure (psia) #: Pamb ambient pressure (e.g. sea level=14.7 psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio """
"""::
#: Return the Thrust Coefficient (CF) for frozen chemistry and ambient pressure #: Pc = combustion end pressure (psia) #: Pamb ambient pressure (e.g. sea level=14.7 psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozenAtThroat flag, 0=frozen in chamber, 1=frozen at throat """
frozen=1, frozenAtThroat=frozenAtThroat)
"""::
#: Return a list of heat capacity, viscosity, thermal conductivity and Prandtl number #: in the chamber. (units are default printout units) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio... has no effect on chamber properties #: frozen flag (0=equilibrium, 1=frozen) """
else:
"""::
#: Return a list of heat capacity, viscosity, thermal conductivity and Prandtl number #: in the throat. (units are default printout units) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio... has no effect on throat properties #: frozen flag (0=equilibrium, 1=frozen) """
else:
"""::
#: Return a list of heat capacity, viscosity, thermal conductivity and Prandtl number #: at the exit. (units are default printout units) #: Pc = combustion end pressure (psia) #: MR is only used for ox/fuel combos. #: eps = Nozzle Expansion Area Ratio #: frozen flag (0=equilibrium, 1=frozen) """
else:
# ----------------------- DEBUG OUTPUT ----------------------------- """ Print all the interface variables to the FORTRAN pyd file. Normally used for debugging or verifying FORTRAN internal values. """ commonL = dir(py_cea) for common in commonL: if common[:1] != '_': print(common) vL = dir( getattr(py_cea,common) ) print(vL) for v in vL: var = getattr( getattr(py_cea,common), v) print(v,var) print()
#Cp, visc, cond, Pr = ispNew.get_Exit_Transport(Pc=1000.0, MR=6.0, eps=40.0, frozen=1) #print('Cp=%g, visc=%g, cond=%g, Pr=%g'%(Cp, visc, cond, Pr) ) #sys.exit()
|