A method for solving NS equations using neural network based on conservation integral constraints

Through the neural network method based on conserved integral constraints, conserved quantity equations are established and NS equations are solved, and the existing technology solves the problem of insufficient accuracy and efficiency in complex fluid flow problems, and high-precision flow field solutions under finite data conditions are realized.

CN119311998BActive Publication Date: 2025-03-18CHINA AERODYNAMICS RES AND DEV CENT ULTRA-HIGH SPEED AERODYNAMICS RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411845356.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-03-18
Estimated Expiration
2044-12-16

AI Technical Summary

Technical Problem

The prior art is difficult to provide high-precision and efficient solutions when solving complex nonlinear fluid flow problems, especially given only the initial incoming flow conditions and individual boundary data.

Method used

The neural network method based on the conserved integral constraint is adopted, and the conservation equation is obtained by establishing a neural network model and using the energy conservation theorem to perform integral transformation, so as to accurately solve the non-visible compressible NS equation without a large amount of sampled data.

Benefits of technology

It realizes that the solution information of the entire flow field is accurately solved when only the initial flow conditions and individual boundary data are required, reducing the need for data and the difficulty of obtaining sampling points in the calculation domain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311998B_ABST
    Figure CN119311998B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for solving NS equations based on a neural network with integral constraints of conservation quantities, comprising the following steps: S1. Establishing NS equations to be solved according to actual application scenarios; S2. Performing numerical simulation of computational fluid dynamics methods; S3. Based on the theorem of conservation of energy, integrating and transforming the NS equations to be solved to obtain conservation quantity equations, and establishing a neural network model; S4. Training and solving the neural network model in S3, and verifying the solution results obtained with the numerical values ​​obtained in S2 until the predetermined solution accuracy of the neural network model is reached. The present invention solves the problem of accurately solving inviscid compressible NS equations, and accurately solves the solution information of the entire flow field when only initial incoming flow conditions and individual boundary data are required, which significantly reduces the demand for data and the difficulty of obtaining sampling points in the computational domain compared to PINN solutions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of flow field reconstruction in fluid mechanics, and specifically relates to a method for solving NS equations based on a neural network with conservation quantity integral constraints. Background Art

[0002] In recent years, machine learning and deep learning have attracted much attention due to their breakthrough performance in cognitive applications. As a universal approximator of nonlinear functions, neural networks have been widely studied in partial differential equation modeling. In 2017, Raissi proposed the physical information neural network (PINN), which revolutionized the modeling of physical systems. Although PINN has great potential in practical applications, the PINN modeling method requires the use of automatic differentiation technology of neural networks and the acquisition of residual points in the computational domain, which will lead to shortcomings such as time-consuming training and increased costs.

[0003] Although PINN has a certain effect in solving complex fluid mechanics problems, its solution accuracy and solution speed have always been challenging. Traditional analytical methods may be able to provide more accurate analytical solutions when solving partial differential equations, and traditional analytical methods are usually efficient in the solution process and can quickly obtain solutions. However, traditional analytical methods are difficult to apply to complex nonlinear fluid flow problems. Therefore, combining PINN with traditional analytical methods can combine the advantages of both and provide more accurate and comprehensive solutions. For example, patent application number 202410427624.5 discloses a deep neural network method for solving NS equations based on the idea of ​​distribution function. When faced with given incoming flow conditions and very few wall sampling point conditions, this method cannot complete the solution without considering the solution accuracy. Summary of the invention

[0004] An object of the present invention is to solve at least the above problems and / or disadvantages and to provide at least the advantages which will be described hereinafter.

[0005] In order to achieve these purposes and other advantages of the present invention, a method for solving the NS equations based on a neural network with conservation quantity integral constraints is provided, comprising the following steps:

[0006] S1. Establish the NS equations to be solved according to the actual application scenario;

[0007] S2. Performing numerical simulation using computational fluid dynamics methods to obtain true values ​​of the NS equations to be solved;

[0008] S3. Based on the energy conservation theorem, the NS equation to be solved is integrated and transformed to obtain the conservation equation, and a neural network model is established, where the conservation equation is expressed by the following equation:

[0009] In the above formula, u represents the velocity in the x direction, v represents the velocity in the y direction, p represents the pressure, rho represents the density, e represents the internal energy, nx represents the horizontal normal vector, ny represents the vertical normal vector, and dl represents the length of the integral;

[0010] S4. Train and solve the neural network model in S3, and verify the solution result with the true value obtained in S2 until the predetermined solution accuracy of the neural network model is reached.

[0011] Preferably, the neural network model includes in sequence: a boundary layer, an input layer, a hidden layer, an output layer, a Gaussian integral layer, and a loss function error layer;

[0012] Hidden layer: In the NS equation system, four sub-networks are assigned to the physical quantities of lateral velocity u, vertical velocity v, pressure p, and density rho as their network layers, and the network layers are connected in a fully connected manner, where u and v use the Tanh activation function, and p and rho use sigmoid or other non-negative activation functions;

[0013] Gaussian integral layer: transform the NS equation to be solved;

[0014] Output layer: Each sub-network outputs the corresponding physical quantity.

[0015] Preferably, the NS equation transformation process to be solved comprises the following steps:

[0016] S31. Integrate the NS equation to be solved over the entire computational domain to obtain the integrated NS equation:

[0017]

[0018] In the above formula, , , s represents the area of ​​the computational domain, U represents the conserved quantity, represents flux;

[0019] S32. Apply Gauss's theorem to the integrated NS equation to obtain the following equation:

[0020]

[0021] In the above formula, l represents the boundary domain;

[0022] S33.U and Substituting into the NS equation after applying Gauss's theorem in S32, the conservation equation is obtained.

[0023] Preferably, the neural network model is trained iteratively in S4 by the following steps:

[0024] S41. Input the coordinate information of the initial boundary shape in S3 into the neural network model in S4 for training and solving,

[0025] S42. The relative L2 norm error between the predicted value obtained and the true value obtained in S2;

[0026] S43. If the relative L2 norm error between the two is greater than 10%, continue to repeat step S41 until the relative L2 norm error between the two is less than 10%, and the training of the neural network model is completed.

[0027] The present invention includes at least the following beneficial effects: the present invention solves the problem of accurate solution of the inviscid compressible NS equations, and accurately solves the solution information of the entire flow field when only initial inflow conditions and individual boundary data are required, which significantly reduces the demand for data and the difficulty of obtaining sampling points in the computational domain compared to the PINN solution.

[0028] Other advantages, objectives and features of the present invention will be embodied in part through the following description, and in part will be understood by those skilled in the art through study and practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 A flow chart of a method for solving NS equations using a neural network based on conservation quantity integral constraints of the present invention;

[0030] Figure 2 It is an enlarged schematic diagram of one of the boundary layers in the flow chart of the method for solving the NS equations based on the conservation quantity integral constraint of the present invention;

[0031] Figure 3 Another enlarged schematic diagram of the boundary layer in the flow chart of the method for solving the NS equations by using a neural network based on conservation quantity integral constraints of the present invention;

[0032] Figure 4 Another enlarged schematic diagram of the boundary layer in the flow chart of the method for solving the NS equations by using a neural network based on conservation quantity integral constraints of the present invention;

[0033] Figure 5 It is a flowchart of the neural network model training iteration of the present invention;

[0034] Figure 6 The method for solving the NS equations based on the conservation integral constraint of the neural network of Example 1 uses the coordinate information of the initial boundary to solve the x-direction velocity field of the calculation domain;

[0035] Figure 7The method for solving the NS equations based on the conservation integral constraint of the neural network in Example 1 uses the coordinate information of the initial boundary to solve the velocity field in the y direction of the calculation domain;

[0036] Figure 8 The method for solving the NS equations based on the conservation integral constraint of the neural network in Example 1 uses the coordinate information of the initial boundary to solve the pressure field of the calculation domain;

[0037] Fig. 9 The method for solving the NS equations based on the conservation integral constraint of the neural network in Example 1 uses the coordinate information of the initial boundary to solve the density field of the calculation domain;

[0038] Fig.10 The velocity field in the x direction of the calculation domain obtained by solving the neural network model iteration in Example 1;

[0039] Fig.11 The velocity field in the y direction of the calculation domain obtained by solving the neural network model iteration in Example 1;

[0040] Fig.12 The calculation domain pressure field obtained by solving the neural network model iteration in Example 1;

[0041] Fig.13 The calculation domain density field obtained by solving the neural network model iteration in Example 1;

[0042] Fig.14 The velocity field in the x direction of the calculation domain obtained by solving the neural network model training iteration in Example 1;

[0043] Fig.15 The velocity field in the y direction of the calculation domain obtained by solving the neural network model training iteration in Example 1;

[0044] Fig.16 The calculation domain pressure field obtained by solving after the neural network model training iteration is completed in Example 1;

[0045] Fig.17 The calculation domain density field obtained by solving after the neural network model training iteration is completed in Example 1;

[0046] Fig.18 The velocity field in the x direction of the calculation domain is obtained by numerical simulation of the data of the NS equation to be solved in Example 1 using the computational fluid dynamics method;

[0047] Fig.19 The velocity field in the y direction of the calculation domain is obtained by numerical simulation of the data of the NS equation to be solved in Example 1 through the computational fluid dynamics method;

[0048] Fig. 20The calculation domain pressure field is obtained by numerical simulation of the data of the NS equation to be solved in Example 1 through the computational fluid dynamics method;

[0049] Fig.21 The data for solving the NS equations in Example 1 are the calculation domain density field obtained by numerical simulation using the computational fluid dynamics method. DETAILED DESCRIPTION

[0050] The present invention is further described in detail below in conjunction with the accompanying drawings so that those skilled in the art can implement the invention with reference to the description.

[0051] In order to reduce the shortcomings of large and complex sampling data in the high-dimensional situation during the PINN solution process, which is equivalent to incurring a large training cost. Therefore, our method is inspired by Gauss's theorem and reduces the dimension of the computational domain, greatly reducing the difficulty of data acquisition. For the NS equation system, our main approach is based on the premise that the conservation quantity of the entire computational domain remains unchanged, that is, the inflow of matter in the entire computational domain is equal to the outflow. Therefore, our network model architecture mainly consists of five parts, namely the network input layer, hidden layer, output layer, Gaussian integral layer and error layer.

[0052] The input of the network input layer is the independent variable of the NS equation system, that is, the space-time coordinates.

[0053] Step 1: Determine the NS equations to be solved. The NS equations for different situations are different, including compressible and incompressible fluids, viscosity and non-viscosity, etc. It is necessary to select the appropriate NS equations according to the actual problem to be solved.

[0054] Step 2: Use computational fluid dynamics to perform numerical simulations on the problem to be solved. This provides validation data to obtain benchmark results for the experiment and verify the correctness of the model.

[0055] Step 3: Transform the NS equation to be solved. For the two-dimensional steady-state compressible NS equation:

[0056] (1)

[0057] in, , ; (2)

[0058] rho,u,v,p,e represent density, x-direction velocity, y-direction velocity, pressure and internal energy respectively. In order to make equation (5) valid, we know from the law of conservation of energy that the energy of a system will not disappear or be generated out of thin air, so the system can be integrated over the entire computational domain:

[0059] (3)

[0060] In the above formula, s represents the area of ​​the calculation domain;

[0061] Applying Gauss's theorem to equation (3) yields the following equation:

[0062] (4)

[0063] In the above formula, l represents the boundary domain;

[0064] In formula (4), l must satisfy the arbitrary condition, so we will randomly generate different boundary shapes. The specific method is shown in steps 4 and 5, so that formula (4) is satisfied on different boundary domains. Finally, substitute formula (2) into formula (4) to obtain formula (5).

[0065] Step 4: Build a neural network model architecture based on the result of the NS equation transformation in step 3. The network model architecture is as follows: Figure 1 shown.

[0066] The deep neural network model mainly includes: boundary layer, network input layer, network hidden layer, network output layer, NS equation embedding layer and loss function error layer.

[0067] Figure 2-Figure 4 The boundary layer shown: randomly sample boundaries of different shapes as boundary information for network training as the initial boundary shape for network training. Here, the number of different discrete points can also be used directly to represent different shapes.

[0068] Input layer: The input of the neural network model is the space-time coordinates of the NS equation system. Here we consider the steady-state flow scenario, so the time dimension is not considered. Therefore, our network input only has spatial coordinates. For the two-dimensional case, the spatial coordinates have only two dimensions, x and y, which represent the horizontal and vertical coordinates respectively.

[0069] Hidden layer: In the hidden layer here, we use four sub-networks as the network layers of four physical quantities to train four physical quantities respectively. All of them are connected to the previous layer in a fully connected manner. The purpose of this is to prevent different sub-networks from affecting each other. There may be complex interactions between different features or physical quantities, which sometimes lead to instability or difficulty in convergence during the training process. Therefore, separating the physical quantities into different sub-networks can reduce this mutual interference, thereby improving the stability and efficiency of training. Different activation functions are selected according to the characteristics of the physical quantities, such as Tanh activation function for speed, sigmoid or other non-negative activation functions for pressure and density. Different activation functions are selected to enhance the nonlinear expression ability of the entire network.

[0070] Output layer: Each of the four sub-networks outputs only one physical quantity, which represents the lateral velocity, longitudinal velocity, pressure and density in the NS equation system, and outputs Figure 1 The formula A in is as follows:

[0071]

[0072] Gaussian integration layer: This part mainly constructs conservation quantities for the entire NS equation system, including conservation quantities for the inlet, wall, and outlet. The calculation method for the conservation quantities of each part in the two-dimensional case is shown in formula (5), which represents the conservation quantities of mass, momentum in two directions, and energy, respectively. Among them, nx represents the horizontal normal vector, ny represents the vertical normal vector, and dl represents the length of the integral. According to the principle of Gauss's theorem, in order to convert the surface integral into a line integral through Gauss's theorem, the arbitrariness of the integral boundary must be met. Therefore, the conservation quantity for the Gaussian integration layer is calculated as follows:

[0073] The physical quantities and normal vectors on the coordinate information obtained by the network output layer for the inlet, wall, and outlet are used to construct the conservation equation of formula (1). Then, the obtained conservation quantity is integrated at the inlet, wall, and outlet using the 5-point Gaussian integral formula to obtain the conservation values ​​of mass, momentum, and energy of the entire system. In order to meet the arbitrariness of the integral boundary, we use different boundary loop solutions. (5)

[0074] Loss function error layer, the model loss function consists of two parts, namely, Loss Data and Loss F, where Loss Data represents the data-driven part of the initial conditions of the incoming flow, and Loss F represents the errors in the mass, energy and momentum of the entire system to be solved. By continuously constraining formula A through Loss F, we finally get the conservation equation (5). Our goal is to make the total loss of Loss Data and LossF as close to zero as possible through network training.

[0075] Step 5: Model training and validation, such as Figure 5As shown. Model training: Input the coordinate information of the initial boundary shape into the network model and iterate in sequence. After each boundary shape training is completed, the relative L2 norm error of the solution is tested. If the test accuracy does not reach less than 10%, it does not meet our solution accuracy requirements. Then we believe that the solution accuracy of the model under the current boundary shape is insufficient and needs to be further trained. Then we use randomly generated different boundary shapes to input the network again and iterate the training repeatedly. The model can gradually learn more about the characteristics and laws of the NS equation system, thereby improving its solution accuracy. The iterative process will continue until the solution results of the model under any different boundary shape meet the relative L2 norm error accuracy requirements within 10%. At this point, we can assume that the model has good generalization ability and solution accuracy.

[0076] Embodiment 1:

[0077] This embodiment considers the NS equations of two-dimensional steady compressible inviscid flow at Mach 5 and an angle of attack of 10 degrees, and its expression is as follows:

[0078]

[0079] Where rho, u, v, p, e represent density, x-direction velocity, y-direction velocity, pressure and internal energy respectively, and the initial velocity, pressure and density conditions of the incoming flow are: 2.4620, -0.4341, 0.17857, 1.0 respectively. In this embodiment, only about 10 wall sampling points are needed as additional data information under the initial conditions.

[0080] The benchmark data are obtained through digital simulation, see Figure 18-21 The solution result of the method of the present invention according to the initial boundary shape is shown in Figure 6-9 , we can see that the solution result does not meet the requirements, so we add new boundary conditions to train the model. Figure 10-13 As a result, continue to add new boundary conditions until the solution accuracy requirement is met. Figure 14-17 . The relative L2 norm errors of the x-direction velocity, y-direction velocity, pressure and density in the final experimental results are 0.00307, ​​0.04111, 0.05120, and 0.03671, respectively. Therefore, it is shown that the method of the present invention can accurately solve the NS equations to be solved based on only given incoming flow conditions and very few wall sampling points. The most important thing is that our model training does not consider the internal conditions of the calculation domain at all. The model training can be completed only with boundary coordinate points (which is impossible to achieve with existing methods), and the accuracy is relatively high. Using the same solution conditions, it is impossible to complete the solution with the traditional PINN model, even without considering the accuracy.

[0081] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.

Claims

1. A method for solving NS equations based on a neural network with conservation integral constraints, characterized in that: The following steps are involved: S1. Establish the NS equations to be solved according to the aircraft flow scenario simulation; S2. Performing numerical simulation using computational fluid dynamics methods to obtain true values ​​of the NS equations to be solved; S3. Based on the energy conservation theorem, the NS equation to be solved is integrated and transformed to obtain the conservation equation, and a neural network model is established, where the conservation equation in two dimensions is expressed by the following equation: In the above formula, u represents the velocity in the x direction, v represents the velocity in the y direction, p represents the pressure, rho represents the density, e represents the internal energy, nx represents the horizontal normal vector, ny represents the vertical normal vector, and dl represents the length of the integral; S4. Train and solve the neural network model in S3, and verify the solution result with the true value obtained in S2 until the solution accuracy of the predetermined neural network model is reached; The neural network model includes: a boundary layer, an input layer, a hidden layer, an output layer, a Gaussian integral layer, and a loss function error layer in sequence; Hidden layer: In the NS equation system, four sub-networks are assigned to the physical quantities u, v, p, and rho as their network layers, and the network layers are connected in a fully connected manner. Among them, u and v use the Tanh activation function, and p and rho use sigmoid or other non-negative activation functions; Gaussian integral layer for transforming the NS equation to be solved; An output layer that outputs the corresponding physical quantity to each sub-network; The NS equation transformation process to be solved comprises the following steps: S31. Integrate the NS equation to be solved over the entire computational domain to obtain the integrated NS equation: In the above formula, , , s represents the area of ​​the computational domain, U represents the conserved quantity, represents flux; S32. Apply Gauss's theorem to the integrated NS equation to obtain the following equation: In the above formula, l represents the boundary domain; S33.U and Substituting this into the NS equation after applying Gauss's theorem in S32, we obtain the equation for the conservation quantity.

2. The method for solving the NS equations based on a neural network with conservation integral constraints according to claim 1, characterized in that: The training of the neural network model in S4 is iterated through the following steps: S41. Input the coordinate information of the initial boundary shape in S3 into the neural network model in S4 for training and solving, S42. The relative L2 norm error between the predicted value obtained and the true value obtained in S2; S43. If the relative L2 norm error between the two is greater than 10%, continue to repeat step S41 until the relative L2 norm error between the two is less than 10%, and the training of the neural network model is completed.

Citation Information

Patent Citations

  • Deep neural network method for solving NS equation based on distribution function thought

    CN118013870A

  • System and method for fluid flow assessment

    WO2024112677A1