buffalo_wings.airfoil.Cylinder

class buffalo_wings.airfoil.Cylinder(radius)[source]

Bases: Airfoil

Cylindrical 2D airfoil.

Parameters:

radius (float)

__init__(radius)[source]

Initialize the cylinder radius.

Parameters:

radius (float) – Radius of the cylinder.

Return type:

None

Methods

__init__(radius)

Initialize the cylinder radius.

arc_length(t_s, t_e)

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

camber_location(t)

Return the amount 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

radius

Return the cylinder radius.

spec

Return the schema definition used to create this airfoil.

surface_length

Return the full airfoil surface length.

property radius: float

Return the cylinder radius.

Returns:

Radius of the cylinder.

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]]]

static camber_location(t)[source]

Return the amount 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:

Parametric 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]]]