88# ----------------------------------------------------------------------
99
1010import SUAVE
11+ if not SUAVE .__version__ == '2.5.0' :
12+ assert ('These tutorials only work with the SUAVE 2.5.0 release' )
1113
1214import numpy as np
1315import pylab as plt
1921
2022from SUAVE .Methods .Propulsion .turbofan_sizing import turbofan_sizing
2123from SUAVE .Methods .Geometry .Two_Dimensional .Cross_Section .Propulsion import compute_turbofan_geometry
24+ from SUAVE .Methods .Geometry .Two_Dimensional .Planform import segment_properties
25+
26+ from SUAVE .Plots .Performance .Mission_Plots import *
27+
28+ from copy import deepcopy
2229
23- from SUAVE .Plots .Mission_Plots import *
2430
2531# ----------------------------------------------------------------------
2632# Main
@@ -151,7 +157,7 @@ def base_analysis(vehicle):
151157 # ------------------------------------------------------------------
152158 # Energy
153159 energy = SUAVE .Analyses .Energy .Energy ()
154- energy .network = vehicle .propulsors
160+ energy .network = vehicle .networks
155161 analyses .append (energy )
156162
157163 # ------------------------------------------------------------------
@@ -325,9 +331,23 @@ def vehicle_setup():
325331 segment .sweeps .quarter_chord = 0. * Units .degrees
326332 segment .thickness_to_chord = 0.10
327333 wing .Segments .append (segment )
334+
335+ # Fill out more segment properties automatically
336+ wing = segment_properties (wing )
328337
329338 # add to vehicle
330339 vehicle .append_component (wing )
340+
341+ # ------------------------------------------------------------------
342+ # Nacelle
343+ # ------------------------------------------------------------------
344+ nacelle = SUAVE .Components .Nacelles .Nacelle ()
345+ nacelle .diameter = 3.96 * Units .meters
346+ nacelle .length = 289. * Units .inches
347+ nacelle .tag = 'nacelle'
348+ nacelle .origin = [[123.0 * Units .feet , 25.0 * Units .feet , 6.5 * Units .feet ]]
349+ nacelle .Airfoil .naca_4_series_airfoil = '0012'
350+
331351
332352 # ------------------------------------------------------------------
333353 # Turbofan Network
@@ -339,9 +359,6 @@ def vehicle_setup():
339359 # setup
340360 turbofan .number_of_engines = 3.0
341361 turbofan .bypass_ratio = 8.1
342- turbofan .engine_length = 289. * Units .inches
343- turbofan .nacelle_diameter = 3.96 * Units .meters
344- #turbofan.cooling_ratio = 1.0
345362 turbofan .origin = [[133.0 * Units .feet , 25.0 * Units .feet , 6.5 * Units .feet ],[145.0 * Units .feet , 0.0 * Units .feet , 6.5 * Units .feet ],[133.0 * Units .feet , - 25.0 * Units .feet , 6.5 * Units .feet ]]
346363
347364 # working fluid
@@ -481,19 +498,31 @@ def vehicle_setup():
481498 #design sizing conditions
482499 altitude = 0. * Units .km
483500 mach_number = 0.01
484- isa_deviation = 0.
485501
486502 # add to network
487503 turbofan .thrust = thrust
488504
489505 #size the turbofan
490506 turbofan_sizing (turbofan ,mach_number ,altitude )
491- #turbofan.size(mach_number,altitude)
492507
493508 #computing the engine length and diameter
494- compute_turbofan_geometry (turbofan ,None )
509+ compute_turbofan_geometry (turbofan ,nacelle )
495510
496511 vehicle .append_component (turbofan )
512+
513+ # Finish adding all the nacelles
514+
515+ nacelle_2 = deepcopy (nacelle )
516+ nacelle_2 .tag = 'nacelle_2'
517+ nacelle_2 .origin = [[135.0 * Units .feet , 0.0 * Units .feet , 6.5 * Units .feet ]]
518+
519+ nacelle_3 = deepcopy (nacelle )
520+ nacelle_3 .tag = 'nacelle_3'
521+ nacelle_3 .origin = [[123.0 * Units .feet , - 25.0 * Units .feet , 6.5 * Units .feet ]]
522+
523+ vehicle .append_component (nacelle )
524+ vehicle .append_component (nacelle_2 )
525+ vehicle .append_component (nacelle_3 )
497526
498527
499528 # ------------------------------------------------------------------
0 commit comments