A spatially adaptive fluid simulation method based on smoothed particle hydrodynamics
By converting the boundary solid into an SDF model and combining the level set method and wake protection mechanism, the resolution of fluid particles is adaptively detected and refined, which solves the problems of low computational efficiency and insufficient simulation accuracy in the smooth particle hydrodynamics method and achieves more efficient fluid simulation results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- UNIV OF SCI & TECH BEIJING
- Filing Date
- 2022-09-13
- Publication Date
- 2026-06-02
Smart Images

Figure CN115630586B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fluid simulation technology, and in particular to a spatial adaptive fluid simulation method based on Smoothed Particle Hydrodynamics (SPH). Background Technology
[0002] Currently, fluid simulation is widely used in scientific research and engineering across various fields. However, due to limitations in hardware and simulation algorithms, as well as the increasing size and complexity of fluid simulation environments, there remains a need to improve the accuracy and efficiency of fluid simulation. Traditional fluid simulations typically use fluid cells with uniform resolution, which often leads to wasted computational resources in relatively stable fluid regions rather than regions with richer and more complex fluid behavior. How to detect important regions in fluid simulation and perform adaptive multi-resolution simulations to save computational resources, thereby improving simulation efficiency and local simulation detail, is an important problem in computer graphics research.
[0003] Fluid simulation typically employs either meshed or meshless methods. Meshable adaptive methods include various approaches such as octrees and tetrahedral meshes. However, for meshless SPH (Self-Protection Physics) methods, earlier adaptive approaches could only apply predefined particle refinement patterns within a fixed refinement region defined by the user in the scene. This meant selecting specific particle sizes for fluid particles within a given spatial location based on its refinement requirements. If particle resolution conversion was needed, the original particles could be immediately replaced with particles of different resolutions, or a temporal blending scheme could be used to retain the influence of the original particles for a certain period. Alternatively, a multi-level resolution scheme could be used, adding higher-level single-resolution particle sets to areas requiring higher resolution, generating new fine particles within the resolution conversion boundary region. The properties of these fine particles within the boundary were calculated by interpolation from coarse particles until they penetrated into the high-resolution region. Particle coarsening often relied on random deletion to maintain a certain balance. These methods often resulted in quality loss or allowed only very limited adaptability.
[0004] For adaptive refinement region detection in the SPH method, previous approaches typically employed surface-based refinement strategies. This involves identifying fluid-free surfaces more likely to generate rich fluid phenomena, determining these surfaces using level set methods, and refining fluid particles only above a certain depth. However, rich fluid behavior extends beyond the fluid surface; the coupling between boundary solid objects and the fluid below the surface also impacts overall simulation quality. Therefore, surface-based refinement strategies often suffer from inflexible intervention mechanisms, leading to low computational efficiency in certain situations and failing to enhance the simulation accuracy of specific dynamic regions. Summary of the Invention
[0005] This invention provides a spatial adaptive fluid simulation method based on smooth particle hydrodynamics to solve the technical problems of low computational efficiency and inability to enhance the simulation accuracy of specific dynamic regions in existing technologies.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:
[0007] On the one hand, this invention provides a space-adaptive fluid simulation method based on smooth particle hydrodynamics, which optimizes the detection of key regions in the simulation scene, can capture regions with richer fluid-structure interaction in space, and refines the resolution of fluid particles in these regions. The method includes the following steps:
[0008] The 3D model of the boundary solid object in the fluid simulation scene is converted into an SDF (Signed Distance Field) model, and the gradient field of the SDF model is obtained.
[0009] Add a set of fluid particles to the simulation scene and import the SDF model and its gradient field into the simulation scene;
[0010] In a single simulation time step, the distance from fluid particles to the solid surface is estimated using the level set method, and the particle size function value is calculated by combining the SDF value at the particle. At the same time, a wake protection mechanism is applied to delay the decay of the fine particle size function value near the boundary solid.
[0011] In a single simulation time step, the optimal particle size is calculated based on the calculated particle size function value and the preset adaptive ratio. The calculated optimal particle size is compared with the current particle size. Based on the comparison results, the particles are classified, and the particle size is adjusted according to the particle category.
[0012] Within a single simulation time step, dynamic calculations are performed on fluid particles based on smooth particle hydrodynamics, while simultaneously handling the coupling between fluid particles and boundary solids. A time mixing scheme is used to stabilize the numerical field, update the physical properties of the particles and the physical properties of the boundary solids, and complete the simulation within the current time step.
[0013] Furthermore, the SDF model evaluates the distance from a location in space to the solid surface and uses a sign to indicate whether each location is inside or outside the solid; where a positive sign indicates that the corresponding location is outside the solid, and a negative sign indicates that the corresponding location is inside the solid.
[0014] Furthermore, the fluid particles carry preset material properties, which include one or more combinations of position, mass, density, velocity, and pressure.
[0015] Furthermore, the method of estimating the distance from the fluid particle to the solid surface using the level set method, and combining this with the SDF value at the particle to calculate the particle's scale function value, while applying a wake protection mechanism to delay the decay of the fine particle scale function value near the boundary solid, includes:
[0016] Using the level set method, an initial level set estimate is calculated for all particles, serving as the initial level set value for each particle. The level set values are iteratively propagated from particles near the surface outwards to other particles in the neighborhood until the level set values of all particles remain unchanged. A level set value is then saved for particle i.
[0017] For the boundary solid b in the simulation scenario * Extract the SDF value at the particle's location, considering the preset optimal refinement range. The solid-state size function value of particle i is calculated using the following formula.
[0018]
[0019] in, The SDF value at the location of particle i;
[0020] Applying a wake protection mechanism, the following process is executed iteratively: For particles that have just entered a certain range around the selected solid, a merging delay is set. For particles with τ>0, the decay of their solid scale function value is stopped, and the current solid scale function value that has stopped decaying is propagated to the entire particle set to smooth the numerical field of the solid scale function; until the numerical field of this solid scale function no longer changes.
[0021] The scale function value φ of particle i is calculated using the following formula. i:
[0022]
[0023] in, Represented as a specific solid b * The maximum merging delay of surrounding fluid particles.
[0024] Further, the step of calculating the optimal particle size based on the calculated particle size function value and a preset adaptive ratio, comparing the calculated optimal particle size with the current particle size, classifying the particles based on the comparison result, and adjusting the particle size according to the particle category includes:
[0025] Based on the calculated particle scale function value and the preset adaptive ratio, the optimal particle mass is calculated using the following formula via linear interpolation.
[0026]
[0027] Where, m base Let α represent the mass of the lowest resolution particle, and α represent the preset adaptive ratio, i.e., for the highest resolution particle mass m. fine Satisfy m fine =αm base φ max This represents the maximum scale function value used to limit the refinement range;
[0028] Based on the calculated optimal particle mass, for a mass of m i Calculate the relative mass of particle i. Particles are classified according to their relative mass:
[0029]
[0030] Among them, C i The classification results of the particles are represented by S, s, o, l, and L, which represent different particle categories, respectively.
[0031] Based on particle classification, different particles are subjected to splitting, merging, or mass sharing to adjust their scale.
[0032] Furthermore, the particle-based classification, which applies splitting, merging, or mass-sharing adjustments to the scale of different particles, includes:
[0033] Distributing all the mass of an S-type particle to surrounding S-type or S-type particles, and then removing the S-type particles that have distributed the mass to other particles from the particle set, follows the momentum conservation condition. The particles that receive the mass will gain momentum corresponding to the received mass. Similarly, distributing a portion of the mass of an l-type particle to surrounding S-type or S-type particles will also result in the particles that receive the mass gaining momentum corresponding to the received mass.
[0034] The L-type particles are equally split into several particles with masses close to m. opt The L-type particles that will be split are then removed from the particle set. Following the conditions of mass conservation and momentum conservation, the split particles will inherit the velocity and other properties of the original particles used to solve the fluid dynamics equations. The position distribution of the split particles will be optimized to reduce the instability caused by the change in particle spatial distribution due to the addition of new particles to the simulation.
[0035] Furthermore, the method based on smooth particle hydrodynamics performs dynamic calculations on fluid particles, simultaneously handles the coupling between fluid particles and boundary solids, stabilizes the numerical field using a time-mixing scheme, and updates the physical properties of the particles and the boundary solids, including:
[0036] Other fluid particles around the sampled fluid particle are used to derive an approximate planar boundary at the particle position based on the directed distance field of the boundary solid. The numerical contribution of the planar boundary is calculated. Based on smooth particle dynamics, dynamic calculations are performed on the fluid particle to calculate the density of the fluid particle.
[0037] Based on smooth particle fluid dynamics, the compressibility of the fluid field under the action of gravity, viscous force and surface tension is calculated according to the Navier-Stokes equations. The pressure is solved by implicit iteration based on density invariance and divergence-free conditions, so that the fluid maintains volume incompressibility.
[0038] The velocity and position of fluid particles are updated by applying Newton's second law and the time integration method.
[0039] Furthermore, in the process of performing dynamic calculations on fluid particles based on smooth particle fluid dynamics, simultaneously handling the coupling between fluid particles and boundary solids, stabilizing the numerical field using a time-mixing scheme, and updating the physical properties of particles and boundary solids, a time-mixing mechanism is applied. This time-mixing mechanism saves the position of the original particles deleted from the simulation for a period of time after the fluid particles split and merge. Based on the saved position and the fluid particles that receive their mass, the density and velocity of the corresponding original particles are estimated. The estimated density and velocity are then mixed into the corresponding calculation results of the child particles that receive their mass. This allows these child particles to maintain their behavior to some extent before the split or merge, thereby stabilizing the numerical field around them and improving the stability of the simulation.
[0040] The time-mixing process for density is described as follows:
[0041]
[0042] Where, ρ o ρ represents the density calculated from the original particle. i The density is calculated from the mass of the particle that received the original particle. β represents the density of particle i after time mixing, and β represents the preset time mixing weight. The value of β will gradually decrease to 0 as the simulation time step increases.
[0043] The time-mixing process of particle velocities is described as follows:
[0044]
[0045] Among them, v o v represents the calculated velocity of the original particle. i The velocity of the particle, calculated from the mass of the original particle, represents the velocity of the particle. This represents the velocity of particle i after time mixing.
[0046] In another aspect, the present invention also provides an electronic device comprising a processor and a memory; wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the above-described method.
[0047] In another aspect, the present invention also provides a computer-readable storage medium storing at least one instruction that is loaded and executed by a processor to implement the above-described method.
[0048] The beneficial effects of the technical solution provided by this invention include at least the following:
[0049] 1. Most existing fluid simulation techniques based on smooth particle fluid dynamics adopt uniform resolution, resulting in low computational resource utilization efficiency. However, the particle fluid spatial adaptive simulation technique proposed in this invention can adaptively detect important regions in space and use fine particles of continuous scale within a certain spatial range around them to improve the fluid simulation quality within the region, save a lot of computational resources, and maintain high simulation quality.
[0050] 2. This invention achieves the detection of the region near the solid based on the solid representation of the directed distance field, accurately capturing the region where the fluid interacts with multiple dynamic boundary solid objects. The quality of fluid-structure interaction in this region is effectively improved by particle refinement, and the wake protection mechanism is used to expand the region, so as to maintain the simulation accuracy of the region where fluid-structure interaction occurs for a longer period of time. Attached Figure Description
[0051] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0052] Figure 1 This is a schematic diagram of the execution flow of the space adaptive fluid simulation method based on smooth particle hydrodynamics provided in the embodiments of the present invention;
[0053] Figure 2 These are comparison diagrams of the simulation effects of the present invention and the prior art in the scenario of a ship sailing across the water; where (a) is a uniform high-resolution simulation effect diagram, (b) is a uniform low-resolution simulation effect diagram, (c) is a simulation effect diagram using the spatial adaptive method of surface refinement, and (d) is a simulation effect diagram using the spatial adaptive method of boundary refinement.
[0054] Figure 3 These are simulation comparison diagrams of the present invention and the prior art under the scenario of propeller stirring water; wherein, (a) is a uniform high-resolution simulation effect diagram, (b) is a simulation effect diagram combining the boundary refinement mechanism and surface refinement mechanism of the present invention, and (c) is a simulation diagram using only the surface refinement mechanism. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0056] First Embodiment
[0057] To improve the efficiency and quality of fluid simulation, this embodiment provides a space-adaptive fluid simulation method based on smooth particle hydrodynamics. This method optimizes the detection of key regions in the simulation scene, enabling it to capture regions with richer fluid-structure interaction behavior in space. It also refines the resolution of fluid particles in these regions, achieving higher-precision simulations with limited computational resources. Compared to existing models, it has lower computational and storage requirements and greater flexibility, meeting the efficiency and accuracy requirements of fluid simulation in complex physical environments. The execution flow of this method is as follows: Figure 1 As shown, it includes the following steps:
[0058] S1, convert the 3D model of the boundary solid object in the fluid simulation scene into an SDF (Signed Distance Field) model, and obtain the gradient field of the SDF model;
[0059] The SDF model evaluates the distance from a location in space to the solid surface and uses a sign to indicate whether each location is inside or outside the solid. A positive sign indicates that the corresponding location is outside the solid, and a negative sign indicates that the corresponding location is inside the solid, thus representing the entire solid.
[0060] S2, add a set of fluid particles to the simulation scene and import the SDF model and its gradient field into the simulation scene;
[0061] Fluid particles carry physical properties such as position, mass, density, velocity, and pressure.
[0062] S3 estimates the distance from fluid particles to the solid surface using the level set method, and calculates the particle scale function value by combining it with the SDF value at the particle. At the same time, a wake protection mechanism is applied to delay the decay of the fine particle scale function value near the boundary solid, thereby maintaining the resolution.
[0063] Specifically, in this embodiment, S3 includes the following steps:
[0064] Using the level set method, an initial level set estimate is calculated for all particles, serving as the initial level set value for each particle. The level set values are iteratively propagated from particles near the surface outwards to other particles in the neighborhood until the level set values of all particles remain unchanged. A level set value is then saved for particle i.
[0065] For the boundary solid b in the simulation scenario * Extract the SDF value at the particle's location, considering the preset optimal refinement range. The solid-state size function value of particle i is calculated using the following formula.
[0066]
[0067] in, The SDF value at the location of particle i;
[0068] A wake protection mechanism is applied, which sets a merging delay for particles that have just entered a certain range around a specific solid. For particles with τ>0, the decay of their solid scale function value is stopped to avoid the loss of wake effect caused by rapid merging of particles after leaving the solid. This value is then propagated to the entire particle set to smooth the numerical field of the solid scale function. This process is iterated until the numerical field does not change.
[0069] The solid-state scale function can be combined with the level set method. If combined with the level set function used for surface detection, the maximum value of the two is selected to ensure finer refinement, thereby determining the scale function value φ of particle i. i for:
[0070]
[0071] in, Represented as a specific solid b * The maximum merging delay of surrounding fluid particles.
[0072] Through the above analysis of level set values and solid scale function value Take the maximum value as the actual scale function value φ of the particle. i This is to ensure the highest resolution detail.
[0073] S4. Calculate the optimal particle size based on the calculated particle size function value and the preset adaptive ratio. Compare the calculated optimal particle size with the current particle size. Classify the particles based on the comparison results. Apply splitting, merging, or mass sharing to different categories of particles according to their categories, thereby adjusting the particle size.
[0074] Specifically, in this embodiment, S4 includes the following steps:
[0075] Based on the calculated particle scale function value and the preset adaptive ratio, the optimal particle mass is calculated using the following formula via linear interpolation.
[0076]
[0077] Where, m base Let α represent the mass of the lowest resolution particle, and α represent the preset adaptive ratio, i.e., for the highest resolution particle mass m. fine Satisfy m fine =αm base φ max This represents the maximum scale function value used to limit the refinement range;
[0078] Based on the calculated optimal particle mass, for a mass of m i Calculate the relative mass of particle i. Particles are classified according to their relative mass:
[0079]
[0080] Among them, C i The classification results of the particles are represented by S, s, o, l, and L, which represent different particle categories, respectively.
[0081] Based on particle classification, all the mass of an S-class particle is distributed to surrounding S-class or S-class particles, and the original particle is then removed from the simulated particle set. Following the momentum conservation condition, the particle receiving the mass will gain momentum corresponding to the received mass. Similarly, a portion of the mass of an L-class particle is distributed to surrounding S-class or S-class particles; the particle receiving the mass will also gain momentum corresponding to the received mass. Finally, L-class particles are equally split into several particles with masses close to m. opt The original particle is then removed from the simulated particle set. Following the conditions of mass and momentum conservation, the refined particles that split off will inherit the velocity and other properties of the original particle used to solve the fluid dynamics equations. The pre-computed split template is then applied to optimize the position distribution of the refined particles, thereby reducing the instability caused by the change in particle spatial distribution due to the addition of new particles to the simulation.
[0082] S5, based on smooth particle fluid dynamics, performs dynamic calculations on fluid particles, while handling the coupling between fluid particles and boundary solids. It uses a time mixing scheme to stabilize the numerical field, updates the physical properties of the particles and the physical properties of the boundary solids, and completes the simulation within the current time step.
[0083] Specifically, in this embodiment, S5 includes the following steps:
[0084] Other fluid particles around the sampled fluid particle are used to derive an approximate planar boundary at the particle position based on the directed distance field of the boundary solid. The numerical contribution of the planar boundary is calculated. Based on smooth particle dynamics, the fluid particle is dynamically calculated by combining the two to calculate the density of the fluid particle.
[0085] Based on smooth particle fluid dynamics, the compressibility of the fluid field under the action of gravity, viscous force and surface tension is calculated according to the Navier-Stokes equations. The pressure is solved by implicit iteration based on density invariance and divergence-free conditions, so that the fluid maintains volume incompressibility.
[0086] The velocity and position of fluid particles are updated by applying Newton's second law and the time integration method.
[0087] In the above process, a time mixing mechanism is applied. The time mixing mechanism preserves the position of the original particle deleted from the simulation for a period of time after the fluid particle splits and merges. Based on the position and the fluid particle that receives its mass, the density and velocity of the original particle are estimated. The density and velocity are then mixed into the corresponding calculation results of the child particles that receive its mass. This allows these child particles to maintain their behavior to some extent before the split or merge, thereby stabilizing the numerical field around them and improving the stability of the simulation.
[0088] The time-mixing process of density can be described as follows:
[0089]
[0090] Where, ρ o The density ρ is calculated for the original particle. i The density calculated for a particle receiving the mass of the original particle. β is the density of particle i after time mixing, which will be used to calculate other physical properties. β is the preset time mixing weight, which will gradually decrease to 0 as the simulation time step increases.
[0091] Similarly, the time mixing process of particle velocities can be described as:
[0092]
[0093] Among them, v o v represents the calculated velocity of the original particle. i The velocity of the particle, calculated from the mass of the original particle, represents the velocity of the particle. This represents the velocity of particle i after time mixing.
[0094] Iteratively execute S3 to S5 until the preset simulation termination condition is met, thus completing the entire simulation process.
[0095] The following section evaluates the simulation effect of the present invention compared to existing technologies using a scenario of a small boat gliding across the water. In this scenario, the small boat couples with the water, and the large amount of water splashed up and the wake generated behind the boat are important fluid phenomena in the simulation.
[0096] Figure 2 The simulation results of existing methods using uniform resolution are presented, by... Figure 2 As can be seen in (b), the uniform low-resolution simulation cannot observe the formed splashes and wakes, indicating a relatively low simulation quality; Figure 2 As can be seen in (a), although uniform high-resolution simulation can achieve high-quality simulation of the scene, a large amount of computing resources are wasted in the area below the water surface because the number of particles increases exponentially with the particle size. Figure 2 Figures (c) and (d) show the simulation results using spatially adaptive methods for surface refinement and boundary refinement, respectively. Both schemes use the same base particle scale as the uniform low-resolution simulation and the same finest particle scale as the uniform high-resolution simulation. A wake-holding mechanism is applied to the boundary refinement scheme to improve quality. Both simulation schemes produce simulation quality similar to the uniform high-resolution simulation with a significantly fewer particle count than the high-resolution simulation. Figure 2(c) indicates that the present invention achieves refinement around the boundary of the boat object through a boundary refinement mechanism without affecting other surface areas; in contrast, Figure 2 (d) indicates that surface refinement incurs some resource waste due to simulating high-resolution fluid-stable surfaces, and particles below the fluid surface and in contact with boundary objects are not sufficiently refined. The comparison demonstrates that the boundary refinement mechanism of this invention can further reduce the computational resources required for spatial adaptive simulation and improve the simulation quality of fluid-structure interaction occurring below the fluid surface.
[0097] As can be seen from the above, the spatial adaptive simulation method of the present invention can improve the simulation efficiency. At the same time, compared with the surface refinement mechanism, the boundary refinement mechanism of the present invention can more accurately capture the region where the fluid phenomenon is more intense, thereby reducing the computational resources consumed on the stable surface.
[0098] Furthermore, the simulation effect of the present invention and the prior art is evaluated using a scenario where a propeller agitates water. Figure 3 The image shows a cross-sectional view of the scene, in which turbulence on the water surface caused by the propeller is a key phenomenon in the simulation.
[0099] Figure 3 (a) in the figure represents a uniform high-resolution simulation effect, which produces good quality but consumes a large amount of computational resources. Figure 3 (b) shows the simulation effect of combining the boundary refinement mechanism and surface refinement mechanism of the present invention, compared to... Figure 3 The simulation shown in (c) uses only the surface refinement mechanism. The simulation scheme that combines boundary refinement and surface refinement produces turbulence effects that are closer to those of high-resolution simulations.
[0100] As can be seen from the above, the boundary refinement mechanism of the present invention can significantly improve the simulation quality of fluid-structure interaction occurring below the fluid surface. The good combination with the surface refinement mechanism further demonstrates the flexibility that the boundary refinement mechanism of the present invention provides for formulating refined region detection strategies.
[0101] In summary, this embodiment proposes a novel spatial adaptive simulation method with boundary refinement capabilities for SPH fluid simulation. This method uses a directed distance field model to represent solid boundary objects in the simulation scene, thereby adaptively detecting fluid-structure interaction regions. A set of particles with physical properties is imported into the simulation scene to represent the fluid. Based on this directed distance field, a computational scale function is calculated. The distance between fluid particles and boundary objects is calculated using the directed distance field to evaluate the optimal resolution of the particles. The optimal resolution of the particles reaches its highest value within a specific distance from the boundary object and smoothly decreases with increasing distance until it reaches a basic resolution. Subsequently, the actual resolution of the particles is adjusted to the optimal resolution through particle splitting, merging, and mass redistribution. Simultaneously, a wake protection mechanism is applied to lock the resolution of particles for a period of time after they move near the solid boundary object to prevent the loss of flow details. Finally, a smoothed particle fluid dynamics method is used to calculate various physical properties of the fluid particles to simulate particle motion. This achieves greater and continuous adaptability, and further reduces time consumption through more flexible and efficient adaptive detection of refined regions, producing more refined simulation results.
[0102] Second Embodiment
[0103] This embodiment provides an electronic device, which includes a processor and a memory; wherein the memory stores at least one instruction, which is loaded and executed by the processor to implement the method of the first embodiment.
[0104] The electronic device can vary considerably depending on its configuration or performance, and may include one or more processors (central processing units, CPUs) and one or more memories, wherein the memories store at least one instruction that is loaded by the processor and executed in accordance with the above method.
[0105] Third Embodiment
[0106] This embodiment provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to implement the method of the first embodiment described above. The computer-readable storage medium may be a ROM, random access memory, CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc. The instruction stored therein can be loaded and executed by a processor in a terminal.
[0107] Furthermore, it should be noted that the present invention can be provided as a method, apparatus, or computer program product. Therefore, embodiments of the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0108] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0109] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The functions specified in one or more boxes. These computer program instructions may also be loaded onto a computer or other programmable data processing terminal equipment to cause a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0110] It should also be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0111] Finally, it should be noted that the above description represents a preferred embodiment of the present invention. It should be pointed out that although preferred embodiments have been described, those skilled in the art, once they understand the basic inventive concept of the present invention, can make various improvements and modifications without departing from the principles described herein. These improvements and modifications should also be considered within the scope of protection of the present invention. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.
Claims
1. A space-adaptive fluid simulation method based on smooth particle hydrodynamics, characterized in that, The space adaptive fluid simulation method based on smooth particle hydrodynamics includes: The 3D model of the boundary solid object in the fluid simulation scene is converted into an SDF (Signed Distance Field) model, and the gradient field of the SDF model is obtained. Add a set of fluid particles to the simulation scene and import the SDF model and its gradient field into the simulation scene; In a single simulation time step, the distance from fluid particles to the solid surface is estimated using the level set method, and the particle size function value is calculated by combining the SDF value at the particle. At the same time, a wake protection mechanism is applied to delay the decay of the fine particle size function value near the boundary solid. In a single simulation time step, the optimal particle size is calculated based on the calculated particle size function value and the preset adaptive ratio. The calculated optimal particle size is compared with the current particle size. Based on the comparison results, the particles are classified, and the particle size is adjusted according to the particle category. Within a single simulation time step, dynamic calculations are performed on fluid particles based on smooth particle hydrodynamics, while simultaneously handling the coupling between fluid particles and boundary solids. A time mixing scheme is used to stabilize the numerical field, update the physical properties of the particles and the physical properties of the boundary solids, and complete the simulation within the current time step.
2. The space adaptive fluid simulation method based on smooth particle hydrodynamics as described in claim 1, characterized in that, The SDF model evaluates the distance from a location in space to a solid surface and uses a sign to indicate whether each location is inside or outside the solid; where a positive sign indicates that the corresponding location is outside the solid, and a negative sign indicates that the corresponding location is inside the solid.
3. The space adaptive fluid simulation method based on smooth particle hydrodynamics as described in claim 1, characterized in that, The fluid particles carry preset physical properties, which include one or more combinations of position, mass, density, velocity, and pressure.
4. The space adaptive fluid simulation method based on smooth particle hydrodynamics as described in claim 1, characterized in that, The method of estimating the distance from fluid particles to the solid surface using the level set method, and combining this with the SDF value at the particle location to calculate the particle's scale function value, while applying a wake protection mechanism to delay the decay of the fine particle scale function value near the boundary solid, includes: Using the level set method, an initial level set estimate is calculated for all particles, serving as the initial level set value for each particle. The level set values are iteratively propagated from particles near the surface outwards to other particles in the neighborhood until the level set values of all particles remain unchanged. A level set value is then saved for particle i. For the boundary solid b in the simulation scenario * Extract the SDF value at the particle's location, considering the preset optimal refinement range. The solid-state size function value of particle i is calculated using the following formula. in, The SDF value at the location of particle i; Applying a wake protection mechanism, the following process is executed iteratively: For particles that have just entered a certain range around the selected solid, a merging delay is set. For particles with τ>0, the decay of their solid scale function value is stopped, and the current solid scale function value that has stopped decaying is propagated to the entire particle set to smooth the numerical field of the solid scale function; until the numerical field of this solid scale function no longer changes. The scale function value of particle i is calculated using the following formula. Φ i : in, Represented as a specific solid b * The maximum merging delay of surrounding fluid particles.
5. The space adaptive fluid simulation method based on smooth particle hydrodynamics as described in claim 4, characterized in that, The process of calculating the optimal particle size based on the calculated particle size function value and a preset adaptive ratio, comparing the calculated optimal particle size with the current particle size, classifying particles based on the comparison result, and adjusting the particle size according to the particle category includes: Based on the calculated particle scale function value and the preset adaptive ratio, the optimal particle mass is calculated using the following formula via linear interpolation. Where, m base Let α represent the mass of the lowest resolution particle, and α represent the preset adaptive ratio, i.e., for the highest resolution particle mass m. fine Satisfy m fine =αm base , Φ max This represents the maximum scaling function value used to define the refinement range; Based on the calculated optimal particle mass, for a mass of m i Calculate the relative mass of particle i. Particles are classified according to their relative mass: Among them, C i The classification results of the particles are represented by S, s, o, l, and L, which represent different particle categories, respectively. Based on particle classification, different particles are subjected to splitting, merging, or mass sharing to adjust their scale.
6. The space adaptive fluid simulation method based on smooth particle hydrodynamics as described in claim 5, characterized in that, The particle-based classification, which applies splitting, merging, or mass-sharing adjustments to the scale of different particles, includes: Distributing all the mass of an S-type particle to surrounding S-type or S-type particles, and then removing the S-type particles that have distributed the mass to other particles from the particle set, follows the momentum conservation condition. The particles that receive the mass will gain momentum corresponding to the received mass. Similarly, distributing a portion of the mass of an l-type particle to surrounding S-type or S-type particles will also result in the particles that receive the mass gaining momentum corresponding to the received mass. The L-type particles are equally split into several particles with masses close to m. opt The L-type particles that will be split are then removed from the particle set. Following the conditions of mass conservation and momentum conservation, the split particles will inherit the velocity and other properties of the original particles used to solve the fluid dynamics equations. The position distribution of the split particles will be optimized to reduce the instability caused by the change in particle spatial distribution due to the addition of new particles to the simulation.
7. The space adaptive fluid simulation method based on smooth particle hydrodynamics as described in claim 1, characterized in that, The method, based on smooth particle fluid dynamics, performs dynamic calculations on fluid particles while simultaneously handling the coupling between fluid particles and boundary solids. It uses a time-mixing scheme to stabilize the numerical field and updates the physical properties of both the particles and the boundary solids. This includes: Other fluid particles around the sampled fluid particle are used to derive an approximate planar boundary at the particle position based on the directed distance field of the boundary solid. The numerical contribution of the planar boundary is calculated. Based on smooth particle dynamics, dynamic calculations are performed on the fluid particle to calculate the density of the fluid particle. Based on smooth particle fluid dynamics, the compressibility of the fluid field under the action of gravity, viscous force and surface tension is calculated according to the Navier-Stokes equations. The pressure is solved by implicit iteration based on density invariance and divergence-free conditions, so that the fluid maintains volume incompressibility. The velocity and position of fluid particles are updated by applying Newton's second law and the time integration method.
8. The space adaptive fluid simulation method based on smooth particle hydrodynamics as described in claim 7, characterized in that, In the process of performing dynamic calculations on fluid particles based on smooth particle fluid dynamics, while handling the coupling between fluid particles and boundary solids, stabilizing the numerical field using a time-mixing scheme, and updating the physical properties of particles and boundary solids, a time-mixing mechanism is applied. This time-mixing mechanism saves the position of the original particles deleted from the simulation for a period of time after the fluid particles split and merge. Based on the saved position and the fluid particles that receive their mass, the density and velocity of the corresponding original particles are estimated. The estimated density and velocity are then mixed into the corresponding calculation results of the child particles that receive their mass. This allows these child particles to maintain their behavior to some extent before the split or merge, thereby stabilizing the numerical field around them and improving the stability of the simulation. The time-mixing process for density is described as follows: Where, ρ o ρ represents the density calculated from the original particle. i The density is calculated from the mass of the particle that received the original particle. β represents the density of particle i after time mixing, and β represents the preset time mixing weight. The value of β will gradually decrease to 0 as the simulation time step increases. The time-mixing process of particle velocities is described as follows: Among them, v o v represents the calculated velocity of the original particle. i The velocity of the particle, calculated from the mass of the original particle, represents the velocity of the particle. This represents the velocity of particle i after time mixing.