NWH Aerodynamics
Search Results for

    Show / Hide Table of Contents

    Class AirfoilSection

    Represents one spanwise section of an airfoil that calculates local aerodynamic forces. Each section independently computes lift, drag, and moment based on local flow conditions.

    Inheritance
    object
    AirfoilSection
    Namespace: NWH.Aerodynamics.Airfoils
    Assembly: NWH.Aerodynamics.dll
    Syntax
    [Serializable]
    public class AirfoilSection
    Remarks

    The finite wing is divided into multiple sections along the span. Each section evaluates the airfoil profile curves at its local angle of attack and applies forces at its aerodynamic center. Control surface deflections are integrated by combining the main airfoil section with its attached control section.

    Constructors

    | Edit this page View Source

    AirfoilSection()

    Declaration
    public AirfoilSection()
    | Edit this page View Source

    AirfoilSection(string, Airfoil, FinitePlane, int)

    Declaration
    public AirfoilSection(string name, Airfoil parentAirfoil, FinitePlane fPlane, int subIndex = -1)
    Parameters
    Type Name Description
    string name
    Airfoil parentAirfoil
    FinitePlane fPlane
    int subIndex

    Fields

    | Edit this page View Source

    aT

    Reference to the parent airfoil's transform system.

    Declaration
    public AirfoilTransform aT
    Field Value
    Type Description
    AirfoilTransform
    | Edit this page View Source

    aerodynamicCenter

    Local position of the aerodynamic center in the parent airfoil's coordinate system.

    Declaration
    public Vector3 aerodynamicCenter
    Field Value
    Type Description
    Vector3
    | Edit this page View Source

    aoa

    Current angle of attack in degrees. Angle between the relative wind and the chord line. Positive when wind comes from below the chord line.

    Declaration
    public float aoa
    Field Value
    Type Description
    float
    | Edit this page View Source

    area

    Planform area of this section in square meters. Used to scale aerodynamic forces.

    Declaration
    public float area
    Field Value
    Type Description
    float
    | Edit this page View Source

    cd

    Current drag coefficient evaluated from the airfoil profile at the current angle of attack.

    Declaration
    public float cd
    Field Value
    Type Description
    float
    | Edit this page View Source

    chordLength

    Average chord length of this section in meters. Distance from leading edge to trailing edge.

    Declaration
    public float chordLength
    Field Value
    Type Description
    float
    | Edit this page View Source

    cl

    Current lift coefficient evaluated from the airfoil profile at the current angle of attack.

    Declaration
    public float cl
    Field Value
    Type Description
    float
    | Edit this page View Source

    cm

    Current moment coefficient evaluated from the airfoil profile at the current angle of attack.

    Declaration
    public float cm
    Field Value
    Type Description
    float
    | Edit this page View Source

    controlAirfoil

    Reference to the control surface airfoil attached to this section, if any.

    Declaration
    public Airfoil controlAirfoil
    Field Value
    Type Description
    Airfoil
    | Edit this page View Source

    controlAirfoilSectionIndex

    Index of the control surface section that corresponds to this main wing section.

    Declaration
    public int controlAirfoilSectionIndex
    Field Value
    Type Description
    int
    | Edit this page View Source

    dragCenter

    Local position where drag force is applied in the parent airfoil's coordinate system.

    Declaration
    public Vector3 dragCenter
    Field Value
    Type Description
    Vector3
    | Edit this page View Source

    dragForce

    Drag force vector in world space. Points opposite to the relative wind direction.

    Declaration
    public Vector3 dragForce
    Field Value
    Type Description
    Vector3
    | Edit this page View Source

    dragMagnitude

    Magnitude of drag force in Newtons.

    Declaration
    public float dragMagnitude
    Field Value
    Type Description
    float
    | Edit this page View Source

    fPlane

    Defines the geometry of this section as a quadrilateral planform segment.

    Declaration
    public FinitePlane fPlane
    Field Value
    Type Description
    FinitePlane
    | Edit this page View Source

    liftForce

    Lift force vector in world space. Perpendicular to both relative wind and span direction.

    Declaration
    public Vector3 liftForce
    Field Value
    Type Description
    Vector3
    | Edit this page View Source

    liftMagnitude

    Magnitude of lift force in Newtons.

    Declaration
    public float liftMagnitude
    Field Value
    Type Description
    float
    | Edit this page View Source

    momentMagnitude

    Magnitude of pitching moment in Newton-meters.

    Declaration
    public float momentMagnitude
    Field Value
    Type Description
    float
    | Edit this page View Source

    momentTorque

    Moment torque vector in world space. Positive creates nose-up pitching moment.

    Declaration
    public Vector3 momentTorque
    Field Value
    Type Description
    Vector3
    | Edit this page View Source

    name

    Display name of this section for debugging purposes.

    Declaration
    public string name
    Field Value
    Type Description
    string
    | Edit this page View Source

    parentAirfoil

    Reference to the parent Airfoil that owns this section.

    Declaration
    public Airfoil parentAirfoil
    Field Value
    Type Description
    Airfoil
    | Edit this page View Source

    subIndex

    Section index within the parent airfoil's sections list.

    Declaration
    public int subIndex
    Field Value
    Type Description
    int

    Properties

    | Edit this page View Source

    AerodynamicCenter

    Declaration
    public Vector3 AerodynamicCenter { get; }
    Property Value
    Type Description
    Vector3
    | Edit this page View Source

    ControlAirfoilSection

    Declaration
    public AirfoilSection ControlAirfoilSection { get; }
    Property Value
    Type Description
    AirfoilSection
    | Edit this page View Source

    DragCenter

    Declaration
    public Vector3 DragCenter { get; }
    Property Value
    Type Description
    Vector3

    Methods

    | Edit this page View Source

    DrawGizmos()

    Declaration
    public void DrawGizmos()
    | Edit this page View Source

    Initialize(Airfoil, Atmosphere)

    Initializes the section's geometry and calculates its area, chord length, and force application points.

    Declaration
    public void Initialize(Airfoil inParentAirfoil, Atmosphere atmosphere)
    Parameters
    Type Name Description
    Airfoil inParentAirfoil

    The Airfoil that owns this section.

    Atmosphere atmosphere

    Optional Atmosphere component for altitude-dependent air density.

    Remarks

    Computes the aerodynamic center and drag center positions along the chord line based on the parent airfoil's specified chord position ratios. Calculates the average chord length from the leading and trailing edge lengths.

    | Edit this page View Source

    OnPhysicsSubstep(float)

    Calculates and applies lift, drag, and moment forces to the parent rigidbody.

    Declaration
    public void OnPhysicsSubstep(float dt)
    Parameters
    Type Name Description
    float dt

    Physics timestep in seconds.

    Remarks

    Evaluates the airfoil profile curves at the current angle of attack to obtain Cl, Cd, and Cm. Forces are calculated using the standard aerodynamic equations with dynamic pressure (0.5 * rho * v^2 * area). Lift is applied at the aerodynamic center, drag at the drag center. Moment is applied as a force couple perpendicular to the chord line.

    | Edit this page View Source

    OnPrePhysicsSubstep(float)

    Pre-calculates flow conditions and control surface effects before force calculation.

    Declaration
    public void OnPrePhysicsSubstep(float dt)
    Parameters
    Type Name Description
    float dt

    Physics timestep in seconds.

    Remarks

    Computes the relative airflow velocity by combining the rigidbody's velocity at the aerodynamic center with wind velocity. If the relative velocity is below 0.1 m/s, skips force calculation for performance. When a control surface is attached, calculates the effective angle of attack and chord length based on the control surface deflection angle.

    | Edit this page View Source

    SetWindVelocity(Vector3)

    Sets the ambient wind velocity affecting this section.

    Declaration
    public void SetWindVelocity(Vector3 vel)
    Parameters
    Type Name Description
    Vector3 vel

    Wind velocity vector in world space.

    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics