# Helmholtz decomposition-based SPH

School of Computer Science and Technology, Division of Intelligence and Computing, Tianjin University, Tianjin, China

Abstract

Keywords： Water simulation ; SPH ; Helmholtz decomposition ; Conjugate Gradient

Content

^{[1]}, the smoothed particle hydrodynamics (SPH) method has been widely used in the simulation of various types of fluids. The SPH method, which yields the numerical solutions of partial differential equations, can easily deal with distorted and complex boundaries. In addition, SPH is relatively simple and provides stable results that are difficult to diverge

^{[2]}. After decades of development, the SPH method has made remarkable achievements in the simulation of fluids

^{[3,4]}, elastic solids

^{[5]}, foam

^{[6]}, snow

^{[7]}, multiphase flow

^{[8-10]}, and fluid control

^{[11-14]}.

^{[15,16]}uses an equation of state (EOS) to calculate pressure, which is suitable for compressible fluids. The weakly compressible SPH

^{[17]}imposes strict time-step restrictions on weakly compressible fluids, which limits its performance. Predictive-corrective incompressible SPH (PCISPH)

^{[18]}calculates the corresponding pressure value based on SSPH and EOS iterative prediction and correction of particle position. The PCISPH can deal with a larger time step and improve computational efficiency. It is based on the incompressible density of particles. The IISPH (Implicit Incompressible SPH) approach

^{[19]}allows a greater time step and a higher convergence rate, which further improves the computational efficiency, but its accuracy and stability remain to be improved.

^{[20]}generally requires information on 5-13 adjacent elements. In addition, the additional search time of neighboring particles makes the fluid simulation of SPH on a small scale more time-consuming. In terms of mathematics, SPH lacks a complete error analysis system. Once the SPH simulation is started, each particle will be in a disordered but non-random state, which makes the error analysis of SPH very difficult. Therefore, improving the accuracy and efficiency of the SPH method remains a difficult problem.

^{[21]}, while the initial application of SPH in the field of water simulation dates back to 2003

^{[16]}. The basic idea of SPH is to treat a continuous fluid as a collection of discrete fluid particles, and that the complex fluid motion is caused by the interaction between the fluid and rigid particles. The main process of SPH in water simulation involves the following steps:

^{[22]}. The Helmholtz decomposition theorem states that at an appropriate asymptotic infinity, a vector field can be decomposed into two parts:

*The divi-free part*represents the rotation, which can be expressed as the curl of the vector potential function.

*The curl-free part*represents translation and compression/expansion, which can be expressed as the gradient of a scalar potential function.

^{[23,24]}. Specifically, the Helmholtz decomposition must satisfy one of the following boundary conditions:

**n**is the outer normal vector of the boundary, and

**h**is the harmonic component, and its divergence and curl are both zero. In this case, the Helmholtz decomposition needs to satisfy the boundary conditions expressed by Equation (10).

^{[20]}, successive over-relaxation

^{[25]}, and CG

^{[26]}. Among them, CG can solve Poisson equations with complex boundary conditions in an efficient interactive way, so it is an ideal solution.

^{[27]}. For boundary handling, we used the scheme proposed by Akinci et al.

^{[28]}, surface tension was treated using the method proposed by He et al.

^{[29]}, and the liquid surface was reconstructed using the method proposed by Akinci et al.

^{[30]}. The images were rendered using Arnold.

^{[19]}and DFSPH (Divergence-free SPH)

^{[31]}. The radius of the liquid particles in all scenes was 0.025 m, and the maximum volume error rate was set to 0.01%. In addition, the liquids in all the scenes were simulated in a cubic water tank. Considering the lighting factor, we did not render the water tank.

Δt/ms | IISPH | DFSPH | Our scheme | |||
---|---|---|---|---|---|---|

avg. iter. | comp. time/ms | avg. iter. | comp. time/ms | avg.iter. | comp. time/ms | |

0.5 | 2.0 | 14.686 | 2.0/1.0 | 5.470 | 2.0 | 5.631 |

0.75 | 2.0 | 14.928 | 2.0/1.0 | 6.025 | 2.0 | 5.485 |

1 | 2.0 | 14.272 | 2.0/1.0 | 5.567 | 2.0 | 5.932 |

2 | 2.1 | 14.598 | 2.0/1.0 | 5.835 | 2.0 | 5.514 |

3 | 4.2 | 23.451 | 2.6/1.3 | 6.367 | 2.7 | 6.220 |

^{st}frame and stops at the 52

^{nd}frame, and then the right one starts to drain. This scene contains 1938 liquid particles at the beginning, and the number of particles increases with time. The efficiency comparison between the proposed method and other approaches in this scene is shown in Table 2. The efficiency of our method is higher than that of IISPH, but compared with DFSPH, our scheme only has advantages when the time step is 0.5ms.

Δt/ms | IISPH | DFSPH | Our scheme | |||
---|---|---|---|---|---|---|

avg. iter. | comp. time/ms | avg. iter. | comp. time/ms | avg. iter. | comp. time/ms | |

0.5 | 2.0 | 9.162 | 2.0/1.0 | 3.727 | 2.0 | 3.606 |

0.75 | 2.0 | 8.052 | 2.0/1.0 | 3.565 | 2.0 | 3.653 |

1 | 2.0 | 8.185 | 2.0/1.0 | 3.587 | 2.0 | 3.908 |

2 | 2.0 | 8.645 | 2.0/1.0 | 3.606 | 2.0 | 3.719 |

3 | 4.0 | 12.753 | 3.2/1.1 | 3.992 | 2.8 | 4.026 |

Δt/ms | IISPH | DFSPH | Our scheme | |||
---|---|---|---|---|---|---|

avg. iter. | comp. time/ms | avg. iter. | comp. time/ms | avg. iter. | comp. time/ms | |

0.5 | 2.0 | 30.618 | 2.0/1.0 | 15.901 | 2.0 | 15.516 |

0.75 | 2.0 | 30.083 | 2.0/1.0 | 14.812 | 2.0 | 14.920 |

1 | 2.1 | 34.150 | 2.0/1.0 | 15.085 | 2.0 | 15.384 |

2 | 4.3 | 42.266 | 2.1/1.0 | 15.527 | 2.1 | 15.123 |

3 | 11.5 | 80.475 | 5.3/1.5 | 18.987 | 5.1 | 18.644 |

Δt/ms | IISPH | DFSPH | Our scheme | |||
---|---|---|---|---|---|---|

avg. iter. | comp. time/ms | avg. iter. | comp. time/ms | avg. iter. | comp. time/ms | |

0.5 | 2.0 | 15.586 | 2.0/1.0 | 9.656 | 2.0 | 9.544 |

0.75 | 2.0 | 15.223 | 2.0/1.0 | 10.926 | 2.0 | 9.578 |

1 | 2.0 | 15.577 | 2.0/1.0 | 9.788 | 2.0 | 9.754 |

2 | 2.0 | 16.097 | 2.0/1.0 | 9.884 | 2.0 | 9.679 |

3 | 4.1 | 20.674 | 2.5/1.1 | 12.194 | 2.3 | 10.429 |

^{[19]}, the application CG cannot clamp the negative pressure between iterations to eliminate the cohesion effect. In fact, clamping the negative pressure in the CG results in an extremely unstable pressure field. Finally, when using CG to solve the linear equation system, i.e.,

Reference

Gingold R A, Monaghan J J. Smoothed particle hydrodynamics: theory and application to non-spherical stars. Monthly Notices of the Royal Astronomical Society, 1977, 181(3): 375–389 DOI:10.1093/mnras/181.3.375

Gissler C, Peer A, Band S, Bender J, Teschner M. Interlinked SPH pressure solvers for strong fluid-rigid coupling. ACM Transactions on Graphics, 2019, 38(1): 5 DOI:10.1145/3284980

Bao K, Zhang H, Zheng L L, Wu E H. Pressure corrected SPH for fluid animation. Computer Animation and Virtual Worlds, 2009, 20(2/3): 311–320 DOI:10.1002/cav.299

Huang C, Zhu J, Sun H Q, Wu E H. Parallel-optimizing SPH fluid simulation for realistic VR environments. Computer Animation and Virtual Worlds, 2015, 26(1): 43–54 DOI:10.1002/cav.1564

Peer A, Gissler C, Band S, Teschner M. An implicit SPH formulation for incompressible linearly elastic solids. Computer Graphics Forum, 2018, 37(6): 135–148 DOI:10.1111/cgf.13317

Bender J, Koschier D, Kugelstadt T, Weiler M. Turbulent micropolar SPH fluids with foam. IEEE Transactions on Visualization and Computer Graphics, 2018, 25(6): 2284–2295 DOI:10.1109/tvcg.2018.2805110

Gissler C, Henne A, Band S, Peer A, Teschner M. An implicit compressible SPH solver for snow simulation. ACM Transactions on Graphics, 2020, 39(4): 36 DOI:10.1145/3386569.3392431

Koschier D, Bender J, Solenthaler B, Teschner M. Smoothed particle hydrodynamics techniques for the physics based simulation of fluids and solids. 2020

Ren B, Li C F, Yan X, Lin M C, Bonet J, Hu S M. Multiple-fluid SPH simulation using a mixture model. ACM Transactions on Graphics, 2014, 33(5): 171 DOI:10.1145/2645703

Yan X, Jiang Y T, Li C F, Martin R R, Hu S M. Multiphase SPH simulation for interactive fluids and solids. ACM Transactions on Graphics, 2016, 35(4): 79 DOI:10.1145/2897824.2925897

Feng G, Liu S G. Detail-preserving SPH fluid control with deformation constraints. Computer Animation and Virtual Worlds, 2018, 29(1): e1781 DOI:10.1002/cav.1781

Zhang X Y, Liu S G. Parallel SPH fluid control with dynamic details. Computer Animation and Virtual Worlds, 2018, 29(2): e1801 DOI:10.1002/cav.1801

Zhang X Y, Liu S G. SPH haptic interaction with multiple-fluid simulation. Virtual Reality, 2017, 21(4): 165–175 DOI:10.1007/s10055-017-0308-1

Zhang X Y, Liu S G. SPH fluid control with self-adaptive turbulent details. Computer Animation and Virtual Worlds, 2015, 26(3/4): 357–366 DOI:10.1002/cav.1637

Monaghan J J. Smoothed particle hydrodynamics. Annual Review of Astronomy and Astrophysics, 1992, 30(1): 543–574 DOI:10.1146/annurev.aa.30.090192.002551

Müller M, Charypar D, Gross M. Particle-based fluid simulation for interactive applications. In: ACM SIGGRAPH/Eurographics Symposium on Computer Animation, 2003, 154–159

Becker M, Teschner M. Weakly compressible SPH for free surface flows. In: ACM SIGGRAPH/Eurographics Symposium on Computer Animation, 2007, 209–217

Solenthaler B, Pajarola R. Predictive-corrective incompressible SPH. ACM Transactions on Graphics, 2009, 28(3): 40 DOI:10.1145/1531326.1531346

Ihmsen M, Cornelis J, Solenthaler B, Horvath C, Teschner M. Implicit incompressible SPH. IEEE transactions on Visualization and Computer Graphics, 2013, 20(3): 426–435

Acharya S, Baliga B R, Karki K, Murthy J Y, Prakash C, Vanka S P. Pressure-based finite-volume methods in computational fluid dynamics. Journal of Heat Transfer, 2007, 129(4): 407–424 DOI:10.1115/1.2716419

Stam J. Stable fluids. In: SIGGRAPH, 1999,121–128

Bhatia H, Norgard G, Pascucci V, Bremer P T. The Helmholtz-hodge decomposition—A survey. IEEE Transactions on Visualization and Computer Graphics, 2013, 19(8): 1386–1404 DOI:10.1109/tvcg.2012.316

Chorin A J, Marsden J E. A mathematical introduction to fluid mechanics. New York, NY, Springer US, 1990 DOI:10.1007/978-1-4684-0364-0

Maria Denaro F. On the application of the Helmholtz-Hodge decomposition in projection methods for incompressible flows with general boundary conditions. International Journal for Numerical Methods in Fluids, 2003, 43(1): 43–69 DOI:10.1002/fld.598

Zapata M A U, van Bang D P, Nguyen K D. Parallel SOR methods with a parabolic-diffusion acceleration technique for solving an unstructured-grid Poisson equation on 3D arbitrary geometries. International Journal of Computational Fluid Dynamics, 2016, 30(5): 370–385 DOI:10.1080/10618562.2016.1234045

Helfenstein R, Koko J. Parallel preconditioned conjugate gradient algorithm on GPU. Journal of Computational and Applied Mathematics, 2012, 236(15): 3584–3590 DOI:10.1016/j.cam.2011.04.025

Koschier D, Bender J, Solenthaler B, Teschner M. Smoothed particle hydrodynamics techniques for the physics based simulation of fluids and solids. In: Eurographics, 2020, 1–41

Akinci N, Ihmsen M, Akinci G, Solenthaler B, Teschner M. Versatile rigid-fluid coupling for incompressible SPH. ACM Transactions on Graphics, 2012, 31(4): 1–8 DOI:10.1145/2185520.2185558

He X W, Wang H M, Zhang F J, Wang H, Wang G P, Zhou K. Robust simulation of sparsely sampled thin features in SPH-based free surface flows. ACM Transactions on Graphics, 2014, 34(1): 1–9 DOI:10.1145/2682630

Akinci G, Ihmsen M, Akinci N, Teschner M. Parallel surface reconstruction for particle-based fluids. Computer Graphics Forum, 2012, 31(6): 1797–1809 DOI:10.1111/j.1467-8659.2012.02096.x

Bender J, Koschier D. Divergence-free smoothed particle hydrodynamics. In: Proceedings of the 14th ACM SIGGRAPH / Eurographics Symposium on Computer Animation. Los Angeles California, New York, NY, USA, ACM, 2015,147–155 DOI:10.1145/2786784.2786796