From 517e67b01c75bc33adbb78991987a69bd4c42934 Mon Sep 17 00:00:00 2001 From: planes Date: Tue, 15 Mar 2022 15:12:35 -0700 Subject: [PATCH] updated existing tutorials --- B737_AVL_Tutorial/tut_mission_B737_AVL.py | 31 ++++------------------- BWB_CFD/BWB.py | 2 +- BWB_CFD/base_data.txt | 13 ++++++++++ Regional_Jet_Optimization/Optimize.py | 4 +-- Solar_UAV_Optimization/Optimize.py | 2 +- Solar_UAV_Optimization/Plot_Mission.py | 8 +++--- Solar_UAV_Optimization/Vehicles.py | 2 +- tut_concorde.py | 5 ++-- tut_mission_B737.py | 2 +- tut_payload_range.py | 5 ++-- tut_solar_uav.py | 6 ++--- 11 files changed, 36 insertions(+), 44 deletions(-) create mode 100644 BWB_CFD/base_data.txt diff --git a/B737_AVL_Tutorial/tut_mission_B737_AVL.py b/B737_AVL_Tutorial/tut_mission_B737_AVL.py index fd87ed8..f00b15a 100644 --- a/B737_AVL_Tutorial/tut_mission_B737_AVL.py +++ b/B737_AVL_Tutorial/tut_mission_B737_AVL.py @@ -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 @@ -113,7 +107,8 @@ 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) @@ -121,7 +116,7 @@ def base_analysis(vehicle): # 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) @@ -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 diff --git a/BWB_CFD/BWB.py b/BWB_CFD/BWB.py index a7ef16b..e2dd375 100644 --- a/BWB_CFD/BWB.py +++ b/BWB_CFD/BWB.py @@ -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 diff --git a/BWB_CFD/base_data.txt b/BWB_CFD/base_data.txt new file mode 100644 index 0000000..deaeabc --- /dev/null +++ b/BWB_CFD/base_data.txt @@ -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 diff --git a/Regional_Jet_Optimization/Optimize.py b/Regional_Jet_Optimization/Optimize.py index 5f08ab4..3c31e5e 100644 --- a/Regional_Jet_Optimization/Optimize.py +++ b/Regional_Jet_Optimization/Optimize.py @@ -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 @@ -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 diff --git a/Solar_UAV_Optimization/Optimize.py b/Solar_UAV_Optimization/Optimize.py index c4b1365..bbbb5b7 100644 --- a/Solar_UAV_Optimization/Optimize.py +++ b/Solar_UAV_Optimization/Optimize.py @@ -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 diff --git a/Solar_UAV_Optimization/Plot_Mission.py b/Solar_UAV_Optimization/Plot_Mission.py index 8ee9c43..59f9764 100644 --- a/Solar_UAV_Optimization/Plot_Mission.py +++ b/Solar_UAV_Optimization/Plot_Mission.py @@ -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() \ No newline at end of file diff --git a/Solar_UAV_Optimization/Vehicles.py b/Solar_UAV_Optimization/Vehicles.py index cbbc715..ccbc8de 100644 --- a/Solar_UAV_Optimization/Vehicles.py +++ b/Solar_UAV_Optimization/Vehicles.py @@ -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 diff --git a/tut_concorde.py b/tut_concorde.py index 59f4ea8..74e7966 100644 --- a/tut_concorde.py +++ b/tut_concorde.py @@ -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 diff --git a/tut_mission_B737.py b/tut_mission_B737.py index 18297bb..bad49b9 100644 --- a/tut_mission_B737.py +++ b/tut_mission_B737.py @@ -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 diff --git a/tut_payload_range.py b/tut_payload_range.py index c88562b..bf607f5 100644 --- a/tut_payload_range.py +++ b/tut_payload_range.py @@ -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 diff --git a/tut_solar_uav.py b/tut_solar_uav.py index 7f99db4..f6ed2d7 100644 --- a/tut_solar_uav.py +++ b/tut_solar_uav.py @@ -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 @@ -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