buffalo_wings.airfoil.Naca5AirfoilParams

class buffalo_wings.airfoil.Naca5AirfoilParams(spec)[source]

Bases: OrthogonalAirfoil

Parametric NACA 5-digit airfoil built from explicit parameters.

Methods

arc_length(u_s, u_e)

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

arc_length_breakpoints()

Return the breakpoint locations in arc-length coordinates.

breakpoint_parameter_limits(*, index)

Return parameter limits for one breakpoint.

breakpoints()

Return the locations of breakpoints or discontinuities.

camber_curve(*[, num_points, spacing])

Return the exact native camber curve for this orthogonal airfoil.

camber_location(u)

Return the camber-line location associated with u.

chord()

Return the airfoil chord length.

curvature_from_xi(xi, *, surface)

Return one-surface curvature values at surface-local xi locations.

d2ydx2(u)

Return the second surface derivative at curve parameter locations.

dydx(u)

Return the surface slope at curve parameter locations.

from_params(*, ideal_lift_coefficient, ...)

Build a parametric NACA 5-digit airfoil from explicit params.

k(u)

Calculate the curvature at parameter location.

leading_edge()

Return the leading-edge location.

normal(u)

Calculate the unit normal at parameter location.

slope_from_xi(xi, *, surface)

Return one-surface slope values at surface-local xi locations.

tangent(u)

Calculate the unit tangent at parameter location.

thickness_value(u)

Return the thickness offset associated with u.

to_spec()

Return the schema definition needed to recreate this airfoil.

trailing_edge()

Return the midpoint of the trailing-edge points.

u_from_s(s)

Return curve parameters that correspond to arc length.

u_from_x(x, *, surface)

Return curve parameters that correspond to x.

u_from_xi(xi, *, surface)

Convert one-surface xi coordinates to curve parameters.

xi_from_u(u)

Convert curve airfoil parameters to surface-local xi values.

xy_from_s(s)

Return curve coordinates at arc-length locations.

xy_from_u(u)

Calculate the airfoil coordinates at one parameter location.

xy_from_xi(xi, *, surface)

Return one-surface coordinates at surface-local xi locations.

xy_s(s)

Calculate first derivatives at arc-length location.

xy_s_breakpoint(*, index)

Return one-sided arc-length derivatives at one airfoil breakpoint.

xy_ss(s)

Calculate second derivatives at arc-length location.

xy_ss_breakpoint(*, index)

Return one-sided arc-length second derivatives at one breakpoint.

xy_u(u)

Calculate first derivatives with respect to the airfoil parameter.

xy_u_breakpoint(*, index)

Return one-sided first derivatives at one airfoil breakpoint.

xy_uu(u)

Return second derivatives of the airfoil coordinates.

xy_uu_breakpoint(*, index)

Return one-sided second derivatives at one airfoil breakpoint.

Attributes

camber

Return the concrete parametric NACA 5-digit camber model.

length

Return the full airfoil surface length.

spec

Return the source spec for this airfoil.

thickness

Return the concrete parametric NACA thickness model.

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: Naca5DigitCamberParams | Naca5DigitCamberReflexedParams

Return the concrete parametric NACA 5-digit camber model.

This property exposes the continuous-index 5-digit camber-line object constructed from the stored parameter definition, including the reflexed variant when requested by the source spec.

property thickness: Naca45DigitThicknessParams

Return the concrete parametric NACA thickness model.

This property exposes the parametric thickness relation constructed from the stored 5-digit definition.

classmethod from_params(*, ideal_lift_coefficient, max_camber_location, reflexed, t, trailing_edge='standard', leading_edge_radius='standard')[source]

Build a parametric NACA 5-digit airfoil from explicit params.

Parameters:
  • ideal_lift_coefficient (buffalo_core.typing.FloatScalar) – Design lift coefficient associated with the camber line.

  • max_camber_location (buffalo_core.typing.FloatScalar) – Chordwise location of maximum camber as a fraction of chord.

  • reflexed (bool) – Whether to build the reflexed 5-digit camber-line family.

  • t (buffalo_core.typing.FloatScalar) – Maximum thickness as a fraction of chord.

  • trailing_edge ({"standard", "sharp"}, default "standard") – Trailing-edge closure model for the thickness distribution.

  • leading_edge_radius ({"standard", "exact"}, default "standard") – Leading-edge radius treatment for the thickness distribution.

Returns:

Runtime airfoil built from the explicit parameters.

Return type:

Self

Raises:

ValueError – If the parameter set falls outside the supported NACA 5-digit range.

property spec: Naca5AirfoilSpec

Return the source spec for this airfoil.

Returns:

Defensive copy of the serialized source spec.

Return type:

Naca5AirfoilSpec

to_spec()[source]

Return the schema definition needed to recreate this airfoil.

Returns:

Serialized source spec for this airfoil.

Return type:

Naca5AirfoilSpec

arc_length(u_s, u_e)

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

Parameters:
  • u_s (buffalo_core.typing.FloatScalar) – Start point of distance calculation.

  • u_e (buffalo_core.typing.FloatInput) – End point of distance calculation.

Returns:

Distance from start point to end point.

Return type:

buffalo_core.typing.FloatArray

arc_length_breakpoints()

Return the breakpoint locations in arc-length coordinates.

Returns:

Arc-length coordinates measured from the minimum native parameter.

Return type:

list[FloatScalar]

Notes

These values include the two curve endpoints as boundary markers. Interior breakpoints correspond to the native-parameter interior breakpoints returned by breakpoints().

breakpoint_parameter_limits(*, index)

Return parameter limits for one breakpoint.

Notes

Endpoint breakpoints return the exact boundary parameter. Interior breakpoints return nearby one-sided parameters chosen within the neighboring breakpoint interval for the current generic breakpoint-side implementation. These limits exist to support the sampled fallback in the generic *_breakpoint methods and should not be treated as the primary source of truth when a subclass can provide exact one-sided values directly.

Return type:

tuple[TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’), TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’)]

breakpoints()

Return the locations of breakpoints or discontinuities.

Returns:

Sorted unique parameter values induced by camber-line joins, thickness discontinuities, and their mirrored surface partners.

Return type:

list[float]

Notes

This list always includes -1, 0, and 1. Additional interior values are induced by mapped camber breakpoints or mapped thickness discontinuities that require one-sided derivative information at the airfoil level.

camber_curve(*, num_points=81, spacing='cosine')

Return the exact native camber curve for this orthogonal airfoil.

Parameters:
  • num_points (int, default 81) – Unused compatibility argument accepted for API consistency with the approximate extraction path on other airfoil families.

  • spacing ({"uniform", "cosine"}, default "cosine") – Unused compatibility argument accepted for API consistency with the approximate extraction path on other airfoil families.

Returns:

Exact camber result exposing the native camber runtime.

Return type:

AirfoilCamberResult

camber_location(u)

Return the camber-line location associated with u.

Parameters:

u (buffalo_core.typing.FloatInput) – Signed or unsigned airfoil parameter values.

Returns:

Tuple (x, y) of camber-line coordinates evaluated at the mapped camber parameter.

Return type:

tuple[FloatArray, FloatArray]

chord()

Return the airfoil chord length.

Returns:

Distance between the leading-edge reference and trailing-edge midpoint reference.

Return type:

buffalo_core.typing.FloatScalar

curvature_from_xi(xi, *, surface)

Return one-surface curvature values at surface-local xi locations.

Parameters:
  • xi (buffalo_core.typing.FloatInput) – Surface-local coordinates in [0, 1] measured from the leading edge to the trailing edge.

  • surface ({"lower", "upper"}) – Surface to evaluate.

Returns:

Surface-oriented curvature values on the selected surface.

Return type:

buffalo_core.typing.FloatArray

d2ydx2(u)

Return the second surface derivative at curve parameter locations.

Parameters:

u (buffalo_core.typing.FloatInput) – Airfoil parameters.

Returns:

Second derivative values d^2y/dx^2 evaluated at u.

Return type:

buffalo_core.typing.FloatArray

dydx(u)

Return the surface slope at curve parameter locations.

Parameters:

u (buffalo_core.typing.FloatInput) – Airfoil parameters.

Returns:

Surface slope values dy/dx evaluated at u.

Return type:

buffalo_core.typing.FloatArray

k(u)

Calculate the curvature at parameter location.

Parameters:

u (buffalo_core.typing.FloatInput) – Parameter for desired locations.

Returns:

Curvature of surface matching the normalized shape of u.

Return type:

buffalo_core.typing.FloatArray

leading_edge()

Return the leading-edge location.

Returns:

(x, y) location of the leading-edge reference point.

Return type:

tuple[FloatScalar, FloatScalar]

property length: buffalo_core.typing.FloatScalar

Return the full airfoil surface length.

Returns:

Total airfoil surface length measured from the lower trailing edge to the upper trailing edge.

Return type:

buffalo_core.typing.FloatScalar

normal(u)

Calculate the unit normal at parameter location.

Parameters:

u (buffalo_core.typing.FloatInput) – Parameter for desired locations.

Returns:

Tuple (n_x, n_y) of float64 arrays matching the normalized shape of u.

Return type:

tuple[FloatArray, FloatArray]

slope_from_xi(xi, *, surface)

Return one-surface slope values at surface-local xi locations.

Parameters:
  • xi (buffalo_core.typing.FloatInput) – Surface-local coordinates in [0, 1] measured from the leading edge to the trailing edge.

  • surface ({"lower", "upper"}) – Surface to evaluate.

Returns:

Surface slope values dy/dx on the selected surface.

Return type:

buffalo_core.typing.FloatArray

tangent(u)

Calculate the unit tangent at parameter location.

Parameters:

u (buffalo_core.typing.FloatInput) – Parameter for desired locations.

Returns:

Tuple (t_x, t_y) of float64 arrays matching the normalized shape of u.

Return type:

tuple[FloatArray, FloatArray]

thickness_value(u)

Return the thickness offset associated with u.

Parameters:

u (buffalo_core.typing.FloatInput) – Signed or unsigned airfoil parameter values.

Returns:

Thickness magnitude evaluated at the mapped thickness parameter.

Return type:

buffalo_core.typing.FloatArray

trailing_edge()

Return the midpoint of the trailing-edge points.

Returns:

(x, y) location of the trailing-edge midpoint reference.

Return type:

tuple[FloatScalar, FloatScalar]

u_from_s(s)

Return curve parameters that correspond to arc length.

Parameters:

s (buffalo_core.typing.FloatInput) – Arc lengths measured from the lower trailing edge.

Returns:

Curve parameters corresponding to s.

Return type:

buffalo_core.typing.FloatArray

Raises:

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

u_from_x(x, *, surface)

Return curve parameters that correspond to x.

Parameters:
  • x (buffalo_core.typing.FloatInput) – Chordwise coordinates in the normalized airfoil frame.

  • surface ({"lower", "upper"}) – Surface to solve on.

Returns:

Curve parameters on the requested surface.

Return type:

buffalo_core.typing.FloatArray

Raises:

ValueError – If any requested chordwise coordinate lies outside the reachable x-range of the selected surface.

u_from_xi(xi, *, surface)

Convert one-surface xi coordinates to curve parameters.

Parameters:
  • xi (buffalo_core.typing.FloatInput) – Surface-local coordinates in [0, 1] measured from the leading edge to the trailing edge.

  • surface ({"lower", "upper"}) – Surface to evaluate.

Returns:

Curve parameters matching xi on the selected surface.

Return type:

buffalo_core.typing.FloatArray

xi_from_u(u)

Convert curve airfoil parameters to surface-local xi values.

Parameters:

u (buffalo_core.typing.FloatInput) – Curve airfoil parameters in [-1, 1].

Returns:

Surface-local xi values and upper-surface membership flags.

Return type:

SurfaceMappedValues

Notes

Concrete airfoil families define this mapping because xi need not equal |u| for every airfoil parameterization.

property xmax_parameter: buffalo_core.typing.FloatScalar

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

This property caches the native airfoil parameter at the maximum x-location.

property xmin_parameter: buffalo_core.typing.FloatScalar

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

This property caches the native airfoil parameter at the minimum x-location.

Raises:

RuntimeError – If the internal scalar root solve for the x-minimum does not converge.

xy_from_s(s)

Return curve coordinates at arc-length locations.

Parameters:

s (buffalo_core.typing.FloatInput) – Arc length location of point.

Returns:

(x, y) coordinates matching the normalized shape of s.

Return type:

tuple[FloatArray, FloatArray]

xy_from_u(u)

Calculate the airfoil coordinates at one parameter location.

Parameters:

u (buffalo_core.typing.FloatInput) – Signed surface parameter values in [-1, 1].

Returns:

Tuple (x, y) of float64 arrays matching the normalized shape of u.

Return type:

tuple[FloatArray, FloatArray]

xy_from_xi(xi, *, surface)

Return one-surface coordinates at surface-local xi locations.

Parameters:
  • xi (buffalo_core.typing.FloatInput) – Surface-local coordinates in [0, 1] measured from the leading edge to the trailing edge.

  • surface ({"lower", "upper"}) – Surface to evaluate.

Returns:

Tuple (x, y) of float64 arrays matching the normalized shape of xi.

Return type:

tuple[FloatArray, FloatArray]

xy_s(s)

Calculate first derivatives at arc-length location.

Parameters:

s (buffalo_core.typing.FloatInput) – Arc length location of point.

Returns:

(dx/ds, dy/ds) coordinates matching the normalized shape of s.

Return type:

tuple[FloatArray, FloatArray]

Notes

If s matches one of arc_length_breakpoints() exactly, this method returns the minus-side derivative limit. Subclasses should override xy_s_breakpoint() when exact one-sided breakpoint derivatives are available analytically.

xy_s_breakpoint(*, index)

Return one-sided arc-length derivatives at one airfoil breakpoint.

Notes

This method composes the exact arc-length tangent values from the exact native breakpoint derivatives returned by xy_u_breakpoint(). When the native derivative vanishes at a cusp-like breakpoint, such as the orthogonal leading edge, this method uses the one-sided native second derivative to recover the exact one-sided tangent direction.

Return type:

tuple[tuple[TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’), TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’)], tuple[TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’), TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’)]]

xy_ss(s)

Calculate second derivatives at arc-length location.

Parameters:

s (buffalo_core.typing.FloatInput) – Arc length location of point.

Returns:

(d^2x/ds^2, d^2y/ds^2) coordinates matching the normalized shape of s.

Return type:

tuple[FloatArray, FloatArray]

Notes

If s matches one of arc_length_breakpoints() exactly, this method returns the minus-side derivative limit. Subclasses should override xy_ss_breakpoint() when exact one-sided breakpoint second derivatives are available analytically.

xy_ss_breakpoint(*, index)

Return one-sided arc-length second derivatives at one breakpoint.

Notes

This method composes the exact arc-length curvature-vector values from the exact native breakpoint derivatives returned by xy_u_breakpoint() and xy_uu_breakpoint(). When the native derivative vanishes at a cusp-like breakpoint, such as the orthogonal leading edge, the generic sampled fallback is retained because the exact arc-length second derivative depends on higher-order native data, such as one-sided xy_uuu values, that this runtime does not expose.

Return type:

tuple[tuple[TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’), TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’)], tuple[TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’), TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’)]]

xy_u(u)

Calculate first derivatives with respect to the airfoil parameter.

Parameters:

u (buffalo_core.typing.FloatInput) – Parameter for desired locations.

Returns:

Tuple (dx/du, dy/du) of float64 arrays matching the normalized shape of u.

Return type:

tuple[FloatArray, FloatArray]

Notes

If u matches one of breakpoints() exactly, this method returns the minus-side derivative limit.

xy_u_breakpoint(*, index)

Return one-sided first derivatives at one airfoil breakpoint.

Notes

This method composes the one-sided camber and thickness values that apply on each side of the requested airfoil breakpoint. It is the exact-breakpoint contract paired with xy_u().

Return type:

tuple[tuple[TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’), TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’)], tuple[TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’), TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’)]]

xy_uu(u)

Return second derivatives of the airfoil coordinates.

Parameters:

u (buffalo_core.typing.FloatInput) – Parameter for desired locations.

Returns:

Tuple (d^2x/du^2, d^2y/du^2) of float64 arrays matching the normalized shape of u.

Return type:

tuple[FloatArray, FloatArray]

Notes

If u matches one of breakpoints() exactly, this method returns the minus-side derivative limit.

xy_uu_breakpoint(*, index)

Return one-sided second derivatives at one airfoil breakpoint.

Notes

This method composes the one-sided camber and thickness values that apply on each side of the requested airfoil breakpoint. It is the exact-breakpoint contract paired with xy_uu().

Return type:

tuple[tuple[TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’), TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’)], tuple[TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’), TypeAliasForwardRef(‘buffalo_core.typing.FloatScalar’)]]