A Physics-Constrained and Data-Driven Method For Modeling Supersonic Flow
A Physics-Constrained and Data-Driven Method For Modeling Supersonic Flow
View Export
Online Citation
Tong Zhao (赵通), Jian An (安健), Yuming Xu (许煜明), Guoqiang He (何国强), and Fei Qin (秦飞)a)
AFFILIATIONS
National Key Laboratory of Solid Rocket Propulsion, Northwestern Polytechnical University, Xi’an 710072, China
a)
Author to whom correspondence should be addressed: [email protected]
ABSTRACT
A fast solution of supersonic flow is one of the crucial challenges in engineering applications of supersonic flight. This article introduces a
deep learning framework, the supersonic physics-constrained network (SPC), for the rapid solution of unsteady supersonic flow problems.
SPC integrates deep convolutional neural networks with physics-constrained methods based on the Euler equation to derive a new loss func-
tion that can accurately calculate the flow fields by considering the spatial and temporal characteristics of the flow fields at the previous
moment. Compared to purely data-driven methods, SPC significantly reduces the dependency on training data volume by incorporating
physical constraints. Additionally, the training process of SPC is more stable than that of data-driven methods. Taking the classic supersonic
However, researchers have also considered neural networks as been used to model and predict flow fields at locations such as the
black-box models to replace the complex and time-consuming process inlets and isolator sections of hypersonic vehicles.43
of solving Navier–Stokes equations. Kim and Lee21 combined genera- Physics-driven methods have encountered certain bottlenecks in
tive adversarial networks (GANs) with recurrent neural networks modeling supersonic flows, while data-driven methods have made
(RNNs) to replace the direct numerical simulation (DNS) model for advances in the field. Consequently, researchers have attempted to
simulating turbulent channel flows. By incorporating samples with dif- combine the two approaches. Mao et al.44 achieved favorable results by
ferent Reynolds numbers, this approach exhibited good generalization introducing clustering-based training samples at potential discontinu-
performance. Li et al.22 constructed a deep learning framework using ity locations in solving two-dimensional oblique shocks and shock
convolutional neural networks (CNNs) for blade physical fields and tube problems. Liu et al.45 weakened the weights of PINNs near strong
aerodynamic predictions. Benefiting from CNN’s impressive perfor- discontinuities, allowing PINNs to predominantly learn from the
mance in computer vision, the abundant grid data within flow fields smooth regions of the flow fields. The natural occurrence of disconti-
naturally corresponds to pixels in images. Consequently, numerous nuities within the flow fields, influenced by compressible characteris-
research outcomes have emerged using CNNs and its various variants tics, was thus captured. This method yielded positive outcomes in
for flow modeling, prediction, and reconstruction.23–26 solving shock tube problems, the Lax problem, and two-dimensional
Data-driven flow modeling methods have made significant Riemann problems. Gao et al.46 treated training residuals as posterior
strides. However, these approaches typically require a substantial predictions within PINNs, continuously adjusting the neural network’s
amount of data27 to achieve robust generalization performance. In sit- sampling points in space during training, and achieved satisfactory
uations where obtaining sufficient high-precision data may pose chal- computational results.
lenges, introducing physical constraints can be a valuable strategy. The From the previous research, we can summarize as follows: ‹.
physics-informed neural networks27,28 (PINNs) method, introduced Data-driven methods for flow field modeling face challenges due to
by Raissi, incorporates physical conservation laws into neural networks their substantial data requirements for training, which inevitably intro-
to solve partial differential equations (PDEs). It successfully predicted duce computational costs. The potential of PINNs in modeling com-
the Karman vortex behind a cylinder in the absence of data. Rao plex supersonic flow has not yet been fully exploited. One of the
et al.29 further enhanced Raissi’s work by introducing strong boundary questions that needs addressing is how to effectively integrate the
condition constraints, achieving higher modeling accuracy for flow physics-driven and data-driven components in PINNs to enhance
around a cylinder. Harada et al.30 utilized physics-constrained neural their stability, convergence, and generalization during the training pro-
2. PINNs the spatial discretization using the specified weight convolution kernel,
and the last part is the loss function of the coupled physical constraints
PINNs leverage the automatic differentiation algorithm of neural proposed in this paper.
networks to iteratively train and approximate specific solutions to dif- First, compared to subsonic flow, one of the most distinctive char-
ferential equations.47 acteristics of supersonic flow is its sensitivity to fluid compressibility.
The specific set T is composed of two subsets, Tf and Tb , repre- Supersonic flow fields exhibit strong discontinuities such as shock waves.
senting the sampling points within the computational domain and on Since there is a huge difference in the physical properties before and
the computational domain boundary, respectively. Tf and Tb together after the shock wave, we regard these discontinuities in the flow fields as
are referred to as the collection of sampling points. To constrain the an edge feature in the field of computer vision. As a variant of CNNs,
neural network’s output u ^ , the loss function is defined as a weighted U-net has excellent performance in semantic segmentation and edge
sum of the L2 norm of the residual equations and boundary recognition; it was initially built by Ronneberger et al.48 in 2015. In neu-
conditions, ral networks, deeper architectures enhance the capability to extract
Lðh; TÞ ¼ wf Lðh; Tf Þ þ wb Lb ðh; Tb Þ; (1) intrinsic data features, but the edge features in images tend to weaken as
the network layers deepen. U-Net addresses this issue by extracting
1 X @u @ 2 u @u image features through down-sampling while retaining more edge tex-
L h; Tf ¼ f xi ; ; ; yi ; ;
Tf x2T @xi @xi2 @yi tures through the concatenation operation during up-sampling. The
f
2 principle of the SPC can be simply expressed as UNN tþ1
¼ NNðU t ; X; hÞ,
@u where NN represents network, U t is the tensor of flow fields at time t,
ti ; ; h ; (2)
@ti 2 and UNN tþ1
is the flow field at the next time step computed by SPC. For
1 X unsteady flow simulations, the predicted flow fields at t by the network
Lðh; Tb Þ ¼ Bðu^ ; xÞ22 : (3) are used as inputs for predicting the flow fields at t þ 1.
Tf x2T
b
However, SPC is developed based on CNNs. Therefore, for the
In the above-mentioned equation, wf and wb represent weights, computation of the differential terms in Eq. (8), SPC does not use the
while the other terms involve derivatives, partial derivatives, normal traditional approach of iterating through the grid to implement finite
derivatives, and similar differential terms. Unlike conventional numer- differences. Instead, it utilizes convolution kernels with fixed weights
ical methods that rely on finite differences or similar techniques to for the rapid computation of tensors. This computational method can
be expressed as
2 3
2 3
0 0 1 0
6 7
6 uv v u 0 7
6 7
6 ðc 1Þu2 þ ðc 3Þv2 7
B¼6
6 ðc 1Þu ð3 cÞv c177;
6 2 7
6 7
4 ðc 2Þðv3 þ u2 vÞ a2 v ð3 2cÞv2 þ u2 a2 5
ðc 1Þuv þ cv
2 c1 2 c1
t
where a represents the local speed of sound. Additionally, to enhance where UCFD is obtained by solving the Euler equation. Furthermore, by
the temporal constraint of the neural network model and accomplish incorporating constraints for boundary conditions, SPC’s loss function
unsteady computations, a combined approach of data-driven and for the supersonic flow model is as follows:
physics-constrained modeling is employed. This entails integrating
CFD data during the time progression. Ultimately, the derived loss Loss ¼ x1 Losspdes þ x2 LossBC : (12)
function for the physical equations is given as
III. EXPERIMENTAL SETUP
tþ1
1 X UNN UCFD
t tþ1
UNN UNN
tþ1
A. Experimental configurations
¼ þ
iþ1 i1
Losspdes A
Tf x2T Dt Dx The forward step flow is a classic case of supersonic flow, and its
f
FIG. 3. Dataset distribution. The volume of data used for training is (a) 3, (b) 4, (c) 6, and (d) 9.
FIG. 4. Distribution of datasets with changes in configuration (a) forward step. (b) three-wedge ramp.
dataset, and the volume of data used for training represents 3, 4, 6, and The computation using the trained network consumes only
9, respectively. 0.012 s, which has a high acceleration effect. The loss values during
training are analyzed separately in Sec. IV B and Fig. 7 of this paper.
D. Generalization ability in different boundary Other details about training and prediction are also described in more
conditions detail below.
In this section, the generalization ability of SPC will be verified by
changing the geometric boundary and inflow conditions. In the vari- A. Effect of network hyperparameters
ous geometric experiments, the flow velocity is fixed at u ¼ 3, and the
In the study of supersonic flows, wave structures are critical focal
coordinates x and y of the step corner are used to characterize the step.
points. To precisely evaluate the accuracy of neural network predic-
As shown in Fig. 4, the blue dots represent the distribution of the train-
tions, this paper intends to employ numerical error and shock wave
ing set, and the red dot represents the position of the testing set. The
prediction result within the black dashed lines signifies interpolation position error as evaluation metrics,
generalization ability, while outside the black dashed lines represents t
xpred xCFD
t
extrapolation generalization ability. In the experiments involving ERRORp ¼ t
100%;
(14)
xCFD
TABLE IV. Range analysis of the effect of network hyperparameters on the results. We analyze the reasons for the influence of the above hyperpara-
meters. According to Fig. 5, in the conventional image recognition
Hyperparameters problem, Tanh is widely used as an activation function. With the
advantage of fast training speed, it can meet the needs of high precision
Activation Convolutional Learning Kernel
in learning results. However, solving the physical problem is different
function kernels rate size ERRORp
from the image recognition. The flow process is continuous and more
1 Tanh 16 0.005 33 sensitive to the change in boundary conditions. Therefore, Tanh makes
2 Tanh 24 0.01 55 10.63 the neural network show the same output under different boundary
3 Tanh 32 0.05 73 conditions, because it is easy to be saturated. The input and output of
the Relu are linear in the domain greater than zero, so it does not have
4 Relu 16 0.01 73 8.48
the disadvantage of saturation. However, in the definition domain less
5 Relu 24 0.05 33 13.7
than zero, the output of the Relu is all zero, which makes the neuron
6 Relu 32 0.005 55 10.22 no longer responsive to any input after completing a large gradient
7 LeakyRelu 16 0.05 55 14.45 operation, which makes the network fail to update the gradient during
8 LeakyRelu 24 0.005 73 10.88 the training process. The LeakyRelu improves the disadvantage of the
9 LeakyRelu 32 0.01 33 1.43 Relu without negative input by giving a small linear component to a
K1 210.63 122.93 121.10 115.13 negative input.50 It shows better stability and higher accuracy than
K2 32.40 35.21 20.54 35.30 others. The learning rate is a secondary factor affecting the learning
K3 26.76 111.65 128.15 119.36 results. The smaller learning rate converges slowly, but the larger learn-
L1 70.21 40.98 40.37 38.38 ing rate will overfit the model. After comparison, 0.01 is the optimal
L2 10.80 11.74 6.85 11.77 learning rate. In addition, the more number of convolution kernels is
L3 8.92 37.22 42.72 39.79 not better. More convolution kernels can extract more features, but at
the same time, it will cause too many network parameters and take a
Rj 61.29 29.24 35.87 28.02 long time for network training. The size of the convolution kernel has
the least influence on the results, the training speed of the small convo-
Priority Activation function, Learning rate, lution kernel is faster. The large convolution kernel can capture a larger
Convolutional kernels, Kernel size flow fields space and consider the spatial characteristics of the flow
FIG. 5. Activation function (a) Tanh, (b) Relu, and (c) LeakyRelu.
FIG. 6. (a) Results of the CFD at t ¼ 1 s, t ¼ 2 s, and t ¼ 3 s. (b) Results of the physics-driven neural network at t ¼ 1 s, t ¼ 2 s, and t ¼ 3 s. (c) Results of the SPC at t ¼ 1 s,
t ¼ 2 s, and t ¼ 3 s.
phenomena become more intricate. Solely relying on data-free PINNs differential information from the physical equations in training neural
presents certain challenges in solving these complex equations. For the networks, SPC can help reduce the demand for training samples.
problem studied in this paper, if the data-driven approach is not intro- In order to explore the reasons for the above-mentioned conclu-
C. Generalization ability
TABLE V. Error results for each of the data-driven neural network and SPC.
1. Forward step flow
Data-driven SPC
Volume of First, we verify the prediction results for the forward step prob-
datasets ERRORN ERRORP (%) ERRORN ERRORP (%) lem. The results in Fig. 8 correspond to five sampling points from the
test dataset with different geometries, none of which were included in
1 3 0.281 100 0.022 2.78 the training samples. In Fig. 8(a), the coordinates of the corner point
2 4 0.108 44.35 0.021 2.41 are x ¼ 0.5 and y ¼ 0.2. In this case, due to the proximity of the step to
3 6 0.059 15.77 0.016 1.81 the inlet, a third reflected shock wave appears at the upper boundary
4 9 0.045 4.94 0.012 1.60 of the flow fields, a special case not present in the training set. This
indicates that the SPC can effectively learn the physical characteristics
of the flow fields, with a numerical error of 0.023 and a shock posi- error in the position of the third reflected shock wave in the upper
tion error of 0.020. In Fig. 8(b), the coordinates of the corner point right corner of the computational domain. This discrepancy might be
are x ¼ 1.0 and y ¼ 0.2. Only two reflected shock waves appear on due to the lower incoming flow speed, resulting in a weaker intensity
the upper wall in this case, with an average numerical error of 0.012 of the reflected shock wave and a thicker shock wave surface in the cal-
and a shock position error of 3.82%. The error is mainly concen- culations, leading to distortion in the shock wave position calculation.
trated near the last reflected shock wave. As observed in Fig. 8(b), For this case, the numerical error of the fluid fields is 0.022, and the
the predicted shock waves by SPC are closer to the upstream region error in shock wave position is 4.82%. Figure 9(b) displays a compari-
compared to the results from CFD calculations. In Fig. 8(c), repre- son and error analysis of the computational results for the case with
senting the corner point coordinates of x ¼ 1.3 and y ¼ 0.3, due to u ¼ 4. In this case, the left region of the computational domain is
an increase in step height, the bow shock at the upper boundary of slightly slower. This might be attributed to the neural network model
the flow fields transitions to a normal shock wave. SPC also cap- not capturing the incoming flow boundary accurately, the affected area
tures this change, with a numerical error of 0.018 and a shock posi- is only a small portion of the entire computational domain. However,
tion error of 3.73%. In Fig. 8(d), the corner point coordinates are the shock wave position calculation is fairly accurate, the numerical
x ¼ 1.6 and y ¼ 0.4, and in Fig. 8(e), the corner point coordinates error of the fluid fields is 0.053, and the error in shock wave position is
are x ¼ 2.0 and y ¼ 0.4. In these two cases, the original bow shock 2.54%.
wave completely transforms into a normal shock wave by further Regarding the error in mentioned above, it should be noted that
elevation of the step height. SPC predicts the shock wave fronts SPC is still a model based on data. Physics-constrained networks are
clearly and accurately, with high precision in other areas of the flow introduced to minimize the demand for high-resolution supersonic
fields. The average numerical errors for the flow fields are 0.018 and flow data. At the same time, physics-constrained networks make
0.013, and the shock position errors are 2.06% and 2.00%, model training easier to converge and more physically interpretable,
respectively. but this does not mean that SPC can realize the modeling of supersonic
Second, we further validate the generalization of SPC to changes flow entirely through physics. The complexity of the flow field charac-
in inflow conditions. Figure 9(a) shows the computational results and teristics is still an important factor affecting the accuracy. This will be
error of CFD and SPC for the step problem when u ¼ 2, the predicted more intuitively reflected in the experiment on the compression ramp
shock wave surface by SPC is relatively clear. However, there is a small in Sec. IV C 2.
2. Compression ramp flow highly accurate predictions of shock wave behavior. For the extrapola-
tion case, the coordinates of point p are [0, 0.16, 0.61, 0.72]. In this
This section is a verification of the generalization of SPC on the case, the angles of wedges are larger, resulting in a more significant
three-wedge compression ramp flow. Among the experiments of compression effect. As depicted in Fig. 10(b), the error is primarily
geometries change, an interpolated working condition and an exter- concentrated near the fourth wedge angle. Notably, SPC predicts shock
nally interpolated working condition are chosen in this paper. In the wave positions closer to the upstream region compared to CFD calcu-
interpolation case, the coordinates of point p are [0, 0.12, 0.47, 0.50], lations. The average flow field error for this case is 0.010, with a shock
the results predicted by SPC are illustrated in Fig. 10(a). For the inter- wave position error of 2.63%, SPC demonstrates significant precision
polation case, the average numerical error is only 0.008 with a shock in predicting the behavior of the ramp.
wave position error of 2.25%. The error between the predictions and Figure 11(a) shows the computational and predicted results of the
the true value is mainly in the wave back of the reflected shock wave ramp at u ¼ 2, with a good level of agreement between the predicted
near the upper wall, and the reflection angle is slightly larger in the results and the true values. Due to the slower inflow velocity, the oblique
prediction result of SPC. However, overall, SPC provides clear and shock waves generated by the first and second ramps do not reflect at the
FIG. 9. CFD and SPC results for different inflows of the forward step. (a) u ¼ 2.0 and (b) u ¼ 4.0.
FIG. 10. CFD and SPC for different geometrical configurations of a three-wedge compression ramp. (a) pi ¼ [0, 0.12, 0.47, 0.50]. (b) pi ¼ [0, 0.16, 0.61, 0.72].
FIG. 11. CFD and SPC results for different inflows of a three-wedge compression ramp. (a) u ¼ 2.0 and (b) u ¼ 3.6.
V. CONCLUSION ACKNOWLEDGMENTS
In this study, a deep learning framework, SPC, for unsteady The authors would like to express their thanks for the support
supersonic inviscid flows is proposed, and the applicability of the from the National Natural Science Foundation of China (Grant No.
52106165). Also, the authors thank the reviewers for their DATA AVAILABILITY
recommendations. The data that support the findings of this study are available from
the corresponding author upon reasonable request.
AUTHOR DECLARATIONS
Conflict of Interest APPENDIX A: NUMERICAL CALCULATION METHODS
The authors have no conflicts to disclose. The data used in this paper are obtained by solving the Euler
equations based on the rhoCentralFoam solver of OpenFOAM,
which is a widely accepted solver in the field of supersonic flow.
Author Contributions
The second-order total variation diminishing (TVD) scheme is used
Tong Zhao: Conceptualization (equal); Data curation (equal); and a minmod limiter is added to alleviate the oscillation near the
Methodology (equal); Software (equal); Validation (equal); Writing – discontinuity. The courant number (CFL) number is limited to 0.1.
original draft (equal). Jian An: Data curation (equal); Formal analysis The Sod shock tube and the Lax shock tube are the most widely
(equal); Methodology (equal); Validation (equal); Writing – review & used cases for verifying the accuracy of the solver. Both of them are
editing (equal). Yuming Xu: Conceptualization (equal); Data curation 1 D Riemann problems, which have analytical solutions under fixed
(equal); Investigation (equal); Methodology (equal); Writing – review boundary conditions, described by Euler equations as
& editing (equal). Guoqiang He: Data curation (equal); Formal analy- 0 1 0 1
q qu
sis (equal); Validation (equal). Fei Qin: Funding acquisition (equal); @@ A @ @ 2 q 1
qu þ qu þ p A ¼ 0; E ¼ þ qu2 : (A1)
Project administration (equal); Visualization (equal); Writing – review @t @x c1 2
E uðE þ pÞ
& editing (equal).
FIG. 15. Results for a training data volume of 4. (a) Data driven, (b) SPC, (c) error of data driven, (d) error of SPC, and (e) shock wave position errors.
FIG. 17. Results for a training data volume of 9. (a) Data driven, (b) SPC, (c) error of data driven, (d) error of SPC, and (e) shock wave position errors.
31
H. Gao, L. Sun, and J.-X. Wang, “PhyGeoNet: Physics-informed geometry- 41
C. Kong, J. Chang, Z. Wang, Y. Li, and W. Bao, “Data-driven super-resolution
adaptive convolutional neural networks for solving parameterized steady-state reconstruction of supersonic flow field by convolutional neural networks,” AIP
PDEs on irregular domain,” J. Comput. Phys. 428, 110079 (2021). Adv. 11(6), 065321 (2021).
32
J.-X. Wang, J. Wu, J. Ling, G. Iaccarino, and H. Xiao, “A comprehensive 42
C. Kong, C. Zhang, Z. Wang, Y. Li, and J. Chang, “Efficient prediction of super-
physics-informed machine learning framework for predictive turbulence sonic flowfield in an isolator based on pressure sequence,” AIAA J. 60(5),
modeling,” arXiv:1701.07102 (2018). 2826–2835 (2022).
33
S. Cai, Z. Mao, Z. Wang, M. Yin, and G. E. Karniadakis, “Physics-informed 43
D. Meng, M. Shi, Y. Shi, and Y. Zhu, “A machine learning method for transi-
neural networks (PINNs) for fluid mechanics: A review,” Acta Mech. Sin. tion prediction in hypersonic flows over a cone with angles of attack,” AIP
37(12), 1727–1738 (2021). Adv. 12(2), 025116 (2022).
34
P. Ren, C. Rao, Y. Liu, J.-X. Wang, and H. Sun, “PhyCRNet: Physics-informed 44
Z. Mao, A. D. Jagtap, and G. E. Karniadakis, “Physics-informed neural networks
convolutional-recurrent network for solving spatiotemporal PDEs,” Comput. for high-speed flows,” Comput. Methods Appl. Mech. Eng. 360, 112789 (2020).
Methods Appl. Mech. Eng. 389, 114399 (2022). 45
L. Liu, S. Liu, H. Xie, F. Xiong, T. Yu, M. Xiao, L. Liu, and H. Yong,
35
E. McGowan, V. Gawade, and W. (Grace) Guo, “A physics-informed convolu- “Discontinuity computing using physics-informed neural network,” J. Sci.
tional neural network with custom loss functions for porosity prediction in Comput. 98, 22 (2024).
laser metal deposition,” Sensors 22(2), 494 (2022). 46
Z. Gao, L. Yan, and T. Zhou, “Failure-informed adaptive sampling for PINNs,”
36
X. Zhao, Z. Gong, Y. Zhang, W. Yao, and X. Chen, “Physics-informed convolu- SIAM J. Sci. Comput. 45, A1971–A1994 (2023).
tional neural networks for temperature field prediction of heat source layout 47
L. Lu, X. Meng, Z. Mao, and G. E. Karniadakis, “DeepXDE: A deep learning
without labeled data,” Eng. Appl. Artif. Intell. 117, 105516 (2023). library for solving differential equations,” SIAM Rev. 63(1), 208–228 (2021).
37
R. Zhai, D. Yin, and G. Pang, “A deep learning framework for solving forward 48
O. Ronneberger, P. Fischer, and T. Brox, “U-Net: Convolutional networks for bio-
and inverse problems of power-law fluids,” Phys. Fluids 35(9), 093115 (2023). medical image segmentation,” in Medical Image Computing and Computer-Assisted
38
A. Zanjani, A. M. Tahsini, K. Sadafi, and F. Ghavidel Mangodeh, “Shape opti- Intervention – MICCAI 2015, edited by N. Navab, J. Hornegger, W. M. Wells, and
mization and flow analysis of supersonic nozzles using deep learning,” Int. J. A. F. Frangi (Springer International Publishing, Cham, 2015), pp. 234–241.
Comput. Fluid Dyn. 36(10), 875–891 (2022). 49
L. F. G. Marcantoni, J. P. Tamagno, and S. A. Elaskar, “High speed flow simula-
39
M.-Y. Wu, J.-Z. Peng, Z.-M. Qiu, Z.-H. Chen, Y.-B. Li, and W.-T. Wu, tion using openfoam,” Mec. Comput. 31(16), 2939–2959 (2012), available at
“Computationally effective estimation of supersonic flow field around airfoils https://scholar.google.com/scholar_lookup?title=High%20speed%20flow%20simulation
using sparse convolutional neural network,” Fluid Dyn. Res. 55(3), 035504 %20using%20OpenFOAM&author=L.%20Gutierrez%20Marcantoni&author=J.
(2023). %20Tamagno&author=S.%20Elaskar&publication_year=2012&journal=&volume
40
C. Fujio and H. Ogawa, “Deep-learning prediction and uncertainty quantifi- =&pages=2939-2959.
cation for scramjet intake flowfields,” Aerosp. Sci. Technol. 130, 107931 50
D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,”
(2022). arXiv:1412.6980 (2017).