buffalo_wings.airfoil.Naca4AirfoilParams
- class buffalo_wings.airfoil.Naca4AirfoilParams(spec)[source]
Bases:
OrthogonalAirfoilParametric NACA 4-digit airfoil built from explicit parameters.
- Parameters:
spec (
Naca4AirfoilSpec) – Serialized specification containing explicit 4-digit parameters.- Raises:
ValueError – If
specdoes not contain a valid params-only definition.
- __init__(spec)[source]
Build a parametric NACA 4-digit airfoil from its source spec.
- Parameters:
spec (
Naca4AirfoilSpec) – Serialized specification containing explicit 4-digit parameters.- Raises:
ValueError – If
specdoes not contain a valid params-only definition.- Return type:
None
Methods
__init__(spec)Build a parametric NACA 4-digit airfoil from its source spec.
arc_length(t_s, t_e)Calculate the arc-length distance between two points on surface.
Return the location 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.
from_params(*, m, p, t[, trailing_edge, ...])Build a parametric NACA 4-digit airfoil from explicit params.
joints()Return the locations of any joints/discontinuities in the curve.
k(t)Calculate the curvature at parameter location.
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.
Return the amount of thickness at specified parameter location.
to_spec()Return the schema definition needed to recreate this airfoil.
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
Return the concrete NACA 4-digit camber model.
Return the source spec for this airfoil.
Return the full airfoil surface length.
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.
- property thickness: Naca45DigitThicknessParams
Return the concrete parametric NACA thickness model.
- 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 (
float) – Maximum camber as a fraction of chord.p (
float) – Chordwise location of maximum camber as a fraction of chord.t (
float) – 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.
- Returns:
Defensive copy of the serialized source spec.
- Return type:
- to_spec()[source]
Return the schema definition needed to recreate this airfoil.
- Returns:
Serialized source spec for this airfoil.
- Return type:
- 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
- camber_location(t)
Return the location 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]]]
- 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.
- joints()
Return the locations of any joints/discontinuities in the curve.
- Returns:
Xi-coordinates of any discontinuities.
- Return type:
List[float]
- 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 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:
x (
buffalo_wings.type_aliases.FloatArray) – X-coordinate of interest.upper (
bool) – True if want upper surface point otherwise get lower surface point.
- 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
- thickness_value(t)
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
- 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]]
- property xmax_parameter: float | floating[Any]
Return the parameter of the largest x-coordinate for the airfoil.
- Returns:
Native airfoil parameter at the maximum x-location.
- Return type:
float
- property xmin_parameter: float | floating[Any]
Return the parameter of the smallest x-coordinate for the airfoil.
- Returns:
Native airfoil parameter at the minimum x-location.
- Return type:
float
- xy(t)
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_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]]]
- xy_t(t)
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)
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]]]