Pressure corrected SPH for fluid animation Kai Bao, Hui Zhang, Lili Zheng and Enhua Wu Analyzed by Po-Ram Kim 2 March 2010
Abstract We present pressure scheme for the SPH for fluid animation In conventional SPH method, EOS are used For volume conservation, high speeds of sound are required à numerical instability In the paper, a new extra pressure correction scheme is proposed Po-Ram Kim 2 March 2010 # 2
Abstract Smoother pressure distribution and more efficient simulation are achieved The proposed method has been used to simulate free surface problems Surface tension and fluid fragmentation can be well handled Po-Ram Kim 2 March 2010 # 3
Introduction SPH is a method to capture characteristics and thus becomes more and more widely used To simulate free surface flow, one crucial problem is to ensure the incompressibility of the flow There are two main ways to achieve this The divergence of the velocity field à zero Poisson equation : time consuming solution Keeping the fluid density constant Poisson equation : time consuming solution Moving Particle Semi-implicit (MPS) method Po-Ram Kim 2 March 2010 # 4
Introduction In the conventional SPH method EOS are used to directly associate the pressure with particle density The time-consuming solution of Poisson equation is avoided : widely used But, it proved to be hard to guarantee the incompressibility of free surface flow Tait s equation The volume of fluid is generally well conserved But, a high sound speed has to be used àthe time step is too small little difference in density will lead to large variation in pressure Po-Ram Kim 2 March 2010 # 5
Introduction In the paper An iterative pressure correction scheme is proposed to be used along with the EOS The local pressure disturbance is made to propagate to the neighboring areas Smoother pressure distribution Incompressible fluid More accurate and efficient simulation Smaller sound speeds and larger time steps are made possible Enhancement in the surface tension model Po-Ram Kim 2 March 2010 # 6
Previous Work In Eulerain methods The incompressibility is easy to enforce While the mass conservation for small features is not well guaranteed Widely used in the physically based animation and many fluid phenomena Po-Ram Kim 2 March 2010 # 7
Previous Work In Largrangian particles(sph) First introduced for highly deformable bodies Grids are required during the computation Mass conservation is naturally guaranteed Surface tracking techniques are required Large deformation and violent fragmentation can be handled Interactive simulation of free surface flow was achieved using SPH by Muller et al Po-Ram Kim 2 March 2010 # 8
Previous Work Free-surface flow Highly viscous fluids Po-Ram Kim 2 March 2010 # 9
Previous Work Solid-fluid coupling An adaptive sampling technique Po-Ram Kim 2 March 2010 # 10
Methodology Basic SPH Formations Lagrangian form of the Navier Stokes equation Conservation of mass Conservation of momentum v : velocity vector, p : pressure, ρ : fluid density, g : gravitational acceleration vector, : kinetic viscosity Po-Ram Kim 2 March 2010 # 11
Methodology Basic SPH Formations To evaluate the value f at an arbitrary position x an interpolation is applied with the neighboring particles : Particle approximation j i f j : the value of f at the position of particle j, W : smoothing kernel function m : mass, ρ : density Po-Ram Kim 2 March 2010 # 12
Methodology Basic SPH Formations By applying the SPH particle approximation to the momentum equation(equation (2)) j i p j : the pressure of particle i, : direction gradient to particle i Po-Ram Kim 2 March 2010 # 13
Methodology Density Computation Two main approaches to determine the density of particles in the traditional SPH The density summation method Tracking the evolution of the density through the continuity equation Po-Ram Kim 2 March 2010 # 14
Methodology Density Computation The density summation method (ßwidely used) Advantage It conserves the mass exactly Disadvantage It suffers from particle deficiency near the boundary In the paper, the continuity density approach (equation(5)) is used Po-Ram Kim 2 March 2010 # 15
Methodology Equations of State Incompressible fluid liquids Compressible fluid Gases A theoretically incompressible flow is practically compressible Artificial compressibility is introduced Weakly compressible The pressure is determined with EOS This approach for free surface flow àthe volume of the flow is hard to be well conserved Po-Ram Kim 2 March 2010 # 16
Methodology Equations of State Equation of State k p = c 2, c : the sound of speed, ρ0 : reference density Tait s equation àthe variations of density remain small àthe volume of the fluid is generally well conserved Po-Ram Kim 2 March 2010 # 17
Methodology Equations of State Tait s equation Small deviation in density field will result in large fluctuation in pressure Noisy pressure distribution will be obtained Numerical instability Po-Ram Kim 2 March 2010 # 18
Methodology Equations of State Time step CFL Viscous condition External force condition force condition With the Tait s equation, A high speed of sound is required To keep density fluctuation low à Small time step has to be used To keep the density variation under the order of 1% Sound speed = 10 * (maximum possible velocity) In ref[8] Time step = 4.52*10-4 Po-Ram Kim 2 March 2010 # 19
Methodology Pressure Correction Equation For a truly incompressible flow dr ρ = constant à = 0 dt equation(1) à Ñ à divergence-free field v = 0 To obtain a divergence free field, the classical prejec tion method is used Ñ 2 r p = Ñ v dt * v* : intermediate velocity field without applying the pressure in momentum equation However, solving poisson equation proves to be very time consuming Po-Ram Kim 2 March 2010 # 20
Methodology Pressure Correction Equation To resolve The noisy pressure disturbance Instability arising from the EOS To avoid the expensive solution of global Poisson equation A flexible pressure correction equation is presented Po-Ram Kim 2 March 2010 # 21
Methodology Pressure Correction Equation By substituting the equation(6) into continuity equation(equation(1)), the following equation could be obtained dp dt 2 + r c Ñ v = 0 (9) Variational method di ( f) = di( f) dt dt p dp = k p dt dr 1 = dt k equation(1) 1 k p = dp dt k dp dt + p c ( r - r ) 2 p dr dt dp dt = 0 + rñ v rñ v = = 0 0 Po-Ram Kim 2 March 2010 # 22
Methodology Pressure Correction Equation Equation(9) can be written in SPH form as If the computation is convergent, RHS of equation(10) should be zero A pressure correction value could be obtained by Since the pressure correction scheme is iterative, a counting number n is introduced Po-Ram Kim 2 March 2010 # 23
Methodology Pressure Correction Equation The pressure at the new iteration is written as ω is the relaxation factor with a value under 1.0 With the pressure correction value, the velocity correction value can be obtained with the momentum equation v is the kinetic viscosity Po-Ram Kim 2 March 2010 # 24
Methodology Pressure Correction Equation The velocity correction can be obtained by The velocity is updated with Ω is the relaxation factor with a value under 1.0 Po-Ram Kim 2 March 2010 # 25
Methodology Pressure Correction Equation In each SPH time step Equations (11) and (15) are solved iteratively until convergent During the iteration Pressure disturbance will propagate to the neighboring particles Smoother pressure distribution will be obtained The pressure correction scheme actually provides a combination of the EOS method and the global pressure Poisson method With larger speed of sound, less pressure correction iterations will be required Po-Ram Kim 2 March 2010 # 26
Methodology Surface Tension Model Surface tension plays a fundamental role in many fluid phenomena Fluid breaking Droplet dynamics The surface tension results from the uneven molecular forces of attraction near the surface The surface tension will lead to a net force in the direction of surface normal Po-Ram Kim 2 March 2010 # 27
Methodology Surface Tension Model In SPH method, widely used form σ : Tension coefficient Smoother surface tension force Po-Ram Kim 2 March 2010 # 28
Results and Discussions All the simulations are performed within a single thread Intel Core2 Q6700 CPU 8GB RAM The reference densities in all the simulations All the 2D results are rendered with OpenGL All the 3D results with POVRay Po-Ram Kim 2 March 2010 # 29
Results and Discussions Divergence The particles are represented by dots The velocities of the particles are displayed with line segments starting from the positions of the particles Located in the rectangle of 0.2 0.2 The initial spacing of the particles is 0.02 2520 fluid particles are used in the simulation A speed of sound of 40 is taken The time step is 0.001 second Po-Ram Kim 2 March 2010 # 30
Results and Discussions Divergence Initial velocity : (0.5,0.0) Figure1(a-1) Figure1(a-2) Figure1(a-3) Figure1(a-4) Po-Ram Kim 2 March 2010 # 31
Results and Discussions Divergence Initial velocity : (0.5,0.5) Figure1(b-1) Figure1(b-2) Figure1(b-3) Figure1(b-4) Po-Ram Kim 2 March 2010 # 32
Results and Discussions Divergence We consider the computation has been convergent Usually, several times of the iterations are enough c = 5 and dt = 0.008 second exactly the same correction results are obtained Po-Ram Kim 2 March 2010 # 33
Results and Discussions Pressure Distribution Dam-break flow Initial height of water body = 2m Initial width of water body = 1m Initial particle spacing = 0.02m Total 5000 fluid particles are used In figure 2 Figure 2a : the pressure correction scheme is NOT used Figure 2b : the pressure correction scheme is used Purple color : the highest pressure Red color : the lowest pressure Po-Ram Kim 2 March 2010 # 34
Results and Discussions Pressure Distribution c = 102gH 62.6m/second dt = 8 10 5 c = 30 m/second dt = 2 10 4 figure2 Po-Ram Kim 2 March 2010 # 35
Results and Discussions Pressure Distribution As shown from the Figure 2, Without the pressure correction, the pressure fields obtained are unphysically noisy The pressure noise is significantly reduced Smoother pressure distribution is achieved Po-Ram Kim 2 March 2010 # 36
Results and Discussions Surface Tension The initial side length of cube is 0.005 m The initial spacing of the particles is 0.0002m About 12K particles in total are used in the simulation. dt = 0.00005 sec It takes about 0.3 second for one time step of simulation As the energy is damped by viscous and numerical dissipation The particles are stable at a spherical shape It takes very long time to achieve Po-Ram Kim 2 March 2010 # 37
Results and Discussions Surface Tension Evolution of a drop initially in cube shape under effect of surface tension with zero gravity 0.0sec 0.0255 sec 0.0518sec 0.0833se c 0.114sec 2.0sec Figure 3 Po-Ram Kim 2 March 2010 # 38
Results and Discussions Dam-break on a Wet Bed Initial value Height = 0.45m Length = 0.32m Width = 0.4m Initial water depth on the bed region = 0.018 Initial spacing of the particles = 0.006m Total # of particle = 267k Time step = 0.0005sec Simulation time = 7.5 sec Po-Ram Kim 2 March 2010 # 39
Results and Discussions Dam-break on a Wet Bed The free surface shape is the main focus of this simulation At the initial time A mushroom shape in free surface Two breaking waves enclosing voids will be generated 0.0sec 0.19sec 0.34sec 0.72sec Figure 4 Po-Ram Kim 2 March 2010 # 40
Results and Discussions Dam-break Flow on Complicated Topography Digital elevation model (DEM) data is used To generate the terrain surface Then a distance field is generated to enforce the solid boundary condition Initial velocity of water body is 3m/sec The initial spacing of particles is 0.04m Total # of particle is 330k particles The time step is 0.001 second When water interacts with the terrain surface Violent breakage and fragmentation occur Wave propagation and reflection are well produced Po-Ram Kim 2 March 2010 # 41
Results and Discussions Dam-break Flow on Complicated Topography 0.0sec 0.5sec 1.25sec 2.9sec 4.75sec 7.9sec Po-Ram Kim 2 March 2010 # 42
Results and Discussions CASA 2009 A simulation of dambreak with an obstacle in CASA 2009 shape is carried out When the water flows over the obstacle, violent breaking is produced When the flow settles down The shape of the terrain obstacle becomes visible The initial spacing of particles is 0.005m The time step is 0.0005 second Total # of particle is 310k particles Po-Ram Kim 2 March 2010 # 43
Results and Discussions CASA 2009 0.14sec 0.34sec 1.14sec 4.64sec Figure 6 Po-Ram Kim 2 March 2010 # 44
Conclusions and Future Work In the paper, A pressure correction equation is proposed for free surface flow The pressure disturbance incurred by the EOS is reduced No solution of pressure Poisson equation is required More accurate and efficient simulation is achieved The improved SPH method has been used in free surface and surface tension problem simulation Po-Ram Kim 2 March 2010 # 45
Conclusions and Future Work Our ongoing work Investigation of numerical properties of the pressure correction scheme Its applications to more fluid phenomena, such as multi-phase flow Po-Ram Kim 2 March 2010 # 46