Skip to content

Commit ce52e5a

Browse files
committed
small cleanups in regional jet
1 parent 573d52e commit ce52e5a

File tree

3 files changed

+10
-78
lines changed

3 files changed

+10
-78
lines changed

Regional_Jet_Optimization/Optimize.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,18 @@
2323
# Run the whole thing
2424
# ----------------------------------------------------------------------
2525
def main():
26-
import time
27-
t = time.time()
2826

2927
problem = setup()
3028

3129
## Base Input Values
3230
#output = problem.objective()
3331

3432
## Uncomment to view contours of the design space
35-
#variable_sweep(problem)
33+
variable_sweep(problem)
3634

3735
# Uncomment for the first optimization
38-
output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
39-
print (output)
36+
#output = scipy_setup.SciPy_Solve(problem,solver='SLSQP')
37+
#print (output)
4038

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

7068
# [ tag , initial, (lb , ub) , scaling , units ]
7169
problem.inputs = np.array([
72-
[ 'wing_area' , 80 , ( 50. , 130. ) , 100. , Units.meter**2],
70+
[ 'wing_area' , 92 , ( 50. , 130. ) , 100. , Units.meter**2],
7371
[ 'cruise_altitude' , 8 , ( 6. , 12. ) , 10. , Units.km],
7472
])
7573

7674
# -------------------------------------------------------------------
7775
# Objective
7876
# -------------------------------------------------------------------
7977

80-
# throw an error if the user isn't specific about wildcards
8178
# [ tag, scaling, units ]
8279
problem.objective = np.array([
8380
[ 'fuel_burn', 10000, Units.kg ]

Regional_Jet_Optimization/Procedure.py

Lines changed: 4 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -138,55 +138,6 @@ def simple_sizing(nexus):
138138
turbofan_sizing(config.propulsors['turbofan'], mach_number = mach_number, altitude = altitude)
139139
compute_turbofan_geometry(config.propulsors['turbofan'], conditions)
140140

141-
142-
# ------------------------------------------------------------------
143-
# Landing Configuration
144-
# ------------------------------------------------------------------
145-
landing = nexus.vehicle_configurations.landing
146-
state = Data()
147-
state.conditions = Data()
148-
state.conditions.freestream = Data()
149-
150-
# landing weight
151-
landing.mass_properties.landing = 0.85 * config.mass_properties.takeoff
152-
153-
# Landing CL_max
154-
altitude = nexus.missions.base.segments[-1].altitude_end
155-
atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
156-
p, T, rho, a, mu = atmosphere.compute_values(altitude)
157-
state.conditions.freestream.velocity = nexus.missions.base.segments['descent_3'].air_speed
158-
state.conditions.freestream.density = rho
159-
state.conditions.freestream.dynamic_viscosity = mu/rho
160-
settings = Data()
161-
settings.maximum_lift_coefficient_factor = 1.0
162-
CL_max_landing, CDi = compute_max_lift_coeff(state,settings,landing)
163-
landing.maximum_lift_coefficient = CL_max_landing
164-
165-
166-
#Takeoff CL_max
167-
takeoff = nexus.vehicle_configurations.takeoff
168-
altitude = nexus.missions.base.airport.altitude
169-
atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
170-
p, T, rho, a, mu = atmosphere.compute_values(altitude)
171-
state.conditions.freestream.velocity = nexus.missions.base.segments.climb_1.air_speed
172-
state.conditions.freestream.density = rho
173-
state.conditions.freestream.dynamic_viscosity = mu/rho
174-
settings.maximum_lift_coefficient_factor = 1.0
175-
max_CL_takeoff,CDi = compute_max_lift_coeff(state,settings,takeoff)
176-
takeoff.maximum_lift_coefficient = max_CL_takeoff
177-
178-
#Base config CL_max
179-
base = nexus.vehicle_configurations.base
180-
altitude = nexus.missions.base.airport.altitude
181-
atmosphere = SUAVE.Analyses.Atmospheric.US_Standard_1976()
182-
p, T, rho, a, mu = atmosphere.compute_values(altitude)
183-
state.conditions.freestream.velocity = nexus.missions.base.segments.climb_1.air_speed
184-
state.conditions.freestream.density = rho
185-
state.conditions.freestream.dynamic_viscosity = mu/rho
186-
settings.maximum_lift_coefficient_factor = 1.0
187-
max_CL_base,CDi = compute_max_lift_coeff(state,settings,landing)
188-
base.maximum_lift_coefficient = max_CL_base
189-
190141
return nexus
191142

192143
# ----------------------------------------------------------------------
@@ -203,11 +154,7 @@ def weight(nexus):
203154
weights = nexus.analyses.landing.weights.evaluate(method="SUAVE")
204155
weights = nexus.analyses.takeoff.weights.evaluate(method="SUAVE")
205156
weights = nexus.analyses.short_field_takeoff.weights.evaluate(method="SUAVE")
206-
207-
for config in nexus.vehicle_configurations:
208-
config.mass_properties.zero_fuel_center_of_gravity = vehicle.mass_properties.zero_fuel_center_of_gravity
209-
config.fuel = vehicle.fuel
210-
157+
211158
return nexus
212159

213160
# ----------------------------------------------------------------------
@@ -232,15 +179,6 @@ def post_process(nexus):
232179
summary = nexus.summary
233180
nexus.total_number_of_iterations +=1
234181

235-
# Static stability calculations
236-
CMA = -10.
237-
for segment in results.base.segments.values():
238-
max_CMA = np.max(segment.conditions.stability.static.Cm_alpha[:,0])
239-
if max_CMA > CMA:
240-
CMA = max_CMA
241-
242-
summary.static_stability = CMA
243-
244182
#throttle in design mission
245183
max_throttle = 0
246184
for segment in results.base.segments.values():
@@ -255,11 +193,11 @@ def post_process(nexus):
255193
design_takeoff_weight = vehicle.mass_properties.takeoff
256194
zero_fuel_weight = vehicle.mass_properties.breakdown.zero_fuel_weight
257195

258-
summary.max_zero_fuel_margin = (design_landing_weight - zero_fuel_weight)/zero_fuel_weight
259-
summary.base_mission_fuelburn = design_takeoff_weight - results.base.segments['descent_3'].conditions.weights.total_mass[-1]
196+
summary.max_zero_fuel_margin = (design_landing_weight - zero_fuel_weight)/zero_fuel_weight
197+
summary.base_mission_fuelburn = design_takeoff_weight - results.base.segments['descent_3'].conditions.weights.total_mass[-1]
260198

261199
#when you run want to output results to a file
262200
filename = 'results.txt'
263201
write_optimization_outputs(nexus, filename)
264-
202+
265203
return nexus

Regional_Jet_Optimization/Vehicles.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ def base_setup():
3838
# Vehicle-level Properties
3939
# ------------------------------------------------------------------
4040

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

50-
vehicle.mass_properties.center_of_gravity = [[16.8, 0, 1.6]]
51-
vehicle.mass_properties.moments_of_inertia.tensor = [[10 ** 5, 0, 0],[0, 10 ** 6, 0,],[0,0, 10 ** 7]]
52-
5349
# envelope properties
5450
vehicle.envelope.ultimate_load = 3.5
5551
vehicle.envelope.limit_load = 1.5
@@ -217,10 +213,11 @@ def base_setup():
217213
gt_engine.inlet_diameter = 2.0
218214

219215
#compute engine areas)
220-
Amax = (np.pi/4.)*gt_engine.nacelle_diameter**2.
221216
Awet = 1.1*np.pi*gt_engine.nacelle_diameter*gt_engine.engine_length # 1.1 is simple coefficient
217+
222218
#Assign engine area
223219
gt_engine.areas.wetted = Awet
220+
224221
#set the working fluid for the network
225222
working_fluid = SUAVE.Attributes.Gases.Air()
226223

0 commit comments

Comments
 (0)