Skip to content

Commit

Permalink
simplifying ramjet network i/o
Browse files Browse the repository at this point in the history
  • Loading branch information
WallyMaier committed Feb 8, 2018
1 parent fad84a1 commit 8bbc8f9
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 43 deletions.
24 changes: 9 additions & 15 deletions trunk/SUAVE/Components/Energy/Networks/Ramjet.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,40 +104,34 @@ def evaluate_thrust(self,state):
ram(conditions)

#link inlet nozzle to ram
inlet_nozzle.inputs.stagnation_temperature = ram.outputs.stagnation_temperature
inlet_nozzle.inputs.stagnation_pressure = ram.outputs.stagnation_pressure

inlet_nozzle.inputs = ram.outputs

#Flow through the inlet nozzle
inlet_nozzle(conditions)

#link the combustor to the inlet nozzle
combustor.inputs.stagnation_temperature = inlet_nozzle.outputs.stagnation_temperature
combustor.inputs.stagnation_pressure = inlet_nozzle.outputs.stagnation_pressure
combustor.inputs.mach_number = inlet_nozzle.outputs.mach_number
combustor.inputs = inlet_nozzle.outputs

#flow through the high pressor comprresor
#flow through the combustor
combustor.compute_rayleigh(conditions)


#link the core nozzle to the low pressure turbine
core_nozzle.inputs.stagnation_temperature = combustor.outputs.stagnation_temperature
core_nozzle.inputs.stagnation_pressure = combustor.outputs.stagnation_pressure
core_nozzle.inputs = combustor.outputs

#flow through the core nozzle
core_nozzle.compute_limited_geometry(conditions)

# compute the thrust using the thrust component
#link the thrust component to the core nozzle
thrust.inputs.core_exit_velocity = core_nozzle.outputs.velocity
thrust.inputs.core_area_ratio = core_nozzle.outputs.area_ratio
thrust.inputs.core_nozzle = core_nozzle.outputs

thrust.inputs.total_temperature_reference = core_nozzle.outputs.stagnation_temperature
thrust.inputs.total_pressure_reference = core_nozzle.outputs.stagnation_pressure

#link the thrust component to the combustor
thrust.inputs.fuel_to_air_ratio = combustor.outputs.fuel_to_air_ratio

#link the thrust component to the low pressure compressor
thrust.inputs.stag_temp_lpt_exit = core_nozzle.outputs.stagnation_temperature
thrust.inputs.stag_press_lpt_exit = core_nozzle.outputs.stagnation_pressure
#link the thrust component
thrust.inputs.number_of_engines = number_of_engines
thrust.inputs.flow_through_core = 1.0 #scaled constant to turn on core thrust computation
thrust.inputs.flow_through_fan = 0.0 #scaled constant to turn on fan thrust computation
Expand Down
12 changes: 6 additions & 6 deletions trunk/SUAVE/Components/Energy/Processes/Thrust.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,19 @@ def compute(self,conditions):


#computing the non dimensional thrust
core_thrust_nondimensional = flow_through_core*(gamma*M0*M0*(core_nozzle.velocity/u0-1) + core_area_ratio*(core_nozzle.static_pressure/p0-1))
fan_thrust_nondimensional = flow_through_fan*(gamma*M0*M0*(fan_nozzle.velocity/u0-1) + fan_area_ratio*(fan_nozzle.static_pressure/p0-1))
core_thrust_nondimensional = flow_through_core*(gamma*M0*M0*(core_nozzle.velocity/u0-1.) + core_area_ratio*(core_nozzle.static_pressure/p0-1.))
fan_thrust_nondimensional = flow_through_fan*(gamma*M0*M0*(fan_nozzle.velocity/u0-1.) + fan_area_ratio*(fan_nozzle.static_pressure/p0-1.))

Thrust_nd = core_thrust_nondimensional + fan_thrust_nondimensional


Fsp = 1./(gamma*M0)*Thrust_nd

#Computing the specific impulse
Isp = Fsp*a0*(1+bypass_ratio)/(f*g)
Isp = Fsp*a0*(1.+bypass_ratio)/(f*g)

#Computing the TSFC
TSFC = 3600.*f*g/(Fsp*a0*(1+bypass_ratio))
TSFC = 3600.*f*g/(Fsp*a0*(1.+bypass_ratio))
#computing the core mass flow
mdot_core = mdhc*np.sqrt(Tref/total_temperature_reference)*(total_pressure_reference/Pref)

Expand All @@ -191,7 +191,7 @@ def compute(self,conditions):

#fuel flow rate
a = np.array([0.])
fuel_flow_rate = np.fmax(0.1019715*FD2*TSFC/3600,a) #use units package for the constants
fuel_flow_rate = np.fmax(0.1019715*FD2*TSFC/3600.,a) #use units package for the constants

#computing the power
power = FD2*u0
Expand Down Expand Up @@ -255,7 +255,7 @@ def size(self,conditions):


#compute dimensional mass flow rates
mdot_core = design_thrust/(Fsp*a0*(1+bypass_ratio)*no_eng*throttle)
mdot_core = design_thrust/(Fsp*a0*(1.+bypass_ratio)*no_eng*throttle)
mdhc = mdot_core/ (np.sqrt(Tref/total_temperature_reference)*(total_pressure_reference/Pref))

#pack outputs
Expand Down
32 changes: 10 additions & 22 deletions trunk/SUAVE/Methods/Propulsion/ramjet_sizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,48 +77,36 @@ def ramjet_sizing(ramjet,mach_number = None, altitude = None, delta_isa = 0, con
#set the working fluid to determine the fluid properties
ram.inputs.working_fluid = ramjet.working_fluid

#Flow through the ram , this computes the necessary flow quantities and stores it into conditions
#Flow through the ram
ram(conditions)

#link inlet nozzle to ram
inlet_nozzle.inputs.stagnation_temperature = ram.outputs.stagnation_temperature #conditions.freestream.stagnation_temperature
inlet_nozzle.inputs.stagnation_pressure = ram.outputs.stagnation_pressure #conditions.freestream.stagnation_pressure
inlet_nozzle.inputs = ram.outputs

#Flow through the inlet nozzle
inlet_nozzle(conditions)

#link the combustor to the high pressure compressor
combustor.inputs.stagnation_temperature = inlet_nozzle.outputs.stagnation_temperature
combustor.inputs.stagnation_pressure = inlet_nozzle.outputs.stagnation_pressure
combustor.inputs.mach_number = inlet_nozzle.outputs.mach_number
#link the combustor to the inlet nozzle
combustor.inputs = inlet_nozzle.outputs

#flow through the high pressor comprresor
combustor.compute_rayleigh(conditions)


#link the core nozzle to the low pressure turbine
core_nozzle.inputs.stagnation_temperature = combustor.outputs.stagnation_temperature
core_nozzle.inputs.stagnation_pressure = combustor.outputs.stagnation_pressure
#link the core nozzle to the combustor
core_nozzle.inputs = combustor.outputs

#flow through the core nozzle
core_nozzle.compute_limited_geometry(conditions)

# compute the thrust using the thrust component
#link the thrust component to the core nozzle
thrust.inputs.core_exit_velocity = core_nozzle.outputs.velocity
thrust.inputs.core_area_ratio = core_nozzle.outputs.area_ratio
thrust.inputs.core_nozzle = core_nozzle.outputs

#link the thrust component to the combustor
thrust.inputs.fuel_to_air_ratio = combustor.outputs.fuel_to_air_ratio

#link the thrust component to the low pressure compressor
thrust.inputs.stag_temp_lpt_exit = core_nozzle.outputs.stagnation_temperature
thrust.inputs.stag_press_lpt_exit = core_nozzle.outputs.stagnation_pressure
thrust.inputs.number_of_engines = number_of_engines
thrust.inputs.total_temperature_reference = core_nozzle.outputs.stagnation_temperature
thrust.inputs.total_pressure_reference = core_nozzle.outputs.stagnation_pressure


#link the thrust component to the combustor
thrust.inputs.fuel_to_air_ratio = combustor.outputs.fuel_to_air_ratio

#compute the thrust
thrust.inputs.fan_nozzle = Data()
thrust.inputs.fan_nozzle.velocity = 0.0
Expand Down

0 comments on commit 8bbc8f9

Please sign in to comment.