Skip to content

Commit

Permalink
various 2.5 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
planes committed Nov 8, 2021
1 parent efd5f29 commit e60deee
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 38 deletions.
12 changes: 6 additions & 6 deletions B737_AVL_Tutorial/tut_mission_B737_AVL.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,26 @@ 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.filenames.avl_bin_name = 'CHANGE ME TO YOUR DIRECTORY'
aerodynamics.process.compute.lift.inviscid.settings.filenames.avl_bin_name = '/Users/emiliobotero/Research/avl3.35'
#aerodynamics.process.compute.lift.inviscid.settings.spanwise_vortex_density = 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.filenames.avl_bin_name = 'CHANGE ME TO YOUR DIRECTORY'
stability.settings.filenames.avl_bin_name = '/Users/emiliobotero/Research/avl3.35'

#stability.settings.spanwise_vortex_density = 3
stability.geometry = vehicle
analyses.append(stability)

# ------------------------------------------------------------------
# Energy
energy= SUAVE.Analyses.Energy.Energy()
energy.network = vehicle.propulsors
energy.network = vehicle.networks
analyses.append(energy)

# ------------------------------------------------------------------
Expand Down Expand Up @@ -347,9 +350,6 @@ def vehicle_setup():
turbofan.bypass_ratio = 5.4
turbofan.origin = [[13.72, 4.86,-1.9],[13.72, -4.86,-1.9]]

#compute engine areas
turbofan.areas.wetted = 1.1*np.pi*turbofan.nacelle_diameter*turbofan.engine_length

# working fluid
turbofan.working_fluid = SUAVE.Attributes.Gases.Air()

Expand Down
40 changes: 22 additions & 18 deletions BWB_CFD/BWB.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

from SUAVE.Methods.Propulsion.turbofan_sizing import turbofan_sizing
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Propulsion import compute_turbofan_geometry
from SUAVE.Methods.Geometry.Two_Dimensional.Planform import segment_properties

from SUAVE.Plots.Performance.Mission_Plots import *

Expand Down Expand Up @@ -156,7 +157,7 @@ def base_analysis(vehicle):
# ------------------------------------------------------------------
# Energy
energy= SUAVE.Analyses.Energy.Energy()
energy.network = vehicle.propulsors
energy.network = vehicle.networks
analyses.append(energy)

# ------------------------------------------------------------------
Expand Down Expand Up @@ -330,6 +331,9 @@ def vehicle_setup():
segment.sweeps.quarter_chord = 0. * Units.degrees
segment.thickness_to_chord = 0.10
wing.Segments.append(segment)

# Fill out more segment properties automatically
wing = segment_properties(wing)

# add to vehicle
vehicle.append_component(wing)
Expand All @@ -341,20 +345,8 @@ def vehicle_setup():
nacelle.diameter = 3.96 * Units.meters
nacelle.length = 289. * Units.inches
nacelle.tag = 'nacelle'
nacelle.origin = [[133.0 *Units.feet, 25.0*Units.feet, 6.5*Units.feet]]
nacelle.areas.wetted = nacelle.length *(2*np.pi*nacelle.diameter/2.)

nacelle_2 = deepcopy(nacelle)
nacelle_2.tag = 'nacelle_2'
nacelle_2.origin = [[145.0 *Units.feet, 0.0*Units.feet, 6.5*Units.feet]]

nacelle_3 = deepcopy(nacelle)
nacelle_3.tag = 'nacelle_3'
nacelle_3.origin = [[133.0 *Units.feet, -25.0*Units.feet, 6.5*Units.feet]]

vehicle.append_component(nacelle)
vehicle.append_component(nacelle_2)
vehicle.append_component(nacelle_3)
nacelle.origin = [[123.0 *Units.feet, 25.0*Units.feet, 6.5*Units.feet]]
nacelle.Airfoil.naca_4_series_airfoil = '0012'


# ------------------------------------------------------------------
Expand Down Expand Up @@ -506,19 +498,31 @@ def vehicle_setup():
#design sizing conditions
altitude = 0. * Units.km
mach_number = 0.01
isa_deviation = 0.

# add to network
turbofan.thrust = thrust

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

#computing the engine length and diameter
compute_turbofan_geometry(turbofan,None)
compute_turbofan_geometry(turbofan,nacelle)

vehicle.append_component(turbofan)

# Finish adding all the nacelles

nacelle_2 = deepcopy(nacelle)
nacelle_2.tag = 'nacelle_2'
nacelle_2.origin = [[135.0 *Units.feet, 0.0*Units.feet, 6.5*Units.feet]]

nacelle_3 = deepcopy(nacelle)
nacelle_3.tag = 'nacelle_3'
nacelle_3.origin = [[123.0 *Units.feet, -25.0*Units.feet, 6.5*Units.feet]]

vehicle.append_component(nacelle)
vehicle.append_component(nacelle_2)
vehicle.append_component(nacelle_3)


# ------------------------------------------------------------------
Expand Down
31 changes: 17 additions & 14 deletions tut_solar_uav.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import SUAVE
#if not SUAVE.__version__=='2.5.0':
#assert('These tutorials only work with the SUAVE 2.5.0 release')
from SUAVE.Core import Units, Data
from SUAVE.Core import Units

import numpy as np
import pylab as plt
Expand Down Expand Up @@ -240,23 +240,23 @@ def vehicle_setup():
prop.tip_radius = 4.25 * Units.meters
prop.hub_radius = 0.05 * Units.meters
prop.design_Cl = 0.7
prop.design_altitude = 14.0 * Units.km
prop.design_thrust = None
prop.design_power = 3500.0 * Units.watts
prop.design_altitude = 15.0 * Units.km
prop.design_power = None
prop.design_thrust = 120.
prop = propeller_design(prop)

net.propellers.append(prop)

# Component 4 the Motor
motor = SUAVE.Components.Energy.Converters.Motor()
motor.resistance = 0.008
motor.no_load_current = 4.5 * Units.ampere
motor.speed_constant = 120. * Units['rpm'] # RPM/volt converted to (rad/s)/volt
motor.resistance = 0.006
motor.no_load_current = 2.5 * Units.ampere
motor.speed_constant = 30. * Units['rpm'] # RPM/volt converted to (rad/s)/volt
motor.propeller_radius = prop.tip_radius
motor.propeller_Cp = prop.design_power_coefficient
motor.gear_ratio = 12. # Gear ratio
motor.gearbox_efficiency = .98 # Gear box efficiency
motor.expected_current = 160. # Expected current
motor.expected_current = 60. # Expected current
motor.mass_properties.mass = 2.0 * Units.kg
net.motors.append(motor)

Expand All @@ -274,15 +274,14 @@ 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 = 700. * Units.Wh/Units.kg
bat.resistance = 0.05
bat.max_voltage = 45.0
initialize_from_mass(bat,bat.mass_properties.mass)
bat.specific_energy = 600. * Units.Wh/Units.kg
bat.max_voltage = 130.0
initialize_from_mass(bat)
net.battery = bat

#Component 9 the system logic controller and MPPT
logic = SUAVE.Components.Energy.Distributors.Solar_Logic()
logic.system_voltage = 40.0
logic.system_voltage = 120.0
logic.MPPT_efficiency = 0.95
net.solar_logic = logic

Expand Down Expand Up @@ -403,6 +402,7 @@ def mission_setup(analyses,vehicle):

# base segment
base_segment = Segments.Segment()
base_segment.process.iterate.initials.initialize_battery = SUAVE.Methods.Missions.Segments.Common.Energy.initialize_battery

# ------------------------------------------------------------------
# Cruise Segment: constant speed, constant altitude
Expand All @@ -420,7 +420,7 @@ def mission_setup(analyses,vehicle):
segment.altitude = 15.0 * Units.km
segment.mach = 0.12
segment.distance = 3050.0 * Units.km
segment.battery_energy = vehicle.networks.solar.battery.max_energy*0.2 #Charge the battery to start
segment.battery_energy = vehicle.networks.solar.battery.max_energy*0.3 #Charge the battery to start
segment.latitude = 37.4300 # this defaults to degrees (do not use Units.degrees)
segment.longitude = -122.1700 # this defaults to degrees

Expand Down Expand Up @@ -461,6 +461,9 @@ def plot_mission(results):

# Plot Aerodynamic Coefficients
plot_aerodynamic_coefficients(results)

# Drag Components
plot_drag_components(results)

# Plot Aircraft Flight Speed
plot_aircraft_velocities(results)
Expand Down

0 comments on commit e60deee

Please sign in to comment.