Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/suavecode/SUAVE into fea…
Browse files Browse the repository at this point in the history
…ture-low_noise_rotor
  • Loading branch information
mclarke2 committed Nov 6, 2022
2 parents a1e0e3f + dc46e12 commit 74acaa9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 59 deletions.
10 changes: 2 additions & 8 deletions regression/scripts/airfoil_import/airfoil_interpolation_test.py
Expand Up @@ -6,7 +6,6 @@

from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.generate_interpolated_airfoils import generate_interpolated_airfoils
from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.import_airfoil_geometry import import_airfoil_geometry
from SUAVE.Plots.Geometry import plot_airfoil
import pylab as plt
import os

Expand All @@ -24,16 +23,11 @@ def main():
new_files = generate_interpolated_airfoils(a1, a2, nairfoils,npoints=100,save_filename="Transition")

# import the new airfoil geometries and compare to the regression:
airfoil_data_1 = import_airfoil_geometry(new_files[1],npoints=100)
airfoil_data_2 = import_airfoil_geometry(new_files[2],npoints=100)
airfoil_data_1 = import_airfoil_geometry(new_files['a_1'].name,npoints=100)
airfoil_data_2 = import_airfoil_geometry(new_files['a_2'].name,npoints=100)
airfoil_data_1_r = import_airfoil_geometry("Transition1_regression.txt",npoints=100)
airfoil_data_2_r = import_airfoil_geometry("Transition2_regression.txt",npoints=100)

# plot airfoils
colors = ['blue','green','orange','red']
for af in range(len(new_files)):
plot_airfoil(new_files[af],line_color = colors[af] ,save_filename = airfoil_name)

# ensure coordinates are the same:
assert( max(abs(airfoil_data_1.x_coordinates - airfoil_data_1_r.x_coordinates)) < 1e-5)
assert( max(abs(airfoil_data_2.x_coordinates - airfoil_data_2_r.x_coordinates)) < 1e-5)
Expand Down
53 changes: 5 additions & 48 deletions trunk/SUAVE/Components/Energy/Converters/Rotor.py
Expand Up @@ -87,7 +87,7 @@ def __defaults__(self):
self.sol_tolerance = 1e-8
self.design_power_coefficient = 0.01

self.Airfoils = Airfoil_Container()
self.Airfoils = ContainerOrdered()
self.airfoil_polar_stations = None

self.use_2d_analysis = False # True if rotor is at an angle relative to freestream or nonuniform freestream
Expand All @@ -101,7 +101,7 @@ def __defaults__(self):
self.inputs.y_axis_rotation = 0.
self.inputs.pitch_command = 0.
self.variable_pitch = False

# Initialize the default wake set to Fidelity Zero
self.Wake = Rotor_Wake_Fidelity_Zero()

Expand All @@ -111,11 +111,10 @@ def __defaults__(self):
self.optimization_parameters.slack_constaint = 1E-3 # slack constraint
self.optimization_parameters.ideal_SPL_dBA = 45
self.optimization_parameters.aeroacoustic_weight = 1. # 1 = aerodynamic optimization, 0.5 = equally weighted aeroacoustic optimization, 0 = acoustic optimization




def append_airfoil(self,airfoil):
""" Adds an airfoil to the segment
""" Adds an airfoil to the rotor
Assumptions:
None
Expand Down Expand Up @@ -698,46 +697,4 @@ def prop_vel_to_body(self):
return rot_mat

def vec_to_prop_body(self):
return self.prop_vel_to_body()


## @ingroup Components-Wings
class Airfoil_Container(ContainerOrdered):
""" Container for rotor airfoil
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""

def get_children(self):
""" Returns the components that can go inside
Assumptions:
None
Source:
N/A
Inputs:
None
Outputs:
None
Properties Used:
N/A
"""

return []
return self.prop_vel_to_body()
Expand Up @@ -2,13 +2,14 @@
# generate_airfoil_transition.py
#
# Created: Mar 2021, R. Erhard
# Modified: Oct 2022, M. Clarke
# Modified:

# ----------------------------------------------------------------------
# Imports
# ----------------------------------------------------------------------

from SUAVE.Methods.Geometry.Two_Dimensional.Cross_Section.Airfoil.import_airfoil_geometry import import_airfoil_geometry
from SUAVE.Plots.Geometry import plot_airfoil
import numpy as np
import os

Expand Down Expand Up @@ -88,6 +89,10 @@ def generate_interpolated_airfoils(a1, a2, nairfoils, npoints=200, save_filename

# plot new and original airfoils:
airfoil_files.insert(0,a1)
airfoil_files.append(a2)
airfoil_files.append(a2)

return airfoil_files
for airfoil_file in airfoil_files:
name = os.path.basename(airfoil_file)
plot_airfoil(airfoil_file,save_filename = name[:-4])

return new_files

0 comments on commit 74acaa9

Please sign in to comment.