Prediction of confined flow field around a circular cylinder and its force based on convolution neural network

In this paper, a large number of numerical simulations of the external confined flow field around a circular cylinder is conducted by using the open source library OpenLB. The boundary information of the flow field is defined by Euclidean distance function. Then, massive data, including the velocity field and the drag and lift coefficients of the cylinder, are obtained and used for model training. Subsequently, two convolutional neural network models are presented. The input ends of the two models are the boundary information of the flow field, and the output ends are the velocity field and the force on the cylinder respectively. Once the two models are established, they are used to predict the velocity and force respectively. The predicted results are in good agreement with the real values. It turns out that the convolution neural network models can be used to predict the flow field and force with complex boundaries, and it has the advantages of high accuracy and efficiency in practical engineering applications.


I. INTRODUCTION
Flow around a circular cylinder is a classical problem in fluid mechanics, which has many important engineering applications. Many research studies have been carried out regarding this problem in the past decades, such as computational fluid dynamics (CFD) method based on Navier-Stokes equation [1], Boltzmann equation [2], particle image velocimetry [3] . In recent years, with the wide application of computational fluid dynamics, a large number of data have been accumulated. On the other hand, with the accumulation of big data, machine learning models, especially deep learning algorithms, are developing rapidly, and have been successfully applied in many fields. Thus, it is feasible to apply deep learning to fluid dynamics [4][5][6][7][8]. This modeling paradigm of exploring physical mechanisms with deep learning models is called data-driven model [9,10]. As one of the most promising deep learning models, the convolutional neural network (CNN) has wide successful applications [11][12][13], especially in image classification [14], recognition [15] since it was first proposed by Lecun [16]. For the combination of CNN model and CFD method, some papers has been published recently [17][18][19].. Jin et al. [20] used CNN to establish the mapping relationship between the pressure fluctuations on the cylinder and the velocity field around the cylinder using the CFD dataset. The trained model is then tested over various Reynolds numbers. The predictions of this model agree well with the CFD results. Bhatnagar et al. [21] adopted the CNN to approximate the flow field around airfoil using the CFD data from Reynolds Averaged Navier-Stokes (RANS) flow solutions. A model based on convolutional neural networks (CNNs) is proposed for flow field predictions by Bhatnagar et al. [21]. The results show that it's possible to study the impact of the airfoil shape and operating conditions on the aerodynamic forces and the flow field in near-real time. Murata et al. [22] presented a nonlinear model, named decomposing CNN auto coder to extract the future of flow field around the circular cylinder. However, these works are the prediction of flow around a circular cylinder in an unbounded flow field. The existence of the external boundary will increase the complexity of the flow field. In order to investigate the bounded flow around the circular cylinder, we propose a deep convolution neural network model which is capable of predicting the flow field and force on the cylinder.
The structure of this article is as follows: Sec. II 2 VOLUME XX, 2021 illustrates the bounded flow around a circular cylinder calculated by CFD solver OpenLB. The target for identifying boundary information is realized by Euclidean distance function. Then, in Sec. III, the CNN model structure is introduced. Two CNN models, named as CNN-FORCE and CNN-FORCE， are proposed to predict the force of the cylinder and the velocity field around the cylinder, respectively. Section IV evaluates the general performance of the proposed models. Finally, a summary is provided in Sec. V.

II. CFD of BOUNDED FLOW AROUND CIRCULAR CYLINDER and BOUNDARY INFORMATION RECOGNITION
The bounded flow diagram is depicted in Fig.1. The length and the width are 2.2m and 0.411m, respectively. The radius r of the cylinder is 0.05m, and the position of the cylinder center is limited to the red region. The kinematic viscosity of the fluid is 0.001m 2 /s and the density is 1 kg/m 3 . The bounded flow is simulated by the open source code library OpenLB. The computational cases in this paper include 15 groups according to Re equals 10, 20, 30..., 150, respectively. Note that the flow Reynolds numbers are determined with a fixed cylinder diameter of 0.1m. In each group, the cylinder is randomly positioned 500 times, so, the total number of cases is 7500, which forms an extensive database to train the deep CNN model. Flow boundary shape is the input end of CNN, which is represented by Euclidean distance function. The Euclidean distance from each point to the cylinder boundary is defined as follows, where i=1, 2,…,m, j=1,2, …,n. m, n represents the dimension of the input data in the x, y direction, here are 223 and 44 in CFD, respectively. r represents the distance from the center of the bluff body to those points, г represents the geometric boundary of a bluff body. If the position of any point is in the inner or the boundary of the bluff body, then b=0. If the position of any point is outside the geometric boundary of the bluff body, then b=1.
Multi-dimensional input information including Reynolds number and the position of the cylinder relative to the boundary of the computational field. For the input end, different boundary types are represented by different numbers. For example, the velocity entry boundary is denot ed as number 3, the exit boundary is denoted as 4, the upper and lower boundary is denoted as 2, the entire boundary of the computational field and the inside of the cylinder are denoted as 0, and other positions of the computational field are defined as 1. These defined values constitute a matrix representing the unique geometric information, which is illustrated in Fig.2. As described above, the neural network can distinguish the various types of boundary and the cylindrical boundary at various Reynolds numbers.

FIGURE 2. The flow field boundary information is used as the inp ut end of CNN
In order to verify the accuracy of LBM numerical met hod in this complex flow, the stream velocity at t=30sis compared to NS solver in Figure 3, in which profile pos ition is located at two cylinder diameters behind the cyli nder, where Re =100. The two curves agree well, which shows that the accuracy of LBM method is pretty good.

A. THE STRUCTURE OF CONVOLUTIONAL NEURA L NETWORKS
CNN model can automatically learn and extract features from data and its generalization ability is significantly better than traditional methods. The network structure is mainly composed of input layer, convolution layer, pooling layer, full connection layer, and output layer. In this paper, two structures, named as CNN-VELOCITY and CNN-FORCE are designed for predicting the velocity field, drag coefficient, and lift coefficient, respectively.

1) CONVOLUTION LAYER, DECONVOLUTION LAYER AND ACTIVATION FUNCTION
In order to extract the different characteristics of computational field boundary, a multilayer convolution layer is introduced in this paper. In the convolution layer, the feature graph of the previous layer is convolved with the convolution kernel. The convolution kernel slides on the feature graph with a fixed step size, and the result of convolution forms the feature graph of the layer under the action of the nonlinear activation function ReLU of the layer. The formula of the convolution layer is, where  represents convolution kernel, c x is the input characteristic graph, ReLU is the nonlinear activation function and c y represents the output of the convolution layer. The convolution kernel may not be convolved at the boundary of the feature graph because it is not divisible. We add 0 artificially in the feature graph, which means we add a zero-padding layer in the network. To visualize the output velocity field information in CNN-VELOCITY model, we set up the deconvolution layer as shown in Fig. 4. The blue and green represent the input and output respectively. Deconvolution operation is similar to convolution. The deconvolution kernel is the transpose of the original convolution kernel. In this study, the deconvolution layer is used to convert the output data of the previous convolutional layer into a matrix of 223×44. The convolution and deconvolution processes are expressed as: where ConvNN(.) represents the mapping of data to eigenvectors. DeconvNN(.) represents the mapping of eigenvectors to output data. The velocity field information with the same dimension as the input information is obtained by deconvolution.

2) POOLING LAYER
The pooling layer is generally set after the volume accumulation layer, and the pooling operation can be carried out according to a certain rule, Such as average pooling and maximum pooling [23]. The average pooling operation is shown in Fig.5. The pooling layer can reduce dimension and highlight the characteristics of the data. Assuming pooling layer, then:

3) FULLY CONNECTED LAYER
The fully connected layer connects all the elements in front of the layer and converts the two-dimensional data output of the convolution layer into a one-dimensional vector, and is expressed as, x is the input data of the full connection layer, f w is the weight, and f b is the output data of the full connection layer. The full connection layer can integrate the local information of the convolution layer or pooling layer with the distinction of categories. In order to improve the performance of the convolutional neural network, ReLU is used as the excitation function for each neuron in the full connection layer.

4) DROPOUT LAYER
In order to improve the over-fitting phenomenon caused by the training of relatively small data sets by a complex feedforward network, this study introduced dropout layer [24]. The formula of the Dropout layer is In the above equations, the Bernoulli function is to generate 4 VOLUME XX, 2021 l y is the input data of this layer. l y is to filter out the input data of some neurons.
Through the dropout layer, the sparse matrix is established by making a certain neuron stop working with probability p. The updating of weights is no longer dependent on the joint action of hidden nodes with fixed relationships, which prevents some features from being effective only under other specific features, and forces the network to learn more robust features.

1) CNN-FORCE MODEL
The cylinder is subjected to drag and lift force in the flow field, drag coefficient () It should be noticed that due to the fluctuation the lift coefficient and drag coefficient mentioned below in this paper, are root mean square values. The CNN-FORCE model takes the boundary information of the flow around the circular cylinder as the input data and maps this data to the drag or lift coefficient by CNN, as shown in Fig.6. The internal parameters of the CNN-FORCE model are displayed in Table 1. After continuous training with a large number of datasets ranging from 10 to 150 Reynolds Numbers, the model of drag and lift coefficient exerted on the cylinder for predicting different positions and Reynolds Numbers is finally obtained.

2) CNN-VELOCITY MODEL
Compared with the CNN-FORCE model, we need a more complex neural network structure to capture the potential features in the velocity field data to establish the mapping relationship between the boundary information of the flow around the circular cylinder and the velocity field. In this paper, the deconvolution neural network is imported to predict the velocity field information. The network structure of the CNN-VELOCITY model is shown in Fig. 7and the internal parameters are displayed in Table 2.
The data set with Reynolds number information and boundary information is the input end of the neural network. After a large number of samples training and determining the network layer parameters, we obtain the velocity field model of flow around a circular cylinder at various positions and Reynolds numbers.

3) LOSS FUNCTION
The goal of training a convolutional neural network is to minimize the loss function. MSE is adopted as the loss function in both CNN-FORCE and CNN-VELOCITY models, and expressed as,  Table 3. This study import a deep learning library-Keras into Tensorflow, which is a widely used machine learning platform to train CNN-FORCE and CNN-VELOCITY. Fig.  8 shows the loss curve during the training process.
Due to the complex network structure of the CNN-VELOCITY model with a large number of network nodes and a large amount of data, the decrease speed of the loss curve is relatively slow. With the increase of epoch, loss gradually became stable and the training ended.

A. CNN-FORCE RESULTS
A data set including 15 groups, Re=10, 20, 30, …, 150, each group with 500 randomly distributed positions, is used to train the neural network and predict the flow around circular cylinder cases with Re=15, 45, 75, 105, 135 at random position. Fig.9 shows the mean MSE curves of the drag coefficient and lift coefficient. The averaged MSE value keeps within 0.05, indicating high accuracy. Through the training of the neural network, the force coefficients exerted on the cylinder with different Reynolds Numbers can be predicted accurately.   Re= 15,45,75,105,135 predicted by the CNN-FORCE model. With Reynolds number increasing, the difference between the predicted value and true value increases slightly. However, most values of correlation coefficient R remain above 0.9, indicating a high accuracy in our research. The prediction results show that the CNN-FORCE model can capture the internal relationship between the force coefficient exerted on the cylinder and the input information. Due to the random distribution of the size and position of the cylinder, the position of the cylinder makes the drag coefficient and lift coefficient fluctuate greatly at the same Reynolds number. With the increase of Reynolds number, the fluctuation amplitude of drag coefficient and lift coefficient decreases gradually, which is in accordance with other numerical results [25].

B. CNN-VELOCITY MODEL PREDICTION RESULTS
The velocity magnitude at Re=15, 45, 75, 105, 135 are predicted by the CNN-VELOCITY model, the results are shown in Fig. 11. In order to show the prediction accuracy of the flow field near the cylinder, the flow field is limited to a given range. The predicted value is in good agreement with the corresponding CFD result as shown in Fig. 12 Fig. 13 shows the predicted one fits their CFD counterpart very well. VOLUME XX, 2021 11

C. COMPARISON OF COMPUTING RESOURCES
Compared with the CFD method, we found that the data-driven models have great advantages in computational efficiency. Once the model is trained, the position of the cylinder and the Reynolds number can be randomly specified in the forecast stage. The CNN-FORCE and CNN-VELOCITY models can quickly predict the drag coefficients, lift coefficients and velocity field around a circular cylinder at a random location with high accuracy. The time required by OpenLB and CNN model to predict per case under the same computer resources is listed in Table 4. It can be seen that the data-driven model has a distinct advantage over the CFD approach. In this paper, the CFD method combined with data-driven modeling is used to predict the flow and force around a cylinder with an external confined boundary. Firstly, a large number of cases are calculated by OpenLB, and an extensive database is established for deep learning modeling. Due to different data structures, two CNN models are designed to predict the force on a cylinder and the velocity amplitude around a cylinder. Once the models are trained, they are capable of predicting the velocity and the fluid force at other positions of the cylinder at different Reynolds numbers. The results indicate that the deep learning method based on convolution neural network has the advantages of high prediction accuracy and efficiency. It should be noted that the deep learning model needs a lot of data training. In this paper, 7500 cases are calculated to obtain big data for training. In order to save the calculation time, the selected Reynolds number of the flow around the cylinder is low. But considering the external confined boundary, the richness of the flow field is increased to a certain extent.