# Fast Prediction of Flow Field around Airfoils Based on Deep Convolutional Neural Network
## 2 Methods
### Numerical Method and Data Preparation  
#### 2.3.1 CFD Validation  
To prepare the CFD datasets in this work, we use the open source software OpenFOAM for the solution of RANS equations. Before the buildup of the dataset, the CFD numerical simulation method to obtain the accurate flow field data will be validated by the calculation of steady flow around NACA0012 airfoil. The 2D unstructured mesh with the boundary layers near the airfoil is generated via gmsh from airfoil profile, where the used gmsh is a python-based application program interface (API). Considering the influence of the far-field boundary on the flow field around the airfoil and computational cost, the entire simulation domain is set to 40 \(c\)\(\times\) 40 \(c\), where \(c\) is the chord length of airfoil. Figure 5 depicts the schematic diagram of the calculation domain and mesh. The number of grids is approximately \(5\times 10^{4}\).  
The Spalart-Allmaras (SA) turbulence model is selected to solve the RANS equations using OpenFOAM. The operating conditions of the validation case are as follows: the Mach number (Mach) is 0.15, Reynolds number is 6 \(\times\) 10\({}^{6}\), AOA is 10\({}^{\circ}\). Simulation results of the validation case are also compared with data from the numerical results of CFL3D (Computational Fluids Laboratory-3D) User's Manual [47] and wind tunnel experiment [48] in terms of lift coefficient \(C_{l}\), drag coefficient \(C_{d}\) and pressure coefficient \(C_{p}\), which are defined as  
\[C_{l}=\frac{2f_{l}}{\rho UL_{\infty}^{2}c},\ C_{d}=\frac{2f_{d}}{\rho UL_{ \infty}^{2}c} \tag{20}\]  
\[C_{p}=\frac{p-p_{\infty}}{1/2\rho UL_{\infty}^{2}} \tag{21}\]  
where \(f_{l}\) is the lift force perpendicular to the direction of incoming flow, and \(f_{d}\) is the drag force of the same direction of the incoming flow, \(p\) is the static pressure at the point where pressure coefficient is being evaluated; \(p_{\infty}\) is the static pressure in the freestream remote from any disturbance; \(\rho\) is the fluid density; and \(U_{\infty}\) is the inlet velocity.  
Table 2 shows \(C_{l}\) and \(C_{d}\) from the simulation results of OpenFOAM, in comparison with CFL3D and wind tunnel experiment data. The relative error is calculated by taking the experimental data as the reference value. Admittedly, relative errors by simulation on the square grid are larger than CFL3D, especially in terms of drag coefficient \(C_{d}\). Distribution of surface pressure coefficient \(C_{p}\) is given in Figure 6a, along both sides of the airfoil. The simulation results from OpenFOAM agree reasonably with the experiment results, with largest discrepancy takes place at the upper of leading edge. Moreover, the variations of \(C_{l}\) and \(C_{d}\) are shown in Figure 6b. When the grid number exceeds 5 \(\times\) 10\({}^{4}\), the sensitivity of  
Figure 5: Schematic diagram of the calculation domain and mesh used in the validation case.  
lift and drag coefficients to the grid number is rather low. Moreover, with the grid number of \(5\times 10^{4}\) under the validation condition, the calculated \(C_{l}\) and \(C_{d}\) are 1.1283 and 0.0129, respectively. Slight deviations are achieved compared with the experimental values of 1.0809 and 0.0117. Therefore, the grid-scale of about 5 \(\times 10^{4}\) is selected for subsequent calculations. As the focus of this work is on the prediction and training behavior of the proposed CNN-DCNN model, rather than accuracy of the CFD method, we assume that results from the square grid with a size of 40 \(c\times\) 40 \(c\) are acceptable for further training and testing of the CNN-DCNN model. Additionally, the flow still has laminar to turbulent transition at Reynolds number of millions of orders of magnitude [49]. Nevertheless, it should be emphasized that the final collected flow field data is under steady flow status. At this time, the flow has transformed to a fully turbulent status.