buffalo_wings.airfoil.OrthogonalAirfoil

class buffalo_wings.airfoil.OrthogonalAirfoil(camber, thickness)[source]

Bases: Airfoil

Airfoils that can be decomposed to camber and thickness.

This class represents airfoils that are naturally described by a camber line (curve) and a thickness normal to the camber line, both above and below the camber line. The parameterization of the camber representation and the thickness representation must be based on the same transformation.

Notes

The public airfoil parameter t is a signed surface parameter in [-1, 1]. Negative values lie on the lower surface and positive values lie on the upper surface. Internally, the geometry is evaluated using the unsigned surface parameter |t| together with a separate surface sign.

The camber parameter u is the chord-like parameter used by the camber model, with u = |t|**2. The thickness parameter v is the square-root chord parameter used by the thickness model, with v = |t|. Equivalently, u = v**2 and v = sqrt(u).

This convention is intentional. It removes the leading-edge square-root singularity from the thickness representation while preserving a smooth airfoil surface parameterization for coordinate and derivative evaluation.

Parameters:
  • camber (Camber)

  • thickness (Thickness)

__init__(camber, thickness)[source]

Store the camber line and thickness for the airfoil.

Parameters:
  • camber (Camber) – Camber-line representation used by the airfoil model.

  • thickness (Thickness) – Thickness distribution paired with camber.

Return type:

None

Methods

__init__(camber, thickness)

Store the camber line and thickness for the airfoil.

arc_length(t_s, t_e)

Calculate the arc-length distance between two points on surface.

camber_location(t)

Return the location of camber at specified parameter location.

chord()

Return the chord length of the airfoil.

d2ydx2(t)

Calculate the second derivative at parameter location.

dydx(t)

Calculate the slope at parameter location.

joints()

Return the locations of any joints/discontinuities in the curve.

k(t)

Calculate the curvature at parameter location.

leading_edge()

Return the location of the leading edge.

normal(t)

Calculate the unit normal at parameter location.

t_from_s(s)

Calculate the parametric value for arc-length provided.

t_from_x(x, upper)

Calculate the parametric value for x-location provided.

tangent(t)

Calculate the unit tangent at parameter location.

thickness_value(t)

Return the amount of thickness at specified parameter location.

to_spec()

Return the schema definition needed to recreate this airfoil.

trailing_edge()

Return the location of the trailing edge.

xy(t)

Calculate the coordinates of geometry at parameter location.

xy_from_s(s)

Calculate the coordinates of geometry at arc-length location.

xy_s(s)

Calculate rates of change of the coordinates at arc-length location.

xy_ss(s)

Calculate second derivative of the coordinates at arc-length location.

xy_t(t)

Calculate rates of change of the coordinates at parameter location.

xy_tt(t)

Return second derivative of the coordinates at parameter location.

Attributes

camber

Return the camber function for airfoil.

spec

Return the schema definition used to create this airfoil.

surface_length

Return the full airfoil surface length.

thickness

Return the thickness function for airfoil.

xmax_parameter

Return the parameter of the largest x-coordinate for the airfoil.

xmin_parameter

Return the parameter of the smallest x-coordinate for the airfoil.

property camber: Camber

Return the camber function for airfoil.

Returns:

Camber-line model associated with this airfoil.

Return type:

Camber

property thickness: Thickness

Return the thickness function for airfoil.

Returns:

Thickness model associated with this airfoil.

Return type:

Thickness

property xmin_parameter: float | floating[Any]

Return the parameter of the smallest x-coordinate for the airfoil.

Returns:

Native airfoil parameter at the minimum x-location.

Return type:

float

property xmax_parameter: float | floating[Any]

Return the parameter of the largest x-coordinate for the airfoil.

Returns:

Native airfoil parameter at the maximum x-location.

Return type:

float

xy(t)[source]

Calculate the coordinates of geometry at parameter location.

Notes

Parameter goes from -1 (trailing edge lower surface) to +1 (trailing edge upper surface) with 0 representing the leading edge.

Parameters:

t (numpy.ndarray) – Parameter for desired locations.

Returns:

  • numpy.ndarray – X-coordinate of point.

  • numpy.ndarray – Y-coordinate of point.

Return type:

tuple[ndarray[tuple[int, …], dtype[float64]], ndarray[tuple[int, …], dtype[float64]]]

xy_t(t)[source]

Calculate rates of change of the coordinates at parameter location.

Notes

Parameter goes from -1 (trailing edge lower surface) to +1 (trailing edge upper surface) with 0 representing the leading edge.

Parameters:

t (numpy.ndarray) – Parameter for desired locations.

Returns:

  • numpy.ndarray – Parametric rate of change of the x-coordinate of point.

  • numpy.ndarray – Parametric rate of change of the y-coordinate of point.

Return type:

tuple[ndarray[tuple[int, …], dtype[float64]], ndarray[tuple[int, …], dtype[float64]]]

xy_tt(t)[source]

Return second derivative of the coordinates at parameter location.

Notes

Parameter goes from -1 (trailing edge lower surface) to +1 (trailing edge upper surface) with 0 representing the leading edge.

Parameters:

t (numpy.ndarray) – Parameter for desired locations.

Returns:

  • numpy.ndarray – Parametric second derivative of the x-coordinate of point.

  • numpy.ndarray – Parametric second derivative of the y-coordinate of point.

Return type:

tuple[ndarray[tuple[int, …], dtype[float64]], ndarray[tuple[int, …], dtype[float64]]]

camber_location(t)[source]

Return the location of camber at specified parameter location.

Parameters:

t (numpy.ndarray) – Parameter location of interest.

Returns:

  • numpy.ndarray – X-coordinate of camber at specified point.

  • numpy.ndarray – Y-coordinate of camber at specified point.

Return type:

tuple[ndarray[tuple[int, …], dtype[float64]], ndarray[tuple[int, …], dtype[float64]]]

thickness_value(t)[source]

Return the amount of thickness at specified parameter location.

Parameters:

t (numpy.ndarray) – Parameter location of interest.

Returns:

Thickness at specified point.

Return type:

numpy.ndarray

joints()[source]

Return the locations of any joints/discontinuities in the curve.

Returns:

Xi-coordinates of any discontinuities.

Return type:

List[float]

arc_length(t_s, t_e)

Calculate the arc-length distance between two points on surface.

Parameters:
  • t_s (float) – Start point of distance calculation.

  • t_e (numpy.ndarray) – End point of distance calculation.

Returns:

Distance from start point to end point.

Return type:

numpy.ndarray

chord()

Return the chord length of the airfoil.

Returns:

Chord length.

Return type:

float

d2ydx2(t)

Calculate the second derivative at parameter location.

Parameters:

t (numpy.ndarray) – Parameter for desired locations.

Returns:

Second derivative of surface at point.

Return type:

numpy.ndarray

Raises:

ValueError – If there is no surface point at the given x-location.

dydx(t)

Calculate the slope at parameter location.

Parameters:

t (numpy.ndarray) – Parameter for desired locations.

Returns:

Slope of surface at point.

Return type:

numpy.ndarray

Raises:

ValueError – If there is no surface point at the given x-location.

k(t)

Calculate the curvature at parameter location.

Parameters:

t (numpy.ndarray) – Parameter for desired locations.

Returns:

Curvature of surface at point.

Return type:

numpy.ndarray

leading_edge()

Return the location of the leading edge.

Returns:

  • float – X-coordinate of leading edge.

  • float – Y-coordinate of leading edge.

Return type:

tuple[float | floating[Any], float | floating[Any]]

normal(t)

Calculate the unit normal at parameter location.

Parameters:

t (numpy.ndarray) – Parameter for desired locations.

Returns:

Unit normal at point.

Return type:

numpy.ndarray, numpy.ndarray

property spec: AirfoilDefinitionSpec

Return the schema definition used to create this airfoil.

Returns:

Serialized airfoil definition that can recreate this runtime object.

Return type:

AirfoilDefinitionSpec

Raises:

NotImplementedError – If the concrete airfoil type does not preserve its source spec.

property surface_length: float | floating[Any]

Return the full airfoil surface length.

Returns:

Arc length measured from the lower trailing edge to the upper trailing edge.

Return type:

float

t_from_s(s)

Calculate the parametric value for arc-length provided.

Parameters:

s (numpy.ndarray) – Arc-length location of point.

Raises:

ValueError – When arc-length provided is larger than airfoil surface length.

Returns:

Parametric value for location provided.

Return type:

numpy.ndarray

t_from_x(x, upper)

Calculate the parametric value for x-location provided.

Parameters:
Returns:

Parameteric value for location provided.

Return type:

numpy.ndarray

Raises:

ValueError – If there is no surface point at the given x-location.

tangent(t)

Calculate the unit tangent at parameter location.

Parameters:

t (numpy.ndarray) – Parameter for desired locations.

Returns:

Unit tangent at point.

Return type:

numpy.ndarray, numpy.ndarray

to_spec()

Return the schema definition needed to recreate this airfoil.

Returns:

Serialized airfoil definition that can recreate this runtime object.

Return type:

AirfoilDefinitionSpec

trailing_edge()

Return the location of the trailing edge.

Notes

Since some airfoil descriptions have gap between the upper and lower surface at the trailing edge (such as NACA 4-digit and 5-digit airfoils), the point returned is the average of the two trailing edge points. If the specific location of the upper or the lower surface of the trailing edge is desired, use xy() passing in either -1 (lower) or +1 (upper).

Returns:

  • float – X-coordinate of trailing edge.

  • float – Y-coordinate of trailing edge.

Return type:

tuple[float | floating[Any], float | floating[Any]]

xy_from_s(s)

Calculate the coordinates of geometry at arc-length location.

Parameters:

s (numpy.ndarray) – Arc-length location for point.

Returns:

  • numpy.ndarray – X-coordinate of point.

  • numpy.ndarray – Y-coordinate of point.

Return type:

tuple[ndarray[tuple[int, …], dtype[float64]], ndarray[tuple[int, …], dtype[float64]]]

xy_s(s)

Calculate rates of change of the coordinates at arc-length location.

Parameters:

s (numpy.ndarray) – Arc-length location for point.

Returns:

  • numpy.ndarray – Arc-length rate of change of the x-coordinate of point.

  • numpy.ndarray – Arc-length rate of change of the y-coordinate of point.

Return type:

tuple[ndarray[tuple[int, …], dtype[float64]], ndarray[tuple[int, …], dtype[float64]]]

xy_ss(s)

Calculate second derivative of the coordinates at arc-length location.

Parameters:

s (numpy.ndarray) – Arc-length location for point.

Returns:

  • numpy.ndarray – Arc-length second derivative of the x-coordinate of point.

  • numpy.ndarray – Arc-length second derivative of the y-coordinate of point.

Return type:

tuple[ndarray[tuple[int, …], dtype[float64]], ndarray[tuple[int, …], dtype[float64]]]