Lattice Boltzmann evolution method and device, electronic equipment and storage medium

By using only one memory copy to update the particle density distribution function in the lattice Boltzmann evolution method, the problems of read-write conflicts and memory requirements in parallel computing are solved, computing efficiency is improved and costs are saved.

CN118709508APending Publication Date: 2024-09-27CHINA AUTOMOTIVE INNOVATION CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410719405.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

The existing lattice Boltzmann evolution method requires two copies to store the particle density distribution function in parallel computing, which results in additional memory consumption and repeated reading and storage operations, reducing computing efficiency and increasing storage requirements.

Method used

Write multiple first particle density distribution functions into the memory variables of the current grid, and generate and write the second particle density distribution function through the migration step. Only one memory copy is used for updating, which avoids read and write conflicts and reduces memory requirements. .

Benefits of technology

In parallel computing, read and write conflicts are avoided, the frequency and demand for repeated memory reading are reduced, computing efficiency is improved, and time and economic costs are saved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709508A
    Figure CN118709508A
Patent Text Reader

Abstract

The invention discloses a lattice Boltzmann evolution method, a lattice Boltzmann evolution device, electronic equipment and a storage medium, according to the scheme, through redesign of collision and migration steps of a lattice Boltzmann method, an in-situ access technical scheme of a collision migration process of a particle density distribution function can be completed by only needing a density distribution function copy; in other words, in-situ reading of the particle density distribution functions on the lattices is achieved, calculation of the particle density distribution functions on other lattices cannot be affected, and read-write conflicts cannot be generated in the parallel calculation process; compared with a traditional mode, according to the scheme, updating of the particle density distribution function can be completed only through one copy, namely one memory variable, the repeated reading frequency of a memory is reduced, meanwhile, the memory requirement is reduced by half, and therefore when the LBM is used for conducting high-performance parallel computing, time and economic cost can be greatly saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a lattice Boltzmann evolution method, device, electronic device and storage medium. Background Art

[0002] The Lattice Boltzmann Method (LBM) is a numerical method different from traditional computational fluid dynamics. It solves the macroscopic physical parameters of the fluid system by directly discretizing the Boltzmann equation from the mesoscopic scale and gas kinetic theory. As a simple and effective numerical method, the LBM method is very suitable for large-scale parallel computing due to its natural locality and parallelism.

[0003] In the related art, the evolution of LBM can be divided into two processes: collision step and migration step. In both processes, multiple particle density distribution functions (DDF) need to be stored. At present, two copies are usually used to store DDF respectively. After each collision step and migration step, the storage information of the two copies is exchanged to solve the reading and storage conflicts in the parallel computing process.

[0004] However, the above lattice Boltzmann evolution method will bring additional memory consumption and repeated reading and storage operations, which not only reduces the computational efficiency but also increases the storage requirements. Summary of the invention

[0005] The present application aims to at least solve the technical problems existing in the prior art. To this end, the present application proposes a lattice Boltzmann evolution method in a first aspect, which comprises:

[0006] Writing a plurality of first particle density distribution functions into the memory variable of the current grid; wherein the plurality of first particle density distribution functions are obtained after executing a collision step on a plurality of initial particle density distribution functions stored in the current grid;

[0007] Obtain multiple pre-migration particle density distribution functions corresponding to the current grid; wherein the multiple pre-migration particle density distribution functions include multiple first particle density distribution functions stored in the current grid and multiple first particle density distribution functions stored in other grids around the current grid, and the first particle density distribution functions stored in other grids are obtained after executing a collision step on multiple initial particle density distribution functions stored in other grids;

[0008] A migration step is performed on multiple pre-migration particle density distribution functions to generate multiple second particle density distribution functions corresponding to the current grid, and the multiple second particle density distribution functions are written into the memory variable of the current grid.

[0009] In a possible implementation, performing a migration step on a plurality of pre-migration particle density distribution functions to generate a plurality of second particle density distribution functions corresponding to the current grid includes:

[0010] Obtaining first directions corresponding to a plurality of first particle density distribution functions stored in a current grid among a plurality of pre-migration particle density distribution functions;

[0011] Obtaining a second direction corresponding to the first particle density distribution function stored in a plurality of other grids around the current grid in a plurality of pre-migration particle density distribution functions; wherein the second direction is opposite to the first direction;

[0012] The multiple first particle density distribution functions corresponding to the first direction are exchanged with the multiple first particle density distribution functions corresponding to the second direction to generate multiple second particle density distribution functions corresponding to the current grid.

[0013] In a possible implementation, multiple first particle density distribution functions corresponding to the first direction are exchanged with multiple first particle density distribution functions corresponding to the second direction to generate multiple second particle density distribution functions corresponding to the current grid, including:

[0014] For each first particle density distribution function corresponding to the first direction, a target particle density distribution function is obtained from a plurality of first particle density distribution functions corresponding to the second direction; wherein the target particle density distribution function and the first particle density distribution function corresponding to the first direction are located on a straight line;

[0015] The target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction to generate a plurality of second particle density distribution functions corresponding to the current grid.

[0016] In a possible implementation, the target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction to generate a plurality of second particle density distribution functions corresponding to the current grid, including:

[0017] The target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction to obtain the target particle density distribution function after migration;

[0018] Obtain the inverse distribution function corresponding to the density distribution function of each migrated target particle in the current grid;

[0019] Based on the density distribution functions of the target particles after migration in the current grid and the inverse distribution functions corresponding to the density distribution functions of the target particles after migration in the current grid, a plurality of second particle density distribution functions corresponding to the current grid are obtained.

[0020] In a possible implementation, the multiple second particle density distribution functions corresponding to the current grid include the density distribution functions of the target particles after migration in the current grid, and the inverse distribution functions corresponding to the density distribution functions of the target particles after migration in the current grid, and the multiple second particle density distribution functions are written into the memory variable of the current grid, including:

[0021] Determine the first write position corresponding to each post-migration target particle density distribution function in the current grid;

[0022] Determine a second write position corresponding to the inverse distribution function corresponding to each post-migration target particle density distribution function in the current grid;

[0023] Based on the first write position and the second write position, a plurality of second particle density distribution functions are written into the memory variable of the current grid.

[0024] In a possible implementation, the method further includes:

[0025] In a new iteration process of the current grid, the inverse distribution functions of the plurality of second particle density distribution functions stored in the current grid are obtained;

[0026] Using the inverse distribution functions of the plurality of second particle density distribution functions as the new plurality of initial particle density distribution functions;

[0027] A collision step is performed on the new multiple initial particle density distribution functions to generate new multiple first particle density distribution functions, and the steps of the above-mentioned lattice Boltzmann evolution method are repeatedly performed until a preset iteration termination condition is reached.

[0028] In a possible implementation, the first direction is a positive direction, and the second direction is a negative direction.

[0029] In a second aspect, the present application proposes a lattice Boltzmann evolution device, the device comprising:

[0030] A writing module is used to write a plurality of first particle density distribution functions into the memory variable of the current grid; wherein the plurality of first particle density distribution functions are obtained after executing a collision step on a plurality of initial particle density distribution functions stored in the current grid;

[0031] An acquisition module is used to acquire multiple pre-migration particle density distribution functions corresponding to the current grid; wherein the multiple pre-migration particle density distribution functions include multiple first particle density distribution functions stored in the current grid and multiple first particle density distribution functions stored in other grids around the current grid, and the first particle density distribution functions stored in other grids are obtained after executing a collision step on multiple initial particle density distribution functions stored in other grids;

[0032] A generation module is used to perform a migration step on multiple pre-migration particle density distribution functions, generate multiple second particle density distribution functions corresponding to the current grid, and write the multiple second particle density distribution functions into the memory variable of the current grid.

[0033] In a possible implementation manner, the generation module is specifically used to:

[0034] Obtaining first directions corresponding to a plurality of first particle density distribution functions stored in a current grid among a plurality of pre-migration particle density distribution functions;

[0035] Obtaining a second direction corresponding to the first particle density distribution function stored in a plurality of other grids around the current grid in a plurality of pre-migration particle density distribution functions; wherein the second direction is opposite to the first direction;

[0036] The multiple first particle density distribution functions corresponding to the first direction are exchanged with the multiple first particle density distribution functions corresponding to the second direction to generate multiple second particle density distribution functions corresponding to the current grid.

[0037] In a possible implementation manner, the generation module is further used to:

[0038] For each first particle density distribution function corresponding to the first direction, a target particle density distribution function is obtained from a plurality of first particle density distribution functions corresponding to the second direction; wherein the target particle density distribution function and the first particle density distribution function corresponding to the first direction are located on a straight line;

[0039] The target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction to generate a plurality of second particle density distribution functions corresponding to the current grid.

[0040] In a possible implementation manner, the generation module is further used to:

[0041] The target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction to obtain the target particle density distribution function after migration;

[0042] Obtain the inverse distribution function corresponding to the density distribution function of each migrated target particle in the current grid;

[0043] Based on the density distribution functions of the target particles after migration in the current grid and the inverse distribution functions corresponding to the density distribution functions of the target particles after migration in the current grid, a plurality of second particle density distribution functions corresponding to the current grid are obtained.

[0044] In a possible implementation, the multiple second particle density distribution functions corresponding to the current grid include density distribution functions of target particles after migration in the current grid, and inverse distribution functions corresponding to density distribution functions of target particles after migration in the current grid, and the generation module is further used for:

[0045] Determine the first write position corresponding to each post-migration target particle density distribution function in the current grid;

[0046] Determine a second write position corresponding to the inverse distribution function corresponding to each post-migration target particle density distribution function in the current grid;

[0047] Based on the first write position and the second write position, a plurality of second particle density distribution functions are written into the memory variable of the current grid.

[0048] In one possible implementation, the lattice Boltzmann evolution device is further used to:

[0049] In a new iteration process of the current grid, the inverse distribution functions of the plurality of second particle density distribution functions stored in the current grid are obtained;

[0050] Using the inverse distribution functions of the plurality of second particle density distribution functions as the new plurality of initial particle density distribution functions;

[0051] A collision step is performed on the new multiple initial particle density distribution functions to generate new multiple first particle density distribution functions, and the steps of the above-mentioned lattice Boltzmann evolution method are repeatedly performed until a preset iteration termination condition is reached.

[0052] In a possible implementation, the first direction is a positive direction, and the second direction is a negative direction.

[0053] The third aspect of the present application proposes an electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the lattice Boltzmann evolution method as described in the first aspect.

[0054] The fourth aspect of the present application proposes a computer-readable storage medium, which stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by a processor to implement the lattice Boltzmann evolution method as described in the first aspect.

[0055] The embodiments of the present application have the following beneficial effects:

[0056] The lattice Boltzmann evolution method, device, electronic device and storage medium provided in the embodiments of the present application include: writing multiple first particle density distribution functions into the memory variable of the current lattice, wherein the multiple first particle density distribution functions are obtained after executing a collision step on the multiple initial particle density distribution functions stored in the current lattice, obtaining multiple pre-migration particle density distribution functions corresponding to the current lattice, wherein the multiple pre-migration particle density distribution functions include the multiple first particle density distribution functions stored in the current lattice and the first particle density distribution functions stored in multiple other lattices around the current lattice, the first particle density distribution functions stored in other lattices are obtained after executing a collision step on the multiple initial particle density distribution functions stored in other lattices, performing a migration step on the multiple pre-migration particle density distribution functions, generating multiple second particle density distribution functions corresponding to the current lattice, and writing the multiple second particle density distribution functions into the memory variable of the current lattice. This solution writes multiple first particle density distribution functions into the memory variable of the current grid, that is, the multiple initial particle density distribution functions are read from the position of the memory variable, and the multiple first particle density distribution functions are written in situ to the position, and the multiple second particle density distribution functions after the current grid is migrated are still written in situ to the memory variable of the current grid, which will not affect the particle density distribution functions on other grids, so that no read-write conflict occurs during the parallel computing process; in addition, only one copy, that is, one memory variable, is needed to complete the update of the particle density distribution function, which reduces the frequency of repeated memory reading and reduces the memory requirement by half; at the same time, when using LBM for high-performance parallel computing, it can greatly save time and economic costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 A schematic diagram of an existing collision step before collision provided in an embodiment of the present application;

[0058] Figure 2 A schematic diagram of performing a collision in an existing collision step provided in an embodiment of the present application;

[0059] Figure 3 A schematic diagram of an existing post-collision writing in a collision step provided in an embodiment of the present application;

[0060] Figure 4 A schematic diagram before migration in an existing execution migration step provided in an embodiment of the present application;

[0061] Figure 5 A schematic diagram of migration in an existing execution migration step provided in an embodiment of the present application;

[0062] Figure 6 A schematic diagram of post-migration writing in an existing execution migration step provided in an embodiment of the present application;

[0063] Figure 7 A structural block diagram of a computer device provided in an embodiment of the present application;

[0064] Figure 8 A flowchart of the steps of a lattice Boltzmann evolution method provided in an embodiment of the present application;

[0065] Fig. 9 A schematic diagram before a collision in a collision step performed in the present application provided in an embodiment of the present application;

[0066] Fig.10 A schematic diagram of performing a collision in a collision step in the present application provided in an embodiment of the present application;

[0067] Fig.11 A schematic diagram of performing post-collision writing in a collision step in the present application provided in an embodiment of the present application;

[0068] Fig.12 A schematic diagram before migration in a migration step performed in the present application provided in an embodiment of the present application;

[0069] Fig.13 A flowchart of the steps of generating a plurality of second particle density distribution functions provided in an embodiment of the present application;

[0070] Fig.14 Another flow chart of steps for generating a plurality of second particle density distribution functions provided in an embodiment of the present application;

[0071] Fig.15 A schematic diagram of performing migration in the migration step in the present application provided in an embodiment of the present application;

[0072] Fig.16 A flowchart of another step of generating a plurality of second particle density distribution functions provided in an embodiment of the present application;

[0073] Fig.17 A flowchart of the steps of writing a plurality of second particle density distribution functions provided in an embodiment of the present application;

[0074] Fig.18 A schematic diagram of post-migration writing in a migration step in the present application provided in an embodiment of the present application;

[0075] Fig.19 A flowchart of the steps of performing a new round of iteration on the current grid provided in an embodiment of the present application;

[0076] Fig. 20 A structural block diagram of a lattice Boltzmann evolution device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0077] 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 belong to the protection area of ​​the present application.

[0078] In the related technology, the evolution of LBM can be divided into two processes: collision step and migration step. In both processes, multiple particle density distribution functions DDF need to be stored. At present, for simulations in the fields of automobiles, aerospace, etc., the amount of grids is often in the hundreds of millions to billions. Large-scale parallel computing is the most effective way to save time and cost. In the process of parallel computing, in order to solve the conflict problem of reading and storage, two copies are usually used, that is, copy ① and copy ② respectively store DDF. After each collision step and migration step, the storage information of the two copies is exchanged to solve the conflict problem of reading and storage in the parallel computing process.

[0079] like Figures 1 to 6 As shown, Figure 1 A schematic diagram of an existing collision step before collision provided in an embodiment of the present application, Figure 2 A schematic diagram of performing a collision in an existing collision step provided in an embodiment of the present application is shown in FIG. Figure 3 A schematic diagram of an existing post-collision writing in a collision step provided in an embodiment of the present application, Figure 4 A schematic diagram of an existing execution migration step before migration provided in an embodiment of the present application, Figure 5 A schematic diagram of migration in an existing execution migration step provided in an embodiment of the present application, Figure 6 A schematic diagram of writing after migration in an existing execution migration step provided in an embodiment of the present application. It should be noted that: Figure 1-Figure 3 The schematic diagrams look the same. Figure 5 and Figure 6The schematic diagrams look the same, but they are only used to illustrate the results of different stages in the collision step and the migration step; in addition, the specific content of the DDF in different stages is also different. It should also be noted that the grid volume given in the example is 3*3 in size, and each grid is displayed in a cross-shaped grid, just to show the components in different directions.

[0080] Among them, in each iteration, when executing the collision step, the DDF stored in the copy ① of the current grid is only read but not written, and the DDF stored in the copy ② of the current grid is only written but not read, and they do not interfere with each other during parallel calculation. Specifically, before the collision, the 9 DDFs of the current grid in the copy ① are read first, including itself and its 8 directional components, that is, 8 DDFs, and then the collision is performed again, and finally the new 9 DDFs after the collision are obtained and written into the position of the 9 DDFs of the current grid in the copy ②.

[0081] In the process of executing the migration step, the DDF stored in the copy ② of the current grid is read only and not written, and the DDF stored in the copy ① of the current grid is written only and not read, and they do not interfere with each other during parallel calculation. Specifically, before migration, the 9 DDFs stored in the copy ② around the current grid are read first, including the DDFs of itself and the surrounding 8 directions, and then migration is performed, and finally the new 9 DDFs after migration are obtained and written into the position of the 9 DDFs of the current grid in the copy ①.

[0082] Finally, repeat the above process for the next iteration, and keep updating copies ① and ② alternately until the calculation is terminated. It should be noted that the current grid is the grid in the middle of each figure, and its own DDF is located at the center of the current grid, which is usually not indicated. The DDFs in the other 8 directions are indicated by short lines. For example, for Figure 1 For example, the DDF in the other eight directions can be indicated by eight short lines on the cross grid in the current grid.

[0083] It can be seen that for each grid's DDF, two copies, or two memories, are required to perform DDF update operations, which results in additional memory consumption and repeated reading and storage operations, increasing storage requirements; moreover, frequent read and write operations will also seriously affect program execution efficiency, thereby affecting computing efficiency.

[0084] In view of this, the present application proposes a lattice Boltzmann evolution method, device, electronic device and storage medium, by writing multiple first particle density distribution functions into the memory variable of the current lattice, that is, the multiple initial particle density distribution functions are read from the position of the memory variable, and the multiple first particle density distribution functions are written in situ to the position, and by writing the multiple second particle density distribution functions after the current lattice is migrated into the memory variable of the current lattice in situ, the particle density distribution functions on other lattices will not be affected, so that no read-write conflict will occur during the parallel computing process; in addition, only one copy, that is, one memory variable, is needed to complete the update of the particle density distribution function, which reduces the frequency of repeated memory reading and reduces the memory requirement by half; at the same time, when using LBM for high-performance parallel computing, time and economic costs can be greatly saved.

[0085] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "multiple" means two or more. In addition, the use of "based on" or "according to" means openness and inclusiveness, because the process, steps, calculations or other actions "based on" or "according to" one or more of the conditions or values ​​may be based on additional conditions or values ​​beyond the described values ​​in practice.

[0086] The lattice Boltzmann evolution method provided in the present application can be applied to computer devices (electronic devices), and the computer devices can be servers or terminals, wherein the server can be a single server or a server cluster composed of multiple servers. The embodiments of the present application do not make specific limitations on this. The terminals can be, but are not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices.

[0087] Take the computer device as a server as an example. Figure 7 A block diagram of a server is shown, such as Figure 7 As shown, the server may include a processor and a memory connected via a system bus. The processor of the server is used to provide computing and control capabilities. The memory of the server includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, a lattice Boltzmann evolution method is implemented.

[0088] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. Optionally, the server may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0089] It should be noted that the execution subject of the embodiments of the present application may be a computer device or a lattice Boltzmann evolution device. The following method embodiments are described with a computer device as the execution subject.

[0090] Figure 8 A flowchart of the steps of a lattice Boltzmann evolution method provided in an embodiment of the present application. Figure 8 As shown, the method comprises the following steps:

[0091] Step 802: Write a plurality of first particle density distribution functions into the memory variable of the current grid.

[0092] Among them, the evolution of LBM can usually be divided into two processes: collision step and migration step. That is, each grid must perform collision step and migration step in each iteration process, and multiple particle density distribution functions, namely DDFs, need to be stored in these two processes. At present, common models in the LBM method usually include two-dimensional model D2Q9 and three-dimensional model D3Q19. For the two-dimensional model D2Q9, it has 9 discrete velocity directions, that is, each grid point needs to store 9 DDFs, including itself and 8 directional components; for the three-dimensional model D3Q19, it has 19 discrete velocity directions, that is, each grid point needs to store 19 DDFs, including itself and 19 directional components.

[0093] During the iteration process, before executing the collision, it is necessary to first read the multiple initial particle density distribution functions stored in the current grid, then execute the collision, and finally obtain the multiple first particle density distribution functions after the collision, and write the multiple first particle density distribution functions into the memory variable of the current grid.

[0094] In this embodiment, by writing multiple first particle density distribution functions into the memory variable of the current grid, that is, multiple initial particle density distribution functions are read from a certain position of the memory variable, multiple first particle density distribution functions are written to that position in situ, which will not affect the particle density distribution functions on other grids, so that no read-write conflict occurs during the parallel calculation process; at the same time, only one copy, that is, one memory variable, is needed to complete the update of the particle density distribution function, which reduces the repeated reading frequency and memory requirements of the memory.

[0095] The following embodiments are all described by taking the 9 DDFs corresponding to each grid in the two-dimensional model D2Q9 as an example. Figures 9 to 11 As shown, Fig. 9 A schematic diagram before a collision in a collision step performed in the present application is provided in an embodiment of the present application, Fig.10 A schematic diagram of performing a collision in a collision step in the present application is provided in an embodiment of the present application, Fig.11 A schematic diagram of performing post-collision writing in a collision step in the present application is provided for an embodiment of the present application. It should be noted that: Figure 9-11 The schematic diagrams look the same, but they are only for illustrating the results of different stages in the collision step. In addition, the specific contents of the DDF in different stages are also different.

[0096] Step 804: Obtain multiple pre-migration particle density distribution functions corresponding to the current grid.

[0097] Among them, the multiple pre-migration particle density distribution functions include multiple first particle density distribution functions stored in the current grid and multiple first particle density distribution functions stored in other grids around the current grid. The first particle density distribution functions stored in other grids are obtained after executing the collision step for the multiple initial particle density distribution functions stored in other grids. It should be noted that the first particle density distribution functions are all obtained after executing the collision step.

[0098] When selecting multiple pre-migration particle density distribution functions, you can refer to the existing method of selecting 9 DDFs around the current grid before migration in the execution of the migration step, and use certain rules to select multiple pre-migration particle density distribution functions in this application. Optionally, for the multiple first particle density distribution functions stored in the current grid in the multiple pre-migration particle density distribution functions, in addition to itself, the other 4 first particle density distribution functions can be selected from the 8 first particle density distribution functions in the current grid. After randomly selecting 4 adjacent first particle density distribution functions, and then respectively selecting 4 surrounding first particle density distribution functions that are located on the same straight line and adjacent to these 4 first particle density distribution functions.

[0099] For example, Fig.12 As shown, Fig.12 A schematic diagram of a migration step before migration in the present application is provided for an embodiment of the present application. Among them, the 9 pre-migration particle density distribution functions include the 5 first particle density distribution functions stored in the current grid, that is, itself and the other 4 first particle density distribution functions. The first particle density distribution functions stored in multiple other grids around the current grid are the surrounding 4 first particle density distribution functions.

[0100] Step 806: perform a migration step on the multiple pre-migration particle density distribution functions to generate multiple second particle density distribution functions corresponding to the current grid, and write the multiple second particle density distribution functions into the memory variable of the current grid.

[0101] After reading a plurality of pre-migration particle density distribution functions, a migration step may be performed on the plurality of pre-migration particle density distribution functions to generate a plurality of second particle density distribution functions corresponding to the current grid. Fig.13 As shown, Fig.13 A flowchart of the steps of generating a plurality of second particle density distribution functions provided in an embodiment of the present application includes:

[0102] Step 1302: Obtain a first direction corresponding to a plurality of first particle density distribution functions stored in a current grid among a plurality of pre-migration particle density distribution functions.

[0103] Step 1304: Obtain a second direction corresponding to a first particle density distribution function stored in a plurality of other grids around the current grid in a plurality of pre-migration particle density distribution functions.

[0104] Step 1306: swap the positions of the multiple first particle density distribution functions corresponding to the first direction with the multiple first particle density distribution functions corresponding to the second direction to generate multiple second particle density distribution functions corresponding to the current grid.

[0105] The second direction is opposite to the first direction. In some optional embodiments, the first direction may be a positive direction, and the second direction may be a negative direction.

[0106] Continue with Fig.12 For example, the first direction corresponding to the multiple first particle density distribution functions stored in the current grid can be regarded as the positive direction. In addition, the four first particle density distribution functions other than itself can also be marked as 1, 2, 3, and 4 in a clockwise direction, starting from the first particle density distribution function located on the far left. The second direction corresponding to the first particle density distribution functions stored in multiple other grids around the current grid can be regarded as the negative direction. In addition, the four surrounding first particle density distribution functions can also be marked as -1, -2, -3, and -4 in a clockwise direction, starting from the first particle density distribution function located on the far left.

[0107] Next, the multiple first particle density distribution functions corresponding to the first direction and the multiple first particle density distribution functions corresponding to the second direction may be exchanged to generate multiple second particle density distribution functions corresponding to the current grid. When the position exchange is performed, it is also necessary to exchange according to certain rules.

[0108] In some optional embodiments, Fig.14 As shown, Fig.14 Another step flow chart for generating a plurality of second particle density distribution functions provided in an embodiment of the present application includes:

[0109] Step 1402: For each first particle density distribution function corresponding to the first direction, a target particle density distribution function is obtained from a plurality of first particle density distribution functions corresponding to the second direction.

[0110] Step 1404: swap the target particle density distribution function with the first particle density distribution function corresponding to the first direction to generate a plurality of second particle density distribution functions corresponding to the current grid.

[0111] Among them, the target particle density distribution function and the first particle density distribution function corresponding to the first direction are located on a straight line, so that the target particle density distribution function and the first particle density distribution function corresponding to the first direction can be exchanged to generate multiple second particle density distribution functions corresponding to the current grid.

[0112] Please continue to refer to Fig.12 , since the four first particle density distribution functions corresponding to the first direction except itself are marked as 1, 2, 3, and 4 respectively, the four first particle density distribution functions corresponding to the second direction are marked as -1, -2, -3, and -4 respectively. For each first particle density distribution function corresponding to the first direction, the target particle density distribution function corresponding to the first particle density distribution function marked as 1 is marked as -1, the target particle density distribution function corresponding to the first particle density distribution function marked as 2 is marked as -2, the target particle density distribution function corresponding to the first particle density distribution function marked as 3 is marked as -3, and the target particle density distribution function corresponding to the first particle density distribution function marked as 4 is marked as -4.

[0113] Therefore, it is only necessary to exchange the first particle density distribution function at the corresponding position with the target particle density distribution function, so as to generate multiple second particle density distribution functions corresponding to the current grid. Fig.15 As shown, Fig.15 A schematic diagram of performing migration in the migration step in the present application is provided for an embodiment of the present application. It should be noted that: Fig.15 The marks are only used to illustrate that the particle density distribution functions in the positive and negative directions are exchanged, and do not mean that the pre-defined positive and negative directions are changed.

[0114] After the position exchange process, Fig.15It can be seen that the second particle density distribution function of the current grid has only four other functions except itself. Therefore, it is necessary to determine the remaining four second particle density distribution functions of the current grid. Fig.16 As shown, Fig.16 A flowchart of another step of generating a plurality of second particle density distribution functions provided in an embodiment of the present application includes:

[0115] Step 1602: swap the target particle density distribution function with the first particle density distribution function corresponding to the first direction to obtain the migrated target particle density distribution function.

[0116] Step 1604: Obtain the inverse distribution function corresponding to the density distribution function of each migrated target particle in the current grid.

[0117] Step 1606: Based on the density distribution functions of the target particles after migration in the current grid and the inverse distribution functions corresponding to the density distribution functions of the target particles after migration in the current grid, a plurality of second particle density distribution functions corresponding to the current grid are obtained.

[0118] After the target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction, the target particle density distribution function after migration can be obtained, that is, Fig.15 The target particle density distribution function after migration is shown. It should be noted that, for the target particle density distribution function after migration here, after the migration of each of the first particle density distribution functions corresponding to the first direction, the corresponding target particle density distribution function after migration is the multiple first particle density distribution functions corresponding to the second direction before migration; after the migration of each of the first particle density distribution functions corresponding to the second direction, the corresponding target particle density distribution function after migration is the multiple first particle density distribution functions corresponding to the first direction before migration.

[0119] Next, the inverse distribution function corresponding to each post-migration target particle density distribution function in the current grid can be obtained. Here, the inverse distribution function can be obtained by directly negating each post-migration target particle density distribution function. For example, if each post-migration target particle density distribution function is recorded as f, the corresponding inverse distribution function can be recorded as -f. Finally, based on each post-migration target particle density distribution function in the current grid and the inverse distribution function corresponding to each post-migration target particle density distribution function in the current grid, multiple second particle density distribution functions corresponding to the current grid can be obtained.

[0120] In other words, the plurality of second particle density distribution functions corresponding to the current grid include each post-migration target particle density distribution function in the current grid and the inverse distribution function corresponding to each post-migration target particle density distribution function in the current grid.

[0121] After executing the migration step to obtain multiple second particle density distribution functions corresponding to the current grid, it is necessary to write the multiple second particle density distribution functions into the memory variable of the current grid. Fig.17 As shown, Fig.17 A flowchart of steps for writing a plurality of second particle density distribution functions provided in an embodiment of the present application includes:

[0122] Step 1702: Determine the first write position corresponding to each post-migration target particle density distribution function in the current grid.

[0123] Step 1704: determine a second writing position corresponding to the inverse distribution function corresponding to each post-migration target particle density distribution function in the current grid.

[0124] Step 1706: Based on the first write position and the second write position, write a plurality of second particle density distribution functions into the memory variable of the current grid.

[0125] Among them, when writing multiple second particle density distribution functions, it is necessary to determine the first writing position corresponding to each post-migration target particle density distribution function in the current grid, and at the same time, it is necessary to determine the second writing position corresponding to the inverse distribution function corresponding to each post-migration target particle density distribution function in the current grid.

[0126] like Fig.18 As shown, Fig.18 A schematic diagram of writing after migration in the migration step in the present application is provided for an embodiment of the present application. Similarly, Fig.18 The marks in the figure do not mean that the positive and negative directions of the definitions have been changed. They are only used to illustrate the density distribution function of the target particles after migration in the current grid corresponding to the marks -1 to -4. Fig.15 The corresponding positions in are the same. Among them, for the 4 second particle density distribution functions located in the positive direction defined before migration, they are the target particle density distribution functions after migration in the current grid, and their corresponding positions are the first write positions. The reverse distribution functions of these 4 target particle density distribution functions after migration are the remaining 4 second particle density distribution functions in the current grid, and their corresponding positions are the second write positions. It should be noted that the target particle density distribution functions after migration in the current grid and their corresponding reverse distribution functions are located on a straight line.

[0127] Finally, based on the determined first write position and second write position, multiple second particle density distribution functions can be written into the memory variable of the current grid, that is, Fig.18 Results shown.

[0128] In this embodiment, by writing the multiple second particle density distribution functions after the migration of the current grid into the memory variable of the current grid in situ, the particle density distribution functions on other grids will not be affected, and no read-write conflict will occur during the parallel computing process. At the same time, only one copy, that is, one memory variable, is needed to complete the update of the particle density distribution function, reducing the repeated reading frequency and memory requirements of the memory.

[0129] In some optional embodiments, since the iteration process may be repeated multiple times, in a new iteration process of the current grid, for example Fig.19 As shown, Fig.19 A flowchart of steps for performing a new round of iteration of the current grid provided in an embodiment of the present application includes:

[0130] Step 1902: In a new iteration process of the current grid, the inverse distribution functions of the multiple second particle density distribution functions stored in the current grid are obtained.

[0131] Step 1904: Use the inverse distribution functions of the multiple second particle density distribution functions as the new multiple initial particle density distribution functions.

[0132] Step 1906: perform a collision step on the new multiple initial particle density distribution functions to generate new multiple first particle density distribution functions, and repeat the steps of the above-mentioned lattice Boltzmann evolution method until a preset iteration termination condition is reached.

[0133] Among them, for the multiple second particle density distribution functions corresponding to the current grid obtained after executing the migration step using the above embodiment, compared with the migration result obtained by the existing method, the DDF in the first direction and the second direction are just swapped. Therefore, in the new iteration process of the current grid, it is necessary to obtain the reverse distribution function of the multiple second particle density distribution functions stored in the current grid.

[0134] Next, the inverse distribution functions of the multiple second particle density distribution functions are used as new multiple initial particle density distribution functions, and a collision step is performed on the new multiple initial particle density distribution functions to generate new multiple first particle density distribution functions, and the steps of the above-mentioned lattice Boltzmann evolution method are repeated until the preset iteration termination condition is reached.

[0135] The specific process of repeatedly executing the lattice Boltzmann evolution method can refer to the above embodiment, which will not be described in detail here. The preset iteration termination condition can be preset, for example, it can be reaching the maximum number of iterations.

[0136] In addition, the present application also compares the memory requirements of the lattice Boltzmann evolution method provided by the present application with those of the existing lattice Boltzmann evolution method. Specifically, it is assumed that the storage type of each DDF is float, where q is the value of n in the DmQn model, that is, the number of components of the particle density distribution function. For the common two-dimensional D2Q9 model, q=9; for the three-dimensional D3D19 model, q=19. It has been verified that the memory requirement of the existing lattice Boltzmann evolution method is 8q, and the memory requirement of the lattice Boltzmann evolution method provided by the present application is 4q.

[0137] The lattice Boltzmann evolution method provided in the embodiment of the present application includes: writing multiple first particle density distribution functions into the memory variable of the current lattice, wherein the multiple first particle density distribution functions are obtained after executing a collision step on the multiple initial particle density distribution functions stored in the current lattice, obtaining multiple pre-migration particle density distribution functions corresponding to the current lattice, wherein the multiple pre-migration particle density distribution functions include the multiple first particle density distribution functions stored in the current lattice, and the first particle density distribution functions stored in multiple other lattices around the current lattice, the first particle density distribution functions stored in other lattices are obtained after executing a collision step on the multiple initial particle density distribution functions stored in other lattices, performing a migration step on the multiple pre-migration particle density distribution functions, generating multiple second particle density distribution functions corresponding to the current lattice, and writing the multiple second particle density distribution functions into the memory variable of the current lattice. This solution writes multiple first particle density distribution functions into the memory variable of the current grid, that is, the multiple initial particle density distribution functions are read from the position of the memory variable, and the multiple first particle density distribution functions are written in situ to the position, and the multiple second particle density distribution functions after the current grid is migrated are still written in situ to the memory variable of the current grid, which will not affect the particle density distribution functions on other grids, so that no read-write conflict occurs during the parallel computing process; in addition, only one copy, that is, one memory variable, is needed to complete the update of the particle density distribution function, which reduces the frequency of repeated memory reading and reduces the memory requirement by half; at the same time, when using LBM for high-performance parallel computing, it can greatly save time and economic costs.

[0138] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0139] Fig. 20 A structural block diagram of a lattice Boltzmann evolution device provided in an embodiment of the present application.

[0140] like Fig. 20 As shown, the lattice Boltzmann evolution device 2000 includes:

[0141] The writing module 2002 is used to write multiple first particle density distribution functions into the memory variable of the current grid; wherein the multiple first particle density distribution functions are obtained after executing the collision step on the multiple initial particle density distribution functions stored in the current grid.

[0142] Acquisition module 2004 is used to acquire multiple pre-migration particle density distribution functions corresponding to the current grid; wherein the multiple pre-migration particle density distribution functions include multiple first particle density distribution functions stored in the current grid, and multiple first particle density distribution functions stored in other grids around the current grid, and the first particle density distribution functions stored in other grids are obtained after executing a collision step on the multiple initial particle density distribution functions stored in other grids.

[0143] The generation module 2006 is used to perform a migration step on the multiple pre-migration particle density distribution functions, generate multiple second particle density distribution functions corresponding to the current grid, and write the multiple second particle density distribution functions into the memory variable of the current grid.

[0144] Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be described in detail here. Each module in the above lattice Boltzmann evolution device can be implemented in whole or in part by software, hardware, and a combination thereof. Each of the above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations of each of the above modules.

[0145] In one embodiment of the present application, a computer device is provided, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:

[0146] Writing a plurality of first particle density distribution functions into the memory variable of the current grid; wherein the plurality of first particle density distribution functions are obtained after executing a collision step on a plurality of initial particle density distribution functions stored in the current grid;

[0147] Obtain multiple pre-migration particle density distribution functions corresponding to the current grid; wherein the multiple pre-migration particle density distribution functions include multiple first particle density distribution functions stored in the current grid and multiple first particle density distribution functions stored in other grids around the current grid, and the first particle density distribution functions stored in other grids are obtained after executing a collision step on multiple initial particle density distribution functions stored in other grids;

[0148] A migration step is performed on multiple pre-migration particle density distribution functions to generate multiple second particle density distribution functions corresponding to the current grid, and the multiple second particle density distribution functions are written into the memory variable of the current grid.

[0149] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:

[0150] Obtaining first directions corresponding to a plurality of first particle density distribution functions stored in a current grid among a plurality of pre-migration particle density distribution functions;

[0151] Obtaining a second direction corresponding to the first particle density distribution function stored in a plurality of other grids around the current grid in a plurality of pre-migration particle density distribution functions; wherein the second direction is opposite to the first direction;

[0152] The multiple first particle density distribution functions corresponding to the first direction are exchanged with the multiple first particle density distribution functions corresponding to the second direction to generate multiple second particle density distribution functions corresponding to the current grid.

[0153] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:

[0154] For each first particle density distribution function corresponding to the first direction, a target particle density distribution function is obtained from a plurality of first particle density distribution functions corresponding to the second direction; wherein the target particle density distribution function and the first particle density distribution function corresponding to the first direction are located on a straight line;

[0155] The target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction to generate a plurality of second particle density distribution functions corresponding to the current grid.

[0156] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:

[0157] The target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction to obtain the target particle density distribution function after migration;

[0158] Obtain the inverse distribution function corresponding to the density distribution function of each migrated target particle in the current grid;

[0159] Based on the density distribution functions of the target particles after migration in the current grid and the inverse distribution functions corresponding to the density distribution functions of the target particles after migration in the current grid, a plurality of second particle density distribution functions corresponding to the current grid are obtained.

[0160] In one embodiment of the present application, the multiple second particle density distribution functions corresponding to the current grid include the density distribution functions of the target particles after migration in the current grid, and the inverse distribution functions corresponding to the density distribution functions of the target particles after migration in the current grid. When the processor executes the computer program, the following steps are also implemented:

[0161] Determine the first write position corresponding to each post-migration target particle density distribution function in the current grid;

[0162] Determine a second write position corresponding to the inverse distribution function corresponding to each post-migration target particle density distribution function in the current grid;

[0163] Based on the first write position and the second write position, a plurality of second particle density distribution functions are written into the memory variable of the current grid.

[0164] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:

[0165] In a new iteration process of the current grid, the inverse distribution functions of the plurality of second particle density distribution functions stored in the current grid are obtained;

[0166] Using the inverse distribution functions of the plurality of second particle density distribution functions as the new plurality of initial particle density distribution functions;

[0167] A collision step is performed on the new multiple initial particle density distribution functions to generate new multiple first particle density distribution functions, and the steps of the above-mentioned lattice Boltzmann evolution method are repeatedly performed until a preset iteration termination condition is reached.

[0168] In one embodiment of the present application, the first direction is a positive direction, and the second direction is a negative direction.

[0169] The implementation principle and technical effect of the computer device provided in the above embodiment are similar to those of the above method embodiment, and will not be repeated here.

[0170] In one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0171] Writing a plurality of first particle density distribution functions into the memory variable of the current grid; wherein the plurality of first particle density distribution functions are obtained after executing a collision step on a plurality of initial particle density distribution functions stored in the current grid;

[0172] Obtain multiple pre-migration particle density distribution functions corresponding to the current grid; wherein the multiple pre-migration particle density distribution functions include multiple first particle density distribution functions stored in the current grid and multiple first particle density distribution functions stored in other grids around the current grid, and the first particle density distribution functions stored in other grids are obtained after executing a collision step on multiple initial particle density distribution functions stored in other grids;

[0173] A migration step is performed on multiple pre-migration particle density distribution functions to generate multiple second particle density distribution functions corresponding to the current grid, and the multiple second particle density distribution functions are written into the memory variable of the current grid.

[0174] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:

[0175] Obtaining first directions corresponding to a plurality of first particle density distribution functions stored in a current grid among a plurality of pre-migration particle density distribution functions;

[0176] Obtaining a second direction corresponding to the first particle density distribution function stored in a plurality of other grids around the current grid in a plurality of pre-migration particle density distribution functions; wherein the second direction is opposite to the first direction;

[0177] The multiple first particle density distribution functions corresponding to the first direction are exchanged with the multiple first particle density distribution functions corresponding to the second direction to generate multiple second particle density distribution functions corresponding to the current grid.

[0178] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:

[0179] For each first particle density distribution function corresponding to the first direction, a target particle density distribution function is obtained from a plurality of first particle density distribution functions corresponding to the second direction; wherein the target particle density distribution function and the first particle density distribution function corresponding to the first direction are located on a straight line;

[0180] The target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction to generate a plurality of second particle density distribution functions corresponding to the current grid.

[0181] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:

[0182] The target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction to obtain the target particle density distribution function after migration;

[0183] Obtain the inverse distribution function corresponding to the density distribution function of each migrated target particle in the current grid;

[0184] Based on the density distribution functions of the target particles after migration in the current grid and the inverse distribution functions corresponding to the density distribution functions of the target particles after migration in the current grid, a plurality of second particle density distribution functions corresponding to the current grid are obtained.

[0185] In one embodiment of the present application, the multiple second particle density distribution functions corresponding to the current grid include the density distribution functions of the target particles after migration in the current grid, and the inverse distribution functions corresponding to the density distribution functions of the target particles after migration in the current grid. When the computer program is executed by the processor, the following steps are also implemented:

[0186] Determine the first write position corresponding to each post-migration target particle density distribution function in the current grid;

[0187] Determine a second write position corresponding to the inverse distribution function corresponding to each post-migration target particle density distribution function in the current grid;

[0188] Based on the first write position and the second write position, a plurality of second particle density distribution functions are written into the memory variable of the current grid.

[0189] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:

[0190] In a new iteration process of the current grid, the inverse distribution functions of the plurality of second particle density distribution functions stored in the current grid are obtained;

[0191] Using the inverse distribution functions of the plurality of second particle density distribution functions as the new plurality of initial particle density distribution functions;

[0192] A collision step is performed on the new multiple initial particle density distribution functions to generate new multiple first particle density distribution functions, and the steps of the above-mentioned lattice Boltzmann evolution method are repeatedly performed until a preset iteration termination condition is reached.

[0193] In one embodiment of the present application, the first direction is a positive direction, and the second direction is a negative direction.

[0194] The implementation principle and technical effect of the computer storage medium provided in the above embodiment are similar to those of the above method embodiment, and will not be repeated here.

[0195] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer execution instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, data center, etc. that contains one or more servers that can be integrated with a medium. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a DVD), or a semiconductor medium (eg, a solid state disk (SSD)).

[0196] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered as the area recorded in this specification.

[0197] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the patent area of ​​the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection area of ​​the present application. Therefore, the protection area of ​​the present application shall be subject to the attached claims.

Claims

1. A lattice Boltzmann evolution method, characterized in that: The method comprises: Writing a plurality of first particle density distribution functions into the memory variable of the current grid; wherein the plurality of first particle density distribution functions are obtained after executing a collision step on a plurality of initial particle density distribution functions stored in the current grid; Acquire multiple pre-migration particle density distribution functions corresponding to the current grid; wherein the multiple pre-migration particle density distribution functions include multiple first particle density distribution functions stored in the current grid and first particle density distribution functions stored in multiple other grids around the current grid, and the first particle density distribution functions stored in the other grids are obtained after executing a collision step on the multiple initial particle density distribution functions stored in the other grids; A migration step is performed on the multiple pre-migration particle density distribution functions to generate multiple second particle density distribution functions corresponding to the current grid, and the multiple second particle density distribution functions are written into the memory variable of the current grid.

2. The method according to claim 1, characterized in that The step of performing a migration step on the plurality of pre-migration particle density distribution functions to generate a plurality of second particle density distribution functions corresponding to the current grid includes: Obtaining a first direction corresponding to a plurality of first particle density distribution functions stored in the current grid among the plurality of pre-migration particle density distribution functions; Obtaining a second direction corresponding to the first particle density distribution function stored in a plurality of other grids around the current grid among the plurality of pre-migration particle density distribution functions; wherein the second direction is opposite to the first direction; The plurality of first particle density distribution functions corresponding to the first direction are exchanged with the plurality of first particle density distribution functions corresponding to the second direction to generate a plurality of second particle density distribution functions corresponding to the current grid.

3. The method according to claim 2, characterized in that The step of exchanging the positions of the plurality of first particle density distribution functions corresponding to the first direction with the plurality of first particle density distribution functions corresponding to the second direction to generate the plurality of second particle density distribution functions corresponding to the current grid includes: For each of the first particle density distribution functions corresponding to the first direction, a target particle density distribution function is obtained from the plurality of first particle density distribution functions corresponding to the second direction; wherein the target particle density distribution function and the first particle density distribution function corresponding to the first direction are located on a straight line; The target particle density distribution function is exchanged with the first particle density distribution function corresponding to the first direction to generate a plurality of second particle density distribution functions corresponding to the current grid.

4. The method according to claim 3, characterized in that The step of performing position exchange processing on the target particle density distribution function and the first particle density distribution function corresponding to the first direction to generate a plurality of second particle density distribution functions corresponding to the current grid includes: Exchanging the position of the target particle density distribution function with the first particle density distribution function corresponding to the first direction to obtain a target particle density distribution function after migration; Obtaining the inverse distribution function corresponding to each of the migration target particle density distribution functions in the current grid; Based on the density distribution functions of the target particles after migration in the current grid and the inverse distribution functions corresponding to the density distribution functions of the target particles after migration in the current grid, a plurality of second particle density distribution functions corresponding to the current grid are obtained.

5. The method according to any one of claims 1 to 4, characterized in that: The multiple second particle density distribution functions corresponding to the current grid include each post-migration target particle density distribution function in the current grid, and a reverse distribution function corresponding to each post-migration target particle density distribution function in the current grid, and writing the multiple second particle density distribution functions into the memory variable of the current grid includes: Determine a first write position corresponding to each of the post-migration target particle density distribution functions in the current grid; Determine a second writing position corresponding to the inverse distribution function corresponding to each of the post-migration target particle density distribution functions in the current grid; Based on the first writing position and the second writing position, the plurality of second particle density distribution functions are written into the memory variable of the current grid.

6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: In a new iteration process of the current grid, obtaining the inverse distribution functions of the plurality of second particle density distribution functions stored in the current grid; Using the inverse distribution functions of the plurality of second particle density distribution functions as new plurality of initial particle density distribution functions; A collision step is performed on the new multiple initial particle density distribution functions to generate new multiple first particle density distribution functions, and the steps of the above-mentioned lattice Boltzmann evolution method are repeatedly performed until a preset iteration termination condition is reached.

7. The method according to any one of claims 2 to 4, characterized in that: The first direction is a positive direction, and the second direction is a negative direction.

8. A lattice Boltzmann evolution device, characterized in that: The device comprises: A writing module, used for writing a plurality of first particle density distribution functions into the memory variable of the current grid; wherein the plurality of first particle density distribution functions are obtained after executing a collision step on a plurality of initial particle density distribution functions stored in the current grid; An acquisition module, used for acquiring a plurality of pre-migration particle density distribution functions corresponding to the current grid; wherein the plurality of pre-migration particle density distribution functions include a plurality of first particle density distribution functions stored in the current grid, and a plurality of first particle density distribution functions stored in other grids around the current grid, wherein the first particle density distribution functions stored in other grids are obtained after executing a collision step on the plurality of initial particle density distribution functions stored in the other grids; A generation module is used to perform a migration step on the multiple pre-migration particle density distribution functions, generate multiple second particle density distribution functions corresponding to the current grid, and write the multiple second particle density distribution functions into the memory variable of the current grid.

9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the steps of the method described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the steps of the method described in any one of claims 1 to 7.