2013_TVCG_IISPH
2013_TVCG_IISPH
Abstract—We propose a novel formulation of the projection method for Smoothed Particle Hydrodynamics (SPH). We combine
a symmetric SPH pressure force and an SPH discretization of the continuity equation to obtain a discretized form of the pressure
Poisson equation (PPE). In contrast to previous projection schemes, our system does consider the actual computation of the
pressure force. This incorporation improves the convergence rate of the solver. Furthermore, we propose to compute the density
deviation based on velocities instead of positions as this formulation improves the robustness of the time-integration scheme. We
show that our novel formulation outperforms previous projection schemes and state-of-the-art SPH methods. Large time steps
and small density deviations of down to 0.01% can be handled in typical scenarios. The practical relevance of the approach is
illustrated by scenarios with up to 40 million SPH particles.
Index Terms—physically-based simulation, fluid dynamics, Smoothed Particle Hydrodynamics, incompressibility, implicit inte-
gration
we prefer over the alternative divergence term. The for all particle i do P
divergence term tends to result in problematic com- ρadv
i = ρi (t) + ∆t j mj vij adv
∇Wij (t)
pression as discussed in, e.g. [11], [12]. Thus, our p0i = 0.5 pi (t − ∆t)
approach is closely related to ISPH schemes which compute aii (12)
employ density constraints, e.g. [13]. However, our procedure P RESSURE S OLVE
formulation significantly improves the convergence l=0
of the solver and the stability of the time-integration while ρlavg − ρ0 > η ∨ l < 2 do
scheme due to two novel aspects discussed in the for Pall particle i doP
following. l 2 mj l
j dij pj = ∆t j − ρ2 (t) pj ∇Wij (t)
j
Discretization of the Laplacian. Our discretization
for all particle i do
of the PPE differs from previous formulations that
compute pl+1i (13)
employ additional approximations for the Laplace
pi (t) = pl+1
i
operator, e.g. [11], [13], [14], [16]. These ISPH meth-
ods start with a continuous form of the PPE. Then, l =l+1
they discretize the Laplacian and the source term. procedure I NTEGRATION
The resulting system does not consider the pressure for all particle i do
force that is finally derived from the pressure field. vi (t + ∆t) = viadv + ∆tFpi (t)/mi
Thus, there is no distinguished form of the pressure xi (t + ∆t) = xi (t) + ∆tvi (t + ∆t)
force with a special relation to the computed pres-
sure field. In contrast, our derivation considers the
relation between pressure and pressure force. First, update of the neighborhood is avoided. According to
we do not start with a continuous PPE, but with the our observations, (4) tolerates significantly larger time
continuous continuity equation which is discretized. steps and, thus, improves the robustness of the time-
The main goal of this discretization is the introduction integration scheme.
of v(t+∆t) which is expressed with the pressure force On the other hand, the system contains a significantly
term used in the final velocity update. Thereby, we larger number of non-zero entries compared to previ-
can finally apply the particular form of the pressure ous projection schemes. As (6) contains a nested sum,
force that has been considered in the computation the coefficients aij are non-zero for the neighbors j
of the pressure field. This incorporation improves of particle i and for neighbors of neighbors of i. Typi-
the convergence rate and the overall performance as cally, a particle has 30-40 neighbors [23]. Nevertheless,
shown in comparisons to ISPH in Sec. 5. the system can be solved very efficiently in a matrix-
Source term. In previous ISPH implementations and free way as presented in the following.
in predictive-corrective EOS solvers, ρi (t + ∆t) is
computed based on predicted positions as
X 3 S OLVER
ρi (t + ∆t) = mj W (x∗i − x∗j , h), (7)
The system can be solved in various ways. For simi-
j
lar systems, grid approaches commonly apply SOR,
where x∗i equals xadv
i in ISPH and the predicted e.g. [24], Conjugate Gradient, e.g. [9], or multigrid
positions during iterations in predictive-corrective solvers, e.g. [10], while SPH approaches often employ
EOS solvers. However, solving (7) implies a re- Conjugate Gradient for PPEs, e.g. [11]. We have imple-
computation of the neighborhood. In PCISPH, this mented and evaluated relaxed Jacobi and Conjugate
overhead is avoided by only updating distances for Gradient to solve our formulation. Multigrid solvers
the current neighborhood. This introduces an error have not been considered due to their involved setup
which gets more significant for larger displacements for irregular samplings.
∆xi = ∆tviadv + ∆t2 Fpi /mi . For the proposed system, the relaxed Jacobi solver is
In contrast, IISPH predicts the density based on ve- more practical than Conjugate Gradient. We therefore
locities (4). As known values ∇Wij (t) are preferred describe implementation details of the relaxed Jacobi
over unknown values ∇Wij (t + ∆t) without affecting solver first in Sec. 3.1, followed by a discussion of
the error order of the discretization, the approximative possible reasons for that outcome in Sec. 3.2.
4 AUTHOR’S VERSION
Fig. 5. Breaking dam with 100K particles. Fig. 6. Blender scenario with 90K particles.
as 5 R ESULTS
X X We integrated the solvers into an SPH framework
ρadv
i = mj Wij + Ψb (ρ0i )Wib which employs the cubic spline kernel and the viscous
j b
X force presented in [23]. Surface tension is modeled
adv
+ ∆t mj vij ∇Wij with [5]. Neighborhood search and fluid update are
X
j parallelized using the techniques described in [30].
Ψb (ρ0i ) viadv − vb (t + ∆t) ∇Wib . The fluid surface is reconstructed with [31], [32].
+ ∆t
b Performance measurements are given for a 16-core
3.46 GHz Intel i7 with 64 GB RAM. Images were
Pressure forces correct the density field such that rendered with mental ray [33].
Fp
!
p
2 Fi 2 j
X
adv
ρi (t + ∆t) = ρi + mj ∆t − ∆t ∇Wij 5.1 Convergence Criterion
j
mi mj
p Realistic SPH simulations require low density errors
2 Fi
X
+ Ψb (ρ0i ) ∆t ∇Wib in order to avoid perceivable volume changes, i.e.,
mi
b oscillations of the free surface. While the original
PCISPH method considered the maximum density
In [29], boundary particles b do not have an individual
error with a threshold of 1%, we recommend to
pressure, but exert a pressure force which is depen-
maintain an average density error of less than 0.1%.
dent on the fluid pressure pi as
Although average and maximum density errors are
pi closely related, their ratio varies throughout a simula-
Fpi←b = −mi Ψb (ρ0i ) ∇Wib (15) tion, i.e., if a maximum density error is preserved, the
ρ2i
average density error and therefore the fluid volume
Thus, the displacement due to pressure is computed might change over time. Such variations of the aver-
as age density error result in oscillations of the pressure
field and in perceivable simulation artifacts such as
Fpi X mj jumping of the free surface. This issue is particularly
∆t2 = −∆t2 2 ∇Wij pj +
mi j |
ρj perceivable in simulations with growing water depth
{z }
dij as illustrated in Figure 4. In this scenario, the obtained
average compression varied between 0.3% and 0.6%
X mj X 1 when tolerating a maximum error of 1%. We found
−∆t2 ∇Wij − ∆t2 Ψb (ρ0i ) 2 ∇Wib pi .
j
ρ2i ρi that these artifacts can be avoided by considering the
b
| {z } estimated average density error with a threshold of
dii 0.1% as the convergence criterion. Please note that this
criterion restricts the overall global volume change
Accordingly, the pressure update with relaxed Jacobi of the fluid to 0.1%, but tolerates locally delimited
reads maximum density errors. The average density error
η, also referred to as density deviation, compression
1
pl+1
i = (1 − ω)pli + ω ρ0 − ρadv
i or volume compression, is consistently used as con-
aii vergence criterion in all experiments with all solvers.
X X X
− mj dij plj − djj plj − djk plk ∇Wij
j j k6=i
! 5.2 Performance Comparisons
X X
− Ψb (ρ0i ) dij plj ∇Wib . (16) We present comparisons with three existing solvers.
b j First, we illustrate the performance of IISPH by com-
paring to PCISPH, the current state-of-the-art pressure
IHMSEN et al.: IMPLICIT INCOMPRESSIBLE SPH 7
TABLE 1
Comparison of IISPH with PCISPH using different time steps for a breaking dam with 100K particles (Figure 5).
Timings are given for the whole simulation (300 frames). The largest ratio in the pressure computation time and
the lowest total computation times are marked bold. The maximum volume compression was set to 0.01%. The
particle radius was 0.025m.
TABLE 2
Comparison of IISPH with PCISPH using different time steps for the blender scene with 90K particles
(Figure 6). Timings are given for the whole simulation (1000 frames). The largest ratio in the pressure
computation time and the lowest total computation times are marked bold. The maximum volume compression
was set to 0.1%. The particle radius was 0.05m.
solver in computer graphics. Second, we illustrate the is obtained. Further, the speed-ups grow for larger
benefits of our PPE formulation by comparing to the time steps. This indicates that the convergence of
discretization of the PPE used in ISPH [13]. Third, IISPH scales better compared to PCISPH for growing
we briefly compare to constraint fluids [15] due to time steps. As shown in the accompanying video, the
similarities in the concept. simulation results are in good agreement.
SPH computation time per simulated frame. IISPH
Comparison to PCISPH computes the pressure field up to six times faster than
We compare IISPH to PCISPH in two scenarios with PCISPH. However, the overall speed-up in the com-
different particle radii r and different average density putation time per simulated frame also depends on
errors η to illustrate the effect of these parameters other SPH components, e.g. the neighborhood query.
on the time step and the convergence rate of the The neighborhood query adds roughly constant costs
solvers. Figure 5 shows a breaking dam with 100K per simulation step. However, the total costs per
particles, r = 0.025m, and η = 0.01%. Figure 6 shows simulated frame for finding the neighbors decrease
a blender with 90K particles, r = 0.05m, and η = 0.1%. with larger time steps as less simulation steps are
The performance measurements are summarized in performed per simulated frame. Interestingly, increas-
Table 1 and Table 2. ing costs for the pressure solve and decreasing costs
for the neighborhood search result in the fact, that
Pressure solve. Compared to PCISPH, IISPH com- IISPH and PCISPH do not necessarily achieve their
putes the pressure field up to 6.2 times faster for best overall performance for the largest possible time
the breaking dam and up to 5.2 times faster in the step. For the breaking dam, IISPH and PCISPH handle
blender scene. These speed-ups are a combination of time steps of up to 0.005s and 0.0025s, respectively.
an improved convergence and an improved efficiency The factor of two with respect to the maximum time
per iteration. Regarding the convergence, IISPH re- step is, however, practically irrelevant for the overall
quires up to 3.6 and 3.1 times less iterations compared computation time, as both solvers achieve their best
to PCISPH. Combined with the improved efficiency performance for time steps of 0.004s and 0.00067s,
per iteration (2 particle loops in IISPH vs. 3 particle corresponding to a factor of six with respect to the
loops in PCISPH), a speed-up of up to 6.2 and 5.2
8 AUTHOR’S VERSION
Fig. 7. Average number of iterations of PCISPH, IISPH Fig. 8. Convergence of IISPH and ISPH for one
and ISPH for different time steps in the breaking dam simulation step of the breaking dam scenario with
scenario. ∆t = 0.0025s.
optimal time step and a factor of three with respect proposed IISPH discretization of the Laplacian and
to the overall performance gain. The situation in the the source term.
blender scenario is analogous. ISPH [13]. Here, the Laplacian is approximated as
Time step. As discussed in [6], PCISPH scales pres- proposed in [11] with
sure values by a global stiffness value δ which is time-
X 8 pij xij ∇Wij
step dependent. So, dependent on the time step, δ ∇2 pi = mj 2 (17)
might be too large and cause overshooting, or it might j (ρi + ρj ) xij · xij + 2
be too small and negatively influence the convergence
where = 0.1h avoids singularities. For the density
rate. The performance and stability of PCISPH are,
invariant scheme, the source term is computed with
thus, heavily influenced by the time step. For IISPH,
(ρ0 − ρ∗ ) /∆t2 where ρ∗ is computed based on the
the time step has less effect on the performance. The
intermediate particle positions xadv
i = xi (t) + ∆tviadv
influence of the time step on the number of iterations
as
is illustrated in Figure 7. X
ρ∗ = mj W (xadv
i − xadv
j ). (18)
For the performance comparisons (Table 1 and Ta- j
ble 2), we kept the time step fix for each simulation
This yields the following discretization of the PPE
run. However, in practice, adaptive time-stepping
schemes are desirable. For PCISPH, the coupling of ∇2 pi = (ρ0 − ρ∗i ) /∆t2 . (19)
the time step size with the convergence rate and
the stability is an issue that requires sophisticated Finally, pressure forces are computed with the sym-
techniques to realize adaptive time steps, e.g. [34]. metric pressure force (2).
In contrast, changing time steps do not negatively Discretization of the Laplacian. IISPH takes contri-
affect the robustness of IISPH. The time step can just butions of second-ring neighbors into account which
be set according to the CFL condition, e.g. ∆t = improves the convergence rate compared to ISPH.
min 0.4h/ viadv , without rolling back the simulation In order to verify this, we compared the left-hand
as required in PCISPH [34], [21]. In practice, this has side of (5) with the approximate discretization of
a positive effect on the overall performance gain of the Laplacian in ISPH (17). In this comparison, we
IISPH compared to PCISPH. only vary the discretization of the Laplacian. The
source term is taken from (5) in both cases. Figure 8
Comparison to ISPH illustrates the convergence of both implementations
for one simulation step of the breaking dam scenario
IISPH differs from ISPH presented in [13] in the dis- with equivalent initial particle configurations. IISPH
cretization of the Laplacian and the source term. Both achieves an estimated compression of 0.01% after 23
aspects improve the performance of IISPH. While our iterations, while ISPH takes 231 iterations. As we
discretization of the Laplacian improves the conver- only use different discretizations of the Laplacian
gence rate compared to [13], our source term allows in both settings, the experiment indicates that the
for larger time steps compared to the source term specific form of the Laplacian in IISPH significantly
of [13]. We first summarize the ISPH formulation improves the convergence rate compared to ISPH.
of [13], followed by an analysis of the benefits of the While Figure 8 compares the convergence for one
IHMSEN et al.: IMPLICIT INCOMPRESSIBLE SPH 9
Fig. 11. Street flood. This scene contains up to 28 million fluid particles. IISPH computes one simulation step in
42 seconds with an average time step of 0.0025 seconds and a compression of less than 0.1%.
[8] R. Bridson, Fluid Simulation for Computer Graphics. A K Peters faces,” in Proc. of ACM SIGGRAPH/Eurographics Symposium on
/ CRC Press, 2008. Computer Animation, 2008, pp. 211–218.
[9] N. Foster and R. Fedkiw, “Practical animation of liquids,” in [29] N. Akinci, M. Ihmsen, B. Solenthaler, G. Akinci, and
Proc. SIGGRAPH 2001, 2001, pp. 23–30. M. Teschner, “Versatile rigid-fluid coupling for incompressible
[10] N. Chentanez and M. Müller, “Real-time eulerian water simu- SPH,” ACM Trans. on Graphics (SIGGRAPH Proc.), vol. 30, no. 4,
lation using a restricted tall cell grid,” ACM Trans. on Graphics pp. 72:1–72:8, 2012.
(SIGGRAPH Proc.), vol. 30, pp. 82:1–82:10, 2011. [30] M. Ihmsen, N. Akinci, M. Becker, and M. Teschner, “A parallel
[11] S. Cummins and M. Rudman, “An SPH projection method,” SPH implementation on multi-core CPUs,” Computer Graphics
Journal of Comp. Physics, vol. 152, no. 2, pp. 584–607, 1999. Forum, vol. 30, no. 1, pp. 99–112, 2011.
[12] S. Premoze, T. Tasdizen, J. Bigler, A. Lefohn, and R. Whitaker, [31] B. Solenthaler, J. Schläfli, and R. Pajarola, “A unified particle
“Particle-based simulation of fluids,” Computer Graphics Forum model for fluid-solid interactions,” Computer Animation and
(Eurographics Proc.), vol. 22, pp. 401–410, 2003. Virtual Worlds, vol. 18, no. 1, pp. 69–82, 2007.
[13] S. Shao and Y. Lo, “Incompressible SPH method for simulating [32] G. Akinci, M. Ihmsen, N. Akinci, and M. Teschner, “Paral-
Newtonian and non-Newtonian flows with a free surface,” lel surface reconstruction for particle-based fluids,” Computer
Advances in water resources, vol. 26, no. 7, pp. 787–800, 2003. Graphics Forum, vol. 32, no. 1, pp. 99–112, 2012.
[33] NVIDIA ARC, “mental ray 3.9 [software],”
[14] A. Khayyer, H. Gotoh, and S. Shao, “Enhanced predictions
http://www.mentalimages.com, 2011. [Online]. Available:
of wave impact pressure by improved incompressible SPH
http://www.mentalimages.com
methods,” Applied Ocean Research, vol. 31, no. 2, pp. 111 – 131,
[34] M. Ihmsen, N. Akinci, M. Gissler, and M. Teschner, “Boundary
2009.
Handling and Adaptive Time-stepping for PCISPH,” in Proc.
[15] K. Bodin, C. Lacoursire, and M. Servin, “Constraint fluids,” VRIPHYS, 2010, pp. 79–88.
IEEE TVCG, vol. 18, no. 3, pp. 516–526, 2012. [35] M. Macklin and M. Mueller, “Position Based Fluids,” ACM
[16] X. Hu and N. Adams, “An incompressible multi-phase SPH Transactions on Graphics (Proceedings SIGGRAPH), vol. 32, pp.
method,” Journal of Comp. Phys., vol. 227, no. 1, pp. 264–278, 1–5, 2013.
2007. [36] I. Alduán and M. A. Otaduy, “SPH granular flow with fric-
[17] F. Losasso, J. Talton, N. Kwatra, and R. Fedkiw, “Two-way tion and cohesion,” in Proc. of ACM SIGGRAPH/Eurographics
coupled SPH and particle level set fluid simulation,” IEEE Symposium on Computer Animation, 2011, pp. 25–32.
TVCG, vol. 14, no. 4, pp. 797–804, 2008. [37] M. Ihmsen, A. Wahl, and M. Teschner, “High-Resolution
[18] J. Morris, P. Fox, and Y. Zhu, “Modeling low Reynolds number Simulation of Granular Material with SPH,” in Proceedings
incompressible flows using SPH,” Journal of Comp. Phys., vol. VRIPHYS. Best Paper Award, 2012, pp. 53–60.
136, no. 1, pp. 214–226, 1997. [38] M. Becker, M. Ihmsen, and M. Teschner, “Corotated SPH for
[19] J. Liu, S. Koshizuka, and Y. Oka, “A hybrid particle-mesh deformable solids,” Eurographics Workshop on Natural Phenom-
method for viscous, incompressible, multiphase flows,” Journal ena, pp. 27–34, 2009.
of Comp. Phys., vol. 202, no. 1, pp. 65–93, 2005.
[20] G. Yue, C. Li, S. Hu, and B. Barsky, “Simulating gaseous fluids
with low and high speeds,” Computer Graphics Forum, vol. 28,
no. 7, pp. 1845–1852, 2009.
[21] K. Raveendran, C. Wojtan, and G. Turk, “Hybrid
Smoothed Particle Hydrodynamics,” in Proc. of ACM
SIGGRAPH/Eurographics Symposium on Computer Animation,
2011, pp. 33–42.
[22] M. Ellero, M. Serrano, and P. Español, “Incompressible
smoothed particle hydrodynamics,” Journal of Computational
Physics, vol. 226, no. 1, pp. 1731–1752, 2007.
[23] J. Monaghan, “Smoothed particle hydrodynamics,” Reports on
Progress in Physics, vol. 68, no. 8, pp. 1703–1759, 2005.
[24] N. Foster and D. Metaxas, “Realistic animation of liquids,”
Graph. Models Image Process., vol. 58, no. 5, pp. 471–483, 1996.
[25] H. Schechter and R. Bridson, “Ghost SPH for animating wa-
ter,” ACM Trans. on Graphics (SIGGRAPH Proc.), vol. 31, no. 4,
2012.
[26] B. Solenthaler and M. Gross, “Two-scale particle simulation,”
ACM Trans. on Graphics (SIGGRAPH Proc.), vol. 30, no. 4, pp.
72:1–72:8, 2011.
[27] J. Orthmann and A. Kolb, “Temporal blending for adaptive
SPH,” Computer Graphics Forum, vol. 31, no. 8, pp. 2436–2449,
2012.
[28] B. Solenthaler and R. Pajarola, “Density contrast SPH inter-