A method, device and storage medium for fluid dynamics simulation
Through unstructured flow field grids and parallel processing technology, the efficiency and accuracy problems of the lattice Boltzmann method in complex geometric boundary fluid calculations are solved, and efficient complex flow field simulations are achieved.
Patent Information
- Application Number
- CN202010352414.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-28
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2040-04-28
AI Technical Summary
In the existing technology, the lattice Boltzmann method is difficult to handle fluid calculations with complex geometric boundaries, and the uniform Cartesian grid causes the problem that the grid size must be kept consistent, resulting in limited computational efficiency and accuracy in complex flow field simulations.
Using unstructured flow field grids and preset division algorithms, the flow field is divided to generate multiple sub-regions, and parallel processing is used to calculate the particle distribution function of each sub-region. The finite volume method and Runge-Kutta scheme are used to improve Computational efficiency and accuracy.
It achieves high-precision grid allocation in complex flow fields, reduces the grid size, improves the efficiency and accuracy of fluid mechanics simulation, adapts to changes in complex flow field information, and avoids restrictions on grid size consistency.
Smart Images

Figure CN111680456B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of fluid mechanics, and in particular to a method, device and storage medium for fluid mechanics simulation. Background Art
[0002] Fluid mechanics is one of the scientific disciplines that has gradually formed from practical activities in human society. With the emergence and development of computer technology, numerical calculation methods have become one of the three important scientific research methods alongside theoretical analysis and experimental research. The numerical simulation of complex flow fields in computational fluid dynamics is closely related to national development, social progress and human life. Through numerical calculation methods combined with high-performance computing technology, many complex flow field problems can be numerically simulated and solved, which can save physical experimental expenses to a certain extent and speed up research progress.
[0003] In the prior art, in order to solve the problems of stability, convergence speed, parallel efficiency, etc. existing in the macroscopic continuous model in the prior art, as well as the problems of complex simulation program, large amount of calculation, high memory requirement, etc. existing in the microscopic molecular model, the lattice Boltzmann method can be used to perform numerical simulation and solve the more complex flow field problems. Specifically, the lattice Boltzmann method mostly uses a uniform Cartesian grid, but for geometric models with complex boundaries, the number of grids required is often huge. Due to the defects of the uniform Cartesian grid, the lattice Boltzmann method is difficult to handle fluid calculations with complex geometric boundaries, so a technical solution that can solve the above technical problems is needed. Summary of the invention
[0004] The main technical problem solved by the present application is to provide a method for simulating and calculating large-scale complex flow fields, and specifically to provide a method, device and storage medium for fluid mechanics simulation.
[0005] In order to solve the above technical problems, a technical solution adopted by the present application is: to provide a method for fluid mechanics simulation, the method comprising:
[0006] Acquire a flow field model, and generate an unstructured flow field grid corresponding to the flow field model;
[0007] Acquiring initial macro information, boundary condition information and the number of execution processes set based on the flow field model;
[0008] Using a preset partitioning algorithm to partition the flow field grid to obtain a plurality of sub-areas corresponding to the number of the execution processes, and assigning a corresponding sub-area to each of the processes;
[0009] Utilizing each of the processes to calculate the particle distribution function corresponding to the grid unit in each of the sub-regions according to the initial macro information and the boundary condition information, and determining the macro information corresponding to the grid unit in each of the sub-regions according to the particle distribution function of the grid unit in each of the sub-regions;
[0010] Calculating a convergence value of the flow field according to macro information of the grid unit in the sub-region, and judging whether the flow field model meets a convergence condition according to the convergence value of the flow field;
[0011] If so, the macro information corresponding to the grid cells in each of the sub-regions is aggregated and output as the simulation result of the flow field model.
[0012] In order to solve the above technical problems, another technical solution adopted by the present application is: to provide a fluid dynamics simulation device, the device comprising a coupled memory and a processor, wherein:
[0013] The memory includes local storage and stores a computer program;
[0014] The processor is configured to run the computer program to execute the method described above.
[0015] In order to solve the above technical problem, another technical solution adopted by the present application is: providing a storage medium, wherein the storage medium stores a computer program that can be executed by a processor, and the computer program is used to implement the above method.
[0016] The beneficial effect of the present application is that, different from the prior art, the technical solution provided by the present application can better adapt to the complex flow field information in the actual application environment by generating an unstructured flow field grid for the acquired flow field model, avoiding the disadvantage that the grid size must remain consistent under the uniform Cartesian grid used in the prior art, and can achieve the use of high-precision grids at flow field positions where the flow field information changes greatly, and the use of large-size and relatively sparse grids at flow field positions where the flow field information changes slowly, thereby achieving the entire complex flow field information by using a smaller-scale grid, and at the same time improving the efficiency of fluid mechanics simulation of complex flow fields while ensuring the simulation accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of a method for fluid dynamics simulation in an embodiment of the present application;
[0018] Figure 2 A schematic diagram of a flow chart of another embodiment of a method for fluid dynamics simulation of the present application;
[0019] Figure 3A schematic diagram of a flow chart of another embodiment of a method for fluid dynamics simulation of the present application;
[0020] Figure 4 A schematic diagram of a flow chart of another embodiment of a method for fluid dynamics simulation of the present application;
[0021] Figure 5 This is a flow chart of a method for fluid dynamics simulation in another embodiment of the present application;
[0022] Figure 6 This is a flow chart of a method for fluid dynamics simulation in another embodiment of the present application;
[0023] Figure 7 A schematic diagram of an application scenario in an embodiment of a method for fluid mechanics simulation of the present application;
[0024] Figure 8 A schematic diagram of an application scenario in another embodiment of a method for fluid dynamics simulation of the present application;
[0025] Fig. 9 A schematic diagram of an application scenario in another embodiment of a method for fluid dynamics simulation of the present application;
[0026] Fig.10 This is a structural schematic diagram of an embodiment of a fluid dynamics simulation device of the present application;
[0027] Fig.11 This is a schematic structural diagram of a storage medium embodiment of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It is to be understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0029] In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically limited. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0030] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0031] In the existing field of fluid mechanics, there are three main methods for describing fluids, namely, macroscopic continuous models, microscopic molecular models, and mesoscopic dynamic models, depending on the different observation scales. The numerical simulation of traditional computational fluid dynamics is based on the macroscopic continuous model, which regards the fluid as continuous and describes it through a set of highly nonlinear partial differential equations. However, there are problems such as stability, convergence speed, and parallel efficiency based on the macroscopic continuous model. In the microscopic molecular model, the fluid is regarded as a system composed of many molecules. The dynamic characteristics of a single molecule are studied, and then the macroscopic fluid information is obtained by applying statistical methods. However, the simulation program of the microscopic molecular model is relatively complex, with large computational workload and high memory requirements, and it cannot be adapted to large-scale and complex flow field simulation application scenarios. The lattice Boltzmann method (mesoscopic dynamic model) is different from the direct discretization of macroscopic equations such as Navier-Stokes and molecular dynamics. It is based on the molecular kinetic theory and evolved from the Boltzmann equation. It is a mesoscopic model between the microscopic molecular dynamics model and the macroscopic continuous model of the fluid. It reflects the physical nature of fluid flow from a mesoscopic perspective, and regards the fluid as a series of particles that are larger than molecules but infinitely small at the macroscopic level. These particles are calculated on the grid according to certain physical laws, and macroscopic physical quantities are obtained by statistically averaging the distribution function reflecting the state of the particles. Since the particles on the grid point only exchange information with the particles closest to the grid point during the migration process, and are only related to the grid point itself during the collision process, the lattice Boltzmann method is very suitable for parallel computing. In recent years, the lattice Boltzmann method has developed into a popular and promising numerical method, and has been successfully applied and studied in multiphase flow, porous media, magnetic fluid, combustion, crystallization, etc. However, the existing lattice Boltzmann method mostly uses uniform Cartesian grids, but for geometric models with complex boundaries, the number of grids required is often huge. Due to the defects of uniform Cartesian grids, the lattice Boltzmann method is difficult to handle fluid calculations with complex geometric boundaries, and the method of fluid mechanics simulation provided by the present application is a fully parallel and efficient algorithm of the lattice Boltzmann method that uses the finite volume method to discretize in space and the Runge-Kutta scheme to discretize in time, which can better solve the problems existing in the prior art. Please refer to the corresponding parts of the following embodiments for details.
[0032] See also Figure 1 , Figure 1 : is a flow chart of a method for fluid mechanics simulation in an embodiment of the present application. In the current embodiment, the method provided by the present application includes:
[0033] S110: Acquire a flow field model, and generate an unstructured flow field grid corresponding to the flow field model.
[0034] First, import the flow field model that needs to be simulated for fluid mechanics. The flow field model is set and imported by the user according to actual needs. After obtaining the flow field model, the set algorithm will be used to process the flow field model to obtain the unstructured flow field grid corresponding to the flow field model. Among them, the size of the grids generated at different positions of the corresponding flow field model is random and irregular. Specifically, the generation rule of the flow field grid follows that the grid size generated in places where the flow field information changes greatly is smaller and the grid density is larger, and the grid size generated in places where the flow field information changes less is larger, and the corresponding generated grid density is smaller.
[0035] S120: Acquire initial macro information, boundary condition information and the number of execution processes set based on the flow field model.
[0036] After the flow field model is obtained, the initial macro information, boundary condition information and number of execution processes set based on the flow field model will be further obtained. Specifically, after the flow field model is imported, the user is prompted to set the initial macro information of the flow field, the boundary condition information of each boundary in the flow field and the number of parallel execution processes according to the needs of the flow field model simulation problem.
[0037] Among them, the initial macro information includes at least: the initial density of the flow field model, the initial fluid velocity in the flow field model and the initial pressure of the flow field model. The boundary condition information of each boundary in the flow field includes: the macro information of the boundary and other required related information, such as the boundary condition information of the flow field can also include the coordinates of the boundary, etc. In the technical solution provided in this application, the initial macro information set based on the flow field model will be used as the initial macro information of each grid unit in the flow field model.
[0038] The number of processes executed in parallel refers to the number of logic programs used to process flow field simulation in parallel. In the current embodiment, the main logic program used to process flow field simulation is defined as a process according to its function. The multiple processes include at least one main process and multiple common processes. The main process reads the grid file, aggregates the macro information corresponding to the grid cells in each sub-region, and outputs it as the simulation result of the flow field model. The common process is mainly used to simulate the flow field of the sub-region corresponding to the common process and obtain the macro information of the grid cells in each sub-region.
[0039] S130: Divide the flow field grid using a preset partitioning algorithm to obtain a plurality of sub-areas corresponding to the number of execution processes, and allocate a corresponding sub-area to each process.
[0040] The flow field grid is divided by a preset partitioning algorithm to obtain a plurality of sub-regions corresponding to the number of execution processes. After the flow field grid is divided, the sub-regions obtained by the division will be further assigned to each process. Each process will perform a fluid mechanics simulation on its corresponding sub-region according to the setting to obtain the relevant information of the fluid mechanics of each sub-region. It can also be understood that each process calculates the particle distribution function of the corresponding sub-region based on the initial macro information and boundary condition information, and then finally determines the macro information of each grid unit based on the particle distribution function of each grid unit in the sub-region. Among them, since the flow field model is a three-dimensional concept, in the current embodiment, the sub-regions obtained by the division include at least the region of the three-dimensional concept. Among them, it should be noted that the shape and size of the sub-region are not limited here, and the size and shape of the sub-region are specifically determined according to the division criteria included in the preset partitioning algorithm.
[0041] Furthermore, in one embodiment, the flow field grid is divided using a multi-level k-way graph division algorithm to obtain sub-areas corresponding to the number of processes. It is understandable that in other embodiments, other algorithms may also be used to divide the flow field grid, which are not specifically exemplified here.
[0042] S140: Utilize each process to calculate the particle distribution function corresponding to each grid unit in each sub-region according to the initial macro information and boundary condition information, and determine the macro information corresponding to the grid unit in each sub-region according to the particle distribution function of each grid unit in each sub-region.
[0043] After completing the division of the flow field grid and assigning the corresponding sub-region to each process, each process is used to calculate the particle distribution function of each grid unit in each sub-region according to the initial macro information and boundary condition information. Specifically, as described above, the technical solution provided by the present application includes a main process and multiple ordinary processes. In the current step, each process including the main process and multiple ordinary processes is used to calculate the particle distribution function of each grid unit in the sub-region corresponding to each process according to the initial macro information and boundary condition information.
[0044] After calculating and obtaining the particle distribution function of the grid cells in each sub-region, the macro information of the grid cells in each sub-region is further determined according to the particle distribution function corresponding to each grid cell in each sub-region, that is, the density, fluid velocity and pressure of the corresponding grid cell in the sub-region are determined according to the obtained particle distribution function of each grid cell in the sub-region.
[0045] In other embodiments, after the particle distribution function of the grid cells in each sub-region is calculated and obtained, the macro information of the corresponding grid cells in each sub-region is further updated according to the particle distribution function.
[0046] S150: Calculating the convergence value of the flow field according to the macro information of the grid cells in the sub-region, and judging whether the flow field model meets the convergence condition according to the convergence value of the flow field.
[0047] After obtaining the macro information of each sub-region, each process is then further used to calculate the sum of the speed changes and the sum of the speed magnitudes of the corresponding sub-regions according to the macro information of the grid units in the sub-region. Then, based on the sum of the speed changes and the sum of the speed magnitudes, the relative speed change of the sub-region is calculated, and based on the obtained relative speed changes of each sub-region, it is judged whether the flow field model meets the convergence condition. Among them, in one embodiment, the relative speed change can also be understood as a convergence value. Specifically, when the relative speed change of the sub-region is less than or equal to a preset threshold, it is judged that the sub-region meets the convergence condition. When most of the sub-regions in the flow field model meet the convergence condition, it can be judged that the flow field model meets the convergence condition. Among them, the preset threshold is an empirical value used to judge whether convergence occurs. For details, please refer to the explanation in the corresponding embodiment below.
[0048] When it is determined that the flow field model meets the convergence conditions, step S160 will be executed. Otherwise, if it is determined that the convergence value of the sub-area is greater than the preset threshold, it is determined that the sub-area does not meet the convergence conditions. Correspondingly, when the sub-area below the preset proportion in the flow field model meets the convergence conditions, it is determined that the flow field model does not meet the convergence conditions. At this time, each process will be used to re-execute the above step S140 and at least part of the subsequent steps.
[0049] S160: Aggregate the macro information of the grid cells in each sub-region and output it as a simulation result of the flow field model.
[0050] If it is determined according to the convergence values of each sub-region that the flow field model meets the convergence condition, the macro information corresponding to the grid cells in each sub-region updated in step S140 will be aggregated and output as the simulation result of the flow field model.
[0051] This application Figure 1In the corresponding embodiment, by generating an unstructured flow field grid corresponding to the acquired flow field model, and obtaining the initial macro information, boundary condition information and number of execution processes set based on the flow field model, the flow field grid is divided by a preset partitioning algorithm to obtain sub-regions corresponding to the number of execution processes, and a corresponding sub-region is allocated to each process, and then each process is used to calculate the particle distribution function of each grid unit in each sub-region according to the initial macro information and boundary condition information, and then the macro information of the grid unit in the corresponding sub-region is determined according to the obtained particle distribution function. Then, the convergence value of the sub-region is calculated using the updated macro information of the grid unit in each sub-region, and then the convergence value of each sub-region is judged according to the convergence value of each sub-region. When it is judged that the flow field model meets the convergence condition, the macro information of each grid unit in each sub-region can be aggregated and output as the simulation result of the flow field model.
[0052] That is, compared with the prior art, in this application Figure 1 The technical solution provided in the corresponding embodiment generates an unstructured flow field grid for the acquired flow field model, which can better adapt to the complex flow field information in the actual application environment, avoid the disadvantage that the grid size must be kept consistent under the uniform Cartesian grid used in the prior art, and can achieve the use of high-precision grids in flow field positions where the flow field information changes greatly, and the use of large-size and relatively sparse grids in flow field positions where the flow field information changes slowly, thereby achieving the entire complex flow field information using a smaller-scale grid, while also improving the efficiency of fluid mechanics simulation of complex flow fields while ensuring the accuracy of the simulation.
[0053] See also Figure 2 , Figure 2 This is a flow chart of another embodiment of a method for fluid dynamics simulation of the present application. In the current embodiment, the method provided by the present application includes:
[0054] S201: Acquire a flow field model, and generate an unstructured flow field grid corresponding to the flow field model.
[0055] First of all, it should be noted that step S201 and Figure 1 The step S110 in the corresponding embodiment is the same, and the specific content can refer to the description of the corresponding part of step S110, which will not be described in detail here.
[0056] Furthermore, in the current embodiment, after step S201 acquires the flow field model and generates an unstructured flow field grid corresponding to the flow field model, the method provided by the present application further includes step S202.
[0057] S202: Save the generated unstructured flow field grid of the flow field model as a grid file.
[0058] After the flow field model is acquired and the unstructured flow field grid corresponding to the flow field model is generated, the unstructured flow field grid of the generated flow field model is further saved as a grid file, so that after the flow field grid or the flow field model is divided, each process reads the grid file corresponding to the allocated sub-area. The grid file at least includes the unstructured flow field grid generated in step S201 and the information corresponding to each flow field grid. The flow field grid refers to all grid units corresponding to the entire flow field model. Each sub-area includes multiple grid units. Specifically, the number of grid units included in each sub-area is determined by the division rule of the division algorithm. The number of grid units included in different sub-areas can be different or the same, and no limitation is made here. It should be noted that in the current embodiment, as long as the flow field model that needs to be simulated by fluid mechanics does not change, the corresponding steps S201 to S205 will only be executed once. When the flow field model changes, the corresponding S201 to S205 will be re-executed.
[0059] S203: Acquire initial macro information, boundary condition information and the number of execution processes set based on the flow field model.
[0060] The initial macro information is set by the user according to actual needs, and includes: the initial density of the flow field model, the initial fluid velocity in the flow field model, and the initial pressure of the flow field model.
[0061] S204: Divide the flow field grid using a preset partitioning algorithm to obtain a plurality of sub-areas corresponding to the number of execution processes, and allocate a corresponding sub-area to each process.
[0062] Steps S203 to S204 and Figure 1 Step S120 and step S130 in the corresponding embodiment are the same, and the details can be referred to the description of the corresponding part above, which will not be repeated here.
[0063] In the current embodiment, after the flow field grid is divided using a preset division algorithm in step S204 to obtain a plurality of sub-areas corresponding to the number of execution processes and a corresponding sub-area is allocated to each process, the method provided in the present application further includes step S205.
[0064] S205: Using the main process to read the grid file, and respectively allocating the sub-grid files corresponding to the corresponding sub-regions to the common processes.
[0065] After completing the division of the flow field grid corresponding to the flow field model and obtaining multiple sub-areas corresponding to the number of execution processes, the main process further reads the grid file, and allocates the sub-grid files corresponding to the sub-areas corresponding to each ordinary process to each ordinary process respectively. By reading the grid file, at least the coordinate information of each grid unit can be read. Further, in other embodiments, the coordinate information of each grid unit and the unit information of the points contained in the grid unit can also be read by reading the grid file, wherein the unit information of the points contained in the grid unit at least includes the point sequence number and / or the coordinate information corresponding to the point included in the current grid unit. Among them, the sub-grid file is the grid file of the corresponding part of the sub-area in the grid file. When the flow field grid is divided into 8 sub-areas, the grid file corresponding to the corresponding flow field model will be divided into 8 sub-grid files corresponding to the sub-area. For example, when eight processes are involved in the fluid dynamics simulation, after reading the grid file, the main process will allocate the subgrid files of the corresponding sub-regions to the remaining seven ordinary processes. For example, for ordinary process No. 2, only the subgrid file corresponding to the sub-region corresponding to ordinary process No. 2 will be allocated, and no subgrid files corresponding to other sub-regions will be allocated to ordinary process No. 2. Correspondingly, when the main process also processes a sub-region, the main process will also read the subgrid file corresponding to the sub-region for itself.
[0066] Further, Figure 1 The corresponding step S140 in the embodiment uses each process to calculate the particle distribution function of each grid unit corresponding to each sub-region according to the initial macro information and boundary condition information, and further includes steps S206 to S208.
[0067] S206: Utilize each process to calculate the attribute information of each grid cell included in the sub-region according to the coordinate information of the grid cells included in the sub-grid file corresponding to the sub-region corresponding to the process.
[0068] After completing the division and allocation of sub-areas and reading the sub-grid files corresponding to the corresponding sub-areas for each process, each process will use the coordinate information of the grid cells corresponding to the sub-areas it processes to calculate the attribute information of each grid cell included in the sub-area.
[0069] Among them, the coordinate information of the grid unit can be read by reading the grid file through the above-mentioned step S205. In the current embodiment, the grid unit included in the generated grid file is a tetrahedron, and the corresponding attribute information of the calculated grid unit at least includes determining the faces where the four vertices of the grid unit are located and the grid unit where they are located, calculating the centroid of the four faces of the tetrahedron, the endpoint coordinate information included in each face, and the area of each face. At the same time, determining the attribute information of the grid unit will also include determining the volume, centroid, and face and point coordinate information included in the current grid unit. It can be understood that the attribute information of the grid unit is not limited to only including the above content. In other embodiments, other attribute information of the grid unit can be calculated according to actual needs, which are not listed here one by one.
[0070] It should be noted that, in the technical solution provided by the present application, before or while calculating the attribute information of each grid unit included in the sub-area, the technical solution provided by the present application will also include: allocating a buffer in the memory for parallel reception and transmission of the information transmission application program interface, so as to be used for data transmission between adjacent grid units with interfaces in adjacent sub-areas in the following steps.
[0071] S207: Calculate the initial particle distribution function corresponding to each grid unit according to the initial macro information of each grid unit.
[0072] After calculating the attribute information of each grid cell, the initial particle distribution function corresponding to each grid cell will be further calculated according to the initial macro information of each grid cell, so as to update the particle distribution function of the grid cells in the sub-area within the current time period according to the initial particle distribution function of each grid cell. Among them, the initial macro information of the grid cell is the initial macro information set based on the flow field model. It should be noted that the time period refers to the current calculation cycle time, that is, if it is determined through step S209 that the flow field model does not meet the convergence condition, step S208 will be further re-executed in a cycle. Correspondingly, the time period refers to the time difference between the two executions of step S208. The time difference can be set by the user according to actual needs, or it can be set by the program by default based on empirical values.
[0073] Furthermore, the above step S207 calculates the initial particle distribution function corresponding to each grid unit according to the initial macro information of each grid unit, and further includes: calculating the equilibrium distribution function of each grid unit in the current time period by the following formula according to the initial macro information of each grid unit.
[0074] Specifically, the formula is: in, represents the equilibrium distribution function value of the αth discrete velocity direction in the grid unit in the current time period, ρ represents the density of the grid unit, y represents the fluid velocity corresponding to the grid unit, c s represents the speed of sound, e α represents the discrete velocity in the αth direction in the lattice model, e α is the αth column vector of e, where the current time period is the first time period, u is the initial fluid velocity in the flow field model, and c s It is a fixed value set by the user.
[0075] Among them, the number of directions in the lattice model is derived from the theoretical model. For example, in one embodiment, a grid unit can be set to include 19 directions according to the derivation in the theoretical model. Correspondingly, a grid unit has a center of mass, and then a grid unit will have 19 particle distribution function values and 19 equilibrium distribution function values.
[0076] The discrete velocity e in the grid cell is as follows:
[0077]
[0078] In another embodiment, the ratio ω is set α It is set according to the sequence number of the direction. The specific setting ratio is as follows:
[0079]
[0080] After obtaining the equilibrium distribution function of each grid unit in the current time period, the equilibrium distribution function of each grid unit in the current time period is further assigned as the initial particle distribution function.
[0081] S208: Using each process to update the particle distribution function of the grid cells in the sub-region of the current time period in real time according to the initial particle distribution function corresponding to the grid cells included in each sub-region using the Runge-Kutta method.
[0082] After using each process to obtain the initial particle distribution function corresponding to the grid cells included in each sub-area, each process is further used to update the particle distribution function of the grid cells in the sub-area in the current time period in real time using the Runge-Kutta method based on the initial particle distribution function corresponding to the grid cells included in each sub-area.
[0083] S209: Calculating the convergence value of the flow field according to the macro information of the grid cells in the sub-region, and judging whether the flow field model meets the convergence condition according to the convergence value of the flow field.
[0084] In one embodiment, step S209 may also be to use each process to calculate the convergence value of each sub-region according to the macro information of the grid unit in the corresponding sub-region, and the main process collects the convergence value corresponding to each sub-region and then calculates the convergence value of the flow field model, and finally uses the main process to judge whether the flow field model meets the convergence condition according to the convergence value of the flow field model. Further, each process calculates the sum of the speed change amount and the sum of the speed magnitude in the sub-region according to the macro information of the grid unit in the corresponding sub-region, and then calculates the ratio of the sum of the speed change amount to the sum of the speed magnitude in each process to obtain the relative speed change amount of the sub-region, that is, to obtain the convergence value of the sub-region, and then the sub-region feeds back the corresponding convergence value to the main process to obtain the convergence value of the flow model, and then uses the main process to judge whether the flow field model meets the convergence condition according to the convergence value of the flow field model. In other embodiments, after each process obtains its own convergence value, it further determines whether the corresponding sub-area meets the convergence condition based on the convergence value, and then feeds back the judgment result to the main process. The main process further determines whether the flow field meets the convergence condition based on the convergence judgment results of each sub-area fed back by each process.
[0085] In another embodiment, step S209 may also be to use each process to calculate the sum of the velocity changes and the sum of the velocity magnitudes in the sub-region according to the macro information of the grid cells in the corresponding sub-region, and send them to the main process, and then use the main process to calculate the ratio of the sum of the velocity changes to the sum of the velocity magnitudes to obtain the relative velocity change, and judge whether the flow field model meets the convergence condition according to the relative velocity change. In the current embodiment, the relative velocity change can be understood as the convergence value of the flow field model. If the convergence value is less than the preset threshold, it is judged that the flow field model meets the convergence condition, and step S210 is executed, otherwise step S208 will be re-circulated.
[0086] S210: Aggregate the macro information corresponding to each sub-region and output it as a simulation result of the flow field model.
[0087] It should be noted that Figure 2 In the corresponding embodiment, steps S209 and S210 are Figure 1 The steps S150 and S160 shown in FIG. 1 are the same and will not be described in detail here. Figure 1 The description in the corresponding embodiment.
[0088] In the current embodiment, the method provided in the present application generates a three-dimensional unstructured grid corresponding to the flow field model, that is, obtains a spatially discrete grid unit through the finite volume method, and then uses the Runge-Kutta method in time to obtain a particle distribution function containing a finite volume grid unit area. Compared with the prior art, the technical solution provided in the present application can be used to deal with large-scale and complex practical application problems of fluid mechanics.
[0089] See also Figure 3 , Figure 3 This is a flow chart of another embodiment of a method for fluid mechanics simulation of the present application. In the current embodiment, the above step S208 is further elaborated. Specifically, the method provided by the present application includes:
[0090] S301: Calculate the convection flux between adjacent grid cells with interfaces in each sub-area respectively.
[0091] The calculation formula for the convective flux between adjacent grid cells with interfaces in each sub-area is as follows:
[0092]
[0093] Among them, A α,i represents the convective flux of grid cell i, V i represents the volume of grid cell i, Where, ε = 1.0 × 10 -5 , k = 1.0, v is the viscosity coefficient, and the viscosity coefficient v is a preset fixed value, Δx is half of the distance between the centroids of the mesh units i and j with the interface, and Δx can also be understood as half of the difference in the centroid coordinates of the mesh units i and j, n ij is the normal vector of the interface between two mesh units, l ij is the area of the interface, and represents the particle distribution function of the grid cells on the left and right sides of the interface, and The calculation formula is as follows.
[0094]
[0095] In the above formula, and represents the gradient of the particle distribution function of grid cell i and grid cell j, respectively, and f α,i and f α,j is the particle distribution function representing grid cell i and grid cell j, r L and r RRepresent the vectors pointing from grid cell i and grid cell j to the centroid of the interface between the two grid cells respectively.
[0096] S302: Calculate the collision term corresponding to each grid unit in each sub-region according to the equilibrium state function of each grid unit in each sub-region and the particle distribution function of each grid unit.
[0097] Specifically, based on the following formula, the collision term C corresponding to each grid unit in each sub-region is obtained according to the equilibrium state function of each grid unit in each sub-region and the particle distribution function of each grid unit: α,i , the formula is as follows:
[0098]
[0099] in, is the equilibrium distribution function of grid unit i in the α direction, f α,i is the particle distribution function or the initialization particle distribution function of grid unit i in the α direction, τ is the relaxation time, and its value is determined by the viscosity coefficient ν, τ = 3ν.
[0100] S303: Calculate the particle distribution function of each grid cell in the sub-area within the current time period according to the convection flux and the collision term.
[0101] After the convective flux and the collision term are obtained, the particle distribution function of each grid unit in the sub-area in the current time period is further calculated according to the obtained convective flux and the collision term.
[0102] Further, step S303 includes: calculating the sum of the convection flux and the collision term, and outputting it as a first ratio K1, that is, K1=A α,i +C α,i .
[0103] The second ratio K2 is calculated according to the following formula:
[0104] Among them, A α,i is the convective flux between adjacent grid cells with interfaces in the sub-region, C α,i is the collision item corresponding to the grid cell in the sub-area.
[0105] After respectively obtaining the first ratio K1 and the second ratio K2, the particle distribution function of each grid unit in the sub-area in the current time period is calculated according to the following calculation formula:
[0106]
[0107] in, is the particle distribution function of the sub-area in the time period t+Δt, is the particle distribution function of the sub-area in time period t.
[0108] See also Figure 4 , Figure 4 This is a flow chart of another embodiment of a method for fluid mechanics simulation of the present application. In the current embodiment, the focus is on the above-mentioned step S140 of determining the macro information corresponding to the grid cells in each sub-region according to the particle distribution function of the grid cells in each sub-region. First of all, it should be noted that in the current embodiment, the macro information includes: the density of the grid cells in the sub-region, the fluid velocity of the grid cells in the sub-region, and the pressure of the grid cells in the sub-region. In the current embodiment, the method provided by the present application includes:
[0109] S401: summing the values of the particle distribution function of each grid unit in the sub-region, and using the summed result as the density of the corresponding grid unit in the sub-region.
[0110] As described above, in one embodiment, 19 directions are preset in each grid unit. Correspondingly, when executing step S401, the values of the particle distribution function in the 19 directions in each grid unit are summed, and the sum of the values of the particle distribution function in the 19 directions is output as the density of the grid unit.
[0111] Specifically, the formula for obtaining the grid cell density ρ is as follows: ρ = ∑f α , where f α is the value of the particle distribution function in each preset direction in the grid unit.
[0112] S402: Calculate the fluid velocity of the grid cells in the sub-region according to the column vector of the set direction in the grid cells, the particle distribution function value of the grid cells, and the density of the grid cells in the sub-region.
[0113] The equation relationship between the column vector of the set direction in the grid unit, the particle distribution function value of the grid unit and the density of the grid unit in the sub-region is as follows: That is, the product of the density of the grid unit and the fluid velocity corresponding to the grid unit is equal to the sum of the products of the column vectors of each set direction in the grid unit and the particle distribution function value of the set direction of the grid unit, that is, ρu=∑e α f α , and then the grid unit fluid velocity u can be obtained according to the relationship in the above equation. The calculation formula of velocity u is as follows
[0114] S403: Calculate the product of the fluid density and the square of the sound velocity of the grid cell in the sub-region as the pressure of the corresponding grid cell.
[0115] That is, the pressure value of a grid cell is equal to the density of the grid cell and the speed of sound c s The product of the square values of It should be noted that, in the current embodiment, the density of the grid unit is the density obtained in the above step S401.
[0116] See also Figure 5 , Figure 5 This is a flow chart of another embodiment of a method for fluid mechanics simulation of the present application. In the current embodiment, the above step S150 calculates the convergence value of the flow field according to the macro information of the grid cells in the sub-region, and judges whether the flow field model meets the convergence condition according to the convergence value of the flow field, further comprising:
[0117] S501: Utilize each process to calculate the convergence value corresponding to the sub-region according to the fluid velocity of each grid unit in the corresponding sub-region and the velocity component of the grid unit in the three-dimensional direction, and send the convergence value to the main process.
[0118] First of all, it should be noted that the process includes the main process and the ordinary process. In the current embodiment, the main process and the ordinary process respectively perform different steps in determining whether the flow field model meets the convergence condition. Figure 5 The description in the corresponding embodiment.
[0119] When judging whether the flow field model meets the convergence conditions, firstly, each process should be used to obtain the velocity change and the sum of the velocity magnitudes of each sub-region according to the fluid velocity u of each grid unit in the corresponding sub-region and the velocity component in the three-dimensional direction of the corresponding grid unit, and then the main process collects and calculates the relative velocity change. The main process determines whether the flow field model meets the convergence conditions according to the relative velocity change.
[0120] S502: Calculate the convergence value of the flow field model using the main process, and determine whether the convergence value of the flow field model is less than a preset threshold.
[0121] After using each process (each process here includes a common process and a main process) to calculate the speed change and the sum of the speed magnitudes of each sub-area, and sending the speed change and the sum of the speed magnitudes to the main process, the main process is further used to calculate the ratio of the speed change to the sum of the speed magnitudes, and output as a relative speed change, and then the main process determines whether the relative speed change is less than a preset threshold, and the main process determines whether the flow field model meets the convergence condition based on the judgment result. Among them, the preset threshold is a preset empirical value for judging whether the flow field model meets the convergence, which can be set according to actual needs or simulation needs, and no limitation is made here. When it is judged that the relative speed change is less than the preset threshold, it is judged that the flow field model meets the convergence condition, and the following step S603 will be executed at this time, otherwise it is judged that the flow field model does not meet the convergence condition.
[0122] Among them, the calculation formula of the relative change of the velocity of the flow field model and whether it meets the convergence are as follows:
[0123]
[0124] Among them, u n , v n and w n is the component of the fluid velocity u of each grid unit in the sub-area in the three-dimensional direction at time t, and ζ is the threshold used to determine whether it converges.
[0125] S503: Determine whether the obtained flow field model satisfies the convergence condition.
[0126] If the main process determines that the relative change in velocity in the flow field model is less than a preset threshold, the main process will further determine that the flow field model meets the convergence condition. Furthermore, the main process will aggregate the macro information corresponding to each sub-region and output it as the simulation result of the flow field model.
[0127] It can be understood that in other embodiments, in the method provided by the present application, the above steps calculate the convergence value of the particle distribution function corresponding to the grid unit in the sub-region based on the macro information of the grid unit in the sub-region, and judge whether the flow field model meets the convergence condition based on the convergence value corresponding to each sub-region, and further include the following process: using each process to calculate the convergence value of each sub-region based on the fluid velocity of each grid unit in the corresponding sub-region and the velocity component of the grid unit in the three-dimensional direction, and each process judges whether the convergence value of each sub-region is less than a preset threshold value based on the convergence value of each sub-region; then use each process to feedback the judgment result of whether the sub-region meets the convergence condition to the main process, and then the main process further judges whether the flow field model meets the convergence condition based on the judgment result fed back by each process. Among them, calculating the convergence value is to calculate the relative change in speed, and the relative change in speed can be calculated based on Figure 5 The calculation is performed using the calculation formula in the corresponding embodiment.
[0128] Furthermore, the main process can further determine whether the flow field model meets the convergence condition based on the judgment results of whether the sub-areas meet the convergence condition received from other processes. Specifically, the main process can determine whether the flow field model meets the convergence condition by determining whether the proportion of sub-areas that meet the convergence condition is greater than or equal to a preset proportion.
[0129] In one embodiment, the preset ratio may be 100%, that is, only when it is determined that the velocity changes of all sub-areas in the flow field model are less than the preset threshold, the main process will determine that the flow field model meets the convergence condition.
[0130] In another embodiment, when the number of sub-regions included in the flow field model is large, the preset ratio can be set to ninety-five percent according to actual needs. Then, correspondingly, the main process will only determine that the flow field model meets the convergence conditions when it is determined that the convergence values of greater than or equal to ninety-five percent of the sub-regions in the flow field model are less than the preset threshold.
[0131] See also Figure 6 , Figure 6 This is a flow chart of another embodiment of a method for fluid dynamics simulation of the present application. In the current embodiment, the method provided by the present application includes:
[0132] S601: Acquire a flow field model, and generate an unstructured flow field grid corresponding to the flow field model.
[0133] S602: Save the generated unstructured flow field grid of the flow field model as a grid file.
[0134] S603: Acquire initial macro information, boundary condition information and the number of execution processes set based on the flow field model.
[0135] S604: Divide the flow field grid using a preset partitioning algorithm to obtain a plurality of sub-areas corresponding to the number of execution processes, and allocate a corresponding sub-area to each process.
[0136] S605: Use the main process to read the grid file, and allocate the sub-grid files corresponding to the corresponding sub-areas to the common processes respectively.
[0137] It should be noted that, in the current embodiment, steps S601 to S605 are the same as those described above. Figure 2Steps S201 to S205 in the corresponding embodiment are the same, and the details can be referred to the corresponding part above, and no further description is given here. In the current embodiment, after the flow field grid is divided into multiple sub-areas using a preset division algorithm, the following step S606 is further performed.
[0138] S606: Generate a preset unit corresponding to the sub-area using each process.
[0139] Wherein, the preset unit is a preset unit for processing the boundary conditions in the sub-area. Wherein, the grid units included in the boundary of the corresponding sub-area of the preset unit are generated, that is, the number of preset units corresponds to the number of grid units at the boundary in the sub-area. After the corresponding sub-area is assigned to each process, and the main process assigns the sub-grid files corresponding to the corresponding sub-areas to each ordinary process, the method provided in the present application will also use each process to generate the preset unit of the corresponding sub-area. Wherein, in some embodiments, the preset unit is defined as a ghost unit. For example, when there are 8 grid units on the boundary of a sub-area, the process corresponding to the sub-area will generate preset units corresponding to the 8 grid units, wherein the preset units generated by the process correspond to the 8 grid units on the boundary, respectively, for processing the boundary conditions of the sub-area.
[0140] S607: Calculate the initial particle distribution function corresponding to each grid unit according to the initial macro information of each grid unit.
[0141] S608: Calculate the attribute information of each grid cell included in the sub-region using each process according to the coordinate information, cell information and initial macro information of the grid cell included in the sub-grid file corresponding to the sub-region. Steps S607 to S608 may correspond to the above Figure 2 The description of step S207 and step S206 will not be described in detail here.
[0142] S609: Utilize each process to transmit the particle distribution function of the outer grid cells in the sub-region corresponding to it to the adjacent sub-region and receive the particle distribution function of the outermost grid cells sent by the adjacent sub-region, so as to determine the particle distribution function of the grid cells at the adjacent sub-region.
[0143] That is, step S609 is understood as using each process to place the outer layer unit particle distribution function of the sub-region corresponding to it in the sending buffer to pass it to the process corresponding to the adjacent sub-region, and using the receiving buffer to receive the particle distribution function sent by the process corresponding to the adjacent sub-region, and then placing the data in the receiving buffer at the corresponding grid unit to determine the convection flux between the adjacent sub-regions, so as to enable the process of the adjacent sub-region to determine the particle distribution function of the grid unit at the adjacent sub-region.
[0144] It should be noted that, in the current embodiment, when the following step S612 determines that the flow field model does not meet the convergence condition, step S609 and the steps after step S609 will be re-executed. Correspondingly, in the current embodiment, before each new round of iterative step calculation starts, the particle distribution function of all the outermost grid cells of the sub-region processed by each process needs to be transferred to the adjacent sub-region, so that the process corresponding to the adjacent sub-region can calculate the particle distribution function corresponding to the sub-region based on the obtained particle distribution function value of the outermost grid cell of the adjacent sub-region.
[0145] S610: Calculate the particle distribution function of the preset unit using the equilibrium state extrapolation method.
[0146] After using each process to generate the preset unit of the corresponding sub-area, the macro information corresponding to the preset unit is further set for the preset unit according to the boundary conditions, and the particle distribution function of the preset unit is calculated using the equilibrium state extrapolation method. Specifically, it is necessary to first calculate the equilibrium state distribution function of the grid unit corresponding to the preset unit, and then obtain the particle distribution function of the preset unit through an approximate algorithm. The specific formula is as follows:
[0147]
[0148] In the above formula, f α,i′ and represent the particle distribution function and equilibrium distribution function of the preset unit i′, respectively, and f α,i , and They respectively represent the particle distribution function, equilibrium distribution function and non-equilibrium distribution function of the grid unit i corresponding to the preset unit i′.
[0149] Furthermore, when the technical solution provided by the present application is executed in a first loop, after step S607, the method provided by the present application further includes: allocating a buffer for parallel reception and transmission of the communication protocol in the memory for data transfer between adjacent grid units at the interface of adjacent sub-regions, so as to execute the following step S608. In the current embodiment, the buffer for parallel reception and transmission of the communication protocol is only allocated once in the memory, that is, the step of allocating a buffer for parallel reception and transmission of the communication protocol in the memory for data transfer between adjacent grid units at the interface of adjacent sub-regions does not participate in the loop.
[0150] S611: Using each process, according to the initial particle distribution function corresponding to the grid cells included in each sub-region, the Runge-Kutta method is used to update the particle distribution function and macro information of each grid cell in the sub-region of the current time period in real time.
[0151] S612: Utilize each process to calculate the sum of velocity changes and the sum of velocity magnitudes in the sub-region according to the macro information of the grid cells in the sub-region, and send it to the main process, which calculates the relative velocity change and determines whether the flow field model meets the convergence condition according to the relative velocity change.
[0152] S613: Aggregate the macro information corresponding to each sub-region and output it as the simulation result of the flow field model. Figure 2 The steps S206 to S210 in the above are the same, and the details can be found in the corresponding part of the above text, which will not be described in detail here. In the current embodiment, the flow field grid can be divided by using a preset division algorithm, thereby ensuring the parallel efficiency of large-scale complex flow field grid division, and at the same time, each process generates a preset unit of the sub-region part that it is responsible for, which is convenient for the processing of boundary conditions, and also shortens the time required for fluid mechanics simulation of the entire flow field model.
[0153] Please also see Figures 7 to 9 , Figure 7 A schematic diagram of an application scenario in an embodiment of a method for fluid mechanics simulation of the present application; Figure 8 A schematic diagram of an application scenario in another embodiment of a method for fluid dynamics simulation of the present application; Fig. 9The present invention is a schematic diagram of an application scenario in another embodiment of a method for fluid mechanics simulation. In one embodiment, when it is necessary to perform fluid mechanics simulation on a flow field model with a sphere O flowing around it, the fluid model A is first imported into the grid generation software or program logic to generate a grid corresponding to the flow field model A and the generated grid is saved as a grid file. At the same time, the initial macro information, boundary condition information and number of execution processes of the grid set based on the flow field model are obtained, wherein the boundary conditions at least include the inlet, outlet, wall, spherical surface, etc. of the grid. At the same time, the initial flow field information of the flow field grid (flow field model) can be set to ρ = 1.0, u = (0.1 0 0), (where ρ is the initial macroscopic density of the flow field model, and u is the initial macroscopic velocity corresponding to the flow field model), and the number of processes executed in parallel is set by the user according to actual needs.
[0154] Then, the flow field grid is divided in parallel using a preset division algorithm to obtain a plurality of sub-regions corresponding to the number of execution processes, and then the main process reads the grid file to allocate the sub-grid file corresponding to the corresponding sub-region to each process, and each process performs parallel simulation calculations on the corresponding sub-region to obtain the particle distribution function and macro information of each sub-region, and then calculates the relative change in velocity of the particle distribution function, and finally determines whether the flow field model meets the convergence condition according to the relative change in velocity. When it is determined that the convergence condition is met, the above calculation is stopped and the macro information of each sub-region is aggregated and output as the simulation result of the flow field model. By testing the performance of the above technical solution, it is found that the technical solution provided by the present application can better guarantee the accuracy of the calculation results while improving the running speed. By testing and comparing the technical solution provided by the present application and the fluid mechanics simulation solution in the prior art at different Reynolds numbers, it is found that the technical solution provided by the present application can better guarantee the accuracy of the calculation results while reducing the amount of calculation.
[0155] See also Fig.10 , Fig.10 FIG. 1 is a schematic diagram of a fluid dynamics simulation device in an embodiment of the present application. In the current embodiment, the fluid dynamics simulation device 1000 provided by the present application includes a coupled processor 1001 and a memory 1002. The fluid dynamics simulation device 1000 can execute Figures 1 to 9 And the method of fluid mechanics simulation described in any corresponding embodiment.
[0156] The memory 1002 includes a local storage (not shown) and stores a computer program. When the computer program is executed, Figures 1 to 9 And the method described in any corresponding embodiment.
[0157] The processor 1001 is coupled to the memory 1002, and the processor 1001 is used to run the computer program to execute the above Figures 1 to 9 And the method of fluid mechanics simulation described in any corresponding embodiment.
[0158] See also Fig.11 , Fig.11 1 is a schematic diagram of a storage medium according to an embodiment of the present application. The storage medium 1100 stores a computer program 1101 that can be executed by a processor. The computer program 1101 is used to implement the above Figures 1 to 9 The method of fluid mechanics simulation described in any one of the corresponding embodiments. Specifically, the storage medium 1100 may be a memory, a personal computer, a server, a network device, or a USB flash drive, etc., and no limitation is made here.
[0159] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for fluid mechanics simulation, characterized in that: The method comprises: Acquire a flow field model, and generate an unstructured flow field grid corresponding to the flow field model; Saving the generated unstructured flow field grid of the flow field model as a grid file; Acquiring initial macro information, boundary condition information and the number of execution processes set based on the flow field model; The flow field grid is divided by using a preset division algorithm to obtain a plurality of sub-areas corresponding to the number of the execution processes, and the corresponding sub-area is allocated to each of the processes; the preset division algorithm is a parallel multi-level k-path graph division algorithm; Utilizing each of the processes to calculate the particle distribution function corresponding to each grid unit in each of the sub-regions according to the initial macro information and the boundary condition information, and determining the macro information corresponding to the grid unit in each of the sub-regions according to the particle distribution function of the grid unit in each of the sub-regions; Calculating the convergence value of the flow field according to the macro information of the grid cells in the sub-region, and judging whether the flow field model meets the convergence condition according to the convergence value of the flow field, including: each of the processes respectively calculates the sum of the velocity changes and the sum of the velocity magnitudes of the corresponding sub-region according to the macro information of the grid cells in the sub-region, calculating the relative velocity change of the sub-region according to the sum of the velocity changes and the sum of the velocity magnitudes, and judging whether the flow field model meets the convergence condition according to the obtained relative velocity changes of each sub-region; If so, the macro information of the grid cells in each of the sub-regions is aggregated and output as the simulation result of the flow field model.
2. The method for fluid dynamics simulation according to claim 1, characterized in that: The process includes a main process and a common process; After the flow field grid is divided by using a preset division algorithm to obtain a plurality of sub-areas corresponding to the number of the execution processes, and the corresponding sub-area is allocated to each process, the method further comprises: The main process is used to read the grid file, and the sub-grid files corresponding to the sub-areas corresponding to the common processes are respectively allocated, wherein the grid file includes sub-grid files corresponding to the number of processes, and the sub-grid file includes multiple grid units.
3. The method for fluid dynamics simulation according to claim 2, characterized in that: The step of using each of the processes to calculate the particle distribution function corresponding to each grid unit in each of the sub-areas according to the initial macro information and the boundary condition information further includes: Utilizing each of the processes to calculate the attribute information of each grid cell included in the sub-region according to the coordinate information of the grid cells included in the sub-grid file corresponding to the sub-region corresponding to the process; Calculating the initial particle distribution function corresponding to each of the grid units according to the initial macro information of each of the grid units; Each of the processes is used to update the particle distribution function of the grid cells in the sub-region in the current time period in real time using the Runge-Kutta method according to the initial particle distribution function corresponding to the grid cells included in each sub-region.
4. The method for fluid dynamics simulation according to claim 3, characterized in that: The initial macro information includes: the initial density of the flow field model, the initial fluid velocity in the flow field model and the initial pressure of the flow field model; The step of calculating the initial particle distribution function corresponding to each of the grid cells according to the initial macro information of each of the grid cells further comprises: According to the initial macro information of each grid unit, the equilibrium distribution function of each grid unit in the current time period is calculated by the following formula: Assigning the equilibrium distribution function of the current time period of each grid unit to the initial particle distribution function; in, represents the equilibrium distribution function value of the αth discrete velocity direction in the grid unit in the current time period, ρ represents the density of the grid unit, y represents the fluid velocity corresponding to the grid unit, c s represents the speed of sound, e α represents the discrete velocity in the αth direction in the lattice model, wherein when the current time period is the first time period, the ω α It is pre-set according to the following rules: The u is the initial fluid velocity in the flow field model.
5. The method for fluid dynamics simulation according to claim 3, characterized in that: The method of using each of the processes to respectively update the particle distribution functions of the grid cells in the sub-regions in the current time period using the Runge-Kutta method according to the initial particle distribution functions corresponding to the grid cells in each of the sub-regions further comprises: Calculate the convective flux between adjacent grid cells with interfaces in each sub-region respectively; Calculating the collision term corresponding to each of the grid cells in each of the sub-regions according to the equilibrium state function of each of the grid cells and the particle distribution function of each of the grid cells in each of the sub-regions; The particle distribution function of each of the grid cells in the sub-region within the current time period is calculated according to the convective flux and the collision term.
6. The method for fluid dynamics simulation according to claim 1, characterized in that: The macro information includes: the density of the grid cells in the sub-region, the fluid velocity of the grid cells in the sub-region, and the pressure of the grid cells in the sub-region. The determining of the macro information corresponding to the grid cells in each sub-region according to the particle distribution function of the grid cells in each sub-region further includes: Sum the values of the particle distribution functions in a plurality of preset directions in each grid unit in the sub-region, and use the summation result as the density of the grid unit; Calculate the fluid velocity of the grid cell in the sub-region according to the column vector of the set direction in the grid cell, the value of the particle distribution function of the grid cell, and the density of the grid cell in the sub-region; The product of the fluid density and the square value of the speed of sound of the grid unit in the sub-region is calculated as the pressure of the grid unit.
7. The method for fluid dynamics simulation according to claim 6, characterized in that: The process includes a main process and a common process; The step of calculating the convergence value of the flow field according to the macro information of the grid unit in the sub-region, and judging whether the flow field model meets the convergence condition according to the convergence value of the flow field, further comprises: Using each of the processes to calculate the convergence value corresponding to the sub-region according to the fluid velocity of each of the grid cells in the corresponding sub-region and the velocity component of the grid cells in the three-dimensional direction, and send the convergence value to the main process; Calculating the convergence value of the flow field model using the main process, and determining whether the convergence value of the flow field model is less than a preset threshold; If so, it is determined that the flow field model satisfies the convergence condition.
8. The method for fluid dynamics simulation according to claim 6, characterized in that: The process includes a main process and a common process; The step of calculating the convergence value of the flow field according to the macro information of the grid unit in the sub-region, and judging whether the flow field model meets the convergence condition according to the convergence value of the flow field, further comprises: Utilizing each of the processes to calculate the convergence value corresponding to the sub-region according to the fluid velocity of each of the grid cells in the corresponding sub-region and the velocity component of the grid cells in the three-dimensional direction, and judging whether the sub-region is less than satisfying the convergence condition according to the convergence value; Using each of the processes to feed back to the main process a judgment result of whether the sub-region meets the convergence condition; Using the main process to judge whether the flow field model meets the convergence condition according to the judgment results fed back by each process; If it is determined by the main process that more than a preset proportion of sub-areas in the flow field meet the convergence condition, it is determined that the flow field model meets the convergence condition.
9. The method for fluid dynamics simulation according to claim 1, characterized in that: The method further comprises: At least part of the process is used to generate preset units corresponding to the grid units included in the boundary of the flow field model, and the preset units are preset units for processing boundary conditions in the flow field model.
10. The method for fluid dynamics simulation according to claim 9, characterized in that: The method further comprises: The particle distribution function of the preset unit is calculated using the equilibrium state extrapolation method, wherein the calculation formula is as follows: Among them, f α,i′ and represent the particle distribution function and equilibrium distribution function of the preset unit i′, respectively, and f α,i , and They respectively represent the particle distribution function, equilibrium distribution function and non-equilibrium distribution function of the i-th grid unit, and the preset unit i′ is a unit used to process the boundary conditions of the i-th grid unit.
11. The method for fluid dynamics simulation according to claim 1, characterized in that: The method further comprises: allocating a buffer zone in the memory for parallel reception and transmission of the communication protocol, so as to be used for data transmission between adjacent grid units with interfaces in adjacent sub-areas.
12. A fluid mechanics simulation device, characterized in that: The device comprises a memory and a processor coupled, wherein: The memory includes local storage and stores a computer program; The processor is configured to run the computer program to perform the method according to any one of claims 1 to 11.
13. A computer storage medium, characterized in that: The storage medium stores a computer program that can be executed by a processor, and the computer program is used to implement the method according to any one of claims 1 to 11.
