Skip to content

Commit

Permalink
updated existing tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
planes committed Mar 15, 2022
1 parent ee8e53b commit 517e67b
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 44 deletions.
31 changes: 5 additions & 26 deletions B737_AVL_Tutorial/tut_mission_B737_AVL.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,11 @@

# SUAVE Imports
import SUAVE
assert SUAVE.__version__=='2.5.0', 'These tutorials only work with the SUAVE 2.5.0 release'
assert SUAVE.__version__=='2.5.2', 'These tutorials only work with the SUAVE 2.5.2 release'

from SUAVE.Core import Data, Units
from SUAVE.Core import Units
from SUAVE.Plots.Performance.Mission_Plots import *
from SUAVE.Methods.Propulsion.turbofan_sizing import turbofan_sizing
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Propulsion import compute_turbofan_geometry
from SUAVE.Input_Output.Results import print_parasite_drag, \
print_compress_drag, \
print_engine_data, \
print_mission_breakdown, \
print_weight_breakdown

# Python Imports
import numpy as np
Expand Down Expand Up @@ -113,15 +107,16 @@ def base_analysis(vehicle):
# Aerodynamics Analysis
aerodynamics = SUAVE.Analyses.Aerodynamics.AVL()
aerodynamics.process.compute.lift.inviscid.settings.filenames.avl_bin_name = 'CHANGE ME TO YOUR DIRECTORY'
#aerodynamics.process.compute.lift.inviscid.settings.spanwise_vortex_density = 3
#aerodynamics.settings.number_spanwise_vortices = 5
#aerodynamics.settings.number_chordwise_vortices = 3
aerodynamics.geometry = vehicle
analyses.append(aerodynamics)

# ------------------------------------------------------------------
# Stability Analysis
stability = SUAVE.Analyses.Stability.AVL()
stability.settings.filenames.avl_bin_name = 'CHANGE ME TO YOUR DIRECTORY'
#stability.settings.spanwise_vortex_density = 3

stability.geometry = vehicle
analyses.append(stability)

Expand Down Expand Up @@ -179,22 +174,6 @@ def vehicle_setup():
vehicle.systems.control = "fully powered"
vehicle.systems.accessories = "medium range"

# ------------------------------------------------------------------
# Landing Gear
# ------------------------------------------------------------------
# used for noise calculations
landing_gear = SUAVE.Components.Landing_Gear.Landing_Gear()
landing_gear.tag = "main_landing_gear"

landing_gear.main_tire_diameter = 1.12000 * Units.m
landing_gear.nose_tire_diameter = 0.6858 * Units.m
landing_gear.main_strut_length = 1.8 * Units.m
landing_gear.nose_strut_length = 1.3 * Units.m
landing_gear.main_units = 2 #number of main landing gear units
landing_gear.nose_units = 1 #number of nose landing gear
landing_gear.main_wheels = 2 #number of wheels on the main landing gear
landing_gear.nose_wheels = 2 #number of wheels on the nose landing gear
vehicle.landing_gear = landing_gear

# ------------------------------------------------------------------
# Main Wing
Expand Down
2 changes: 1 addition & 1 deletion BWB_CFD/BWB.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ----------------------------------------------------------------------

import SUAVE
assert SUAVE.__version__=='2.5.0', 'These tutorials only work with the SUAVE 2.5.0 release'
assert SUAVE.__version__=='2.5.2', 'These tutorials only work with the SUAVE 2.5.2 release'

import numpy as np
import pylab as plt
Expand Down
13 changes: 13 additions & 0 deletions BWB_CFD/base_data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# AoA Mach CL CD
0.00000000 0.30000000 0.00415459 0.00111181
0.00000000 0.50000000 0.00413721 0.00147859
0.00000000 0.70000000 0.00453948 0.00248097
0.00000000 0.85000000 0.00746666 0.01186390
0.05235988 0.30000000 0.20388958 0.00432118
0.05235988 0.50000000 0.21483924 0.00532740
0.05235988 0.70000000 0.24112666 0.00817240
0.05235988 0.85000000 0.30532633 0.03115450
0.10471976 0.30000000 0.40011425 0.01441278
0.10471976 0.50000000 0.41798452 0.01788826
0.10471976 0.70000000 0.45717927 0.02884358
0.10471976 0.85000000 0.52613515 0.07289007
4 changes: 2 additions & 2 deletions Regional_Jet_Optimization/Optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ----------------------------------------------------------------------

import SUAVE
assert SUAVE.__version__=='2.5.0', 'These tutorials only work with the SUAVE 2.5.0 release'
assert SUAVE.__version__=='2.5.2', 'These tutorials only work with the SUAVE 2.5.2 release'
from SUAVE.Core import Units, Data
import numpy as np
import Vehicles
Expand All @@ -30,7 +30,7 @@ def main():
## Base Input Values
output = problem.objective()

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

# Uncomment for the first optimization
Expand Down
2 changes: 1 addition & 1 deletion Solar_UAV_Optimization/Optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# ----------------------------------------------------------------------

import SUAVE
assert SUAVE.__version__=='2.5.0', 'These tutorials only work with the SUAVE 2.5.0 release'
assert SUAVE.__version__=='2.5.2', 'These tutorials only work with the SUAVE 2.5.2 release'

from SUAVE.Core import Units, Data
import numpy as np
Expand Down
8 changes: 5 additions & 3 deletions Solar_UAV_Optimization/Plot_Mission.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ def plot_mission(results,line_style='bo-'):
# Plot Solar Conditions
plot_solar_flux(results)

# Plot Aircraft Electronics
plot_battery_pack_conditions(results)
# Plot Aerodynamic Forces
plot_aerodynamic_forces(results, line_style)

# Plot Aerodynamic Coefficients
plot_aerodynamic_coefficients(results, line_style)

return

if __name__ == '__main__':
main()
plt.show()
2 changes: 1 addition & 1 deletion Solar_UAV_Optimization/Vehicles.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def base_setup():
# Component 8 the Battery
bat = SUAVE.Components.Energy.Storages.Batteries.Constant_Mass.Lithium_Ion()
bat.mass_properties.mass = 3.0 * Units.kg
bat.specific_energy = 200. *Units.Wh/Units.kg
bat.specific_energy = 400. *Units.Wh/Units.kg
bat.resistance = 0.003
initialize_from_mass(bat,bat.mass_properties.mass)
net.battery = bat
Expand Down
5 changes: 2 additions & 3 deletions tut_concorde.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@
# ----------------------------------------------------------------------

import SUAVE
assert SUAVE.__version__=='2.5.0', 'These tutorials only work with the SUAVE 2.5.0 release'
from SUAVE.Core import Units, Data
assert SUAVE.__version__=='2.5.2', 'These tutorials only work with the SUAVE 2.5.2 release'
from SUAVE.Core import Units
from SUAVE.Plots.Performance.Mission_Plots import *
from SUAVE.Methods.Propulsion.turbojet_sizing import turbojet_sizing

import numpy as np
import pylab as plt

from copy import deepcopy
Expand Down
2 changes: 1 addition & 1 deletion tut_mission_B737.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# SUAVE Imports
import SUAVE
assert SUAVE.__version__=='2.5.0', 'These tutorials only work with the SUAVE 2.5.0 release'
assert SUAVE.__version__=='2.5.2', 'These tutorials only work with the SUAVE 2.5.2 release'
from SUAVE.Core import Data, Units
# The Data import here is a native SUAVE data structure that functions similarly to a dictionary.
# However, iteration directly returns values, and values can be retrieved either with the
Expand Down
5 changes: 2 additions & 3 deletions tut_payload_range.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
# ----------------------------------------------------------------------

import SUAVE
assert SUAVE.__version__=='2.5.0', 'These tutorials only work with the SUAVE 2.5.0 release'
from SUAVE.Core import Units, Data
assert SUAVE.__version__=='2.5.2', 'These tutorials only work with the SUAVE 2.5.2 release'
from SUAVE.Core import Units
from SUAVE.Methods.Propulsion.turbofan_sizing import turbofan_sizing
from SUAVE.Methods.Performance import payload_range
from SUAVE.Methods.Geometry.Two_Dimensional.Planform import wing_planform
from SUAVE.Plots.Performance.Mission_Plots import *

import numpy as np
import pylab as plt


Expand Down
6 changes: 3 additions & 3 deletions tut_solar_uav.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Imports
# ----------------------------------------------------------------------
import SUAVE
assert SUAVE.__version__=='2.5.0', 'These tutorials only work with the SUAVE 2.5.0 release'
assert SUAVE.__version__=='2.5.2', 'These tutorials only work with the SUAVE 2.5.2 release'
from SUAVE.Core import Units

import numpy as np
Expand Down Expand Up @@ -272,8 +272,8 @@ def vehicle_setup():

# Component 8 the Battery
bat = SUAVE.Components.Energy.Storages.Batteries.Constant_Mass.Lithium_Ion()
bat.mass_properties.mass = 90.0 * Units.kg
bat.specific_energy = 600. * Units.Wh/Units.kg
bat.mass_properties.mass = 95.0 * Units.kg
bat.specific_energy = 800. * Units.Wh/Units.kg
bat.max_voltage = 130.0
initialize_from_mass(bat)
net.battery = bat
Expand Down

0 comments on commit 517e67b

Please sign in to comment.