utils module
- utils.add_minimum_gap(xy)
Adding minimum TE gap of 2mm. Before using need to position airfoil first (chord on x-axis from 0 to 1)
- Parameters:
xy – (n, 2)shape coordinates
- Returns:
array of shape coordinates with added gap
- utils.add_tailedge_gap(xy, gap)
Adding tail edge gap. Before using need to position airfoil first (chord on x-axis from 0 to 1)
- Parameters:
xy – (n, 2) shape coordinate
gap – gap size to be added
- Returns:
array of shape coordinates with added gap
- utils.arc_distance(xy)
Calculate distance along the arc of points defining airfoil shape. t in [0, 1]
- Parameters:
xy – (n_landmarks, 2) discrete planar curve with n landmarks representing a shape
- Returns:
(n_landmarks, ) distance along the arc of points defining airfoil shape
- utils.calc_area(xy, a=0, b=1)
Function calculates area inside of an airfoil shape xy (x coordinates are normalized by chord length) from left boundary a to right boundary b using discrete representation of a shape and trapesoidal rule.
E.g. to calculate area inside of an airfoil from 25% chord to 45% chord one can use calc_area(xy, a=0.25, b=0.45)
- Parameters:
xy – (n, 2) array of given shape
a – left boundary
b – right boundary
- Returns:
scalar area
- utils.calc_curvature(xy)
Calculate curvature based on planar respresentation.
- Parameters:
xy – (n_landmarks, 2) discrete planar curve with n landmarks representing a shape
- Returns:
curvature values
- utils.calc_curvature_at_x(xy)
Calculate curvature based on planar respresentation.
- Parameters:
xy – (n_landmarks, 2) discrete planar curve with n landmarks representing a shape
- Returns:
curvature values
- utils.calc_unit_normal(shape)
- utils.check_selfintersect(shape)
Check if self intersection in a shape exist.
- Parameters:
X – (n_landmarks, 2) discrete planar curve with n landmarks representing a shape
- Returns:
bool = if intersection exist
- utils.find_selfintersect(shape)
Find all self intersections of shape.
- Parameters:
X – (n_landmarks, 2) discrete planar curve with n landmarks representing a shape
- Returns:
bool = if intersection exist (n, 2) array with index p and q of intersecting intervals (n=number of intersections) (n, 2) array of intersection locations (n=number of intersections)
- utils.position_airfoil(shape_inp, rotate=True, LE_cst=False, return_LEind=False)
Normalize, rotates and translates given airfoil coordinates so that the leading edge is at (0, 0) and tail edge is at (1, 0).
- Parameters:
shape_inp – (n, 2) shape coordinates
rotate – (bool) rotate airfoil to set LE at (0,0), defaults to True
LE_cst – (bool) set true if shape_inp is from CST parametrization to use x=0 point as LE, defaults to False
return_LEind – (bool) return index of leading edge coordinate, defaults to False
- Returns:
array of shape coordinates
- utils.remove_tailedge_gap(xy)
Remove tailedge gap.
- Parameters:
xy – (n, 2) shape coordinates
- Returns:
array of shape coordinates without gap
- utils.tailedge_gap(xy)
Calculate tail edge gap size
:param xy (n, 2) shape coordinates :return: TE gap size