Background grid-based multi-physics field coupling parallel communication mapping construction method, device, equipment and medium
Through the multi-physics coupled parallel communication mapping construction method based on background grid, the problem of inefficient communication between solvers in the prior art is solved, efficient parallel communication is achieved and construction time-consuming.
Patent Information
- Application Number
- CN202411514525.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-10-29
AI Technical Summary
Existing parallel communication methods have problems such as inefficiency and long construction in improving communication efficiency between solvers, especially in large-scale grid numerical simulations.
Through a multi-physics coupled parallel communication mapping construction method based on background grid, the coupling surface of the solver is obtained and its boundaries are expanded, and the target background grid is generated to determine the approximate coupling surface, and a process communication map is established and parallel communication is performed.
It improves the communication efficiency between solvers, reduces the time-consuming construction of parallel communications, and is suitable for large-scale grid numerical simulation.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multidisciplinary coupled numerical simulation, and in particular to a method, device, equipment and medium for constructing multi-physical field coupled parallel communication mapping based on a background grid. Background Art
[0002] Multidisciplinary coupled numerical simulation refers to the process of combining multiple disciplinary solvers to perform numerical calculations on complex physical phenomena or engineering problems, predicting the physical phenomena and laws after coupling between different disciplines, and exploring the mechanisms and characteristics of the interaction between different physical fields. In order to achieve coupled simulation between different disciplines, different solvers need to transmit grid node coordinates and physical information data through coupling surfaces. The transmitted physical information data mainly includes structural displacement, flow data, motion speed and acceleration, etc. There are two ways to implement coupled data transmission and communication in multidisciplinary parallel numerical simulation: serial communication and parallel communication. Among them, parallel communication adopts a decentralized design idea, directly transmits and communicates coupling surface data between solver processes based on the mapping relationship of the coupling surface, and does not rely on the main process for data collection and distribution. It can greatly reduce the data communication delay time in multidisciplinary coupled numerical simulation, improve the efficiency of data communication, and avoid communication becoming a bottleneck restricting the overall computing efficiency during ultra-large-scale grid numerical simulation. It is the main technical direction for the development of data communication in multidisciplinary coupled simulation.
[0003] In order to achieve parallel communication, it is necessary to establish the channel and content of direct data communication between solvers according to the partition and data distribution of the coupling surface of each solver, that is, to determine which computing nodes of the first solver need to communicate with which computing nodes of the second solver, and the content that needs to be communicated between different computing nodes. Existing parallel communication methods are mainly implemented in two ways: one is to use loop traversal to search for corresponding mapping grid points one by one in the interpolation domain. This method is intuitive, simple, easy to implement, and can obtain accurate mapping relationships, but the search efficiency is extremely low, and it is only applicable to very simple and small problems; the other is to first use a rectangular / cuboid envelope to determine the coupling boundary, narrow the search range, and then combine special data structures (such as R-trees, which is another form of development into multidimensional space) and algorithms to obtain the mapping grid points in the envelope. This method can determine relatively accurate coupling communication content, but due to the use of special data structures, program design and implementation are relatively complex, and when the grid scale is large, building data structures and searching are also time-consuming. Therefore, how to improve the communication efficiency between solvers needs to be solved. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for constructing a multi-physics field coupling parallel communication mapping based on a background grid, which can improve the communication efficiency between solvers and reduce the time consumption of parallel communication construction. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a method for constructing a multi-physics field coupling parallel communication mapping based on a background grid, comprising:
[0006] Acquire a first coupling surface of each process in a first solver for communication coupling, and expand a boundary of the first coupling surface based on a support radius in a preset data mapping scheme to obtain an expanded coupling surface boundary;
[0007] Generate a target background grid corresponding to each process in the first solver according to a preset background grid setting instruction and the enlarged coupling surface boundary, and determine an approximate coupling surface of the first coupling surface on the target background grid;
[0008] Sending a second coupling surface of each process in a second solver for communication coupling to the first solver, and determining first position information of the second coupling surface on the approximate coupling surface;
[0009] A process communication mapping is established between each process in the first solver and each process in the second solver based on the first position information, and parallel communication is performed between the first solver and the second solver based on the process communication mapping.
[0010] Optionally, the step of expanding the boundary of the first coupling surface based on the support radius in the preset data mapping scheme to obtain an expanded coupling surface boundary includes:
[0011] Traversing the coupling surface nodes corresponding to each process in the first solver on the first coupling surface, and determining the maximum value and the minimum value of the coupling surface nodes in the directions of two coordinate axes respectively;
[0012] Determine the updated minimum value corresponding to the coupling surface node in the two coordinate axis directions by respectively using the numerical difference between the minimum value of the coupling surface node in the two coordinate axis directions and the first radius value in the preset data mapping scheme;
[0013] Obtaining updated maximum values corresponding to the coupling surface node in the two coordinate axis directions by respectively using the maximum values of the coupling surface node in the two coordinate axis directions and the value of the second radius value in the preset data mapping scheme;
[0014] The boundary of the first coupling surface is expanded based on the updated minimum value and the updated maximum value to obtain an expanded coupling surface boundary.
[0015] Optionally, generating a target background grid corresponding to each process in the first solver according to a preset background grid setting instruction and the enlarged coupling surface boundary includes:
[0016] Determine the number of nodes of the background grid in the two coordinate axis directions based on the preset background grid setting instruction, and substitute the boundary value of the boundary of the enlarged coupling surface into the preset grid size calculation formula to determine the target grid size of the background grid;
[0017] A target background grid corresponding to each process in the first solver is determined based on the number of nodes and the target grid size.
[0018] Optionally, determining an approximate coupling surface of the first coupling surface on the target background grid includes:
[0019] Traversing the grid points of the coupling surface of each process in the first solver, and determining the target support domain of the coupling surface node based on a preset support domain calculation formula;
[0020] Determine second position information of the target support region in the target background grid based on the diagonal coordinates of the target support region and the target grid size;
[0021] The target background grid is marked based on the second position information to obtain an approximate coupling surface of the enlarged coupling surface boundary on the target background grid.
[0022] Optionally, the determining first position information of the second coupling surface on the approximate coupling surface includes:
[0023] Traversing each coupling surface grid point on the second coupling surface through each process in the first solver, and determining whether each coupling surface grid point is within the boundary of the enlarged coupling surface;
[0024] If each of the coupling surface grid points is within the boundary of the enlarged coupling surface, the first position information of the second coupling surface on the approximate coupling surface is determined according to a preset position information calculation formula.
[0025] Optionally, the establishing, based on the first location information, a process communication mapping between each process in the first solver and each process in the second solver includes:
[0026] Determining a target node located in an interpolation domain corresponding to a target process in the first solver from the second coupling surface based on the first position information;
[0027] A process communication mapping is established between each process in the first solver and each process in the second solver based on the node sequence number corresponding to the target node.
[0028] Optionally, the performing parallel communication between the first solver and the second solver based on the process communication mapping includes:
[0029] A mapping matrix is established based on the node coordinates of the first coupling surface and the target node, and parallel communication is performed between the first solver and the second solver based on the mapping matrix.
[0030] In a second aspect, the present application discloses a multi-physics field coupling parallel communication mapping construction device based on a background grid, comprising:
[0031] A coupling surface expansion module, used for obtaining a first coupling surface of each process in a first solver for communication coupling, and expanding a boundary of the first coupling surface based on a support radius in a preset data mapping scheme to obtain an expanded coupling surface boundary;
[0032] An approximate coupling surface determination module, used to generate a target background grid corresponding to each process in the first solver according to a preset background grid setting instruction and the enlarged coupling surface boundary, and determine an approximate coupling surface of the first coupling surface on the target background grid;
[0033] a position information confirmation module, used to send the second coupling surface of each process in the second solver used for communication coupling to the first solver, and determine the first position information of the second coupling surface on the approximate coupling surface;
[0034] A data communication module is used to establish a process communication mapping between each process in the first solver and each process in the second solver based on the first position information, and to perform parallel communication between the first solver and the second solver based on the process communication mapping.
[0035] In a third aspect, the present application discloses an electronic device, comprising:
[0036] Memory, used to store computer programs;
[0037] A processor is used to execute the computer program to implement the aforementioned background grid-based multi-physics field coupling parallel communication mapping construction method.
[0038] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned background grid-based multi-physics field coupled parallel communication mapping construction method.
[0039] It can be seen that in the present application, the first coupling surface of each process in the first solver for communication coupling is obtained, and the boundary of the first coupling surface is expanded based on the support radius in the preset data mapping scheme to obtain the boundary of the expanded coupling surface; the target background grid corresponding to each process in the first solver is generated according to the preset background grid setting instruction and the boundary of the expanded coupling surface, and the approximate coupling surface of the first coupling surface on the target background grid is determined; the second coupling surface of each process in the second solver for communication coupling is sent to the first solver, and the first position information of the second coupling surface on the approximate coupling surface is determined; based on the first position information, the process communication mapping between each process in the first solver and each process in the second solver is established, and the parallel communication between the first solver and the second solver is performed based on the process communication mapping. That is, through the background grid mapping relationship, the process communication mapping between each process in the first solver and each process in the second solver is quickly determined. In this way, the time consumption of parallel communication construction can be greatly reduced while improving communication efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0041] Figure 1 A flowchart of a method for constructing a multi-physics field coupling parallel communication mapping based on a background grid disclosed in this application;
[0042] Figure 2 A flowchart of a specific method for constructing multi-physics field coupling parallel communication mapping based on background grid disclosed in this application;
[0043] Figure 3 A coupling surface mesh of a specific solver A and solver B disclosed in this application;
[0044] Figure 4 A coupling surface mesh and a background mesh of a specific solver A disclosed in this application;
[0045] Figure 5 is the position of the support domain of node p in the background grid in a specific process A1 disclosed in this application;
[0046] Figure 6 A specific process A1 disclosed in this application is to mark a background grid for a node p;
[0047] Figure 7 is a marked background grid in a specific solver A disclosed in this application;
[0048] Figure 8 The position of a node q of a specific process B1 disclosed in this application in the background grid of process A1;
[0049] Fig. 9 Filtering the coupling surface grid points of process B1 in a specific process A1 disclosed in this application to determine the communication content;
[0050] Fig.10 A schematic diagram of the structure of a multi-physics field coupling parallel communication mapping construction device based on a background grid disclosed in this application;
[0051] Fig.11 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0053] Existing parallel communication methods are mainly implemented in two ways: one is to use loop traversal to search for corresponding mapping grid points one by one in the interpolation domain. This method is intuitive, simple, easy to implement, and can obtain accurate mapping relationships, but the search efficiency is extremely low and is only applicable to very simple problems with small computational complexity; the other is to first use a rectangular / cuboid envelope to determine the coupling boundary, narrow the search range, and then combine a special data structure (such as an R-tree) and algorithm to obtain the mapping grid points in the envelope. This method can determine relatively accurate coupling communication content, but due to the use of a special data structure, program design and implementation are relatively complex, and when the grid scale is large, constructing data structures and searching are also time-consuming. This application will specifically introduce a method for constructing multi-physics field coupling parallel communication mapping based on a background grid, which can solve problems existing in communication content.
[0054] See also Figure 1 As shown, the embodiment of the present application discloses a method for constructing a multi-physics field coupling parallel communication mapping based on a background grid, comprising:
[0055] Step S11: obtaining a first coupling surface of each process in a first solver for communication coupling, and expanding a boundary of the first coupling surface based on a support radius in a preset data mapping scheme to obtain an expanded coupling surface boundary.
[0056] In this embodiment, the expansion of the boundary of the first coupling surface based on the support radius in the preset data mapping scheme to obtain the expanded coupling surface boundary includes: traversing the coupling surface nodes corresponding to each process in the first solver on the first coupling surface, and determining the maximum and minimum values of the coupling surface nodes in the two coordinate axis directions respectively; using the numerical difference obtained by the minimum value of the coupling surface node in the two coordinate axis directions and the first radius value in the preset data mapping scheme to determine the updated minimum value corresponding to the coupling surface node in the two coordinate axis directions; using the numerical sum of the maximum value of the coupling surface node in the two coordinate axis directions and the second radius value in the preset data mapping scheme to obtain the updated maximum value corresponding to the coupling surface node in the two coordinate axis directions; expanding the boundary of the first coupling surface based on the updated minimum value and the updated maximum value to obtain the expanded coupling surface boundary. Specifically, first determine the grid points included in the coupling surface Interface traversed by all processes of the first solver, and find the maximum and minimum values X of the coupling surface Interface in the two coordinate directions X and Y. min , X max , Y min , Y max Then, according to the mapped support radius r, the minimum values in the X and Y directions are enlarged, and then an appropriate value R (optional, R = 1.05r. The values of r and R can be set according to the actual situation) is selected to enlarge the maximum values in the X and Y directions to obtain the new coupling boundary X min =X min -r, Y min =Y min -r, X max =X max +R, Y max =Y max +R.
[0057] Step S12: generating a target background grid corresponding to each process in the first solver according to a preset background grid setting instruction and the enlarged coupling surface boundary, and determining an approximate coupling surface of the first coupling surface on the target background grid.
[0058] In this embodiment, the number of nodes of the background grid in the X and Y directions is first set, and then the target background grid corresponding to each process in the first solver is generated according to the coupling boundary value and the preset grid size calculation formula. Then, the grid points of the coupling surface Interface are traversed, and the support domain of the current node being traversed is calculated according to the support radius r. Furthermore, according to the two diagonal points of the support domain box of each node and the background grid size, the position of the diagonal point in the X and Y directions of the background grid is calculated, and the approximate coupling surface of the first coupling surface on the target background grid is determined according to the position.
[0059] Step S13: sending the second coupling surface of each process in the second solver used for communication coupling to the first solver, and determining first position information of the second coupling surface on the approximate coupling surface.
[0060] In this embodiment, determining the first position information of the second coupling surface on the approximate coupling surface includes: traversing each coupling surface grid point on the second coupling surface through each process in the first solver, and judging whether each coupling surface grid point is within the boundary of the enlarged coupling surface; if each coupling surface grid point is within the boundary of the enlarged coupling surface, determining the first position information of the second coupling surface on the approximate coupling surface according to a preset position information calculation formula. Specifically, the main process of the second solver for communication coupling collects the coupling surface grids of all processes and then sends them to the main process of the first solver. Finally, the main process of the first solver sends the received coupling surface grid of the second solver to all processes of the first solver. Then each process of the first solver traverses the received coupling surface grid points of the second solver to judge whether the node q(x,y) being traversed is within the coupling surface boundary of the process. If x <X min , or x>=X max , or <Y min , or y>=Y max , then q is not within the coupling surface boundary of the process. Otherwise, it is necessary to further calculate the position of node q in the background grid of the process. The calculation method is: the position of the background grid in the X direction is i=int((xX min ) / dX)+1, the position in the Y direction is j=int((yY min ) / dY)+1.
[0061] Step S14: establishing a process communication mapping between each process in the first solver and each process in the second solver based on the first position information, and performing parallel communication between the first solver and the second solver based on the process communication mapping.
[0062] In this embodiment, the process communication mapping between each process in the first solver and each process in the second solver based on the first position information includes: determining the target node located in the interpolation domain corresponding to the target process in the first solver from the second coupling surface based on the first position information; and establishing the process communication mapping between each process in the first solver and each process in the second solver based on the node sequence number corresponding to the target node. Specifically, according to the calculation result of the first position information, query whether the node q is in the interpolation domain of the current process of the first solver. If the value of the two-dimensional array indexBg(i,j) is 1, it means that the node q is located in the interpolation domain of the coupling surface of the first solver, and the value is 0, which means that the q point is outside the interpolation domain. Then, the communication mapping is established according to the query result. Traverse all points of the coupling surface of the second solver to establish a communication mapping such as Map={1:[q1,q2,…];…;m:[q1,q2,…]}. Among them, 1 to m represent the process number of the second solver, and q1, q2, ... represent the node numbers of the coupled surface mesh of the process of the second solver. Finally, the communication map is fed back to each process of the second solver and recorded as sendMap in each process of B. The map is in the form of sendMap={1:[q1,q2, ...]; ...; n:[q1,q2, ...]}. Among them, 1 to n represent the process number of the first solver, and q1, q2, ... represent the node numbers of the coupled surface mesh of the process of the second solver.
[0063] Further, in this embodiment, the parallel communication between the first solver and the second solver based on the process communication mapping includes: establishing a mapping matrix based on the node coordinates of the first coupling surface and the target node, and performing parallel communication between the first solver and the second solver based on the mapping matrix. First, each process of the second solver traverses the communication mapping sendMap, takes the process number (1...n) of the first solver as the target process of communication, and the displacement corresponding to the node sequence number [q1, q2,...] as the communication data, and establishes direct communication between each process of the second solver and each process of the first solver. Then, each process of the first solver collects the data sent by the second solver, including the process number (rank) and displacement of the second solver, and combines the collected data into a new coupling surface. Finally, each process of the first solver uses the relationship between its coupling surface node coordinates and the target node coordinates obtained in step S14 to establish a mapping matrix to realize the transmission of the displacement of the coupling surface of the second solver to each process of the first solver. Then, according to the inverse matrix of the mapping matrix, the data of the coupling surface on each process of the first solver is transmitted to the new coupling surface. Then, the communication map of each process in the first solver is used to decompose the new coupling surface and transfer it to the corresponding process of the second solver. Finally, each process of the second solver receives the data sent by each process of the first solver and restores it to the data of the coupling surface of the process. It should be noted here that this data is a certain type of data transmitted between solvers, including but not limited to pressure, transmission load, displacement and other data.
[0064] It can be seen that in this embodiment, the first coupling surface of each process in the first solver for communication coupling is obtained, and the boundary of the first coupling surface is expanded based on the support radius in the preset data mapping scheme to obtain the boundary of the expanded coupling surface; the target background grid corresponding to each process in the first solver is generated according to the preset background grid setting instruction and the boundary of the expanded coupling surface, and the approximate coupling surface of the first coupling surface on the target background grid is determined; the second coupling surface of each process in the second solver for communication coupling is sent to the first solver, and the first position information of the second coupling surface on the approximate coupling surface is determined; based on the first position information, the process communication mapping between each process in the first solver and each process in the second solver is established, and the parallel communication between the first solver and the second solver is performed based on the process communication mapping. That is, through the background grid mapping relationship, the process communication mapping between each process in the first solver and each process in the second solver is quickly determined. In this way, the time consumption of parallel communication construction can be greatly reduced while improving communication efficiency.
[0065] The above embodiment introduces the entire parallel communication method. This embodiment will specifically introduce the process of determining the background grid and the process of generating the approximate coupling surface.
[0066] See also Figure 2 As shown, the embodiment of the present application discloses a specific method for determining an approximate coupling surface, including:
[0067] Step S21: determining the number of nodes of the background grid in the two coordinate axis directions based on the preset background grid setting instruction, and substituting the boundary value of the enlarged coupling surface boundary into the preset grid size calculation formula to determine the target grid size of the background grid.
[0068] Step S22: determining the target background grid corresponding to each process in the first solver based on the number of nodes and the target grid size.
[0069] In this embodiment, the number of nodes of the background grid in the X direction is set to N i , the number of nodes in the Y direction is N j Then, according to the coupling surface boundary X min , X max , Y min , Y max and the number of nodes N of the background grid i 、N j Generate the corresponding rectangular background grid. The grid size in the X direction can be expressed as dX=(X max -X min ) / (N i -1), the grid size in the Y direction can be expressed as dY=(Y max -Y min ) / (N j -1).
[0070] Step S23: traversing the grid points of the coupling surfaces of each process in the first solver, and determining the target support domain of the coupling surface nodes based on a preset support domain calculation formula.
[0071] In this embodiment, first, the grid points of the coupling surface Interface are traversed, and the support domain of the node p(x, y) being traversed is calculated according to the support radius r. The support domain is a rectangle, and its coordinates are box=[xr, yr, x+r, y+r].
[0072] Step S24: determining second position information of the target support region in the target background grid based on the diagonal coordinates of the target support region and the target grid size.
[0073] In this embodiment, the two diagonal points P1 (xr, yr) and P2 (x+r, y+r) of each node support region box are found. According to the background grid size, the positions of the corner point P1 in the X and Y directions of the background grid are calculated as i min 、j min , where i min =int((xrX min ) / dX)+1,j min =int((yrY min ) / dY)+1. Then, the positions of the corner point P2 in the X and Y directions of the background grid are calculated as i max 、j max , where i max =int((x+rX min ) / dX)+1,j max =int((y+rY min ) / dY)+1.
[0074] Step S25: marking the target background grid based on the second position information to obtain an approximate coupling surface of the first coupling surface on the target background grid.
[0075] In this embodiment, the target background grid is marked based on the second position information to obtain an approximate coupling surface of the first coupling surface on the target background grid. Specifically, first, a two-dimensional array indexBg is created, whose size is (N i -1)*(N j -1). Initialize all element values of indexBg to 0, indicating that the background unit is not marked. Then, according to i min 、j min 、i max and j max Mark the background grid. Set the X direction to be greater than or equal to i min and less than or equal to i max The background unit, and the Y direction is greater than or equal to j min and less than or equal to j max The background unit is marked as 1, that is, indexBg(i min :i max ,j min :j max )=1.
[0076] It can be seen that in this embodiment, by constructing a background grid, and then establishing an interpolation envelope domain by rectangular partitioning of the background grid and marking it, the communication content between the computing nodes of the first solver and the second solver is quickly determined according to the background grid mapping relationship. This method can improve communication efficiency and greatly reduce the time consumption of parallel communication construction.
[0077] Next, the method of the present application will be specifically introduced in conjunction with specific examples. For easy identification, the first solver in the example is solver A, and the second solver is solver B. For example, in the field of high-speed aircraft numerical simulation, aerodynamic heating will cause the surface temperature of the aircraft to rise, thereby affecting the structural strength and stiffness; structural deformation will change the aerodynamic shape of the aircraft, thereby affecting the aerodynamic force of the aircraft, so it is necessary to combine the fluid solver and the structural solver to perform aerodynamic-thermal-structural coupling simulation, and the fluid solver and the structural solver need to communicate during the simulation process. Therefore, the fluid solver can be used as solver A, and the structural solver can be used as solver B. Alternatively, in the field of thermal protection, the flow of the fluid will affect the temperature distribution of the structure, and the temperature distribution on the surface of the structure will also affect the heat transfer between the fluid and the structure. Therefore, it is necessary to combine the fluid solver and the thermal solver to perform flow-thermal coupling simulation, and the fluid solver and the thermal solver also need to communicate during the simulation process. The fluid solver can be used as solver A, and the thermal solver can be used as solver B. There are processes A1 and A2 with coupled surface meshes in solver A. The coupled surface mesh elements of solver A are triangular elements. There are processes B1, B2 and B3 with coupled surface meshes in solver B. The coupled surface mesh elements of solver B are quadrilateral elements. The mesh model is as follows: Figure 3 shown.
[0078] All processes of solver A loop through all nodes of the coupling surface and calculate the maximum and minimum values of all nodes in the two coordinate directions X and Y by contrast exchange. min , X max , Y min , Y max , that is, for any node, compare the existing X min , X max , Y min , Y max The value is compared with the node's X and Y coordinates, and then X is updated based on the comparison result. min , X max , Y min , Y max value until all nodes are traversed. The coupling surface boundary of process A1 is X min =-5, X max =5, Y min =-0.1, Y max =5, the coupling surface boundary of process A2 is X min =-5, X max =5, Y min =-5, Y max =0.6.
[0079] According to the mapped support radius r=0.6, the minimum value of the coupling surface boundary in the X and Y directions is expanded, and then R=0.63 is selected to expand the maximum value of the coupling surface boundary in the X and Y directions. In process A1, the coupling surface boundary after expansion is X min =-5.6, Y min =-0.7, X max =5.63, Y max =5.63, the coupling surface boundary after expansion in process A2 is X min =-5.6, Y min =-5.6, X max =5.63, Y max =1.23.
[0080] Furthermore, the number of nodes in the background grid in the X direction is set to Ni = 21, and the number of nodes in the Y direction is set to Nj = 21. Then, a rectangular background grid is generated according to the obtained coupling surface boundary and Ni, Nj, as shown in Figure 4 In process A1, the mesh size in the X direction is dX=0.5615, and the mesh size in the Y direction is dY=0.3615. In process A2, the mesh size in the X direction is dX=0.5615, and the mesh size in the Y direction is dY=0.3415.
[0081] Traverse the nodes of the coupling surface of each process of solver A. Then, calculate the support domain of the node p being traversed based on the support radius r=0.6. For example Figure 5 In the example, the node being traversed is p(5,0), and the coordinates of its support domain are box=[4.4,-0.6,5.6,0.6].
[0082] Then, find the two diagonal points of the support box of each node, such as Figure 5 The diagonal points of the support domain of the node p in the background are P1(4.4,-0.6) and P2(5.6,0.6). Then, according to the background grid size, the positions of the two diagonal points on the background grid are calculated. The positions of the corner point P1(4.4,-0.6) in the X and Y directions of the background grid are i min =18,j min =1, the positions of the corner point P2(5.6,0.6) in the X and Y directions of the background grid are i max =20,j max =5.
[0083] Furthermore, a two-dimensional array indexBg is created with a size of 20*20, and all elements of indexBg are initialized to 0, indicating that the background unit is not marked. Then, according to the calculated i min 、j min 、i max and jmax Mark the background grid, e.g. Figure 6 In the figure, the background cells marked by node p are displayed in black, and the unmarked background cells are displayed in white. The background mesh marked by solver A is shown in Figure 7 As shown. Then the main process of solver B collects the coupling surface meshes of all processes and sends them to the main process of solver A. Finally, the main process of solver A sends the received coupling surface meshes of solver B to all processes of solver A.
[0084] First, each process of solver A traverses the received coupling surface grid points of solver B to determine whether the node q(x,y) being traversed is within the coupling surface boundary of the process. Taking process A1 as an example, if x<-5.6, or x>=5.63, or y<-0.7, or y>=5.63, then q is not within the coupling surface boundary of process A1. Otherwise, further calculate the position of node q in the background grid of process A1. Figure 8 It means that the node q being traversed is (4.667,2), its position in the X direction is i=19, and its position in the Y direction is j=9. Then it queries whether the point is within the interpolation domain of the current process of solver A. The query result is as follows Fig. 9 As shown. Then, a communication mapping is established based on the query results. Taking process A1 as an example, the communication mapping between process A1 and process B1 is established as Map={B1:[3-8,12-19,21-50]}. Finally, the communication mapping is fed back to each process of solver B and recorded as sendMap in each process of B. In process B1, sendMap={A1:[3-8,12-19,21-50]}.
[0085] Furthermore, each process of solver B traverses the communication map sendMap, takes the process number (1…n) of solver A as the target process of communication, and the displacement corresponding to the node number [q1,q2,…] as the communication data, and establishes direct communication between each process of solver B and each process of solver A. Then, each process of solver A collects the data sent by solver B, including the process number (rank) and displacement of solver B, and combines the collected data into a new coupling surface. Finally, each process of solver A uses the relationship between its coupling surface node coordinates and the obtained coupling surface node coordinates of solver B to establish a mapping matrix to realize the transmission of the displacement of the coupling surface of solver B to each process of solver A. According to the inverse matrix of the mapping matrix, the data of the coupling surface on each process of solver A is transmitted to the new coupling surface. Then, using the communication map Map of each process in solver A, the new coupling surface is decomposed and transmitted to the corresponding process of solver B. Finally, each process of solver B receives the data sent by each process of solver A and restores it to the data of the coupling surface of the process.
[0086] refer to Fig.10 The embodiment of the present application also discloses a multi-physical field coupling parallel communication mapping construction device based on a background grid, including:
[0087] A coupling surface expansion module 11 is used to obtain a first coupling surface of each process in a first solver for communication coupling, and expand a boundary of the first coupling surface based on a support radius in a preset data mapping scheme to obtain an expanded coupling surface boundary;
[0088] An approximate coupling surface determination module 12, configured to generate a target background grid corresponding to each process in the first solver according to a preset background grid setting instruction and the enlarged coupling surface boundary, and determine an approximate coupling surface of the first coupling surface on the target background grid;
[0089] A position information confirmation module 13, used to send the second coupling surface of each process in the second solver used for communication coupling to the first solver, and determine the first position information of the second coupling surface on the approximate coupling surface;
[0090] The data communication module 14 is used to establish a process communication mapping between each process in the first solver and each process in the second solver based on the first position information, and to perform parallel communication between the first solver and the second solver based on the process communication mapping.
[0091] It can be seen that in this embodiment, the process communication mapping between each process in the first solver and each process in the second solver is quickly determined and established through the background grid mapping relationship. In this way, the time consumption of parallel communication construction can be greatly reduced while improving the communication efficiency.
[0092] In some specific embodiments, the coupling surface expansion module 11 may specifically include:
[0093] A coupling surface boundary determination unit, used for traversing the coupling surface nodes corresponding to each process in the first solver on the first coupling surface, and determining the maximum value and the minimum value of the coupling surface nodes in the directions of two coordinate axes respectively;
[0094] A minimum value updating unit, used to determine the updated minimum value corresponding to the coupling surface node in the two coordinate axis directions by respectively using the numerical difference between the minimum value of the coupling surface node in the two coordinate axis directions and the first radius value in the preset data mapping scheme;
[0095] A maximum value updating unit, used to obtain an updated maximum value corresponding to the coupling surface node in the two coordinate axis directions by respectively using the maximum value of the coupling surface node in the two coordinate axis directions and the value of the second radius value in the preset data mapping scheme;
[0096] A boundary expansion unit is used to expand the boundary of the first coupling surface based on the updated minimum value and the updated maximum value to obtain an expanded coupling surface boundary.
[0097] In some specific embodiments, the approximate coupling surface determining module 12 may specifically include:
[0098] A background size determination unit, for determining the number of nodes of the background grid in two coordinate axis directions based on a preset background grid setting instruction, and substituting the boundary value of the enlarged coupling surface boundary into a preset grid size calculation formula to determine a target grid size of the background grid;
[0099] A target background grid generation unit is used to determine the target background grid corresponding to each process in the first solver based on the number of nodes and the target grid size.
[0100] In some specific embodiments, the approximate coupling surface determining module 12 may specifically include:
[0101] A support domain determination unit, configured to traverse the grid points of the coupling surfaces of each process in the first solver, and determine the target support domain of the coupling surface nodes based on a preset support domain calculation formula;
[0102] A position determination unit, configured to determine second position information of the target support region in the target background grid based on the diagonal coordinates of the target support region and the target grid size;
[0103] A position marking unit is used to mark the target background grid based on the second position information to obtain an approximate coupling surface of the enlarged coupling surface boundary on the target background grid.
[0104] In some specific embodiments, the location information confirmation module 13 may specifically include:
[0105] A grid point judgment unit, configured to traverse each coupling surface grid point on the second coupling surface through each process in the first solver, and judge whether each coupling surface grid point is within the boundary of the enlarged coupling surface;
[0106] A position calculation unit is used to determine the first position information of the second coupling surface on the approximate coupling surface according to a preset position information calculation formula if each coupling surface grid point is within the boundary of the enlarged coupling surface.
[0107] In some specific embodiments, the data communication module 14 may specifically include:
[0108] a target node determining unit, configured to determine, from the second coupling surface based on the first position information, a target node located in an interpolation domain corresponding to a target process in the first solver;
[0109] A communication mapping establishing unit is used to establish a process communication mapping between each process in the first solver and each process in the second solver based on the node sequence number corresponding to the target node.
[0110] In some specific embodiments, the data communication module 14 may specifically include:
[0111] A parallel communication unit is used to establish a mapping matrix based on the node coordinates of the first coupling surface and the target node, and to perform parallel communication between the first solver and the second solver based on the mapping matrix.
[0112] Furthermore, the present application also discloses an electronic device. Fig.11 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0113] Fig.11 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the method for constructing a multi-physics field coupling parallel communication mapping based on a background grid disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0114] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0115] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0116] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the multi-physics field coupling parallel communication mapping construction method based on the background grid performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0117] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed method for constructing a multi-physics field coupled parallel communication mapping based on a background grid is implemented. The specific steps of the method can be referred to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0118] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0119] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0120] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0121] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0122] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for constructing multi-physics field coupling parallel communication mapping based on background grid, characterized in that: include: Acquire a first coupling surface of each process in a first solver for communication coupling, and expand the boundary of the first coupling surface based on a support radius in a preset data mapping scheme to obtain an expanded coupling surface boundary; wherein, expanding the boundary of the first coupling surface based on the support radius in the preset data mapping scheme to obtain an expanded coupling surface boundary comprises: traversing the coupling surface nodes corresponding to each process in the first solver on the first coupling surface, and determining the maximum and minimum values of the coupling surface nodes in two coordinate axis directions respectively; determining the updated minimum value corresponding to the coupling surface node in the two coordinate axis directions by using the numerical difference obtained by the minimum value of the coupling surface node in the two coordinate axis directions and the first radius value in the preset data mapping scheme respectively; obtaining the updated maximum value corresponding to the coupling surface node in the two coordinate axis directions by using the numerical sum of the maximum value of the coupling surface node in the two coordinate axis directions and the second radius value in the preset data mapping scheme respectively; expanding the boundary of the first coupling surface based on the updated minimum value and the updated maximum value to obtain an expanded coupling surface boundary; Generate a target background grid corresponding to each process in the first solver according to a preset background grid setting instruction and the enlarged coupling surface boundary, and determine an approximate coupling surface of the first coupling surface on the target background grid; The second coupling surface of each process in the second solver for communication coupling is sent to the first solver, and the first position information of the second coupling surface on the approximate coupling surface is determined; wherein the determining the first position information of the second coupling surface on the approximate coupling surface comprises: traversing each coupling surface grid point on the second coupling surface through each process in the first solver, and judging whether each coupling surface grid point is within the boundary of the enlarged coupling surface; if each coupling surface grid point is within the boundary of the enlarged coupling surface, determining the first position information of the second coupling surface on the approximate coupling surface according to a preset position information calculation formula; The preset position information calculation formula is i=int((x- X min ) / d X )+1 and j=int((y- Y min ) / d Y )+1; where i is X The position of the direction, j is Y direction, x is the mesh point of the coupling surface X direction coordinate, y is the mesh point of the coupling surface Y The coordinates of the direction, X min The boundary of the coupling surface after the expansion is X The minimum value of the direction, Y min The boundary of the coupling surface after the expansion is Y Minimum value of direction, d X for X The grid size in the direction, d Y for Y Grid size in direction; A process communication mapping is established between each process in the first solver and each process in the second solver based on the first position information, and parallel communication is performed between the first solver and the second solver based on the process communication mapping; wherein, the process communication mapping is established between each process in the first solver and each process in the second solver based on the first position information, including: determining a target node located in an interpolation domain corresponding to a target process in the first solver from the second coupling surface based on the first position information; and establishing a process communication mapping between each process in the first solver and each process in the second solver based on a node serial number corresponding to the target node.
2. The method for constructing multi-physics field coupling parallel communication mapping based on background grid according to claim 1 is characterized in that: The step of generating a target background grid corresponding to each process in the first solver according to the preset background grid setting instruction and the enlarged coupling surface boundary includes: Determine the number of nodes of the background grid in the two coordinate axis directions based on the preset background grid setting instruction, and substitute the boundary value of the boundary of the enlarged coupling surface into the preset grid size calculation formula to determine the target grid size of the background grid; A target background grid corresponding to each process in the first solver is determined based on the number of nodes and the target grid size.
3. The method for constructing multi-physics field coupling parallel communication mapping based on background grid according to claim 2 is characterized in that: The determining an approximate coupling surface of the first coupling surface on the target background grid includes: Traversing the grid points of the coupling surface of each process in the first solver, and determining the target support domain of the coupling surface node based on a preset support domain calculation formula; Determine second position information of the target support region in the target background grid based on the diagonal coordinates of the target support region and the target grid size; The target background grid is marked based on the second position information to obtain an approximate coupling surface of the first coupling surface on the target background grid.
4. The method for constructing multi-physics field coupling parallel communication mapping based on background grid according to claim 1, characterized in that: The performing parallel communication between the first solver and the second solver based on the process communication mapping includes: A mapping matrix is established based on the node coordinates of the first coupling surface and the target node, and parallel communication is performed between the first solver and the second solver based on the mapping matrix.
5. A multi-physics field coupling parallel communication mapping construction device based on background grid, characterized in that: include: A coupling surface expansion module, used for acquiring the first coupling surface of each process in the first solver for communication coupling, and expanding the boundary of the first coupling surface based on the support radius in the preset data mapping scheme to obtain the expanded coupling surface boundary; wherein, the expansion of the boundary of the first coupling surface based on the support radius in the preset data mapping scheme to obtain the expanded coupling surface boundary comprises: traversing the coupling surface nodes corresponding to each process in the first solver on the first coupling surface, and determining the maximum value and the minimum value of the coupling surface nodes in the two coordinate axis directions respectively; determining the updated minimum value corresponding to the coupling surface node in the two coordinate axis directions by using the numerical difference obtained by the minimum value of the coupling surface node in the two coordinate axis directions and the first radius value in the preset data mapping scheme respectively; obtaining the updated maximum value corresponding to the coupling surface node in the two coordinate axis directions by using the numerical sum of the maximum value of the coupling surface node in the two coordinate axis directions and the second radius value in the preset data mapping scheme respectively; expanding the boundary of the first coupling surface based on the updated minimum value and the updated maximum value to obtain the expanded coupling surface boundary; An approximate coupling surface determination module, used to generate a target background grid corresponding to each process in the first solver according to a preset background grid setting instruction and the enlarged coupling surface boundary, and determine an approximate coupling surface of the first coupling surface on the target background grid; A position information confirmation module, used to send the second coupling surface of each process in the second solver used for communication coupling to the first solver, and determine the first position information of the second coupling surface on the approximate coupling surface; wherein, the determining the first position information of the second coupling surface on the approximate coupling surface comprises: traversing each coupling surface grid point on the second coupling surface through each process in the first solver, and judging whether each coupling surface grid point is within the boundary of the enlarged coupling surface; if each coupling surface grid point is within the boundary of the enlarged coupling surface, determining the first position information of the second coupling surface on the approximate coupling surface according to a preset position information calculation formula; The preset position information calculation formula is i=int((x- X min ) / d X )+1 and j=int((y- Y min ) / d Y )+1; where i is X The position of the direction, j is Y direction, x is the mesh point of the coupling surface X direction coordinate, y is the mesh point of the coupling surface Y The coordinates of the direction, X min The boundary of the coupling surface after the expansion is X The minimum value of the direction, Y min The boundary of the coupling surface after the expansion is Y Minimum value of direction, d X for X The grid size in the direction, d Y for Y Grid size in direction; A data communication module, used to establish a process communication mapping between each process in the first solver and each process in the second solver based on the first position information, and to perform parallel communication between the first solver and the second solver based on the process communication mapping; wherein, the process communication mapping between each process in the first solver and each process in the second solver based on the first position information includes: determining a target node located in an interpolation domain corresponding to a target process in the first solver from the second coupling surface based on the first position information; and establishing a process communication mapping between each process in the first solver and each process in the second solver based on a node sequence number corresponding to the target node.
6. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the background grid-based multi-physics field coupling parallel communication mapping construction method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the background grid-based multi-physics field coupling parallel communication mapping construction method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Grid data transmission method for multi-physics field coupling
CN115794447A
Quick construction method and equipment for parallel communication of coupling interface data and medium
CN118152155A
Cited By
Parallel communication mapping construction method based on double marking
CN119996197A