Public documentation
Documentation for AirfoilDefinitions.jl's public interface.
Index
AirfoilDefinitions.AirfoilDefinitionsAirfoilDefinitions.AbstractAirfoilDefinitionAirfoilDefinitions.AirfoilFileAirfoilDefinitions.CSTAirfoilDefinitions.CSTAirfoilDefinitions.NACA4AirfoilDefinitions.NACA4AirfoilDefinitions.NACA4AirfoilDefinitions.UnitAirfoilAirfoilDefinitions.UnitAirfoilAirfoilDefinitions.UnitAirfoilAirfoilDefinitions.UnitAirfoilAirfoilDefinitions.coordinatesAirfoilDefinitions.coordinatesAirfoilDefinitions.coordinatesAirfoilDefinitions.coordinatesAirfoilDefinitions.coordinatesAirfoilDefinitions.normalizeAirfoilDefinitions.normalize!
Public interface
AirfoilDefinitions.AirfoilDefinitions — Module
AirfoilDefinitions.jl – a Julia package for defining two-dimensional chord-normalized airfoil geometries using parametric airfoil definitions.
AirfoilDefinitions.AbstractAirfoilDefinition — Type
AbstractAirfoilDefinitionAbstract supertype for airfoil generation methods.
AirfoilDefinitions.AirfoilFile — Type
AirfoilFile <: AbstractAirfoilDefinitionGeneric airfoil definition that reads the coordinates stored in an external file.
The file is expected to contain two columns representing (x, y) coordinates, ordered according to the Selig format. The geometry is read and normalized when coordinates are requested.
AirfoilDefinitions.CST — Type
CST{Tu, Tl, Te, Tt, Tn1, Tn2} <: AbstractAirfoilDefinitionClass–-Shape Transformation (CST) airfoil definition.
Fields
upper_weights::Tu: Weights for the upper surface.lower_weights::Tl: weights for the lower surface.leading_edge_weight::Te: Leading-edge curvature.trailing_edge_thickness::Tt: Trailing-edge thickness.N1::Tn1: Leading-edge class exponent (default: 0.5).N2::Tn2: Trailing-edge class exponent (default: 1.0).
AirfoilDefinitions.CST — Method
CST(coordinates; num_upper_weights=8, num_lower_weights=8, N1=0.5, N2=1.0)Fit a CST airfoil definition to a set of input airfoil coordinates.
This constructor performs a nonlinear least-squares fit of the CST (Class–Shape Transformation) parameterization to the provided airfoil coordinates. Upper and lower surfaces are fitted simultaneously using Bernstein polynomial shape functions.
The input coordinates are internally normalized to a unit chord prior to fitting.
Arguments
coordinates::AbstractMatrix: Airfoil coordinates following the Selig ordering.
Keyword Arguments
num_upper_weights::Int: Number of Bernstein coefficients used for the upper surface shape function.num_lower_weights::Int: Number of Bernstein coefficients used for the lower surface shape function.N1::Real: Leading-edge class exponent.N2::Real: Trailing-edge class exponent.
Returns
CST: A CST representation of the given airfoil coordinates.
AirfoilDefinitions.NACA4 — Type
NACA4{Tm, Tp, Tt} <: AbstractAirfoilDefinitionFour-digit NACA airfoil definition.
Represents a classical NACA 4-digit airfoil parameterized by camber, camber position, and thickness. This type encodes how the airfoil is defined, not its discretized geometry.
Arguments
max_camber::Tm: Maximum camber as a fraction of the chord.max_camber_position::Tp: Chordwise position of maximum camber.max_thickness::Tt: Maximum thickness as a fraction of the chord.open_trailing_edge::Bool: Whether to use the open trailing-edge formulation.
AirfoilDefinitions.NACA4 — Method
NACA4(s::String; open_trailing_edge=true)Construct a NACA 4-digit airfoil from a four-digit string.
The string must contain exactly four digits, following the standard NACA convention (e.g. "2412").
Arguments
s: Four-digit NACA airfoil designation.
Keyword arguments
open_trailing_edge: Whether to use the open trailing-edge formulation.
An ArgumentError is thrown if the string does not contain exactly four digits.
AirfoilDefinitions.NACA4 — Method
NACA4(m, p, t; open_trailing_edge=true)Construct a NACA 4-digit airfoil from numerical parameters.
Arguments
m: Maximum camber as a fraction of the chord.p: Chordwise position of maximum camber.t: Maximum thickness as a fraction of the chord.
Keyword arguments
open_trailing_edge: Whether to use the open trailing-edge formulation.
An ArgumentError is thrown if the parameters are invalid or inconsistent.
AirfoilDefinitions.UnitAirfoil — Type
UnitAirfoil{M <: AbstractAirfoilDefinition, C <: AbstractMatrix}Canonical representation of a unit-chord airfoil.
UnitAirfoil stores airfoil geometry in a normalized reference frame (unit chord, fixed orientation, Selig ordering), together with the method that produced it.
Fields
method::M: Airfoil definition method.coordinates::C: Airfoil coordinates in canonical form.
AirfoilDefinitions.UnitAirfoil — Method
UnitAirfoil(method::AirfoilFile; kwargs...)Construct a UnitAirfoil by reading and normalazing the coordinates in a file.
AirfoilDefinitions.UnitAirfoil — Method
UnitAirfoil(method::CST; num_points = 199, kwargs...)Construct a UnitAirfoil from a CST airfoil definition. Coordinates are generated using coordinates(::CST).
AirfoilDefinitions.UnitAirfoil — Method
UnitAirfoil(method::NACA4; num_points = 199, kwargs...)Construct a UnitAirfoil from a NACA 4-digit airfoil definition. Coordinates are generated using coordinates(::NACA4).
AirfoilDefinitions.coordinates — Method
coordinates(method::AbstractAirfoilDefinition; kwargs...)Return the airfoil coordinates defined by method.
Concrete subtypes of AbstractAirfoilDefinition are expected to implement this interface. Keyword arguments may be used to control some options of the method.
AirfoilDefinitions.coordinates — Method
coordinates(method::AirfoilFile; kwargs...)Read and return normalized airfoil coordinates from a file.
The coordinates are normalized in place to a canonical reference frame (unit chord, leading edge at the origin, Selig ordering).
Arguments
method::AirfoilFile: Generic airfoil definition stored in an external file.
AirfoilDefinitions.coordinates — Method
coordinates(method::CST; num_points=199, kwargs...)Generate airfoil coordinates using the CST airfoil definition.
Arguments
method::CST: CST airfoil definition.
Keyword arguments
num_points::Int: Total number of points used to discretize the airfoil.
Returns
Matrix{<:Real}: Airfoil coordinates on a unit chord, ordered according to the Selig convention.
AirfoilDefinitions.coordinates — Method
coordinates(method::NACA4; num_points=199, kwargs...)Generate airfoil coordinates for a NACA 4-digit airfoil.
Arguments
method::NACA4: four-digit NACA airfoil definition.
Keyword arguments
num_points::Int: Total number of points used to discretize the airfoil.
Returns
::Matrix: Airfoil coordinates on a unit chord, ordered according to the Selig convention.
AirfoilDefinitions.coordinates — Method
coordinates(foil::UnitAirfoil; kwargs...)Return the coordinate representation of a UnitAirfoil.
Keyword arguments are accepted for interface consistency but are not used by this method.
AirfoilDefinitions.normalize! — Method
normalize(coordinates) -> AbstractMatrix
normalize!(coordinates)Normalize airfoil coordinates.
The normalization assumes that coordinates are arranged according to the Selig ordering and performs the following steps:
- Identify the leading edge as the point farthest from the midpoint of the trailing edge.
- Translate the coordinates so that the leading edge lies at
(0, 0). - Scale the coordinates so that the chord length is unity.
- Rotate the coordinates so that the trailing edge lies at
(1, 0).
Arguments
coordinates::AbstractMatrix: Two-column matrix of airfoil coordinates(x, y)ordered in Selig format.
AirfoilDefinitions.normalize — Method
normalize(coordinates) -> AbstractMatrix
normalize!(coordinates)Normalize airfoil coordinates.
The normalization assumes that coordinates are arranged according to the Selig ordering and performs the following steps:
- Identify the leading edge as the point farthest from the midpoint of the trailing edge.
- Translate the coordinates so that the leading edge lies at
(0, 0). - Scale the coordinates so that the chord length is unity.
- Rotate the coordinates so that the trailing edge lies at
(1, 0).
Arguments
coordinates::AbstractMatrix: Two-column matrix of airfoil coordinates(x, y)ordered in Selig format.