Skip to content

Commit

Permalink
more minor tutorial edits
Browse files Browse the repository at this point in the history
  • Loading branch information
timdmacdo committed Aug 14, 2017
1 parent 96a28a6 commit 3f72c69
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 55 deletions.
2 changes: 1 addition & 1 deletion tut_concorde.py
Expand Up @@ -240,7 +240,7 @@ def vehicle_setup():
fuselage = SUAVE.Components.Fuselages.Fuselage()
fuselage.tag = 'fuselage'
fuselage.seats_abreast = 4
fuselage.seat_pitch = 1
fuselage.seat_pitch = 1 * Units.meter
fuselage.fineness.nose = 4.3 * Units.meter
fuselage.fineness.tail = 6.4 * Units.meter
fuselage.lengths.total = 61.66 * Units.meter
Expand Down
2 changes: 1 addition & 1 deletion tut_mission_B737.py
Expand Up @@ -309,7 +309,7 @@ def vehicle_setup():

fuselage.number_coach_seats = vehicle.passengers
fuselage.seats_abreast = 6
fuselage.seat_pitch = 1
fuselage.seat_pitch = 1 * Units.meter
fuselage.fineness.nose = 1.6
fuselage.fineness.tail = 2.
fuselage.lengths.nose = 6.4 * Units.meter
Expand Down
68 changes: 34 additions & 34 deletions tut_payload_range.py
Expand Up @@ -198,7 +198,7 @@ def vehicle_setup():
wing.areas.affected = 0.6 * wing.areas.wetted
wing.twists.root = 2.0 * Units.degrees
wing.twists.tip = 0.0 * Units.degrees
wing.origin = [20.,0,0]
wing.origin = [20.,0,0] # meters
wing.vertical = False
wing.symmetric = True
wing.dynamic_pressure_ratio = 1.0
Expand Down Expand Up @@ -228,8 +228,8 @@ def vehicle_setup():
wing.areas.affected = 0.6 * wing.areas.wetted
wing.twists.root = 2.0 * Units.degrees
wing.twists.tip = 2.0 * Units.degrees
wing.origin = [50,0,0]
wing.aerodynamic_center = [2,0,0]
wing.origin = [50,0,0] # meters
wing.aerodynamic_center = [2,0,0] # meters
wing.vertical = False
wing.symmetric = True
wing.dynamic_pressure_ratio = 0.9
Expand All @@ -244,7 +244,7 @@ def vehicle_setup():
wing = SUAVE.Components.Wings.Wing()
wing.tag = 'vertical_stabilizer'

wing.aspect_ratio = 1.7 #
wing.aspect_ratio = 1.7
wing.sweeps.quarter_chord = 25 * Units.deg
wing.thickness_to_chord = 0.12
wing.taper = 0.10
Expand All @@ -259,8 +259,8 @@ def vehicle_setup():
wing.areas.affected = 0.6 * wing.areas.wetted
wing.twists.root = 0.0 * Units.degrees
wing.twists.tip = 0.0 * Units.degrees
wing.origin = [50,0,0]
wing.aerodynamic_center = [2,0,0]
wing.origin = [50,0,0] # meters
wing.aerodynamic_center = [2,0,0] # meters
wing.vertical = True
wing.symmetric = False
wing.dynamic_pressure_ratio = 1.0
Expand All @@ -277,7 +277,7 @@ def vehicle_setup():

fuselage.number_coach_seats = vehicle.passengers
fuselage.seats_abreast = 4
fuselage.seat_pitch = 0.7455
fuselage.seat_pitch = 0.7455 * Units.meters
fuselage.fineness.nose = 2.0
fuselage.fineness.tail = 3.0
fuselage.lengths.nose = 6.0 * Units.meter
Expand Down Expand Up @@ -305,7 +305,7 @@ def vehicle_setup():
# ------------------------------------------------------------------


#initialize the gas turbine network
# initialize the gas turbine network
gt_engine = SUAVE.Components.Energy.Networks.Turbofan()
gt_engine.tag = 'turbofan'

Expand All @@ -314,124 +314,124 @@ def vehicle_setup():
gt_engine.engine_length = 2.71
gt_engine.nacelle_diameter = 2.05

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

#Component 1 : ram, to convert freestream static to stagnation quantities
# Component 1 : ram, to convert freestream static to stagnation quantities
ram = SUAVE.Components.Energy.Converters.Ram()
ram.tag = 'ram'

#add ram to the network
# add ram to the network
gt_engine.ram = ram

#Component 2 : inlet nozzle
# Component 2 : inlet nozzle
inlet_nozzle = SUAVE.Components.Energy.Converters.Compression_Nozzle()
inlet_nozzle.tag = 'inlet nozzle'

inlet_nozzle.polytropic_efficiency = 0.98
inlet_nozzle.pressure_ratio = 0.99

#add inlet nozzle to the network
# add inlet nozzle to the network
gt_engine.inlet_nozzle = inlet_nozzle

#Component 3 :low pressure compressor
# Component 3 :low pressure compressor
low_pressure_compressor = SUAVE.Components.Energy.Converters.Compressor()
low_pressure_compressor.tag = 'lpc'

low_pressure_compressor.polytropic_efficiency = 0.91
low_pressure_compressor.pressure_ratio = 1.9

#add low pressure compressor to the network
# add low pressure compressor to the network
gt_engine.low_pressure_compressor = low_pressure_compressor

#Component 4 :high pressure compressor
# Component 4 :high pressure compressor
high_pressure_compressor = SUAVE.Components.Energy.Converters.Compressor()
high_pressure_compressor.tag = 'hpc'

high_pressure_compressor.polytropic_efficiency = 0.91
high_pressure_compressor.pressure_ratio = 10.0

#add the high pressure compressor to the network
# add the high pressure compressor to the network
gt_engine.high_pressure_compressor = high_pressure_compressor

#Component 5 :low pressure turbine
# Component 5 :low pressure turbine
low_pressure_turbine = SUAVE.Components.Energy.Converters.Turbine()
low_pressure_turbine.tag='lpt'

low_pressure_turbine.mechanical_efficiency = 0.99
low_pressure_turbine.polytropic_efficiency = 0.99

#add low pressure turbine to the network
# add low pressure turbine to the network
gt_engine.low_pressure_turbine = low_pressure_turbine

#Component 5 :high pressure turbine
# Component 5 :high pressure turbine
high_pressure_turbine = SUAVE.Components.Energy.Converters.Turbine()
high_pressure_turbine.tag='hpt'

high_pressure_turbine.mechanical_efficiency = 0.99
high_pressure_turbine.polytropic_efficiency = 0.99

#add the high pressure turbine to the network
# add the high pressure turbine to the network
gt_engine.high_pressure_turbine = high_pressure_turbine

#Component 6 :combustor
# Component 6 :combustor
combustor = SUAVE.Components.Energy.Converters.Combustor()
combustor.tag = 'Comb'
combustor.tag = 'comb'
combustor.efficiency = 0.99
combustor.alphac = 1.0
combustor.turbine_inlet_temperature = 1500
combustor.pressure_ratio = 0.95
combustor.fuel_data = SUAVE.Attributes.Propellants.Jet_A()

#add the combustor to the network
# add the combustor to the network
gt_engine.combustor = combustor

#Component 7 :core nozzle
# Component 7 :core nozzle
core_nozzle = SUAVE.Components.Energy.Converters.Expansion_Nozzle()
core_nozzle.tag = 'core nozzle'

core_nozzle.polytropic_efficiency = 0.95
core_nozzle.pressure_ratio = 0.99

#add the core nozzle to the network
# add the core nozzle to the network
gt_engine.core_nozzle = core_nozzle

#Component 8 :fan nozzle
# Component 8 :fan nozzle
fan_nozzle = SUAVE.Components.Energy.Converters.Expansion_Nozzle()
fan_nozzle.tag = 'fan nozzle'

fan_nozzle.polytropic_efficiency = 0.95
fan_nozzle.pressure_ratio = 0.98

#add the fan nozzle to the network
# add the fan nozzle to the network
gt_engine.fan_nozzle = fan_nozzle

#Component 9 : fan
# Component 9 : fan
fan = SUAVE.Components.Energy.Converters.Fan()
fan.tag = 'fan'

fan.polytropic_efficiency = 0.93
fan.pressure_ratio = 1.7

#add the fan to the network
# add the fan to the network
gt_engine.fan = fan

#Component 10 : thrust (to compute the thrust)
# Component 10 : thrust (to compute the thrust)
thrust = SUAVE.Components.Energy.Processes.Thrust()
thrust.tag ='compute_thrust'

#total design thrust (includes all the engines)
# total design thrust (includes all the engines)
thrust.total_design = 37278.0* Units.N #Newtons

#design sizing conditions
# design sizing conditions
altitude = 35000.0*Units.ft
mach_number = 0.78
isa_deviation = 0.

# add thrust to the network
gt_engine.thrust = thrust

#size the turbofan
# size the turbofan
turbofan_sizing(gt_engine,mach_number,altitude)

# add gas turbine network gt_engine to the vehicle
Expand Down
37 changes: 18 additions & 19 deletions tut_solar_uav.py
Expand Up @@ -114,13 +114,12 @@ def vehicle_setup():
wing.twists.tip = 0.0 * Units.degrees
wing.highlift = False
wing.vertical = False
wing.eta = 1.0
wing.number_ribs = 26.
wing.number_end_ribs = 2.
wing.transition_x_upper = 0.6
wing.transition_x_lower = 1.0
wing.origin = [3.0,0.0,0.0]
wing.aerodynamic_center = [3.0,0.0,0.0]
wing.origin = [3.0,0.0,0.0] # meters
wing.aerodynamic_center = [3.0,0.0,0.0] # meters

# add to vehicle
vehicle.append_component(wing)
Expand Down Expand Up @@ -152,8 +151,8 @@ def vehicle_setup():
wing.chords.root = wing.areas.reference/wing.spans.projected
wing.chords.tip = wing.areas.reference/wing.spans.projected
wing.chords.mean_aerodynamic = wing.areas.reference/wing.spans.projected
wing.origin = [10.,0.0,0.0]
wing.aerodynamic_center = [0.5,0.0,0.0]
wing.origin = [10.,0.0,0.0] # meters
wing.aerodynamic_center = [0.5,0.0,0.0] # meters

# add to vehicle
vehicle.append_component(wing)
Expand Down Expand Up @@ -182,8 +181,8 @@ def vehicle_setup():
wing.areas.affected = 0.6 * wing.areas.wetted
wing.twists.root = 0.0 * Units.degrees
wing.twists.tip = 0.0 * Units.degrees
wing.origin = [10.,0.0,0.0]
wing.aerodynamic_center = [0.5,0.0,0.0]
wing.origin = [10.,0.0,0.0] # meters
wing.aerodynamic_center = [0.5,0.0,0.0] # meters
wing.symmetric = True
wing.vertical = True
wing.t_tail = False
Expand All @@ -200,8 +199,8 @@ def vehicle_setup():
# build network
net = Solar()
net.number_of_engines = 1.
net.nacelle_diameter = 0.2
net.engine_length = 0.01
net.nacelle_diameter = 0.2 * Units.meters
net.engine_length = 0.01 * Units.meters
net.areas = Data()
net.areas.wetted = 0.01*(2*np.pi*0.01/2.)

Expand All @@ -227,11 +226,11 @@ def vehicle_setup():
prop_attributes.number_blades = 2.0
prop_attributes.freestream_velocity = 40.0 * Units['m/s']# freestream
prop_attributes.angular_velocity = 150. * Units['rpm']
prop_attributes.tip_radius = 4.25
prop_attributes.hub_radius = 0.05
prop_attributes.tip_radius = 4.25 * Units.meters
prop_attributes.hub_radius = 0.05 * Units.meters
prop_attributes.design_Cl = 0.7
prop_attributes.design_altitude = 14.0 * Units.km
prop_attributes.design_thrust = 0.0
prop_attributes.design_thrust = 0.0
prop_attributes.design_power = 3500.0 * Units.watts
prop_attributes = propeller_design(prop_attributes)

Expand All @@ -242,31 +241,31 @@ def vehicle_setup():
# Component 4 the Motor
motor = SUAVE.Components.Energy.Converters.Motor()
motor.resistance = 0.008
motor.no_load_current = 4.5
motor.no_load_current = 4.5 * Units.Ampere
motor.speed_constant = 120. * Units['rpm'] # RPM/volt converted to (rad/s)/volt
motor.propeller_radius = prop.prop_attributes.tip_radius
motor.propeller_Cp = prop.prop_attributes.Cp
motor.gear_ratio = 12. # Gear ratio
motor.gearbox_efficiency = .98 # Gear box efficiency
motor.expected_current = 160. # Expected current
motor.mass_properties.mass = 2.0
motor.mass_properties.mass = 2.0 * Units.kg
net.motor = motor

# Component 6 the Payload
payload = SUAVE.Components.Energy.Peripherals.Payload()
payload.power_draw = 50. #Watts
payload.power_draw = 50. * Units.Watts
payload.mass_properties.mass = 5.0 * Units.kg
net.payload = payload

# Component 7 the Avionics
avionics = SUAVE.Components.Energy.Peripherals.Avionics()
avionics.power_draw = 50. #Watts
avionics.power_draw = 50. * Units.Watts
net.avionics = avionics

# Component 8 the Battery
bat = SUAVE.Components.Energy.Storages.Batteries.Constant_Mass.Lithium_Ion()
bat.mass_properties.mass = 55.0 * Units.kg
bat.specific_energy = 450.*Units.Wh/Units.kg
bat.specific_energy = 450. * Units.Wh/Units.kg
bat.resistance = 0.05
initialize_from_mass(bat,bat.mass_properties.mass)
net.battery = bat
Expand Down Expand Up @@ -418,8 +417,8 @@ def mission_setup(analyses,vehicle):
segment.mach = 0.12
segment.distance = 3050.0 * Units.km
segment.battery_energy = vehicle.propulsors.network.battery.max_energy*0.2 #Charge the battery to start
segment.latitude = 37.4300
segment.longitude = -122.1700
segment.latitude = 37.4300 # this defaults to degrees (do not use Units.degrees)
segment.longitude = -122.1700 # this defaults to degrees

mission.append_segment(segment)

Expand Down

0 comments on commit 3f72c69

Please sign in to comment.