Three-dimensional unstructured grid adaptive refining method and system based on machine learning

By using PINNs combined with the residual of the fluid control equation as an error indicator, the problems of high computational cost and slow error convergence of existing AMR technology in three-dimensional unstructured grids are solved, and efficient and accurate grid adaptive refinement is achieved, which is suitable for complex flow scenarios and solving various partial differential equations.

CN120706306APending Publication Date: 2025-09-26ZHEJIANG UNIV
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202510808673.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing AMR technology lacks reliable error indicators in three-dimensional unstructured grids, resulting in high computational cost and slow error convergence, making it difficult to flexibly apply it in complex flow scenarios.

Method used

Physical information neural networks (PINNs) are used in combination with the residual of the fluid governing equation as an error indicator. The residual values ​​of the flow field data and the governing equation are calculated by training PINNs, the grid cells that need to be refined are marked, and the grid is adaptively refined through Delaunay tetrahedron partitioning.

Benefits of technology

It achieves efficient and accurate mesh adaptive refinement in three-dimensional unstructured grids, reduces computational overhead, improves computational accuracy and mesh quality, and is suitable for solving incompressible/compressible flows and other partial differential equations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120706306A_ABST
    Figure CN120706306A_ABST
Patent Text Reader

Abstract

The invention discloses a three-dimensional unstructured grid adaptive refinement method and system based on machine learning, and belongs to the field of machine learning, partial differential equation solving and computational fluid mechanics simulation. Residual errors of a fluid control equation are used as a novel error indicator and a refinement criterion, imprecise flow field data and the fluid control equation are obtained by fusing coarse grids of simulation flow through a physical information neural network, and the total residual errors of the equations are conveniently calculated by using automatic differentiation after training is completed. Therefore, the coarse grid units with relatively high residual errors can be adaptively marked and refined. By matching an h-refinement scheme, Delaunay tetrahedron subdivision is executed after vertexes are strategically inserted to maintain the quality of the refined grid. According to the method, any numerical solver can be flexibly matched to carry out grid adaptive refinement, so that various typical flow problems can be solved with high precision. The method achieves better balance between calculation precision and the number of grids, and has the advantages of being simple, convenient, high in compatibility and universality and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the fields of machine learning, partial differential equation solving and computational fluid dynamics simulation, and specifically relates to a three-dimensional unstructured grid adaptive refinement method and system based on machine learning. Background Art

[0002] Proper mesh generation is crucial for accurate and efficient fluid dynamics simulations. In computational fluid dynamics simulations, resolving key flow features often requires a denser mesh within the flow region. A mesh that is too coarse results in poor computational accuracy, while a mesh that is too dense significantly increases computational cost. Therefore, adaptive mesh refinement (AMR) is often used when solving classical equations in fluid dynamics, such as the Navier-Stokes equations for incompressible flow and the Euler equations for inviscid, compressible flow. As a method for adaptively adjusting mesh resolution, AMR enables targeted localized mesh refinement in areas where improved accuracy is required. Traditional AMR methods follow an iterative "solve-estimate-mark-refine" meshing process: 1. First, the governing equations are numerically solved on a coarse mesh; 2. The mesh cell errors are estimated using an error indicator; 3. Mesh cells with large errors are marked; 4. These marked cells are refined, the mesh updated, and the solution is repeated. As an effective method for solving partial differential equations, AMR can improve solution accuracy while minimizing computational cost. By performing a sensitivity analysis of meshes at different resolutions, the optimal mesh that combines accuracy and efficiency can be determined.

[0003] One of the main challenges faced when implementing AMR technology is the lack of a reliable error indicator (or refinement criterion). Existing AMR techniques are typically based on the assumption that insufficient grid resolution will result in larger errors in regions with large gradients or related quantities. Based on this characteristic, the grid resolution is adjusted by refining the cells in these regions. However, local refinement based solely on gradients or related quantities does not guarantee a simultaneous reduction in other global errors and may even lead to inaccurate results. Furthermore, there is still significant room for improvement in grid partitioning and storage efficiency. Existing AMR methods and their improved versions mostly rely on the gradient or curvature of the solution as error indicators and are primarily applied to carefully designed structured grids. However, in many cases, AMR based on these metrics still requires unnecessary refinement across a large computational domain, resulting in a large number of meshes after refinement and slow convergence of computational errors. Furthermore, each solver typically has its own proprietary AMR algorithm built in, making it difficult to flexibly call upon one another, making it difficult to deploy new AMR algorithms within traditional solvers. Therefore, it is necessary to explore a more flexible and reliable AMR error indicator that can be applied to a wider range of flow scenarios, compatible with any numerical solver, and can also be used to refine more complex unstructured grids. Summary of the Invention

[0004] The present invention aims to overcome the shortcomings of conventional AMR techniques in the prior art and provide a method and system for adaptive refinement of three-dimensional unstructured grids based on machine learning. Existing AMR methods still rely heavily on the gradient or curvature of the solution as error indicators. In many cases, AMR based on these indicators still requires unnecessary refinement within a large computational domain, resulting in high computational cost and slow error convergence. The present invention proposes using the residual of the governing equation as a novel error indicator for the AMR process. Compared with the gradient or curvature of a single physical quantity, the overall residual of the governing equation provides a more global representation of the error and a broader perspective on the error distribution. The present invention utilizes physics-informed neural networks (PINNs) to fuse low-precision solution data on a coarse grid with the governing equation. After training, the PINNs use automatic differentiation to quickly and easily calculate the residual of the equation, thereby adaptively identifying and marking coarse grid cells with relatively high residuals. A refinement criterion based on the governing equation residual is combined with a designed mesh refinement scheme to ensure the quality of the refined mesh cells by strategically inserting vertices and performing Delaunay tetrahedronization. This method can be flexibly used with any classic numerical solver for computational fluid dynamics simulations to adaptively refine the mesh, solving various types of partial differential equations (PDEs) with high precision, thereby efficiently simulating incompressible and compressible flow scenarios. Compared with traditional error indicators and AMR processes, this method strikes a good balance between computational accuracy and mesh size, offering advantages such as high efficiency, simplicity, compatibility, and versatility.

[0005] The specific technical solutions adopted in the present invention are as follows:

[0006] In a first aspect, the present invention provides a method for adaptive refinement of a three-dimensional unstructured grid based on machine learning, as follows:

[0007] S1: On the mesh to be refined, which has been used for computational fluid dynamics simulation of fluid flow, the numerical solver in computational fluid dynamics is used to solve the fluid governing equations, and the flow field data at all nodes of the mesh to be refined after the solution is completed are extracted;

[0008] S2: Constructing a physical information neural network, introducing the fluid control equation as a physical constraint into the physical information neural network, and combining it with the flow field data in S1 to jointly constitute a total loss function of the physical information neural network; training the physical information neural network to minimize the total loss function, thereby obtaining a trained physical information neural network;

[0009] S3: Using the physical information neural network trained in S2, predict the residual value of the fluid control equation at the center of each grid cell in the grid to be refined in S1;

[0010] S4: sorting the corresponding grid cells according to the residual values ​​of all fluid control equations in S3, and marking the grid cells with residual values ​​greater than a predetermined percentage as grid cells to be refined;

[0011] S5: Apply the h-refinement scheme to refine the grid cells to be refined, and iterate the obtained new grid to be refined according to S1-S5 until the target physical quantity reaches the preset convergence condition as the grid cells are gradually refined. Then, the iteration is terminated to obtain the optimal grid that meets the required accuracy and number of grid cells.

[0012] Preferably, in S1, the numerical solver is one of ANSYS Fluent, OpenFOAM, STAR-CCM+, SU2, CFX, and COMSOL.

[0013] Preferably, in S1, the fluid control equation is the Navier-Stokes equation, which is expressed in three-dimensional Cartesian coordinates as follows:

[0014]

[0015]

[0016] Where u = (u, v, w) is the velocity vector of the fluid, where u, v, and w are the velocity components of the fluid in the x, y, and z directions, respectively; p is the pressure; t is the time; and Reynolds number Re = UD / ν, where U is the characteristic velocity, D is the characteristic length, and ν is the kinematic viscosity.

[0017] Preferably, in S1, if the fluid flows compressibly, the flow field data includes velocity, pressure and density; if the fluid flows incompressibly, the flow field data includes velocity and pressure; wherein the velocity includes the components of the fluid in the x, y and z directions.

[0018] Preferably, the total loss function of the physical information neural network in S2 is obtained by the following method:

[0019] The fluid control equations and flow field data are combined in the loss function in the form of mean square error, and the final total loss function is It is expressed as the sum of the two:

[0020]

[0021] in, and They represent the loss term of the fluid control equation and the loss term of the flow field data respectively; θ represents all trainable parameters in the physical information neural network;

[0022] The specific form of each loss item is:

[0023]

[0024] Where u = (u, v, w) is the velocity vector of the fluid, where u, v, and w are the velocity components of the fluid in the x, y, and z directions, respectively; p is the pressure; t is the time; Reynolds number Re = UD / ν, where U is the characteristic velocity, D is the characteristic length, and ν is the kinematic viscosity; and They represent the fluid velocity u at point The network prediction value and the true observation value at N f is the total number of training points used to impose physical constraints; N d is the number of known observation data points; and Represents the pressure p at point The network prediction value and the true observation value at ; and Denotes the density ρ at point The network prediction value and the true observation value at .

[0025] Preferably, in S2, the physical information neural network is trained using a phased optimization strategy, specifically as follows:

[0026] First, the Adam optimizer is used for preliminary training, and its learning rate adopts a decreasing scheduling strategy, as follows: 1×10 -3 The learning rate was then reduced to 5×10 -4 , and the last 20,000 training cycles were further reduced to 1×10 -4 ;

[0027] After the Adam optimizer training is completed, the L-BFGS optimizer is used for fine optimization to further reduce the residual error and improve the model accuracy.

[0028] Preferably, the S3 is as follows:

[0029] Based on the physical information neural network trained in S2, the automatic differentiation technology is used to calculate the first-order or second-order partial derivatives of each flow field data in the fluid control equation, and then the residual value of the fluid control equation at the center of each grid cell in the grid to be refined is predicted, which represents the error of each grid cell; among them, the total residual R at the center of each grid cell is f is the sum of the absolute values ​​of the continuity equation and the momentum equation, expressed as:

[0030]

[0031] Where u = (u, v, w) is the velocity vector of the fluid, where u, v, and w are the velocity components of the fluid in the x, y, and z directions, respectively; p is the pressure; t is the time; and Reynolds number Re = UD / ν, where U is the characteristic velocity, D is the characteristic length, and ν is the kinematic viscosity.

[0032] Compared with the gradient or curvature of a single physical quantity, the overall residual of PDEs can provide a more global error representation and a broader perspective on error distribution, making it a more accurate and reliable AMR error indicator.

[0033] Preferably, in S4, a fixed ratio strategy is adopted as a grid unit refinement rule, and effective control of the number of cells in the grid is achieved by refining the total number of grid cells in a fixed ratio.

[0034] Preferably, in S5, the h-refinement scheme is to reduce the characteristic length of the grid cell by an edge bisection operation, and subdivide each grid cell into eight smaller tetrahedral cells without changing the grid cell type, as follows:

[0035] After inserting new vertices at the midpoints of the edges of the marked mesh cells to be refined, Delaunay tetrahedron decomposition is performed to subdivide the parent mesh cell into eight finer child mesh cells. The new vertices and the four vertices of the original tetrahedron of the parent mesh cell form four child tetrahedrons. These four child tetrahedrons are similar to the original tetrahedron, and the remaining octahedron of the original tetrahedron is equally divided into four tetrahedrons.

[0036] In a second aspect, the present invention provides a three-dimensional unstructured grid adaptive refinement system based on machine learning, comprising:

[0037] The flow field data extraction module is used to solve the fluid control equations using the numerical solver in computational fluid dynamics on the grid to be refined in advance of computational fluid dynamics simulation of fluid flow, and to extract the flow field data on all nodes of the grid to be refined after the solution is completed;

[0038] a physical information neural network training module for constructing a physical information neural network, introducing the fluid control equation as a physical constraint into the physical information neural network, and combining it with the flow field data in the flow field data extraction module to jointly constitute a total loss function of the physical information neural network; training the physical information neural network to minimize the total loss function to obtain a trained physical information neural network;

[0039] a fluid control equation residual value prediction module, configured to use the physical information neural network trained in the physical information neural network acquisition module to predict the fluid control equation residual value at the center of each grid cell in the to-be-refined grid of the flow field data extraction module;

[0040] A grid unit marking module to be refined is used to sort the corresponding grid units according to the residual values ​​of all fluid control equations in the fluid control equation residual value prediction module, and mark the grid units with residual values ​​greater than a predetermined percentage as grid units to be refined;

[0041] The optimal grid acquisition module is used to apply the h-refinement scheme to refine the grid units to be refined, and iteratively execute the flow field data extraction module, the physical information neural network training module, the fluid control equation residual value prediction module, the grid unit marking module to be refined and the optimal grid acquisition module on the new grid to be refined. The iteration is terminated after the target physical quantity reaches the preset convergence condition as the grid units are gradually refined, and the optimal grid that meets the required accuracy and number of grid units is obtained.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] 1. The method provided by this paper is suitable for adaptive refinement of three-dimensional unstructured meshes and can be used for incompressible and compressible flow simulations, as well as solving various PDEs. This method strikes a good balance between computational accuracy and cost, significantly reducing computational overhead while maintaining accuracy.

[0044] 2. The present invention provides an error indicator based on the residuals of the control equations (i.e., the residuals of the fluid control equations). Compared with existing error indicators based on gradients or curvatures, the overall residuals of PDEs can provide a more global error representation and a broader perspective on the error distribution, making it a more accurate and reliable AMR error indicator.

[0045] 3. The present invention uses PINNs to combine the governing equations with the low-precision solution data on the coarse grid (i.e., the initial grid to be refined), and constructs a comprehensive loss function (i.e., the total loss function) that includes data loss terms and physical constraint terms, ensuring that the trained model conforms to both the governing equations and the grid node data.

[0046] 4. The trained PINNs in the present invention can conveniently calculate the PDEs residuals on the coarse grid, accurately and appropriately identify the grid cells that need to be refined, and reduce the over-refinement or computational waste that may exist in traditional AMR methods.

[0047] 5. The present invention uses PINNs as an external plug-in that can be used with any numerical solver for error estimation (only the physical quantity data obtained by the solution needs to be extracted), thereby adaptively refining the grid and forming an efficient "solve-train-estimate-label-refine" cycle process, providing a new technical solution for AMR in classic flow scenarios and various physical scenarios.

[0048] 6. The technical solution of the present invention has wide applicability. The proposed AMR based on the residual of the control equation can not only be used to efficiently solve incompressible / compressible flow problems, but can also be applied to solve other types of PDEs, providing reliable technical support for practical engineering applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 Schematic diagram of the control equation residual-guided mesh adaptive refinement method based on physical information neural network;

[0050] Figure 2 Schematic diagram of the training (TRAIN) process for solving the Navier-Stokes equations describing incompressible flows using the AMR framework based on the residuals of the fluid governing equations.

[0051] Figure 3 Schematic diagram of the estimation and marking process for solving the Navier-Stokes equations describing incompressible flow using the AMR framework based on the residuals of the fluid governing equations;

[0052] Figure 4 Schematic diagram of the h-refinement scheme applied to tetrahedral meshes;

[0053] Figure 5 In the embodiment of the present invention, in the AMR process based on the residual of the control equation (or PDEs) and the existing traditional error indicator, the obstacle on the ground is in the incompressible air flow (Reynolds number Re = 4.7×10 6 ) shows an example of the convergence characteristics of the linear velocity amplitude behind the obstacle along the incoming flow direction as a function of the number of grid cells. DETAILED DESCRIPTION

[0054] The present invention will be further described and illustrated below with reference to the accompanying drawings and specific embodiments. The technical features of each embodiment of the present invention may be combined accordingly, provided that there is no conflict between them.

[0055] Figure 1Figure 1 is a flow chart of a method for adaptive refinement of three-dimensional unstructured grids based on machine learning, provided by the present invention. The method follows a cyclic process of SOLVE → TRAIN → ESTIMATE → MARK → REFINE. The five steps of the present invention, "Solve - Train - Estimate - Mark - Refine," are as follows:

[0056] S1, solution: On the mesh to be refined in advance for computational fluid dynamics simulation of fluid flow, the numerical solver in computational fluid dynamics is used to solve the fluid control equations, and the flow field data on all nodes of the mesh to be refined after the solution is completed are extracted.

[0057] As a preferred embodiment of the present invention, the numerical solver is mainly one of ANSYS Fluent, OpenFOAM, STAR-CCM+, SU2, CFX, and COMSOL.

[0058] As a preferred embodiment of the present invention, the fluid control equation is the Navier-Stokes equation, which can be expressed in three-dimensional Cartesian coordinates as follows:

[0059]

[0060]

[0061] Where u = (u, v, w) is the velocity vector of the fluid, where u, v, and w are the velocity components of the fluid in the x, y, and z directions, respectively; p is the pressure; t is the time; and Reynolds number Re = UD / ν, where U is the characteristic velocity, D is the characteristic length, and ν is the kinematic viscosity.

[0062] As a preferred embodiment of the present invention, if the fluid flows compressibly, the flow field data includes velocity, pressure, and density; if the fluid flows incompressibly, the flow field data includes only velocity and pressure. The velocity includes the velocity components of the fluid in the x, y, and z directions.

[0063] In this step, the grid to be refined is a coarse grid, and the flow field solved based on the coarse grid has lower accuracy than the flow field solved based on the fine grid.

[0064] S2, Training: Construct a physical information neural network. The fluid governing equations from S1 are introduced as physical constraints into this neural network. These constraints are combined with the flow field data obtained in S1 (i.e., the low-precision flow field data simulated on the grid to be refined) to form the total loss function of the neural network. This neural network is then trained to minimize the total loss function, resulting in a fully trained neural network.

[0065] The PINNs model trained in the S2 step serves as an alternative model of the fluid flow process and can restore the distribution of the flow field on the coarse grid (i.e., the grid to be refined), thereby accurately predicting the residual of the fluid control equation.

[0066] As a preferred embodiment of the present invention, in this step, the total loss function of the physical information neural network is obtained by the following method:

[0067] The fluid control equations and flow field data are combined in the loss function in the form of mean square error (MSE), and the final total loss function is It is expressed as the sum of the two:

[0068]

[0069] in, and They represent the loss term of the fluid control equation and the loss term of the flow field data respectively; θ represents all trainable parameters (weights and biases) in the physical information neural network;

[0070] The specific form of each loss item is:

[0071]

[0072] Where u = (u, v, w) is the velocity vector of the fluid, where u, v, and w are the velocity components of the fluid in the x, y, and z directions, respectively; p is the pressure; t is the time; Reynolds number Re = UD / ν, where U is the characteristic velocity, D is the characteristic length, and ν is the kinematic viscosity; and They represent the fluid velocity u at point The network prediction value and the true observation value at N f is the total number of training points used to impose physical constraints; N d is the number of known observation data points; and Represents the pressure p at point The network prediction value and the true observation value at ; and Denotes the density ρ at point The network prediction value and the true observation value at .

[0073] As a preferred embodiment of the present invention, Figure 2Figure 2 shows a schematic diagram of the training (TRAIN) process in the adaptive mesh refinement framework based on residuals of the governing fluid equations, i.e., step S2. This training process is used to solve the Navier-Stokes equations. Specifically, the Navier-Stokes equations are coupled with low-precision flow field data obtained from a coarse grid to train PINNs. The training points correspond to the grid nodes. The total loss function used in the training process consists of two components:

[0074] (1) Fluid control equations: physical constraints constructed by the Navier-Stokes equations;

[0075] (2) Coarse grid flow field data part: the data fitting item is constructed from the flow field data on the coarse grid nodes.

[0076] Through the synergistic effect of the above two loss function components, the trained PINNs model is ensured to not only meet the constraints of the fluid control equations, but also accurately fit the flow field data of the coarse grid simulation.

[0077] As a preferred embodiment of the present invention, in this step, the physical information neural network is trained using a phased optimization strategy. The phased optimization strategy ensures both rapid convergence in the early stages of training and optimization accuracy in the later stages, thereby obtaining a high-quality PINNs model. The details are as follows:

[0078] First, the Adam optimizer is used for preliminary training, and its learning rate adopts a decreasing scheduling strategy, as follows: 1×10 -3 The learning rate was then reduced to 5×10 -4 , and the last 20,000 training cycles were further reduced to 1×10 -4 ;

[0079] After the Adam optimizer training is completed, the L-BFGS optimizer is used for fine optimization to further reduce the residual error and improve the model accuracy.

[0080] The machine learning method of the present invention is physical information neural network (PINNs), which is described in detail below:

[0081] The total loss function construction method of PINNs is unified. It can not only handle supervised learning scenarios with known flow field data, but also embed known fluid control equations as physical constraints. It can be trained by combining data-driven and physical constraints. By minimizing the total loss function, PINNs makes the prediction results not only fit the known flow field data, but also satisfy the physical laws described by the fluid control equations, thereby improving the accuracy and generalization ability of residual prediction on coarse grids.

[0082] The input of PINNs is the three-dimensional Cartesian space coordinates of the fluid flow, and the output is the physical quantities of the flow field to be solved, such as velocity, pressure and density; during the training phase, PINNs fuse the low-precision solution data obtained from the coarse grid with the fluid control equation to construct an alternative model of the coarse grid solution; the training points of PINNs correspond to all grid nodes of the coarse grid; the loss function used in the training process includes the fluid control equation part and the flow field data part obtained by coarse grid simulation; the fluid control equation part is a physical constraint term constructed based on the mean square error of the partial differential equation corresponding to the fluid flow problem; the flow field data part obtained by coarse grid simulation is a data fitting term constructed based on the mean square error of the low-precision flow field data on the coarse grid nodes that simulate the fluid flow; after the physical information neural network training is completed, automatic differentiation is used to derive the network output physical quantities (velocity, pressure, etc.) to calculate the absolute values ​​of all variables and differential operator combinations in the fluid control equation, thereby quickly predicting the residual of the fluid control equation.

[0083] The network structure of PINNs is a fully connected feedforward neural network; the structure of the feedforward neural network includes an input layer, a hidden layer, and an output layer; the input layer takes the three-dimensional spatial coordinates of the flow problem, such as x, y, and z, as input; the output layer takes the physical quantities of the flow field to be solved, such as velocity u, v, w, and pressure p (for the Euler equation of inviscid compressible flow, the output also includes density ρ) as output; the hidden layer contains neurons, activation functions, weights, and biases; the activation function is the hyperbolic tangent function; the network architecture contains 6 hidden layers, each containing 40 neurons.

[0084] S3, estimation: Using the physical information neural network trained in S2, predict the residual value of the fluid control equation at the center of each grid cell in the grid to be refined in S1. Each grid cell corresponds to a residual value of the fluid control equation.

[0085] As a preferred embodiment of the present invention, the steps are as follows:

[0086] Based on the physical information neural network trained in S2, the automatic differentiation technology is used to calculate the differential operator information such as the first-order or second-order partial derivatives of each flow field data in the fluid control equation, and then quickly predict the residual value of the fluid control equation at the center of each grid cell in the grid to be refined (that is, the residual of the fluid control equation at any position in the calculation domain), thereby representing the error of each grid cell; among them, the total residual at the center of each grid cell is the sum of the absolute values ​​of the residuals of each control equation, such as the total residual R of the Navier-Stokes equation f is the sum of the absolute values ​​of the continuity equation and the momentum equation, expressed as:

[0087]

[0088] Where u = (u, v, w) is the velocity vector of the fluid, where u, v, and w are the velocity components of the fluid in the x, y, and z directions, respectively; p is the pressure; t is the time; and Reynolds number Re = UD / ν, where U is the characteristic velocity, D is the characteristic length, and ν is the kinematic viscosity.

[0089] It should be noted that the absolute value of the residual itself does not have a clear physical meaning, but the relative size of these residual values ​​determines which grid cells need to be refined; based on this feature, the present invention does not need to scale or normalize the residual values ​​of each equation according to the size of the residual or other measurement indicators.

[0090] S4, marking: sorting the corresponding grid cells according to the residual values ​​of all fluid control equations in S3, and marking the grid cells with residual values ​​greater than a predetermined percentage as grid cells to be refined.

[0091] In this step, the marking process selects the tetrahedral mesh elements to be refined based on the error estimate of the control equation residual indicator (i.e., the size of the residual value of the fluid control equation); each mesh element is represented by its center point, and the larger the residual at the center point, the greater the error of the element.

[0092] As a preferred embodiment of the present invention, this step uses a fixed ratio strategy as the grid cell refinement rule. By refining a fixed ratio of the total number of grid cells, the number of cells in the grid is effectively controlled. Specifically, the grid cells are sorted according to the residual of the governing equation at each cell center, and the top n% of cells with the highest residuals are marked for subsequent refinement. The optimal value of the fixed ratio n% depends on the specific case, and generally a relatively small percentage is tried as a starting point.

[0093] like Figure 3 Figure 2 shows a schematic diagram of the estimation and marking process (steps S3 and S4) in the adaptive mesh refinement framework based on PDE residuals. This process is used to predict the residuals of the Navier-Stokes equations on a coarse grid. Using the trained PINNs model, the PDE residuals at the center of each coarse grid cell are predicted; the centroid of each grid cell represents its location. The specific implementation process includes:

[0094] (1) Residual estimation: The PDEs residual value at the center point of each tetrahedral grid cell is predicted by the trained PINNs model;

[0095] (2) Sorting: sort all cells in the coarse grid according to the residual size of their center points;

[0096] (3) Cell marking: A fixed ratio strategy is used to mark the top percentage of grid cells with higher residual values ​​as cells to be refined.

[0097] S5, refinement: Apply the h-refinement scheme to refine the above-mentioned mesh elements to be refined; calculate the midpoints of each edge of the marked tetrahedral element, add them to the original mesh node set, and then perform Delaunay tetrahedron decomposition to obtain a refined new mesh; the new mesh obtained after refinement is iteratively executed according to S1-S5 until the target physical quantity reaches the preset convergence condition as the mesh elements are gradually refined, and the iteration is terminated to obtain the optimal mesh that meets the required accuracy and number of mesh elements.

[0098] As a preferred embodiment of the present invention, Figure 4 As shown in Figure 2, the h-refinement scheme reduces the characteristic length of the mesh cell by dividing the edges equally. Without changing the mesh cell type, each mesh cell is subdivided into eight smaller tetrahedral cells, as follows:

[0099] After inserting new vertices at the midpoints of the edges of the marked mesh cells to be refined, Delaunay tetrahedron decomposition is performed to subdivide the parent mesh cell into eight finer child mesh cells. The new vertices and the four vertices of the original tetrahedron of the parent mesh cell form four child tetrahedrons. These four child tetrahedrons are similar to the original tetrahedron, and the remaining octahedron of the original tetrahedron is equally divided into four tetrahedrons.

[0100] It should be noted that the target physical quantity is determined according to the specific scenario. For example, if the scenario is the flow around an aircraft wing, the target physical quantity (or the physical quantity of interest) can be the lift and drag of the wing; if the scenario is the flow around a vehicle, the target physical quantity can be the velocity amplitude behind the car.

[0101] The grids of the present invention all adopt unstructured grids, which are tetrahedral grids. The topological information of the tetrahedral grids includes nodes, edges, faces, cells, boundaries, etc., where each information item (such as nodes and cells) is stored in the form of an array and integrated into a unified dictionary structure. After the topological information of the grid is saved as a dictionary file, it can be formatted and a grid file type compatible with the solver can be generated.

[0102] The generation and refinement of tetrahedral meshes mainly rely on the Delaunay tetrahedron partitioning algorithm; Delaunay tetrahedron partitioning ensures that the circumscribed sphere of each tetrahedron does not contain any other points in the point set. This feature ensures that the tetrahedron partitioning avoids the generation of narrow tetrahedral elements with very small angles and poor shapes, and can effectively redistribute the mesh connection relationship according to the newly inserted nodes. These features ensure the improvement of mesh element quality and the stability of numerical calculations, providing reliable mesh quality for accurate numerical simulation of complex problems.

[0103] Figure 5Shown is a specific example of the method of the present invention, which shows the convergence characteristics of the amplitude of the intersection velocity of an obstacle on the ground along the incoming flow direction behind the obstacle in an incompressible air flow (Reynolds number Re = 4.7×106) in an AMR process based on the residual of the governing equation (i.e., the method of the present invention, the PDEs residual indicator) and the existing traditional error indicator (pressure Hessian indicator). For both adaptive grid refinement methods, the calculated intersection velocity amplitude can converge to the reference value and stop after two or three refinements; the intersection velocity obtained by the AMR method based on the traditional error indicator can also approach the reference value, but this process requires a significant increase in the number of grid cells; while the AMR method based on the residual of the governing equation provided by the present invention shows a faster convergence speed, requiring only fewer marked cells and refinement levels to achieve the expected accuracy.

[0104] The present invention uses the residual of the fluid control equation as a new error indicator and refinement criterion, and fuses the inaccurate flow field data obtained from the coarse grid of the simulated flow with the fluid control equation through a physical information neural network. After the training is completed, automatic differentiation is used to conveniently calculate the overall residual of the equation, so that the coarse grid units with relatively higher residuals can be adaptively marked and refined. In addition, this method is combined with the h-refinement scheme, and Delaunay tetrahedron partitioning is performed after strategically inserting vertices to maintain the quality of the refined grid. This method can be flexibly combined with any numerical solver for grid adaptive refinement, thereby solving a variety of typical flow problems with high precision. Compared with traditional adaptive refinement, this method achieves a better balance between calculation accuracy and the number of grids, and has the advantages of simplicity, compatibility and versatility.

[0105] The embodiment described above is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Persons skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent substitution or equivalent transformation falls within the scope of protection of the present invention.

Claims

1. A three-dimensional unstructured grid adaptive refinement method based on machine learning, characterized in that: The details are as follows: S1: On the mesh to be refined, which has been used for computational fluid dynamics simulation of fluid flow, the numerical solver in computational fluid dynamics is used to solve the fluid governing equations, and the flow field data at all nodes of the mesh to be refined after the solution is completed are extracted; S2: Constructing a physical information neural network, introducing the fluid control equation as a physical constraint into the physical information neural network, and combining it with the flow field data in S1 to jointly constitute a total loss function of the physical information neural network; training the physical information neural network to minimize the total loss function, thereby obtaining a trained physical information neural network; S3: Using the physical information neural network trained in S2, predict the residual value of the fluid control equation at the center of each grid cell in the grid to be refined in S1; S4: sorting the corresponding grid cells according to the residual values ​​of all fluid control equations in S3, and marking the grid cells with residual values ​​greater than a predetermined percentage as grid cells to be refined; S5: Apply the h-refinement scheme to refine the grid cells to be refined, and iterate the obtained new grid to be refined according to S1-S5 until the target physical quantity reaches the preset convergence condition as the grid cells are gradually refined. Then, the iteration is terminated to obtain the optimal grid that meets the required accuracy and number of grid cells.

2. The method for adaptive refinement of three-dimensional unstructured grids based on machine learning according to claim 1, characterized in that: In S1, the numerical solver is one of ANSYS Fluent, OpenFOAM, STAR-CCM+, SU2, CFX, and COMSOL.

3. The method for adaptive refinement of three-dimensional unstructured grids based on machine learning according to claim 1, characterized in that: In S1, the fluid control equation is the Navier-Stokes equation, which is expressed in three-dimensional Cartesian coordinates as follows: Where u = (u, v, w) is the velocity vector of the fluid, where u, v, and w are the velocity components of the fluid in the x, y, and z directions, respectively; p is the pressure; t is the time; and Reynolds number Re = UD / ν, where U is the characteristic velocity, D is the characteristic length, and ν is the kinematic viscosity.

4. The method for adaptive refinement of three-dimensional unstructured grids based on machine learning according to claim 1, characterized in that: In S1, if the fluid flows compressibly, the flow field data includes velocity, pressure and density; If the fluid flows incompressibly, the flow field data includes velocity and pressure; the velocity includes the components of the fluid in the x, y, and z directions.

5. The method for adaptive refinement of three-dimensional unstructured grids based on machine learning according to claim 1, characterized in that: The total loss function of the physical information neural network in S2 is obtained by the following method: The fluid control equations and flow field data are combined in the loss function in the form of mean square error, and the final total loss function is It is expressed as the sum of the two: in, and They represent the loss term of the fluid control equation and the loss term of the flow field data respectively; θ represents all trainable parameters in the physical information neural network; The specific form of each loss item is: Where u = (u, v, w) is the velocity vector of the fluid, where u, v, and w are the velocity components of the fluid in the x, y, and z directions, respectively; p is the pressure; t is the time; Reynolds number Re = UD / ν, where U is the characteristic velocity, D is the characteristic length, and ν is the kinematic viscosity; and They represent the velocity u of the fluid at point The network prediction value and the true observation value at N f is the total number of training points used to impose physical constraints; N d is the number of known observation data points; and Represents the pressure p at point The network prediction value and the true observation value at ; and Denotes the density ρ at point The network prediction value and the true observation value at .

6. The method for adaptive refinement of three-dimensional unstructured grids based on machine learning according to claim 1, characterized in that: In S2, the physical information neural network is trained using a phased optimization strategy, as follows: First, the Adam optimizer is used for preliminary training, and its learning rate adopts a decreasing scheduling strategy, as follows: 1×10 -3 The learning rate was then reduced to 5×10 -4 , and the last 20,000 training cycles were further reduced to 1×10 -4 ; After the Adam optimizer training is completed, the L-BFGS optimizer is used for fine optimization to further reduce the residual error and improve the model accuracy.

7. The method for adaptive refinement of three-dimensional unstructured grids based on machine learning according to claim 1, characterized in that: The S3 is as follows: Based on the physical information neural network trained in S2, the automatic differentiation technology is used to calculate the first-order or second-order partial derivatives of each flow field data in the fluid control equation, and then the residual value of the fluid control equation at the center of each grid cell in the grid to be refined is predicted, which represents the error of each grid cell; among them, the total residual R at the center of each grid cell is f is the sum of the absolute values ​​of the continuity equation and the momentum equation, expressed as: Where u = (u, v, w) is the velocity vector of the fluid, where u, v, and w are the velocity components of the fluid in the x, y, and z directions, respectively; p is the pressure; t is the time; and Reynolds number Re = UD / ν, where U is the characteristic velocity, D is the characteristic length, and ν is the kinematic viscosity.

8. The method for adaptive refinement of three-dimensional unstructured grids based on machine learning according to claim 1, characterized in that: In the above S4, a fixed ratio strategy is adopted as a grid unit refinement rule, and effective control of the number of cells in the grid is achieved by refining the total number of grid cells of a fixed ratio.

9. The method for adaptive refinement of three-dimensional unstructured grids based on machine learning according to claim 1, characterized in that: In S5, the h-refinement scheme reduces the characteristic length of the grid cell by dividing the edges equally. Without changing the grid cell type, each grid cell is subdivided into eight smaller tetrahedral cells. Specifically, After inserting new vertices at the midpoints of the edges of the marked mesh cells to be refined, Delaunay tetrahedron decomposition is performed to subdivide the parent mesh cell into eight finer child mesh cells. The new vertices and the four vertices of the original tetrahedron of the parent mesh cell form four child tetrahedrons. These four child tetrahedrons are similar to the original tetrahedron, and the remaining octahedron of the original tetrahedron is equally divided into four tetrahedrons.

10. A three-dimensional unstructured grid adaptive refinement system based on machine learning, characterized in that: include: The flow field data extraction module is used to solve the fluid control equations using the numerical solver in computational fluid dynamics on the grid to be refined in advance of computational fluid dynamics simulation of fluid flow, and to extract the flow field data on all nodes of the grid to be refined after the solution is completed; a physical information neural network training module for constructing a physical information neural network, introducing the fluid control equation as a physical constraint into the physical information neural network, and combining it with the flow field data in the flow field data extraction module to jointly constitute a total loss function of the physical information neural network; training the physical information neural network to minimize the total loss function to obtain a trained physical information neural network; a fluid control equation residual value prediction module, configured to use the physical information neural network trained in the physical information neural network acquisition module to predict the fluid control equation residual value at the center of each grid cell in the to-be-refined grid of the flow field data extraction module; A grid unit marking module to be refined is used to sort the corresponding grid units according to the residual values ​​of all fluid control equations in the fluid control equation residual value prediction module, and mark the grid units with residual values ​​greater than a predetermined percentage as grid units to be refined; The optimal grid acquisition module is used to apply the h-refinement scheme to refine the grid units to be refined, and iteratively execute the flow field data extraction module, the physical information neural network training module, the fluid control equation residual value prediction module, the grid unit marking module to be refined and the optimal grid acquisition module on the new grid to be refined. The iteration is terminated after the target physical quantity reaches the preset convergence condition as the grid units are gradually refined, and the optimal grid that meets the required accuracy and number of grid units is obtained.

Citation Information

Cited By

  • Self-adaptive mesh refinement method, system and equipment for physical information neural network

    CN120874642A

  • Heat storage system real-time sensing prediction method based on hybrid simulation and PINN

    CN122170696A

  • Real-time perception and prediction method for thermal storage system based on hybrid simulation and PINN

    CN122170696B

  • Flow field solving method and device, computer equipment and storage medium

    CN122287474A

  • Real-time sensing method and system for multi-physics field of multi-layer cascaded PINN thermal energy storage

    CN122413991A