Flow field pressure gradient prediction method of graph attention network based on physical operator guidance
By introducing the physical modeling idea of FDM or FVM and constructing a graph attention network with directional attention weights, the accuracy and physical consistency problems of flow field gradient prediction are solved, and efficient and accurate flow field gradient distribution prediction is achieved.
Patent Information
- Application Number
- CN202510888026.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-09-30
AI Technical Summary
Existing flow field gradient prediction methods have low accuracy under unstructured grids, lack physical interpretability, are difficult to adapt to complex boundary conditions, and lack the physical consistency of direct gradient prediction.
Combining the physical modeling ideas of the finite difference method (FDM) or finite volume method (FVM), a graph attention network with directional attention weights is constructed, and the physical perception ability is integrated through the OGIA layer to achieve gradient reconstruction.
It significantly improves the accuracy of gradient prediction, is applicable to complex unstructured grids, has good generalization capabilities, and meets physical consistency and efficient prediction.
Smart Images

Figure CN120724902A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computational fluid dynamics simulation and machine learning, and more particularly to a method for predicting flow field pressure gradients using a graph attention network guided by physical operators. This method integrates physics domain knowledge (partial differential equation operators) into a graph neural network model to rapidly predict the gradient distribution at each point in the flow field. Background Art
[0002] Numerical simulation of fluid mechanics (such as solving the Navier-Stokes equations) is a commonly used analytical method in the engineering field, but high-precision computational fluid dynamics (CFD) simulations are usually time-consuming and computationally expensive. In recent years, the construction of proxy models for flow field prediction using deep learning technology has become a research hotspot. Some studies have shown that the use of deep learning models such as convolutional neural networks can approximate the prediction of flow field results at a computational cost far lower than that of traditional solvers, and the prediction speed is two to four orders of magnitude faster than that of classic CFD solvers, while maintaining a low error rate. This means that within an acceptable accuracy range, data-driven models can greatly improve the efficiency of flow field prediction. However, models based entirely on data training often require a large amount of high-quality simulation data to support them, and because they do not explicitly consider physical constraints, their prediction results may not satisfy basic physical laws (such as conservation of mass and momentum), thereby limiting their credibility in engineering.
[0003] To improve the physical plausibility of predictions, physics-guided machine learning methods have emerged. For example, techniques such as physical information neural networks (PINNs) incorporate physical equations as constraints into neural network training, enabling model predictions to satisfy both the training data fit and the constraints of the governing equations. Furthermore, graph neural networks (GNNs), as tools for processing non-Euclidean data, are well-suited for simulating gridded data such as flow fields. The CFD computational domain is typically discretized into a grid, which naturally fits the graph-structured data format. Compared to traditional convolutional networks that process images based on regular grids, graph neural networks can flexibly process unstructured grids, preserving the topological relationships between adjacent grid nodes and helping to capture the local nonlinear characteristics of complex flows. However, current flow field prediction methods based on graph neural networks mostly focus on the prediction of field quantities such as velocity or pressure, lacking technical solutions that can directly predict gradient fields while ensuring physical consistency. Therefore, a new approach is urgently needed that combines physical operator guidance with graph neural networks to improve the accuracy of gradient predictions while ensuring that flow field predictions conform to physical laws. Summary of the Invention
[0004] In view of the shortcomings of the data-driven flow field prediction model in the existing technology in terms of prediction accuracy, physical consistency and direct prediction ability of the gradient field, the main problem to be solved by the present invention is how to combine fluid mechanics physical operators with graph neural network models to provide a technical solution that meets the high-speed prediction requirements and ensures the physical accuracy of the flow field gradient.
[0005] The present invention aims to solve the problems of low flow field gradient prediction accuracy, lack of physical interpretability and difficulty in adapting to complex boundary conditions in existing methods under unstructured grids. It provides a flow field pressure gradient prediction method based on a graph attention network guided by physical operators. This method introduces the physical modeling ideas of the finite difference method (FDM) or finite volume method (FVM) into the graph neural network, and realizes gradient reconstruction with physical perception ability by constructing directional attention weights.
[0006] The core technical solution of the present invention includes the following main steps:
[0007] Step 1: Obtain flow field sample data under multiple unstructured grids;
[0008] Step 2: constructing a graph structure based on the flow field data;
[0009] Step 3: Normalize the initial features of the nodes;
[0010] Step 4: The graph structure is input into the neural network composed of OGIA layers;
[0011] Step 5: Input the OGIA network output into the multi-layer perceptron, and the output node corresponds to the two-dimensional pressure gradient value.
[0012] Further explanation of step one:
[0013] Step 1: Derive flow field data under multiple different operating conditions (such as Mach number, Reynolds number, angle of attack, etc.) from the CFD numerical simulation results;
[0014] Step 2: Each flow field sample contains the spatial coordinates, pressure values and corresponding operating parameters of the grid nodes;
[0015] Step 3: The grid is an unstructured format, which can be a triangle, quadrilateral, tetrahedron or mixed unit structure, and has topological irregularity;
[0016] Step 4: Build a graph structure for each sample separately to support batch processing or independent processing of graph neural networks.
[0017] Further explanation of step 2:
[0018] Step 1: Select the graph structure form according to the selected physical modeling method, including finite difference method (FDM) and finite volume method (FVM);
[0019] Step 2: If the FDM mode is used, the nodes are taken as the vertices of the graph, and the K nearest neighbors of each node are selected as edges using the Euclidean distance to construct a point-edge graph (such as Figure 2 shown);
[0020] Step 3: If the FVM mode is used, the control volume unit is used as the vertex of the graph, and edges are established between any two units that share a face, and a face-unit volume graph is constructed (such as Figure 3 shown);
[0021] Step 4: Attach geometric and physical information to each edge, such as direction vector, surface normal vector, volume, and pressure difference, for subsequent attention guidance calculations.
[0022] Further explanation of step three:
[0023] Step 1: Standardize or normalize the original pressure value, coordinate information and working condition parameters of each node to unify the numerical scale;
[0024] Step 2: Concatenate the normalized pressure value p, coordinate vector (x, y, z) and working condition parameters into the feature vector x i , as the input of the graph neural network;
[0025] Step 3: Normalization can be performed on each sample independently or globally on the entire set, depending on the task settings.
[0026] Further explanation of step 4:
[0027] Step 1: Input the graph structure and normalized node features into the OGIA graph neural network model. OGIA consists of multiple graph attention layers.
[0028] Step 2: In each OGIA layer, first generate three sets of vectors q / k / v by linear transformation for each node feature (q i ,k i ,v i ) and the neighbor's (q j ,k j ,v j );
[0029] Step 3: Combine physical quantities to generate The term is used to compare with the directional attention weight Guide the calculation of attention weights:
[0030] FDM mode:
[0031] FVM mode:
[0032]
[0033] Step 4: Use softmax to calculate the neighbors’ s grad The item is normalized to obtain the attention weight α ij ;
[0034] Step 5: Based on weight α ij Weighted aggregation of neighbor features and output of next layer node embedding;
[0035] Step 6: The OGIA layer uses the attention mechanism to fuse physical terms and feature terms, and stacks two or more layers to form a deep perception model.
[0036] Further explanation of step five:
[0037] Step 1: The node features output by the last layer of OGIA are fed into a multi-layer perceptron (MLP) to generate the pressure gradient prediction value;
[0038] Step 2: The output target quantity is the pressure gradient of each node in two-dimensional space If it is three-dimensional data, the three-dimensional gradient is output;
[0039] Step 3: Use mean square error (MSE) as the supervised loss function and compare it with the normalized true gradient for training;
[0040] Step 4: Denormalize the output results and restore them to the original physical quantity scale.
[0041] The beneficial effects of the present invention are as follows:
[0042] (1) Introducing the physical-guided graph attention mechanism: constructing s by FDM or FVM grad
[0043] item, so that the attention weight has clear physical meaning and directionality.
[0044] (2) Applicable to complex unstructured grid data: It can construct effective graph structures without mesh rule assumptions and is compatible with mainstream CFD formats such as triangular meshes and tetrahedrons.
[0045] (3) Significantly improve the accuracy of gradient prediction: Compared with the standard GCN and PINN models, OGIA performs better in pressure gradient recovery tasks, especially in areas with high accuracy requirements such as boundary layers and vortex zones.
[0046] (4) Good generalization and migration capabilities: The network can adapt to multiple different working conditions at the same time and achieve unified modeling through the coordinated input of working condition parameters.
[0047] In summary, the technical solution provided by the present invention effectively solves the shortcomings of existing flow field gradient prediction methods, can output flow field gradient distribution that meets physical consistency with high accuracy and efficiency, and has broad application prospects in the engineering field. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is the overall structure flow chart of the present invention;
[0049] Figure 2 Schematic diagram for constructing point-edge graphs using the finite difference method (FDM);
[0050] Figure 3 Schematic diagram for constructing a surface-element diagram using the finite volume method (FVM);
[0051] Figure 4 Construct a flowchart for attention guidance in FDM;
[0052] Figure 5 Construct a flowchart for attention guidance of FVM;
[0053] Figure 6 Schematic diagram of the structural module of the OGIA graph attention layer; DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solutions and beneficial effects of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not constitute a limitation on the scope of protection of the present invention.
[0055] like Figure 1 As shown, the present invention provides a flow field pressure gradient prediction method based on a physical operator-guided graph attention network. The overall process includes data acquisition, graph structure construction, node feature normalization, graph neural network modeling, gradient prediction output and other steps, as follows:
[0056] Step S101: Obtain flow field sample data under multiple unstructured grids:
[0057] The present invention first obtains flow field sample data under multiple unstructured grids. Each sample contains the following information:
[0058] The three-dimensional or two-dimensional coordinates of the grid nodes (such as x, y, z);
[0059] The pressure value p at the corresponding node;
[0060] Control parameters related to operating conditions (such as Mach number, Reynolds number, reference pressure, etc.).
[0061] The data can be generated by CFD numerical simulation software (such as SU2, OpenFOAM, etc.) and stored in CSV format or point cloud form.
[0062] Step S102: constructing a graph structure based on the flow field data:
[0063] According to different graph modeling methods, the present invention supports two graph structure construction methods:
[0064] like Figure 2 As shown in Figure 2, the FDM-OGIA architecture uses a vertex-edge graph structure. Each grid node acts as a node in the graph, and nodes are connected by edges using the K-nearest neighbor method, forming an undirected graph structure consisting of all nodes and their neighborhoods.
[0065] like Figure 3 As shown in Figure 2, the FVM-OGIA architecture uses a face-unit graph structure. Each node represents the center of a control volume. If two control volumes share a face, an edge is established between them. The edge information records geometric properties such as the shared face vector and volume.
[0066] Step S103: Normalize the initial features of the node:
[0067] like Figure 6 As shown, in order to improve the stability and generalization ability of model training, the present invention normalizes the pressure value, coordinate information and working condition parameters in the input data. The specific method is to use the z-score normalization method:
[0068]
[0069] Where x represents the original data, μ and σ are the mean and standard deviation respectively.
[0070] The normalized features will be concatenated into the input vector of each node for the initial feature representation of the graph neural network.
[0071] Step S104: The graph structure is input into the neural network composed of the OGIA layer:
[0072] like Figure 6 As shown in Figure 2, the OGIA network consists of multiple stacked OGIA graph attention layers, each of which includes the following modules:
[0073] Query / Key / Value building block: linearly transforms each node feature to generate the input vector of the attention mechanism;
[0074] Physics-guided weight calculation module: construct weight α ij ;
[0075] Weighted aggregation module: performs weighted aggregation of neighbor information based on weights.
[0076] According to different modeling methods, the weight calculation method is as follows:
[0077] like Figure 4 As shown, in FDM-OGIA mode, the physical weight term is constructed:
[0078]
[0079] Directional weight term:
[0080]
[0081] where Δp ij =p j -p i is the pressure difference between adjacent nodes i and j, is the unit direction vector, q i is the query vector of the central node i, k j is the key vector of adjacent node j.
[0082] like Figure 5 As shown, in FVM-OGIA mode, the physical weight term is constructed:
[0083]
[0084] Directional weight term:
[0085]
[0086] where Δp ij =p j -p i is the pressure difference between adjacent control bodies, S ij is the shared surface normal vector of the two control volumes, V i is the volume of the control body, q i is the query vector of the central node i, k j is the key vector of adjacent node j.
[0087] The total weight term is the fusion of directional attention factor and physical factor:
[0088]
[0089] The attention mechanism uses the softmax function to convert the guide term into a normalized weight:
[0090]
[0091] Step S105: Input the OGIA network output into the multi-layer perceptron, and the output node corresponds to the two-dimensional pressure gradient value:
[0092] The network output includes the two-dimensional gradient value of each node The system also includes a supervision module to construct a loss function, which is defined as the mean square error (MSE) between the predicted gradient and the true gradient:
[0093]
[0094] The training process uses the Adam optimizer and the learning rate scheduling strategy to perform multiple rounds of iterations until convergence.
[0095] Example description:
[0096] In a typical application scenario, the present invention uses a two-dimensional airfoil flow field as training data, including 100 working condition samples. Each sample contains approximately 50,000 grid nodes and is modeled using the FDM-OGIA graph structure.
[0097] Compared with the standard GCN and PINN models, under the same number of training rounds, the proposed method can significantly reduce the gradient reconstruction error, especially in the vicinity of high Reynolds numbers or wall boundaries, and is more stable and accurate.
[0098] It should be noted that the present invention is not limited to the above-described embodiments. Without departing from the principles of the present invention, those skilled in the art may modify or replace the order of the steps, model structure, loss function form, etc. of the method, and such changes shall be deemed to be part of the scope of protection of the present invention. The method of the present invention provides a new and effective tool for rapid simulation and optimization design in the field of fluid mechanics by integrating physical priors and graph neural network models.
Claims
1. A flow field pressure gradient prediction method based on a physical operator-guided graph attention network, characterized in that: The following steps are involved: Step 1: Obtain flow field sample data under multiple unstructured grids, wherein the sample data includes the pressure value, coordinate position and working condition parameters at each grid node; Step 2: constructing a graph structure based on the flow field data, where the nodes of the graph represent grid points or control volume centers, and the edges of the graph represent spatial connections between nodes or shared surface connections between control volumes; Step 3: Normalize the initial features of each node to form a node input feature vector, which includes the normalized pressure value, coordinate information, and optional working condition parameters; Step 4: Input the graph structure into a graph neural network. The network consists of multiple physics-guided graph attention layers (OGIA layers). Each OGIA layer uses an attention mechanism related to the physical quantities between nodes for message passing. Step 5: Input the OGIA network output into the multi-layer perceptron and output the two-dimensional pressure gradient value corresponding to each node; In the OGIA layer, the attention weight α ij Constructed as follows: When the finite difference method (FDM) mode is used, α ij The pressure difference Δp between nodes ij With unit direction vector Joint participation in forming attention-guiding factors When the finite volume method (FVM) model is used, α ij By the adjacent surface normal vector S ij , unit volume V i and pressure difference Δp ij Calculated The model is trained using normalized gradient values as supervisory signals, and the loss function includes a mean square error term between the predicted value and the true gradient value.
2. The method according to claim 1, wherein: The graph structure is in a point-edge format, where nodes correspond to grid points and edges are their K nearest neighbors.
3. The method according to claim 1, wherein: The graph structure is in the form of a surface-unit body, where nodes correspond to the centers of control bodies and edges correspond to shared surfaces between two control bodies.
4. The method according to claim 1, wherein: The OGIA layer adopts the attention mechanism and uses linear transformation to obtain q, k, v vectors, constructs directional attention guidance items and fuses physical quantities to calculate adjacency weights.
5. The method according to claim 1, wherein: The OGIA layer stack is no less than two layers, and ReLU activation and Dropout operations are used between layers.
6. The method according to claim 1, wherein the attention factor is obtained by fusing a similarity score based on node features with a directional guidance item based on physical orientation, and the fusion weight is a learnable parameter.
7. A flow field gradient prediction system for implementing the method according to any one of claims 1 to 5, characterized in that: include: Data preprocessing module: used to normalize pressure, coordinates and working parameters; Graph construction module: constructs flow field data into a point-edge or surface-unit graph structure; Feature embedding module: generates the initial feature vector of each node; OGIA neural network module: contains multiple physics-guided graph attention layers, based on s grad Implement directed message aggregation, where feature aggregation uses a message passing mechanism to build a graph neural network layer. The message passing is determined by the embedding features and weights of adjacent nodes. Gradient output module: outputs the pressure gradient value of each node in the two-dimensional or three-dimensional coordinate direction, and the output is composed of a multi-layer perceptron (MLP); Loss calculation module: used to construct the supervised loss function in training.
8. The system of claim 6, wherein: The OGIA neural network module includes two modes: FDM-OGIA and FVM-OGIA, and supports switching under different graph structure inputs.
9. The system according to claim 6 or 7, wherein: The graph neural network structure supports deployment in the PyTorch Geometric framework and uses the MessagePassing structure to implement forward propagation and gradient training.
10. The system according to any one of claims 6 to 8, wherein: The system can be applied to gradient reconstruction in the post-processing stage of CFD simulation and is suitable for irregular grid or mixed grid scenarios.
Citation Information
Cited By
Automobile external flow field pressure distribution prediction and distributed calculation system, equipment and medium
CN122334112A