Non-structural parallel grid quality optimization method based on grid unit merging
By merging the topological relationships between negative volume elements and adjacent elements, the mesh information is reconstructed, solving the problems of CFD calculation accuracy and efficiency caused by mesh distortion, and achieving efficient mesh quality optimization.
Patent Information
- Application Number
- CN202511715129.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-21
- Publication Date
- 2025-12-23
AI Technical Summary
In existing technologies, the negative volume cell problem caused by mesh cell distortion leads to a decrease in the accuracy and efficiency of CFD calculations, especially in large-scale parallel computing environments where the processing efficiency is limited.
By merging negative volume elements with adjacent elements through topological relationships, the mesh geometry, topology, boundary conditions, and docking surface information are reconstructed, negative volume elements are eliminated, and mesh quality is improved.
The elimination of negative volume cells improves the efficiency and accuracy of CFD calculations, ensuring mesh quality and computational stability in large-scale parallel computing environments.
Smart Images

Figure CN121189237A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computational fluid dynamics (CFD), specifically to a method for optimizing the quality of unstructured parallel meshes based on mesh cell merging. Background Technology
[0002] Computational Fluid Dynamics (CFD) is an interdisciplinary field that uses computers and numerical algorithms to perform numerical simulations and analyses of fluid dynamics problems. It is widely used in aerospace, automotive, energy, and civil engineering. The foundation of CFD calculations is the computational mesh. The real computational domain is a continuous space, which needs to be discretized into a finite number of elements (e.g., triangles, quadrilaterals, tetrahedrons, hexahedrons, etc.) to form a mesh structure. The mesh quality directly affects the efficiency and accuracy of CFD calculations.
[0003] When mesh elements are distorted, especially in geometrically complex regions, elements with high mesh twist or even negative volume elements may appear. Negative volume elements can lead to instability in the computational matrix, thereby reducing the accuracy and efficiency of CFD calculations, and in severe cases, causing numerical simulation failure. Existing mesh optimization methods mostly involve local smoothing or re-meshing, which have limited processing efficiency and are not well-suited for large-scale parallel computing environments. Therefore, there is an urgent need for an efficient and parallelizable unstructured mesh quality optimization method that can eliminate negative volume elements and improve the overall quality of the computational mesh. Summary of the Invention
[0004] The purpose of this invention is to provide an unstructured parallel mesh quality optimization method based on mesh cell merging, to solve the problem of decreased CFD computation efficiency and accuracy caused by negative volume cells in the existing technology. When a negative volume cell is detected, it is merged with adjacent cells through topological relationships. After merging, the mesh geometry, topology, boundary conditions, and docking surface information are reconstructed, ultimately eliminating the negative volume cell and improving the overall mesh quality.
[0005] Specifically, the present invention proposes a method for optimizing the quality of unstructured parallel meshes based on mesh cell merging, comprising the following steps: Step 1: Read the grid file, read the raw grid data, and establish the correspondence between the current process grid number and the global grid number.
[0006] Step 2: Traverse the grid cells in the original grid data and calculate the geometric metric information of the grid cells.
[0007] Preferably, the geometric metric information of the mesh cell includes the mesh face center, area, normal vector, cell body center, and volume.
[0008] Step 3: Calculate the mesh distortion, detect the existence of negative volume elements, and record the negative volume elements and their corresponding mesh surface numbers.
[0009] Among them, the mesh distortion is an index calculated based on the geometry of the mesh elements. The smaller the value, the greater the degree of distortion. When it is negative, it is judged as a negative volume element.
[0010] Step 4: Initialize the mesh optimization information data. For each mesh block of the original mesh data, create a mesh cell merging marker array to mark whether the mesh cell has been merged; create a mesh cell number mapping array to record the correspondence between the numbers of the mesh cells in the original mesh data and the optimized mesh cells, and number the optimized mesh cells based on the mesh cell information of the original mesh data.
[0011] Preferably, all mesh cells are initially marked as unmerged. In step four, the optimized mesh cells are numbered using the mesh cell information from the original mesh data, assuming the mesh does not contain negative volume cells, and the cell information of the optimized mesh cells is initialized. Negative volume cells are processed in step five.
[0012] Step 5: When a negative volume cell is detected in the mesh, the cell numbers on the left and right sides of the mesh face are obtained through the topological relationship, and these two cells are marked as having the same cell number in the mesh cell number mapping array and merged into one cell; at the same time, these two cells are marked as merged cells in the mesh cell merge mark array.
[0013] Preferably, when a negative distortion is detected on a mesh surface, after obtaining the element numbers on the left and right sides of that mesh surface, the mesh element number mapping array is used for judgment. If both left and right elements are unmerged elements, mesh merging is performed. If there are merged elements in the left and right elements, the two elements are not merged. The purpose of this process is to avoid merging the same mesh element multiple times in one iteration, as multiple mergings would make the mesh information reconstruction in step six very difficult.
[0014] Step 6: After merging, based on the mesh merging information, reconstruct the geometric information, topological information, boundary condition information, and docking surface information of the optimized mesh.
[0015] This includes constructing the geometric information of the optimized mesh, including initializing the mesh data structure and assigning node coordinates.
[0016] The optimization of the mesh topology information includes both mesh cell topology information and mesh surface topology information. Mesh cell topology information includes the number of nodes and node numbers in each mesh cell; mesh surface topology information includes the number of nodes, node numbers, and left and right cell numbers in each mesh surface.
[0017] The boundary condition information for constructing the optimized mesh includes the boundary condition information for constructing the optimized mesh based on the boundary condition information of the original mesh data before optimization.
[0018] The process of constructing the mesh docking surface information after optimization includes constructing the optimized mesh docking surface information based on the original mesh data before optimization. Because the parallel computing mesh consists of multiple mesh blocks, docking surface information is required for CFD calculations; therefore, the mesh docking surface information needs to be reconstructed.
[0019] Step 7: Repeat steps 2 through 6 until there are no more negative volume elements in the optimized mesh.
[0020] Step 8: Output the optimized mesh file. The optimized mesh file is used for CFD calculations and can effectively improve the overall quality of the computational mesh.
[0021] This invention proposes an unstructured parallel mesh quality optimization method based on mesh cell merging. When negative volume cells exist in the mesh, the negative volume cells are merged with adjacent cells to eliminate negative volume cells in the mesh, improve the quality of the computational mesh, and enhance the efficiency and accuracy of CFD computation. Attached Figure Description
[0022] To more clearly illustrate the technical solution of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.
[0023] Figure 1 This is a schematic diagram of an ideal computational grid cell.
[0024] Figure 2 This is a schematic diagram of grid cell distortion.
[0025] Figure 3 This is a schematic diagram of a negative volume unit.
[0026] Figure 4 This is a schematic diagram of a two-dimensional mesh to be optimized.
[0027] Figure 5 This is a schematic diagram of a two-dimensional mesh after unit merging.
[0028] Figure 6 This is a schematic diagram of the spatial cross-section of the wind field grid in complex terrain. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0030] Specifically, the unstructured parallel mesh quality optimization method based on mesh cell merging proposed in this invention includes the following steps: Step 1: Read the grid file, read the raw grid data, and establish the correspondence between the current process grid number and the global grid number.
[0031] Step 2: Traverse the grid cells in the original grid data and calculate the geometric metric information of the grid cells.
[0032] In one embodiment, the geometric metric information of the mesh cell includes the mesh face center, area, normal vector, cell body center, and volume.
[0033] Step 3: Calculate the mesh distortion, detect the existence of negative volume elements, and record the negative volume elements and their corresponding mesh surface numbers.
[0034] Among them, the mesh distortion is an index calculated based on the geometry of the mesh elements. The smaller the value, the greater the degree of distortion. When it is negative, it is judged as a negative volume element.
[0035] Step 4: Initialize the mesh optimization information data. For each mesh block of the original mesh data, create a mesh cell merging marker array to mark whether the mesh cells have been merged. Initially, all mesh cells are marked as unmerged. Create a mesh cell number mapping array to record the correspondence between the numbers of the mesh cells in the original mesh data and the optimized mesh cells. Number the optimized mesh cells based on the mesh cell information of the original mesh data.
[0036] The optimized mesh cells are numbered using the mesh cell information from the original mesh data, assuming the default mesh does not contain negative volume cells. The cell information of the optimized mesh cells is then initialized. Negative volume cells are processed in step five.
[0037] In one embodiment, a two-dimensional unstructured triangular mesh is used as an example. First, the original mesh data is read, and a global and local numbering mapping is established. Geometric metrics are calculated, including mesh face centers, area, element volume centers, and mesh distortion. The detection results show that some elements have negative distortion.
[0038] Step 5: When a negative volume cell is detected in the mesh, the cell numbers on the left and right sides of the mesh face are obtained through the topological relationship, and these two cells are marked as having the same cell number in the mesh cell number mapping array and merged into one cell; at the same time, these two cells are marked as merged cells in the mesh cell merge mark array.
[0039] In one embodiment, when a negative twist of a certain mesh is detected, after obtaining the cell numbers on the left and right sides of the mesh surface, the mesh cell number mapping array is first used for judgment. If both left and right cells are unmerged cells, then mesh merging is performed.
[0040] In one embodiment, negative volumetric elements are merged with adjacent elements based on topological relationships, and their numbers are mapped in an array. After merging, the geometric information, topological relationships, and boundary condition information are reconstructed. After two iterations, the negative volumetric elements are completely eliminated, and the final mesh quality meets the requirements for CFD calculation.
[0041] In one embodiment, if there are already merged cells in the left and right cells, the two cells are not merged. The purpose of this is to avoid merging the same mesh cell multiple times in one iteration, as multiple mergings would make it very difficult to reconstruct the mesh information in step six.
[0042] Step 6: After merging, based on the mesh merging information, reconstruct the geometric information, topological information, boundary condition information, and docking surface information of the optimized mesh.
[0043] This includes constructing the geometric information of the optimized mesh, including initializing the mesh data structure and assigning node coordinates.
[0044] The optimization of the mesh topology information includes both mesh cell topology information and mesh surface topology information. Mesh cell topology information includes the number of nodes and node numbers in each mesh cell; mesh surface topology information includes the number of nodes, node numbers, and left and right cell numbers in each mesh surface.
[0045] The boundary condition information for constructing the optimized mesh includes the boundary condition information for constructing the optimized mesh based on the boundary condition information of the original mesh data before optimization.
[0046] The process of constructing the mesh docking surface information after optimization includes constructing the optimized mesh docking surface information based on the original mesh data before optimization. Because the parallel computing mesh consists of multiple mesh blocks, docking surface information is required for CFD calculations; therefore, the mesh docking surface information needs to be reconstructed.
[0047] In one embodiment, for complex geometric models, the generated 3D tetrahedral mesh contains multiple negative volume elements. Using the method of this invention, all negative volume elements are detected and recorded, and then merged sequentially with adjacent elements. During the merging process, an element number mapping table is used to avoid duplicate merging and ensure topological consistency. After merging, the volume, node numbering relationships, and boundary conditions of the 3D elements are reconstructed. Finally, a 3D mesh without negative volumes is obtained and successfully applied to CFD simulations, with stable convergence in the numerical calculation process.
[0048] Step 7: Repeat steps 2 through 6 until there are no more negative volume elements in the optimized mesh.
[0049] Step 8: Output the optimized mesh file. The optimized mesh file is used for CFD calculations and can effectively improve the overall quality of the computational mesh.
[0050] In one embodiment, a wind field simulation with complex terrain was used for testing. The total grid size of the simulation was 461W, and the simulation model was as follows. Figure 6 As shown in the figure. Mesh detection results indicate a twist rate of -14.93 and the presence of 27 negative volume elements. After optimization using the method of this invention, the mesh twist rate is improved to 7.31, and the number of negative volume elements is reduced to 0. The comparison of mesh quality before and after optimization is shown in Table 1 below: Table 1 Comparison of mesh quality before and after optimization
[0051] In a parallel computing environment, the interface information is updated synchronously during the optimization process, ensuring data consistency across multiple subdomains. Simulation results show that the method of this invention can effectively improve mesh quality and CFD calculation accuracy in a large-scale parallel computing environment.
[0052] In summary, this invention proposes an unstructured parallel mesh quality optimization method based on mesh cell merging. During CFD computation, if negative volume cells exist in the mesh, these negative volume cells are merged with adjacent cells, and the mesh topology is reconstructed to improve the quality of the computational mesh and enhance the efficiency and accuracy of CFD computation. Furthermore, this method constructs the docking surface information of multiple optimized meshes, realizing the mesh quality optimization function for large-scale parallel meshes.
[0053] It should be noted that, for those skilled in the art, the technical features in the above embodiments can be freely combined, and the resulting technical solutions also belong to the embodiments disclosed in this invention.
[0054] Furthermore, without departing from the principles of this invention, several improvements and modifications can be made to this invention, and these improvements and modifications also fall within the protection scope of the claims of this invention.
Claims
1. A method for optimizing the quality of unstructured parallel meshes based on mesh cell merging, characterized in that, Includes the following steps: Step 1: Read the grid file, read the raw grid data, and establish the correspondence between the current process grid number and the global grid number; Step 2: Traverse the grid cells in the original grid data and calculate the geometric metric information of the grid cells; Step 3: Calculate the mesh distortion, detect the existence of negative volume elements, and record the negative volume elements and their corresponding mesh face numbers; Step 4: Initialize the mesh optimization information data. For each mesh block of the original mesh data, create a mesh cell merging marker array to mark whether the mesh cell has been merged; create a mesh cell number mapping array to record the correspondence between the numbers of the mesh cells in the original mesh data and the optimized mesh cells; and number the optimized mesh cells based on the mesh cells in the original mesh data. Step 5: When a negative volume cell is detected in the mesh, the cell numbers on the left and right sides of the mesh face are obtained through the topological relationship, and these two cells are marked as having the same cell number in the mesh cell number mapping array. That is, during mesh optimization, the two cells are merged into one cell; at the same time, these two cells are marked as merged cells in the mesh cell merging mark array. Step 6: After merging, based on the mesh merging information, reconstruct the geometric information, topological information, boundary condition information, and docking surface information of the optimized mesh; Step 7: Repeat steps 2 through 6 until there are no more negative volume elements in the optimized mesh; Step 8: Output the optimized mesh file.
2. The method for optimizing the quality of unstructured parallel meshes based on mesh cell merging according to claim 1, characterized in that, In step two, the geometric metric information of the mesh element includes the mesh face center, area, normal vector, element body center, and volume.
3. The method for optimizing the quality of unstructured parallel meshes based on mesh cell merging according to claim 1, characterized in that, In step three, the mesh distortion is an index calculated based on the geometry of the mesh cells. The smaller the value, the greater the degree of distortion. When it is negative, it is determined to be a negative volume cell.
4. The method for optimizing the quality of unstructured parallel meshes based on mesh cell merging according to claim 1, characterized in that, In step four, all mesh cells are initially marked as unmerged.
5. The method for optimizing the quality of unstructured parallel meshes based on mesh cell merging according to claim 1, characterized in that, In step five, when a negative distortion of a certain mesh surface is found, after obtaining the cell numbers on the left and right sides of the mesh surface, the mesh cell number mapping array is used to make a judgment. If both left and right cells are unmerged cells, mesh merging is performed; if there are merged cells in the left and right cells, the two cells are not merged.
6. The method for optimizing the quality of unstructured parallel meshes based on mesh cell merging according to claim 1, characterized in that, In step six, the geometric information of the optimized mesh is constructed, including mesh data structure initialization and node coordinate assignment.
7. The method for optimizing the quality of unstructured parallel meshes based on mesh cell merging according to claim 1, characterized in that, In step six, the topology information of the optimized mesh is constructed, including mesh cell topology information and mesh surface topology information.
8. The method for optimizing the quality of unstructured parallel meshes based on mesh cell merging according to claim 7, characterized in that, The topology information of a grid cell includes the number of nodes and the node number in each grid cell; the topology information of a grid surface includes the number of nodes, the node number, and the numbers of the left and right cells in each grid surface.
9. The method for optimizing the quality of unstructured parallel meshes based on mesh cell merging according to claim 1, characterized in that, In step six, the boundary condition information of the optimized mesh is constructed, including the boundary condition information of the original mesh data before optimization.
10. The method for optimizing the quality of unstructured parallel meshes based on mesh cell merging according to claim 1, characterized in that, In step six, the docking surface information of the optimized mesh is constructed, including the mesh docking surface information based on the original mesh data before optimization, and the optimized mesh docking surface information is constructed.