Geometry Representation Effectiveness in Improving Airfoil Aerodynamic Coefficient Prediction with Convolutional Neural Network

— Many applications use symmetric or asymmetric airfoils, such as aircraft design, wind turbines, and heat transfer. Each airfoil has different aerodynamic coefficients. Obtaining the aerodynamic coefficients is a must to optimize the airfoil design. Engineers use various methods to get the airfoil aerodynamic coefficients. A prediction method is an approximation approach that effectively reduces time and cost. This article uses convolutional neural networks (CNN) to get approximation values of those coefficients. In CNN, we collect 8920 aerodynamic coefficients for 223 NACA 4 as labels in datasets by using XFOIL at (cid:1) (cid:2) (cid:3) (cid:4) and (cid:5) (cid:6) (cid:3) (cid:7)(cid:4)(cid:4)(cid:4)(cid:4)(cid:4) with varying angles of attacks starting (cid:8)(cid:9)(cid:4) (cid:10) to (cid:9)(cid:4) (cid:10) with increment of (cid:11) (cid:10) . The simulation results are compared to the experiment using E387 airfoil for validation. Then, airfoil geometries as part of input datasets were transformed into Grayscale and RGB images using the signed distance function (SDF) and mesh algorithm. Each airfoil representation was trained using an 80% dataset and tested using a 20% dataset with Adam as an optimizer to generate each prediction model using modified LeNet-5. We use three different layer depths in modified LeNet-5 to obtain the optimal layer number. There is no remarkable improvement when varying the depth layers, so four layers are used instead. Simulation results show that using an SDF with Fast Marching Method on CNN predicts the most effective for the airfoil’s lift, drag, and pitch moment coefficient with varying angles of attack simultaneously. One can extend the method by using SDF to recognize different flow conditions.


I. INTRODUCTION
The airfoil design continues to be an exciting and practical design problem for engineering.Many difficulties in airfoil design involve the generation of lift, drag, and moment by airfoil sections [1].Many airfoils have interesting aerodynamic behaviors that could impact flight safety and performance.Therefore, Obtaining the aerodynamic coefficients is a must [2].These aerodynamic coefficients have received much attention in experiments through wind tunnel tests and numerical studies.
Wind tunnel testing can deliver aerodynamic coefficient results.However, it could take a long time and is more expensive to study airfoil aerodynamics only [3].Due to recent technology in numerical computation, engineers use various methods to compute aerodynamic coefficients as the first step in airfoil design [4]; then, wind tunnel testing can validate the result of the aerodynamic coefficient.
He et al. [4] use a numerical approach for airfoil design.Another strategy is using Particle Swarm Optimization (PSO) to produce an optimal airfoil design [5].A spotted hyena optimizer, a metaheuristic approach, is used to optimize airfoil design by minimizing the drag force [6].The metaheuristic approach belongs to the approximation method, so obtaining an optimal global solution is not guaranteed.Besides that, the metaheuristic has a dilemma in balancing exploration and exploitation.Using data-driven can improve the metaheuristic approach for optimization to solve that situation [7].
Nowadays, data size is growing unprecedentedly [8]- [10], so airfoil design and analysis based on data-driven is preferable [11]- [14]; moreover, the rise of computer technology and Artificial Intelligence (AI) has guided the reliable evolution of the data-driven model.Yonekura et al. [15] dan Thuerey et al. [16] utilize the Autoencoder method to explore airfoil design.Sekar et al. [17] use the inverse technique to generate airfoil geometry data based on pressure distribution around the airfoil surface using a Convolutional Neural Network (CNN).
Multiple studies have been applied to predict the aerodynamic coefficient of the airfoil using CNN.This method is realized as deep learning and utilizes convolution segments to gather specific patterns from pictures and use them for training and validation.Zhang et al. [18] approximate the lift force coefficient with CNN using an airfoil geometry-image as input to the trained model.Conversely, Chen et al. [19] use CNN to get the lift, drag, and moment predictions.Hui et al. [20] utilize CNN to predict the pressure distribution around the airfoil surface.All previous studies need airfoil geometry representations as input in CNN.
There are several methods to generate airfoil geometry representations.Many airfoil geometry representation methods use various types of aspects.The grayscale image's outline and solid color represent the airfoil geometry [18], [19].The grayscale image only has one channel, which has less pixel information and affects image recognition.
We also use Unstructured Mesh (UM) as an airfoil geometry representation based on a meshing algorithm [21] to enrich the pixel information on the grayscale image.However, UM image algorithm randomly creates patterns, as shown in Fig. 2b, making it challenging to recognize image features.To overcome the shortcomings of Grayscale and UM image, we propose the enhanced Signed Distance Function (SDF) method [20], [22] through the Fast Marching Method (FMM).SDF+FMM uses three channels to enrich the pixel information.In addition, SDF+FMM produces more consistent patterns than UM with faster performance and improves aerodynamic coefficient prediction.

II. MATERIAL AND METHOD
In general, the steps taken in building a predictive model of the aerodynamic coefficient of the airfoil, as illustrated in Fig. 1, include airfoil data processing, data selection, and making the trained model.

A. Airfoil Data Processing
The first step in processing airfoil data in building a predictive model is obtaining the airfoil's shape or geometry.The airfoil shape consists of coordinates along the top and bottom surfaces.The coordinates are acquired from UIUC Airfoil Data Site and converted into a digital image, so it is easy to implement the architecture with CNN [23].Airfoil images can be created in the form of a single channel [18], [19], [24] [20], [25] using a Signed Distance Field [26].Airfoil geometry representation with Grayscale (Fig. 2a) is our base representation and is easy to generate.It contains only black and white pixels.We also use UM (Fig. 2b) to enrich the pixel information from the Grayscale.Then for comparison, we propose SDF+FMM (Fig. 2c) for airfoil geometry representation based on Algorithm 1.The SDF+FMM can give more complex features than Grayscale but has a more precise pattern than UM.The images and the airfoil aerodynamic coefficients are stored in the database.
We use XFOIL [27] to obtain the airfoil aerodynamic coefficients.XFOIL can predict airfoil aerodynamics fastly for a low Reynold number [28]- [30] using the potential flow and integral boundary layer method.For flow conditions, we keep 0 and 500000 to get aerodynamic coefficients , , with varying angles of attack, starting 20 until 20 .Finally, we keep the airfoil surface roughness configuration !" 5.
To validate the computation results using XFOIL, we compare XFOIL and the experiment [31] using the same E387 airfoil.It turns out that the results between them are acceptable based on Fig. 3.

B. CNN Architecture
CNN has been widely used in image recognition and was first proposed for gradient-based learning in document recognition [32].CNN is an ideal architecture for image data implementation [33].CNN uses images with either one channel or three channels as input data.Then the data is transferred to the convolution, pooling, and fully connected layers.
As illustrated in Fig. 4, we use LeNet-5 [34] as CNN architecture with some adjustments.The airfoil image has a size of 128 & 128 as the initial input data.The twodimensional convolutional (Conv) layer is the main component of CNN.The Conv layer 1 has a kernel size of 15 & 15 as in Fig. 4b or Fig. 4c, with three channels as input and 1 step size in each direction.We use a batch norm [35], [36] to make it faster and more stable during training.The activation function is a rectified linear unit (ReLU) because it gives better results [37]- [39].

C. Model Training
The model training includes two steps: forward and backward calculation.The first step is to extract the airfoil image patterns using the convolution and pooling procedures, feed the components into the fully connected segment, and gets aerodynamic coefficient prediction results through the output layer.Prediction errors are the differences between approximation and actual values.In the last step, the algorithms return these errors and update the network parameters.The numbers of convolutional, pooling, and fully connected layers are flexible depending on the input images.
The forward and backward calculation steps are repeated if the stop condition is unmet.The maximum number of epochs determines the end condition of CNN training.The training procedure of the CNN architecture is shown in Fig. 5.Because the SDF+FMM can perform very well during training, we combine it with multiple architectures, as shown in Fig. 4.There is no significant improvement when varying the convolution layers while validating the datasets.However, all architectures show decreasing MSE during training, as shown in Fig. 7, so we choose the four layers instead (Aerofoil4BN2FC).Then, the trained model predicts the aerodynamic coefficients for the unseen airfoil during training.For this purpose, the NACA 2024 has the actual coefficient of lift, drag, and moment from CFD and then compares them to the prediction results.From Fig. 8a, the image with SDF+FMM has the best prediction result.The grayscale image has a better prediction result than the unstructured mesh.The unstructured mesh cannot perform well at less than zero angles of attack.For the drag coefficient case in Fig. 8b, the unstructured mesh performs worst for all conditions.The grayscale image performs well, but the SDF+FMM image still has the best prediction results.It also happens on the moment coefficient, as shown in Fig. 8c, and the SDF+FMM image can follow the actual data very well.On the other hand, the grayscale image performs slightly well, and the unstructured mesh still cannot obtain good prediction results.
The SDF+FMM image can perform very well for aerodynamic coefficient.This performance can happen because the trained model using SDF+FMM as airfoil geometry representation has the smallest MSE during validation.In this article, Root Mean Squared Error (RMSE) and R-squared (9 : ) are metrics to measure the network's performance.Based on Table II, it looks evident that airfoil geometry representation using our proposed SDF+FMM has the best metric results compared to the original SDF.In terms of the 9 : metric, as illustrated in Fig. 9, the grayscale image and SDF+FMM have a high score in predicting , but the UM has slightly below that.The UM is still good for predicting , because it can follow the curve pattern in Fig. 8a, but it has a high value of RMSE, and it cannot perform very well for angles less than zero.Although all geometry representations can follow the curve pattern for predicting , they have good 9 : globally, but only SDF+FMM can fit close enough to actual as shown Fig. 8b.The Grayscale has a lower RMSE than the UM.The Grayscale and UM have higher RMSE than the SDF+FMM for predicting .Based on this study, we use 8K datasets, and the Aerofoil4BN2FC architecture type was chosen to determine which image type is better Grayscale, UM, or SDF+FMM.Fig. 6 shows that SDF+FMM images give the best results during the training process at 1000 epochs because it produces more consistent patterns and more complex pixel information.We use Batch Normalization to speed up the training process.The training process and the metric results also show that the image we propose in SDF+FMM has the smallest RMSE value of 0.0245 for , 0.0036 for , and 0.0032 for , than the original SDF.The same applies to the 9 : value of 99.9% for , 99.5% for , and 99.46% for , in predicting the airfoil aerodynamic coefficient according to Table II.This study also found variations in the depth of the CNN layer on SDF+FMM images have a similar performance during training, so the architecture chosen is Aerofoil4BN2FC.
The SDF+FMM image effectively improves training performance and predicts aerodynamic coefficients very well.SDF+FMM images can be applied to airfoils (2D wings) on different flow conditions for further research.But still, this image needs improvement for predictions of the aerodynamic coefficient on 3D wings.However, this limitation opens the opportunity for further research on predicting aerodynamic coefficients using CNN for airfoils and 3D wings with different flow conditions.

Fig. 4
Fig. 4 LeNet-5 architecture with modification After the ReLU operation in Fig. 4c, we set 20 channels with a resolution of 58 & 58 after the MaxPool procedure based on Eq. (1 in the article [40] for the Conv layer 2. We can get output resolution ' with ( N as input, )* as padding, + as kernel, and ,as stride (step) size o 0 ( 1 2)* + ,-2 1 1 (1) We apply the same procedure for the other Conv layers.The last Conv layer will have 60 & 4 & 4 for the first fully connected (FC) layer.The rest of the output resolutions are shown in Tabel.The output layer of this architecture is linear regression.It uses MSE (Mean Square Error) as a loss

Fig. 5
Fig.5The proposed procedure for model training In this paper, the training algorithm uses adaptive moment estimation (Adam)[41],[42].It minimizes the loss criterion using the minibatch.An epoch is the complete progress of the instruction rules over the whole training set.III.RESULTS AND DISCUSSIONWe collect 223 NACA 4 airfoils and have 8920 in total datasets.The datasets include airfoil images as input and aerodynamic coefficients as labels and are split into 80% for training and 20% for validation.Both of these are applied for data transformation.All airfoil images are resized into 128 & 128, and then the pictures and airfoil coefficients are standardized using a mean μ of 0.5 and a standard deviation σ of 0.5.

Fig. 6
Fig. 6 shows the training history for various airfoil geometry representations using the same Aerofoil4BN2FC architecture as shown in Fig. 4c.The MSE curves for the training datasets drop faster.On the other hand, the MSE curves for validation vary.The validation loss for unstructured mesh does not fall very well and continues flat with the highest MSE loss than others.The grayscale images have lower MSE for validation loss than the unstructured mesh and continue flat for the rest of the epochs.In this training, airfoil images using SDF have the lowest MSE and keep minimizing the error.

Fig. 6
Fig. 6 Training history for various airfoil geometry representations

Fig. 7
Fig. 7 Training history for layer depth variation on SDF datasets

Fig. 8
Fig. 8 Aerodynamic coefficient prediction from various geometry

Fig. 9
Fig. 9 The 9 : metric for various prediction result

TABLE I THE
OUTPUT RESOLUTIONS FROM THE LAST CONV LAYER INTO A FULLY

TABLE II THE
METRIC RESULTS FROM VARIOUS GEOMETRY REPRESENTATIONS