Parallel hexahedral mesh generation method applied to spiral structure flow field DNS
Through parallel processing and optimization algorithms, the hybrid mesh of complex flow fields of the spiral structure is converted into a high-quality hexahedral mesh, which solves the consistency and resource consumption problems in traditional methods and achieves efficient mesh generation and calculation accuracy .
Patent Information
- Application Number
- CN202411038507.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-15
AI Technical Summary
Traditional methods are difficult to generate high-quality consistent hexahedral mesh for direct numerical simulation of helical structure flow fields, resulting in problems of calculation errors and high resource consumption.
Using parallel processing and optimization algorithms, the hybrid mesh is converted into high-quality hexahedral mesh. Through dual graph generation, node weight calculation, multi-level graph division, mesh type conversion and node number synchronization, we ensure grid consistency and efficiency.
It realizes automated grid conversion, reduces manual errors, improves simulation accuracy and efficiency, reduces computing resource requirements, and provides an efficient grid generation solution for spectral element method.
Smart Images

Figure CN118966063A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of computational fluid dynamics, and in particular to a parallel hexahedron grid generation method applied to a spiral structure flow field DNS. Background Art
[0002] In modern engineering technology, computational fluid dynamics (CFD) simulation has become a key tool for solving complex flow problems in various fields such as liquid fluid, magnetic fluid, air fluid, etc. due to its powerful analytical capabilities. In particular, spiral structures are widely present in a variety of equipment and systems. Due to their unique geometric shapes, these structures produce complex and special phenomena in the flow and heat exchange process. Accurate simulation of them is the basis for optimizing design and improving efficiency. For example, in the field of nuclear energy, the core of fast neutron reactors adopts a wire-wound fuel rod assembly design to improve the flow of coolant and increase heat exchange efficiency; in the field of aerospace, spiral structures are used in the design of engine components, such as the cooling channels of turbine blades. These channels adopt a spiral shape to improve the cooling efficiency, so that when the high-temperature gas flows, the temperature of the blades can be effectively reduced, thereby improving the performance and life of the engine; in hydraulic systems, especially hydraulic presses and certain types of pumps, spiral flow channels are often used to guide fluids, reduce the generation of eddies and turbulence, and improve the efficiency of fluid transmission. In order to deeply understand and optimize the special flow phenomena caused by the complex spiral structure, high-order CFD direct numerical simulation (DNS) is required, that is, no simplification or assumption is made on the control equations, and the equations are solved directly. This requires the use of a large number of high-quality grids to ensure the accuracy and efficiency of the simulation.
[0003] As a high-order, high-precision numerical calculation method, the spectral element method is widely used because of its excellent performance in dealing with complex flow field problems. The basic idea is to convert the partial differential equation into a weak form, perform isoparametric mapping on the integral region, approximate discretize the integral equation based on the integral interpolation points and interpolation formulas, and convert the continuous problem into a system of linear equations in a discrete format for solution. This method can provide the characteristics of low numerical dissipation and low numerical dispersion, and has a fast convergence speed, which is particularly suitable for DNS. However, the application of the spectral element method depends on the number and quality of the grid, which have become the core factors that directly affect the simulation accuracy, efficiency and authenticity.
[0004] In particular, traditional mesh generation techniques face significant challenges for engineering problems with complex geometric flow fields such as helical structures. These complex geometries require meshes to be highly adaptable and accurate to accurately capture detailed phenomena in the flow field. However, it is difficult to generate large amounts of high-quality meshes for these complex geometries, especially consistent quadrilateral / hexahedral meshes suitable for spectral element methods (the difference between consistent and non-conformal meshes is shown in the figure). Figure 1 ), is a very challenging task. The hexahedral mesh shape is very rigid and needs to rely on user input or detailed preprocessing of the geometric model. For example, taking the fast reactor wire-wound fuel assembly as an example (as shown in Figure 2 If the block structured mesh method is used, the complex geometry needs to be manually cut into several sub-regions that reflect the geometric features, and then mapped to the complex spiral structure. This process is not only labor-intensive but also difficult. If the sweep algorithm is used (starting from one or more initial faces, "sweeping" the entire volume in a specific direction to generate a hexahedral mesh), although the rotational stretching mesh of the spiral winding part can be created, the mesh often cannot be completely matched at the interface between the inner and outer flow channels, and the overall mesh is non-uniform (such as Figure 3 ), resulting in calculation errors.
[0005] In view of the above background, the present invention proposes a parallel hexahedron mesh generation method for DNS with a complex flow field of a spiral structure.
[0006] The core of this technology is to effectively convert the mixed grid of the complex flow field with spiral structure into a high-quality hexahedral grid through parallel processing and optimization algorithm, thus overcoming the automation difficulties and high resource consumption problems in traditional methods. This technology can not only process the complex mixed grids commonly found in the complex flow field with spiral structure, but also significantly improve the conversion efficiency and reduce the demand for computing resources while maintaining the consistency of the grid, providing an efficient and reliable grid generation solution for DNS based on spectral element method. Summary of the invention
[0007] The purpose of the present invention is to propose a parallel hexahedron mesh generation method applied to a spiral structure flow field DNS to solve the problems raised in the background technology.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] The parallel hexahedron mesh generation method applied to DNS of spiral structure flow field includes the following steps:
[0010] S1. Hybrid grid regional decomposition:
[0011] S1.1. Dual graph generation: Process the hybrid grid file to generate a dual graph, where the grid cells are used as nodes of the graph and the adjacent relationships between the cells are used as edges of the graph;
[0012] S1.2, node weight calculation: determine the grid type and assign corresponding weights to nodes according to different grid types;
[0013] S1.3, Multi-level Graph Partitioning Algorithm Region Decomposition: First, a coarse graph is obtained by collaboratively reducing the size of the graph; then, an initial partition is performed on the coarse graph according to the number of processors; finally, refinement is performed on the original graph to optimize the partitioning result;
[0014] S2. Parallel spectral element grid generation:
[0015] S2.1. Determine the grid dimension: determine whether the grid is a two-dimensional grid or a three-dimensional grid;
[0016] S2.2, determine the grid type: determine the grid type according to the number of nodes in each grid unit, and divide it into different branches according to the different components of the grid type;
[0017] S2.3, Grouping of grids of the same type: Group grids of the same type into the same grid group and number the grid groups in sequence;
[0018] S2.4, mesh type conversion: segment the two-dimensional mesh and the three-dimensional mesh to complete the mesh type conversion;
[0019] S3, Node number synchronization: Establish communication between processors and synchronize the global numbers of newly added nodes on the boundary to ensure grid consistency;
[0020] S4, sub-grid merging and spectrum element grid data output:
[0021] S4.1, after all processors complete local calculations, perform a global merge operation to merge into a complete spectrum element grid according to the global numbers of their respective sub-grid areas and boundary nodes;
[0022] S4.2. During the merging process, the boundary conditions are processed to ensure that there are no duplicate nodes at the interfaces between sub-regions and the unit topology is consistent;
[0023] S4.3. After the merging is completed, the spectral element grid data of the entire calculation domain is output for subsequent CFD simulation calculations.
[0024] Preferably, the mesh types include triangle (tri), quadrilateral (quad) in two dimensions and tetrahedron (tetra), hexahedron (hex), triangular prism (wedge) in three dimensions.
[0025] Preferably, the S2.2 specifically includes the following contents:
[0026] For 2D meshes, pure triangles (tri) are divided into one branch, and a mixture of triangles (tri) and quadrilaterals (quad) is divided into another branch;
[0027] For three-dimensional meshes, pure tetrahedrons are divided into one branch, pure triangular prisms are divided into one branch, tetrahedrons and triangular prisms are mixed into one branch, and tetrahedrons, hexahedrons, and triangular prisms are mixed into one branch.
[0028] Preferably, the S2.4 specifically includes the following contents:
[0029] For a two-dimensional grid, the midpoints of the edges and the center of the faces are used for segmentation. After segmentation, one quadrilateral (quad) is converted into four quadrilaterals (quads), and one triangle (tri) is converted into three quadrilaterals (quads);
[0030] For three-dimensional meshes, edge midpoints, face centers, and body centers are used for segmentation. After segmentation, one hexahedron (hex) is converted into eight hexahedrons (hex), one tetrahedron (tetra) is converted into four hexahedrons (hex), and one wedge is converted into six hexahedrons (hex).
[0031] Preferably, S3 specifically includes the following contents:
[0032] S3.1. For each sub-region boundary, identify and record synchronized nodes;
[0033] S3.2. Use the MPI library to synchronize node information between processors. Each processor sends the local number and coordinates of its boundary nodes, receives boundary information from other processors, and assigns global numbers to newly added nodes.
[0034] Compared with the prior art, the present invention provides a parallel hexahedron mesh generation method for spiral structure flow field DNS, which has the following beneficial effects:
[0035] (1) An automated conversion tool is provided: The present invention is specifically used for the conversion of a hybrid grid to a spectral element grid for a complex flow field with a spiral structure, which effectively saves the time required for manual grid conversion and significantly improves the robustness of the conversion process. Through automated processing, the grid inconsistency errors caused by improper human operation are reduced, thereby ensuring the quality and reliability of the computational model.
[0036] (2) Breaking through the limitations of spectral element meshes: Traditional spectral element method-based solvers, such as Nek5000, are limited to using only quadrilateral or hexahedral meshes. The present invention overcomes this limitation and provides a method for generating quadrilateral / hexahedral spectral element meshes without manual intervention, which reduces the burden on researchers and users in the pre-processing stage of numerical simulation and enhances the ability of the model to approximate the real geometric shape, thereby helping to improve the accuracy of the solution process.
[0037] (3) Parallel processing: During the grid conversion process, the present invention adopts a parallelization algorithm to distribute the tasks that were originally processed serially to multiple processors, thereby improving the efficiency of grid conversion and significantly reducing the demand for computing resources, so that even large-scale grid conversion tasks can be completed within an acceptable time. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 Schematic diagrams showing the difference between consistent and inconsistent meshes mentioned in the background of the present invention; wherein (a) is a schematic diagram of a triangular consistent mesh, where two meshes are connected by the same node; (b) is a schematic diagram of a quadrilateral consistent mesh, where two meshes are connected by the same edge; (c) is a schematic diagram of a triangular inconsistent mesh, where the nodes between the connecting edges of the two meshes are not one-to-one corresponding (i.e., there are hanging nodes); (d) is a schematic diagram of a quadrilateral inconsistent mesh, where the nodes between the connecting edges of the two meshes are not one-to-one corresponding (i.e., there are hanging nodes);
[0039] Figure 2 The schematic diagram of the complex spiral structure of the fast reactor core mentioned in the background technology of the present invention is shown in the figure below. The left side shows a single rod flow channel, and its geometric shape is a spiral wire wound evenly outside a cylinder. The middle shows the assembly flow channel geometry, and there are 61 fuel rods with wire windings in a hexagonal outer sleeve. The right side shows the assembly flow channel grid.
[0040] Figure 3 It is a non-uniform hexahedral mesh generated by a sweeping algorithm mentioned in the background technology of the present invention. It is a combined mesh. The inner flow channel (wire winding part) is rotated and stretched, but the mesh at the interface between the inner and outer flow channels cannot be matched, which is a non-uniform mesh.
[0041] Figure 4 This is a flow chart of the parallel hexahedron mesh generation method applied to the DNS of the spiral structure flow field mentioned in Example 1 of the present invention;
[0042] Figure 5 This is a flow chart of the algorithm for converting the hybrid grid to the spectral element grid mentioned in Embodiment 1 of the present invention;
[0043] Figure 6 This is a schematic diagram of the grid type conversion mentioned in Example 1 of the present invention. DETAILED DESCRIPTION
[0044] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0045] In order to better adapt to the three-dimensional geometric structure of complex spirals, a hybrid meshing method is often used, that is, combining multiple mesh forms such as tetrahedron, hexahedron and triangular prism; in addition, when studying the tangent plane flow characteristics of complex spiral geometric structures, a two-dimensional hybrid meshing method is also often used, that is, combining the mesh forms of triangles and quadrilaterals, and dividing according to the specific characteristics of each part, in order to achieve the best simulation effect. In order to make the hybrid mesh of tetrahedron (hereinafter referred to as tetra), hexahedron (hereinafter referred to as hex) and triangular prism (hereinafter referred to as wedge) in three-dimensional and triangle (hereinafter referred to as tri) and quadrilateral (hereinafter referred to as quad) in two-dimensional to perform spectral element method DNS, and solve the problems that the conversion process cannot be automated, is time-consuming and has high memory requirements, the present invention proposes a parallel hexahedral mesh generation method applied to DNS of spiral structure flow field, which effectively converts the hybrid mesh of spiral structure complex flow field into high-quality hexahedral mesh through parallel processing and optimization algorithm, thereby overcoming the automation difficulties and high resource consumption problems in traditional methods. This technology can not only handle complex mixed grids commonly found in complex flow fields with spiral structures, but also significantly improve conversion efficiency and reduce computing resource requirements while maintaining grid consistency, providing an efficient and reliable grid generation solution for DNS based on the spectral element method.
[0046] The parallel hexahedron mesh generation method for spiral structure flow field DNS proposed by the present invention is described below with reference to the accompanying drawings and specific examples, which specifically include the following contents.
[0047] Embodiment 1:
[0048] See also Figure 4 The present invention proposes a parallel hexahedron mesh generation method for a spiral structure flow field DNS, including the following contents:
[0049] 1) Hybrid grid regional decomposition:
[0050] a) Dual graph generation: Generate a dual graph from a hybrid grid file. The grid cells are used as nodes of the graph, and the adjacency relationships between cells are used as edges of the graph.
[0051] b) Node weight calculation: Determine the grid type and assign corresponding weights to nodes according to different grid types.
[0052] c) Multi-level graph partitioning algorithm Region decomposition: First, the size of the graph is reduced by collaboration, then the initial partitioning is performed on the coarse graph according to the number of processors, and finally, refinement is performed on the original graph to optimize the partitioning result.
[0053] 2) Parallel spectral element grid generation: On each processor, execute the following scheme, the algorithm flow chart is as follows Figure 5 As shown:
[0054] a) Determine the grid dimension: determine whether it is a two-dimensional grid or a three-dimensional grid;
[0055] b) Determine the grid type: Determine the grid type (tetra, hex, wedge, tri, quad) based on the number of nodes in each grid unit, and enter different branches based on the different compositions of the grid types. For two-dimensional, pure tri is one branch, and tri and quad are mixed into one branch; for three-dimensional, pure tet is one branch, pure wedge is one branch, tet and wedge are mixed into one branch, and tet, hex, and wedge are one branch. (Note: The algorithm assumes that the grid to be converted is a non-spectral element grid by default, so pure hex and pure quad branches are not set);
[0056] c) Grouping of similar grids: Group the grids of the same type into the same block (block means grid group) and number the blocks in sequence;
[0057] d) Mesh type conversion: For 2D meshes, the conversion idea is to segment by edge midpoints and face centers; for 3D meshes, the segmentation idea is to segment by edge midpoints, face centers, and body centers. Therefore, after segmentation, 1 quad is converted to 4 quads; 1 tri is converted to 3 quads; 1 hex is converted to 8 hexes, 1 tetra is converted to 4 hexes, and 1 triangular prism is converted to 6 hexes. The conversion results are shown in the attached figure. Figure 6 It should be noted here that the quad and hex grids also need to be converted in the mixed grid because other grids mixed with them generate hanging points (edge midpoints, face centers) during the segmentation conversion. In order to make the whole grid after conversion consistent, the quad and hex grids also need to be segmented.
[0058] 3) Node number synchronization: To ensure grid consistency, processors need to communicate to synchronize the global numbers of newly added nodes on the boundary:
[0059] a) For each sub-region boundary, identify and record the nodes that need to be synchronized
[0060] b) Use the MPI library to synchronize node information between processors. Each processor sends the local number and coordinates of its boundary nodes, receives boundary information from other processors, and assigns global numbers to newly added nodes.
[0061] 4) Sub-grid merging and spectrum element grid data output:
[0062] a) After all processors complete local calculations, they perform a global merge operation, merging their sub-grid regions and boundary nodes into a complete spectral element grid according to their global numbers.
[0063] b) During the merging process, boundary conditions need to be handled to ensure that there are no duplicate nodes at the interfaces between sub-regions and that the cell topology is consistent.
[0064] c) After the merging is completed, the spectral element grid data of the entire calculation domain is output for subsequent CFD simulation calculations.
[0065] Furthermore, the above contents are described below with reference to specific examples, which specifically include the following contents:
[0066] Step 1: Hybrid mesh domain decomposition:
[0067] Step 1.1: Dual Graph Generation: This algorithm aims to generate the corresponding dual graph from the hybrid grid file. First, an empty dual graph G(V,E) is initialized. Next, it traverses each grid cell u and adds it as a node to the graph G(V). Then, the algorithm checks each cell v that is adjacent to cell u and adds the relationship between each pair of adjacent cells to the graph G(E) as an edge (u,v), but the premise is that such an edge does not exist in the graph yet. Finally, the algorithm outputs the dual graph G(V,E), whose nodes represent grid cells and edges represent the adjacent relationships between cells.
[0068] Step 1.2: Node weight calculation: This algorithm accepts the dual graph G(V,E) generated in the previous step as input, and calculates the weight of each node u to generate a weighted dual graph G_w(V_w,E). The algorithm traverses each node u in the dual graph, determines the type of grid unit u represented by the node, and assigns a corresponding weight according to the amount of calculation for that type. For example, for tetra, it is necessary to calculate 6 edge midpoints, 4 face centers, and 1 body center, so the weight is 11. Specifically, if the unit type is tri, the weight is set to 4; quad is set to 5; tetra is set to 11; hex is set to 19; and wedge is set to 15. After assigning weights, the nodes and their weights are added to the weighted dual graph G_w(V_w). Finally, the weighted dual graph G_w(V_w,E) is returned.
[0069] Step 1.3: Multi-level graph partitioning algorithm: The purpose of this algorithm is to partition the weighted dual graph G_w(V_w,E) into P subgraphs, where P is the number of processors.
[0070] a) Collaboration step: In this step, the algorithm continuously simplifies the graph. This process continuously selects candidate node pairs, evaluates them based on the node weights and the adjacent relationships between them, and preferentially merges the node pairs with smaller weights and close connections (close connections are judged as: the smallest weight difference and the most common adjacent nodes) to ensure that the merged new nodes will not have an adverse effect on subsequent partitioning due to excessive weight. In each merge operation, the weight of the new node is updated to the sum of the weights of the original two nodes. This process continues until the graph can no longer be merged further, and finally returns the coordinated rough graph G_c.
[0071] b) Initial partitioning step: The algorithm applies the Kernighan-Lin algorithm on the rough graph G_c to find P roughly balanced subgraphs. These subgraphs constitute the initial partitioned subgraph set {S'_1, S'_2, ..., S'_P}.
[0072] c) Refinement step: In the refinement phase, the algorithm projects the initial partition {S'_1, S'_2, ..., S'_P} back to the original graph G_w, and performs local optimization on each subgraph S'_i using the Fiduccia-Mattheyses algorithm. The goal of the optimization is to reduce the sum of the weights of the boundary edges between the subgraph partitions. After completing this step, the refined subgraph set {S_1, S_2, ..., S_P} is returned.
[0073] Step 2: Parallel spectral element grid generation:
[0074] Taking the conversion from tri grid to quad grid and tet grid to hex grid as examples, the implementation method of grid type conversion in the hybrid grid to spectral element grid conversion algorithm in each processor is explained. However, it should be noted that the idea and process of the conversion algorithm are not only applicable to tri and tet grids, but also to other types of grids. The following "grid number" refers to the number of grids allocated to the processor.
[0075] tri_element_num indicates the number of triangular meshes, tet_element_num indicates the number of tetrahedral meshes, quad_element_num indicates the number of quadrilateral spectral element meshes after conversion, hex_element_num indicates the number of hexahedral spectral element meshes after conversion, sub_element indicates the sub-mesh number after each mesh is cut, vertex indicates the current mesh point number (including vertices and mesh edge midpoints), face indicates the current face number, dim indicates the dimension, ori_mesh_order indicates the number of each mesh before conversion, and the value range is [1:tri_element_num / tet_element_num], trans_mesh_order indicates the number of each mesh after conversion, and the value range is [1:3*tri_element_num], mesh_ori[ori_mesh_order][vertex][dim] stores the coordinates of the triangular / tetrahedral mesh points before conversion, and mesh_trans[ori_mesh_order][vertex][dim] stores the coordinates of the quadrilateral / hexahedral spectral element mesh points after conversion.
[0076] Tri to quad grid conversion:
[0077] 1) Data preparation:
[0078] mesh_ori[ori_mesh_order][vertex][dim] stores the coordinates of the triangular mesh points before transformation, ori_mesh_order = [1:tri_element_num], vertex = [1:3], dim = [1:2];
[0079] mesh_trans[trans_mesh_order][vertex][dim] stores the coordinates of the transformed quadrilateral spectral element grid points trans_mesh_order = [1:3*tri_element_num], vertex = [1:4], dim = [1:2];
[0080] tri_vertex[vertex][dim]: stores the vertex coordinates of the tri grid unit, vertex = [1:6], dim = [1:2];
[0081] tri_face[dim]: stores the coordinates of the face center of tri grid unit, dim = [1:2]
[0082] quad_vertex[sub_element][vertex][dim]: stores the converted quad grid cell, sub_element = [1:3], vertex = [1:4], dim = [1:2];
[0083] Initialize ori_mesh_order=trans_mesh_order=1;
[0084] 2) Traverse all tri meshes with ori_mesh_order until ori_mesh_order =
[0085] tri_element_num:
[0086] ① Read the node coordinate information of the tri mesh file, store the three vertex coordinates in mesh_ori[ori_mesh_order][1:3][1:2] respectively, and assign them to tri_vertex[1:3][1:2];
[0087] ② Calculate the midpoints of the three edges of the tri grid and store them in tri_vertex[4:6][1:2] respectively;
[0088] ③ Calculate the face center of the tri grid and store it in tri_face[1:2];
[0089] ④For each sub_element, assign the midpoint of the two intersecting sides in tri_vertex[1:6][1:2], the intersection of the two sides, and tri_face[1:2] to quad_vertex[sub_element][1:4][1:2];
[0090] ⑤ Traverse each sub_element, increase the value of trans_mesh_order by 1 each time, and assign quad_vertex[sub_element][1:4][1:2] to mesh_trans[trans_mesh_order][1:4][1:2];
[0091] Tet to hex grid conversion:
[0092] 1) Data preparation:
[0093] mesh_ori[ori_mesh_order][vertex][dim] stores the coordinates of the tetrahedral mesh points before transformation, ori_mesh_order = [1:tet_element_num], vertex = [1:4], dim = [1:3];
[0094] mesh_trans[trans_mesh_order][vertex][dim] stores the coordinates of the hexahedral spectral element grid points after transformation trans_mesh_order = [1:4*tet_element_num], vertex = [1:8], dim = [1:3];
[0095] tet_vertex[vertex][dim]: stores the vertex coordinates of the tet grid unit, vertex = [1:10], dim = [1:3];
[0096] tet_face[face][dim]: stores the coordinates of the face center of the tet grid cell, face = [1:4], dim = [1:3];
[0097] tet_center[dim]: stores the coordinates of the center of the tet grid, dim = [1:3];
[0098] hex_vertex[sub_element][vertex][dim]: stores the converted hex grid unit, sub_element = [1:4], vertex = [1:8], dim = [1:3];
[0099] Initialize ori_mesh_order=trans_mesh_order=1;
[0100] 2) Traverse all tet meshes with ori_mesh_order until ori_mesh_order =
[0101] tet_element_num:
[0102] ① Read the node coordinate information of the tet mesh file, store the coordinates of the four vertices in mesh_ori[ori_mesh_order][1:4][1:3] respectively, and assign them to tet_vertex[1:4][1:3];
[0103] ② Calculate the midpoints of the 6 edges of the tet grid and store them in tet_vertex[4:10][1:3] respectively;
[0104] ③ Calculate the center of each face of the tet mesh and store it in tet_face[1:4][1:3];
[0105] ④ Calculate the center of the tet grid and store it in tet_center[1:3];
[0106] ⑤For each sub_element, assign the midpoints of the three intersecting edges in tet_vertex[1:10][1:3], the intersection of the three edges, the center of the three intersecting faces in tet_face[1:4][1:3], and tet_center[1:3] to hex_vertex[sub_element][1:8][1:3];
[0107] ⑥ Traverse each sub_element, increase the value of trans_mesh_order by 1 each time, and assign hex_vertex[sub_element][1:8][1:3] to mesh_trans[trans_mesh_order][1:8][1:4];
[0108] Step 3: Node number synchronization:
[0109] Step 3.1: Define key data structures:
[0110] ①Boundary node array: boundaryNodes, including:
[0111] localID: local ID
[0112] globalID: global ID
[0113] coordinates[dim]: coordinates, which is the same as the dimension dim in mesh_ori and mesh_trans.
[0114] subdomainID: subdomain ID
[0115] ②Global node coordinate array: globalNodeCoordinates
[0116] ③Spectral element unit global node number array: hexElementNodeIDs
[0117] Step 3.2: Identify boundary nodes: Traverse all grid cells in each sub-region. For each node in each cell, if the node is adjacent to at least one cell belonging to another sub-region, record the localID, coordinates, and subdomainID of the node in the boundaryNodes array.
[0118] Step 3.3: Node information synchronization:
[0119] ① Use MPI_Allgather to synchronize the boundaryNodes information of all processors.
[0120] ②For each received border node information, check whether there is the same
[0121] The coordinates of the node.
[0122] ③If there are nodes with the same coordinates, all processors reach a consensus, assign a unified minimum globalID to these nodes, and update the globalID in the boundaryNodes array.
[0123] Step 4: Subgrid merging and spectral element grid data output:
[0124] Step 4.1: Global merge operation:
[0125] ① Collect boundaryNodes information on all processors, especially the globalID of each node
[0126] and coordinates.
[0127] ②Deduplicate based on globalID and build globalNodeCoordinates.
[0128] ③Merge the grid data of each sub-area, update hexElementNodeIDs, and ensure that each spectral element unit references the correct globalID.
[0129] Step 4.2: Dealing with boundary conditions:
[0130] Check each cell in hexElementNodeIDs to ensure that nodes on the boundary are correctly connected between different sub-regions and maintain the consistency of the cell topology.
[0131] Step 4.3: Output spectrum element grid data:
[0132] ① Traverse hexElementNodeIDs and output the node global number list of each spectrum element unit.
[0133] ②Traverse globalNodeCoordinates and output the coordinates of each node.
[0134] The above is only a preferred specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. The parallel hexahedral grid generation method for spiral structure flow field DNS involved in the present invention, including the hybrid grid region decomposition algorithm, parallel spectral element grid generation method, node number synchronization algorithm and subgrid merging and spectral element grid data output method provided in the invention are all considered to be within the protection scope of the present invention. It should be pointed out that the above is a preferred implementation of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention, and these improvements and modifications should also be considered to be within the protection scope of the present invention.
Claims
1. A parallel hexahedron mesh generation method for DNS of spiral structure flow field, characterized in that: The following steps are involved: S1. Hybrid grid regional decomposition: S1.
1. Dual graph generation: Process the hybrid grid file to generate a dual graph, where the grid cells are used as nodes of the graph and the adjacent relationships between the cells are used as edges of the graph; S1.2, node weight calculation: determine the grid type and assign corresponding weights to nodes according to different grid types; S1.3, Multi-level Graph Partitioning Algorithm Region Decomposition: First, a coarse graph is obtained by collaboratively reducing the size of the graph; then, an initial partition is performed on the coarse graph according to the number of processors; finally, the original graph is refined to optimize the partitioning result; S2. Parallel spectral element grid generation: S2.
1. Determine the grid dimension: determine whether the grid is a two-dimensional grid or a three-dimensional grid; S2.2, determine the grid type: determine the grid type according to the number of nodes in each grid unit, and divide it into different branches according to the different components of the grid type; S2.3, Grouping of grids of the same type: Group grids of the same type into the same grid group and number the grid groups in sequence; S2.4, mesh type conversion: segment the two-dimensional mesh and the three-dimensional mesh to complete the mesh type conversion; S3, Node number synchronization: Establish communication between processors and synchronize the global numbers of newly added nodes on the boundary to ensure grid consistency; S4, sub-grid merging and spectrum element grid data output: S4.1, after all processors complete local calculations, perform a global merge operation to merge into a complete spectrum element grid according to the global numbers of their respective sub-grid areas and boundary nodes; S4.
2. During the merging process, the boundary conditions are processed to ensure that there are no duplicate nodes at the interfaces between sub-regions and the unit topology is consistent; S4.
3. After the merging is completed, the spectral element grid data of the entire calculation domain is output for subsequent CFD simulation calculations.
2. The parallel hexahedron mesh generation method for spiral structure flow field DNS according to claim 1, characterized in that: The mesh types include triangles and quadrilaterals in two dimensions and tetrahedrons, hexahedrons and triangular prisms in three dimensions, which are respectively denoted as tri, quad, tetra, hex and wedge.
3. The parallel hexahedron mesh generation method for spiral structure flow field DNS according to claim 1, characterized in that: S2.2 specifically includes the following contents: For 2D meshes, pure triangles are divided into one branch, and a mixture of triangles and quadrilaterals is divided into another branch; For three-dimensional grids, pure tetrahedrons are divided into one branch, pure triangular prisms are divided into one branch, tetrahedrons and triangular prisms are mixed into one branch, and tetrahedrons, hexahedrons, and triangular prisms are mixed into one branch.
4. The parallel hexahedron mesh generation method for spiral structure flow field DNS according to claim 1, characterized in that: S2.4 specifically includes the following contents: For a two-dimensional grid, the midpoints of the edges and the center of the faces are used for segmentation. After segmentation, one quadrilateral is converted into four quadrilaterals, and one triangle is converted into three quadrilaterals. For three-dimensional grids, edge midpoints, face centers, and body centers are used for segmentation. After segmentation, one hexahedron is converted into eight hexahedrons, one tetrahedron is converted into four hexahedrons, and one triangular prism is converted into six hexahedrons.
5. The parallel hexahedron mesh generation method for spiral structure flow field DNS according to claim 1, characterized in that: The S3 specifically includes the following contents: S3.
1. For each sub-region boundary, identify and record synchronized nodes; S3.
2. Use the MPI library to synchronize node information between processors. Each processor sends the local number and coordinates of its boundary nodes, receives boundary information from other processors, and assigns global numbers to newly added nodes.
Citation Information
Patent Citations
Multi-grid Chebyshev parallel spectral element method with complex medium elastic wave propagation and simulation
CN103530451A
Tetrahedral mesh generation method and device for three-dimensional solid model
CN104063903A
Dynamic boundary flow field numerical simulation-oriented local area grid reconstruction parallel method
CN110188424A
Method for converting hybrid grid into spectral element grid
CN116305354A
