Skip to content

Commit 3f72c69

Browse files
committed
more minor tutorial edits
1 parent 96a28a6 commit 3f72c69

4 files changed

Lines changed: 54 additions & 55 deletions

File tree

tut_concorde.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def vehicle_setup():
240240
fuselage = SUAVE.Components.Fuselages.Fuselage()
241241
fuselage.tag = 'fuselage'
242242
fuselage.seats_abreast = 4
243-
fuselage.seat_pitch = 1
243+
fuselage.seat_pitch = 1 * Units.meter
244244
fuselage.fineness.nose = 4.3 * Units.meter
245245
fuselage.fineness.tail = 6.4 * Units.meter
246246
fuselage.lengths.total = 61.66 * Units.meter

tut_mission_B737.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def vehicle_setup():
309309

310310
fuselage.number_coach_seats = vehicle.passengers
311311
fuselage.seats_abreast = 6
312-
fuselage.seat_pitch = 1
312+
fuselage.seat_pitch = 1 * Units.meter
313313
fuselage.fineness.nose = 1.6
314314
fuselage.fineness.tail = 2.
315315
fuselage.lengths.nose = 6.4 * Units.meter

tut_payload_range.py

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def vehicle_setup():
198198
wing.areas.affected = 0.6 * wing.areas.wetted
199199
wing.twists.root = 2.0 * Units.degrees
200200
wing.twists.tip = 0.0 * Units.degrees
201-
wing.origin = [20.,0,0]
201+
wing.origin = [20.,0,0] # meters
202202
wing.vertical = False
203203
wing.symmetric = True
204204
wing.dynamic_pressure_ratio = 1.0
@@ -228,8 +228,8 @@ def vehicle_setup():
228228
wing.areas.affected = 0.6 * wing.areas.wetted
229229
wing.twists.root = 2.0 * Units.degrees
230230
wing.twists.tip = 2.0 * Units.degrees
231-
wing.origin = [50,0,0]
232-
wing.aerodynamic_center = [2,0,0]
231+
wing.origin = [50,0,0] # meters
232+
wing.aerodynamic_center = [2,0,0] # meters
233233
wing.vertical = False
234234
wing.symmetric = True
235235
wing.dynamic_pressure_ratio = 0.9
@@ -244,7 +244,7 @@ def vehicle_setup():
244244
wing = SUAVE.Components.Wings.Wing()
245245
wing.tag = 'vertical_stabilizer'
246246

247-
wing.aspect_ratio = 1.7 #
247+
wing.aspect_ratio = 1.7
248248
wing.sweeps.quarter_chord = 25 * Units.deg
249249
wing.thickness_to_chord = 0.12
250250
wing.taper = 0.10
@@ -259,8 +259,8 @@ def vehicle_setup():
259259
wing.areas.affected = 0.6 * wing.areas.wetted
260260
wing.twists.root = 0.0 * Units.degrees
261261
wing.twists.tip = 0.0 * Units.degrees
262-
wing.origin = [50,0,0]
263-
wing.aerodynamic_center = [2,0,0]
262+
wing.origin = [50,0,0] # meters
263+
wing.aerodynamic_center = [2,0,0] # meters
264264
wing.vertical = True
265265
wing.symmetric = False
266266
wing.dynamic_pressure_ratio = 1.0
@@ -277,7 +277,7 @@ def vehicle_setup():
277277

278278
fuselage.number_coach_seats = vehicle.passengers
279279
fuselage.seats_abreast = 4
280-
fuselage.seat_pitch = 0.7455
280+
fuselage.seat_pitch = 0.7455 * Units.meters
281281
fuselage.fineness.nose = 2.0
282282
fuselage.fineness.tail = 3.0
283283
fuselage.lengths.nose = 6.0 * Units.meter
@@ -305,7 +305,7 @@ def vehicle_setup():
305305
# ------------------------------------------------------------------
306306

307307

308-
#initialize the gas turbine network
308+
# initialize the gas turbine network
309309
gt_engine = SUAVE.Components.Energy.Networks.Turbofan()
310310
gt_engine.tag = 'turbofan'
311311

@@ -314,124 +314,124 @@ def vehicle_setup():
314314
gt_engine.engine_length = 2.71
315315
gt_engine.nacelle_diameter = 2.05
316316

317-
#set the working fluid for the network
317+
# set the working fluid for the network
318318
gt_engine.working_fluid = SUAVE.Attributes.Gases.Air
319319

320-
#Component 1 : ram, to convert freestream static to stagnation quantities
320+
# Component 1 : ram, to convert freestream static to stagnation quantities
321321
ram = SUAVE.Components.Energy.Converters.Ram()
322322
ram.tag = 'ram'
323323

324-
#add ram to the network
324+
# add ram to the network
325325
gt_engine.ram = ram
326326

327-
#Component 2 : inlet nozzle
327+
# Component 2 : inlet nozzle
328328
inlet_nozzle = SUAVE.Components.Energy.Converters.Compression_Nozzle()
329329
inlet_nozzle.tag = 'inlet nozzle'
330330

331331
inlet_nozzle.polytropic_efficiency = 0.98
332332
inlet_nozzle.pressure_ratio = 0.99
333333

334-
#add inlet nozzle to the network
334+
# add inlet nozzle to the network
335335
gt_engine.inlet_nozzle = inlet_nozzle
336336

337-
#Component 3 :low pressure compressor
337+
# Component 3 :low pressure compressor
338338
low_pressure_compressor = SUAVE.Components.Energy.Converters.Compressor()
339339
low_pressure_compressor.tag = 'lpc'
340340

341341
low_pressure_compressor.polytropic_efficiency = 0.91
342342
low_pressure_compressor.pressure_ratio = 1.9
343343

344-
#add low pressure compressor to the network
344+
# add low pressure compressor to the network
345345
gt_engine.low_pressure_compressor = low_pressure_compressor
346346

347-
#Component 4 :high pressure compressor
347+
# Component 4 :high pressure compressor
348348
high_pressure_compressor = SUAVE.Components.Energy.Converters.Compressor()
349349
high_pressure_compressor.tag = 'hpc'
350350

351351
high_pressure_compressor.polytropic_efficiency = 0.91
352352
high_pressure_compressor.pressure_ratio = 10.0
353353

354-
#add the high pressure compressor to the network
354+
# add the high pressure compressor to the network
355355
gt_engine.high_pressure_compressor = high_pressure_compressor
356356

357-
#Component 5 :low pressure turbine
357+
# Component 5 :low pressure turbine
358358
low_pressure_turbine = SUAVE.Components.Energy.Converters.Turbine()
359359
low_pressure_turbine.tag='lpt'
360360

361361
low_pressure_turbine.mechanical_efficiency = 0.99
362362
low_pressure_turbine.polytropic_efficiency = 0.99
363363

364-
#add low pressure turbine to the network
364+
# add low pressure turbine to the network
365365
gt_engine.low_pressure_turbine = low_pressure_turbine
366366

367-
#Component 5 :high pressure turbine
367+
# Component 5 :high pressure turbine
368368
high_pressure_turbine = SUAVE.Components.Energy.Converters.Turbine()
369369
high_pressure_turbine.tag='hpt'
370370

371371
high_pressure_turbine.mechanical_efficiency = 0.99
372372
high_pressure_turbine.polytropic_efficiency = 0.99
373373

374-
#add the high pressure turbine to the network
374+
# add the high pressure turbine to the network
375375
gt_engine.high_pressure_turbine = high_pressure_turbine
376376

377-
#Component 6 :combustor
377+
# Component 6 :combustor
378378
combustor = SUAVE.Components.Energy.Converters.Combustor()
379-
combustor.tag = 'Comb'
379+
combustor.tag = 'comb'
380380
combustor.efficiency = 0.99
381381
combustor.alphac = 1.0
382382
combustor.turbine_inlet_temperature = 1500
383383
combustor.pressure_ratio = 0.95
384384
combustor.fuel_data = SUAVE.Attributes.Propellants.Jet_A()
385385

386-
#add the combustor to the network
386+
# add the combustor to the network
387387
gt_engine.combustor = combustor
388388

389-
#Component 7 :core nozzle
389+
# Component 7 :core nozzle
390390
core_nozzle = SUAVE.Components.Energy.Converters.Expansion_Nozzle()
391391
core_nozzle.tag = 'core nozzle'
392392

393393
core_nozzle.polytropic_efficiency = 0.95
394394
core_nozzle.pressure_ratio = 0.99
395395

396-
#add the core nozzle to the network
396+
# add the core nozzle to the network
397397
gt_engine.core_nozzle = core_nozzle
398398

399-
#Component 8 :fan nozzle
399+
# Component 8 :fan nozzle
400400
fan_nozzle = SUAVE.Components.Energy.Converters.Expansion_Nozzle()
401401
fan_nozzle.tag = 'fan nozzle'
402402

403403
fan_nozzle.polytropic_efficiency = 0.95
404404
fan_nozzle.pressure_ratio = 0.98
405405

406-
#add the fan nozzle to the network
406+
# add the fan nozzle to the network
407407
gt_engine.fan_nozzle = fan_nozzle
408408

409-
#Component 9 : fan
409+
# Component 9 : fan
410410
fan = SUAVE.Components.Energy.Converters.Fan()
411411
fan.tag = 'fan'
412412

413413
fan.polytropic_efficiency = 0.93
414414
fan.pressure_ratio = 1.7
415415

416-
#add the fan to the network
416+
# add the fan to the network
417417
gt_engine.fan = fan
418418

419-
#Component 10 : thrust (to compute the thrust)
419+
# Component 10 : thrust (to compute the thrust)
420420
thrust = SUAVE.Components.Energy.Processes.Thrust()
421421
thrust.tag ='compute_thrust'
422422

423-
#total design thrust (includes all the engines)
423+
# total design thrust (includes all the engines)
424424
thrust.total_design = 37278.0* Units.N #Newtons
425425

426-
#design sizing conditions
426+
# design sizing conditions
427427
altitude = 35000.0*Units.ft
428428
mach_number = 0.78
429429
isa_deviation = 0.
430430

431431
# add thrust to the network
432432
gt_engine.thrust = thrust
433433

434-
#size the turbofan
434+
# size the turbofan
435435
turbofan_sizing(gt_engine,mach_number,altitude)
436436

437437
# add gas turbine network gt_engine to the vehicle

tut_solar_uav.py

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,12 @@ def vehicle_setup():
114114
wing.twists.tip = 0.0 * Units.degrees
115115
wing.highlift = False
116116
wing.vertical = False
117-
wing.eta = 1.0
118117
wing.number_ribs = 26.
119118
wing.number_end_ribs = 2.
120119
wing.transition_x_upper = 0.6
121120
wing.transition_x_lower = 1.0
122-
wing.origin = [3.0,0.0,0.0]
123-
wing.aerodynamic_center = [3.0,0.0,0.0]
121+
wing.origin = [3.0,0.0,0.0] # meters
122+
wing.aerodynamic_center = [3.0,0.0,0.0] # meters
124123

125124
# add to vehicle
126125
vehicle.append_component(wing)
@@ -152,8 +151,8 @@ def vehicle_setup():
152151
wing.chords.root = wing.areas.reference/wing.spans.projected
153152
wing.chords.tip = wing.areas.reference/wing.spans.projected
154153
wing.chords.mean_aerodynamic = wing.areas.reference/wing.spans.projected
155-
wing.origin = [10.,0.0,0.0]
156-
wing.aerodynamic_center = [0.5,0.0,0.0]
154+
wing.origin = [10.,0.0,0.0] # meters
155+
wing.aerodynamic_center = [0.5,0.0,0.0] # meters
157156

158157
# add to vehicle
159158
vehicle.append_component(wing)
@@ -182,8 +181,8 @@ def vehicle_setup():
182181
wing.areas.affected = 0.6 * wing.areas.wetted
183182
wing.twists.root = 0.0 * Units.degrees
184183
wing.twists.tip = 0.0 * Units.degrees
185-
wing.origin = [10.,0.0,0.0]
186-
wing.aerodynamic_center = [0.5,0.0,0.0]
184+
wing.origin = [10.,0.0,0.0] # meters
185+
wing.aerodynamic_center = [0.5,0.0,0.0] # meters
187186
wing.symmetric = True
188187
wing.vertical = True
189188
wing.t_tail = False
@@ -200,8 +199,8 @@ def vehicle_setup():
200199
# build network
201200
net = Solar()
202201
net.number_of_engines = 1.
203-
net.nacelle_diameter = 0.2
204-
net.engine_length = 0.01
202+
net.nacelle_diameter = 0.2 * Units.meters
203+
net.engine_length = 0.01 * Units.meters
205204
net.areas = Data()
206205
net.areas.wetted = 0.01*(2*np.pi*0.01/2.)
207206

@@ -227,11 +226,11 @@ def vehicle_setup():
227226
prop_attributes.number_blades = 2.0
228227
prop_attributes.freestream_velocity = 40.0 * Units['m/s']# freestream
229228
prop_attributes.angular_velocity = 150. * Units['rpm']
230-
prop_attributes.tip_radius = 4.25
231-
prop_attributes.hub_radius = 0.05
229+
prop_attributes.tip_radius = 4.25 * Units.meters
230+
prop_attributes.hub_radius = 0.05 * Units.meters
232231
prop_attributes.design_Cl = 0.7
233232
prop_attributes.design_altitude = 14.0 * Units.km
234-
prop_attributes.design_thrust = 0.0
233+
prop_attributes.design_thrust = 0.0
235234
prop_attributes.design_power = 3500.0 * Units.watts
236235
prop_attributes = propeller_design(prop_attributes)
237236

@@ -242,31 +241,31 @@ def vehicle_setup():
242241
# Component 4 the Motor
243242
motor = SUAVE.Components.Energy.Converters.Motor()
244243
motor.resistance = 0.008
245-
motor.no_load_current = 4.5
244+
motor.no_load_current = 4.5 * Units.Ampere
246245
motor.speed_constant = 120. * Units['rpm'] # RPM/volt converted to (rad/s)/volt
247246
motor.propeller_radius = prop.prop_attributes.tip_radius
248247
motor.propeller_Cp = prop.prop_attributes.Cp
249248
motor.gear_ratio = 12. # Gear ratio
250249
motor.gearbox_efficiency = .98 # Gear box efficiency
251250
motor.expected_current = 160. # Expected current
252-
motor.mass_properties.mass = 2.0
251+
motor.mass_properties.mass = 2.0 * Units.kg
253252
net.motor = motor
254253

255254
# Component 6 the Payload
256255
payload = SUAVE.Components.Energy.Peripherals.Payload()
257-
payload.power_draw = 50. #Watts
256+
payload.power_draw = 50. * Units.Watts
258257
payload.mass_properties.mass = 5.0 * Units.kg
259258
net.payload = payload
260259

261260
# Component 7 the Avionics
262261
avionics = SUAVE.Components.Energy.Peripherals.Avionics()
263-
avionics.power_draw = 50. #Watts
262+
avionics.power_draw = 50. * Units.Watts
264263
net.avionics = avionics
265264

266265
# Component 8 the Battery
267266
bat = SUAVE.Components.Energy.Storages.Batteries.Constant_Mass.Lithium_Ion()
268267
bat.mass_properties.mass = 55.0 * Units.kg
269-
bat.specific_energy = 450.*Units.Wh/Units.kg
268+
bat.specific_energy = 450. * Units.Wh/Units.kg
270269
bat.resistance = 0.05
271270
initialize_from_mass(bat,bat.mass_properties.mass)
272271
net.battery = bat
@@ -418,8 +417,8 @@ def mission_setup(analyses,vehicle):
418417
segment.mach = 0.12
419418
segment.distance = 3050.0 * Units.km
420419
segment.battery_energy = vehicle.propulsors.network.battery.max_energy*0.2 #Charge the battery to start
421-
segment.latitude = 37.4300
422-
segment.longitude = -122.1700
420+
segment.latitude = 37.4300 # this defaults to degrees (do not use Units.degrees)
421+
segment.longitude = -122.1700 # this defaults to degrees
423422

424423
mission.append_segment(segment)
425424

0 commit comments

Comments
 (0)