Table of Contents

Airfoil

Airfoil class in NWH Aerodynamics is responsible for making the aircraft interact with air. It is sliced into smaller sections (AirfoilSection) which are then individually simulated using principles of 2D airfoil simulation.

If making an open-world game with a large-scale map (> ~4000 units), the shifting origin is required (not only for this asset, but in general with game engines that use floating point precision). Explanation.

Geometry

Shape

Airfoil uses its own geometry representation in a form of a 2D trapezoidal plane with relative position and rotation to the Transform it is attached to. The shape of the Airfoil plane is adjusted using A, B, C, and D handle. AD and BC lines are always kept in parallel to each other.

If the shape of the airfoil can not be achieved using a single Airfoil multiple Airfoils can be attached to the object. This can be useful in cases such as a single-piece wing model. Still, the best practice would be to have one object and one Airfoil per single flight surface.

Airfoil adjusted to the shape of a wing using A, B, C, and D handles.

Slicing Planes

Same Airfoil from the previous image, but with slicing planes added. These are usually positioned uniformly along the width of the Airfoil, or to match the edges of the ControlSurfaces such as airfoils and elevators.

Sections

Once the slicing planes are set up pressing Slice button will generate AirfoilSections - sections of an Airfoil that each get simulated separately.

Airfoil from the image above after pressing Slice button. AirfoilSections are marked by green lines and named S[sectionNumber].

It is important that the orientation indicators of each AirfoilSection point in the correct direction. When flying level the blue indicator (forward) should point towards the incoming air, the red indicator (right) should be flush with the Airfoil and point towards the B-C line and the green (up) indicator should point up from the airfoil plane. If the green indicator is pointing the wrong way press the Flip button.

AirfoilSection orientation indicator.

Position and Rotation

To adjust the position and rotation of the Airfoil plane in the relation to the Transform it is attached to, position and rotation handles can be used. These are similar to the Transform handles but only affect the Airfoil position and rotation.

Airfoil position and rotation adjusted independently of the parent Transform using the Airfoil position and rotation handles.

Gizmos and Handles

These are the gizmos used to represent an Airfoil inside the Unity Editor:

Airfoil with gizmos displayed. The airfoil A, B, C, and D corners were re-positioned without pressing Slice button so the gizmos are still displaying the outdated AirfoilSections (green).

Setup

Using a flattened cube as an example wing model.
Example cube after adding Airfoil to it.

Airfoil Profiles

NACA1411 AirfoilProfile inspector.



AirfoilProfile is a ScriptableObject that determines the behaviour of the Airfoil.

Fields

  • 2D Cross-section - an icon of the 2D cross-section of the airfoil. Note that the Y dimension is exaggerated to better show the shape of the airfoil.
  • Coefficients - Cl (coefficient of lift), Cd (coefficient of drag) and Cm (coefficient of moment) can be used to tune the base behavior of the AirfoilProfile. These fields affect all the Airfoils using this AirfoilProfile. For individual coefficient adjustment check the Airfoil inspector.
  • Curves - AnimationCurves representing the lift, drag and moment values along the Y axis against the angle of attack on the X axis. X axis should be in range of [-90, 90]. Usually parsed from the Polar String but can also be set manually.
  • Parsing - Converts polar data from 2D airfoil simulation software such as XFoil into curves. Header Lines determines the number of initial lines to ignore (11 for XFoil) and the index values determine which column is what. By default the first column determines the angle of attack, next column is coefficient of lift, etc. If the curves are set manually this section can be ignored.

Included Airfoil Profiles

Over 1000 common airfoils are included.

After importing only NACA airfoils will be present in the NWH > Aerodynamics > Scripts > Airfoil > AirfoilProfiles directory but by double clicking on AirfoilProfiles.unitypackage in NWH > Aerodynamics > Scripts > Airfoil the rest of the AirfoilProfiles will get imported.

2023/05/14 16:43