buffalo_wings.airfoil.Naca4AirfoilParams
- class buffalo_wings.airfoil.Naca4AirfoilParams(spec)[source]
Bases:
OrthogonalAirfoilParametric NACA 4-digit airfoil built from explicit parameters.
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.
from_params(*, m, p, t[, trailing_edge, ...])Build a parametric NACA 4-digit airfoil from explicit params.
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 concrete NACA 4-digit camber model.
Return the full airfoil surface length.
Return the source spec for this airfoil.
Return the concrete parametric NACA thickness model.
Return the parameter of the largest x-coordinate for the airfoil.
Return the parameter of the smallest x-coordinate for the airfoil.
- property camber: Naca4DigitCamber
Return the concrete NACA 4-digit camber model.
This property exposes the camber-line object constructed from the explicit 4-digit parameters.
- property thickness: Naca45DigitThicknessParams
Return the concrete parametric NACA thickness model.
This property exposes the parametric thickness relation constructed from the explicit 4-digit parameters.
- classmethod from_params(*, m, p, t, trailing_edge='standard', leading_edge_radius='standard')[source]
Build a parametric NACA 4-digit airfoil from explicit params.
- Parameters:
m (
buffalo_core.typing.FloatScalar) – Maximum camber as a fraction of chord.p (
buffalo_core.typing.FloatScalar) – Chordwise location of maximum camber as a fraction of chord.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 4-digit range.
- property spec: Naca4AirfoilSpec
Return the source spec for this airfoil.
This property returns a defensive copy of the serialized source spec.
- to_spec()[source]
Return the schema definition needed to recreate this airfoil.
- Returns:
Serialized source spec for this airfoil.
- Return type:
- 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’)]
- 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, and1. 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, 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:
- 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
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
- 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]
- 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
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)
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.
- 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 ofs.- 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)offloat64arrays matching the normalized shape ofu.- 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_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 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.
- 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()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’)]]
- 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)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_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)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_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’)]]