Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
planes committed Nov 6, 2022
2 parents dfdd415 + dc46e12 commit d0cdc76
Show file tree
Hide file tree
Showing 77 changed files with 2,576 additions and 2,599 deletions.
5 changes: 2 additions & 3 deletions regression/automatic_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,14 @@
modules = [

# ----------------------- Regression List --------------------------
'scripts/segments/transition_segment_test.py',
'scripts/aerodynamics/aerodynamics.py',
'scripts/aerodynamics/all_moving_surfaces_vlm.py',
'scripts/aerodynamics/control_surfaces_vlm.py',
'scripts/aerodynamics/sears_haack.py',
'scripts/aerodynamics/sideslip_and_rotation_vlm.py',
'scripts/airfoil_import/airfoil_import_test.py',
'scripts/airfoil_import/airfoil_interpolation_test.py',
'scripts/airfoil_analysis/airfoil_panel_method_test.py',
'scripts/airfoil_analysis/airfoil_polar_surrogate_test.py',
'scripts/airfoil_analysis/airfoil_panel_method_test.py',
'scripts/atmosphere/atmosphere.py',
'scripts/atmosphere/constant_temperature.py',
'scripts/AVL/test_AVL.py',
Expand Down Expand Up @@ -96,6 +94,7 @@
'scripts/rocket_network/Rocketdyne_F1.py',
'scripts/rocket_network/Rocketdyne_J2.py',
'scripts/segments/segment_test.py',
'scripts/segments/transition_segment_test.py',
'scripts/slipstream/slipstream_test.py',
'scripts/slipstream/propeller_interactions.py',
'scripts/solar_network/solar_network.py',
Expand Down
11 changes: 4 additions & 7 deletions regression/scripts/VTOL/test_Tiltwing.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def main():

# RPM check during hover
RPM = results.segments.departure.conditions.propulsion.propeller_rpm[0][0]
RPM_true = 1847.7091031178145
RPM_true = 1922.161595958687

print(RPM)
diff_RPM = np.abs(RPM - RPM_true)
Expand All @@ -66,16 +66,13 @@ def main():

# lift Coefficient Check During Cruise
lift_coefficient = results.segments.climb.conditions.aerodynamics.lift_coefficient[0][0]
lift_coefficient_true = 1.030344423712622
lift_coefficient_true = 1.0303444240760393
print(lift_coefficient)
diff_CL = np.abs(lift_coefficient - lift_coefficient_true)
print('CL difference')
print(diff_CL)
assert np.abs((lift_coefficient - lift_coefficient_true)/lift_coefficient_true) < 1e-3


return

assert np.abs((lift_coefficient - lift_coefficient_true)/lift_coefficient_true) < 1e-3
return

# ----------------------------------------------------------------------
# Setup
Expand Down
30 changes: 15 additions & 15 deletions regression/scripts/Vehicles/Additional_Fuel_Aircraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,21 +272,21 @@ def vehicle_setup():
# ------------------------------------------------------------------
# Nacelles
# ------------------------------------------------------------------
nacelle = SUAVE.Components.Nacelles.Nacelle()
nacelle.tag = 'nacelle_1'
nacelle.length = 2.71
nacelle.inlet_diameter = 1.90
nacelle.diameter = 2.05
nacelle.areas.wetted = 1.1*np.pi*nacelle.diameter*nacelle.length
nacelle.origin = [[13.72, -4.86,-1.9]]
nacelle.flow_through = True
nacelle_airfoil = SUAVE.Components.Airfoils.Airfoil()
nacelle_airfoil.naca_4_series_airfoil = '2410'
nacelle.append_airfoil(nacelle_airfoil)

nacelle_2 = deepcopy(nacelle)
nacelle_2.tag = 'nacelle_2'
nacelle_2.origin = [[13.72, 4.86,-1.9]]
nacelle = SUAVE.Components.Nacelles.Nacelle()
nacelle.tag = 'nacelle_1'
nacelle.length = 2.71
nacelle.inlet_diameter = 1.90
nacelle.diameter = 2.05
nacelle.areas.wetted = 1.1*np.pi*nacelle.diameter*nacelle.length
nacelle.origin = [[13.72, -4.86,-1.9]]
nacelle.flow_through = True
nacelle_airfoil = SUAVE.Components.Airfoils.Airfoil()
nacelle_airfoil.NACA_4_series_flag = True
nacelle_airfoil.coordinate_file = '2410'
nacelle.append_airfoil(nacelle_airfoil)
nacelle_2 = deepcopy(nacelle)
nacelle_2.tag = 'nacelle_2'
nacelle_2.origin = [[13.72, 4.86,-1.9]]

vehicle.append_component(nacelle)
vehicle.append_component(nacelle_2)
Expand Down
26 changes: 13 additions & 13 deletions regression/scripts/Vehicles/Boeing_737.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,19 +506,19 @@ def vehicle_setup():
# ------------------------------------------------------------------
# Nacelles
# ------------------------------------------------------------------
nacelle = SUAVE.Components.Nacelles.Nacelle()
nacelle.tag = 'nacelle_1'
nacelle.length = 2.71
nacelle.inlet_diameter = 1.90
nacelle.diameter = 2.05
nacelle.areas.wetted = 1.1*np.pi*nacelle.diameter*nacelle.length
nacelle.origin = [[13.72, -4.86,-1.9]]
nacelle.flow_through = True
nacelle.Airfoil.naca_4_series_airfoil = '2410'

nacelle_2 = deepcopy(nacelle)
nacelle_2.tag = 'nacelle_2'
nacelle_2.origin = [[13.72, 4.86,-1.9]]
nacelle = SUAVE.Components.Nacelles.Nacelle()
nacelle.tag = 'nacelle_1'
nacelle.length = 2.71
nacelle.inlet_diameter = 1.90
nacelle.diameter = 2.05
nacelle.areas.wetted = 1.1*np.pi*nacelle.diameter*nacelle.length
nacelle.origin = [[13.72, -4.86,-1.9]]
nacelle.flow_through = True
nacelle.Airfoil.NACA_4_series_flag = True
nacelle.Airfoil.coordinate_file = '2410'
nacelle_2 = deepcopy(nacelle)
nacelle_2.tag = 'nacelle_2'
nacelle_2.origin = [[13.72, 4.86,-1.9]]

vehicle.append_component(nacelle)
vehicle.append_component(nacelle_2)
Expand Down
24 changes: 10 additions & 14 deletions regression/scripts/Vehicles/Cessna_172.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
from SUAVE.Methods.Geometry.Three_Dimensional.compute_span_location_from_chord_length import compute_span_location_from_chord_length
from SUAVE.Methods.Flight_Dynamics.Static_Stability.Approximations.datcom import datcom
from SUAVE.Methods.Flight_Dynamics.Static_Stability.Approximations.Supporting_Functions.trapezoid_ac_x import trapezoid_ac_x
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.import_airfoil_geometry import import_airfoil_geometry
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.compute_airfoil_polars import compute_airfoil_polars
from SUAVE.Methods.Propulsion import propeller_design

def vehicle_setup():
Expand Down Expand Up @@ -246,18 +244,16 @@ def vehicle_setup():
prop.design_Cl = 0.8
prop.design_altitude = 12000. * Units.feet
prop.design_power = .64 * 180. * Units.horsepower
prop.variable_pitch = True

airfoil_geometry = ['../Vehicles/Airfoils/NACA_4412.txt']
airfoil_polars = [['../Vehicles//Airfoils/Polars/NACA_4412_polar_Re_50000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_100000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_200000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_500000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_1000000.txt' ]]

prop.airfoil_geometry_data = import_airfoil_geometry(airfoil_geometry)
prop.airfoil_polar_data = compute_airfoil_polars(airfoil_polars, prop.airfoil_geometry_data)
prop.airfoil_polar_stations = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
prop.variable_pitch = True
airfoil = SUAVE.Components.Airfoils.Airfoil()
airfoil.coordinate_file = '../Vehicles/Airfoils/NACA_4412.txt'
airfoil.polar_files = ['../Vehicles//Airfoils/Polars/NACA_4412_polar_Re_50000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_100000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_200000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_500000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_1000000.txt' ]
prop.append_airfoil(airfoil)
prop.airfoil_polar_stations = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
prop = propeller_design(prop)

net.propellers.append(prop)
Expand Down
25 changes: 11 additions & 14 deletions regression/scripts/Vehicles/Electric_Multicopter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
from SUAVE.Methods.Center_of_Gravity.compute_component_centers_of_gravity import compute_component_centers_of_gravity
from SUAVE.Methods.Propulsion.electric_motor_sizing import size_optimal_motor
from SUAVE.Methods.Weights.Correlations.Propulsion import nasa_motor, hts_motor , air_cooled_motor
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.import_airfoil_geometry import import_airfoil_geometry
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.compute_airfoil_polars import compute_airfoil_polars
import numpy as np
from copy import deepcopy

Expand Down Expand Up @@ -241,18 +239,17 @@ def vehicle_setup():
lift_rotor.angular_velocity = (design_tip_mach*speed_of_sound)/lift_rotor.tip_radius
lift_rotor.design_Cl = 0.7
lift_rotor.design_altitude = 1000 * Units.feet
lift_rotor.design_thrust = Hover_Load/(net.number_of_propeller_engines-1) # contingency for one-engine-inoperative condition

airfoil_geometry = ['../Vehicles/Airfoils/NACA_4412.txt']
airfoil_polars = [['../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_50000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_100000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_200000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_500000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_1000000.txt' ]]
lift_rotor.airfoil_geometry_data = import_airfoil_geometry(airfoil_geometry)
lift_rotor.airfoil_polar_data = compute_airfoil_polars(airfoil_polars, lift_rotor.airfoil_geometry_data)
lift_rotor.airfoil_polar_stations = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
lift_rotor = propeller_design(lift_rotor)
lift_rotor.design_thrust = Hover_Load/(net.number_of_propeller_engines-1) # contingency for one-engine-inoperative condition
airfoil = SUAVE.Components.Airfoils.Airfoil()
airfoil.coordinate_file = '../Vehicles/Airfoils/NACA_4412.txt'
airfoil.polar_files = ['../Vehicles//Airfoils/Polars/NACA_4412_polar_Re_50000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_100000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_200000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_500000.txt' ,
'../Vehicles/Airfoils/Polars/NACA_4412_polar_Re_1000000.txt' ]
lift_rotor.append_airfoil(airfoil)
lift_rotor.airfoil_polar_stations = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
lift_rotor = propeller_design(lift_rotor)

# Appending rotors with different origins
origins = [[ 0.,2.,1.4],[ 0.0,-2.,1.4],
Expand Down
6 changes: 3 additions & 3 deletions regression/scripts/Vehicles/Embraer_190.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ def vehicle_setup():
nacelle.inlet_diameter = 2.0
nacelle.origin = [[12.0,4.38,-2.1]]
Awet = 1.1*np.pi*nacelle.diameter*nacelle.length # 1.1 is simple coefficient
nacelle.areas.wetted = Awet
nacelle.Airfoil.naca_4_series_airfoil = '2410'

nacelle.areas.wetted = Awet
nacelle.Airfoil.NACA_4_series_flag = True
nacelle.Airfoil.coordinate_file = '2410'
nacelle_2 = deepcopy(nacelle)
nacelle_2.tag = 'nacelle_2'
nacelle_2.origin = [[12.0,-4.38,-2.1]]
Expand Down
58 changes: 26 additions & 32 deletions regression/scripts/Vehicles/Propellers/APC_10x7_thin_electric.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@
import SUAVE
from SUAVE.Core import Data, Units
import numpy as np
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.compute_airfoil_polars import compute_airfoil_polars
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.import_airfoil_geometry import import_airfoil_geometry
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.import_airfoil_geometry\
import import_airfoil_geometry
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.compute_airfoil_properties import (
compute_airfoil_properties,
)
import os


Expand Down Expand Up @@ -93,34 +96,25 @@ def propeller_geometry():
]
)

prop.pitch_command = 0.0* Units.deg
prop.twist_distribution = beta * Units.deg
prop.chord_distribution = c_R * prop.tip_radius
prop.radius_distribution = r_R * prop.tip_radius
prop.max_thickness_distribution = 0.12

prop.number_azimuthal_stations = 24
prop.number_radial_stations = len(r_R)

# Distance from mid chord to the line axis out of the center of the blade - In this case the 1/4 chords are all aligned
MCA = prop.chord_distribution/4. - prop.chord_distribution[0]/4.
prop.mid_chord_alignment = MCA

airfoils_path = os.path.join(os.path.dirname(__file__), "../Airfoils/")
polars_path = os.path.join(os.path.dirname(__file__), "../Airfoils/Polars/")
airfoil_geometry = [airfoils_path + "Clark_y.txt"]
airfoil_polars = [
[ polars_path + "Clark_y_polar_Re_50000.txt",
polars_path + "Clark_y_polar_Re_100000.txt",
polars_path + "Clark_y_polar_Re_200000.txt",
polars_path + "Clark_y_polar_Re_500000.txt",
polars_path + "Clark_y_polar_Re_1000000.txt",
],
]
prop.airfoil_geometry_data = import_airfoil_geometry(airfoil_geometry)
prop.airfoil_polar_data = compute_airfoil_polars(airfoil_polars, prop.airfoil_geometry_data)
prop.airfoil_polar_stations = np.zeros(len(r_R))
prop.airfoil_polar_stations = list(prop.airfoil_polar_stations.astype(int))


prop.pitch_command = 0.0* Units.deg
prop.twist_distribution = beta * Units.deg
prop.chord_distribution = c_R * prop.tip_radius
prop.radius_distribution = r_R * prop.tip_radius
prop.max_thickness_distribution = 0.12
prop.number_azimuthal_stations = 24
prop.number_radial_stations = len(r_R)
prop.mid_chord_alignment = prop.chord_distribution/4. - prop.chord_distribution[0]/4.
airfoils_path = os.path.join(os.path.dirname(__file__), "../Airfoils/")
polars_path = os.path.join(os.path.dirname(__file__), "../Airfoils/Polars/")
airfoil = SUAVE.Components.Airfoils.Airfoil()
airfoil.coordinate_file = airfoils_path + "Clark_y.txt"
airfoil.polar_files = [ polars_path + "Clark_y_polar_Re_50000.txt",
polars_path + "Clark_y_polar_Re_100000.txt",
polars_path + "Clark_y_polar_Re_200000.txt",
polars_path + "Clark_y_polar_Re_500000.txt",
polars_path + "Clark_y_polar_Re_1000000.txt"]
airfoil.geometry = import_airfoil_geometry(airfoil.coordinate_file,airfoil.number_of_points)
airfoil.polars = compute_airfoil_properties(airfoil.geometry,airfoil.polar_files)
prop.append_airfoil(airfoil)
prop.airfoil_polar_stations = list(np.zeros(len(r_R)).astype(int))
return prop
Loading

0 comments on commit d0cdc76

Please sign in to comment.