Reference
Contents
Index
AeroGeometry.AirfoilAeroGeometry.ControlSurfaceAeroGeometry.FuselageAeroGeometry.FuselageSectionAeroGeometry.SuperellipseAeroGeometry.WingAeroGeometry.WingSectionAeroGeometry.UIUCAeroGeometry.aerodynamic_centerAeroGeometry.areaAeroGeometry.areaAeroGeometry.areaAeroGeometry.areaAeroGeometry.atm2paAeroGeometry.blend_airfoilsAeroGeometry.camberAeroGeometry.centroidAeroGeometry.compute_frameAeroGeometry.coordinatesAeroGeometry.coordinatesAeroGeometry.deflect_control_surfaceAeroGeometry.deflect_control_surface!AeroGeometry.from_filepathAeroGeometry.ft2mAeroGeometry.ftlbf2jAeroGeometry.gal2lAeroGeometry.get_control_surfaceAeroGeometry.hp2wAeroGeometry.in2mAeroGeometry.kts2mpsAeroGeometry.lb2kgAeroGeometry.lbft2nmAeroGeometry.leading_edge_indexAeroGeometry.max_camberAeroGeometry.max_thicknessAeroGeometry.mi2mAeroGeometry.mph2mpsAeroGeometry.naca4AeroGeometry.normalize!AeroGeometry.normalsAeroGeometry.oz2kgAeroGeometry.psiAeroGeometry.quarter_chordAeroGeometry.quarter_chordAeroGeometry.rankine2kelvinAeroGeometry.repanelAeroGeometry.repanel_cosine!AeroGeometry.repanel_curvature!AeroGeometry.rotate!AeroGeometry.rotate_vectorAeroGeometry.spanAeroGeometry.surface_coordinatesAeroGeometry.tangentsAeroGeometry.thicknessAeroGeometry.trailing_edge_angleAeroGeometry.trailing_edge_thicknessAeroGeometry.translate!AeroGeometry.validate!AeroGeometry.write_fileAeroGeometry.yd2m
AeroGeometry.Airfoil — Method
Airfoil(name::String)Constructs an Airfoil object from the provided name. The function follows these steps to generate the airfoil:
- If the name is a valid file path, the coordinates are loaded from the file.
- If the name corresponds to a NACA 4-digit airfoil, its coordinates are generated directly.
- 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 fileAeroGeometry.ControlSurface — Type
Control surface defined as a parametric patch on a Wing.
Coordinates:
- eta ∈ [0,1] root→tip (on one side)
- xi ∈ [0,1] LE→TE
AeroGeometry.Fuselage — Type
Fuselage <: AeroComponentRepresents 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]
)AeroGeometry.FuselageSection — Type
FuselageSection <: AeroComponentRepresents 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)
)AeroGeometry.Superellipse — Type
Superellipse <: SectionShapeRepresents a superellipse cross-section shape using the superellipse equation.
Fields
width::Float64: Width of the superellipseheight::Float64: Height of the superellipseexponent::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)AeroGeometry.Wing — Type
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 ofWingSectionobjects, 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 ofControlSurfaceobjects defining movable surfaces on the wing (default: empty vector).
Notes
- The cross-sections in
sectionsmust 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])AeroGeometry.WingSection — Type
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.
AeroGeometry.UIUC — Method
Internal function used to populate airfoil coordinates from UIUC database.
AeroGeometry.aerodynamic_center — Method
aerodynamic_center(wing::Wing; chord_fraction::Float64=0.25)Computes the location of the aerodynamic center of the wing.
Arguments
wing::Wing: The wing objectchord_fraction::Float64: The position of the aerodynamic center along the MAC, as a fraction of MAC length (default: 0.25)
Notes
- Typically,
chord_fractionis 0.25 for a subsonic wing
AeroGeometry.area — Method
area(airfoil::Airfoil)Retrieves the area an Airfoil object
AeroGeometry.area — Method
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).
AeroGeometry.area — Method
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.
AeroGeometry.area — Method
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 measuretype: 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
AeroGeometry.atm2pa — Method
Convert atmospheres (atm) to Pascals (Pa).
AeroGeometry.blend_airfoils — Method
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
AeroGeometry.camber — Method
camber(airfoil::Airfoil;xc=0:0.01:1)Retrieves the camber distribution of an Airfoil object
AeroGeometry.centroid — Method
centroid(airfoil::Airfoil)Retrieves the geometric centroid of an Airfoil object
AeroGeometry.compute_frame — Method
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).
AeroGeometry.coordinates — Function
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.
AeroGeometry.coordinates — Method
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.
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
AeroGeometry.deflect_control_surface — Method
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.
AeroGeometry.from_filepath — Method
Internal function used to populate airfoil coordinates from a file path.
AeroGeometry.ft2m — Function
Convert feet and inches to meters.
AeroGeometry.ftlbf2j — Method
Convert foot-pounds force (ft-lbf) to joules (J).
AeroGeometry.gal2l — Method
Convert gallons (US) to liters (L).
AeroGeometry.get_control_surface — Method
Find a control surface by name in an entire airplane.
AeroGeometry.hp2w — Method
Convert horsepower (hp) to watts (W).
AeroGeometry.in2m — Method
Convert inches to meters.
AeroGeometry.kts2mps — Method
Convert knots (kts) to meters per second (m/s).
AeroGeometry.lb2kg — Method
Convert pounds (lb) to kilograms (kg).
AeroGeometry.lbft2nm — Method
Convert pound-feet (lb-ft) to Newton-meters (Nm).
AeroGeometry.leading_edge_index — Method
leading_edge_index(airfoil::Airfoil)Retrieves index of the leading edge in the coordinate array of an Airfoil object
AeroGeometry.max_camber — Method
max_camber(airfoil::Airfoil;xc=0:0.01:1)Retrieves the maximum camber an Airfoil object
AeroGeometry.max_thickness — Method
max_thickness(airfoil::Airfoil;xc=0:0.01:1)Retrieves the maximum thickness an Airfoil object
AeroGeometry.mi2m — Method
Convert miles to meters.
AeroGeometry.mph2mps — Method
Convert miles per hour (mph) to meters per second (m/s).
AeroGeometry.naca4 — Function
naca4(name::String, points_per_side::Int64 = 50)Generates coordinates for 4 digit NACA airfoils with 2*pointsperside-1 points using cosine spacing
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
AeroGeometry.normals — Method
normals(airfoil::Airfoil; centers::Bool=true)Returns unit normal vectors (pointing outward) for each panel of the airfoil.
AeroGeometry.oz2kg — Method
Convert ounces (oz) to kilograms (kg).
AeroGeometry.psi — Method
Convert pounds per square inch (psi) to Pascals (Pa).
AeroGeometry.quarter_chord — Method
quarter_chord(airfoil::Airfoil)
Retrieves the geometric quarter chord point of an Airfoil object
AeroGeometry.quarter_chord — Method
quarter_chord(section::WingSection)Get the quarter chord point of a wing section in 3D space.
AeroGeometry.rankine2kelvin — Method
Convert Rankine (°R) to Kelvin (K).
AeroGeometry.repanel — Function
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 repaneln::Int: Target number of panelsmethod::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)
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)
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 repaneln::Int: Target number of panelsUfac::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 resolutionAeroGeometry.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 degreespivot::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])AeroGeometry.rotate_vector — Method
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.
AeroGeometry.span — Method
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 measurecenterline::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
AeroGeometry.surface_coordinates — Method
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
AeroGeometry.tangents — Method
tangents(airfoil::Airfoil; centers::Bool=false)Returns unit tangent vectors for each panel of the airfoil.
AeroGeometry.thickness — Method
thickness(airfoil::Airfoil;xc=0:0.01:1)Retrieves the thickness distribution of an Airfoil object
AeroGeometry.trailing_edge_angle — Method
trailing_edge_angle(airfoil::Airfoil)Retrieves the trailing edge angle of an Airfoil object
AeroGeometry.trailing_edge_thickness — Method
trailing_edge_thickness(airfoil::Airfoil)Retrieves the trailing edge thickness of an Airfoil object
AeroGeometry.translate! — Method
translate!(wing::Wing, xyz::Vector{Float64})Translate the entire wing in global coordinates.
AeroGeometry.validate! — Method
Function to make sure assumed behavior holdsAeroGeometry.write_file — Method
write_file(airfoil::Airfoil)Creates a .dat file of an Airfoil object for use in other software
AeroGeometry.yd2m — Method
Convert yards (yd) to meters (m).