SPH pollutant transport simulation method based on background grid division particle dormancy

By employing a particle dormancy strategy based on background grid partitioning, combined with grid classification and bit operation optimization, the computation of pollutant-free regions is dynamically identified and skipped, thus solving the problem of redundant computation in the SPH method. This achieves efficient pollutant transport simulation and improves computational efficiency and accuracy.

CN120850877APending Publication Date: 2025-10-28TIANJIN UNIV

Patent Information

Application Number
CN202510974225.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing SPH methods suffer from redundant computations in pollutant transport simulations, failing to effectively utilize the sparsity of pollutant distribution, resulting in low computational efficiency and making it difficult to meet the simulation requirements of large-scale real-world operating conditions.

Method used

A particle dormancy strategy based on background grid division is adopted, combined with grid classification, bit operation optimization and dynamic update mechanism, to dynamically identify and skip the calculation of pollutant-free areas, thereby improving computing efficiency through the particle dormancy strategy.

Benefits of technology

It significantly reduces redundant calculations in pollutant transport problems, improves computational efficiency, and maintains computational accuracy, especially in large-scale particle systems, providing an efficient simulation solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120850877A_ABST
    Figure CN120850877A_ABST
Patent Text Reader

Abstract

The invention relates to an SPH pollutant transport simulation method based on background grid division particle dormancy. The method comprises the following steps: initializing parallel computing parameters and initializing particle information; copying the to-be-processed data from the CPU end to the GPU end; parallel computing of the SPH method is carried out, wherein the parallel computing comprises the steps of background grid division, particle sorting, background grid state updating, background grid classification, particle searching and computing, dynamic updating grid classification, particle interaction computing solution diffusion, particle position updating, boundary condition processing and repeated iteration; and copying the result data back to the CPU end from the GPU end, and exporting the result data for subsequent analysis and visualization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computational fluid dynamics (CFD), and in particular to an efficient method for simulating pollutant transport based on the smoothed particle hydrodynamics (SPH) algorithm, which is applicable to the numerical simulation of large-scale pollutant transport problems. Background Technology

[0002] Smoothed Particle Hydrodynamics (SPH) is a numerical simulation technique based on a meshless method. First proposed by Lucy and Gingold, this method discretizes the volume of a continuous fluid into a series of particles, each carrying physical properties and moving with the fluid, enabling it to adapt to complex boundary conditions and large deformation problems. Due to its unique advantages, SPH has achieved excellent simulation results in various fields such as fluid dynamics simulation, astrophysical modeling, and engineering simulation.

[0003] Neighborhood search and inter-particle interaction calculation are the core computational steps of the SPH method, and also the two main computational bottlenecks it faces in practical applications. To obtain accurate and stable simulation results, existing SPH methods track the physical property values ​​of all particles and update them at each time step. Each particle needs to frequently search for its neighboring particles and calculate their interactions at each time step, a process that is extremely computationally intensive. However, in contaminant transport problems, contaminants are typically concentrated in a specific region of the computational domain and migrate along the water flow direction over time, resulting in contaminant concentrations of zero or near zero in most areas of the computational domain. Traditional SPH algorithms perform uniform calculations on all particles, ignoring the spatial sparsity of contaminant distribution, leading to a large amount of redundant computation and reducing computational efficiency.

[0004] A literature search of existing technologies revealed that patent CN115546134A proposes a parallel computational method for SPH (Self-Propagation and Phosphorescence) simulation of water pollutant transport and diffusion. This method first preprocesses the attribute data of the water body, solid boundaries, and pollutant particles in the computational domain, and then stores the data in a GPU for multi-GPU data loading. Through parallel computation of particle neighborhood search and calculation, it achieves the simulation of pollutant transport and diffusion and the calculation of retention characteristics. Although this method can effectively improve the computational efficiency of water pollutant simulation using parallel computing, it does not address the sparsity of pollutant distribution, resulting in significant redundant computations. Furthermore, it does not improve neighborhood search and inter-particle interaction computation, limiting the improvement in computational efficiency. Therefore, it cannot meet the requirements for large-scale simulations under real-world conditions.

[0005] Therefore, there is an urgent need for an efficient method that can dynamically identify and skip calculations of pollutant-free areas to improve the computational efficiency of large-scale pollutant transport simulations. This would allow the SPH method to significantly improve computational efficiency and quickly predict pollutant transport problems in the aquatic environment while ensuring computational accuracy. Summary of the Invention

[0006] To address the aforementioned shortcomings of existing technologies and solve the redundant computation problem in the SPH (Strain Profiling) method, this invention proposes a particle dormancy strategy based on background mesh partitioning for efficient solving of pollutant transport problems using the SPH method. This background mesh partitioning-based particle dormancy strategy, by introducing a particle dormancy mechanism and combining it with mesh classification, bitwise operation optimization, and a dynamic update mechanism, significantly improves the computational efficiency of SPH while maintaining computational accuracy. The technical solution of this invention is as follows:

[0007] A method for simulating SPH pollutant transport based on background grid partitioning and particle dormancy includes the following steps:

[0008] Step 1: Initialization of parallel computing parameters and particle information;

[0009] Step 2: Copy the data to be processed from the CPU to the GPU;

[0010] Step 3: Perform parallel computation of the SPH method, which includes the following sub-steps:

[0011] (1) Background mesh division: Determine the side length of the mesh based on the smooth length and the initial particle spacing, and divide the computational domain into a background mesh;

[0012] (2) Particle sorting: Calculate the grid where the particle is located based on the particle position information, sort the particles according to their spatial position, and ensure that adjacent particles are stored contiguously in memory;

[0013] (3) Background grid state update: Define whether the grid state is an effective grid or an invalid grid based on the pollutant concentration distribution of particles within the grid;

[0014] (4) Background Grid Classification: The grid is classified according to the grid state of the current grid and its neighboring grids. At the grid level, it is determined in advance whether particles need to search the current grid and whether they need to interact with particles in the current grid. The method is as follows: The grid is divided into three types: static grid, boundary grid and active grid. For static grid: If a grid and its neighboring grids are all invalid grids, it is considered that there are no pollutants in the area. During the calculation, no operation is needed on the particles in the grid, and the particles in the grid are put into dormancy. The grid is marked as a static grid. For boundary grid: If a grid is invalid, but its neighboring grids are valid grids, then the grid is a boundary grid. For boundary grids, attention needs to be paid to the valid grids adjacent to it. The particles contained in the boundary grid will only interact with the valid grids adjacent to it. For active grid: If a grid is a valid grid, then the grid is marked as an active grid.

[0015] (5) Particle search and computation: In the particle dormancy strategy based on background grid partitioning, different types of grids will adopt different processing strategies in the neighborhood search and interactive computation process;

[0016] (6) Dynamically update grid classification;

[0017] (7) The pollutant transport problem in each dimension is described by the corresponding convection-diffusion equation, and the diffusion is solved by particle interaction calculation;

[0018] (8) Particle position update;

[0019] (9) Boundary condition processing: Boundary conditions are corrected for particles near the boundary to ensure the consistency of the simulation physics;

[0020] (10) Repeat the iteration until the simulation end time is reached, then end the simulation;

[0021] Step 4: Copy the results data from the GPU back to the CPU and export it for subsequent analysis and visualization.

[0022] Furthermore, the method for step one is as follows:

[0023] (1) Input calculation parameters: including computational domain size, simulation time, diffusion coefficient, initial distribution of pollutants, boundary conditions and flow field distribution;

[0024] (2) Set particle spacing: Determine the particle spacing of the SPH method based on the size of the computational domain and the simulation time;

[0025] (3) Set the number of threads: The number of threads is uniformly set to the total number of particles;

[0026] (4) Initialize particle information: Calculate the initial particle concentration and velocity based on the initial distribution of pollutant concentration and boundary conditions;

[0027] Furthermore, in step three (3), the mesh state Act is divided into valid mesh Act = 1 and invalid mesh Act = 0, as defined below:

[0028] Effective grid: For grid i, if at least one particle has a pollutant concentration greater than or equal to a specific threshold C. threshold ;

[0029] Invalid grid: If the pollutant concentration of all particles (1,2,...,N) in grid i is less than a specific threshold C. threshold .

[0030] Furthermore, the method in step three (5) is as follows:

[0031] For particles in a stationary grid, skip all neighborhood searches and interactive computations for that particle; proceed directly to the position update stage.

[0032] For particles in active grids, neighborhood search and interactive computation are performed on all their neighboring grids according to the neighborhood search algorithm;

[0033] For particles in the boundary grid, it is only necessary to search and interact with particles in the adjacent active grids.

[0034] Furthermore, in step three (5), bitwise operation optimization technology is adopted: binary bits are used to represent active grids adjacent to the boundary grid, the interaction relationship between the grid to which the particle belongs and its adjacent effective grids is recorded and parsed, and neighborhood search and interaction calculation are only performed in the effective grids.

[0035] Furthermore, in step three (5), the bit operation optimization is as follows: binary bits are used to represent active grids adjacent to the boundary grid, and their neighbor information is stored; the neighbor information of each grid is encoded by binary numbers, and the state of its neighbor grids is represented by the position corresponding to the binary numbers; during the neighbor grid particle search, bit operations are used to parse the adjacent effective grids of the boundary grid using binary encoding during the calculation process, and all neighbor grids that need to be calculated are obtained by performing displacement and AND operations.

[0036] Furthermore, in step three (5), for the case where the state change is a boundary grid, the neighborhood grid relationship needs to be updated and the binary code updated in the next time step.

[0037] Furthermore, the method of step three (6) is as follows: during the simulation process, if the pollutant concentration of a certain grid changes, the corresponding calculation strategy update is triggered in the next time step: when changing from a static grid to an active grid, the calculation process of particles in that grid is reactivated; when changing from an active grid to a static grid, the calculation of particles in that grid is stopped and put into hibernation; for the case where the state changes to a boundary grid, its neighborhood grid relationship is recalculated in the next time step.

[0038] Furthermore, in step three (8): the position and velocity of the particle are updated according to the particle's velocity u, v and time step Δt to complete the simulation of the current time step.

[0039] The beneficial effects of this invention are as follows: This invention proposes an efficient SPH (Strain-Based Physics) pollutant transport simulation method based on background grid partitioning and particle dormancy. Utilizing the sparsity of pollutant distribution, a particle dormancy strategy is introduced, combined with grid classification, bitwise operation optimization, and a dynamic update mechanism. This efficient computational method can significantly reduce redundant calculations in pollutant transport problems and improve computational efficiency. In large-scale particle simulations, this method can efficiently utilize computational resources, not only reducing computation time but also maintaining computational accuracy, providing an effective solution for the efficient simulation of large-scale pollutant transport problems. Compared with existing technologies, this invention significantly improves the computational efficiency of solving pollutant transport problems while ensuring computational accuracy, especially when dealing with large-scale particle systems, demonstrating significant engineering application value and broad practical application prospects. Attached Figure Description

[0040] Figure 1 This is a flowchart of the present invention.

[0041] Figure 2 Schematic diagram of mesh generation (black represents static mesh, orange represents boundary mesh, blue represents active mesh, and blue particles indicate a concentration greater than 0).

[0042] Figure 3 Experimental results of the BPG-SPH method for a two-dimensional uniform flow Gaussian model.

[0043] Figure 4 Comparison chart of the results of the two-dimensional uniform flow Gaussian model at x=2000m at time 1500s. Detailed Implementation

[0044] This invention illustrates the specific solution process of the proposed method through a numerical example of a two-dimensional uniform flow Gaussian model transport problem. The problem can be described as follows: In a two-dimensional uniform flow field, the fluid maintains a constant velocity, and the pollutant initially exhibits a Gaussian concentration distribution. As the fluid undergoes convective motion, it diffuses. This physical problem can be transformed into solving a two-dimensional convection-diffusion equation, expressed as follows:

[0045]

[0046] Where C represents the pollutant concentration (the three coordinates are x, y, and t), x and y are the particle spatial coordinates, t is the time coordinate, and α and β are the diffusion coefficients (the rate of pollutant diffusion) in the x and y directions, respectively.

[0047] The specific parameters involved in this experimental model are: computational domain [0, 25m] × [0, 1m], initial pollutant concentration center point (x0, y0) = (5m, 0.5m), flow velocity u = 1m / s, v = 0m / s, δ x =δ y =0.168, diffusion coefficient α=β=0.001, grid number is 6000*200, initial particle distribution spacing Δx=Δy=0.005m, SPH smoothing length h=1.33, simulation time T=10s, time step Δt=0.002s.

[0048] The present invention will be further described in conjunction with the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined in this application.

[0049] This invention is achieved through the following technical solution, as shown in the flowchart. Figure 1 As shown, the specific steps of this invention are as follows:

[0050] Step 1: Data Initialization Before performing parallel computing, data initialization must be completed, which includes the initialization of parallel computing parameters and particle information.

[0051] 1. Set the specific parameters for solving the pollution transport problem: computational domain size [0,25m]×[0,1m], flow velocity u=1m / s, v=0m / s, diffusion coefficient α=β=0.001, SPH smoothing length h=1.33, simulation time T=10s, time step Δt=0.002s.

[0052] 2. Set particle spacing: Determine the initial particle distribution spacing Δx=Δy=0.005m for the SPH method based on the size of the computational domain. The number of particles ParticleNums=5000*200, for a total of 1,000,000.

[0053] 3. Set the number of threads: In this example, the number of threads, ThreadNums, is set to the total number of particles.

[0054] 4. Initialize particle information: The initial pollutant concentration follows a Gaussian distribution, with the initial pollutant concentration center point (x0, y0) = (5m, 0.5m), and the Gaussian distribution parameter δ. x =δ y =0.168.

[0055]

[0056] Step Two: Data Copying Since the CPU and GPU do not share memory, all necessary data must be copied from the CPU to the GPU before parallel computing begins. The specific steps are as follows:

[0057] 1. Allocate GPU memory: Use the CUDAMalloc() function to allocate memory space on the GPU to store data copied from the CPU.

[0058] 2. Data copy: Use the CUDAMemcpy() function to copy data from host memory (CPU side) to device memory (GPU side).

[0059] Step 3: After copying the data to the GPU for parallel computing, the parallel computing of the SPH method begins, which includes the following sub-steps:

[0060] 1. Divide the background grid: Set the side length of the square grid to twice the smooth length h multiplied by the initial particle distribution spacing Δx, specifically GridWidth = 2 * 1.33 * 0.005. After division, the number of grids in the x direction is XGridCount = 1882, the number of grids in the y direction is YGridCount = 78, for a total of 146,796 grids.

[0061] 2. Particle sorting: Calculate the grid where the particle is located based on the particle position information, and sort all particles according to their spatial position to ensure that adjacent particles are stored contiguously in memory.

[0062] 3. Background Grid State Update: The background grid can be considered as a collection of particle physics information, reflecting the commonalities shared by particles within the same grid. Based on this characteristic, this invention defines the grid state Act according to the pollutant concentration distribution of particles within the grid. The grid state Act is divided into effective grid Act = 1 and invalid grid Act = 0. Its specific definitions are as follows:

[0063] Effective grid: For grid i, if at least one particle has a pollutant concentration greater than or equal to a specific threshold C. threshold .

[0064] Invalid grid: If the pollutant concentration of all particles (1,2,...,N) in grid i is less than a specific threshold C. threshold .

[0065] 4. Background grid classification: such as Figure 2 As shown, the grid is further classified based on the grid state (Act) of the current grid and its neighboring grids, allowing for early determination at the grid level whether a particle needs to search the grid and whether it needs to interact with particles within the grid. This invention classifies grids into three types: static grids, boundary grids, and active grids.

[0066] a) Static Grid: If a grid and its neighboring grids are all invalid grids (Act=0), it means that there are no contaminants in this area. No operation is needed on the particles in this grid during the calculation, and the particles in this grid are put into a dormant state. This grid is marked as a static grid.

[0067] b) Boundary Grid: If a grid is invalid (Act = 0) but has neighboring valid grids (Act = 1), then that grid is a boundary grid. Boundary grids require attention to their adjacent valid grids; particles within a boundary grid will only interact with and compute on their adjacent valid grids.

[0068] c) Active grid: If a grid is a valid grid with Act = 1, then the grid is marked as an active grid.

[0069] 5. Particle Search and Computation: In the particle dormancy strategy based on background grid partitioning, different grid types will adopt different processing strategies during neighborhood search and interactive computation.

[0070] a) For particles in a stationary grid, the system skips all neighborhood searches and interaction calculations for that particle and proceeds directly to the position update phase. A stationary grid represents a region that does not participate in physical interactions; therefore, the particle's physical properties remain unchanged, and no calculations are required.

[0071] b) For particles in active grids, the system performs neighborhood search and interactive computation on all its neighboring grids according to the standard neighborhood search algorithm.

[0072] c) Particles in the boundary grid only need to perform search and interaction calculations with particles in specific neighboring grids. To further improve computational efficiency, this invention introduces bitwise operation optimization technology, using binary bits to represent active grids adjacent to the boundary grid. This can efficiently record and parse the interaction relationship between the grid to which a particle belongs and its adjacent valid grids, thus performing neighborhood search and interaction calculations only within valid grids.

[0073] Bitwise optimization refers to using binary bits to represent active grids adjacent to the boundary grid, thereby efficiently storing their neighbor information. Each grid's neighbor information is encoded using a binary number, and the state (valid or invalid) of its neighboring grids is represented by the corresponding position of the binary number. For example, in two-dimensional space, assume each grid has at most eight neighboring grids: left, right, top, bottom, and four diagonal directions (top left, top right, bottom left, bottom right). The state of each direction is represented by a binary bit: 1 indicates the presence of an active grid in that direction, and 0 indicates the absence of an active grid in that direction.

[0074] Suppose we have a boundary grid where only the top and top-right directions of its neighboring grids are active, while the other directions are static. Then, the neighbor information of this grid can be represented by the following binary number: 01100000, where each bit represents:

[0075] ■ The first one (the first one from left to right) indicates the neighboring grid in the top left direction: 0 (invalid grid).

[0076] ■ The second digit indicates the neighboring grid in the upper direction: 1 (invalid grid).

[0077] ■ The third digit indicates the neighboring grid in the upper right direction: 1 (valid grid).

[0078] ■ The fourth digit indicates the neighboring grid to the left: 0 (invalid grid).

[0079] ■ The fifth digit indicates the neighboring grid to the right: 0 (invalid grid).

[0080] ■ The sixth digit indicates the neighboring grid in the lower left direction: 0 (valid grid).

[0081] ■ The seventh bit indicates the neighboring grid in the downward direction: 0 (invalid grid).

[0082] ■ The eighth bit indicates the neighboring grid in the lower right direction: 0 (invalid grid).

[0083] During neighbor mesh particle search, bitwise operations can be used to quickly resolve the effective neighbor meshes of the boundary mesh during computation. The adjacency relationships of the boundary meshes are encoded using binary numbers. During computation, only simple bitwise AND operations are needed to quickly obtain all the neighbor meshes that need to be calculated. Assuming the current computation is for mesh (i,j), its neighbor mesh information is encoded as 01100000. Based on this binary number, we can obtain the following relationships of neighbor meshes that need to be calculated: meshes (i-1,j) and (i-1,j+1) are active (bit 1). Therefore, the system only needs to calculate the particle interactions between mesh (i,j) and its neighboring meshes (i-1,j) and (i-1,j+1).

[0084] Binary encoding enables rapid lookup of valid neighboring grids by compressing the interaction information between the grid and its neighboring grids. In one-dimensional space, only 2 bits are needed to represent the interaction relationship between adjacent grids; in two-dimensional space, 8 bits are sufficient to represent all possible adjacency relationships; and in three-dimensional space, 26 bits are enough to fully represent the interaction information between the grid and its adjacent active grids. This method not only improves computational efficiency but also significantly saves storage space by reducing storage requirements.

[0085] 6. Dynamic Mesh Classification Update: During the simulation, the contaminant concentration of particles may change. If the contaminant concentration of a certain mesh changes (e.g., from quiescent to active, or from active to boundary), the corresponding computational strategy update will be triggered in the next time step. When a mesh changes from quiescent to active, the computational flow of particles within that mesh will be reactivated; when a mesh changes from active to quiescent, the computation of particles within that mesh will be stopped and the mesh will be put into a dormant state. For cases where the state changes to a boundary mesh, its neighborhood mesh relationships must be recalculated and the binary encoding updated in the next time step.

[0086] 7. Particle interaction calculation to solve diffusion: Since the diffusion coefficients in the x and y directions are the same, the pollutant convection-diffusion reaction equation (1) can be discretized using the SPH method to obtain the following results.

[0087]

[0088] Wherein, W(x) i -x j The function h is called the smooth kernel function (hereinafter referred to as "kernel function"). Here, x is the gradient of the kernel function, D is the diffusion coefficient, and N is the total number of particles satisfying the neighborhood condition. The kernel function is typically a cubic spline function, denoted by R. i and x j The relative distance between them, R = |x i -x j | / h, then the kernel function W(x) i -x j The expression for h is:

[0089]

[0090] 8. Particle Position Update: Update the particle's position and velocity based on its velocity u, v and time step Δt to complete the simulation for the current time step. The specific formula is as follows:

[0091] x now =x + uΔt y now =y+vΔt (6)

[0092] Where x and y are the particle spatial coordinates, x now y now Spatial coordinates after particle position update

[0093] 9. Boundary Condition Processing: Boundary conditions are corrected for particles near the boundary. Based on this example, the pollutant concentration C of the boundary particles is set to 0. The specific formula is as follows:

[0094] C(x,0,t)=C(x,1,t)=C(0,y,t)=C(30,y,t)=0 (7)

[0095] Where C represents the pollutant concentration, and the three coordinates are, in order, the particle spatial coordinates in the x-direction, the particle spatial coordinates in the y-direction, and the time coordinate t.

[0096] 10. Repeated iteration: Repeat steps 2-9 of step 3 until the simulation end time is reached.

[0097] Step 4: Results Export After the simulation is complete, the results data need to be copied from the GPU to the CPU and exported for subsequent analysis and visualization.

[0098] 1. Data return: Use the CUDAMemcpy() function to copy data from the device memory to the host memory.

[0099] 2. Result Saving and Visualization: Save the results data to a local file and display them using Matlab or other visualization tools. Calculate the simulation error. The exact solution for this example is as follows:

[0100]

[0101] This embodiment simulates the experimental results of solving the convection-diffusion equation using the traditional SPH method and the SPH method based on the background grid partitioning particle dormancy strategy proposed in this invention, under the same parameters.

[0102] The initial distribution of pollutants and the concentration distribution of pollutants after 1500 s of fluid flow simulation using the SPH method with a particle dormancy strategy based on background grid partitioning are shown below. Figure 3 As shown, the results of the traditional SPH method and the SPH method based on the background mesh partitioning particle dormancy strategy proposed in this invention are compared at x = 2000m at time 1500s. The results are as follows. Figure 4 As shown.

[0103] The experimental results show that the traditional SPH method and the SPH method based on background mesh partitioning and particle dormancy strategy proposed in this invention obtain completely consistent numerical results when solving the two-dimensional uniform flow Gaussian model transport problem. Introducing the particle dormancy strategy based on background mesh partitioning did not lead to a decrease in accuracy.

[0104] On a GPU, the traditional SPH method was compared with the proposed SPH method based on a background mesh partitioning particle dormancy strategy, with parameter settings unchanged. The results show that, under the premise of completely consistent computational errors, the computation time was reduced from 93.776 s to 15.421 s, representing a 608.106% improvement in computational efficiency. This demonstrates that the SPH method based on a background mesh partitioning particle dormancy strategy, while maintaining computational accuracy, significantly reduces redundant computation by dynamically identifying and skipping computations in contaminant-free regions, thereby significantly improving computational efficiency and providing an efficient solution for simulating large-scale contaminant transport problems.

Claims

1. A method for simulating SPH pollutant transport based on background grid partitioning and particle dormancy, comprising the following steps: Step 1: Initialization of parallel computing parameters and particle information; Step 2: Copy the data to be processed from the CPU to the GPU; Step 3: Perform parallel computation of the SPH method, which includes the following sub-steps: (1) Background mesh division: Determine the side length of the mesh based on the smooth length and the initial particle spacing, and divide the computational domain into a background mesh; (2) Particle sorting: Calculate the grid where the particle is located based on the particle position information, sort the particles according to their spatial position, and ensure that adjacent particles are stored contiguously in memory; (3) Background grid state update: Define whether the grid state is an effective grid or an invalid grid based on the pollutant concentration distribution of particles within the grid; (4) Background mesh classification: The mesh is classified according to the mesh status of the current mesh and its neighboring meshes. At the mesh level, it is determined in advance whether the particles need to search the current mesh and whether they need to interact with the particles in the current mesh. The method is as follows: the mesh is divided into three types: static mesh, boundary mesh and active mesh. For static mesh: if a mesh and its neighboring meshes are all invalid meshes, it is considered that there are no pollutants in the area. During the calculation, the particles in the mesh do not need to be operated and the particles in the mesh are put into dormancy. The grid is marked as a stationary grid; for boundary grids: if a grid is invalid but has neighboring grids that are valid, then the grid is a boundary grid. For boundary grids, attention needs to be paid to the valid grids adjacent to it, and the particles contained therein will only interact with the valid grids adjacent to it; for active grids: if a grid is a valid grid, then the grid is marked as an active grid. (5) Particle search and computation: In the particle dormancy strategy based on background grid partitioning, different types of grids will adopt different processing strategies in the neighborhood search and interactive computation process; (6) Dynamically update grid classification; (7) The pollutant transport problem in each dimension is described by the corresponding convection-diffusion equation, and the diffusion is solved by particle interaction calculation; (8) Particle position update; (9) Boundary condition processing: Boundary conditions are corrected for particles near the boundary to ensure the consistency of the simulation physics; (10) Repeat the iteration until the simulation end time is reached, then end the simulation; Step 4: Copy the results data from the GPU back to the CPU and export it for subsequent analysis and visualization.

2. The SPH pollutant transport simulation method based on background grid partitioning and particle dormancy according to claim 1, characterized in that, The method for step one is as follows: (1) Input calculation parameters: including computational domain size, simulation time, diffusion coefficient, initial distribution of pollutants, boundary conditions and flow field distribution; (2) Set particle spacing: Determine the particle spacing of the SPH method based on the size of the computational domain and the simulation time; (3) Set the number of threads: The number of threads is uniformly set to the total number of particles; (4) Initialize particle information: Calculate the initial particle concentration and velocity based on the initial distribution of pollutant concentration and boundary conditions.

3. The SPH pollutant transport simulation method based on background grid partitioning and particle dormancy according to claim 1, characterized in that, In step three (3), the mesh state Act is divided into valid mesh Act = 1 and invalid mesh Act = 0, as defined below: Effective grid: For grid i, if at least one particle has a pollutant concentration greater than or equal to a specific threshold C. threshold ; Invalid grid: If the pollutant concentration of all particles (1,2,…,N) in grid i is less than a specific threshold C. threshold .

4. The SPH pollutant transport simulation method based on background grid partitioning and particle dormancy according to claim 1, characterized in that, Step 3 (5) is as follows: For particles in a stationary grid, skip all neighborhood searches and interactive computations for that particle; proceed directly to the position update stage. For particles in active grids, neighborhood search and interactive computation are performed on all their neighboring grids according to the neighborhood search algorithm; For particles in the boundary grid, it is only necessary to search and interact with particles in the adjacent active grids.

5. The SPH pollutant transport simulation method based on background grid partitioning and particle dormancy according to claim 4, characterized in that, In step 3(5), bitwise operation optimization technique is used: binary bits are used to represent active grids adjacent to the boundary grid, the interaction relationship between the grid to which the particle belongs and its adjacent effective grids is recorded and parsed, and neighborhood search and interaction calculation are performed only in the effective grids.

6. The SPH pollutant transport simulation method based on background grid partitioning and particle dormancy according to claim 5, characterized in that, In step three (5), the bit operation optimization is as follows: binary bits are used to represent active grids adjacent to the boundary grid and their neighbor information is stored; the neighbor information of each grid is encoded by binary numbers, and the state of its neighbor grids is represented by the position corresponding to the binary numbers; during the neighbor grid particle search, bit operations are used to parse the adjacent effective grids of the boundary grid using binary encoding during the calculation process, and all neighbor grids that need to be calculated are obtained by performing displacement and AND operations.

7. The SPH pollutant transport simulation method based on background grid partitioning and particle dormancy according to claim 5, characterized in that, In step 3(5), for the case where the state change is a boundary grid, the neighborhood grid relationship needs to be updated and the binary code updated in the next time step.

8. The SPH pollutant transport simulation method based on background grid partitioning and particle dormancy according to claim 1, characterized in that, The method of step three (6) is as follows: During the simulation, if the pollutant concentration of a certain grid changes, the corresponding calculation strategy update is triggered in the next time step: when changing from a static grid to an active grid, the calculation process of particles in that grid is reactivated; when changing from an active grid to a static grid, the calculation of particles in that grid is stopped and put into hibernation. For cases where the state change is a boundary grid, the neighborhood grid relationship is recalculated in the next time step.

9. The SPH pollutant transport simulation method based on background grid partitioning and particle dormancy according to claim 1, characterized in that, In step 3(8): the position and velocity of the particle are updated according to the particle's velocity u, v and time step Δt to complete the simulation of the current time step.

Citation Information

Patent Citations

  • Micro fossil CT image analysis and classification method and device based on deep learning

    CN115546134A

Cited By

  • High-intensity earthquake area side slope catastrophe chain generation evolution simulation method

    CN122021221A