Flow field reconstruction and shock train leading edge position detection of scramjet isolation section based on a small amount of CFD data

Scramjet is the main power device of hypersonic vehicles. With the gradual expansion of wide velocity domain, shock wave/shock wave and shock wave/boundary layer are the main phenomena in scramjet isolator. When the leading edge of the shock train is pushed out from the inlet of the isolator, the engine will not start. Therefore, it is very important to detect the flow field structure in the isolator and the leading edge position of the shock train. The traditional shock train detection methods have low detection accuracy and slow detection speed. This paper describes a method based on deep learning to reconstruct the flow field in the isolator and detect the leading edge of the shock train. Under various back pressure conditions, the flow field images of computational fluid dynamics (CFD) data and the corresponding upper and lower wall pressure data were obtained, and a data set corresponding to pressure and flow field was constructed. By constructing and training convolutional neural networks, a mapping model with pressure information as input and flow field image as output is obtained, and then the leading edge position of shock train is detected on the output flow field image. The experimental results show that the average structure similarity (SSIM) between the reconstructed flow field image and the CFD flow field image is 0.902, the average peak signal-to-noise ratio (PSNR) is 25.289, the average correlation coefficient (CORR) is 0.956, and the root mean square error of shock train leading edge detection is 3.28 mm. Moreover, if the total pressure input is appropriately reduced, the accuracy of flow field reconstruction does not decline significantly, which means that the model has a certain robustness. Finally, in order to improve the detection accuracy of the leading edge position, we fine tuned the model and obtained another detection method, which reduced the root mean square error of the detection results to 1.87 mm.

ignition delay and mixing rate [3,4], the influence of backward-facing step on supersonic multi fuel jet mixing efficiency [5], and the effect of multi hydrogen jet on fuel mixing efficiency and flow structure [6]. However, isolator is an important part of the scramjet, which forms an aerodynamic thermal buffer between the inlet and the combustor [7]. The back pressure can interact with the boundary layer in the isolator to produce complex shock waves and expansion structures, resulting in shock train [8][9][10]. The shock train sequence generated in the isolator depends on the inlet conditions. However, the structure and flow characteristics of the shock train are often complex, especially when the back pressure changes, the position of the shock train will also change. With the increase of back pressure, the length of shock train will increase. If the shock train is too long, the scramjet inlet will not start [11,12]. Therefore, it is of great significance to study the unstart conditions of the scramjet inlet [13,14]. For example, in the X-51A flight test, both missions encountered the problem that they could not be started [15,16]. In recent years, the main concern has been to control the leading edge of the shock train. However, in order to effectively control the unstart phenomenon, it is necessary to quickly and accurately detect the position of the leading edge of the shock train to achieve active control. At present, the detection methods for the leading edge position of shock train [17] mainly include the pressure rise method, pressure ratio method, static pressure sum method, back pressure method, standard deviation or spectrum analysis method. However, each method has its own shortcomings. For example, considering the influence of hypersonic inlet, the conditions around the isolator are very complex, which makes it difficult to apply the back pressure method and the static pressure sum method in practical engineering scenarios. The spectral analysis method and the standard deviation method have a large amount of calculation, and the latter has low accuracy. The pressure rise method and the pressure ratio method are more practical, but their accuracy needs to be further improved [18,19].
Numerical simulation provides important help for the design of scramjet. Large commercial CFD software FLUENT has been applied to many engineering problems [20][21][22][23][24][25][26]. However, the computational efficiency of current numerical simulation methods hinders large-scale calculations. Therefore, in order to improve the speed of numerical simulation software, methods based on artificial intelligence have become an effective means of optimization design. In recent years, deep learning technology has made great progress in the fields of image recognition [27][28][29][30], speech recognition [31], automatic driving [32] and natural language processing [33]. Researchers are gradually applying artificial intelligence technology to the traditional field of computational fluid dynamics (CFD). For example, Li et al. [34] trained an artificial neural network (ANN) to predict the cooling efficiency of the outer surface of turbine blades. Guo et al. [35] successfully used convolutional neural network (CNN) to predict the stable flow field around the bluff body, greatly reducing the calculation cost. Ling et al. [36] used deep neural network to simulate Reynolds stress anisotropy tensor in Reynolds averaged Navier Stokes simulation, which greatly improved the simulation accuracy. Lee et al. [37] used the generative adversarial network (GAN) to predict the unsteady laminar vortex shedding behind the cylinder, and found that this enhanced the learning of the solution of the lift equation. Liu et al. [38] introduced deep learning into CFD data compression and proposed a new in-situ compression method based on GAN. Compared with the existing CFD data compression methods, this method has significant advantages in compression time, and the compression ratio can be adjusted according to the acceptable reconstruction effect. Liu et al. [39] used CNN to detect the position of shock wave string in the flow field, which can achieve very short detection time. Kong et al. [40] used the ground test data of scramjet isolator to reconstruct the flow field and detect the shock train position based on CNN, and achieved high accuracy. Under the leadership of academician Le Jialing, Chen et al. [41] of China Aerodynamics Research and Development Center took the lead in carrying out the research on intelligent reconstruction of scramjet combustion flow field in China, independently designed a multi-branch fusion convolutional neural network (MBFCNN), established the mapping relationship between the upper and lower wall pressure data of the combustor and the flow field image data of the combustor, and reconstructed the turbulent combustion field with high accuracy. Guo et al. [42] carried out wind tunnel tests under the leadership of academician Le Jialing, and independently designed a multi-path asymmetric residual network (MARN) for super-resolution reconstruction of combustor flow field. This method provides the possibility to develop a lightweight super-resolution model of supersonic combustor flow field; it shows great potential in revealing the physical flow of fuel and air mixture and provides accurate prediction of the spontaneous combustion time. The above research shows that deep learning has great potential in CFD and experimental fluid dynamics.
In this paper, the rapid reconstruction of the flow field in the scramjet isolator based on deep learning and the high-precision detection of the leading edge of the shock train are studied. The main structure of the article is as follows: in Section 2, the data obtained are described in detail; in Section 3, the CNN model is introduced, and some basic concepts in deep learning are briefly summarized; in Section 4, the training results and reconstruction accuracy of the model are mainly explained; in Section 5, the detection results of the leading edge of the shock train based on the reconstructed flow field and the detection results after fine-tuning the model are mainly explained; the final section draws a conclusion.

Calculation model and condition parameters
CFD method was used to calculate the wall pressure and flow field of scramjet isolator. The commercial CFD software FLUENT is used for numerical simulation. The calculation reference [40] is the section model of the isolator of the ground direct connected wind tunnel of Harbin Institute of Technology. The research object is shown in Fig. 1. T0-T20 in Fig. 1 indicates the installation position of pressure measuring points.
When using FLUENT software for numerical simulation, the model size is 25.4 mm (height) × 304.8 mm long. The ideal gas is used for calculation, the Sutherland model is used for viscosity, and the Reynolds number is about 190,000. Relevant parameters indicate that the input Mach number is 2; the static pressure is 19600 Pa and the total temperature is 300 K. Select five back pressure conditions to obtain multiple sets of data, as shown in Table 1. The back pressure can be obtained from Eq. (1).
Where A is the reference value of back pressure, B is the amplitude, f is the oscillation frequency, t is the time, and P a is the calculated back pressure. In the flow, we (1) P a = A + Bsin(2π ft) fix the frequency and amplitude, and the back pressure changes sinusoidally. The frequency is 100 Hz, and each cycle is 10 ms. Five cycles are calculated, and a data point is calculated every 0.5 ms.

Data preprocessing
Five hundred groups of data are obtained by using FLUENT. Each group of data is composed of a pressure sequence and the flow field image at its corresponding time. The flow field image obtained by numerical calculation is cut as shown in Fig. 2. In order to reduce the calculation time and parameters required for network training, the resolution of the flow field image is reduced to 35 × 300 pixels. In order to accelerate the convergence of the network, the image pixel value is normalized from 0-255 to 0-1. Finally, the 500 data are divided into training set and test set according to the ratio of 7:3, that is, 350 groups of data in the training set and 150 groups of data in the test set. In the process of model training, the training set participates in the parameter update of the model, while the test set does not participate in the parameter update of the model, and is only used as the test part of the generalization performance of the model.

Up-sampling
The flow field reconstruction model based on CNN takes multiple pressure measurements as input and flow field images as output. There is a big difference between input and output data. Therefore, in order to establish the mapping relationship between pressure data and flow field images, it is necessary to use up sampling method to quickly expand the size of input pressure data. In the field of computer vision, there are three commonly used up sampling methods: interpolation, deconvolution and de pooling. In this paper, we use the deconvolution of learnable parameters to up sample the pressure information.

Convolution and activation
The convolution operation is to slide the convolution kernel matrix onto the input image matrix with a specific step size, as shown in Fig. 3. Before each sliding, the product of the weight parameters in the convolution kernel matrix and the parameters in the corresponding input image matrix is calculated. The sum of these products of each sliding position forms the output characteristic matrix.
There are many activation functions in deep learning, such as Tanh function, Sigmoid function, Softmax function and ReLU function. This paper uses the ReLU activation function, which is usually applied after convolution. The introduction of the activation function increases the nonlinear characteristics of the network and enhances the fitting ability of the model.

Pooling
Pooling is equivalent to down sampling the image. The overall statistical characteristics of the adjacent outputs of a location are used to replace the network outputs of that location. Pooling effectively reduces the amount of parameters and network complexity. The two commonly used pooling methods are maximum pool downsampling and average pool downsampling. The method used in this study is the maximum pool downsampling method, and its process is shown in Fig. 4.

Fully connected layer
The input of the full connection layer is a one-dimensional array. Therefore, the input multidimensional array must be processed before being passed to the full connection layer. Connect each node of the fully connected layer with all nodes of the previous layer to synthesize all previously extracted features. Because of its fully connected nature, this layer usually has the most parameters. The structure of full connection is shown in Fig. 5.

CNN model structure
In order to establish the mapping relationship between the pressure data in the isolator and the flow field image data, a multi-layer CNN model is designed, as shown in Fig. 6.
The input of the model is the wall pressure data of the isolator, and the output is the pixel value of the flow field image at the corresponding time. Table 2 lists the specific parameter settings in the network, where "Y" and "N" respectively indicate whether the ReLU activation function is used or not. In Table 2, 1× 2 × 10 represents the tensor form

Model training
The computing platform we use is Windows 10, the CPU is Intel Core i5-10400f, the memory size is 16G, the GPU is RTX3060, whose memory size is 12G, and the model training time is 10 min and 18 s. The open source software library PyTorch is used to train the model. The mean square loss function is generally used in regression problems. In order to evaluate the quality of the model, this paper uses the mean square loss function as the evaluation standard. This function is shown in the following Eq. (2).
Where, f n is the flow field image vector obtained through CFD calculation, f * n is the flow field image vector obtained based on CNN reconstruction model, and N is the batch size used in network training, indicating the amount of data used in each round of training. In this study, N = 128, n is the total number of pixels in each image. Because the image resolution after preprocessing is 35 × 300, so n = 10,500.  The network training adopts the Adam optimization method. As an extension of the random gradient descent algorithm, the Adam optimizer is widely used in CNN optimization because of its high computational efficiency, easy implementation and low memory requirements. Figure 7 shows the changes of the loss function of the training set and the loss function of the test set of the CNN model. After 2000 iterations, the loss converges to 0.006 and the training process terminates.

Reconstruction results and index analysis of flow field in isolator
Structural similarity (SSIM) is an index to measure the similarity of two images. It is defined as follows: Where µ x is the average of x, µ y is the average of y, σ 2 x is the variance of x, σ 2 y is the variance of y, and σ xy is the covariance of x and y. c 1 = (k 1 L) 2 , c 2 = (k 2 L) 2 are constants used to maintain stability, where L is the dynamic range of pixel values, k 1 = 0.01, and k 2 = 0.03. SSIM ranges from 0 to 1, and when the two images are exactly the same, SSIM = 1.
Peak signal to noise ratio (PSNR) is used to measure the quality of signal reconstruction in the imaging domain. The PSNR value is 30 -40 dB, indicating that the predicted image is in good agreement with the real image; a value greater than 20 dB indicates that the predicted result of the model is basically consistent with the actual value; values below 20 dB indicate poor image reconstruction results. PSNR is defined by Eq. (4). .

Fig. 7 Log loss function
Where, W represents the image width, H represents the image height, i and j represent the ordinate and abscissa values of the image respectively, X represents the reconstructed image, Y represents the real flow field image, and n = 8.
Pearson correlation coefficient (CORR) measures the linear correlation. The closer the absolute value of the correlation coefficient is to 1, the stronger the correlation is. CORR is defined by: Where x i represents the i-th pixel in the reconstructed flow field diagram and x represents the pixel mean value of the reconstructed image; y i represents the i-th pixel in the real flow field diagram and y represents the pixel mean value of the reconstructed image.
The pressure series in the test set data are input into the CNN model to verify the reliability of the flow field reconstruction method. We randomly selected two reconstructed flow field results at different times to compare with CFD calculation results. The results are shown in Fig. 8. We give the pressure distribution of the upper and lower walls at the time corresponding to the prediction results in the figure, in which the blue line represents the distribution of 10 pressure values on the upper wall of the isolator, the red line represents the distribution of 10 pressure values on the lower wall of the isolator, and the values of SSIM and PSNR are shown in red font in the figure. Figure 9 is the absolute error diagram of the reconstructed flow field. The closer the blue part is, the smaller the error is. The closer the red part is, the larger the error is. It can be seen from the figure that the main error is distributed inside the shock wave structure, which does not affect the observation of its overall structure. Figure 10 shows the pixel scatter analysis and correlation coefficient of the reconstructed flow field (marked in red). It can be seen from the figure that all pixels are concentrated near the red straight line, which indicates that the reconstructed flow field results are highly correlated with the CFD calculation results. Fig. 8 Comparison between reconstructed flow field image based on CNN (middle) and CFD calculated flow field image (down) We studied the influence of different pressure quantities on the accuracy of model reconstruction, and the average SSIM, average PSNR and average CORR indexes of all flow field reconstruction results of the test set are shown in Table 3. It can be seen from the table that when the total number of upper and lower wall pressure is 14, the performance of flow field reconstruction does not decrease significantly, and when the total number of pressure is 10, the reconstruction performance decreases significantly, which shows that the model has a certain robustness.

Indirect detection method based on reconstructed flow field
The leading edge position of the shock train is obtained by comparing the distances between the two shock separation points on the upper and lower walls and the inlet, and the smaller distance point is taken as the leading edge position of the shock train. As shown in Fig. 11 below, the leading edge of the shock train is marked by a red circle, and the distance between it and the inlet is indicated by x STLE .   Figure 12 shows the results obtained by reconstructing the flow field image through CNN, detecting the leading edge position of the shock train, and comparing the detected results with the leading edge position of CFD calculation data. The abscissa represents the horizontal pixel size of the leading edge point of the shock train in the isolator in the image, and the ordinate represents the 150 shock train image data in the test set data. The red line in the figure represents the leading edge position obtained from 150 CFD calculated flow field images, and the green line represents the leading edge position of 150 shock train images output by CNN flow field reconstruction model.
The leading-edge position of the shock train is the distance between the shock train and the inlet of the isolator. The leading-edge position of the shock train predicted by the CNN flowfield reconstruction model is represented by X Det . To verify the accuracy of the model, X Det is compared with the actual shock train leading-edge position X Sch . The error is calculated as follows for i = 1, 2,…, 150: To quantitatively verify the detection accuracy, the root mean square error is defined as e RMS , as shown in the following Eq. (7). Since the calculated isolator length (6) e i = X Det − X Sch . is 304.8 mm, the number of horizontal pixels of an image is 300, so one pixel is about 1.016 mm. Therefore, the error unit can be expressed in mm.

Direct detection method for fine tuning CNN model
The leading edge position detection method based on CNN reconstruction requires high accuracy of the reconstructed flow field. If the reconstructed image has blurred edges, it is difficult to accurately detect the front edge position. So we studied another direct detection method. This method is obtained by modifying the last full connection layer of the CNN model, as shown in Fig. 13. We can get the improved CNN model by changing the output of the last full connection layer of the model to 1. This change means that we no longer need to reconstruct the flow field in the isolator. We use the improved CNN model to directly output the position coordinates of the leading edge of the shock train predicted by the model after training, which also avoids the error caused by the reconstructed flow field. Figure 14 shows the results of the comparison between the leading edge position predicted by the improved CNN model and the leading edge position of CFD calculated flow field data. In the figure,  the ordinate represents 150 test data, the abscissa represents the distance between the leading edge position of the shock train and the inlet port, the blue line represents the leading edge position of the shock train predicted from 150 test data after finetuning the model, and the red line represents the leading edge position of the shock train obtained from CFD data. Through calculation, the root mean square error is only 1.87 mm.

Conclusions
The main purpose of this paper is to study the intelligent method of flow field detection technology in the isolator of scramjet, which has potential application value. Stable and intelligent detection means can provide a strong guarantee for the active control of scramjet engine. A convolutional neural network is built to reconstruct the flow field and detect the leading edge position of the shock train in this paper. This work can be summarized as follows.
(1) Firstly, we used CFD to calculate the flow field in the isolator and the pressure on the upper and lower walls of the isolator under different back pressure conditions, and obtained 500 groups of pressure data and flow field image data at the corresponding time. Then a convolutional neural network is built and trained for flow field reconstruction, that is, the trained network model can obtain the flow field image in the isolator at the corresponding time by inputting the pressure sequence values of the upper and lower walls of the isolator. The average SSIM, average PSNR and average CORR of reconstructed flow field are calculated to be 0.902, 25.289 and 0.956 respectively. We also studied the influence of different total pressures on the upper and lower walls as model input on the reconstruction accuracy, and found that appropriately reducing the total pressure will not significantly affect the performance of flow field reconstruction, that is, the model has a certain robustness. (2) Through the reconstructed flow field image, the leading edge position of the shock train is detected, and the root mean square error of the detection result is 3.28 mm. Finally, by fine tuning the CNN model, we get a new method for detecting the leading edge of shock train (direct detection method), which reduces the root mean square error to 1.87 mm. Compared with reference [40], the potential advantage of this paper is that the proposed direct detection method of fine-tuning CNN model helps to make the detection of the leading edge of the shock train more accurate.