A unified mesh vertex indexing method for high-fidelity parallel simulation of the entire core of a fast reactor
The parallel hash table method generates unique numbers for grid vertices in fast neutron reactors, which solves the problem of innate numbers in traditional methods, improves computing efficiency and storage utilization, and is suitable for large-scale parallel simulations.
Patent Information
- Application Number
- CN202410686890.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-05-30
AI Technical Summary
In high-fidelity parallel simulation of fast neutron reactors, traditional methods cannot assign unique global numbers to grid vertices in the absence of global information, resulting in the same physical vertex that may be different by different processors, affecting computing efficiency and storage need.
Using the parallel hash table method, each processor generates a local hash table and passes the hash value to the No. 0 processor to form a global hash table, handles conflicts and passes back numbers, ensuring that each physical vertex has a unique global number.
It realizes unique numbering of grid vertices in the absence of global information, improves computing efficiency and storage utilization, is suitable for large-scale parallel simulation, and reduces memory requirements and computing time.
Smart Images

Figure CN118657077B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of high performance computing and numerical simulation, and in particular to a unified grid vertex indexing method for high fidelity parallel simulation of a fast reactor full core. Background Art
[0002] Fast neutron reactors are the main reactor type of the world's fourth-generation advanced nuclear energy system, with advantages such as good safety and less waste. With the increasing demand for the safety and economy of nuclear energy systems, high-precision, high-efficiency, and large-scale simulation software has also received more and more attention, especially high-fidelity thermal fluid computational simulation software with independent intellectual property rights, which can help my country's reactor power increase and life extension, component design and improvement, safety assessment and analysis, new reactor design and development, and has strong engineering needs and practical significance. Traditional thermal fluid numerical simulation methods, such as system methods and sub-channel methods, can only perform overall flow field analysis at a macroscopic scale and cannot capture detailed information on the microscopic scale inside the fluid. Therefore, in order to meet the needs of more detailed description and high-precision simulation of flow field behavior, computational fluid dynamics (CFD) is usually used, especially direct numerical simulation (DNS) and large eddy simulation (LES) CFD calculations. However, this type of method requires a huge amount of grids and calculations, and has extremely high computing power and storage requirements, and must rely on supercomputers and large-scale parallel computing. This means that tasks (massive grid-based computing tasks) must be scheduled to different processor cores for parallel processing to fully utilize computing resources and achieve efficient numerical simulation.
[0003] The general CFD calculation method clearly divides the process into pre-processing and main solution parts (such as Figure 1 (as shown in the figure), but for the high-fidelity DNS / LES simulation of the whole core of a fast reactor, the pre-processing of the whole core mesh division and the output of the whole core mesh file are time-consuming due to the huge amount of meshes, and the massive storage required for the mesh is also a major challenge. The reading of the whole core mesh during the main solution and the output of the whole core solution variable mesh after the solution are also difficulties that need to be overcome. In order to solve these difficult problems, the researchers based on the repeated and fixed structural information in the axial and radial directions of the reactor core, Dong L, Miao X, Meng X, et al. Challenges in h igh-fidelit y thermal–h y draulic simulati o n o fFR c o res : I nsights and P ACA-S 4FR solutions[J]. Nuclear Engineering and Design, 2024, 416: 112755. A topological replication and mesh stitching technology based on reactor isomorphism is proposed to achieve the construction of a full core mesh model suitable for high-fidelity simulation of reactors (such as Figure 2 As shown in the figure, a distributed computing technology for thermal fluid based on reactor isomorphism is proposed to achieve the mapping of the smallest basic unit segment to the entire core and efficient reactor thermal fluid calculation. The grid generation is placed in the main solution stage. This method can effectively alleviate the problems of insufficient computing resources and memory, and long time consumption in large-scale simulation processes.
[0004] The core of large-scale parallel tasks is the mapping of massive scale grids to different processor cores and the communication and coordination between different processors (also between different grid tasks). In order to ensure the communication efficiency between processes in the solution process, each processor needs a unified grid vertex indexing method to assign a unique global vertex number to the same physical vertex in different processors. This grid vertex indexing technology is the basis of parallel simulation and is directly related to computational efficiency. The traditional thermal fluid simulation method reads the overall grid file in the preprocessing stage, first performs global vertex numbering to establish an index, and then performs parallel regional decomposition to evenly distribute the grid vertices to each processor to ensure load balancing. However, in the thermal fluid distributed computing based on reactor isomorphism, each processor reads its own segmented file, and forms the entire core component by copying and translating, without the need for regional decomposition, but each processor lacks global information, and the same physical vertex in different processors may be assigned different numbers. Therefore, how to ensure the uniqueness of the overall grid vertex index number is the key. Since the existing global vertex numbering method is based on the overall mesh file rather than the segmented file, there is no need to perform the task of overall mesh generation, and there is no lack of global information of mesh vertices, which cannot meet the current needs. Therefore, how to assign unique global vertex numbers to mesh vertices in the absence of global information and then establish mesh vertex indexes has become a problem to be solved. In view of this, the present invention proposes a unified mesh vertex indexing method for high-fidelity parallel simulation of the entire core of a fast reactor. Summary of the invention
[0005] The purpose of the present invention is to provide a unified grid vertex indexing method for high-fidelity parallel simulation of the entire core of a fast reactor to solve the problem of being unable to establish a unified grid vertex indexing between different grid segments in the distributed calculation of thermal fluids based on the isomorphism of the entire core of the reactor mentioned in the background technology.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] A unified grid vertex indexing method for high-fidelity parallel simulation of a fast reactor full core specifically comprises the following steps:
[0008] S1. Generate local hash table: Each processor generates a local hash table in parallel using the mesh information in its segment, traverses each vertex in the processor, generates a hash value according to the vertex coordinates, determines the local vertex number and assigns the processor number;
[0009] S2, array transfer: send the hash value, local vertex number and processor number obtained in S1 to processor 0 in the form of an array;
[0010] S3. Preliminary generation of a global hash table: Processor 0 receives vertex information from each processor, stores vertices with the same hash value in the same node, and generates a global hash table;
[0011] S4, conflict handling: traverse the global hash table generated in S3, and perform conflict handling on each node with more than 2 members: compare the key values of each vertex, if the key values are the same, no processing is done; if the key values are different, it means a conflict occurs, and find a new hash value for it;
[0012] S5, number return: according to the processor number of each vertex, the vertex information with the same processor number is transmitted back to the respective processors, and the vertex information of each segment of the whole core is collected;
[0013] S6, vertex mapping: After receiving the returned vertex information, each processor sorts the vertex information from small to large according to the local information of the vertex, and generates a mapping array until all segments of the whole core have completed the global vertex numbering task in their respective processors, and the index establishment is completed.
[0014] Preferably, the S1 specifically includes the following contents:
[0015] S1.1, initialize the hash table, and establish a hash table according to the number of vertices in the processor; the size of the established hash table is SIZE, and each element in the table is a null pointer;
[0016] S1.2, traverse each vertex in the processor, generate a hash value according to the vertex coordinates, determine the local vertex number according to the traversal order of each vertex, assign numbers to the processors, and then insert the nodes into the hash table.
[0017] Preferably, the S4 specifically includes the following contents:
[0018] S4.1. Processor 0 sequentially inserts the vertex information sent by other processors into nodes and preliminarily inserts them into the global hash table according to the hash value;
[0019] S4.2, traverse the global hash table and handle conflicts for each node with more than 2 members: compare the key values of each vertex. If the key values are the same, it means that the vertices are the same vertex from different processors and no processing is done; if the key values are different, it means that a conflict occurs, find a new hash value for the vertex, and reinsert it into the global hash table;
[0020] S4.3. After the traversal is completed, each physical vertex has a unique hash value. At this time, the hash value of each vertex is the global vertex number.
[0021] Compared with the prior art, the present invention provides a unified grid vertex indexing method for high-fidelity parallel simulation of the entire core of a fast reactor, which has the following beneficial effects:
[0022] (1) The simulation scale is expanded and applicable to the entire core grid. By utilizing the reactor isomorphism principle and distributed parallel computing, the physical vertices of the grid can be globally numbered based on the lack of global vertex information in the processor, thereby establishing an index.
[0023] (2) It is suitable for high-fidelity thermal fluid simulation calculation software. The global vertex number obtained by this method can facilitate the subsequent communication between processors and the use of higher-order precision methods (such as the spectral element method) to improve simulation accuracy.
[0024] (3) Effectively speed up thermal fluid calculations, reduce storage costs, and alleviate problems such as insufficient memory during calculations. Each processor does not need to read the entire core file, but instead reads the segmented file and copies and translates the entire core.
[0025] (4) The computing parallelism is improved. By applying a parallel hash table, each processor completes the preliminary numbering work synchronously, improving the task parallelism.
[0026] In summary, the present invention proposes a unified grid vertex indexing method for high-fidelity parallel simulation of the entire core of a fast reactor. By using this method, each processor can implement global vertex numbering on the basis of only segmentation information and establish a unique grid vertex index, which fills the gap in this field and promotes the research and development of high-fidelity thermal fluid computational simulation software with independent intellectual property rights. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a traditional CFD solution flow chart proposed in the background technology of the present invention, which is divided into two parts: pre-processing and main solution. In the pre-processing stage, the grid is divided as the input of the main solution stage, so as to complete the solution of the equation.
[0028] Figure 2 This is a schematic diagram of the topological replication and grid stitching technology based on reactor isomorphism proposed in the background technology of the present invention, which shows the basic principle of constructing a full core grid model suitable for high-fidelity simulation of the reactor. The full core grid can be generated from the basic unit grid models of each component through axial and radial translation.
[0029] Figure 3 This is an overall flow chart of the unified mesh vertex indexing method for high-fidelity parallel simulation of the whole core of a fast reactor proposed in Example 1 of the present invention; the basic process is as follows: at the beginning, constants are defined and MPI is initialized, and then each processor generates a local hash table in parallel to obtain local vertex numbers; then through the MPI_Send() and MPI_Recv() functions, processor No. 0 generates a global hash table, handles conflicts, and finally obtains the global vertex number, and then establishes the index. DETAILED DESCRIPTION
[0030] 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.
[0031] The present invention is aimed at the distributed computing of high-fidelity thermal fluid in the whole core of a fast neutron reactor. The purpose is to propose a global vertex numbering method based on a parallel hash table and establish a grid vertex index on the basis that the processors only have their own segmented grid files. Specifically, the local and global numbering of grid vertices is realized through a hash table, and the parallelization of the vertex numbering tasks of each processor is realized through MPI, providing an innovative global vertex numbering method for each processor, improving the efficiency of large-scale parallelism, and facilitating the development of large-scale high-fidelity thermal fluid numerical simulation software.
[0032] In the vertex numbering task, it is generally possible to use a multi-dimensional segmentation sorting method based on the specific characteristics of the graph or topological structure. When segmenting the unit segments after the copy and translation, due to the lack of global information, the unit segments in each processor can be locally numbered, and task parallelism can be achieved through MPI, and the vertex is assigned a unique number through the hash table. After that, the vertex information of other processors is sent to processor 0 to handle possible conflicts and generate a global hash table, thereby providing a unique global number for the vertex.
[0033] The unified grid vertex indexing method for high-fidelity parallel simulation of the entire core of a fast reactor proposed in the present invention is described below with reference to a specific example. The specific contents are as follows.
[0034] Embodiment 1:
[0035] Assume that each processor currently has a segment containing num_of_vertex vertices, the total number of processors is N, and the hash table size SIZE = number_of_vertex*2. When simulating calculations, use MPI to create N processes, each representing a processor. Where num_of_vertex and SIZE are positive integers, and N is a positive integer greater than or equal to 2. It should be pointed out that for the same physical vertex, due to the segmented storage of the reactor core, it may exist in different processors, and this needs to be judged and assigned the same global number.
[0036] 1. Important data structures (C++ description)
[0037] (1)Node data structure:
[0038] typedef struct Node{
[0039] float key[3];
[0040] int value;
[0041] int processorId;
[0042] int localId;
[0043] struct Node* next;
[0044] }Node;
[0045] Among them, key is the three-dimensional coordinates of the vertex; value is the generated hash value; processorId is the processor number where the current vertex is located; localId is the local number of the current vertex; next is a pointer to the next node.
[0046] (2) Hash table data structure
[0047] typedef struct HashMap{
[0048] int size;
[0049] Node**table;
[0050] }HashMap;
[0051] Among them, size is the size of the hash table; table is a two-dimensional array, each element of which is a pointer to a Node structure.
[0052] 2. Specific steps (such as Figure 3 (shown)
[0053] Generate a local hash table:
[0054] (1) Initialize the hash table and create a hash table hashMap according to the number of vertices num_of_vertex in the processor. The size is SIZE, and each element in the table is a null pointer NULL.
[0055] (2) Traverse each vertex in the processor, generate a hash value value based on the vertex (x, y, z) coordinates, determine its local vertex number localId according to the traversal order of each vertex (the local number of the i-th traversed vertex is i), assign a value to the processor number processorId, and insert the node into the hash table.
[0056] Array transfer and preliminary generation of a global hash table:
[0057] (1) Traverse the hash table and store the vertex information (key, value, localId, processorId) corresponding to each node in the arrays array_key, array_value, array_localId, and array_processorId in order.
[0058] (2) Use the MPI_Send() function to send the above array to processor No. 0; processor No. 0 receives the arrays sent by each processor.
[0059] Conflict handling:
[0060] (1) Processor No. 0 sequentially collects the vertex information sent by other processors to form nodes and initially inserts them into the global hash table according to the value.
[0061] (2) Traverse the global hash table. If there are 2 or more nodes in table[i], perform conflict resolution on these nodes. Assuming there are j nodes in table[i], the 2nd, 3rd, ..., jth nodes all compare their key values with the 1st node. If the key values of nodes 1 and k (2 <= k <= j) are the same, it means that they are the same physical vertex in different processors and are not processed; otherwise, it means that a conflict occurs. Find a new hash value new_value for vertex k and reinsert it into the global hash table. The pseudo code for establishing a global mesh vertex index method based on a parallel hash table in a large-scale high-fidelity simulation of the entire core of a neutron reactor is shown below.
[0062]
[0063] (3) After the traversal is completed, each physical vertex has a unique hash value. At this time, the hash value of each vertex is the global vertex number, globalId = value.
[0064] Number returned:
[0065] (1) Perform N for loops and store the node information (global vertex number, local vertex number) with the same processor number in the global hash table into the arrays array_globalId and array_localId.
[0066] (2) Use the MPI_send() function in the loop to send the arrays array_globalId and array_localId back to the corresponding processors.
[0067] Vertex Mapping:
[0068] The other processors receive the data from processor No. 0, generate a mapping from the local vertex number to the global number global_numbering[localId]=globalId, and the index establishment is completed.
[0069] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A unified grid vertex indexing method for high-fidelity parallel simulation of the entire core of a fast reactor, characterized in that: The specific steps include: S1. Generate local hash table: Each processor generates a local hash table in parallel using the mesh information in its segment, traverses each vertex in the processor, generates a hash value according to the vertex coordinates, determines the local vertex number and assigns the processor number; S2, array transfer: send the hash value, local vertex number and processor number obtained in S1 to processor 0 in the form of an array; S3. Preliminary generation of a global hash table: Processor 0 receives vertex information from each processor, stores vertices with the same hash value in the same node, and generates a global hash table; S4, conflict handling: traverse the global hash table generated in S3, and perform conflict handling on each node with more than 2 members: compare the key values of each vertex, if the key values are the same, no processing is done; if the key values are different, it means a conflict occurs, and find a new hash value for it; S5, number return: according to the processor number of each vertex, the vertex information with the same processor number is transmitted back to the respective processors, and the vertex information of each segment of the whole core is collected; S6, vertex mapping: After receiving the returned vertex information, each processor sorts the vertex information from small to large according to the local information of the vertex, and generates a mapping array until all segments of the whole core have completed the global vertex numbering task in their respective processors, and the index establishment is completed.
2. The unified grid vertex indexing method for high-fidelity parallel simulation of the whole core of a fast reactor according to claim 1, characterized in that: The S1 specifically includes the following contents: S1.1, initialize the hash table, and establish a hash table according to the number of vertices in the processor; the size of the established hash table is SIZE, and each element in the table is a null pointer; S1.2, traverse each vertex in the processor, generate a hash value according to the vertex coordinates, determine the local vertex number according to the traversal order of each vertex, assign numbers to the processors, and then insert the nodes into the hash table.
3. The unified grid vertex indexing method for high-fidelity parallel simulation of the whole core of a fast reactor according to claim 1, characterized in that: The S4 specifically includes the following contents: S4.
1. Processor 0 sequentially inserts the vertex information sent by other processors into nodes and preliminarily inserts them into the global hash table according to the hash value; S4.2, traverse the global hash table and handle conflicts for each node with more than 2 members: compare the key values of each vertex. If the key values are the same, it means that the vertices are the same vertex from different processors and no processing is done; if the key values are different, it means that a conflict occurs, find a new hash value for the vertex, and reinsert it into the global hash table; S4.
3. After the traversal is completed, each physical vertex has a unique hash value. At this time, the hash value of each vertex is the global vertex number.
Citation Information
Patent Citations
Fast neutron reactor full-core structure large-scale grid automatic generation method and system
CN113177335A
Mesh topology generation using parallel processing
US20240104845A1
