buffalo_wings.airfoil.OrthogonalAirfoil
- class buffalo_wings.airfoil.OrthogonalAirfoil(*, camber, thickness)[source]
Bases:
AirfoilAirfoils 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
uis 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
xiis 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**2and thereforeu = +/- 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 fromThickness.discontinuities(), and the airfoil breakpoint helpers compose those one-sided component values into exact airfoil-side derivatives when available. The ordinaryxy_u()andxy_uu()evaluators return theminus-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.
Return the breakpoint locations in arc-length coordinates.
breakpoint_parameter_limits(*, index)Return parameter limits for one breakpoint.
Return the locations of breakpoints or discontinuities.
camber_curve(*[, num_points, spacing])Return the exact native camber curve for this orthogonal airfoil.
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
xilocations.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.
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
xilocations.tangent(u)Calculate the unit tangent at parameter location.
Return the thickness offset associated with
u.to_spec()Return the schema definition needed to recreate this airfoil.
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
xicoordinates to curve parameters.xi_from_u(u)Convert curve airfoil parameters to surface-local
xivalues.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
xilocations.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
Return the camber function for airfoil.
Return the full airfoil surface length.
Return the schema definition used to create this airfoil.
Return the thickness function for airfoil.
Return the parameter of the largest x-coordinate for the airfoil.
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, default81) – 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:
- 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)offloat64arrays matching the normalized shape ofu.- 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)offloat64arrays matching the normalized shape ofu.- Return type:
tuple[FloatArray,FloatArray]
Notes
If
umatches one ofbreakpoints()exactly, this method returns theminus-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)offloat64arrays matching the normalized shape ofu.- Return type:
tuple[FloatArray,FloatArray]
Notes
If
umatches one ofbreakpoints()exactly, this method returns theminus-side derivative limit.
- u_from_xi(xi, *, surface)[source]
Convert one-surface
xicoordinates 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
xion the selected surface.- Return type:
buffalo_core.typing.FloatArray
- xi_from_u(u)[source]
Convert curve airfoil parameters to surface-local
xivalues.- Parameters:
u (
buffalo_core.typing.FloatInput) – Curve airfoil parameters in[-1, 1].- Returns:
Surface-local
xivalues and upper-surface membership flags.- Return type:
Notes
Concrete airfoil families define this mapping because
xineed 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, and1. 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()andxy_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-sidedxy_uuuvalues, 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
*_breakpointmethods 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
xilocations.- 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^2evaluated atu.- 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/dxevaluated atu.- 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)offloat64arrays matching the normalized shape ofu.- Return type:
tuple[FloatArray,FloatArray]
- slope_from_xi(xi, *, surface)
Return one-surface slope values at surface-local
xilocations.- 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/dxon 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
NotImplementedErroruntil 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)offloat64arrays matching the normalized shape ofu.- 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 ofs.- Return type:
tuple[FloatArray,FloatArray]
- xy_from_xi(xi, *, surface)
Return one-surface coordinates at surface-local
xilocations.- 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)offloat64arrays matching the normalized shape ofxi.- 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 ofs.- Return type:
tuple[FloatArray,FloatArray]
Notes
If
smatches one ofarc_length_breakpoints()exactly, this method returns theminus-side derivative limit. Subclasses should overridexy_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 ofs.- Return type:
tuple[FloatArray,FloatArray]
Notes
If
smatches one ofarc_length_breakpoints()exactly, this method returns theminus-side derivative limit. Subclasses should overridexy_ss_breakpoint()when exact one-sided breakpoint second derivatives are available analytically.