buffalo_wings.airfoil.AirfoilFactory
- class buffalo_wings.airfoil.AirfoilFactory[source]
Bases:
objectConstruct public airfoil runtime objects from user-facing specs.
This factory centralizes the mapping from serialized airfoil schema objects to the concrete runtime classes used by the geometry library.
- __init__()
Methods
__init__()from_spec(spec)Build an airfoil object from a schema definition.
naca4_from_designation(designation)Build a classic NACA 4-digit airfoil from a designation.
naca4_from_params(*, m, p, t[, ...])Build a parametric NACA 4-digit airfoil from explicit params.
naca4_modified_from_designation(designation)Build a classic modified NACA 4-digit airfoil from a designation.
naca4_modified_from_params(*, m, p, t, ...)Build a parametric modified NACA 4-digit airfoil from params.
naca5_from_designation(designation)Build a classic NACA 5-digit airfoil from a designation.
naca5_from_params(*, ideal_lift_coefficient, ...)Build a parametric NACA 5-digit airfoil from explicit params.
naca5_modified_from_designation(designation)Build a classic modified NACA 5-digit airfoil from a designation.
naca5_modified_from_params(*, ...[, ...])Build a parametric modified NACA 5-digit airfoil from params.
- static from_spec(spec)[source]
Build an airfoil object from a schema definition.
- Parameters:
spec (
AirfoilDefinitionSpec) – Serialized airfoil definition to convert into a runtime object.- Returns:
Runtime airfoil instance corresponding to
spec.- Return type:
- Raises:
ValueError – If a NACA specification does not provide exactly one of
designationorparams.NotImplementedError – If the airfoil type is not yet supported by the factory.
- static naca4_from_designation(designation)[source]
Build a classic NACA 4-digit airfoil from a designation.
- Parameters:
designation (
str) – Four-digit NACA designation such as"2412".- Returns:
Runtime airfoil built from the classic designation.
- Return type:
- Raises:
ValueError – If
designationis not a valid 4-digit NACA code.
- static naca4_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:
- Raises:
ValueError – If any parameter lies outside the supported NACA 4-digit range.
- static naca4_modified_from_designation(designation)[source]
Build a classic modified NACA 4-digit airfoil from a designation.
- Parameters:
designation (
str) – Modified NACA 4-digit designation such as"0003-64".- Returns:
Runtime airfoil built from the modified-series designation.
- Return type:
- Raises:
ValueError – If
designationis not a valid modified NACA 4-digit code.
- static naca4_modified_from_params(*, m, p, t, leading_edge_index, max_thickness_location, trailing_edge='standard')[source]
Build a parametric modified NACA 4-digit airfoil from 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.leading_edge_index (
float) – Modified-series leading-edge shape index.max_thickness_location (
float) – Chordwise location of maximum thickness as a fraction of chord.trailing_edge (
{"standard", "sharp"}, default"standard") – Trailing-edge closure model for the thickness distribution.
- Returns:
Runtime airfoil built from the explicit parameters.
- Return type:
- Raises:
ValueError – If any parameter lies outside the supported modified-series range.
- static naca5_from_designation(designation)[source]
Build a classic NACA 5-digit airfoil from a designation.
- Parameters:
designation (
str) – Five-digit NACA designation such as"23012".- Returns:
Runtime airfoil built from the classic designation.
- Return type:
- Raises:
ValueError – If
designationis not a valid 5-digit NACA code.
- static naca5_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 (
float) – Design lift coefficient associated with the camber line.max_camber_location (
float) – Chordwise location of maximum camber as a fraction of chord.reflexed (
bool) – Whether to build the reflexed camber-line family.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:
- Raises:
ValueError – If any parameter lies outside the supported NACA 5-digit range.
- static naca5_modified_from_designation(designation)[source]
Build a classic modified NACA 5-digit airfoil from a designation.
- Parameters:
designation (
str) – Modified NACA 5-digit designation string.- Returns:
Runtime airfoil built from the modified-series designation.
- Return type:
- Raises:
ValueError – If
designationis not a valid modified NACA 5-digit code.
- static naca5_modified_from_params(*, ideal_lift_coefficient, max_camber_location, reflexed, t, leading_edge_index, max_thickness_location, trailing_edge='standard')[source]
Build a parametric modified NACA 5-digit airfoil from params.
- Parameters:
ideal_lift_coefficient (
float) – Design lift coefficient associated with the camber line.max_camber_location (
float) – Chordwise location of maximum camber as a fraction of chord.reflexed (
bool) – Whether to build the reflexed camber-line family.t (
float) – Maximum thickness as a fraction of chord.leading_edge_index (
float) – Modified-series leading-edge shape index.max_thickness_location (
float) – Chordwise location of maximum thickness as a fraction of chord.trailing_edge (
{"standard", "sharp"}, default"standard") – Trailing-edge closure model for the thickness distribution.
- Returns:
Runtime airfoil built from the explicit parameters.
- Return type:
- Raises:
ValueError – If any parameter lies outside the supported modified-series range.