OpenVSP's Airfoil Analysis capability and VSPAERO's strip-wise parasite drag model both use libNeuralFoil. libNeuralFoil is a C++ library implementation of Peter Sharpe's NeuralFoil. NeuralFoil is a neural network model of airfoil performance trained on a large set of XFoil runs. For details on NeuralFoil and XFoil, visit the respective sites linked above.
OpenVSP and VSPAERO both use the xlarge NeuralFoil
model. NeuralFoil has ben trained on incompressible XFoil runs. Several
compressibility corrections have been applied. These corrections are
similar, but not identical to the corrections applied in Peter Sharpe's
AeroSandbox.
NeuralFoil (and therefore libNeuralFoil) requires eighth order Class Shape Transformation (CST) curve coefficients for the upper and lower curves, as well as terms for the leading edge camber and trailing edge angle. NeuralFoil also requires the airfoils to be normalized in a particular manner and for the split between the upper and lower curves to be the most forward point of the normalized airfoil.
Internally, OpenVSP represents airfoils with piecewise cubic Bezier curves that have been fit to the definition of the airfoil (whether from NACA formulas, files, CST, etc.). Although OpenVSP provides an option for modeling airfoils with a CST parameterization, that definition does not perfectly match NeuralFoil's definition and even those airfoils are processed from the Bezier curves.
In OpenVSP's airfoil representation, the piecewise Bezier curve starts at the trailing edge (TE) of the lower surface and continues around the leading edge (LE) to the TE of the upper surface. When preparing an airfoil for NeuralFoil, the TE point is defined as the average of the first and last points of the airfoil curve. Next, OpenVSP searches for the airfoil point furthest from the TE; this point is designated as the LE. This definition of the LE may not coincide with OpenVSP or the airfoil's native definition of the LE.
The upper and lower curves are evaluated at 100 points with equal arc length spacing. This results in 199 points around the airfoil with the LE represented exactly and shared by both curves.
The airfoil is normalized (rotated and scaled) such that the LE is at (0, 0) and the TE is at (1, 0). The rotation angle and scale factor are recorded such that they can later be applied as corrections to the angle of attack and the chord as needed. Eighth order CST curves are fit to the points through a least squares fit.
When preparing to run VSPAERO, several other geometric parameters are
calculated at the same time as the CST coefficients. These include the
airfoil's thickness to chord ratio (t/c) and the three-dimensional
leading and trailing edge lines of the lifting surfaces. All of this
data is written to an *.airfoilstack file.
When VSPAERO is running in analysis mode, it will read this data from the file. However, when VSPAERO is running in optimization mode, it can access this information in memory via the API.
In OpenVSP, when the compressible analysis mode is selected, the incompressible results from NeuralFoil are corrected for compressibility effects using the Prandtl-Glauert transformation, a buffet correction, and a transonic drag rise model. In VSPAERO, these models are applied whenever they are applicable.
For a swept wing, only the velocity component normal to the sweep line drives compressibility effects. The local Mach number for an infinite swept wing is:
where is the quarter-chord sweep angle. All subsequent compressibility corrections use rather than .
When using the compressible analysis mode in OpenVSP, the user specifies the freestream Mach number () and the sweep angle (). Conversely, VSPAERO calculates these quantities on the fly based on the three dimensional leading and trailing edges of the lifting surfaces, the flight condition, and any relative motion for the case. Consequently, the local sweep and Mach number in VSPAERO will account for differences in sweep caused by sideslip and changes due to rotating blades at any orientation.
The Prandtl-Glauert compressibility factor is:
The compressible lift and moment coefficients are:
The incompressible pressure coefficient is recovered from the NeuralFoil boundary layer edge velocity ratio:
The Prandtl-Glauert corrected pressure coefficient is:
Compressibility reduces turbulent skin friction relative to the incompressible value at the same Reynolds number. A simplified correction factor based on the stagnation-to-static temperature ratio for isentropic flow is:
Applied for air (), where the square root captures the effect of temperature in the skin friction coefficient equation.
The compressible drag coefficient is:
The critical Mach number is the freestream Mach number at which the local flow first reaches sonic conditions at the point of minimum pressure on the airfoil. It is calculated from the minimum incompressible pressure coefficient using a curve fit developed by Peter Sharpe for use with NeuralFoil and AeroSandbox:
The minimum incompressible Cp is found by scanning the upper and lower surface edge velocity distributions returned by NeuralFoil.
The drag divergence Mach number is defined as the Mach number at which the drag rise rate reaches . Using Locke's quartic drag rise model described below, this condition yields:
The increment is obtained by differentiating and setting the result to 0.1.
Wave drag is modeled in three regions:
Subcritical ():
Transonic rise ():
This quartic form matches the classical drag rise behavior near the critical Mach number.
High subsonic / transonic / supersonic ():
A cubic Bezier curve blends from the quartic drag rise at to the thin-airfoil-theory supersonic value. The supersonic anchor point is taken at , where the linearized supersonic drag is:
The Bezier blend ensures continuity of value and slope at , with zero slope imposed at the supersonic anchor to provide a smooth transition.
The total drag coefficient is the sum of the viscous and wave components:
Above the drag divergence Mach number, shock-induced separation leads to buffet onset and a loss of lift effectiveness. A correction is applied to and for :
This linearly reduces effective lift and moment from their full compressible values at to 30% of those values as approaches 1. The threshold of 0.06 above provides a small margin before buffet onset degrades performance.
Drag is not modified by the buffet factor; the viscous and wave drag components are reported independently.