airfoils package

Submodules

airfoils.airfoils module

Provides tools to create and modify airfoil objects

Developed for Airinnova AB, Stockholm, Sweden.

class airfoils.airfoils.Airfoil(upper, lower)

Bases: object

classmethod NACA4(naca_digits, n_points=200)

Create an airfoil object from a NACA 4-digit series definition

Note:
  • This is an alternative constructor method

Args:
naca_digits

String like ‘4412’

points

Total number of points used to create the airfoil

Returns:
airfoil

New airfoil instance

property all_points

Returns a single 2 x N array with x and y-coordinates in separate columns

camber_line(x)

Compute the camber line

Method 1: y_camber = (y_upper + y_lower)/2

Args:
x

Relative chordwise coordinate ranging from 0 to 1

Returns:
camber_line

y-coordinates at given x positions

camber_line_angle(x)

Compute the camber line angle

Args:
x

Relative chordwise coordinate ranging from 0 to 1

Returns:
theta

Camber line angle at given x positions

classmethod morph_new_from_two_foils(airfoil1, airfoil2, eta, n_points)

Create an airfoil object from a linear interpolation between two airfoil objects

Note:
  • This is an alternative constructor method

Args:
airfoil1

Airfoil object at eta = 0

airfoil2

Airfoil object at eta = 1

eta

Relative position where eta = [0, 1]

n_points

Number of points for new airfoil object

Returns:
airfoil

New airfoil instance

plot(*, show=True, save=False, settings={})

Plot the airfoil and camber line

Note:
  • ‘show’ and/or ‘save’ must be True

Args:
show

(bool) Create an interactive plot

save

(bool) Save plot to file

settings

(bool) Plot settings

Plot settings:
  • Plot settings must be a dictionary

  • Allowed keys:

‘points’: (bool) ==> Plot coordinate points ‘camber’: (bool) ==> Plot camber ‘chord’: (bool) ==> Plot chord ‘path’: (str) ==> Output path (directory path, must exists) ‘file_name’: (str) ==> Full file name

Returns:

None or ‘file_name’ (full path) if ‘save’ is True

y_lower(x)
y_upper(x)
class airfoils.airfoils.MorphAirfoil(airfoil1, airfoil2, n_points=200)

Bases: object

at_eta(eta)

Returns a new airfoil object at a given eta position

Args:
eta

(float) eta position where eta = [0, 1]

Returns:
morphed_airfoil

(obj) interpolated airfoil object at the given eta position

exception airfoils.airfoils.NACADefintionError

Bases: Exception

Raised when the NACA identifier number is not valid

airfoils.airfoils.gen_NACA4_airfoil(p, m, xx, n_points)

Generate upper and lower points for a NACA 4 airfoil

Args:
p

m

xx

n_points

Returns:
upper

2 x N array with x- and y-coordinates of the upper side

lower

2 x N array with x- and y-coordinates of the lower side

airfoils.fileio module

Import airfoil data from a text file

Developed for Airinnova AB, Stockholm, Sweden.

exception airfoils.fileio.FileInputFormatError

Bases: Exception

Raised if file input data is not formatted correctly

airfoils.fileio.import_airfoil_data(file_name)

Import airfoil data from a text file

Args:
file_name

File name (string)

Returns:
upper

Upper airfoil coordinates

lower

Lower airfoil coordinates

Module contents