A real-time gas-liquid coupling simulation method and device

Through real-time gas-liquid coupling simulation method, particle dynamics and GPU parallel computing are used to solve the efficiency and authenticity problems of gas-liquid coupling simulation in the existing technology, and efficient and real gas-liquid coupling simulation is achieved, which is suitable for multiple fields. Application.

CN118013809BActive Publication Date: 2024-11-19UNIV OF SCI & TECH BEIJING
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410102321.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-24
Publication Date
2024-11-19
Estimated Expiration
2044-01-24

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently and truly simulate the gas-liquid coupling phenomenon in a real-time environment, especially the formation and dissipation of bubbles, as well as the fluid behavior under the joint action of gas and liquid, resulting in high computational costs and poor visual effects.

Method used

Real-time gas-liquid coupling simulation method is adopted to obtain the gas-liquid coupling system, perform discretization processing to obtain particles, establish liquid and gas dynamic models, and use position-based dynamic methods and Navi-Stokes equations to combine GPU in parallel Calculation, realizes a fast particle search and dynamic addition and deletion mechanism, and simulates the formation and dissipation of bubbles.

Benefits of technology

It significantly improves the real-time performance of gas-liquid coupled simulation, saves calculation time and resources, and provides more realistic physical phenomenon simulation, suitable for film and television special effects, game animation and industrial production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118013809B_ABST
    Figure CN118013809B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computational fluid dynamics, and in particular to a real-time gas-liquid coupling simulation method and device, the method comprising: obtaining a gas-liquid coupling system to be simulated; discretizing the gas-liquid coupling system to obtain particles; wherein the particles include gas particles, liquid particles and boundary particles; establishing a liquid dynamics model based on liquid particles, boundary particles, Navier-Stokes equations and a position-based dynamics method; establishing a gas dynamics model based on gas particles, and obtaining a real-time gas-liquid coupling simulation result based on the liquid dynamics model and the gas dynamics model. The present invention can effectively improve the real-time performance of gas-liquid coupling simulation and the high degree of realism of simulation, and is suitable for large-scale tasks that require real-time multiphase flow dynamic simulation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of computational fluid dynamics, and in particular to a real-time gas-liquid coupling simulation method and device. Background Art

[0002] In the field of computer graphics and physical simulation, real-time simulation technology of fluid dynamics has always been a daunting challenge. The behavior of fluids in real life involves complex physical phenomena, such as turbulence, bubble generation, and free surface motion of liquids, which place high demands on computational models. In particular, gas-liquid coupling simulation technology is widely used in many industries such as movies, games, and engineering simulation. Therefore, how to efficiently and realistically simulate these complex fluid dynamics phenomena on computers is an urgent problem to be solved.

[0003] Traditional fluid simulation methods are mainly based on the gridded Euler method, which divides the fluid space into fixed grids and solves fluid dynamics equations, such as the Navier-Stokes equations, on the grid. The advantage of this method is that it has a solid theoretical foundation and can simulate the overall motion of the fluid well. However, it has difficulties in dealing with complex boundary conditions and free surface problems, and has high computational costs and is difficult to run in real time. In order to overcome the shortcomings of the gridded method, researchers have proposed particle-based Lagrangian methods, such as the smoothed particle hydrodynamics (SPH) method. The SPH method simulates fluid flow by tracking a series of particles in the fluid, each of which carries the physical properties of the fluid, such as density, pressure, and velocity. This method is easy to handle complex free surface and boundary problems and has high flexibility. However, the SPH method often requires high computational costs to ensure the conservation of the volume of the fluid when dealing with incompressible fluids. In recent years, the position based dynamics (PBD) method has attracted attention due to its high efficiency in dealing with incompressible constraints. The application of the PBD method in fluid simulation can more easily achieve real-time simulation by adjusting the particle position in each time step to meet the density constraint. In addition, the method supports parallel computing, which enables it to utilize the powerful computing power of modern graphics processing units (GPUs).

[0004] Although the above methods have their own advantages, it is still a technical challenge to effectively couple the interaction between gas and liquid (such as the formation and dissipation of bubbles) and the fluid behavior under the joint action of gas and liquid (such as the rise of bubbles underwater and liquid splashing). This requires not only accurate simulation of the interaction within the fluid, but also careful processing of the interaction between the fluid and the solid boundary. In addition, for the simulation of gas and liquid, in addition to physical accuracy, high visual realism is also required. For the visual effects industry, how to quickly generate high-quality visual effects with limited computing resources is an important criterion for measuring the success of simulation technology.

[0005] Therefore, developing an efficient, realistic gas-liquid coupling simulation method that can run in a real-time environment has become a research hotspot and technical pursuit in this field. The new method needs to overcome the limitations of existing technologies and improve the speed and quality of simulation to meet the industry's demand for real-time, high-quality fluid dynamics simulation. Summary of the invention

[0006] In order to solve the technical problem of how to simulate multiphase flow such as bubbles in water with high efficiency and high authenticity, the embodiment of the present invention provides a real-time gas-liquid coupling simulation method and device. The technical solution is as follows:

[0007] On the one hand, a real-time gas-liquid coupling simulation method is provided, which is implemented by a real-time gas-liquid coupling simulation device, and the method includes:

[0008] S1. Obtain a gas-liquid coupling system to be simulated.

[0009] S2. Discretize the gas-liquid coupling system to obtain particles; wherein the particles include gas particles, liquid particles and boundary particles.

[0010] S3. Establish a liquid dynamics model based on liquid particles, boundary particles, Navier-Stokes equations and position-based dynamics methods.

[0011] S4. A gas dynamics model is established based on gas particles, and a real-time gas-liquid coupling simulation result is obtained based on the liquid dynamics model and the gas dynamics model.

[0012] Optionally, the gas-liquid coupling system includes a gas model, a liquid model and a solid boundary three-dimensional model.

[0013] In S2, the gas-liquid coupling system is discretized to obtain particles, including:

[0014] S21. Perform Lagrangian particle discretization on the gas model to obtain gas particles.

[0015] S22. Perform Lagrangian particle discretization processing on the liquid model to obtain liquid particles.

[0016] S23. Perform Lagrangian particle discretization processing on the solid boundary three-dimensional model to obtain boundary particles.

[0017] S24. The discretized gas-liquid coupling system is divided into uniform grids, and the particles are mapped to the grid space. The prefix sum is calculated based on the number of particles in the grid space, and the index of the particle in the grid space is located by using the prefix sum. The position of the particle is rearranged according to the grid where the particle is located to realize particle search.

[0018] Optionally, in S3, a liquid dynamics model is established based on liquid particles, boundary particles, Navier-Stokes equations, and a position-based dynamics method, including:

[0019] S31. Estimate the particle distribution density of the liquid particles, and use a smooth kernel function to estimate the particle distribution density of the neighbor particles of the liquid particles.

[0020] S32. Density constraints related to the positions of the liquid particles are established, and the density constraint state of the corrected liquid particles is calculated based on the density constraints, the static density of the liquid particles, and the particle distribution density.

[0021] S33. Based on the position of the liquid particles before and after the discrete time step and density constraint state correction, the velocity of the liquid particles is calculated, the viscosity term and external force term are modeled according to the velocity of the liquid particles, gravity, viscous force dissipation and liquid-air surface tension are applied to the liquid particles, and then a liquid dynamics model is established.

[0022] Optionally, establishing density constraints related to the positions of the liquid particles in S32, and calculating the density constraint state of the corrected liquid particles according to the density constraints, the static density of the liquid particles and the particle distribution density, includes:

[0023] S321. Based on the density invariance of incompressible liquids, density constraints related to the positions of liquid particles are established using Newton's method.

[0024] S322. According to the density constraint, the static density of the liquid particles and the particle distribution density, the correction scale of the liquid particles is gradient calculated, and the position correction amount of the liquid particles is estimated according to the correction scale. The position of the liquid particles is updated through a preset number of iterations to obtain the density constraint state of the corrected liquid particles.

[0025] Optionally, S33 models the viscosity term and the external force term according to the velocity of the liquid particles, applies gravity, viscous force dissipation and liquid-air surface tension, including:

[0026] S331. According to the velocity of the liquid particles, the viscosity term and external force term in the Navier-Stokes equation are modeled, and the viscous force dissipation of the liquid particles is calculated based on the velocity difference between the liquid particles and the viscosity coefficient of the liquid particles.

[0027] S332. Apply gravitational acceleration to the liquid particles.

[0028] S333. Estimate the curvature of the liquid particles at the free surface by calculating the color field gradient. Estimate the Helmholtz free energy of the liquid particles at the free surface based on the curvature of the liquid particles. Use the gradient of the Helmholtz free energy as the liquid-air surface tension.

[0029] Optionally, establishing a gas dynamics model according to gas particles in S4 includes:

[0030] S41. Use a smooth kernel function to estimate the particle distribution density of the liquid particles around the gas particles, and construct the buoyancy of the gas particles according to the particle distribution density difference between the upper and lower liquid particles of the gas particles.

[0031] S42. Calculate the gas-liquid surface tension based on the color field gradient at the boundary between the gas particles and the liquid particles; calculate the cohesive force between the gas particles, and strengthen the gas-liquid surface tension according to the cohesive force.

[0032] S43. Increase the adhesion between gas particles and boundary particles.

[0033] S44. Calculate the drag force between the gas and liquid particles based on the speed difference and drag coefficient between the gas particles and the liquid particles.

[0034] S45. Establish a dynamic mechanism for adding and deleting gas particles.

[0035] Optionally, establishing a dynamic addition and deletion mechanism of gas particles in S45 includes:

[0036] S451. Calculate the speed difference between the liquid particles and the surrounding liquid particles, obtain liquid particles whose speed difference is greater than a preset speed threshold and whose color field gradient is greater than a preset color field gradient threshold, and generate gas particles for the obtained liquid particles.

[0037] S452, obtaining the particle distribution density of air particles at each discrete time step, and marking air particles whose particle distribution density is less than a preset density threshold as failed particles.

[0038] S453, calculating the prefix sum of valid particles, and updating the positions of valid particles; wherein valid particles are air particles except invalid particles in the air particles.

[0039] S454. Update the velocity of the particle and predict the position of the particle at the next discrete time step.

[0040] On the other hand, a real-time gas-liquid coupling simulation device is provided, which is applied to a real-time gas-liquid coupling simulation method, and the device comprises:

[0041] The acquisition module is used to acquire the gas-liquid coupling system to be simulated.

[0042] The processing module is used to discretize the gas-liquid coupling system to obtain particles; wherein the particles include gas particles, liquid particles and boundary particles.

[0043] Building blocks for modeling fluid dynamics based on liquid-particle, boundary-particle, Navier-Stokes equations, and position-based dynamics methods.

[0044] The output module is used to establish a gas dynamics model based on gas particles, and obtain real-time gas-liquid coupling simulation results based on the liquid dynamics model and the gas dynamics model.

[0045] Optionally, the gas-liquid coupling system includes a gas model, a liquid model and a solid boundary three-dimensional model.

[0046] The processing module is further used to:

[0047] S21. Perform Lagrangian particle discretization on the gas model to obtain gas particles.

[0048] S22. Perform Lagrangian particle discretization processing on the liquid model to obtain liquid particles.

[0049] S23. Perform Lagrangian particle discretization processing on the solid boundary three-dimensional model to obtain boundary particles.

[0050] S24. The discretized gas-liquid coupling system is divided into uniform grids, and the particles are mapped to the grid space. The prefix sum is calculated based on the number of particles in the grid space, and the index of the particle in the grid space is located by using the prefix sum. The position of the particle is rearranged according to the grid where the particle is located to realize particle search.

[0051] Optionally, the building block is further used to:

[0052] S31. Estimate the particle distribution density of the liquid particles, and use a smooth kernel function to estimate the particle distribution density of the neighbor particles of the liquid particles.

[0053] S32. Density constraints related to the positions of the liquid particles are established, and the density constraint state of the corrected liquid particles is calculated based on the density constraints, the static density of the liquid particles, and the particle distribution density.

[0054] S33. Based on the position of the liquid particles before and after the discrete time step and density constraint state correction, the velocity of the liquid particles is calculated, the viscosity term and external force term are modeled according to the velocity of the liquid particles, gravity, viscous force dissipation and liquid-air surface tension are applied to the liquid particles, and then a liquid dynamics model is established.

[0055] Optionally, the building block is further used to:

[0056] S321. Based on the density invariance of incompressible liquids, density constraints related to the positions of liquid particles are established using Newton's method.

[0057] S322. According to the density constraint, the static density of the liquid particles and the particle distribution density, the correction scale of the liquid particles is gradient calculated, and the position correction amount of the liquid particles is estimated according to the correction scale. The position of the liquid particles is updated through a preset number of iterations to obtain the density constraint state of the corrected liquid particles.

[0058] Optionally, the building block is further used to:

[0059] S331. According to the velocity of the liquid particles, the viscosity term and external force term in the Navier-Stokes equation are modeled, and the viscous force dissipation of the liquid particles is calculated based on the velocity difference between the liquid particles and the viscosity coefficient of the liquid particles.

[0060] S332. Apply gravitational acceleration to the liquid particles.

[0061] S333. Estimate the curvature of the liquid particles at the free surface by calculating the color field gradient. Estimate the Helmholtz free energy of the liquid particles at the free surface based on the curvature of the liquid particles. Use the gradient of the Helmholtz free energy as the liquid-air surface tension.

[0062] Optionally, the output module is further configured to:

[0063] S41. Use a smooth kernel function to estimate the particle distribution density of the liquid particles around the gas particles, and construct the buoyancy of the gas particles according to the particle distribution density difference between the upper and lower liquid particles of the gas particles.

[0064] S42. Calculate the gas-liquid surface tension based on the color field gradient at the boundary between the gas particles and the liquid particles; calculate the cohesive force between the gas particles, and strengthen the gas-liquid surface tension according to the cohesive force.

[0065] S43. Increase the adhesion between gas particles and boundary particles.

[0066] S44. Calculate the drag force between the gas and liquid particles based on the speed difference and drag coefficient between the gas particles and the liquid particles.

[0067] S45. Establish a dynamic mechanism for adding and deleting gas particles.

[0068] Optionally, the output module is further configured to:

[0069] S451. Calculate the speed difference between the liquid particles and the surrounding liquid particles, obtain liquid particles whose speed difference is greater than a preset speed threshold and whose color field gradient is greater than a preset color field gradient threshold, and generate gas particles for the obtained liquid particles.

[0070] S452, obtaining the particle distribution density of air particles at each discrete time step, and marking air particles whose particle distribution density is less than a preset density threshold as failed particles.

[0071] S453, calculating the prefix sum of valid particles, and updating the positions of valid particles; wherein valid particles are air particles except invalid particles in the air particles.

[0072] S454. Update the velocity of the particle and predict the position of the particle at the next discrete time step.

[0073] On the other hand, a real-time gas-liquid coupling simulation device is provided, comprising: a processor; a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, any one of the above-mentioned real-time gas-liquid coupling simulation methods is implemented.

[0074] On the other hand, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement any one of the above-mentioned real-time gas-liquid coupling simulation methods.

[0075] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0076] In the embodiment of the present invention, by adopting a fast particle search method and a position-based dynamics method, the real-time performance of the gas-liquid coupling simulation can be effectively improved, and the high efficiency of GPU processing parallel computing is utilized, which greatly saves the simulation computing time and consumed cost resources.

[0077] By establishing a liquid dynamics model and performing dynamic modeling on insoluble gases in water, we can simulate physical phenomena such as the formation and dissipation of bubbles, floating and splashing, making the simulation results more realistic. This is of great significance for studying the behavior and characteristics of multiphase flow of bubbles in water.

[0078] The technical solution provided by the present invention can be applied to multiple fields, such as film and television special effects, game animation, and industrial production. The real-time gas-liquid coupling method can be used to simulate effects such as bubbles, water splashes, and waves in water, provide more realistic and lifelike water scenes for film and television special effects, enhance the visual effects of the film, and improve the audience's viewing experience; in game animation, it can provide more realistic and dynamic effects for the water surface and underwater scenes in the game, enhance the realism and immersion of the game, and improve the playability and visual effects of the game; applied to industrial production, engineers and designers can simulate and analyze the flow behavior of liquids and gases in industrial equipment and pipelines, optimize fluid transmission and mixing processes, and improve production efficiency and product quality. BRIEF DESCRIPTION OF THE DRAWINGS

[0079] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0080] Figure 1 is a flow chart of a real-time gas-liquid coupling simulation method provided by an embodiment of the present invention;

[0081] Figure 2 is a schematic diagram of applying gas-liquid tension provided by an embodiment of the present invention;

[0082] Figure 3 is a schematic diagram of drag force application provided by an embodiment of the present invention;

[0083] Figure 4 is a schematic diagram of dynamically adding and deleting gas particles provided by an embodiment of the present invention;

[0084] Figure 5 is a schematic diagram of GPU parallel computing provided by an embodiment of the present invention;

[0085] Figure 6 It is a particle diagram and a rendering diagram of a gas-liquid coupling simulation experiment provided by an embodiment of the present invention;

[0086] Figure 7 It is a complex scene effect diagram of the interaction between gas, liquid and rigid body provided by an embodiment of the present invention;

[0087] Figure 8 It is the overall technical roadmap provided by the embodiment of the present invention;

[0088] Fig. 9 is a schematic diagram of a gas-liquid coupling scenario provided by an embodiment of the present invention;

[0089] Fig.10It is a block diagram of a real-time gas-liquid coupling simulation device provided by an embodiment of the present invention;

[0090] Fig.11 It is a structural schematic diagram of a real-time gas-liquid coupling simulation device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0091] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0092] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0093] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.

[0094] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.

[0095] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0096] The embodiment of the present invention provides a real-time gas-liquid coupling simulation method, which can be implemented by a real-time gas-liquid coupling simulation device, and the real-time gas-liquid coupling simulation device can be a terminal or a server. Figure 1 The process flow chart of the real-time gas-liquid coupling simulation method shown in FIG. 1 may include the following steps:

[0097] S1. Obtain a gas-liquid coupling system to be simulated.

[0098] The gas-liquid coupling system may include a gas model, a liquid model and a solid boundary three-dimensional model.

[0099] S2. Discretize the gas-liquid coupling system, convert the continuous medium into a particle system, and achieve fast particle search based on the neighbor detection method.

[0100] The particles may include gas particles, liquid particles and boundary particles.

[0101] In a feasible implementation, this embodiment first sets up the simulation environment during the initialization phase of the entire scheme, including the size and shape of the container, the position and properties of the solid boundary, and the initialization state and inherent physical properties of the liquid and gas in the container. Discretization processing converts the liquid of the continuous medium into a collection of particles with certain physical properties to facilitate simulation of the continuity and fluidity of the liquid during the calculation process. For the collision between liquid particles and solid boundaries, appropriate boundary processing measures are implemented, such as rebound correction of particle positions, and particle velocity is adjusted according to boundary conditions to ensure that particles do not penetrate solid boundaries.

[0102] Optionally, the above step S2 may include the following steps S21-S24:

[0103] S21. Perform Lagrangian particle discretization on the gas model to obtain gas particles.

[0104] S22. Perform Lagrangian particle discretization on the liquid model, and assign corresponding physical properties such as density, mass, and viscosity parameters to each liquid particle based on the physical characteristics of the liquid.

[0105] S23. Perform Lagrangian particle discretization processing on the solid boundary three-dimensional model to obtain boundary particles.

[0106] In one feasible implementation, the three-dimensional model of the solid boundary in the simulation scene is discretized into boundary particles, and the mass of the boundary particles is estimated by kernel function sampling based on the physical characteristics of the boundary solid. The mass estimation of the boundary particles in this step is to simulate the influence of the solid boundary on the fluid behavior, including but not limited to the friction and resistance between the fluid and the solid boundary.

[0107] S24. The discretized gas-liquid coupling system is divided into uniform grids, and the particles are mapped to the grid space. The prefix sum is calculated based on the number of particles in the grid space, and the index of the particle in the grid space is located by using the prefix sum. The position of the particle is rearranged according to the grid where the particle is located to realize particle search.

[0108] In a feasible implementation, the three-dimensional space is divided into uniform grids, all particle positions are mapped to an ordered grid space, the prefix sum is calculated based on the number of grid particles, the prefix sum is used to locate the index of the particle in the grid, and the position of the particle in the memory is rearranged according to the grid where the particle is located, so as to achieve fast particle search. The neighbor detection and particle search mechanism in this step allows the algorithm to quickly identify and process the interactions between particles, thereby improving the computational efficiency of the simulation.

[0109] S3. Establish a liquid dynamics model based on liquid particles, boundary particles, Navier-Stokes equations and position-based dynamics methods.

[0110] In a feasible implementation, a liquid dynamics model is established based on the Navier-Stokes equations, and a position-based dynamics method is used to impose incompressibility constraints on the liquid.

[0111] Optionally, the above step S3 may include the following steps S31-S33:

[0112] S31. Estimate the particle distribution density of each liquid particle, sample the neighboring particles in the space around the particle location, use the smooth kernel function to estimate its distribution density, and include approximate calculations of boundary particles.

[0113] S32. Based on the density invariance of incompressible liquids, density constraints related to the positions of liquid particles are established, and the current density constraint state of the particles is calculated according to the static density of the liquid particles and the distribution density of the particles.

[0114] Optionally, the above step S32 may include the following steps S321-S322:

[0115] S321. Construct a position-based constraint force through Newton's method to make the density constraint state of the particle approach the density constraint.

[0116] S322. Calculate the correction scale of the current particle based on the density constraint state gradient and use it to estimate the position correction amount of the current particle. Introduce a relaxation factor to avoid the instability caused by the gradient disappearance. Correct the particle density constraint state by iteratively updating the position for a certain number of times.

[0117] S33. Based on the position of the liquid particles before and after the discrete time step and density constraint state correction, the current velocity of the liquid particles is calculated, the viscosity term and external force term are modeled according to the velocity of the liquid particles, gravity, viscous force dissipation and liquid-air surface tension are applied to the liquid particles, and then a liquid dynamics model is established.

[0118] Optionally, modeling the viscosity term and the external force term according to the velocity of the liquid particles in S33, applying gravity, viscous force dissipation and liquid-air surface tension, may include S331-S333:

[0119] S331. Model the viscosity term and external force term in the Navier-Stokes equations, and calculate the kinetic energy dissipation of liquid particles due to viscosity based on the velocity difference between particles and the viscosity coefficient of liquid particles.

[0120] S332. Apply gravitational acceleration to the liquid particles.

[0121] S333, estimating the curvature of the liquid particles at the free surface by calculating the color field gradient, estimating the Helmholtz free energy of the surface liquid particles based on the curvature, and taking the gradient of the Helmholtz free energy as the surface tension; specifically, the surface tension on particle i It can be calculated as:

[0122]

[0123] In the formula, k t is the tension coefficient, subscript j is the neighbor particle number, m is the particle mass, ρ is the particle distribution density, c is the particle color field, and the corresponding is the color field gradient, W is the smooth kernel function, x ij is the relative displacement between particles, and h is the smooth core support radius.

[0124] S4. A gas dynamics model is established based on gas particles, and a real-time gas-liquid coupling simulation result is obtained based on the liquid dynamics model and the gas dynamics model.

[0125] In a feasible implementation, a dynamic model is performed on the insoluble gas in water, and buoyancy, gas-liquid drag and gas-liquid interfacial tension are applied to the gas particles to ensure the interaction between the gas particles and the liquid particles and between the gas particles and the solid boundaries. At the same time, the dynamic addition and deletion of gas particles is realized to simulate the physical phenomenon of bubble formation and dissipation.

[0126] Optionally, establishing a gas dynamics model according to gas particles in S4 may include S41-S45:

[0127] S41. Use a smooth kernel function to estimate the distribution density of liquid particles around the gas particles, and construct the buoyancy force on the gas particles in the vertical direction by calculating the difference in liquid density above and below the gas particles.

[0128] S42. Based on the color field gradient at the boundary between the gas particles and the liquid particles, the surface tension generated at the boundary between the gas particles and the liquid particles is calculated, such as Figure 2 As shown in the figure, the cohesive force generated between gas particles is calculated to strengthen the surface tension effect, so as to minimize the gas-liquid surface area and form bubbles in the water; the cohesive force on particle i It can be expressed as:

[0129]

[0130] In the formula, k c is the cohesion coefficient, subscript j is the neighbor particle number, m is the particle mass, ρ is the particle distribution density, x ij is the relative displacement between particles.

[0131] S43. Adhesion is added between gas particles and boundary particles to simulate the tension effect of reducing the surface area of ​​bubbles by adhering to the solid boundary.

[0132] S44. Calculate the drag force between the gas and liquid particles based on the velocity difference between the gas particles and the liquid particles and the drag coefficient, such as Figure 3 As shown in the figure, the effect of liquid motion on bubble motion is simulated. The drag force also acts on the liquid particles to ensure momentum conservation. The drag force on particle i The calculation can be expressed as:

[0133]

[0134] Where subscript j is the neighbor particle number, m is the particle mass, ρ is the particle distribution density, and k d is the drag coefficient, c s is the speed of sound, W is the smooth kernel function, x ij is the relative displacement between particles, h is the smooth core support radius, and Π is used to evaluate the relative motion intensity between liquid and gas particles, where v ij is the relative velocity difference, δh 2 is a constant used to stabilize the calculation.

[0135] S45. Establish a dynamic addition and deletion mechanism for gas particles to simulate the generation and dissipation of bubbles, thereby enhancing the dynamic effect of the simulation.

[0136] In a feasible implementation, Figure 4 As shown in the figure, the generation and deletion of bubbles mainly occur on the free surface of the liquid, including the violently moving liquid entraining air inside, and the internal bubbles floating up and dissipating on the liquid surface. The dynamic addition and deletion mechanism of gas particles can realize highly parallel detection of significant and non-significant areas of liquid free surface movement, and generate and delete gas particles accordingly without affecting the overall simulation efficiency.

[0137] Optionally, the above step S45 may include the following steps S451-S454:

[0138] S451. Calculate the speed difference between the liquid particles and the surrounding liquid particles, and obtain liquid particles whose speed difference is greater than a preset speed threshold and whose color field gradient is greater than a preset color field gradient threshold. An effective gas particle will be generated for the obtained liquid particles to achieve the effect of air being drawn into the liquid and generating bubbles.

[0139] S452. Check the particle distribution density of air particles at each time step, and mark air particles whose particle distribution density is less than a preset density threshold as failed particles.

[0140] S453. Calculate the prefix sum of the effective bits of the particles, update the memory distribution position of the effective particles, and realize highly parallelized addition and deletion of gas particles.

[0141] S454, update the speed of all particles and predict the particle position in the next time step, so as to achieve a continuous and realistic simulation result of the gas-liquid coupling phenomenon.

[0142] In a feasible implementation, the particle velocity and position are updated using a parallel computing strategy, such as Figure 5 As shown, the simulation space is divided into multiple regions, and the particle data in the multiple regions are distributed to multiple processing cores, such as the computing units of a GPU, to improve the efficiency of the processing cores in accessing data and reduce repeated reading of data. Particle processing tasks are assigned to each computing unit to achieve parallel data processing.

[0143] In this embodiment, the real-time performance and effectiveness of the gas-liquid coupling method are verified through experiments. Figure 6 It shows a simulation experiment in which air is dragged into the water to produce a large number of bubbles when fluid is injected into the water, including particle effects and real rendering effects.

[0144] from Figure 6 It can be seen that due to the speed difference between particles when the fluid is injected into the water, many gas particles are dynamically generated, and the visual effect obtained through visualization rendering is close to the real scene.

[0145] This embodiment conducts a simulation experiment of solid-liquid-gas interaction in complex scenarios, such as Figure 7 As shown in the figure, a dolphin falls into the water and brings up a lot of bubbles, which gradually rise and dissipate as the dolphin dives to the bottom. And when the dolphin swings its tail fin, the bubbles tend to follow the movement. The experimental results show that the method provided by the present invention can vividly and realistically describe the interaction between air, fluid and rigid body.

[0146] In a feasible implementation, in order to effectively simulate the interaction between gas and liquid and the fluid behavior under the joint action of gas and liquid, and meet the real-time and high-quality simulation requirements in the fields of film and television special effects, game animation, industrial production, etc., this embodiment provides a real-time gas-liquid coupling simulation method. Figure 8 As shown in the figure, the method first discretizes the gas-liquid coupling system and proposes a fast neighbor particle search method. Then, the liquid dynamics is modeled and simulated based on the PBD method. Finally, the insoluble gas in water is modeled, buoyancy, drag and surface tension are applied to the gas particles, and the dynamic addition and deletion of gas particles are realized. The method can be implemented by a computer program, and the execution program can simulate the formation and dissipation of bubbles, as well as the rise and splashing phenomena, such as Fig. 9 As shown, it can meet the real-time and authenticity of gas-liquid coupling simulation.

[0147] In the embodiment of the present invention, by adopting a fast particle search method and a position-based dynamics method, the real-time performance of the gas-liquid coupling simulation can be effectively improved, and the high efficiency of GPU processing parallel computing is utilized, which greatly saves the simulation computing time and consumed cost resources.

[0148] By establishing a liquid dynamics model and performing dynamic modeling on insoluble gases in water, we can simulate physical phenomena such as the formation and dissipation of bubbles, floating and splashing, making the simulation results more realistic. This is of great significance for studying the behavior and characteristics of multiphase flow of bubbles in water.

[0149] The technical solution provided by the present invention can be applied to multiple fields, such as film and television special effects, game animation, and industrial production. The real-time gas-liquid coupling method can be used to simulate effects such as bubbles, water splashes, and waves in water, provide more realistic and lifelike water scenes for film and television special effects, enhance the visual effects of the film, and improve the audience's viewing experience; in game animation, it can provide more realistic and dynamic effects for the water surface and underwater scenes in the game, enhance the realism and immersion of the game, and improve the playability and visual effects of the game; applied to industrial production, engineers and designers can simulate and analyze the flow behavior of liquids and gases in industrial equipment and pipelines, optimize fluid transmission and mixing processes, and improve production efficiency and product quality.

[0150] Fig.10 is a block diagram of a real-time gas-liquid coupling simulation device according to an exemplary embodiment, and the device is used for a real-time gas-liquid coupling simulation method. Fig.10 The device includes an acquisition module 1010, a processing module 1020, a construction module 1030, and an output module 1040. For ease of description, Fig.10 Only the main components of the full process visualization device 1000 are shown:

[0151] The acquisition module 1010 is used to acquire the gas-liquid coupling system to be simulated.

[0152] The processing module 1020 is used to discretize the gas-liquid coupling system to obtain particles; wherein the particles include gas particles, liquid particles and boundary particles.

[0153] The construction module 1030 is used to establish a liquid dynamics model based on liquid particles, boundary particles, Navier-Stokes equations and a position-based dynamics method.

[0154] The output module 1040 is used to establish a gas dynamics model according to the gas particles, and obtain a real-time gas-liquid coupling simulation result according to the liquid dynamics model and the gas dynamics model.

[0155] Optionally, the gas-liquid coupling system includes a gas model, a liquid model and a solid boundary three-dimensional model.

[0156] The processing module 1020 is further configured to:

[0157] S21. Perform Lagrangian particle discretization on the gas model to obtain gas particles.

[0158] S22. Perform Lagrangian particle discretization processing on the liquid model to obtain liquid particles.

[0159] S23. Perform Lagrangian particle discretization processing on the solid boundary three-dimensional model to obtain boundary particles.

[0160] S24. The discretized gas-liquid coupling system is divided into uniform grids, and the particles are mapped to the grid space. The prefix sum is calculated based on the number of particles in the grid space, and the index of the particle in the grid space is located by using the prefix sum. The position of the particle is rearranged according to the grid where the particle is located to realize particle search.

[0161] Optionally, the construction module 1030 is further configured to:

[0162] S31. Estimate the particle distribution density of the liquid particles, and use a smooth kernel function to estimate the particle distribution density of the neighbor particles of the liquid particles.

[0163] S32. Density constraints related to the positions of the liquid particles are established, and the density constraint state of the corrected liquid particles is calculated based on the density constraints, the static density of the liquid particles, and the particle distribution density.

[0164] S33. Based on the position of the liquid particles before and after the discrete time step and density constraint state correction, the velocity of the liquid particles is calculated, the viscosity term and external force term are modeled according to the velocity of the liquid particles, gravity, viscous force dissipation and liquid-air surface tension are applied to the liquid particles, and then a liquid dynamics model is established.

[0165] Optionally, the construction module 1030 is further configured to:

[0166] S321. Based on the density invariance of incompressible liquids, density constraints related to the positions of liquid particles are established using Newton's method.

[0167] S322. According to the density constraint, the static density of the liquid particles and the particle distribution density, the correction scale of the liquid particles is gradient calculated, and the position correction amount of the liquid particles is estimated according to the correction scale. The position of the liquid particles is updated through a preset number of iterations to obtain the density constraint state of the corrected liquid particles.

[0168] Optionally, the construction module 1030 is further configured to:

[0169] S331. According to the velocity of the liquid particles, the viscosity term and external force term in the Navier-Stokes equation are modeled, and the viscous force dissipation of the liquid particles is calculated based on the velocity difference between the liquid particles and the viscosity coefficient of the liquid particles.

[0170] S332. Apply gravitational acceleration to the liquid particles.

[0171] S333. Estimate the curvature of the liquid particles at the free surface by calculating the color field gradient. Estimate the Helmholtz free energy of the liquid particles at the free surface based on the curvature of the liquid particles. Use the gradient of the Helmholtz free energy as the liquid-air surface tension.

[0172] Optionally, the output module 1040 is further configured to:

[0173] S41. Use a smooth kernel function to estimate the particle distribution density of the liquid particles around the gas particles, and construct the buoyancy of the gas particles according to the particle distribution density difference between the upper and lower liquid particles of the gas particles.

[0174] S42. Calculate the gas-liquid surface tension based on the color field gradient at the boundary between the gas particles and the liquid particles; calculate the cohesive force between the gas particles, and strengthen the gas-liquid surface tension according to the cohesive force.

[0175] S43. Increase the adhesion between gas particles and boundary particles.

[0176] S44. Calculate the drag force between the gas and liquid particles based on the speed difference and drag coefficient between the gas particles and the liquid particles.

[0177] S45. Establish a dynamic mechanism for adding and deleting gas particles.

[0178] Optionally, the output module 1040 is further configured to:

[0179] S451. Calculate the speed difference between the liquid particles and the surrounding liquid particles, obtain liquid particles whose speed difference is greater than a preset speed threshold and whose color field gradient is greater than a preset color field gradient threshold, and generate gas particles for the obtained liquid particles.

[0180] S452, obtaining the particle distribution density of air particles at each discrete time step, and marking air particles whose particle distribution density is less than a preset density threshold as failed particles.

[0181] S453, calculating the prefix sum of valid particles, and updating the positions of valid particles; wherein valid particles are air particles except invalid particles in the air particles.

[0182] S454. Update the velocity of the particle and predict the position of the particle at the next discrete time step.

[0183] In the embodiment of the present invention, by adopting a fast particle search method and a position-based dynamics method, the real-time performance of the gas-liquid coupling simulation can be effectively improved, and the high efficiency of GPU processing parallel computing is utilized, which greatly saves the simulation computing time and consumed cost resources.

[0184] By establishing a liquid dynamics model and performing dynamic modeling on insoluble gases in water, we can simulate physical phenomena such as the formation and dissipation of bubbles, floating and splashing, making the simulation results more realistic. This is of great significance for studying the behavior and characteristics of multiphase flow of bubbles in water.

[0185] The technical solution provided by the present invention can be applied to multiple fields, such as film and television special effects, game animation, and industrial production. The real-time gas-liquid coupling method can be used to simulate effects such as bubbles, water splashes, and waves in water, provide more realistic and lifelike water scenes for film and television special effects, enhance the visual effects of the film, and improve the audience's viewing experience; in game animation, it can provide more realistic and dynamic effects for the water surface and underwater scenes in the game, enhance the realism and immersion of the game, and improve the playability and visual effects of the game; applied to industrial production, engineers and designers can simulate and analyze the flow behavior of liquids and gases in industrial equipment and pipelines, optimize fluid transmission and mixing processes, and improve production efficiency and product quality.

[0186] Fig.11 is a structural diagram of a real-time gas-liquid coupling simulation device provided by an embodiment of the present invention, such as Fig.11 As shown, the real-time gas-liquid coupling simulation device may include the above Fig.10 The real-time gas-liquid coupling simulation device shown. Optionally, the real-time gas-liquid coupling simulation device 1110 may include a processor 2001 .

[0187] Optionally, the real-time gas-liquid coupling simulation device 1110 may further include a memory 2002 and a transceiver 2003 .

[0188] The processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.

[0189] Combine the following Fig.11 The components of the real-time gas-liquid coupling simulation device 1110 are specifically introduced:

[0190] The processor 2001 is the control center of the real-time gas-liquid coupling simulation device 1110, and can be a processor or a general term for multiple processing elements. For example, the processor 2001 is one or more central processing units (CPUs), or can be an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (field programmable gate arrays, FPGAs).

[0191] Optionally, the processor 2001 may execute various functions of the real-time gas-liquid coupling simulation device 1110 by running or executing a software program stored in the memory 2002 and calling data stored in the memory 2002 .

[0192] In a specific implementation, as an embodiment, the processor 2001 may include one or more CPUs, such as Fig.11 CPU0 and CPU1 are shown in FIG.

[0193] In a specific implementation, as an embodiment, the real-time gas-liquid coupling simulation device 1110 may also include multiple processors, such as Fig.11 2001 and processor 2004 are shown in FIG. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0194] The processor 2005 is the simulation calculation core of the real-time gas-liquid simulation device 1110, and should be one or more graphics processing units (GPUs), which are controlled and scheduled by the processor 2001. The processor 2001 transmits the calculation subroutines and data in the memory 2002 to the processor 2005 according to the simulation program logic, and the processor 2005 performs highly parallel simulation calculations. After the calculation is completed, the processor 2005 transmits the simulation result data to the processor 2001, and the processor 2001 performs further data processing.

[0195] The memory 2002 is used to store the software program for executing the solution of the present invention, and the execution is controlled by the processor 2001. The specific implementation method can refer to the above method embodiment, which will not be repeated here.

[0196] Optionally, the memory 2002 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the processor 2001, or may exist independently and be accessed through the interface circuit ( Fig.11 2001) is coupled to the processor 2001, which is not specifically limited in the embodiment of the present invention.

[0197] The transceiver 2003 is used to communicate with a network device or a terminal device.

[0198] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Fig.11 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.

[0199] Optionally, the transceiver 2003 may be integrated with the processor 2001, or may exist independently and communicate with the processor 2001 through the interface circuit ( Fig.11 ) is coupled to the processor 2001, which is not specifically limited in the embodiment of the present invention. It should be noted that, Fig.11 The structure of the real-time gas-liquid coupling simulation device 1110 shown in the figure does not constitute a limitation on the router, and the actual knowledge structure recognition device may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0200] In addition, the technical effects of the real-time gas-liquid coupling simulation device 1110 can refer to the technical effects of the real-time gas-liquid coupling simulation method described in the above method embodiment, which will not be repeated here.

[0201] It should be understood that the processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0202] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0203] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0204] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0205] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0206] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0207] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0208] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0209] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0210] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0211] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0212] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0213] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A real-time gas-liquid coupling simulation method, characterized in that: The method comprises: S1. Obtain a gas-liquid coupling system to be simulated; S2. discretizing the gas-liquid coupling system to obtain particles; wherein the particles include gas particles, liquid particles and boundary particles; S3, establishing a liquid dynamics model according to the liquid particles, boundary particles, Navier-Stokes equations and a position-based dynamics method; S4. Establishing a gas dynamics model according to the gas particles, and obtaining a real-time gas-liquid coupling simulation result according to the liquid dynamics model and the gas dynamics model; The step S3 establishes a liquid dynamics model according to the liquid particles, boundary particles, Navier-Stokes equations and a position-based dynamics method, including: S31, estimating the particle distribution density of the liquid particles, and using a smooth kernel function to estimate the particle distribution density of the neighbor particles of the liquid particles; S32, establishing a density constraint related to the position of the liquid particles, and calculating a density constraint state of the corrected liquid particles according to the density constraint, the static density of the liquid particles and the particle distribution density; S33, based on the discrete time step and the position of the liquid particles before and after the density constraint state correction, the velocity of the liquid particles is calculated, the viscosity term and the external force term are modeled according to the velocity of the liquid particles, gravity, viscous force dissipation and liquid-air surface tension are applied to the liquid particles, and then a liquid dynamics model is established; The step of establishing a gas dynamics model according to the gas particles in S4 includes: S41, using a smooth kernel function to estimate the particle distribution density of the liquid particles around the gas particles, and constructing the buoyancy of the gas particles according to the particle distribution density difference between the upper and lower liquid particles of the gas particles; S42, calculating the gas-liquid surface tension based on the color field gradient at the boundary between the gas particles and the liquid particles; calculating the cohesive force between the gas particles, and strengthening the gas-liquid surface tension according to the cohesive force; S43, increasing the adhesion between gas particles and boundary particles; S44, calculating the drag force between the gas and liquid particles according to the speed difference between the gas particles and the liquid particles and the drag coefficient; S45. Establish a dynamic mechanism for adding and deleting gas particles.

2. The method according to claim 1, characterized in that The gas-liquid coupling system includes a gas model, a liquid model and a solid boundary three-dimensional model; The step of discretizing the gas-liquid coupling system to obtain particles in S2 includes: S21, performing Lagrangian particle discretization processing on the gas model to obtain gas particles; S22, performing Lagrangian particle discretization processing on the liquid model to obtain liquid particles; S23, performing Lagrangian particle discretization processing on the solid boundary three-dimensional model to obtain boundary particles; S24. Divide the discretized gas-liquid coupling system into uniform grids, map the particles to the grid space, calculate the prefix sum based on the number of particles in the grid space, use the prefix sum to locate the index of the particle in the grid space, rearrange the position of the particle according to the grid where the particle is located, and realize particle search.

3. The method according to claim 1, characterized in that: The step of establishing the density constraint related to the position of the liquid particles in S32, and calculating the density constraint state of the liquid particles after correction according to the density constraint, the static density of the liquid particles and the particle distribution density, includes: S321. Based on the density invariance of incompressible liquids, density constraints related to the positions of liquid particles are established by Newton's method. S322. According to the density constraint, the static density of the liquid particles and the particle distribution density, a correction scale of the liquid particles is gradient calculated, and a position correction amount of the liquid particles is estimated according to the correction scale. The position of the liquid particles is updated through a preset number of iterations to obtain a density constraint state of the liquid particles after correction.

4. The method according to claim 1, characterized in that: The step S33 of modeling the viscosity term and the external force term according to the velocity of the liquid particles, applying gravity, viscous force dissipation and liquid-air surface tension, includes: S331, modeling the viscosity term and the external force term in the Navier-Stokes equation according to the velocity of the liquid particles, and calculating the viscous force dissipation of the liquid particles based on the velocity difference between the liquid particles and the viscosity coefficient of the liquid particles; S332, applying gravitational acceleration to liquid particles; S333. Estimate the curvature of the liquid particles at the free surface by calculating the color field gradient, estimate the Helmholtz free energy of the liquid particles at the free surface based on the liquid particle curvature, and use the gradient of the Helmholtz free energy as the liquid-air surface tension.

5. The method according to claim 1, characterized in that: The establishment of a dynamic addition and deletion mechanism of gas particles in S45 includes: S451, calculating the speed difference between the liquid particles and the surrounding liquid particles, acquiring liquid particles whose speed difference is greater than a preset speed threshold and whose color field gradient is greater than a preset color field gradient threshold, and generating gas particles for the acquired liquid particles; S452, obtaining the particle distribution density of air particles at each discrete time step, and marking air particles whose particle distribution density is less than a preset density threshold as failed particles; S453, calculating the prefix sum of valid particles, and updating the positions of valid particles; wherein the valid particles are air particles except the invalid particles in the air particles; S454. Update the velocity of the particle and predict the position of the particle at the next discrete time step.

6. A real-time gas-liquid coupling simulation device, characterized in that: The device comprises: An acquisition module, used for acquiring a gas-liquid coupling system to be simulated; A processing module, used for discretizing the gas-liquid coupling system to obtain particles; wherein the particles include gas particles, liquid particles and boundary particles; A construction module for establishing a liquid dynamics model based on the liquid particles, boundary particles, Navier-Stokes equations and a position-based dynamics method; An output module, used to establish a gas dynamics model according to the gas particles, and obtain a real-time gas-liquid coupling simulation result according to the liquid dynamics model and the gas dynamics model; The liquid dynamics model is established according to the liquid particles, boundary particles, Navier-Stokes equations and a position-based dynamics method, including: S31, estimating the particle distribution density of the liquid particles, and using a smooth kernel function to estimate the particle distribution density of the neighbor particles of the liquid particles; S32, establishing a density constraint related to the position of the liquid particles, and calculating a density constraint state of the corrected liquid particles according to the density constraint, the static density of the liquid particles and the particle distribution density; S33, based on the discrete time step and the position of the liquid particles before and after the density constraint state correction, the velocity of the liquid particles is calculated, the viscosity term and the external force term are modeled according to the velocity of the liquid particles, gravity, viscous force dissipation and liquid-air surface tension are applied to the liquid particles, and then a liquid dynamics model is established; The step of establishing a gas dynamics model according to the gas particles comprises: S41, using a smooth kernel function to estimate the particle distribution density of the liquid particles around the gas particles, and constructing the buoyancy of the gas particles according to the particle distribution density difference between the upper and lower liquid particles of the gas particles; S42, calculating the gas-liquid surface tension based on the color field gradient at the boundary between the gas particles and the liquid particles; calculating the cohesive force between the gas particles, and strengthening the gas-liquid surface tension according to the cohesive force; S43, increasing the adhesion between gas particles and boundary particles; S44, calculating the drag force between the gas and liquid particles according to the speed difference between the gas particles and the liquid particles and the drag coefficient; S45. Establish a dynamic mechanism for adding and deleting gas particles.

7. A real-time gas-liquid coupling simulation device, characterized in that: The real-time gas-liquid coupling simulation device comprises: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 5.