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 curve and a thickness normal to the camber curve, both above and below the camber curve. The parameterization of the camber representation and the thickness representation must be based on the same transformation.

Notes

This family uses two related public airfoil parameterizations.

The native airfoil parameter u is a signed smooth surface parameter in [-1, 1]. Negative values lie on the lower surface and positive values lie on the upper surface. This parameterization is used for full-airfoil curve queries and is chosen to remain smooth through the leading edge.

The surface-local airfoil parameter xi is a chord-like coordinate in [0, 1] measured from the leading edge to the trailing edge on one selected surface. For this family, xi = u**2 and therefore u = +/- sqrt(xi), with the sign determined by the selected surface.

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

Breakpoint ownership is split across the component models. Camber breakpoints come from Camber.breakpoints(), thickness-side discontinuities come from Thickness.discontinuities(), and the airfoil breakpoint helpers compose those one-sided component values into exact airfoil-side derivatives when available. The ordinary xy_u() and xy_uu() evaluators return the minus-side value when a query lands exactly on an airfoil breakpoint.

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.

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 camber function for airfoil.

length

Return the full airfoil surface length.

spec

Return the schema definition used to create this airfoil.

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.

This property exposes the camber-curve model associated with the airfoil.

property thickness: Thickness

Return the thickness function for airfoil.

This property exposes the thickness model associated with the airfoil.

camber_curve(*, num_points=81, spacing='cosine')[source]

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

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.

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.

xy_from_u(u)[source]

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_u(u)[source]

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_uu(u)[source]

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.

u_from_xi(xi, *, surface)[source]

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)[source]

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.

camber_location(u)[source]

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]

thickness_value(u)[source]

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

breakpoints()[source]

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.

xy_u_breakpoint(*, index)[source]

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_breakpoint(*, index)[source]

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

xy_s_breakpoint(*, index)[source]

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_breakpoint(*, index)[source]

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

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

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

property spec: Naca4AirfoilSpec | Naca4ModifiedAirfoilSpec | Naca5AirfoilSpec | Naca5ModifiedAirfoilSpec | Naca16AirfoilSpec | FlatPlateAirfoilSpec | BiconvexAirfoilSpec | BiconvexParabolaAirfoilSpec | PolygonAirfoilSpec | EllipseAirfoilSpec | CircularArcAirfoilSpec | JoukowskiAirfoilSpec | Naca6AirfoilSpec | Naca6AAirfoilSpec | FileAirfoilSpec | PointsAirfoilSpec | SplineAirfoilSpec | CstAirfoilSpec | ParsecAirfoilSpec

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.

Notes

For schema-backed runtime families that participate in the current round-trip contract, this property preserves the original supported schema form exactly rather than normalizing it to a merely equivalent definition. Placeholder or not-yet-constructable families may still raise NotImplementedError until their schema contract is defined.

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]

to_spec()

Return the schema definition needed to recreate this airfoil.

Returns:

Serialized airfoil definition that can recreate this runtime object.

Return type:

AirfoilDefinitionSpec

Notes

For runtime families covered by the current schema round-trip contract, this returns the same schema content as spec.

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.

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_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_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.