Reference

Contents

Index

AeroGeometry.AirfoilMethod
Airfoil(name::String)

Constructs an Airfoil object from the provided name. The function follows these steps to generate the airfoil:

  1. If the name is a valid file path, the coordinates are loaded from the file.
  2. If the name corresponds to a NACA 4-digit airfoil, its coordinates are generated directly.
  3. If neither of the above succeeds, an attempt is made to find the airfoil in the UIUC database.

The Airfoil object contains the name of the airfoil and a 2D array of x and y coordinates, starting from the trailing edge (TE), moving along the upper surface to the leading edge (LE), and then along the lower surface back to the TE.

Examples

julia> hub = Airfoil("naca0012")  # Generates a NACA 0012 airfoil
julia> tip = Airfoil("b707d")     # Finds and loads an airfoil from the UIUC database
julia> custom = Airfoil("my_airfoil.dat")  # Loads airfoil coordinates from a file
source
AeroGeometry.ControlSurfaceType

Control surface defined as a parametric patch on a Wing.

Coordinates:

  • eta ∈ [0,1] root→tip (on one side)
  • xi ∈ [0,1] LE→TE
source
AeroGeometry.FuselageType
Fuselage <: AeroComponent

Represents a fuselage composed of multiple cross-sectional slices.

Fields

  • name::String: Name of the fuselage.
  • sections::Vector{FuselageSection}: Vector of cross-sectional slices defining the fuselage shape.
  • position::Vector{Float64}: 3D position of the fuselage in space.
  • orientation::Matrix{Float64}: 3x3 rotation matrix defining the fuselage orientation.

Example

# Create a simple fuselage with two circular sections
section1 = FuselageSection(
    center = [0.0, 0.0, 0.0],
    normal = [1.0, 0.0, 0.0],
    shape = Superellipse(2.0, 2.0, 2.0)
)
section2 = FuselageSection(
    center = [5.0, 0.0, 0.0],
    normal = [1.0, 0.0, 0.0],
    shape = Superellipse(1.5, 1.5, 2.0)
)
fuselage = Fuselage(
    name = "Simple Fuselage",
    sections = [section1, section2]
)
source
AeroGeometry.FuselageSectionType
FuselageSection <: AeroComponent

Represents a cross-sectional slice of a fuselage at a specific location and orientation.

Fields

  • center::Vector{<:Real}: 3D coordinates of the center of the cross-section.
  • normal::Vector{<:Real}: Normal vector defining the orientation of the cross-section.
  • shape::SectionShape: Shape of the cross-section (e.g., Superellipse, ArbitraryShape).

Example

# Create a circular fuselage section at origin, normal along x-axis
section = FuselageSection(
    center = [0.0, 0.0, 0.0],
    normal = [1.0, 0.0, 0.0],
    shape = Superellipse(2.0, 2.0, 2.0)
)
source
AeroGeometry.SuperellipseType
Superellipse <: SectionShape

Represents a superellipse cross-section shape using the superellipse equation.

Fields

  • width::Float64: Width of the superellipse
  • height::Float64: Height of the superellipse
  • exponent::Float64: Shape parameter (exponent). Values around 2.0 give an ellipse, higher values approach a rectangle, lower values create a more pointed shape.

Example

# Create a circular cross-section
circle = Superellipse(2.0, 2.0, 2.0)

# Create a more rectangular shape
rect = Superellipse(3.0, 2.0, 4.0)
source
AeroGeometry.WingType

Represents an entire wing, consisting of multiple cross-sections and a symmetry property.

Fields

  • name::String: The name of the wing, useful for identification (e.g., "Main Wing").
  • sections::Vector{WingSection}: A vector of WingSection objects, each representing a cross-section of the wing. These define the shape and geometry of the wing along its span.
  • symmetric::Bool: Indicates whether the wing is symmetric about the y=0 plane:
    • true: The wing is mirrored across the centerline (e.g., for a standard airplane wing pair).
    • false: The wing is not mirrored (e.g., for a single wing or an asymmetrical design).
  • control_surfaces::Vector{ControlSurface}: A vector of ControlSurface objects defining movable surfaces on the wing (default: empty vector).

Notes

  • The cross-sections in sections must be provided in a consistent order along the wing. No automatic sorting is performed.
  • If wing is symmetric, all sections must have non-negative y-coordinates (lie on the positive y-axis).

Example

# Define individual cross-sections of the wing
xsec1 = WingSection(position=[0.0, 0.0, 0.0], chord=1.0, twist=0.0)
xsec2 = WingSection(position=[1.0, 0.5, 0.1], chord=0.8, twist=3.0)

# Define a control surface
cs1 = ControlSurface(name="Aileron", xsec_id=[1, 2], deflection=5.0, hinge_point=0.4, symmetric=false)

# Create the wing with cross-sections and control surfaces
wing = Wing(name="Example Wing", sections=[xsec1, xsec2], symmetric=true, control_surfaces=[cs1])
source
AeroGeometry.WingSectionType

Represents a cross-section of a wing, defined by its airfoil, leading edge location in the wing-fixed axis, chord length, and twist angle.

Fields

  • airfoil::Airfoil: The airfoil object representing the shape of this wing section.
  • position::Vector{Float64}: A 3-element vector specifying the leading edge location [x, y, z] of this cross-section in the wing coordinate system before any twist is applied.
  • chord::Float64: The chord length of the wing cross-section.
  • twist::Float64: The twist angle (in degrees) of this cross-section relative to the root.

Example

xsec = WingSection(position=[1.0, 0.5, 0.0], chord=2.0, twist=5.0)

Notes

  • The leading edge location is defined in the wing coordinate system and applying the twist.
source
AeroGeometry.aerodynamic_centerMethod
aerodynamic_center(wing::Wing; chord_fraction::Float64=0.25)

Computes the location of the aerodynamic center of the wing.

Arguments

  • wing::Wing: The wing object
  • chord_fraction::Float64: The position of the aerodynamic center along the MAC, as a fraction of MAC length (default: 0.25)

Notes

  • Typically, chord_fraction is 0.25 for a subsonic wing
source
AeroGeometry.areaMethod
area(fuselage::Fuselage, closed::Bool=false)

Calculates the surface area of the fuselage by approximating it with quadrilateral panels formed between consecutive cross-sections.

Arguments

  • fuselage::Fuselage: The fuselage object for which to calculate the surface area.
  • closed::Bool: If true, includes the area of the end caps (first and last cross-sections).
source
AeroGeometry.areaMethod
area(sections::Vector{WingSection})

Computes the areas of individual wing sections defined by consecutive WingSection objects.

Arguments

  • sections::Vector{WingSection}: A vector of WingSection objects defining the wing sections.
  • type::Symbol: Either :planform (mean camber surface area) or :wetted (actual surface area including top/bottom). Can be provided as a symbol or string.
source
AeroGeometry.areaMethod
area(wing::Wing; type::Symbol=:planform, centerline::Bool=false)

Computes the wing area.

For symmetric wings, both left/right sides are included in the total area.

Arguments

  • wing::Wing: The wing to measure
  • type: Either :planform (mean camber surface area) or :wetted (actual surface area including top/bottom). Can be provided as a symbol or string.
  • centerline::Bool=false: If true and wing is symmetric with root offset from y=0, includes fictitious rectangular area from innermost section to centerline
source
AeroGeometry.blend_airfoilsMethod
blend_airfoils(airfoil1::Airfoil,airfoil2::Airfoil;fraction::Number=0.5,points_per_side=100)

Superimposes two airfoils, taking fraction of the first airfoil and 1-fraction of the second. Repanels according to points_per_side. See repanel! for more info

source
AeroGeometry.camberMethod
camber(airfoil::Airfoil;xc=0:0.01:1)

Retrieves the camber distribution of an Airfoil object

source
AeroGeometry.compute_frameMethod

Computes the local reference frame for a specific cross-section of the wing.

Args: wing::Wing: Wing object containing cross-sections. index::Int: Index of the cross-section.

Returns: Tuple{Vector{Float64}, Vector{Float64}, Vector{Float64}}: (xglocal, yglocal, zg_local), the local reference frame axes as unit vectors (chordwise, spanwise, normal).

source
AeroGeometry.coordinatesFunction
coordinates(airfoil::Airfoil, surface::Symbol=:all)

Retrieves the coordinates of an Airfoil object based on the specified surface.

Arguments:

  • airfoil: The Airfoil object.
  • surface: A Symbol indicating which surface to retrieve. Options are:
    • :upper: Retrieves the upper surface of the airfoil.
    • :lower: Retrieves the lower surface of the airfoil.
    • :all (default): Retrieves all coordinates.

Returns:

An Array containing the coordinates of the specified surface.

source
AeroGeometry.coordinatesMethod
coordinates(wing::Wing,camberline=false)

Computes the coordinates of each wing cross-section in the global coordinate system. if camberline is true, it returns the wing camberline coordinates instead of the surface coordinates.

Notes

  • If a wing is symmetric and its hub section is at y=0, that section is projected onto the y=0 plane. to avoid self-intersections.
source
AeroGeometry.deflect_control_surface!Method
deflect_control_surface!(airfoil::Airfoil; deflection=0, x_hinge=0.75)

Adds a control surface the trailing edge of an Airfoil object. deflection specifies the deflection angle in degrees, and x_hinge specifies how far down the chord the hinge is to be located

source
AeroGeometry.deflect_control_surfaceMethod
deflect_control_surface(airfoil::Airfoil; deflection=0, x_hinge=0.75)

Returns an Airfoil object with a control surface at the trailing edge. deflection specifies the deflection angle in degrees, and x_hinge specifies how far down the chord the hinge is to be located.

This version is compatible with automatic differentiation.

source
AeroGeometry.naca4Function
naca4(name::String, points_per_side::Int64 = 50)

Generates coordinates for 4 digit NACA airfoils with 2*pointsperside-1 points using cosine spacing

source
AeroGeometry.normalize!Method
normalize!(airfoil::Airfoil)

Normalizes an airfoil in-place so that:

  • Leading edge is at (0, 0)
  • Trailing edge is at (1, 0)
  • The airfoil is properly scaled and rotated
source
AeroGeometry.normalsMethod
normals(airfoil::Airfoil; centers::Bool=true)

Returns unit normal vectors (pointing outward) for each panel of the airfoil.

source
AeroGeometry.repanelFunction
repanel(airfoil::Airfoil,n::Int=100; method=:curvature, hinge=nothing,TEfac=0.1, Ufac=2.0)

Create a new Airfoil object, repanelled according to n. TEfac and Ufac are only used for curvature-based repaneling.

Arguments

  • airfoil::Airfoil: The airfoil to repanel
  • n::Int: Target number of panels
  • method::Symbol=:curvature: Repaneling method (:curvature or :cosine)
  • hinge::Union{Nothing,Real}=nothing: Hinge location for cosine repaneling (between 0 and 1)
  • TEfac::Real=0.1: Trailing-edge resolution factor (higher = more TE clustering)
  • Ufac::Real=2.0: Uniformity factor (higher = more uniform, less curvature-adaptive)
source
AeroGeometry.repanel_cosine!Method
repanel_cosine!(airfoil::Airfoil, n::Int; hinge=nothing)

Repanels an Airfoil object in place according to n. The total number of points will be (2n - 1)

source
AeroGeometry.repanel_curvature!Method
repanel_curvature!(airfoil::Airfoil, n::Int; Ufac=2.0, TEfac=0.1)

Repanel an airfoil using curvature-based spacing. This method adaptively distributes panels based on local curvature, with additional control over uniformity and trailing-edge resolution.

Arguments

  • airfoil::Airfoil: The airfoil to repanel
  • n::Int: Target number of panels
  • Ufac::Real=2.0: Uniformity factor (higher = more uniform, less curvature-adaptive)
  • TEfac::Real=0.1: Trailing-edge resolution factor (higher = more TE clustering)

Examples

julia> airfoil = Airfoil("naca2412")
julia> repanel_curvature!(airfoil, 100)  # Adaptive curvature-based paneling
julia> repanel_curvature!(airfoil, 100, Ufac=1.0, TEfac=0.2)  # More curvature-adaptive, higher TE resolution
source
AeroGeometry.rotate!Method
rotate!(wing::Wing; axis::Vector{<:Real}=[1,0,0], angle::Real=0.0, pivot::Vector{<:Real}=[0,0,0])

Rotate the entire wing around a specified axis by a given angle.

Arguments

  • wing::Wing: The wing to rotate (modified in-place)
  • axis::Vector{<:Real}=[1,0,0]: The rotation axis as a 3D vector in global coordinates. Default is the X-axis.
  • angle::Real=0.0: The rotation angle in degrees
  • pivot::Vector{<:Real}=[0,0,0]: The pivot point for rotation in local wing coordinates. Default is the origin.

Notes

  • The pivot is expressed in local coordinates to allow for intuitive rotations around points on the wing.

Examples

# Rotate wing 45° around Y-axis at origin
rotate!(wing, axis=[0,1,0], angle=45.0)

# Rotate wing 30° around Z-axis at a specific point
rotate!(wing, axis=[0,0,1], angle=30.0, pivot=[0, 3, 0])
source
AeroGeometry.rotate_vectorMethod
rotate_vector(v, axis, θ)

Rotates a 3D vector v around a given axis axis by an angle θ (in radians). The axis should be a unit vector.

source
AeroGeometry.spanMethod
span(wing::Wing; centerline::Bool = true)

Compute the span of a wing by measuring the distance between quarter chord points of wing sections.

Arguments

  • wing::Wing: The wing to measure
  • centerline::Bool=true: If true and wing is symmetric, includes the distance across the two innermost wing sections

Returns

  • Float64: The span in the same units as the wing geometry
source
AeroGeometry.surface_coordinatesMethod
surface_coordinates(airfoil::Airfoil)

Retrieves the coordinate along the surface of an Airfoil object, starting at the trailing edge of the upper surface and wrapping around the leading edge to end at the trailing edge of the lower surface

source
AeroGeometry.tangentsMethod
tangents(airfoil::Airfoil; centers::Bool=false)

Returns unit tangent vectors for each panel of the airfoil.

source