Airfoil#

class pynumad.objects.airfoil.Airfoil(filename: str | None = None, coords: ndarray | None = None, reference: str | None = None)#

Bases: object

Airfoil class

name#

User selected airfoil name

Type:

str

reference#

Header info in file

Type:

string

coordinates#

Profile data in two columns

Type:

array

c#

Computed by NuMAD

Type:

array

camber#

Camber line as a function of x. Distance in percent chord between LP and HP curves. Computed by pyNuMAD.

Type:

array

thickness#

Relative thickness as a function of the x coordinate. Values between 0 and 1, where 1 corresponds to maximum thickness. Computed by pyNuMAD.

Type:

float

percentthick#

Maximum airfoil thickness as a percentage of chord length [#]

Type:

float

maxthick#

Airfoil thickness as a percentage of chord. Values between 0 and 1.

Type:

float

te_type#

Options, ‘round’, ‘sharp’, or ‘flat’

Type:

str

Parameters:
  • filename (string) – path to filename of airfoil (xml somewhat supported)

  • coords (array) – coordinate array

  • reference (string) – Name of airfoil reference

property x#

Horizontal axis of Airfoil shape coordinates Working clockwise starting from the TE to the LE and back to the TE. LE must be at (1,0) and TE at (0,0). Needed only by AirfoilDef.plot

TODO docstring

property y#

Vertical axis of Airfoil shape coordinates Working clockwise starting from the TE to the LE and back to the TE. LE must be at (1,0) and TE at (0,0). Needed only by AirfoilDef.plot

TODO docstring

read_xml(filename: str)#

Populate airfoil object with data from airfoil xml

Parameters:

filename (str)

Returns:

Self

manageTE()#

Updates te_type

resample(n_samples: int = 150, spacing: str = 'cosine')#

Resample airfoil coordinates

Parameters:
  • n_samples (int) – Defaults to 150

  • spacing (str) – spacing method for new samples spacing = ‘auto’ | ‘half-cosine’ | ‘cosine’

Returns:

Self

Example

af.resample(n_samples,spacing) af.resample(200,’half-cosine’);

pynumad.objects.airfoil.get_airfoil_normals(coordinates) ndarray#

Method finds which airfoil is flatback.

If points are placed in flatback region, they are removed for good resampling results. Currently this removal only works for one point located on TE region. Method also gets the TE tpye for round sections. coordinates m by 2 matrix where m is the number of points about airfoil. Coordiantes are 2D.

Parameters:

coordinates

pynumad.objects.airfoil.resample_airfoil(coords_in: ndarray, n_samples: int, spacing: str) ndarray#

Resample airfoil coordinates

Parameters:
  • coords_in (ndarray) – Nx2 array containing N normalized xy airfoil points

  • n_samples (int) – number of points to be created around surface

  • spacing (string) – spacing routine to be used: ‘cosine’, ‘half-cosine’, ‘constant’, ‘auto’

Returns:

  • coords_out (array) – array containing n_samples+1 airfoil points

  • Cosine spacing (puts higher density of points at both LE and TE;) – constant arc length point spacing around a perfect circle.

  • Half-cosine spacing (puts higher density of points at LE and lesser) – density of points at TE

  • constant spacing (constant spacing of points along chord line)

  • auto (choose between Cosine and Half-cosine based on steepness of TE)

  • Assumes coordinates begin at trailing edge (x,y)=(1,0) and trace out the HP

  • surface, then the LP surface.

  • Flatback airfoil inputs are designated by ensuring the following – Point #1 = (1,0) (center of trailing edge) Point #2 = (1,-y) where y~=0 (HP corner of flatback trailing edge) Point #N = (1,y) where y~=0 (LP corner of flatback trailing edge)

  • Notes

  • * This routine enforces LE point is at (0,0) - Warning, this may have

  • complications when it comes ot CFD analyses!!

  • * spline_type = spline algorithm to be used for oversampling

  • ’linear’, ‘pchip’, ‘spline’; right now, the function is hard-coded

  • for ‘spline’, but others can be used by changing the te_type setting

  • in the code.

  • Assumes leading edge at (0,0) and trailing edge at (1,0)

Example

coords_out = resampleAirfoil(coords_in, n_samples, spacing)

JP: initial creation BRR: modified for release 1/25/2011

pynumad.objects.airfoil.get_airfoil_normals_angle_change(unit_normals)#

TODO: Docstring TODO: Test

pynumad.objects.airfoil.rotate2d(xyin, angle)#

NOTE: might be able to use affinetrans module here TODO: Docstring TODO: Test

pynumad.objects.airfoil.compute_camber_and_thickness(coords: ndarray)#

Computes c, camber, and thickness from airfoil coordinates

Parameters:

coords – ndarray

Returns:

c – ndarray camber: ndarray thickness: ndarray