# Fast Prediction of Flow Field around Airfoils Based on Deep Convolutional Neural Network
## 2 Methods
### Design of Neural Network Model
#### 2.1.2 Design of the CNN-DCNN Prediction Model  
The CNN-DCNN model for predicting the flow field mentioned above is the core of the CNN-DCNN framework, whose specific architecture is displayed in Figure 2. Mathematically speaking, the model works as a nonlinear function that maps the low-dimensional features extracted by the CNN encoder to the high dimensional output (e.g., the 2D flow field in this work). Therefore, we first need to extract abundant features among the input variables (flow conditions and airfoil geometries) and assign them appropriate weights, then the input variables can be well mapped to the output flow field. As matter of fact, the 2D flow field data is treated as 2D images in the mapping process, so the mathematical tools developed for CNN and DCNN in computer vision industry could be utilized. The CNN-DCNN model is composed of a series of six encoder (CNN) layers, six decoder (DCNN) layers and a one-by-one convolutional layer. The last layer is introduced as a nonlinear activation of the previous layer, to enhance the network nonlinear expression. In this sense, the prediction model employs CNN to extract information on airfoil shape and operating parameters from the input data, encode them to feature properties, and then utilizes DCNN to decode these features and predict the flow field. In general, the learning process of the CNN-DCNN based prediction model could be abstracted as:  
\[F=encode(S,\ Re),\ \left(\hat{P},\ \hat{U}\right)=decode(F) \tag{3}\]  
where \(S\) is the SDF representation of the parameterized airfoil geometry, \(F\) is the features mined from the input \((S,\ Re)\) using CNN encoder, such as the information of airfoil profile and the flow conditions (i.e., Reynolds number). Furthermore, since the airfoil profile is the actual coordinates after rotational transformation, \(F\) also includes the information on the angle of attack (AOA). \(\hat{P}\), \(\hat{U}\) represent the pressure and velocity field predicted from the features \(F\) by DCNN decoder. In essence, the CNN encoder compresses the high-dimensional input states to the feature maps, finding out the reduced dimensional representation of the input matrices, while DCNN optimally removes the channel-wise and pixel-wise correlations before these feature maps fed into each layer, and projects these feature maps to output matrices. Details of the training process for filter parameters of CNN and DCNN are given in Section 2.2. Model parameters of all the sub-layers are given in Table 1, where \(n_{w}\times n_{h}\times n_{c}\) is the size of the filter (\(w\): width, \(h\): height, \(c\): channel), \(n_{F}\) is the number of the filters (\(F:filter\)), where following the descriptive convention of convolutional networks, we refer to a 3D cube stacked with multiple 2D convolutional kernels as a filter in this work. \(s\) is the stride of the convolution, and \(N_{w}\times N_{h}\times d\) is the size of the output matrix of current layer. Specifically, the number of filters \(n_{F}\) is decided by the index of the CNN layer by \(2^{3+l}\). To obtain sufficient depth and enhance the nonlinear mapping capability of the network,  
Figure 2: Specific architecture of flow field prediction network. “Conv” denotes convolutional layer, “Deconv” indicates deconvolutional layer, “Conv_one-by-one” refers to the one-by-one convolutional layer. activation function of \"Exponential Linear Unit (ELU)\" is applied on each hidden layer. The form of ELU activation function is given as  
\[g(x)=\left\{ \begin{array}{ll}x,&x\geq 0\\ \mu(e^{x}-1),&x<0\end{array} \right. \tag{4}\]  
where \(\mu\) is the default coefficient typically set to unity. Behavior of Equation (4) makes sure that the output of ELU activation function is one-sided saturated and obeys a distribution with zero mean, which speeds up the convergence of training process. Introduction of ELU also avoids the gradient vanishing and exploding in deep neural networks by applying identity function for all nonnegative arguments.