Gnn preconditioning iteration acceleration method and system for fluid numerical simulation

CN122904732APending Publication Date: 2026-10-13QILU UNIVERSITY OF TECHNOLOGY (SHANDONG ACADEMY OF SCIENCES) +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611363520.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-04
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

在条件数较大的流体力学病态矩阵中,残差误差可能被矩阵性质放大为较大的解误差,从而影响网络对矩阵逆算子的逼近稳定性,进一步限制其加速效果

Benefits of technology

[0093](1)本发明面向流体力学数值模拟中的稀疏线性方程组,将流体控制方程离散和线性化后形成的稀疏系数矩阵表示为图结构,并利用 GNN 学习右端项到近似解之间的映射关系,从而构造数据驱动的预条件器。相比仅依赖固定代数规则构造预条件器的方法,本发明能够利用流体力学稀疏矩阵中的非零结构、局部耦合关系和数值信息,提高复杂流体矩阵上的预条件适应能力。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122904732A_ABST
    Figure CN122904732A_ABST
Patent Text Reader

Abstract

The application relates to a GNN preconditioning iteration acceleration method and system for fluid numerical simulation, and belongs to the field of fluid mechanics, which comprises the following steps: representing a sparse coefficient matrix formed by grid discretization and linearization processing of control equations in fluid mechanics numerical simulation as a graph structure; constructing a training sample; constructing and training a GNN preconditioner for fluid mechanics numerical simulation; and embedding the trained GNN preconditioner into an iteration process as a preconditioning operation for solving. The application represents the sparse coefficient matrix as a graph structure, and uses GNN to learn the mapping relationship from the right end item to the approximate solution; and adopts FGMRES as an outer iteration solver, so that the preconditioner can be called to generate a preconditioning vector in each iteration step, thereby accelerating the residual reduction process of a complex fluid sparse linear equation group, improving the calculation efficiency and convergence stability of a linear solving link in fluid mechanics numerical simulation, and realizing the acceleration effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a GNN preconditioning iteration acceleration method and system for fluid numerical simulation, belonging to the field of fluid mechanics technology. Background Technology

[0002] Numerical simulation in fluid mechanics is widely used in engineering scenarios such as aerospace, energy and power, shipbuilding, reservoir flow, environmental flow analysis, and industrial flow simulation. These applications typically require numerical simulations of velocity fields, pressure fields, temperature fields, or component transport processes to obtain engineering results such as flow field distribution, pressure changes, heat and mass transfer states, or flow stability. With the increasing complexity of the simulation object's geometry, the expansion of mesh sizes, and the enhancement of physical coupling processes, the computational burden of numerical simulation in fluid mechanics increases significantly. Linear solution efficiency and convergence stability during the simulation process have become crucial factors affecting the overall simulation speed. Therefore, accelerating the key solution stages in numerical simulation of fluid mechanics is a critical technical issue for improving the efficiency of engineering simulation analysis and optimization design.

[0003] In numerical simulations of fluid mechanics, the continuity equation, momentum equation, energy equation, and related transport equations typically require mesh discretization using the finite volume method, finite difference method, or finite element method. After discretization, the unknowns at each mesh element or node are usually coupled only with adjacent elements or related degrees of freedom, thus forming a large-scale sparse linear system of equations, the general form of which is... .in, It is a sparse coefficient matrix formed by the discrete scheme, grid adjacency, boundary conditions, and variable coupling relationships. For the flow field variables or iterative corrections to be determined, This represents the vector of terms on the right-hand side. Solving this type of sparse linear equation system is often repeatedly called during nonlinear iterations, time progression, or pressure-velocity coupling processes, and its solution speed directly affects the overall operational efficiency of fluid dynamics numerical simulations.

[0004] For complex fluid problems, the computational domain may have complex geometric boundaries, and the mesh may include unstructured, locally refined, or hybrid meshes. Furthermore, factors such as convection dominance, pressure-velocity coupling, multivariable coupling, and differences in physical parameters can also affect the numerical properties of the discrete matrix. Therefore, the sparse matrix formed in fluid dynamics numerical simulations often exhibits irregular distribution of non-zero elements, strong asymmetry, and a large condition number. This can easily lead to slow residual descent, convergence stall, or excessively long solution times during iterative solutions, thus affecting the overall efficiency and stability of the fluid simulation.

[0005] In existing numerical simulations of fluid mechanics, sparse linear equations are typically handled using iterative methods, such as the conjugate gradient method (CG), the generalized minimum residual method (GMRES), and the flexible generalized minimum residual method (FGMRES). For asymmetric or ill-conditioned sparse matrices, the convergence speed of iterative methods often heavily depends on the preconditioner. Commonly used preconditioning methods include incomplete LU decomposition, Jacobi-type methods, approximate inverse methods, and algebraic multigrid methods. While these methods can accelerate iterative convergence to some extent, they may suffer from problems such as unstable preconditioning effects, sensitivity to parameter selection, and high construction costs under complex geometries, unstructured meshes, strong coupling, or ill-conditioned matrix conditions, making it difficult to reliably meet the demands of rapid linear solutions in complex fluid simulations.

[0006] In recent years, the application of Graph Neural Networks (GNNs) has provided a new technical approach for accelerating sparse linear equation systems in numerical simulations of fluid mechanics. This method utilizes the correspondence between sparse matrices and graph structures to represent the discrete fluid matrix as a graph. The GNN learns the mapping from the right-hand side to the approximate solution to construct a preconditioner that can be embedded in the iterative process, thereby accelerating the residual descent process. However, existing GNN preconditioning methods still have two shortcomings. First, model parameters are usually selected based on the training loss, which mainly reflects the network's fitting effect on the training samples and cannot fully reflect the actual acceleration effect after the preconditioner is embedded in the outer iterative solver. Therefore, the model selection result may not be consistent with the actual residual convergence performance. Second, the training objective is usually based on residual constraints. After the approximate solution output by the network is substituted into the original linear equation system, it should be as close as possible to the right-hand side. That is, the constraint network output satisfies ,in This is an approximate solution. In ill-conditioned fluid dynamic matrices with large condition numbers, residual errors may be amplified into larger solution errors by matrix properties, thus affecting the network's approximation stability to the matrix inverse operator and further limiting its acceleration effect. Summary of the Invention

[0007] To address the shortcomings of existing technologies, this invention provides a GNN preconditioning iteration acceleration method and system for fluid numerical simulation. Specifically, it addresses the large-scale sparse linear equation systems formed by mesh discretization and linearization in fluid simulations by reducing the sparse coefficient matrix... Represented as a graph structure, a graph neural network is used to learn the mapping relationship from the right-hand side to the approximate solution, thereby constructing a GNN preconditioner that can be embedded in the iterative solution process. Since the GNN preconditioner is a learned nonlinear mapping, its preconditioning effect may change with the input vector. Therefore, this invention uses FGMRES as the outer iterative solver, enabling it to call the preconditioner to generate the preconditioning vector in each iteration, thereby accelerating the residual descent process of complex sparse linear equations of fluids, improving the computational efficiency and convergence stability of the linear solution link in fluid mechanics numerical simulation, and achieving an acceleration effect.

[0008] The present invention adopts the following technical solution:

[0009] A GNN preconditioning iteration acceleration method for fluid numerical simulation includes the following steps:

[0010] S1 represents the sparse coefficient matrix formed by the mesh discretization and linearization of the governing equations in fluid dynamics numerical simulation. It is represented as a graph structure, providing the input basis for subsequent GNN preconditioner training and FGMRES preconditioning acceleration process;

[0011] S2, for a given sparse coefficient matrix Construct training samples;

[0012] S3. Construct and train a GNN preconditioner for numerical simulation of fluid mechanics, so that the GNN preconditioner can learn the mapping relationship between the right-hand term vector and the approximate solution in the sparse linear equation system of fluid mechanics.

[0013] S4 embeds the trained GNN preconditioner as a preconditioning operation into the iterative process of the Flexible Generalized Minimum Residual Method (FGMRES) to accelerate the preconditioning of sparse linear equations formed in fluid dynamics numerical simulation.

[0014] Unlike traditional preconditioning methods that primarily rely on fixed algebraic rules, this invention utilizes a Generative Neural Network (GNN) to learn the non-zero structure, local coupling relationships, and numerical characteristics of sparse matrices in fluid dynamics. This enables the preconditioner to better adapt to fluid simulation scenarios involving complex geometries, unstructured meshes, asymmetric matrices, and ill-conditioned matrices. Unlike methods that select model parameters solely based on training loss, this invention introduces iterative solution feedback during training. It uses short-step FGMRES to verify and evaluate the actual residual reduction effect of candidate models, making the model parameter selection more closely aligned with the actual acceleration requirements in fluid numerical simulations. Furthermore, this invention employs a hybrid loss function combining residual constraints and solution space supervision, ensuring that the network output satisfies the original linear equation system while approximating the corresponding true solution as closely as possible. This improves the approximation stability of the GNN preconditioner for matrix inverse operators.

[0015] Preferably, in step S1, in the numerical simulation of fluid mechanics, the computational domain is first meshed, discretizing the continuous computational domain into a finite number of mesh elements or nodes, and defining velocity, pressure, temperature, or other flow field variables on each mesh element or node. Subsequently, the continuity equation, momentum equation, energy equation, and related transport equations are discretized and linearized using the finite volume method, finite difference method, or finite element method.

[0016] Since local discretization schemes typically only involve the current element and its neighboring elements, for the th For a given grid cell or node, the discrete equation can be summarized as follows:

[0017]

[0018] in, Indicates the first Unknown quantities on a unit or node Indicates the relationship with the first A set of units or nodes that are adjacent or coupled. This represents the unknown quantity in adjacent elements or related degrees of freedom. This represents the coefficient corresponding to the current unknown quantity. Indicates the first In the equation, with the first The coupling coefficients corresponding to the unknown quantities Indicates the first The right-hand side terms corresponding to each discrete equation;

[0019] Arrange the discrete equations on all grid cells or nodes according to the unknown number to obtain a matrix form:

[0020]

[0021] in, This represents the sparse coefficient matrix obtained after mesh discretization and linearization of the fluid control equations. For the flow field variables or iterative corrections to be determined, The vector of terms on the right-hand side;

[0022] In the matrix In the middle, the first The matrix corresponding to each discrete equation The Okay, the coefficients of the current unknowns Write the coupling coefficients of adjacent unknowns or related degrees of freedom at the diagonal positions of the matrix. Write it to the off-diagonal position of the matrix, that is:

[0023]

[0024]

[0025] in, Representation matrix The Middle Line 1 The element of the column corresponds to the first... unknown quantity In the The self-coefficients of a discrete equation; Representation matrix The Middle Line 1 The element of the column corresponds to the first... Adjacent unknowns or related degrees of freedom In the Coupling coefficients in a discrete equation;

[0026] Therefore, matrix The non-zero elements originate from the unknown coefficients after discretization of the fluid control equations. Their non-zero structure is determined by mesh adjacency relationships, discretization scheme, boundary conditions, and variable coupling methods. Since each element or node typically only directly couples with a few adjacent elements, each row contains only a small number of non-zero elements. Therefore, the resulting matrix... It exhibits a sparse structure. Under conditions of complex geometry, unstructured meshes, convection-dominated environments, pressure-velocity coupling, and multivariable coupling, the matrix... It may also exhibit characteristics such as irregular distribution of non-zero elements, strong asymmetry, and large condition number, which may lead to slow decrease of residuals or stagnation of convergence in subsequent iterations.

[0027] Preferably, in step S1, the sparse coefficient matrix is ​​obtained. Then, the sparse coefficient matrix Represented as a graph structure, specifically:

[0028] Treat each unknown or discrete degree of freedom in the matrix as a node in the graph; if the matrix elements Then it means the first The unknown quantity participates in the first There are several discrete equations, and the two equations are coupled. Therefore, nodes are established in the graph. With nodes Connections between them; matrix elements The value can be used as edge weights or matrix coefficients in the message passing process.

[0029] Through the above method, the sparse coefficient matrix The non-zero structure of the matrix is ​​transformed into the adjacency relations of the graph, and the numerical information in the matrix is ​​transformed into the edge features of the graph. For an asymmetric matrix, if and If elements do not exist simultaneously or have different values, their asymmetric coupling information can be preserved using directed edges or directional message passing. Therefore, the local coupling relationships, non-zero element distributions, and matrix numerical information in the original sparse linear system can be utilized by graph neural networks. The subsequent graph neural network preconditioner uses right-hand side terms... and matrix The corresponding graph structure serves as the input, learning the mapping relationship from the right-hand side to the approximate solution, which is used to approximate the matrix inverse operator and accelerate the iterative solution process.

[0030] Preferably, in step S2, after completing the sparse linear system graph modeling, for a given sparse coefficient matrix... Training samples are constructed to train the GNN preconditioner. These training samples enable the GNN preconditioner to learn the mapping relationship between the right-hand side term vector and the corresponding flow field variables or iterative corrections in fluid numerical simulations, thereby providing preconditioning acceleration capabilities for the subsequent FGMRES iteration process.

[0031] For sparse coefficient matrix Generate several solution vector samples Then, the corresponding right-hand side terms are obtained through matrix multiplication. This forms training sample pairs ( ),in, As input to the GNN preconditioner, As the corresponding solution space monitoring signal. Meanwhile, due to therefore It can also be used as a monitoring signal in residual constraints to ensure that the network output satisfies the original sparse linear equations of hydrodynamics. This sample generation method does not require additional calls to traditional linear equation solvers to obtain training data; instead, it uses known matrices... Training pairs are generated directly from the constructed solution vector samples, thus reducing the computational overhead in the training data construction process.

[0032] Preferably, in step S2, the solution vector samples Samples can be generated through random sampling or by combining them with the Arnoldi process. Combining the Arnoldi process with the random sampling can also enhance the coverage of important directions of the matrix in the training data. Random sampling is used to improve the diversity of the training data, while Krylov or Arnoldi-related samples are used to supplement important directions that may appear during the iterative solution process.

[0033] In this way, the training samples contain both perturbation information of general flow field variables or iterative corrections, and can also reflect some important directions of the hydrodynamic sparse matrix during the iteration process. The resulting sample data can be used to train the GNN preconditioner, enabling it to learn the ability to approximate the inverse mapping of a given hydrodynamic sparse matrix. This provides a data foundation for embedding the preconditioner into the FGMRES iteration process, accelerating the residual descent, and improving the efficiency of the linear solution stage in fluid numerical simulation.

[0034] Preferably, in step S3, based on training sample pairs ( ),in For the solution vector sample The calculated right-hand side vector serves as both the input to the GNN preconditioner and the monitoring signal in the residual constraints. As the corresponding solution space monitoring signal, it is used to constrain the network output to approximate the true solution vector;

[0035] GNN preconditioners use right-hand terms sum matrix Using a graph structure as input, an approximate solution is output through a message-passing process on the graph:

[0036]

[0037] in, The parameter is GNN preconditioners, This indicates that the network represents the true solution. An approximate solution;

[0038] The GNN preconditioner network structure consists of an input encoding layer, several residual map convolutional layers, and an output decoding layer. The input encoding layer is used to convert the right-hand term vector... Mapping to node features enables the right-hand side information in the sparse linear equations of fluid mechanics to be processed by graph neural networks; residual graph convolutional layers are used to combine the sparse coefficient matrix. The graph structure is used for neighborhood information propagation to extract local coupling relationships and numerical correlation features between fluid mesh elements or discrete degrees of freedom; the output decoding layer is used to map the propagated node features back to the solution vector space to obtain an approximate solution. .

[0039] To accommodate the significant scale differences in right-hand side terms across various fluid numerical simulation problems, this invention incorporates scale normalization and denormalization at both the input and output ends. This reduces the impact of numerical scale variations on the training process, improving the training stability and acceleration of the GNN preconditioner. Through this network structure, the GNN preconditioner can utilize the non-zero structure, edge weight information, and local coupling relationships of the fluid dynamics sparse matrix to learn preconditioning maps suitable for subsequent FGMRES iterations.

[0040] Preferably, in terms of the training objective, this invention employs a hybrid loss function combining residual constraints and solution space supervision. In an ill-conditioned matrix, a small residual does not necessarily correspond to a small solution error. To address this issue, a hybrid loss function combining residual constraints and solution space supervision is used during training. The specific process is as follows:

[0041] First, using As a monitoring signal, the residual loss term is defined. :

[0042]

[0043] This residual loss term is used to constrain the network output to satisfy the original linear equation system.

[0044] Secondly, define the solution space loss term. :

[0045]

[0046] The solution space loss term is used to directly constrain the difference between the network output and the true solution;

[0047] Then, the residual loss term and the solution space loss term are weighted and combined to obtain the mixed loss function. :

[0048]

[0049] in, The weight parameter is used to adjust the ratio between residual constraints and solution space supervision. Through the aforementioned hybrid loss function, this invention constrains the network output to satisfy the sparse linear equations of hydrodynamics during training, while also directly constraining the difference between the network output and the true solution. This alleviates the instability problem that may occur when relying solely on residual loss. This training method improves the ability of the GNN preconditioner to approximate the inverse operators of sparse hydrodynamic matrices, and is particularly suitable for sparse hydrodynamic matrices with complex geometries, unstructured meshes, pressure-velocity coupling, large condition numbers, or poor numerical properties, providing a more stable preconditioning acceleration for subsequent iterations.

[0050] Preferably, in terms of model parameter selection, this invention introduces a model parameter optimization method based on iterative solution feedback. During training, the current model is saved every set number of training epochs, and the current GNN preconditioner is embedded into the FGMRES iteration process for short-step verification, recording the residual decrease sequence. Model evaluation metrics are calculated based on the residual decrease, and model parameters with better actual preconditioning acceleration effects are selected as the final preconditioner parameters. In this way, model parameter selection no longer relies solely on training loss, but combines its actual residual decrease performance in the linear solution stage of fluid dynamics numerical simulation, thereby improving the acceleration effect and convergence stability of the preconditioner on the iterative process.

[0051] The specific steps are as follows:

[0052] ① Set the total number of training rounds, validation interval E, and truncation step number. The relative residual threshold is used to control the training process of the graph neural network preconditioner; the validation interval is used to determine how many rounds to evaluate the model; the truncation iteration step is used to control the number of iterations the iterative solver runs during validation; and the relative residual threshold is used to calculate the residual descent evaluation index.

[0053] ② Use a hybrid loss function during training. The parameters of the GNN preconditioner are updated, and the current model parameters are saved after each set number of validation intervals E. This yields a candidate GNN preconditioner;

[0054] ③ Embed the current candidate GNN preconditioner into the iterative solver (FGMRES) and perform a short-step iterative solution on the right-hand side of the verification term; this process does not require a complete solution to convergence, but only performs the first few iterations to observe the effect of the current preconditioner on the residual descent process;

[0055] ④ Record the residual sequence during the truncation iteration process: ,in, To truncate the number of iterations, Indicates the first The relative residual after one iteration;

[0056] ⑤ Calculate and iteratively solve the evaluation index based on the residual sequence. :

[0057]

[0058] The smaller the value, the higher the current model's ranking. The better the residual reduction effect in the iterative solver, the better the model parameters. The corresponding GNN preconditioner is more conducive to actual iterative solution;

[0059] ⑥ Compare the current model's iterative solution evaluation index with the historical best index. If the current model's iterative solution evaluation index is less than the historical best index, then update the current model parameters to the optimal model parameters; otherwise, continue training and wait for the next validation.

[0060] ⑦ After training, the model parameters with the optimal evaluation index obtained through iterative solving are selected as the final GNN preconditioner parameters. Therefore, the selection of model parameters is no longer based solely on the training loss, but also on the actual residual reduction performance after embedding them into the iterative solver, thereby improving the actual solution effect of the final preconditioner.

[0061] By using the above method, the present invention can avoid the problem that the training error may be small but the actual solution effect may be poor when selecting a model based solely on the training loss.

[0062] Preferably, in step S4, after completing the GNN preconditioner training and model parameter optimization, the present invention denotes the trained and optimized model parameters as follows: The corresponding GNN preconditioner is denoted as Subsequently, this preconditioner is embedded as a preconditioning operation in the iteration process of the Flexible Generalized Minimum Residual Method (FGMRES) to accelerate the preconditioning of sparse linear equation sets formed in fluid dynamics numerical simulations.

[0063]

[0064] in, This represents the sparse coefficient matrix obtained after mesh discretization and linearization of the fluid control equations. For the flow field variables or iterative corrections to be determined, The vector of terms on the right-hand side;

[0065] Since the GNN preconditioner is a learned nonlinear mapping, its preconditioning effect may change with the input vector. Therefore, this invention uses FGMRES as the outer iterative solver. In each iteration, the flexible generalized minimum residual method is invoked. A preconditional transformation is performed on the current basis vector to generate a preconditional vector. This preconditional vector is then used to update the iterative subspace and approximate solution, thereby accelerating the residual descent and improving the computational efficiency and convergence stability of the linear solution stage in fluid dynamics numerical simulation. The specific solution process is as follows:

[0066] S41, Given an initial solution Calculate the initial residual :

[0067]

[0068] like If the convergence condition has been met, output directly. Otherwise, normalize the initial residuals to obtain the first basis vector. :

[0069]

[0070] in, The norm of the initial residual vector;

[0071] S42, in the In each iteration, the current basis vector is... Input the trained GNN preconditioner to obtain the preconditioning vector. :

[0072]

[0073] in, Represents the basis vectors in the current iteration. This represents the precondition vector after processing by the GNN preconditioner;

[0074] S43, Calculate matrix-vector product :

[0075]

[0076] Then to Orthogonalize the vectors to obtain new basis vectors, and continue to expand the iterative subspace;

[0077] S44, passing through After each iteration, the precondition vectors obtained in each step are combined into a matrix. :

[0078]

[0079] The Flexible Generalized Minimum Residual Method (FGMRES) obtains a set of combination coefficients based on the currently constructed iterative subspace. And based on the combination coefficients and precondition vector, the initial solution is corrected to obtain the first... Approximate solution in one step:

[0080]

[0081] in, This is an approximate solution obtained in the current iteration. In other words, the final solution is not obtained directly from a single output of the neural network, but rather through multiple preconditioning vectors during the FGMRES iteration process. According to the coefficient After combining, the initial solution The correction was obtained.

[0082] S45, Calculate the residual of the current approximate solution. :

[0083]

[0084] If the residual satisfies the set convergence condition, or the maximum number of iterations is reached, then the iteration stops and the current approximate solution is output. Otherwise, Return to step S42 and continue to the next iteration.

[0085] In the above manner, the preconditioner of the trained graph neural network is repeatedly called during the FGMRES iteration process to generate precondition vectors, accelerate the residual descent speed, and improve the iterative solution effect of sparse linear systems.

[0086] A GNN preconditioning iteration acceleration system for fluid numerical simulation, used to implement the aforementioned GNN preconditioning iteration acceleration method for fluid numerical simulation, includes:

[0087] The sparse linear system graph modeling module for fluid mechanics is used to model the sparse coefficient matrix formed by the mesh discretization and linearization of the governing equations in numerical simulations of fluid mechanics. Represented as a graph structure;

[0088] The training sample generation module is used to generate training samples from a given sparse coefficient matrix. Construct training samples;

[0089] The GNN preconditioner training module is used to build and train GNN preconditioners for numerical simulation of fluid mechanics, enabling the GNN preconditioner to learn the mapping relationship between the right-hand term vector and the approximate solution in the sparse linear equation system of fluid mechanics.

[0090] The preconditioner is embedded in the FGMRES acceleration iteration module to embed the trained GNN preconditioner as a preconditioning operation into the iteration process of the Flexible Generalized Minimum Residual Method (FGMRES) to accelerate the preconditioning of sparse linear equations formed in fluid dynamics numerical simulation.

[0091] For any details not covered in this invention, please refer to the prior art.

[0092] The beneficial effects of this invention are as follows:

[0093] (1) This invention addresses sparse linear equation systems in numerical simulations of fluid mechanics. It represents the sparse coefficient matrix formed after discretizing and linearizing the fluid control equations as a graph structure and uses a GNN to learn the mapping relationship between the right-hand side terms and the approximate solution, thereby constructing a data-driven preconditioner. Compared with methods that rely solely on fixed algebraic rules to construct preconditioners, this invention can utilize the non-zero structure, local coupling relationships, and numerical information in the sparse matrix of fluid mechanics to improve the adaptability of preconditioners on complex fluid matrices.

[0094] (2) This invention proposes a model parameter optimization method based on iterative solution feedback. During the training process, the current GNN preconditioner is periodically embedded into the FGMRES iteration process for short-step verification, and the model parameters are selected based on the residual reduction. Compared with the method of selecting the model based solely on training loss or the final training round, this method can more directly reflect the acceleration effect of the preconditioner in the linear solution stage of actual fluid numerical simulation, making the final model parameters more conducive to rapid residual reduction.

[0095] (3) This invention proposes a hybrid loss function that combines residual constraints and solution space supervision. This method both constrains the network output to satisfy the relationship of the sparse linear equations of hydrodynamics and constrains the difference between the network output and the true solution. It improves the approximation stability of the GNN preconditioner to the matrix inverse operator from the training objective, and alleviates the problem of insufficient solution space supervision that may occur when relying solely on residual loss. It is especially suitable for hydrodynamic sparse matrices with large condition numbers or poor numerical properties.

[0096] (4) In this invention, the trained and optimized GNN preconditioner is embedded into the FGMRES iteration process. Precondition vectors are generated in each iteration, and FGMRES combines these precondition vectors to update the approximate solution. In this way, this invention can improve the Krylov subspace construction process, accelerate the residual descent rate, and reduce the risk of slow residual descent or convergence stagnation on complex fluid matrices, thereby improving the computational efficiency and convergence stability of the linear solution stage in fluid dynamics numerical simulation and achieving an acceleration effect. Attached Figure Description

[0097] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an undue limitation of this application.

[0098] Figure 1 This is a flowchart of the GNN preconditioning iteration acceleration method for fluid numerical simulation according to the present invention;

[0099] Figure 2 This is a flowchart of the model parameter optimization method based on iterative solution feedback in this invention;

[0100] Figure 3 This is a flowchart illustrating the process of embedding the GNN preconditioner into the FGMRES iterative solution in this invention.

[0101] Figure 4 This is a schematic diagram of the FGMRES residual convergence curves of two methods in one embodiment of the present invention;

[0102] Figure 5 This is a schematic diagram showing the comparison of TRA index results between two methods in one embodiment of the present invention. Detailed Implementation

[0103] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. However, this is not the only description; all aspects not described in detail herein are based on conventional techniques in the art.

[0104] Example 1

[0105] A GNN preconditioning iteration acceleration method for fluid numerical simulation, such as Figure 1 As shown, it includes the following steps:

[0106] S1 represents the sparse coefficient matrix formed by the mesh discretization and linearization of the governing equations in fluid dynamics numerical simulation. It is represented as a graph structure, providing the input basis for subsequent GNN preconditioner training and FGMRES preconditioning acceleration process;

[0107] S2, for a given sparse coefficient matrix Construct training samples;

[0108] S3. Construct and train a GNN preconditioner for numerical simulation of fluid mechanics, so that the GNN preconditioner can learn the mapping relationship between the right-hand term vector and the approximate solution in the sparse linear equation system of fluid mechanics.

[0109] S4 embeds the trained GNN preconditioner as a preconditioning operation into the iterative process of the Flexible Generalized Minimum Residual Method (FGMRES) to accelerate the preconditioning of sparse linear equations formed in fluid dynamics numerical simulation.

[0110] Unlike traditional preconditioning methods that primarily rely on fixed algebraic rules, this invention utilizes a Generative Neural Network (GNN) to learn the non-zero structure, local coupling relationships, and numerical characteristics of sparse matrices in fluid dynamics. This enables the preconditioner to better adapt to fluid simulation scenarios involving complex geometries, unstructured meshes, asymmetric matrices, and ill-conditioned matrices. Unlike methods that select model parameters solely based on training loss, this invention introduces iterative solution feedback during training. It uses short-step FGMRES to verify and evaluate the actual residual reduction effect of candidate models, making the model parameter selection more closely aligned with the actual acceleration requirements in fluid numerical simulations. Furthermore, this invention employs a hybrid loss function combining residual constraints and solution space supervision, ensuring that the network output satisfies the original linear equation system while approximating the corresponding true solution as closely as possible. This improves the approximation stability of the GNN preconditioner for matrix inverse operators.

[0111] Example 2

[0112] A GNN preconditioning iteration acceleration method for fluid numerical simulation, as described in Example 1, differs in that, in step S1, the computational domain is first meshed, discretizing the continuous computational domain into a finite number of mesh elements or nodes, and defining velocity, pressure, temperature, or other flow field variables on each mesh element or node. Subsequently, the continuity equation, momentum equation, energy equation, and related transport equations are discretized and linearized using the finite volume method, finite difference method, or finite element method.

[0113] Since local discretization schemes typically only involve the current element and its neighboring elements, for the th For a given grid cell or node, the discrete equation can be summarized as follows:

[0114]

[0115] in, Indicates the first Unknown quantities on a unit or node Indicates the relationship with the first A set of units or nodes that are adjacent or coupled. This represents the unknown quantity in adjacent elements or related degrees of freedom. This represents the coefficient corresponding to the current unknown quantity. Indicates the first In the equation, with the first The coupling coefficients corresponding to the unknown quantities Indicates the first The right-hand side terms corresponding to each discrete equation;

[0116] Arrange the discrete equations on all grid cells or nodes according to the unknown number to obtain a matrix form:

[0117]

[0118] in, This represents the sparse coefficient matrix obtained after mesh discretization and linearization of the fluid control equations. For the flow field variables or iterative corrections to be determined, The vector of terms on the right-hand side;

[0119] In the matrix In the middle, the first The matrix corresponding to each discrete equation The Okay, the coefficients of the current unknowns Write the coupling coefficients of adjacent unknowns or related degrees of freedom at the diagonal positions of the matrix. Write it to the off-diagonal position of the matrix, that is:

[0120]

[0121]

[0122] in, Representation matrix The Middle Line 1 The element of the column corresponds to the first... unknown quantity In the The self-coefficients of a discrete equation; Representation matrix The Middle Line 1 The element of the column corresponds to the first... Adjacent unknowns or related degrees of freedom In the Coupling coefficients in a discrete equation;

[0123] Therefore, matrix The non-zero elements originate from the unknown coefficients after discretization of the fluid control equations. Their non-zero structure is determined by mesh adjacency relationships, discretization scheme, boundary conditions, and variable coupling methods. Since each element or node typically only directly couples with a few adjacent elements, each row contains only a small number of non-zero elements. Therefore, the resulting matrix... It exhibits a sparse structure. Under conditions of complex geometry, unstructured meshes, convection-dominated environments, pressure-velocity coupling, and multivariable coupling, the matrix... It may also exhibit characteristics such as irregular distribution of non-zero elements, strong asymmetry, and large condition number, which may lead to slow decrease of residuals or stagnation of convergence in subsequent iterations.

[0124] Preferably, in step S1, the sparse coefficient matrix is ​​obtained. Then, the sparse coefficient matrix Represented as a graph structure, specifically:

[0125] Treat each unknown or discrete degree of freedom in the matrix as a node in the graph; if the matrix elements Then it means the first The unknown quantity participates in the first There are several discrete equations, and the two equations are coupled. Therefore, nodes are established in the graph. With nodes Connections between them; matrix elements The value can be used as edge weights or matrix coefficients in the message passing process.

[0126] Through the above method, the sparse coefficient matrix The non-zero structure of the matrix is ​​transformed into the adjacency relations of the graph, and the numerical information in the matrix is ​​transformed into the edge features of the graph. For an asymmetric matrix, if and If elements do not exist simultaneously or have different values, their asymmetric coupling information can be preserved using directed edges or directional message passing. Therefore, the local coupling relationships, non-zero element distributions, and matrix numerical information in the original sparse linear system can be utilized by graph neural networks. The subsequent graph neural network preconditioner uses right-hand side terms... and matrix The corresponding graph structure serves as the input, learning the mapping relationship from the right-hand side to the approximate solution, which is used to approximate the matrix inverse operator and accelerate the iterative solution process.

[0127] Preferably, in step S2, after completing the sparse linear system graph modeling, for a given sparse coefficient matrix... Training samples are constructed to train the GNN preconditioner. These training samples enable the GNN preconditioner to learn the mapping relationship between the right-hand side term vector and the corresponding flow field variables or iterative corrections in fluid numerical simulations, thereby providing preconditioning acceleration capabilities for the subsequent FGMRES iteration process.

[0128] For sparse coefficient matrix Several solution vector samples are generated through random sampling. Then, the corresponding right-hand side terms are obtained through matrix multiplication. This forms training sample pairs ( ),in, As input to the GNN preconditioner, As the corresponding solution space monitoring signal. Meanwhile, due to therefore It can also be used as a monitoring signal in residual constraints to ensure that the network output satisfies the original sparse linear equations of hydrodynamics. This sample generation method does not require additional calls to traditional linear equation solvers to obtain training data; instead, it uses known matrices... Training pairs are generated directly from the constructed solution vector samples, thus reducing the computational overhead in the training data construction process.

[0129] Example 3

[0130] A GNN preconditioning iteration acceleration method for fluid numerical simulation, as described in Example 2, differs in that, in step S3, based on training sample pairs ( ),in For the solution vector sample The calculated right-hand side vector serves as both the input to the GNN preconditioner and the monitoring signal in the residual constraints. As the corresponding solution space monitoring signal, it is used to constrain the network output to approximate the true solution vector;

[0131] GNN preconditioners use right-hand terms sum matrix Using a graph structure as input, an approximate solution is output through a message-passing process on the graph:

[0132]

[0133] in, The parameter is GNN preconditioners, This indicates that the network represents the true solution. An approximate solution;

[0134] The GNN preconditioner network structure consists of an input encoding layer, several residual map convolutional layers, and an output decoding layer. The input encoding layer is used to convert the right-hand term vector... Mapping to node features enables the right-hand side information in the sparse linear equations of fluid mechanics to be processed by graph neural networks; residual graph convolutional layers are used to combine the sparse coefficient matrix. The graph structure is used for neighborhood information propagation to extract local coupling relationships and numerical correlation features between fluid mesh elements or discrete degrees of freedom; the output decoding layer is used to map the propagated node features back to the solution vector space to obtain an approximate solution. .

[0135] To accommodate the significant scale differences in right-hand side terms across various fluid numerical simulation problems, this invention incorporates scale normalization and denormalization at both the input and output ends. This reduces the impact of numerical scale variations on the training process, improving the training stability and acceleration of the GNN preconditioner. Through this network structure, the GNN preconditioner can utilize the non-zero structure, edge weight information, and local coupling relationships of the fluid dynamics sparse matrix to learn preconditioning maps suitable for subsequent FGMRES iterations.

[0136] Preferably, in terms of the training objective, this invention employs a hybrid loss function combining residual constraints and solution space supervision. In an ill-conditioned matrix, a small residual does not necessarily correspond to a small solution error. To address this issue, a hybrid loss function combining residual constraints and solution space supervision is used during training. The specific process is as follows:

[0137] First, using As a monitoring signal, the residual loss term is defined. :

[0138]

[0139] This residual loss term is used to constrain the network output to satisfy the original linear equation system.

[0140] Secondly, define the solution space loss term. :

[0141]

[0142] The solution space loss term is used to directly constrain the difference between the network output and the true solution;

[0143] Then, the residual loss term and the solution space loss term are weighted and combined to obtain the mixed loss function. :

[0144]

[0145] in, The weighting parameter is used to adjust the ratio between residual constraints and solution space supervision. The value should not be too large, because solution space supervision is an auxiliary term. It is adjusted between 0.01 and 1 based on the matrix condition number, the scale of the right-hand side, and the training stability. In this embodiment... Setting the value to 0.1 enhances the stability of the solution space while ensuring that residual constraints dominate training. Through the aforementioned hybrid loss function, this invention constrains the network output to satisfy the relationships of the sparse linear equations of hydrodynamics during training, and also directly constrains the difference between the network output and the true solution, thereby alleviating the instability problem that may occur when relying solely on residual loss for inverse operator approximation. This training method can improve the approximation ability of the GNN preconditioner for the inverse operators of sparse hydrodynamic matrices, and is particularly suitable for sparse hydrodynamic matrices with complex geometries, unstructured meshes, pressure-velocity coupling, large condition numbers, or poor numerical properties, providing a more stable preconditioning acceleration effect for subsequent iterations.

[0146] Example 4

[0147] A method for accelerating GNN preconditioning iterations in fluid numerical simulation, as described in Example 3, differs in that it introduces a model parameter optimization method based on iterative solution feedback. During training, the current model is saved every set number of training epochs, and the current GNN preconditioner is embedded in the FGMRES iteration process for short-step verification, recording the residual decrease sequence. In the model verification stage, instead of running FGMRES to full convergence, only the first K pre-set iterations are run. By comparing the residual decrease rate and magnitude of different candidate models within the same number of short steps, model parameters that are more conducive to rapid residual reduction can be selected, thus avoiding the problem of poor actual preconditioning performance caused by selecting a model solely based on training loss. Model evaluation metrics are calculated based on the residual decrease, and model parameters with better actual preconditioning acceleration effects are selected as the final preconditioner parameters. In this way, model parameter selection no longer relies solely on training loss but combines its actual residual decrease performance in the linear solution stage of fluid dynamics numerical simulation, thereby improving the acceleration effect and convergence stability of the preconditioner in the iteration process.

[0148] like Figure 2 As shown, the specific steps are as follows:

[0149] ① Set the total number of training rounds, validation interval E, and truncation step number. and relative residual threshold The total number of training rounds controls the training process of the graph neural network preconditioner; the validation interval determines how many rounds to perform model evaluation; the truncation iteration step count controls the number of iterations the iterative solver runs during validation; the residual threshold is used to determine whether the FGMRES iteration has reached the convergence condition and is used to calculate the residual descent evaluation index during the model parameter optimization process, with a value of [value missing]. While ensuring the accuracy of linear solutions in numerical simulations of fluid mechanics, we avoid excessively strict convergence conditions that could lead to excessive iterations and computational overhead.

[0150] In this embodiment, the total number of training rounds is 2000, the validation interval E=100, and the relative residual threshold is... .

[0151] ② Use a hybrid loss function during training. The parameters of the GNN preconditioner are updated, and the current model parameters are saved after each set number of validation intervals E. This yields a candidate GNN preconditioner;

[0152] ③ Every 100 rounds of training the GNN preconditioner, the current model is embedded into the iterative solver (FGMRES) to perform short-step iterative solutions on the validation right-hand side. This process does not require a complete solution to convergence, but only performs the first few iterations to observe the effect of the current preconditioner on the residual descent process.

[0153] ④ Record the residual sequence during the truncation iteration process: ,in, To truncate the number of iterations, Indicates the first The relative residual after one iteration;

[0154] ⑤ Calculate and iteratively solve the evaluation index based on the residual sequence. :

[0155]

[0156] in, To truncate the number of iterations, For the first The relative residual after one iteration;

[0157] The smaller the value, the higher the current model's ranking. The better the residual reduction effect in the iterative solver, the better the model parameters. The corresponding GNN preconditioner is more conducive to actual iterative solution;

[0158] ⑥ Compare the current model's iterative solution evaluation index with the historical best index. If the current model's iterative solution evaluation index is less than the historical best index, then update the current model parameters to the optimal model parameters; otherwise, continue training and wait for the next validation.

[0159] ⑦ After the total number of training rounds of the GNN preconditioner is completed, the model parameters with the best evaluation index obtained through iterative solution are selected as the final GNN preconditioner parameters, instead of simply selecting the model with the lowest training loss or the model corresponding to the final training round. Therefore, the selection of model parameters is no longer based solely on the training loss, but rather on its actual residual reduction performance after being embedded in the iterative solver, thereby improving the actual solution performance of the final preconditioner.

[0160] By using the above method, the present invention can avoid the problem that the training error may be small but the actual solution effect may be poor when selecting a model based solely on the training loss.

[0161] Example 5

[0162] A method for accelerating GNN preconditioning iteration for fluid numerical simulation, as described in Example 4, differs in that, in step S4, after completing the GNN preconditioner training and model parameter optimization, the trained and optimized model parameters are denoted as... The corresponding GNN preconditioner is denoted as Subsequently, this preconditioner is embedded as a preconditioning operation in the iteration process of the Flexible Generalized Minimum Residual Method (FGMRES) to accelerate the preconditioning of sparse linear equation sets formed in fluid dynamics numerical simulations.

[0163]

[0164] in, This represents the sparse coefficient matrix obtained after mesh discretization and linearization of the fluid control equations. For the flow field variables or iterative corrections to be determined, The vector of terms on the right-hand side;

[0165] Since the GNN preconditioner is a learned nonlinear mapping, its preconditioning effect may change with the input vector. Therefore, this invention uses FGMRES as the outer iterative solver. In each iteration, the flexible generalized minimum residual method is invoked. A preconditional transformation is performed on the current basis vector to generate a preconditional vector. This preconditional vector is then used to update the iterative subspace and approximate solution, thereby accelerating the residual descent and improving the computational efficiency and convergence stability of the linear solution stage in fluid dynamics numerical simulation. For example... Figure 3 The specific solution process is as follows:

[0166] S41, Given an initial solution Calculate the initial residual :

[0167]

[0168] like The convergence condition has been met (the convergence condition is...). If ), then output directly. Otherwise, normalize the initial residuals to obtain the first basis vector. :

[0169]

[0170] The norm of the initial residual vector;

[0171] S42, in the In each iteration, the current basis vector is... Input the trained GNN preconditioner to obtain the preconditioning vector. :

[0172]

[0173] in, Represents the basis vectors in the current iteration. This represents the precondition vector after processing by the GNN preconditioner; this step is equivalent to using a trained neural network to perform a precondition transformation on the current direction.

[0174] S43, Calculate matrix-vector product :

[0175]

[0176] Then to Orthogonalization is performed to obtain new basis vectors, and the iterative subspace is further expanded. Specifically, for... During orthogonalization, it is sequentially orthogonalized with existing basis vectors. Take the inner product and subtract its projection onto these basis vectors, i.e. This process ensures that the resulting vector is orthogonal to the existing basis vectors. Then, the vector is normalized to obtain new basis vectors. And add it to the current Krylov subspace for the next FGMRES iteration;

[0177] S44, passing through After each iteration, the precondition vectors obtained in each step are combined into a matrix. :

[0178]

[0179] The Flexible Generalized Minimum Residual Method (FGMRES) obtains a set of combination coefficients based on the currently constructed iterative subspace. (FGMRES first) The precondition vector is obtained in the step iteration. and arrange them into a matrix Subsequently, FGMRES searches for combination coefficients in the low-dimensional subspace spanned by these preconditioning vectors. To make the approximate solution The corresponding residual norm should be as small as possible, i.e. (to be as small as possible), and based on the combination coefficients and precondition vector, the initial solution is corrected to obtain the first... Approximate solution in one step:

[0180]

[0181] in, This is an approximate solution obtained in the current iteration. In other words, the final solution is not obtained directly from a single output of the neural network, but rather through multiple preconditioning vectors during the FGMRES iteration process. According to the coefficient After combining, the initial solution The correction was obtained.

[0182] S45, Calculate the residual of the current approximate solution. :

[0183]

[0184] If the residual satisfies the set convergence condition, or the maximum number of iterations is reached, then the iteration stops and the current approximate solution is output. Otherwise, Return to step S42 and continue to the next iteration.

[0185] In the above manner, the preconditioner of the trained graph neural network is repeatedly called during the FGMRES iteration process to generate precondition vectors, accelerate the residual descent speed, and improve the iterative solution effect of sparse linear systems.

[0186] Example 6

[0187] A GNN preconditioning iteration acceleration system for fluid numerical simulation, used to implement the GNN preconditioning iteration acceleration method for fluid numerical simulation as described in any of Examples 1-5, includes:

[0188] The sparse linear system graph modeling module for fluid mechanics is used to model the sparse coefficient matrix formed by the mesh discretization and linearization of the governing equations in numerical simulations of fluid mechanics. Represented as a graph structure;

[0189] The training sample generation module is used to generate training samples from a given sparse coefficient matrix. Construct training samples;

[0190] The GNN preconditioner training module is used to build and train GNN preconditioners for numerical simulation of fluid mechanics, enabling the GNN preconditioner to learn the mapping relationship between the right-hand term vector and the approximate solution in the sparse linear equation system of fluid mechanics.

[0191] The preconditioner is embedded in the FGMRES acceleration iteration module to embed the trained GNN preconditioner as a preconditioning operation into the iteration process of the Flexible Generalized Minimum Residual Method (FGMRES) to accelerate the preconditioning of sparse linear equations formed in fluid dynamics numerical simulation.

[0192] To verify the effectiveness of this invention, the experimental environment and parameters are as follows:

[0193] Experimental environment:

[0194] GPU: NVIDIA GeForce RTX 5060;

[0195] Operating system: Windows 10 Pro, Ubuntu 22.04.5 LTS under WSL2;

[0196] Software environment: Python 3.9.23, PyTorch 2.8.0, CUDA 12.9, cuDNN 9.10.2.

[0197] Experimental parameters:

[0198] The experiment selected the Goodwin_040 matrix from the Goodwin group in the SuiteSparse Matrix Collection as the test object. Goodwin_040 is a computational fluid dynamics matrix from the Goodwin group in the SuiteSparse Matrix Collection, derived from the finite element discretization of the Navier–Stokes equations and related transport equations. This matrix has a size of 17922 × 17922, contains 561677 non-zero elements, and is a real, asymmetric, non-positive definite sparse matrix, abbreviated as Goodwin / Goodwin_040 matrix. It can be used to verify the applicability of the method of this invention in sparse linear systems for numerical simulation of fluid dynamics.

[0199] Two methods, GNP-Base and SA-GNP, were used for accelerated validation. GNP-Base represents the original graph neural network preconditioning method, while SA-GNP represents the complete method that simultaneously employs a hybrid loss function and an iterative solution-based feedback model parameter optimization method, i.e., the method of this invention. In the experiments, both methods used the same FGMRES solution settings, with a maximum number of iterations set to 100, and used the same test right-hand side terms and stopping conditions.

[0200] Evaluation metrics include the residual convergence curve and the TRA metric. The residual convergence curve is used to observe how the relative residual changes with the number of iterations, while TRA measures the overall effect of the residual decreasing over time. The formula is as follows:

[0201]

[0202] in, For the first The relative residual after the next iteration For the first The cumulative time corresponding to each iteration;

[0203] Intuitively, TRA can be understood as the area under the residual convergence curve on the time axis; the smaller the value, the faster the residual decreases in a shorter time. If a method can quickly reduce the residual in the early stages or maintain a low residual level throughout the solution process, its TRA is usually smaller, indicating that the method has better practical solution efficiency.

[0204] The results are as follows Figure 4 , Figure 5 As shown, where Figure 4 The residual convergence curves on the HB / gemat11 matrix are presented. The results show that GNP-Base exhibits a slow residual decrease after the initial few steps, and tends to level off near higher residual levels. In contrast, the present invention (SA-GNP) reduces the relative residual by approximately two orders of magnitude compared to GNP-Base. This result demonstrates that the method of the present invention can improve the actual residual descent process of the graph neural network preconditioner in FGMRES.

[0205] Figure 5 The TRA (Trait Area Reduction) metrics on the HB / gemat11 matrix are compared. The TRA of GNP-Base is approximately 4.8, while that of this invention (SA-GNP) is approximately 2.6, indicating that the method of this invention significantly reduces the residual area in the runtime dimension. Compared to the original graph neural network preconditioning method, this invention achieves better time residual reduction under the same solution settings.

[0206] In summary, on the fluid dynamics correlation matrix HB / gemat11, the method of this invention exhibits a faster residual descent rate and a lower TRA index compared to GNP-Base. Experimental results demonstrate that the hybrid loss function and the model parameter optimization method based on iterative solution feedback can jointly improve the actual solution performance of the graph neural network preconditioner, making it more suitable for the FGMRES iterative solution process of computational fluid dynamics sparse linear systems.

[0207] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A GNN preconditioning iterative acceleration method for fluid numerical simulation, characterized in that, Includes the following steps: S1 represents the sparse coefficient matrix formed by the mesh discretization and linearization of the governing equations in fluid dynamics numerical simulation. Represented as a graph structure; S2, for a given sparse coefficient matrix Construct training samples; S3. Construct and train a GNN preconditioner for numerical simulation of fluid mechanics, so that the GNN preconditioner can learn the mapping relationship between the right-hand term vector and the approximate solution in the sparse linear equation system of fluid mechanics. S4 embeds the trained GNN preconditioner as a preconditioning operation into the iterative process of the flexible generalized minimum residual method for solving, and is used to accelerate the preconditioning of sparse linear equations formed in fluid dynamics numerical simulation.

2. The GNN preconditioning iterative acceleration method for fluid numerical simulation according to claim 1, characterized in that, In step S1, since the local discretization scheme only involves the current element and its neighboring elements, for the first... For a given grid cell or node, the discrete equation can be summarized as follows: in, Indicates the first Unknown quantities on a unit or node Indicates the relationship with the first A set of units or nodes that are adjacent or coupled. Represents the unknown quantity of adjacent units. This represents the coefficient corresponding to the current unknown quantity. Indicates the first In the equation, with the first The coupling coefficients corresponding to the unknown quantities Indicates the first The right-hand side terms corresponding to each discrete equation; Arrange the discrete equations on all grid cells or nodes according to the unknown number to obtain a matrix form: in, This represents the sparse coefficient matrix obtained after mesh discretization and linearization of the fluid control equations. For the flow field variables or iterative corrections to be determined, The vector of terms on the right-hand side; In the matrix In the middle, the first The matrix corresponding to each discrete equation The Okay, the coefficients of the current unknowns Write the coupling coefficients of adjacent unknowns or related degrees of freedom at the diagonal positions of the matrix. Write it to the off-diagonal position of the matrix, that is: in, Representation matrix The Middle Line 1 The element of the column corresponds to the first... unknown quantity In the The self-coefficients of a discrete equation; Representation matrix The Middle Line 1 The element of the column corresponds to the first... Adjacent unknowns or related degrees of freedom In the The coupling coefficients in a discrete equation.

3. The GNN preconditioning iterative acceleration method for fluid numerical simulation according to claim 2, characterized in that, In step S1, the sparse coefficient matrix is ​​obtained. Then, the sparse coefficient matrix Represented as a graph structure, specifically: Treat each unknown or discrete degree of freedom in the matrix as a node in the graph; if the matrix elements Then it means the first The unknown quantity participates in the first There are several discrete equations, and the two equations are coupled. Therefore, nodes are established in the graph. With nodes Connections between them; matrix elements The values ​​are used as edge weights or matrix coefficients in the message passing process.

4. The GNN preconditioning iterative acceleration method for fluid numerical simulation according to claim 3, characterized in that, In step S2, for the sparse coefficient matrix Generate several solution vector samples Then, the corresponding right-hand side terms are obtained through matrix multiplication. This forms training sample pairs ( ).

5. The GNN preconditioning iterative acceleration method for fluid numerical simulation according to claim 4, characterized in that, In step S2, the solution vector samples Samples can be generated through random sampling or by combining the Arnoldi process to generate partial samples.

6. The GNN preconditioning iterative acceleration method for fluid numerical simulation according to claim 5, characterized in that, In step S3, based on the training sample pairs ( ),in For the solution vector sample The calculated right-hand side vector serves as both the input to the GNN preconditioner and the monitoring signal in the residual constraints. As the corresponding solution space monitoring signal; GNN preconditioners use right-hand terms sum matrix Using a graph structure as input, an approximate solution is output through a message-passing process on the graph: in, The parameter is GNN preconditioners, Indicates the true solution An approximate solution; The GNN preconditioner network structure consists of an input encoding layer, several residual map convolutional layers, and an output decoding layer. The input encoding layer is used to convert the right-hand term vector... Mapping to node features enables the right-hand side information in the sparse linear equations of fluid mechanics to be processed by graph neural networks; residual graph convolutional layers are used to combine the sparse coefficient matrix. The graph structure is used for neighborhood information propagation to extract local coupling relationships and numerical correlation features between fluid mesh elements or discrete degrees of freedom; the output decoding layer is used to map the propagated node features back to the solution vector space to obtain an approximate solution. .

7. The GNN preconditioning iterative acceleration method for fluid numerical simulation according to claim 6, characterized in that, During training, a hybrid loss function combining residual constraints and solution space supervision is used. The specific process is as follows: First, using As a monitoring signal, the residual loss term is defined. : Secondly, define the solution space loss term. : Then, the residual loss term and the solution space loss term are weighted and combined to obtain the mixed loss function. : in, is a weighting parameter used to adjust the ratio between residual constraints and solution space supervision.

8. The GNN preconditioning iterative acceleration method for fluid numerical simulation according to claim 7, characterized in that, A model parameter optimization method based on iterative solution feedback is introduced, with the following steps: ① Set the total number of training rounds, validation interval E, and truncation step number. and relative residual threshold; ② Use a hybrid loss function during training. The parameters of the GNN preconditioner are updated, and the current model parameters are saved after each set number of validation intervals E. This yields a candidate GNN preconditioner; ③ Embed the current candidate GNN preconditioner into the iterative solver and perform short-step iterative solutions on the right-hand side of the verification term; ④ Record the residual sequence during the truncation iteration process: ,in, To truncate the number of iterations, Indicates the first The relative residual after one iteration; ⑤ Calculate and iteratively solve the evaluation index based on the residual sequence. : The smaller the value, the higher the current model's ranking. The better the residual reduction effect in the iterative solver, the better the model parameters. The corresponding GNN preconditioner is more conducive to actual iterative solution; ⑥ Compare the current model's iterative solution evaluation index with the historical best index. If the current model's iterative solution evaluation index is less than the historical best index, then update the current model parameters to the optimal model parameters; otherwise, continue training and wait for the next validation. ⑦ After training, select the model parameters with the optimal evaluation index obtained through iterative solution as the final GNN preconditioner parameters.

9. The GNN preconditioning iterative acceleration method for fluid numerical simulation according to claim 8, characterized in that, In step S4, the trained and optimized model parameters are denoted as... The corresponding GNN preconditioner is denoted as The solution process is as follows: S41, Given an initial solution Calculate the initial residual : like If the convergence condition has been met, output directly. ; Otherwise, normalize the initial residuals to obtain the first basis vector. : in, The norm of the initial residual vector; S42, in the In each iteration, the current basis vector is... Input the trained GNN preconditioner to obtain the preconditioning vector. : in, Represents the basis vectors in the current iteration. This represents the precondition vector after processing by the GNN preconditioner; S43, Calculate matrix-vector product : Then to Orthogonalize the vectors to obtain new basis vectors, and continue to expand the iterative subspace; S44, passing through After each iteration, the precondition vectors obtained in each step are combined into a matrix. : The Flexible Generalized Minimum Residual Method (FGMRES) obtains a set of combination coefficients based on the currently constructed iterative subspace. And based on the combination coefficients and precondition vector, the initial solution is corrected to obtain the first... Approximate solution in one step: in, This is the approximate solution obtained in the current iteration; S45, Calculate the residual of the current approximate solution. : If the residual satisfies the set convergence condition, or the maximum number of iterations is reached, then the iteration stops and the current approximate solution is output. ; Otherwise Return to step S42 and continue to the next iteration.

10. A GNN preconditioning iteration acceleration system for fluid numerical simulation, used to implement the GNN preconditioning iteration acceleration method for fluid numerical simulation as described in any one of claims 1-9, characterized in that, include: The sparse linear system graph modeling module for fluid mechanics is used to model the sparse coefficient matrix formed by the mesh discretization and linearization of the governing equations in numerical simulations of fluid mechanics. Represented as a graph structure; The training sample generation module is used to generate training samples from a given sparse coefficient matrix. Construct training samples; The GNN preconditioner training module is used to build and train GNN preconditioners for numerical simulation of fluid mechanics, enabling the GNN preconditioner to learn the mapping relationship between the right-hand term vector and the approximate solution in the sparse linear equation system of fluid mechanics. The preconditioner is embedded in the FGMRES acceleration iteration module to embed the trained GNN preconditioner as a preconditioning operation into the iteration process of the flexible generalized minimum residual method, so as to accelerate the preconditioning of the sparse linear equation system formed in the numerical simulation of fluid mechanics.