Skip to content

Commit

Permalink
small cleanups in regional jet
Browse files Browse the repository at this point in the history
  • Loading branch information
planes committed Dec 26, 2020
1 parent 573d52e commit ce52e5a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 78 deletions.
11 changes: 4 additions & 7 deletions Regional_Jet_Optimization/Optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,18 @@
# Run the whole thing
# ----------------------------------------------------------------------
def main():
import time
t = time.time()

problem = setup()

## Base Input Values
#output = problem.objective()

## Uncomment to view contours of the design space
#variable_sweep(problem)
variable_sweep(problem)

# Uncomment for the first optimization
output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
print (output)
#output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
#print (output)

## Uncomment these lines when you want to start an optimization problem from a different initial guess
#inputs = [1.28, 1.38]
Expand Down Expand Up @@ -69,15 +67,14 @@ def setup():

# [ tag , initial, (lb , ub) , scaling , units ]
problem.inputs = np.array([
[ 'wing_area' , 80 , ( 50. , 130. ) , 100. , Units.meter**2],
[ 'wing_area' , 92 , ( 50. , 130. ) , 100. , Units.meter**2],
[ 'cruise_altitude' , 8 , ( 6. , 12. ) , 10. , Units.km],
])

# -------------------------------------------------------------------
# Objective
# -------------------------------------------------------------------

# throw an error if the user isn't specific about wildcards
# [ tag, scaling, units ]
problem.objective = np.array([
[ 'fuel_burn', 10000, Units.kg ]
Expand Down
70 changes: 4 additions & 66 deletions Regional_Jet_Optimization/Procedure.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,55 +138,6 @@ def simple_sizing(nexus):
turbofan_sizing(config.propulsors['turbofan'], mach_number = mach_number, altitude = altitude)
compute_turbofan_geometry(config.propulsors['turbofan'], conditions)


# ------------------------------------------------------------------
# Landing Configuration
# ------------------------------------------------------------------
landing = nexus.vehicle_configurations.landing
state = Data()
state.conditions = Data()
state.conditions.freestream = Data()

# landing weight
landing.mass_properties.landing = 0.85 * config.mass_properties.takeoff

# Landing CL_max
altitude = nexus.missions.base.segments[-1].altitude_end
atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
p, T, rho, a, mu = atmosphere.compute_values(altitude)
state.conditions.freestream.velocity = nexus.missions.base.segments['descent_3'].air_speed
state.conditions.freestream.density = rho
state.conditions.freestream.dynamic_viscosity = mu/rho
settings = Data()
settings.maximum_lift_coefficient_factor = 1.0
CL_max_landing, CDi = compute_max_lift_coeff(state,settings,landing)
landing.maximum_lift_coefficient = CL_max_landing


#Takeoff CL_max
takeoff = nexus.vehicle_configurations.takeoff
altitude = nexus.missions.base.airport.altitude
atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
p, T, rho, a, mu = atmosphere.compute_values(altitude)
state.conditions.freestream.velocity = nexus.missions.base.segments.climb_1.air_speed
state.conditions.freestream.density = rho
state.conditions.freestream.dynamic_viscosity = mu/rho
settings.maximum_lift_coefficient_factor = 1.0
max_CL_takeoff,CDi = compute_max_lift_coeff(state,settings,takeoff)
takeoff.maximum_lift_coefficient = max_CL_takeoff

#Base config CL_max
base = nexus.vehicle_configurations.base
altitude = nexus.missions.base.airport.altitude
atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
p, T, rho, a, mu = atmosphere.compute_values(altitude)
state.conditions.freestream.velocity = nexus.missions.base.segments.climb_1.air_speed
state.conditions.freestream.density = rho
state.conditions.freestream.dynamic_viscosity = mu/rho
settings.maximum_lift_coefficient_factor = 1.0
max_CL_base,CDi = compute_max_lift_coeff(state,settings,landing)
base.maximum_lift_coefficient = max_CL_base

return nexus

# ----------------------------------------------------------------------
Expand All @@ -203,11 +154,7 @@ def weight(nexus):
weights = nexus.analyses.landing.weights.evaluate(method="SUAVE")
weights = nexus.analyses.takeoff.weights.evaluate(method="SUAVE")
weights = nexus.analyses.short_field_takeoff.weights.evaluate(method="SUAVE")

for config in nexus.vehicle_configurations:
config.mass_properties.zero_fuel_center_of_gravity = vehicle.mass_properties.zero_fuel_center_of_gravity
config.fuel = vehicle.fuel


return nexus

# ----------------------------------------------------------------------
Expand All @@ -232,15 +179,6 @@ def post_process(nexus):
summary = nexus.summary
nexus.total_number_of_iterations +=1

# Static stability calculations
CMA = -10.
for segment in results.base.segments.values():
max_CMA = np.max(segment.conditions.stability.static.Cm_alpha[:,0])
if max_CMA > CMA:
CMA = max_CMA

summary.static_stability = CMA

#throttle in design mission
max_throttle = 0
for segment in results.base.segments.values():
Expand All @@ -255,11 +193,11 @@ def post_process(nexus):
design_takeoff_weight = vehicle.mass_properties.takeoff
zero_fuel_weight = vehicle.mass_properties.breakdown.zero_fuel_weight

summary.max_zero_fuel_margin = (design_landing_weight - zero_fuel_weight)/zero_fuel_weight
summary.base_mission_fuelburn = design_takeoff_weight - results.base.segments['descent_3'].conditions.weights.total_mass[-1]
summary.max_zero_fuel_margin = (design_landing_weight - zero_fuel_weight)/zero_fuel_weight
summary.base_mission_fuelburn = design_takeoff_weight - results.base.segments['descent_3'].conditions.weights.total_mass[-1]

#when you run want to output results to a file
filename = 'results.txt'
write_optimization_outputs(nexus, filename)

return nexus
7 changes: 2 additions & 5 deletions Regional_Jet_Optimization/Vehicles.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def base_setup():
# Vehicle-level Properties
# ------------------------------------------------------------------

# mass properties (http://www.embraercommercialaviation.com/AircraftPDF/E190_Weights.pdf)
vehicle.mass_properties.max_takeoff = 51800. # kg
vehicle.mass_properties.operating_empty = 27837. # kg
vehicle.mass_properties.takeoff = 51800. # kg
Expand All @@ -47,9 +46,6 @@ def base_setup():
vehicle.mass_properties.max_fuel = 12971. # kg
vehicle.mass_properties.cargo = 0.0 # kg

vehicle.mass_properties.center_of_gravity = [[16.8, 0, 1.6]]
vehicle.mass_properties.moments_of_inertia.tensor = [[10 ** 5, 0, 0],[0, 10 ** 6, 0,],[0,0, 10 ** 7]]

# envelope properties
vehicle.envelope.ultimate_load = 3.5
vehicle.envelope.limit_load = 1.5
Expand Down Expand Up @@ -217,10 +213,11 @@ def base_setup():
gt_engine.inlet_diameter = 2.0

#compute engine areas)
Amax = (np.pi/4.)*gt_engine.nacelle_diameter**2.
Awet = 1.1*np.pi*gt_engine.nacelle_diameter*gt_engine.engine_length # 1.1 is simple coefficient

#Assign engine area
gt_engine.areas.wetted = Awet

#set the working fluid for the network
working_fluid = SUAVE.Attributes.Gases.Air()

Expand Down

0 comments on commit ce52e5a

Please sign in to comment.