A ship flow field prediction method based on high-order statistical aggregation graph neural network

CN120372815BActive Publication Date: 2026-10-13CHINA SHIP SCIENTIFIC RESEARCH CENTER
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510460674.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-14
Publication Date
2026-10-13
Estimated Expiration
2045-04-14

AI Technical Summary

Technical Problem

但是现有研究主要将GNN应用在圆柱绕流、方柱绕流及翼形绕流等简单应用场景中,如果将上述方法应用在船舶复杂流场预报场景中,则会由于模型对流场空间特征的提取能力不足而导致流场预报精度与泛化性能较低

Benefits of technology

[0038]本申请公开了一种基于高阶统计聚合的图神经网络船舶流场预报方法,该方法利用图自注意力神经网络编码器、多层LSTM解码器和MLP解码器搭建并训练得到的流场预报模型进行自回归式流场预报,该流场预报模型在利用图自注意力神经网络编码器更新节点特征时,不仅引入N-S方程残差项,还构建高阶统计函数以聚合邻居节点特征,从而使得该流场预报模型能够更加准确地捕捉船舶复杂绕流场中节点邻域的分布特征,且确保模型在流场预测中满足物理规律,可以提高对船舶复杂绕流场的预报精度和泛化性能,且预报结果具有较高的物理一致性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372815B_ABST
    Figure CN120372815B_ABST
Patent Text Reader

Abstract

The application discloses a ship flow field prediction method based on high-order statistical aggregation of a graph neural network, relates to the cross field of computational fluid dynamics and deep learning, and after initial flow field data of multiple continuous time points is acquired, a flow field prediction model obtained by using a graph self-attention neural network encoder, a multilayer LSTM decoder and an MLP decoder is trained, the flow field prediction model can predict flow field data of the next time point, and thus self-recurrent flow field prediction is realized; when the flow field prediction model used by the application updates node features by using the graph self-attention neural network encoder, not only is an N-S equation residual term introduced, but also a high-order statistical function is constructed to aggregate neighbor node features, so that the distribution characteristics of the node neighborhood in the complex ship flow field can be more accurately captured, and the physical law is ensured to be met in flow field prediction; the method has high prediction accuracy and generalization performance for the complex ship flow field, and the prediction result has high physical consistency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the interdisciplinary field of computational fluid dynamics and deep learning, and in particular to a graph neural network-based method for predicting ship flow fields based on high-order statistical aggregation. Background Technology

[0002] The study of flow field characteristics around ships is of great significance for hull design optimization, propulsion efficiency, and safety performance. Traditionally, ship flow data is obtained through physical experiments or numerical simulations using Computational Fluid Dynamics (CFD) software. However, physical experiments are hampered by high costs, long cycles, and limited measurement environments. CFD numerical simulations, when handling large-scale, highly complex flow field calculation scenarios, require tens or even hundreds of millions of grids, resulting in enormous computational demands and extremely high requirements for computing resources.

[0003] In recent years, with the rapid development of artificial intelligence technology, deep neural networks, represented by Multilayer Perceptron (MLP), Long Short-Term Memory (LSTM), Convolutional Neural Network (CNN), and Physically Informed Neural Network (PINN), have become a new method for solving complex engineering fluid mechanics problems, and have achieved significant progress and results. However, ship flow field data is usually distributed in non-Euclidean space, containing complex spatial distribution relationships and temporal evolution laws. The aforementioned neural networks assume that the data has a Euclidean structure, which has limitations in processing complex flow field data scenarios, resulting in low prediction accuracy and generalization performance.

[0004] Graph Neural Networks (GNNs) are deep neural networks designed for graph-structured data (nodes, edges). They are capable of processing flow field data structures in non-Euclidean spaces, effectively capturing local structural features and global relationships within the flow field data space. Current methods using GNNs to process flow field data include: Tobias Pfaff et al. proposed a mesh-based graph neural network (MeshGraphNet) for predicting unsteady flow fields around cylinders and NACA airfoils. Subsequent studies have improved MeshGraphNet. For example, Yang Zhishuang introduced an algebraic multigrid algorithm to MeshGraphNet, establishing a multi-scale graph neural network model and conducting flow field prediction studies on cylinders. Li Tianyu and Zou Yiye et al. encoded partial differential equations in MeshGraphNet, constructing a finite-volume graph neural network model for predicting flow fields around cylinders and airfoils. Li Zhilong et al. used graph convolutional recurrent neural networks and MeshGraphNet to predict flow fields around two-dimensional blunt bodies. Patent CN117421519A proposes a partial differential equation solving algorithm based on a physical information graph neural network and finite difference, with its core network architecture relying on MeshGraphNet. Furthermore, Peng Jiangzhou et al. proposed a graph convolutional neural network based on physical information and conducted research on flow field prediction around a cylinder. Patent CN118350292A discloses a training method for an airfoil flow field prediction network, extracting flow field features based on Transformer and using a graph neural network to predict the flow field. Patent CN118332898A discloses an airfoil flow field prediction method based on a hybrid neural network, using a hybrid neural network of graph neural networks and recurrent neural networks to predict flow around an airfoil. However, existing research mainly applies GNNs to simple application scenarios such as flow around cylinders, square cylinders, and airfoils. If these methods are applied to complex ship flow field prediction scenarios, the accuracy and generalization performance of the flow field prediction will be low due to the model's insufficient ability to extract spatial features of the flow field. Summary of the Invention

[0005] To address the aforementioned problems and technical requirements, this application proposes a ship flow field prediction method based on a graph neural network using high-order statistical aggregation. The technical solution of this application is as follows:

[0006] A graph neural network-based method for predicting ship flow fields, based on high-order statistical aggregation, includes:

[0007] Obtain the flow field data of the ship's location at the initial 1 to M consecutive time points, and construct the graph structure data of the current time point based on the flow field data at each time point. The graph structure data includes the node features of all nodes and the edge features of all edges. The node features of each node in the graph structure data include the spatial coordinates of the node and the flow field physical quantity at the corresponding time point. The integer parameter M≥2.

[0008] Starting from T=M, the graph structure data at time T and the M-1 most recent times prior to it are sequentially input into the first to M graph self-attention neural network encoders of the trained flow field prediction model. These encoders are then connected to the M LSTM layers stacked sequentially in a multi-layer LSTM decoder, with the last LSTM layer connected to an MLP decoder. In any m-th graph self-attention neural network encoder, the first message passing layer is initialized based on the input graph structure data at time m. Using a multi-head self-attention mechanism combined with the NS equation residuals, the edge features of any node j and its connected nodes are updated based on the node features at each node in the l-th message passing layer. Multiple feature statistics, including higher-order statistics, of the updated edge features of all connected edges of node j are aggregated onto node j to obtain the node features of node j in the (l+1)-th message passing layer. The node features of each node in the last message passing layer are used as the updated graph structure data at time m and input into the corresponding LSTM layer. The integer parameters are 1≤l≤L-1, the total number of message passing layers is L≥2, and the integer parameters are T-M+1≤m≤T.

[0009] The output of the MLP decoder of the flow field prediction model is used as the prediction result of the flow field data at time T+1 and autoregressive prediction is performed.

[0010] A further technical solution involves obtaining the node characteristics of node j within the (l+1)th message passing layer. include:

[0011] A higher-order aggregation function is constructed using multiple feature statistics to obtain the aggregation result. The aggregation result is then compared with the node features of node j in the l-th message passing layer. splicing results in splicing features Then, the splicing features are analyzed using MLP. Perform a nonlinear transformation to obtain the node features of node j in the (l+1)th message passing layer.

[0012] A further technical solution involves using the feature statistics of each connected edge of node j, including first-order, second-order, third-order, and fourth-order statistics; and constructing a higher-order aggregation function using multiple feature statistics to obtain the aggregation results, including:

[0013] The first-order, second-order, third-order, and fourth-order statistics are concatenated and then subjected to nonlinear transformation by MLP. After softmax mapping, the weight coefficients of each feature statistic are obtained. The aggregated result is obtained by weighting each feature statistic according to its weight coefficient.

[0014] A further technical solution involves updating the edge characteristics of the connection between any node j and any connected node i, including:

[0015] Utilizing a multi-head self-attention mechanism based on the node characteristics of node i within the l-th message passing layer Calculate the attention weights of node i in, W Q W K W V These are the learnable weight matrices, d k For subspace dimension;

[0016] Correct the attention weight α of node i using the residuals of the Navier-Stokes equations. ij The edge features of the connection between node j and node i in the (l+1)th message passing layer are updated.

[0017] A further technical solution involves obtaining the edge features of the connection between node j and node i within the (l+1)th message passing layer. for:

[0018]

[0019] in, The residual of the Navier-Stokes equation, u n p is the velocity at any node n. n It is the pressure at node n, N f It is the total number of nodes. γ is the gradient operator, t represents time, Re is the Reynolds number, and γ is the correction coefficient.

[0020] Further technical solutions include: the graph neural network ship flow field prediction method also includes:

[0021] After the flow field computational domain of the ship model is discretized into a grid, a CFD simulation of the flow field is performed to obtain the simulation results of physical quantities at each grid cell at each simulation time. Based on the simulation results of physical quantities at any simulation time, the simulation graph structure data of the current simulation time is constructed. The node features of each node in the simulation graph structure data include the spatial coordinates of the node and the simulation results of physical quantities at the node at the current simulation time.

[0022] The training samples corresponding to simulation time P are constructed by using the sequence of simulation graph structure data of any simulation time P and the M-1 most recent simulation times before it as the sample input and the simulation results of physical quantities at simulation time P+1 as the sample output. Training samples corresponding to different simulation times are constructed to form a training sample set.

[0023] The model structure of the flow field prediction model is constructed. The M simulation graph structure data in the training samples corresponding to any simulation time P are input into the self-attention neural network encoder of the first to M graphs in the flow field prediction model according to the temporal order. The flow field prediction result at simulation time P+1 is output by the MLP decoder of the flow field prediction model. The flow field prediction model is obtained by training the training sample set in combination with the sample output of the training samples corresponding to simulation time P.

[0024] A further technical solution involves training a flow field prediction model using a training sample set, including:

[0025] Constraints matching the boundary conditions at the physical boundary are applied to the nodes located on the physical boundary of the flow field computational domain in the simulation diagram structure data, and the flow field prediction model is trained using the training sample set under the constraints of the constraints.

[0026] A further technical solution involves training a flow field prediction model using a training sample set under constraints, including:

[0027] For node b located on the physical boundary of the flow field computation domain in the simulation graph structure data, the node features of node b in the (l+1)th message passing layer obtained by the graph self-attention neural network encoder are analyzed based on the boundary conditions at the physical boundary where node b is located. Projecting onto the feasible region yields the projection result. Then it is passed to the next message passing layer for processing, Proj Β () represents the projection operator;

[0028] Calculate the data error L between the flow field prediction result and the sample output for each simulation time point corresponding to the training samples. data The loss function L is used as the model parameter to update the flow field prediction model for model training.

[0029] A further technical solution involves training a flow field prediction model using a training sample set under constraints, including:

[0030] Calculate the data error L between the flow field prediction result and the sample output for each simulation time point corresponding to the training samples. data ;

[0031] The flow field prediction results at node b, located on the physical boundary of the flow field computational domain, in the computational simulation data. and the boundary conditions at the physical boundary. The deviation between them yields the boundary condition regularization term. Where, N b It is the total number of nodes located on the physical boundary of the flow field computational domain in the simulation graph structure data;

[0032] Calculate the loss function L = L data +λL b The model is trained by updating the model parameters of the flow field prediction model by minimizing the loss function L, where λ is the weight coefficient.

[0033] The further technical solution is that the flow field computation domain is a cuboid structure, and the physical boundaries of the flow field computation domain include the left boundary, right boundary, upper boundary, lower boundary, front boundary, rear boundary, and the hull surface boundary of the ship model. The boundary conditions set for the flow field computation domain during the CFD simulation of the flow field include: setting the left boundary as the velocity inlet boundary condition, setting the right boundary as the pressure outlet boundary condition, and setting other boundaries as no-slip wall boundaries.

[0034] Based on the boundary conditions at the physical boundary where node b is located, the node characteristics are determined. Projecting onto the feasible region yields the projection result. This includes obtaining the projection result when node b is located on the left boundary of the flow field computational domain. The projection result is obtained when node b is located on the right boundary of the flow field computation domain. The projection result is obtained when node b is located on the upper boundary, lower boundary, front boundary, rear boundary of the flow field computational domain, and the hull surface boundary of the ship model.

[0035] Alternatively, calculate the flow field prediction results at node b. and the boundary conditions at the physical boundary. The discrepancies include: the calculated flow field prediction results when node b is located on the left boundary of the flow field computation domain. The speed prediction results in the middle and u inlet The difference between them is used as the flow field prediction result. With boundary conditions deviation When node b is located on the right boundary of the flow field computation domain, the calculated flow field prediction results are as follows: The pressure forecast results in p outlet The difference between them is used as the flow field prediction result. With boundary conditions deviation When node b is located on the upper boundary, lower boundary, front boundary, rear boundary of the flow field computational domain, and the hull surface boundary of the ship model, the calculated flow field prediction results are as follows: The difference between the velocity prediction result and 0 is used as the flow field prediction result. With boundary conditions deviation

[0036] Among them, u inlet It is the inlet velocity vector at the left boundary, p outlet The outlet static pressure is at the right boundary, and (x,y,z) is the nodal characteristic of node b. The spatial coordinates contained therein, u is the node feature of node b. The velocity contained therein, p is the node characteristic of node b. The pressure contained within.

[0037] The beneficial technical effects of this application are:

[0038] This application discloses a graph neural network-based ship flow field prediction method based on high-order statistical aggregation. This method uses a graph self-attention neural network encoder, a multi-layer LSTM decoder, and an MLP decoder to build and train a flow field prediction model for autoregressive flow field prediction. When updating node features using the graph self-attention neural network encoder, the flow field prediction model not only introduces the residual term of the Navier-Stokes equation, but also constructs a high-order statistical function to aggregate the features of neighboring nodes. This enables the flow field prediction model to more accurately capture the distribution characteristics of the node neighborhood in the complex flow field around the ship, and ensures that the model satisfies the physical laws in the flow field prediction. This can improve the prediction accuracy and generalization performance of the complex flow field around the ship, and the prediction results have high physical consistency.

[0039] When training the flow field prediction model using CFD simulation data of the flow field, this method also applies constraints based on the boundary conditions of the flow field computation domain through hard or soft constraints. This ensures that the flow field prediction model accurately captures the node features of the boundary conditions and that the prediction results conform to the actual physical boundary conditions, thereby further improving the accuracy and physical consistency of the prediction results. Attached Figure Description

[0040] Figure 1 This is a flowchart of a graph neural network method for predicting ship flow fields in one embodiment of this application.

[0041] Figure 2 This is a network structure diagram of the flow field prediction model in this application.

[0042] Figure 3 This is a flowchart of a method for updating node features in each message-passing layer of a graph-based attention neural network encoder in one embodiment.

[0043] Figure 4 This is a schematic diagram of the training process of the flow field prediction model in one embodiment of this application.

[0044] Figure 5 This is a schematic diagram of the fluid computational domain and boundary conditions set during the training of a flow field prediction model using CFD simulation data of the flow field in an example. Detailed Implementation

[0045] The specific embodiments of this application will be further described below with reference to the accompanying drawings.

[0046] This application discloses a graph neural network-based method for predicting ship flow fields using high-order statistical aggregation. This graph neural network method includes the following steps; please refer to [reference needed]. Figure 1 Flowchart:

[0047] Step S1: Obtain the flow field data of the ship's location at the initial 1 to M consecutive time points, and construct the graph structure data for the current time point based on the flow field data at each time point. The method for constructing the graph structure data based on the flow field data can refer to existing practices, and will not be elaborated in this application. Integer parameter M≥2.

[0048] The constructed graph structure data at each time step includes multiple connected nodes, each with its own node characteristics. The graph structure data includes the node characteristics of all nodes and the edge characteristics of all edges. The node characteristics at each node include the spatial coordinates of the node and the flow field physical quantities at the corresponding time step. In this application, the flow field physical quantities at each node include the fluid velocity and pressure. The edge characteristics of each edge include the index information and length of the connecting edge. The nodes at both ends of the connecting edge can be determined through the index information of the connecting edge.

[0049] Step S2: Starting from T=M, input the graph structure data of time T and the M-1 most recent times before it into the trained flow field prediction model in chronological order.

[0050] Please refer to the model structure of the flow field prediction model used in this application. Figure 2 The flow field prediction model includes M graph self-attention neural network encoders, a multi-layer LSTM decoder, and an MLP decoder. The multi-layer LSTM decoder consists of M LSTM layers stacked sequentially according to the information transmission direction. Figure 2 These are LSTM layers 1 through LSTM layer M, and the first through M graph self-attention neural network encoders (...). Figure 2The layers (GNN-1 to GNN-M) correspond to M sequentially stacked LSTM layers in a multi-layer LSTM decoder, with the last LSTM layer connected to an MLP decoder. In one embodiment, the number of LSTM layers is set to 2, the number of neurons in each layer is set to 128, and the activation function is ReLU. The output dimension of the MLP decoder is set to 2, corresponding to the fluid pressure and velocity, respectively.

[0051] When inputting M graphical structure data points from time T and the M-1 most recent times prior to it into the flow field prediction model, these M graphical structure data points are input into the first to M graphical self-attention neural network encoders in temporal order. For example... Figure 2 In the process, the graph structure data at time T is input into the Mth graph self-attention neural network encoder, the graph structure data at time T-1 is input into the M-1th graph self-attention neural network encoder, and so on, with the graph structure data at time T-M+1 input into the 1st graph self-attention neural network encoder.

[0052] For any integer parameter T-M+1≤m≤T, the graph structure data at time m is input into the m-th graph self-attention neural network encoder. The structures of each graph self-attention neural network encoder are the same, and any m-th graph self-attention neural network encoder includes L message passing layers.

[0053] In any m-th graph self-attention neural network encoder, the first message-passing layer is first initialized according to the graph structure data at time m. Then, message-passing is performed layer by layer using L message-passing layers to update the input graph structure data. For any integer parameter 1 ≤ l ≤ L-1, within any l-th message-passing layer:

[0054] 1. Utilizing a multi-head self-attention mechanism combined with the residuals of the Navier-Stokes equations, the edge features of the connecting edges between any node j and its connected nodes are updated based on the node features at each node in the l-th message-passing layer. Here, only the length of the connecting edges in the edge features is updated; the index information of the connecting edges remains unchanged. The edge features of the connecting edges between node j and any connected node i can be denoted as: Obtain edge features The methods include:

[0055] (1) Utilize the multi-head self-attention mechanism based on the node characteristics of node i in the l-th message passing layer. Calculate the attention weight α of node i ij The calculation formula is:

[0056]

[0057] Among them, Q i K iV i It is the node characteristic of node i within the l-th message passing layer. The linear transformation result, and W Q W K W V These are the learnable weight matrices. d k The dimension of the subspace. Softmax() represents the Softmax function.

[0058] (2) Correct the attention weight α of node i using the residual of the NS equation. ij To obtain the edge features of the connection between node j and node i in the (l+1)th message passing layer. The calculation formula is:

[0059]

[0060] in, This represents the residual of the Navier-Stokes equation. n p is the velocity at any node n. n It is the pressure at node n, N f It is the total number of nodes. γ is the gradient operator, t represents time, Re is the Reynolds number, and γ is the correction coefficient.

[0061] Traditional methods of calculating and updating edge features through purely data-driven approaches can lead to physical inconsistencies in edge features, such as sudden spikes or decays. This application introduces the residuals of the Navier-Stokes equations to correct the edge feature update process, ensuring that the update process conforms to physical laws. Utilizing the regularization constraints and guided corrections based on relevant physical laws can improve the physical consistency of the prediction results.

[0062] 2. Aggregate multiple feature statistics, including higher-order statistics, of all connected edges of node j onto node j to obtain the node features of node j in the (l+1)th message passing layer. Please refer to the following process. Figure 3 :

[0063] (1) First, calculate the edge characteristics of the connecting edge between node j and any connected node i. The multiple feature statistics, including both low-order and high-order statistics, are beneficial for enhancing the ability to mine and represent spatial feature relationships.

[0064] In one embodiment, the feature statistics of each connected edge of node j include first-order statistics, second-order statistics, third-order statistics, and fourth-order statistics.

[0065] (2) Construct a higher-order aggregation function using multiple feature statistics and obtain the aggregation result. Then, combine the aggregation result with the node features of node j in the l-th message passing layer. splicing results in splicing features

[0066] In one embodiment, the calculated first-order statistic includes the mean μ. mean The calculated second-order statistic includes the variance μ. std The calculated third-order statistic includes skewness μ. ske The calculated fourth-order statistic includes the peak value μ. kur Among them, the mean μ mean Central tendency reflecting edge characteristics of connected edges is equivalent to traditional mean aggregation and can preserve basic information. Variance μ std The degree of dispersion reflecting the edge characteristics of a connection edge can distinguish between stable and fluctuating connections. Skewness μ ske The asymmetry (left-skewed or right-skewed) distribution of edge features reflecting connected edges can effectively capture asymmetric patterns. Peak value μ kur The sharpness of the distribution of edge features, reflecting the characteristics of connected edges, can be used to detect outliers. The mean μ is used... mean variance μ std skewness μ ske Peak value μ kur Constructing a higher-order aggregation function and obtaining the aggregation result can capture the edge characteristics of each connection edge of node j from multiple maintenance.

[0067] One approach to constructing a high-order aggregation function using multiple feature statistics is to directly concatenate the feature statistics. However, to improve aggregation efficiency, another approach is to concatenate first-, second-, third-, and fourth-order statistics, perform a nonlinear transformation using an MLP, and then apply a softmax mapping to obtain the weighting coefficients for each feature statistic. Finally, the feature statistics are weighted according to these weighting coefficients to obtain the aggregation result. The feature statistics include the mean μ. mean variance μ std skewness μ ske Peak value μ kur Based on this, firstly, the mean μ mean variance μ std skewness μ ske Peak value μ kur After concatenation, the data is input into an MLP for nonlinear transformation, and then mapped using a softmax function to obtain four weight coefficients. The aggregated result is obtained by weighting each feature statistic according to its weight coefficient. The aggregated result can be expressed as:

[0068] h stats =α1μmean +α2μ std +α3μ ske +α4μ kur

[0069] Among them, the weight coefficients α1, α2, α3, and α4 are obtained by using softmax(MLP(μ mean ||μ std ||μ ske ||μ kur ))get.

[0070] Thus, splicing results in splicing features.

[0071] (3) Using MLP to analyze splicing features Perform a nonlinear transformation to obtain the node features of node j in the (l+1)th message passing layer.

[0072] After passing messages through all message passing layers, the node features of each node in the last message passing layer are used as the updated graph structure data at time m and input into the corresponding LSTM layer.

[0073] In step S3, the multi-layer LSTM decoder receives the updated temporal node features from the graph self-attention neural network encoder and learns the temporal evolution characteristics of the flow field. Finally, it decodes these features into the required flow field physical quantities, namely velocity and pressure, through a single MLP decoder. Then, the output of the MLP decoder of the flow field prediction model is used as the prediction result of the flow field data at time T+1. Autoregressive prediction continues, that is, based on the prediction result of the flow field data at time T+1, the graph structure data at time T+1 is constructed. Then, T = T+1, and step S2 is executed again to obtain the prediction result of the flow field data at the next time. This process is repeated to achieve autoregressive prediction.

[0074] The graph neural network method for ship flow field prediction in this application relies on a flow field prediction model, which needs to be pre-trained. Therefore, before using the flow field prediction model for flow field prediction, this application also includes a training process for the flow field prediction model. In one embodiment, the flow field prediction model is trained using CFD simulation data of the flow field, including the following training process, please refer to [reference needed]. Figure 4 Flowchart:

[0075] Step 410: After completing the discrete mesh division of the flow field computational domain where the ship model is located, perform CFD simulation of the flow field to obtain the simulation results of physical quantities at each grid cell at each simulation time.

[0076] In one embodiment, the constructed flow field computational domain adopts a cuboid structure, such as... Figure 5As shown in (a) above, an enlarged schematic diagram of the ship model within the flow field computational domain is shown below. Figure 5 As shown in (b), the meshing methods for the ship model and its external flow field region are often different when performing discrete mesh generation. Figure 5 The diagram illustrates the meshing method for the ship model and its external flow field region. The external flow field region generally uses a regular mesh, while the ship model generally uses an irregular mesh and is usually subjected to mesh refinement. The specific meshing method can be set according to actual needs.

[0077] After the mesh generation is completed, the spatial structure characteristics of the mesh cells can be determined, including: the cell vertices and edges contained in each mesh cell and the position information of each mesh cell. This allows us to determine the spatial coordinates of each cell vertex in each mesh cell and the cell vertices at both ends of each edge, as well as to establish the index of each edge in each mesh cell and calculate the length of each edge.

[0078] By performing CFD simulation of the flow field around the divided grid cells, the simulation results of physical quantities at each grid cell can be obtained. These simulation results also include the simulation results of velocity and pressure.

[0079] In one embodiment, the flow field mesh data of the DTMB5415 standard ship model at 1000 simulation moments is calculated using Star CCM+ software. The flow field mesh data is then parsed by calling the ParaView API interface using a Python program, thereby obtaining the spatial structural characteristics of the mesh cells and the simulation results of physical quantities at each mesh cell at each simulation moment.

[0080] Step 420: Construct the simulation graph structure data for the current simulation time based on the simulation results of physical quantities at any given simulation time. The obtained graph structure data for the current simulation time includes multiple nodes with interconnected relationships. Each node has its own node characteristics, and these characteristics include the node's spatial coordinates and the simulation results of the physical quantities at the node's current simulation time. For example, in... Figure 5 In the examples, Figure 5 The local simulation diagram structure data obtained by constructing the local area within the red rectangle in (b) is as follows: Figure 5 As shown in (c), circles represent nodes, and lines connecting circles represent connecting edges between nodes.

[0081] Step 430: Using the sequence of simulation graph structure data of any simulation time P and the M-1 most recent simulation times before it as the sample input, and the simulation results of physical quantities at simulation time P+1 as the sample output, a training sample corresponding to simulation time P is constructed. Training samples corresponding to different simulation times are constructed to form a training sample set.

[0082] Step 440, build as follows Figure 2 The model structure of the flow field prediction model shown is to input the M simulation graph structure data in the training samples corresponding to any simulation time P into the self-attention neural network encoder of the first to M graphs in the flow field prediction model according to the temporal order, so as to obtain the flow field prediction result at simulation time P+1 output by the MLP decoder of the flow field prediction model.

[0083] By combining the flow field prediction results and sample outputs of the training samples at any simulation time P, a flow field prediction model can be trained using the training sample set. In one embodiment, to ensure that the trained flow field prediction model satisfies physical laws, during model training, constraints matching the boundary conditions at the physical boundary are applied to the nodes located on the physical boundary of the flow field computational domain in the simulation graph structure data, and the flow field prediction model is trained using the training sample set under these constraints. There are two methods for applying these constraints:

[0084] 1. Apply constraints using hard constraints

[0085] This method applies constraints to the flow field prediction model during the processing of simulated graph structure data. Specifically, it applies constraints to each graph self-attention neural network encoder during the process of updating node features of the input simulated graph structure data.

[0086] The diagram is from the attention neural network encoder. In this process, multiple feature statistics, including higher-order statistics, of the edge features of all connected edges of node j in the l-th message-passing layer are aggregated onto node j to obtain the node features of node j in the (l+1)-th message-passing layer. Afterwards, it does not directly proceed to the next message passing layer for processing. Instead, it first adds constraints based on the boundary conditions of the flow field computation domain before proceeding to the next message passing layer for processing, including:

[0087] For any node b located on the physical boundary of the flow field computation domain in the simulation graph structure data, based on the boundary conditions at the physical boundary where node b is located, the node features of node b in the (l+1)th message passing layer obtained by the graph self-attention neural network encoder are... Projecting onto the feasible region yields the projection result. Then it is passed to the next message passing layer for processing. Among them, Proj Β () is the projection operator, which matches the boundary conditions of the physical boundary where node b is located.

[0088] This method applies hard constraints to the flow field prediction model during the processing of simulation diagram structure data, ensuring that the output of the flow field prediction model conforms to the actual physical boundary conditions. Therefore, during model training, the data error L between the flow field prediction result and the sample output corresponding to each simulation time step is directly calculated. data The loss function L is used as the model parameter to update the flow field prediction model for model training.

[0089] When the flow field computation domain is adopted as follows Figure 5 When the cuboid structure is shown in (a), the physical boundaries of the flow field computational domain include the left boundary, right boundary, upper boundary, lower boundary, front boundary, rear boundary, and the hull surface boundary of the ship model. The boundary conditions set for the flow field computational domain during the CFD simulation of the flow field include: setting the left boundary as the velocity inlet boundary condition and specifying the inlet velocity vector u. inlet Set the right boundary as the pressure outlet boundary condition and specify the outlet static pressure p. outlet Set other boundaries as no-slip wall boundaries and specify a velocity of 0, such as Figure 5 As shown in (d) in the figure.

[0090] The node characteristics of node b in the (l+1)th message passing layer can be represented as follows:

[0091] (x, y, z) are the node features of node b. The spatial coordinates contained therein, u is the node feature of node b. The velocity contained therein, p is the node characteristic of node b. The pressure contained within. The node characteristics of node b. Projecting onto the feasible region yields the projection result. This includes the following situations:

[0092] When node b is located on the left boundary of the flow field computational domain, the node characteristics of node b will be... Projecting onto the feasible region yields the projection result. That is, projecting the velocity u as the inlet velocity vector u inlet Everything else remains the same.

[0093] When node b is located on the right boundary of the flow field computational domain, the node characteristics of node b will be... Projecting onto the feasible region yields the projection result. This also means projecting the pressure p as the outlet static pressure p. outlet Everything else remains the same.

[0094] When node b is located on the upper boundary, lower boundary, front boundary, rear boundary of the flow field computational domain, and the hull surface boundary of the ship model, the node features of node b will be... Projecting onto the feasible region yields the projection result. That is, the velocity u is projected as 0, while everything else remains unchanged.

[0095] 2. Apply constraints using soft constraints.

[0096] Unlike hard constraint methods, this method does not adjust the processing procedure of the flow field prediction model. The diagram is from the attention neural network encoder. It aggregates multiple feature statistics, including higher-order statistics, of all connected edges of node j in the l-th message passing layer onto node j, obtaining the node features of node j in the (l+1)-th message passing layer. After that, it directly proceeds to the next message passing layer for processing.

[0097] This leads to the flow field prediction results of the flow field prediction model potentially not conforming to actual physical conditions. Therefore, soft constraints are applied by optimizing the loss function L, including: calculating the data error L between the flow field prediction results of the training samples and the sample outputs for each simulation time step. data In addition, the deviation between the flow field prediction result at node b, located on the physical boundary of the flow field computation domain in the simulation diagram structure data, and the boundary conditions at its physical boundary is calculated to obtain the boundary condition regularization term L. b The calculation formula is:

[0098]

[0099] Where, N b It is the total number of nodes located on the physical boundary of the flow field computational domain in the simulation graph structure data. It is the flow field prediction result at any node b located on the physical boundary of the flow field computation domain in the simulation diagram structure data. It is the boundary condition at the physical boundary where node b is located;

[0100] Then calculate the loss function L = L data +λL b The model parameters of the flow field prediction model are updated by minimizing the loss function L for model training. Here, the weight coefficients λ∈(0,1). Thus, during model training by minimizing the loss function L, the flow field prediction model can continuously approach the actual boundary conditions, satisfying the laws of mechanics and physics. Figure 4 Take the method of adding soft constraints as an example.

[0101] A cuboid structure is used in the flow field computation domain, and the left boundary is set as the velocity inlet boundary condition with the inlet velocity vector u specified. inlet Set the right boundary as the pressure outlet boundary condition and specify the outlet static pressure p. outletWhen other boundaries are set as no-slip wall boundaries and the velocity is specified as 0, the above boundary condition regularization term L... b The calculation method is as follows:

[0102] When node b is located on the left boundary, calculate the flow field prediction results at node b. Velocity prediction results and inlet velocity vector u inlet The deviation between them is used as the boundary condition regularization term L b In

[0103] When node b is located on the right boundary, calculate the flow field prediction results at node b. Pressure forecast results and outlet static pressure p outlet The deviation between them is used as the boundary condition regularization term L b In

[0104] When node b is located at a no-slip wall boundary, calculate the flow field prediction results at node b. The speed prediction results and the deviation between 0 and 0 are used as the boundary condition regularization term L. b In

[0105] The above descriptions are merely preferred embodiments of this application, and this application is not limited to the above embodiments. It is understood that other improvements and variations that can be directly derived or conceived by those skilled in the art without departing from the spirit and concept of this application should be considered to be included within the protection scope of this application.

Claims

1. A method for ship flow field prediction based on graph neural networks using high-order statistical aggregation, characterized in that, The graph neural network method for ship flow field prediction includes: Obtain the flow field data of the ship's location at the initial 1 to M consecutive time points, and construct the graph structure data of the current time point based on the flow field data at each time point. The graph structure data includes the node features of all nodes and the edge features of all edges. The node features of each node in the graph structure data include the spatial coordinates of the node and the flow field physical quantity at the corresponding time point. The integer parameter M≥2. Starting from T=M, the graph structure data at time T and the M-1 most recent times prior to it are sequentially input into the first to M graph self-attention neural network encoders of the trained flow field prediction model. These encoders are connected to M sequentially stacked LSTM layers in a multi-layer LSTM decoder, with the last LSTM layer connected to an MLP decoder. In any m-th graph self-attention neural network encoder, the first message passing layer is initialized based on the input graph structure data at time m. Using a multi-head self-attention mechanism combined with the NS equation residuals, the edge features of any node j and its connected nodes are updated based on the node features at each node in the l-th message passing layer. Multiple feature statistics, including higher-order statistics, of the updated edge features of all connected edges of node j are aggregated onto node j to obtain the node features of node j in the (l+1)-th message passing layer. The node features of each node in the last message passing layer are used as the updated graph structure data at time m and input into the corresponding LSTM layer. The integer parameters are 1≤l≤L-1, the total number of message passing layers is L≥2, and the integer parameters are T-M+1≤m≤T. The output of the MLP decoder of the flow field prediction model is used as the prediction result of the flow field data at time T+1 and autoregressive prediction is performed.

2. The graph neural network method for ship flow field prediction according to claim 1, characterized in that, Obtain the node characteristics of node j within the (l+1)th message passing layer. include: A high-order aggregation function is constructed using multiple feature statistics to obtain the aggregation result. The aggregation result is then compared with the node features of node j in the l-th message passing layer. splicing results in splicing features Then, the splicing features are analyzed using MLP. Perform a nonlinear transformation to obtain the node features of node j in the (l+1)th message passing layer.

3. The graph neural network method for ship flow field prediction according to claim 2, characterized in that, The feature statistics of each connected edge of node j include first-order, second-order, third-order, and fourth-order statistics. A higher-order aggregation function is constructed using these multiple feature statistics to obtain the aggregation results, including: The first-order, second-order, third-order, and fourth-order statistics are concatenated and then subjected to nonlinear transformation by MLP. After softmax mapping, the weight coefficients of each feature statistic are obtained. The aggregated result is obtained by weighting each feature statistic according to its weight coefficient.

4. The graph neural network method for ship flow field prediction according to claim 1, characterized in that, Updating the edge characteristics of the edge connecting any node j and any connected node i includes: Utilizing a multi-head self-attention mechanism based on the node characteristics of node i within the l-th message passing layer Calculate the attention weights of node i in, W Q W K W V These are the learnable weight matrices, d k For subspace dimension; Correct the attention weight α of node i using the residuals of the Navier-Stokes equations. ij The edge features of the connection between node j and node i in the (l+1)th message passing layer are updated.

5. The graph neural network method for ship flow field prediction according to claim 4, characterized in that, Obtain the edge features of the connection between node j and node i in the (l+1)th message passing layer. for: in, The residual of the Navier-Stokes equation, u n p is the velocity at any node n. n It is the pressure at node n, N f It is the total number of nodes. It is the gradient operator, t represents time, Re is the Reynolds number, and γ is the correction coefficient.

6. The graph neural network method for ship flow field prediction according to claim 1, characterized in that, The graph neural network method for ship flow field prediction also includes: After the flow field computational domain of the ship model is discretized into a grid, a CFD simulation of the flow field is performed to obtain the simulation results of physical quantities at each grid cell at each simulation time. Based on the simulation results of physical quantities at any simulation time, the simulation graph structure data of the current simulation time is constructed. The node features of each node in the simulation graph structure data include the spatial coordinates of the node and the simulation results of physical quantities at the node at the current simulation time. The training samples corresponding to simulation time P are constructed by using the sequence of simulation graph structure data of any simulation time P and the M-1 most recent simulation times before it as the sample input and the simulation results of physical quantities at simulation time P+1 as the sample output. Training samples corresponding to different simulation times are constructed to form a training sample set. The model structure of the flow field prediction model is constructed. The M simulation graph structure data in the training samples corresponding to any simulation time P are input into the self-attention neural network encoder of the first to M graphs in the flow field prediction model according to the temporal order. The flow field prediction result at simulation time P+1 is output by the MLP decoder of the flow field prediction model. The flow field prediction model is then trained using the training sample set in combination with the sample output of the training samples corresponding to simulation time P.

7. The graph neural network method for ship flow field prediction according to claim 6, characterized in that, The flow field prediction model is trained using the training sample set, including: Constraints matching the boundary conditions at the physical boundary are applied to the nodes located on the physical boundary of the flow field computation domain in the simulation diagram structure data, and the flow field prediction model is trained using the training sample set under the constraints of the constraints.

8. The graph neural network method for ship flow field prediction according to claim 7, characterized in that, The flow field prediction model is obtained by training a training sample set under constraints, including: For node b in the simulation graph structure data located on the physical boundary of the flow field computation domain, the node features of node b in the (l+1)th message passing layer obtained by the graph self-attention neural network encoder are determined according to the boundary conditions at the physical boundary where node b is located. Projecting onto the feasible region yields the projection result. Then it is passed to the next message passing layer for processing, Proj Β () represents the projection operator; Calculate the data error L between the flow field prediction result and the sample output for each simulation time point corresponding to the training samples. data The model is trained by updating the model parameters of the flow field prediction model by minimizing the loss function L.

9. The graph neural network method for ship flow field prediction according to claim 7, characterized in that, The flow field prediction model is obtained by training a training sample set under constraints, including: Calculate the data error L between the flow field prediction result and the sample output for each simulation time point corresponding to the training samples. data ; The flow field prediction results at node b, located on the physical boundary of the flow field computation domain, in the simulation diagram structure data. and the boundary conditions at the physical boundary. The deviation between them yields the boundary condition regularization term. Where, N b It is the total number of nodes located on the physical boundary of the flow field computation domain in the simulation diagram structure data; Calculate the loss function L = L data +λL b The model is trained by updating the model parameters of the flow field prediction model by minimizing the loss function L, where λ is the weight coefficient.

10. The graph neural network method for ship flow field prediction according to claim 8 or 9, characterized in that, The flow field computational domain is a cuboid structure. The physical boundaries of the flow field computational domain include the left boundary, right boundary, upper boundary, lower boundary, front boundary, rear boundary, and the hull surface boundary of the ship model. The boundary conditions set for the flow field computational domain during the CFD simulation of the flow field include: setting the left boundary as a velocity inlet boundary condition, setting the right boundary as a pressure outlet boundary condition, and setting the other boundaries as no-slip wall boundaries. Based on the boundary conditions at the physical boundary where node b is located, the node characteristics are determined. Projecting onto the feasible region yields the projection result. This includes obtaining the projection result when node b is located on the left boundary of the flow field computational domain. The projection result is obtained when node b is located on the right boundary of the flow field computation domain. The projection result is obtained when node b is located on the upper boundary, lower boundary, front boundary, rear boundary of the flow field computational domain, and the hull surface boundary of the ship model. Alternatively, calculate the flow field prediction results at node b. and the boundary conditions at the physical boundary. The discrepancies include: the calculated flow field prediction results when node b is located on the left boundary of the flow field computation domain. The speed prediction results in the middle and u inlet The difference between them is used as the flow field prediction result. With boundary conditions deviation When node b is located on the right boundary of the flow field computation domain, the calculated flow field prediction results are as follows: The pressure forecast results in p outlet The difference between them is used as the flow field prediction result. With boundary conditions deviation When node b is located on the upper boundary, lower boundary, front boundary, rear boundary of the flow field computational domain, and the hull surface boundary of the ship model, the calculated flow field prediction results are as follows: The difference between the velocity prediction result and 0 is used as the flow field prediction result. With boundary conditions deviation Among them, u inlet It is the inlet velocity vector at the left boundary, p outlet The outlet static pressure is at the right boundary, and (x,y,z) is the nodal characteristic of node b. The spatial coordinates contained therein, u is the node feature of node b. The velocity contained therein, p is the node characteristic of node b. The pressure contained within.

Citation Information

Patent Citations

  • Partial differential equation solving algorithm based on physical information graph neural network and finite difference

    CN117421519A

  • Airfoil flow field prediction method based on hybrid neural network

    CN118332898A

  • Airfoil profile flow field prediction network training method, airfoil profile flow field prediction network, airfoil profile flow field prediction method and medium

    CN118350292A

  • Flow field prediction method based on attention and convolutional neural network codec

    CN115859781A

  • Hypersonic target wake electron density flow field reconstruction method, system and device based on physical information neural network and medium

    CN118917234A