RocketIsp Code Functions¶
Thruster¶
RocketIsp calculates delivered Isp for liquid rocket thrust chambers.
RocketIsp uses a simplified JANNAF approach to calculate delivered specific impulse (Isp) for liquid rocket thrust chambers.
RocketIsp Copyright (C) 2020 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/>.
- class rocketisp.rocket_isp.RocketThruster(name='RocketIsp Thruster', coreObj=<rocketisp.stream_tubes.CoreStream object>, injObj=None, noz_regen_eps=1.0, pulse_sec=inf, pulse_quality=0.8, isRegenCham=False, calc_CdThroat=True)¶
RocketIsp calculates delivered Isp for liquid rocket thrust chambers by simplified JANNAF method.
- Parameters:
name (str) – name of RocketThruster
coreObj (CoreStream) – CoreStream object
injObj (Injector) – Injector object (optional)
noz_regen_eps (float) – regen cooled nozzle area ratio
pulse_sec (float) – s,duration of pulsing engine (default = infinity)
pulse_quality (float) – on a scale of 0.0 to 1.0, how good is engine at pulsing
isRegenCham (bool) – flag to indicate chamber is regen cooled
calc_CdThroat (bool) – flag to trigger calc_CdThroat
- Returns:
RocketThruster object
- Return type:
- calc_all_eff()¶
Looks at the efficiency object (effObj) and calculates those efficiencies that have not been set as constants by the user.
see: self.calc_CdThroat or effObj[‘XXX’].is_const for individual efficiencies
- get_html_file_str()¶
return HTML string of the current state of RocketThruster instance.
- get_summ_str()¶
return string of the current state of RocketThruster instance.
- reset_attr(name, value, re_evaluate=True)¶
reset the value of any existing attribute of RocketThruster instance. If re_evaluate is True, then call self.evaluate() after resetting the value of the attribute.
- scale_Rt_to_Thrust(ThrustLbf=500.0, Pamb=0.0, use_scipy=False)¶
Adjust throat size in order to get total thrust at specified ambient pressure exactly
- set_MRthruster(MRthruster=1.6)¶
Calculate MRcore given desired MRthruster (assume pcentFFC is already set)
- set_eff_model(eff_name='Div', model_name='MLP fit')¶
Change the named efficiency model from the default model to a different model. For example, change from the simple nozzle divergence model (Div) to the Multi-Layer Perceptron (MLP) divergence model.
- set_eps_to_equal_pexit(Pexit_psia=14.7)¶
Iterate on Area Ratio to find desired Pexit
- set_mr_to_max_ispdel()¶
Iterate on MRcore to find the peak Isp
- summ_print()¶
print to standard output, the current state of RocketThruster instance.
Geometry¶
- class rocketisp.geometry.Geometry(Rthrt=1, CR=2.5, eps=20, pcentBell=80, LnozInp=None, RupThroat=1.5, RdwnThroat=1.0, RchmConv=1.0, cham_conv_deg=30, LchmOvrDt=3.0, LchmMin=1.0, LchamberInp=None)¶
The Geometry object holds all the major thrust chamber geometry values.
- Parameters:
Rthrt (float) – in, throat radius
CR (float) – chamber contraction ratio (Ainj / Athroat)
eps (float) – nozzle area ratio (Aexit / Athroat)
pcentBell (float) – nozzle percent bell (Lnoz / L_15deg_cone)
LnozInp (float) – in, user input nozzle length (will override pcentBell)
RupThroat (float) – radius of curvature just upstream of throat (Rupstream / Rthrt)
RdwnThroat (float) – radius of curvature just downstream of throat (Rdownstream / Rthrt)
RchmConv (float) – radius of curvature at start of convergent section (Rconv / Rthrt)
cham_conv_deg (float) – deg, half angle of conical convergent section
LchmOvrDt (float) – ratio of chamber length to throat diameter (Lcham / Dthrt)
LchmMin (float) – in, minimum chamber length (will override LchmOvrDt)
LchamberInp (float) – in, user input value of chamber length (will override all other entries)
- Returns:
Geometry object
- Return type:
- Variables:
At – in**2, throat area
Lnoz – in, nozzle length
Ltotal – in, nozzle + chamber length
Rinj – in, radius of injector
Dinj – in, diameter of injector
Ainj – in**2, area of injector
Lcham_cyl – in, length of cylindrical section of chamber
Lcham_conv – in, length of convergent section of chamber
Vcham – in**3, approximate chamber volume
- LprimeOvRcham()¶
return chamber length / chamber radius
- evaluate()¶
Uses basic geometry input values to determine derived geometry values. (for example, throat area, nozzle length, injector area, etc.)
- getNozObj()¶
Create and return a Nozzle object.
- get_attr_comment(name)¶
Some attributes may have comments associated with them
- get_model_summ_obj()¶
return ModelSummary object for current state of Geometry instance.
- get_summ_str(alpha_ordered=True, numbered=False, add_trailer=True, fillchar='.', max_banner=76, intro_str='')¶
return string of the current state of Geometry instance.
- reset_attr(name, value, re_evaluate=True)¶
Resets Geometry object attribute by name if that attribute already exists.
- summ_print()¶
print to standard output, the current state of Geometry instance.
- rocketisp.geometry.maybe_show_ft(val)¶
If input inches > 12, return string with feet units.
- rocketisp.geometry.solidCylVol(D, L)¶
calculates a cylinder volume
- rocketisp.geometry.solidFrustrumVol(D1, D2, h)¶
calculates cone frustrum
Nozzle¶
- class rocketisp.nozzle.nozzle.Nozzle(CR=2.5, eps=16.0, pcentBell=80.0, Rt=1.5, Nsegs=20, Rup=2.0, Rd=1.0, cham_conv_ang=30.0, Rc=1.0, theta=None, exitAng=None, forceCone=0, use_huzel_angles=False)¶
Nozzle contour object holds both a dimensionless and absolute dimension representation of the nozzle. It includes interpolators for entire contour.
- Parameters:
CR (float) – contraction ratio of chamber (Ainj / Athroat)
eps (float) – nozzle area ratio (Aexit / Athroat)
pcentBell (float) – nozzle percent bell (Lnoz / L_15deg_cone)
Rt (float) – in, throat radius
Nsegs (int) – number of segments to hold in array of nozzle contour
Rup (float) – radius of curvature just upstream of throat (Rupstream / Rthroat)
Rd (float) – radius of curvature just downstream of throat (Rdownstream / Rthroat)
cham_conv_ang (float) – deg, half angle of convergent section of chamber
Rc (float) – radius of curvature at start of convergent section (Rconvergent / Rthroat)
theta (float) – deg, entrance angle of nozzle (tangent to Rd circular curve)
exitAng (float) – deg, exit angle of nozzle
forceCone (bool) – flag to force nozzle to be a conical nozzle instead of bell nozzle.
use_huzel_angles (bool) – flag to force use of Huzel entrance and exit angle correlation
- Returns:
Nozzle object
- Return type:
- get_conv_zL_epsL()¶
Returns 2 lists for the convergent contour, the z contour and the area ratio contour starting at the injector and going to the throat, but NOT including Throat
- get_div_zL_epsL()¶
Returns 2 lists for the divergent nozzle contour, the z contour and the area ratio contour starting at the throat and going to the nozzle exit, but NOT including Throat
- set_abs_Rt(Rt)¶
Use throat radius to create an absolute contour from the dimensionless contour.
- z_range()¶
return (zmin, zmax)
- rocketisp.nozzle.nozzle.ref_nozzle(Rup=2.0, Rd=1.0, eps=16.0, theta=30.0, alphaExit=10.0, pcBell=80.0, Nsegs=30, forceCone=0, cham_conv_ang=30.0, Rc=1.0, CR=2.5)¶
DIMENSIONLESS Parabolic Nozzle Contour (Rthroat = 1.0)
Efficiencies¶
- class rocketisp.efficiencies.Efficiencies(**constD)¶
Holds all of the thrust chamber efficiencies and provides access to efficiency models in order to update each one.
- evaluate()¶
Combines nozzle and chamber efficiencies into overall nozzle and over chamber efficiency. Gives overall Isp efficiency including any pulsing effects.
- get_model_summ_obj()¶
return ModelSummary object for current state of Efficiencies instance.
- get_state_str_list()¶
Return a list of | delimited state strings for each Efficiency
- get_summ_str()¶
return string of the current state of Efficiencies instance.
- set_const(name, value, re_evaluate=True)¶
Give a new constant value to named efficiency. Call evaluate if re_evaluate is True.
- set_value(name, value, value_src='user input', re_evaluate=True)¶
Give a new value to named efficiency. Call evaluate if re_evaluate is True.
- summ_print()¶
print to standard output, the current state of Efficiencies instance.
- class rocketisp.efficiencies.Efficiency(name, value, desc, value_src)¶
Holds an individual efficiency that is coordinated by the Efficiencies object.
- Parameters:
- Returns:
Efficiency object
- Return type:
- get_state_str()¶
Return a | delimited state string.
- set_value(value, value_src)¶
Every time a new value is set, the source of that value must be given.
Stream Tubes¶
- class rocketisp.stream_tubes.BarrierStream(coreObj, pcentFFC=10.0, ko=0.035)¶
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.
- Parameters:
coreObj (CoreStream) – core stream tube object, CoreStream
pcentFFC (float) – percent fuel film cooling ( FFC flowrate / total fuel flowrate)
ko (float) – entrainment constant (typical value is 0.035, range from 0.03 to 0.06)
- Returns:
BarrierStream object
- Return type:
- Variables:
MRbarrier – barrier mixture ratio at throat
MRwall – mixture ratio at throat wall
Twallgas – degR, temperature of gas at throat wall (cooler upstream)
TcODE_b – degR, average ideal ODE temperature of barrier gas
WentrOvWcool – ratio of entrained flow rate to FFC flow rate
IspDel_b – sec, delivered vacuum barrier Isp
IspODF_b – sec, ideal frozen barrier Isp
IspODK_b – sec, vacuum kinetic Isp of barrier
fracKin_b – fraction of kinetic completion in barrier
fracEntr – fraction of core flow entrained into barrier
IspODE_b – sec. ideal equilibrium barrier Isp
cstarERE_b – ft/s, delivered cstar
cstarODE_b – ft/s, ideal equilibrium cstar
- evaluate()¶
Estimate entrained core flow into film cooled stream tube and calculate performance of barrier stream tube.
- get_model_summ_obj()¶
return ModelSummary object for current state of BarrierStream instance.
- get_summ_str(alpha_ordered=True, numbered=False, add_trailer=True, fillchar='.', max_banner=76, intro_str='')¶
return string of the current state of BarrierStream instance.
- summ_print()¶
print to standard output, the current state of BarrierStream instance.
- class rocketisp.stream_tubes.CoreStream(geomObj=<rocketisp.geometry.Geometry object>, effObj=<rocketisp.efficiencies.Efficiencies object>, 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)¶
Core stream tube of liquid bipropellant thruster.
- Parameters:
geomObj (Geometry) – Geometry that describes thruster
effObj (Efficiencies) – Efficiencies object to hold individual efficiencies
oxName (str) – name of oxidizer (e.g. N2O4, LOX)
fuelName (str) – name of fuel (e.g. MMH, LH2)
MRcore (float) – mixture ratio of core flow (ox flow rate / fuel flow rate)
Pc (float) – psia, chamber pressure
CdThroat (float) – Cd of throat (RocketThruster object may override)
Pamb (float) – psia, ambient pressure (for example sea level is 14.7 psia)
adjCstarODE (float) – multiplier on NASA CEA code value of cstar ODE (default is 1.0)
adjIspIdeal (float) – multiplier on NASA CEA code value of Isp ODE (default is 1.0)
pcentFFC (float) – percent fuel film cooling (if > 0 then add BarrierStream)
ko (float) – entrainment constant (passed to BarrierStream object, range from 0.03 to 0.06)
ignore_noz_sep (bool) – flag to force nozzle flow separation to be ignored (USE WITH CAUTION)
- Returns:
CoreStream object
- Return type:
- Variables:
FvacTotal – lbf, total vacuum thrust
FvacCore – lbf, vacuum thrust due to core stream tube
MRthruster – total thruster mixture ratio’)
IspDel – sec, <=== thruster delivered vacuum Isp ===>
Pexit – psia, nozzle exit pressure
IspDel_core – sec, delivered Isp of core stream tube
IspODF – sec, core frozen Isp
IspODK – sec, core one dimensional kinetic Isp
IspODE – sec, core one dimensional equilibrium Isp
cstarERE – ft/s, delivered core cstar
cstarODE – ft/s, core ideal cstar
CfVacIdeal – ideal vacuum thrust coefficient
CfVacDel – delivered vacuum thrust coefficient
CfAmbDel – delivered ambient thrust coefficient
wdotTot – lbm/s, total propellant flow rate (ox+fuel)
wdotOx – lbm/s, total oxidizer flow rate
wdotFl – lbm/s, total fuel flow rate
TcODE – degR, ideal core gas temperature
MWchm – g/gmole, core gas molecular weight
gammaChm – core gas ratio of specific heats (Cp/Cv)
- calc_cea_perf_params()¶
Calc basic Isp values from CEA and calc implied IspODK from current effKin value.
- evaluate()¶
Assume that all efficiencies have been set, either by original user value or an update by an efficiency model.
- get_model_summ_obj()¶
return ModelSummary object for current state of CoreStream instance.
- get_summ_str(alpha_ordered=True, numbered=False, add_trailer=True, fillchar='.', max_banner=76, intro_str='')¶
return string of the current state of CoreStream instance.
- reset_CdThroat(value, method_name='RocketIsp', re_evaluate=True)¶
reset the value of CdThroat If re_evaluate is True, then call self.evaluate() after resetting the efficiency.
- reset_attr(name, value, re_evaluate=True)¶
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.
- summ_print()¶
print to standard output, the current state of CoreStream instance.
- rocketisp.stream_tubes.shapeFactor(WentrOvWcool)¶
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”
- rocketisp.stream_tubes.solve_At_split(MRc, MRb, ffc, cstar_c, cstar_b)¶
Given MRcore, MRbarrier, fracFFC, cstar_c and cstar_b, solve the throat area split between the core and barrier.
Injector¶
- class rocketisp.injector.Injector(coreObj, Tox=None, Tfuel=None, elemEm=0.8, fdPinjOx=0.25, fdPinjFuel=0.25, dpOxInp=None, dpFuelInp=None, setNelementsBy='acoustics', elemDensInp=5, NelementsInp=100, OxOrfPerEl=1.0, FuelOrfPerEl=1.0, lolFuelElem=False, setAcousticFreqBy='mode', desAcousMode='3T', desFreqInp=5000, CdOxOrf=0.75, CdFuelOrf=0.75, dropCorrOx=0.33, dropCorrFuel=0.33, DorfMin=0.008, LfanOvDorfOx=20.0, LfanOvDorfFuel=20.0)¶
Injector object holds basic information about the injector. Injector design features are calculated including chamber losses due to the injector, Em, Mix and Vap.
- Parameters:
coreObj (CoreStream) – CoreStream object
Tox (None or float) – degR, temperature of oxidizer
Tfuel (None or float) – degR, temperature of fuel
elemEm (float) – intra-element Rupe mixing factor (0.7 below ave, 0.8 ave, 0.9 above ave)
fdPinjOx (float) – fraction of Pc used as oxidizer injector pressure drop
fdPinjFuel (float) – fraction of Pc used as fuel injector pressure drop
dpOxInp (None or float) – psia,input value of injector pressure drop for oxidizer (overrides fdPinjOx)
dpFuelInp (None or float) – psia,input value of injector pressure drop for fuel (overrides fdPinjFuel)
setNelementsBy (str) – flag determines how to calculate number of elements ( “acoustics”, “elem_density”, “input”)
elemDensInp (float) – elem/in**2, input value for element density (setNelementsBy == “elem_density”)
NelementsInp (float) – input value for number of elements (setNelementsBy == “input”)
OxOrfPerEl (float) – number of oxidizer orifices per element
FuelOrfPerEl (float) – number of fuel orifices per element
lolFuelElem (bool) – flag for like-on-like fuel element (determines strouhal multiplier)
setAcousticFreqBy (str) – flag indicating how to determine design frequency. (can be “mode” or “freq”)
desAcousMode (str or float) – driving acoustic mode of injector OR acoustic mode multiplier (setNelementsBy==”acoustics” and setAcousticFreqBy==”mode”)
desFreqInp (None or float) – Hz, driving acoustic frequency of injector (sets D/V if setNelementsBy==”acoustics” and setAcousticFreqBy==”freq”)
CdOxOrf (float) – flow coefficient of oxidizer orifices
CdFuelOrf (float) – flow coefficient of fuel orifices
dropCorrOx (float) – oxidizer drop size multiplier (showerhead=3.0, like-doublet=1.0, vortex=0.5, unlike-doublet=0.33)
dropCorrFuel (float) – fuel drop size multiplier (showerhead=3.0, like-doublet=1.0, vortex=0.5, unlike-doublet=0.33)
DorfMin (float) – in, minimum orifice diameter (lower limit)
LfanOvDorfOx (float) – fan length / oxidizer orifice diameter
LfanOvDorfFuel (float) – fan length / fuel orifice diameter
- Returns:
Injector object
- Return type:
- Variables:
sgOx – g/ml, oxidizer density
dHvapOx – BTU/lbm, oxidizer heat of vaporization
surfOx – lbf/in, oxidizer surface tension
viscOx – poise, oxidizer viscosity
MolWtOx – g/gmole, oxidizer molecular weight
sgFuel – g/ml, fuel density
dHvapFuel – BTU/lbm, fuel heat of vaporization
surfFuel – lbf/in, fuel surface tension
viscFuel – poise, fuel viscosity
MolWtFuel – g/gmole, fuel molecular weight
dpOx – psid, oxidizer injector pressure drop
dpFuel – psid, fuel injector pressure drop
des_freq – Hz, chamber design acoustic frequency
DorfFlForHzLimit – in, fuel orifice Diameter for frequency in Hewitt Correlation
Nelements – number of elements on injector face
NFuelOrf – number of fuel orifices on injector face
NOxOrf – number of oxidizer orifices on injector face
elemDensCalc – elem/in**2, element density on injector face
NelemMakable – maximum number of makable elements giving correct flow rate (diam=DorfMin)
velOx_fps – ft/s, velocity of injected oxidizer
velFuel_fps – ft/s, velocity of injected fuel
AfloOx – in**2, total flow area of oxidizer
AfloFuel – in**2, total flow area of fuel
DorfOx – in, oxidizer orifice diameter
DorfFuel – in, fuel orifice diameter
- calc_element_attr()¶
calc Nelements, injection velocities, elements diam, etc.
- calculate_effEm()¶
calc intra-element mixing efficiency
- calculate_effMix()¶
calc inter-element mixing efficiency
- calculate_effVap()¶
calculate vaporization efficiency
- evaluate(DOREVAL=False)¶
Calculates chamber losses due to the injector, Em, Mix and Vap.
- get_closest_mode()¶
Get the name and frequency of the closest mode to des_freq
- get_model_summ_obj()¶
return ModelSummary object for current state of Injector instance.
- get_summ_str(show_core_stream=True, alpha_ordered=True, numbered=False, add_trailer=True, fillchar='.', max_banner=76, intro_str='')¶
return string of the current state of Injector instance.
- summ_print(show_core_stream=True)¶
print to standard output, the current state of Injector instance.
- rocketisp.injector.temperature_clamp(value, name, min_value, max_value)¶
Check to see if name is limited in range.