TL;DR:

Modeling airfoil efficiency typically relies on high-fidelity computational fluid dynamics (CFD) to accurately simulate air traversing the surfaces of a wing. But creating, testing, and analyzing data from an airfoil experiment can be even more resource intensive. In this study, I examine the possibilty of developing a machine learning (ML) surrogate model to side-step the computation and predict the output. The final result is based on 3,509 held-out test points of 288 airfoil shapes never used during training or tuning.

Introduction

Ever fascinated by taking to the air, humanity developed wings to lift us into the skies. In aviation, the wings on the side of the aircraft have a slightly more technical name: an “airfoil”. The airfoil is divided into two surfaces: the top and the bottom. Bernoulli’s principle states that as the speed of a moving fluid (liquid or gas) increases, the pressure within that fluid decreases. Since air moving over the top of a wing travels faster than air traveling underneath a wing, the air on top of a wing has less pressure. Greater pressure from the underside of the wing causes the wing to rise, giving the wing lift. Thus, as an aircraft speeds up, it begins to lift — and we take flight.

Air moving over a typical airfoil.

To optimize an airfoil’s design, you need to be able to accurately model the flow of the air around an airfoil. Two ways to accomplish this include: (1) high-fidelity computational fluid dymanics (CFD) simulations, or (2) run experiments and measure parameters. Ideally, the two work in tandem — simulations enable new wing designs, and experiment validates the design to support the theory. In practice, both can be a significant drain on resources because CFD is computationally difficult and building fully equipped wind tunnels costs time, effort, and money.

Surrogate Modeling

If you boil that down, you get a simple relationship between input parameters and output parameters. The input parameters are used to define wind speed and wing design, and the outputs are the metrics they produce based on the airfoil (ex. lift and drag). With the dawn of artificial intelligence (AI), a third option arises: ML surrogate modeling.

In short, surrogate modeling means using the model inputs as features and developing a machine learning algorithm to predict the output parameters without running the computationally expensive CFD models.

In this case, we’re trying to compute two parameters, each normalized to the product of dynamic pressure and chord:

  • CLC_L: Lift per unit span
  • CDC_D: Drag per unit span

To be specific, the “dynamic pressure” is defined by qq:

q=12⋅ρ⋅V2q = \frac{1}{2} \cdot ρ \cdot V^2

where ρρ is the air density, and VV is the airspeed.

Here’s some vocabulary we’ll encounter…

  • Camber: The curvature of an airfoil’s surface from its leading edge to its trailing edge
  • Angle of attack: The angle of the airfoil with respect to the incident windstream
  • Computational Fluid Dynamics: The family of computer models used to simulate airfoil performance
  • Class Shape Transformation: A method used to represent smooth geometries using a small number of parameters

and here are some acronyms, as well:

  • AI / ML: Artificial Intelligence / Machine Learning
  • CFD: Computational Fluid Dynamics
  • CST: Class Shape Transformation
  • DPH: Drag-Polar Hypernetwork
  • MdAPE: Median Absolute Percentage Error
  • MAE: Mean Absolute Error

Data Collection

The data used in this study was downloaded from the Github repository, “Dataset of Airfoil Aerodynamic and Geometric Coefficients“. Downloaded as a CSV, airfoil shapes are described with Class Shape Transformation (CST), Kulfan’s parameterization, in which each surface is a smooth curve built from a few weights on Bernstein polynomial bumps. The eight coefficients are four lower-surface weights followed by four upper-surface weights, each ordered from nose to tail. In total, the data contain 9 columns:

  • Angle of attack (AoA)
  • Four CST coefficients to define the lower-surface
  • Four CST coefficients to define the upper-surface

These parameters are cleaned and used as the input to various ML models. Within the context of the airfoil shape, a “smooth” airfoil is one whose CFD log(CD)log(C_D)-versus-AoA curve closely follows a cubic fitted to that airfoil’s own points. If each point is left out of the fit in turn and the fit predicts it, the median miss is within 0.05 in log(CD)log(C_D), about 5%. These airfoil are used as a proxy for well-converged CFD runs and the most trustworthy labels.

Modeling

Model choice

For completeness, 20 models were run on the same dataset and their held-out test metrics were compared. These included standard surrogate model choices like Gaussian Process and Multilayer Perceptrons (MLP), as well as interpolation-based models like K-Nearest Neighbors and Support Vector regression:.

ModelReason
K-Nearest NeighborsPure interpolation
Support Vector Regression (SVR)Smooth kernel interpolator
Nymstrom Kernel Ridge Regression (KRR)Faster approximation of regression kernel
Gaussian ProcessStandard choice for engineering surrogates
Random Forest (RF) / Extra Trees (ET)Robust, very little tuning
HistGradBoostDoes well against tabular data
Light Gradient Boosting Machine (GBM)LightGBM that downweights outliers
[Residual] Multilayer Perceptron (MLP, ResMLP)Standard choice in airfoil surrogates
Average EnsembleAverages LightGBM, CatBoost, ResMLP

And sometimes there are models that are non-standard, but offer perks that other models do not. For instance, the Drag-polar hypernetwork forces physical constraints on the shape of the airfoils, while Fourier-feature MLPs handle stalls. Still other models (ex. Student-t heteroscedastic Neural Networks) suppress outliers to enhance the model.

ModelReason
Drag-polar hypernetwork (DPH)Forces physically plausible airfoil curves
Kolmogorov–Arnold network (KAN)Learns smooth 1D function per connection
Student-t heteroscedastic NNUnconverged points treated as outliers instead of being fitted
Fourier-feature MLPHelps NNs learn sharp features (ex. stall)
Thin-airfoil features + LightGBMAdds physics features to LightGB

Results

Decoupled Models (SVR)

Of each of the models, Support Vector Regression (SVR) with a Gaussian (RBF) kernel performed the best. After tuning the hyperparameters, the most accurate parameter combination was identified based on 3,509 held-out test points of 288 airfoil shapes never used during training or tuning. Since each SVR has one output, two SVR models are run side-by-side to predict CDC_Dand CLC_L: SVR #1 takes (AoA, shape parameters) and predicts CLC_L, while SVR #2 takes the same 9 inputs and predicts log(CD)log(C_D). For this reason, the γγ (smoothness), CC (fit tightness), and εε (noise tolerance) parameters will be different for each model.

γγCCεε
CDC_D15.80.0010.022
CLC_L10.80.00230.016

But does this make sense? No.

Physically, the lift (CLC_L) and drag (CDC_D) are not independent forces — they are perpendicular components of a single aerodynamic force. But in our model comparison, SVR provided the best prediction result, so it was used as the “best” model despite separating the physics into two uncoupled components. Since the models treat the parameters separately, they arrive at different optimized parameters.

If the airfoil’s CFD drag-vs-angle-of-attack or lift-versus-AoA curves varies smoothly from one angle to the next, the usable held-out test data decrease significantly, but the modeling accuracy rises:

CDC_D
MdAPE
CDC_D
MAE
CDC_D
R^2
CLC_L
MAE
CLC_L
R^2
SVR (tuned)0.42%0.00050.8310.00420.9994

If all test points are considered, the median absolute percentage error (MdAPE) still remains rather small.

CDC_D
MdAPE
CDC_D
MAE
CDC_D
R^2
CLC_L
MAE
CLC_L
R^2
SVR (tuned)3.03%0.0077-0.110.03750.962

Coupled Models (Parametric drag-polar hypernetwork)

The drag-polar hypernetwork couples aerodynamics with machine learning, inherently accounting for the relationship between lift and drag. The “drag polar” is an In aerospace engineering, a drag polar is a mathematical relationship that shows how an aircraft’s drag coefficient CDC_D changes as its lift coefficient CLC_L changes. It typically follows a parabolic curve like:

CD=CD0+kCL2C_D = C_{D0} + k C_L^2

But an aircraft’s drag polars are based on a family of curves that shift drastically based on conditions like Mach number and Reynold’s number. The machine learning aspect is handled by the hypernetwork — a neural network whose one job is to generate the weights for another neural network, also called the “target network”. Instead of training a static model, the hypernetwork receives a context vector as input and dynmically outputs a tailored NN for the exact situation.

To be clear, the shap network only reads the eight shape coefficients (not angle of attack) and outputs CD0C_{D0}, kk, k4k_4, and CLmC_{Lm} along with four lift-curve coefficients — each airfoil gets its own drag-polar determined by its shape. Since the only way α\alpha can change drag is by changing lift, AoA enters the model through the lift curve thereby ensuring the physics parameter coupling.

  • Cd₀, k and k₄ are produced through an exponential, so they’re
    always positive, and Cd ≥ Cd₀ > 0 always.

The parametric drag-polar hypernetwork reads in the airfoil’s shape and produces a lift curve CL(a)CL(a) and its drag polar. CDCD is computed from the predicted CLCL:

CD=CD0+k(CL−CLm)2+k4(CL−CLm)4,C_D = C_D0 + k(C_L − C_{Lm})² + k_4(C_L − C_{Lm})^4,

where CD0C_{D0} is the minimum drag coefficient, CLmC_{Lm} is the lift at minimum drag, kk is the quadratic drag-rise factor, and k4k_4 is the quartic drag-rise factor. A drag-polar plot is illustrated below in two scenarios. The first scenario (left) illustrates various components of the drag and lift coefficients, and their relationship to each other and additional derived quantity. In the adjacent (right) plot, a similar aerodynmic analysis is compared to the same airfoil within a windtunnel. Discrepancies between the analytic and empirical data are small until higher drag coefficients begin to illustrate a drop in lift during windtunnel tests.

(Left) The lift coefficient is plotted against drag [1], and (right) the aerodynamic analysis is compared against wind tunnel testing. [2]

If the airfoil’s CFD drag-vs-angle-of-attack or lift-versus-AoA curves varies smoothly from one angle to the next, the usable held-out test data decrease significantly, but the modeling accuracy rises (shown below for a Drag-Polar Hypernetwork (DPH):

CDC_D
MdAPE
CDC_D
MAE
CDC_D
R^2
CLC_L
MAE
CLC_L
R^2
DPH0.57%0.00040.9620.01260.9974

But if all test points are considered, the median absolute percentage error (MdAPE) still remains rather small.

CDC_D
MdAPE
CDC_D
MAE
CDC_D
R^2
CLC_L
MAE
CLC_L
R^2
DPH3.10%0.0075-0.0750.04370.960

Compariong the drag-polar hypernetwork to the decoupled SVR models, the hypernetwork achieves a success in predicting worst-case drag. Demonstrating lower mean CDC_D error and higher CDC_D R2R^2 error on each subset. On airfoils with smooth CLC_L– or CDC_D-versus-AoA curves, the hypernetwork also wins, achieving a higher R2R^2 score (0.962 vs 0.831), indicating its big drag misses are smaller than the SVR network. In short, the drag-polar model stops drag from drifting off in ways the SVR could not handle.

However, the SVR wins on typical drag error (0.42% vs. 0.57% on smooth data), but both error terms are still relatively smally. SVR also models lift better, with an indicated CLC_L error 3x lower than that of the DPH; in turn, this drives a weaker lift-over-drag (L/DL/D) and force-direction scores.

Next Steps

In the future, we can begin looking at how the curves inside the model are fit, like increasing curve flexibility (ex. implementing higher-order polynomals for CL(α)C_L(\alpha)). We could also implement a learned network branch, or even add a thin-airfoil term along with a learned correction. Judging by the performance of the DPH model, lift (CLC_L) is where the most work needs to be done.

Conclusion

In order to place a wing on an airplane, it needs to be tested in a windstream. Prior to the experiment, computationally expensive CFD simulations are performed to predict and optimize airfoil behavior. Before the model can be built, the airfoil must be defined by a set of parameters. In the end, we begin with a set of input parameters and after a lot of work, we end up with a set of performance metrics. At a high level, this is no different than the operation of a machine learning model.

References

  1. Guerrero, Joel & Maestro, Dario & Bottaro, Alessandro. (2012). Biomimetic spiroid winglets for lift and drag control. Comptes Rendus Mecanique. 340. 67-80. 10.1016/j.crme.2011.11.007.
  2. Boschetti, Pedro & Amerio, Andrea & Cárdenas, Elsa. (2009). Aerodynamic Performance as a Function of Local Twist in an Unmanned Airplane. 47th AIAA Aerospace Sciences Meeting including the New Horizons Forum and Aerospace Exposition. 10.2514/6.2009-1481.