0% found this document useful (0 votes)
6 views

2013_TVCG_IISPH

Uploaded by

459258639
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

2013_TVCG_IISPH

Uploaded by

459258639
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

AUTHOR’S VERSION 1

Implicit Incompressible SPH


Markus Ihmsen, Jens Cornelis, Barbara Solenthaler, Christopher Horvath, and Matthias Teschner

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

1 I NTRODUCTION to WCSPH, while the overall speed-up with respect


to WCSPH can be up to 55 or 23, respectively [6], [7].

T HE SPH method [1] has proven to be effective at


generating compelling water effects in computer
graphics. Enforcing incompressibility in SPH is im-
As an alternative to EOS approaches with locally
computed penalty forces, projection schemes, also
referred to as splitting [8], can be used to compute
portant for the visual quality of a simulated scenario the pressure field in SPH. First, intermediate velocities
and this paper contributes to that topic. are predicted without considering the pressure forces.
Standard SPH (SSPH) uses an equation of state (EOS) Then, a PPE is solved to compute pressure such that
to compute pressure that results in forces penalizing the resulting pressure forces correct the intermediate
the current compression [1]. Pressure is computed velocities to a divergence-free state. This is a stan-
from locally evaluated compression weighted with a dard technique in grid-based approaches, e.g. [8], [9],
user-defined stiffness value. The straightforward com- [10], but a detailed discussion of grid-based variants
putation of pressure values makes SSPH well suited is beyond the scope of this paper. In Lagrangian
for efficient simulations of compressible fluids, e.g. [2], approaches, projection schemes can be distinguished
[3]. For weakly compressible fluids (WCSPH), e.g. [4], with respect to the source term in the Poisson formu-
[5], a rather stiff EOS is used that imposes a severe lation. Here, either the divergence of the intermediate
time step restriction limiting the overall performance. velocity field, e.g. [11], [12], the compression due to
the intermediate velocity field, e.g. [13], [14], [15],
The performance of SSPH has been significantly im-
or a combination of both, e.g. [16], [17], are used.
proved by EOS-based predictor-corrector schemes,
As incompressibility is an important ingredient for
e.g. PCISPH [6] and local Poisson SPH [7]. Pressure
realistic fluid animations, the compression formula-
forces are modeled as constraint forces that resolve
tion seems to be preferable in SPH. As discussed for
compression induced by non-pressure forces. The re-
SPH in [11] and for the Moving Particle Semi-Implicit
spective pressure values are computed by iteratively
method (MPS) in [12], only using the divergence term
predicting and correcting the particle positions based
tends to result in perceivable compression.
on an EOS. The approaches still rely on local informa-
tion, but in contrast to SSPH and WCSPH, the EOS The numerically challenging approximation of the
does not contain a user-defined stiffness parameter. Laplacian with SPH is a major issue in SPH projection
PCISPH and local Poisson SPH handle time steps that schemes. Directly discretizing the Laplace operator
are up to two orders of magnitude larger compared with second-order kernel derivatives is known to
be sensitive to the sampling. This is discussed in,
e.g. [18], [11], where approximations are proposed. In
• M. Ihmsen, J. Cornelis and M. Teschner are with the Department of
Computer Science, University of Freiburg.
order to avoid the SPH discretization of the Laplacian,
some authors propose to compute the pressure field
• B. Solenthaler is with the Department of Computer Science, ETH on a background grid at a different, typically lower
Zürich.
resolution, e.g. [19], [17], [20], [21]. After transferring
• C. Horvath is with Pixar Animation Studios, Emeryville, California. the pressure values from the grid to the particles,
particle pressure values can be refined, e.g. using an
2 AUTHOR’S VERSION

Pressure forces in SSPH penalize compression, but do


not guarantee an incompressible state at time t + ∆t.
In contrast to SSPH, the proposed IISPH method com-
putes pressure by iteratively solving a linear system.
To build the system with unknown pressure values,
we mainly employ a discretized form of the conti-
nuity equation and the projection (splitting) concept,
e.g. [8]. Additional assumptions, approximations or
simplifications are avoided. The linear system can be
solved efficiently with a matrix-free implementation.

Fig. 1. A cargo ship in highly agitated water. Up to 2.1 Derivation


30 million particles are processed in 44 seconds per
simulation step with a time step of 0.004 seconds and IISPH is based on a semi-implicit form of the density
a compression of less than 0.1%. prediction using the time rate of change of the density.
The formulation is obtained by directly discretizing
the continuity equation Dρ Dt = −ρ∇ · v at time t using
EOS as in [21]. a forward difference for the time derivative of the
density ρi (t+∆t)−ρ
∆t
i (t)
and the SPH concept for the
SPH projection schemes, also referred to as incom- divergence of the velocity ∇·vi = − ρ1i j mj vij ∇Wij ,
P
pressible SPH (ISPH) methods, are currently consid- which yields
ered impractical in the context of computer graphics.
As stated in, e.g. [11], [22], the performance of ISPH ρi (t + ∆t) − ρi (t) X
= mj vij (t + ∆t)∇Wij (t). (3)
does not scale well with the problem domain and ∆t j
is particularly an issue for large-scale scenarios. Our
work addresses this point. We propose a discretization This specific discretization introduces unknown rela-
of the PPE that significantly improves the convergence tive velocities vij (t + ∆t) = vi (t + ∆t) − vj (t + ∆t) that
of the solver and the stability of the time-integration depend on unknown pressure forces at time t which
scheme. This results in a significant speedup not only are linear in unknown pressure values at time t.
compared to previous ISPH approaches, but more im- Using a semi-implicit Euler scheme for position and
portantly compared to PCISPH, the current state-of- velocity update, the velocity in (3) can be rewritten
the-art. Large time steps and small density deviations Fadv (t)+Fp (t)
as: vi (t + ∆t) = vi (t) + ∆t i mi i with unknown
of down to 0.01% can be handled in typical scenar-
pressure forces Fpi (t) and known non-pressure forces
ios. In contrast to previous projection schemes, the
Fadv
i (t) such as gravity, surface tension and viscosity.
approach scales well with the simulation domain. This
Following the projection concept, we consider inter-
is demonstrated on a number of large scale scenarios Fadv (t)
with up to 40 million fluid particles computed on a mediate (predicted) velocities viadv = vi (t) + ∆t imi
16-core desktop PC, e.g. Figure 1. which result in an intermediate density
X
ρadv
i = ρi (t) + ∆t mj vijadv
∇Wij (t). (4)
j
2 I MPLICIT I NCOMPRESSIBLE SPH (IISPH) We now search for pressure forces to resolve the
compression, i.e., the deviation from the rest density:
SSPH computes the density of particle i at time t
p
!
Fpi (t) Fj (t)
P
as ρi (t) = j mj Wij (t), where mj denotes the mass 2
X
of a particle j and Wij (t) = W (xi (t) − xj (t)) is a ∆t mj − ∇Wij (t) = ρ0 − ρadv
i .
j
m i m j
kernel function with finite support. xi and xj denote
(5)
the position of particles i and j. Pressure pi (t) is
computed with an EOS [4] as Note, that (5) corresponds to (3) with ρi (t + ∆t) = ρ0 .
 γ  Using (2) in (5), we get a linear system A(t)p(t) = b(t)
κρ0 ρi (t)
pi (t) = −1 , (1) with one equation and one unknown pressure value
γ ρ0 pi (t) for each particle. b(t) corresponds to the right-
where ρ0 is the rest density of the fluid, κ and γ hand side of (5), i.e. bi (t) = ρ0 −ρadv
i . For each particle,
control the stiffness. As proposed in [1], momentum- we finally have an equation of the form
preserving pressure forces are computed as X
aij pj = bi = ρ0 − ρadv (6)
i ,
j
!
p
X pi (t) pj (t)
Fi (t) = −mi mj + ∇Wij (t). (2) where we have skipped the time index t to improve
j
ρ2i (t) ρ2j (t)
the readability. This is also done in the following.
IHMSEN et al.: IMPLICIT INCOMPRESSIBLE SPH 3

2.2 Discussion Algorithm 1 IISPH using relaxed Jacobi. l indicates


the iteration.
Equation (4) corresponds to the prediction step of the procedure P REDICT A DVECTION
projection, while (5) is the PPE that is used for the for all particle i do P
pressure computation. The respective pressure forces compute ρi (t) = j mj Wij (t)
are applied in the correction step of the projection Fadv (t)
predict viadv = vi (t) + ∆t imi
scheme: vi (t + ∆t) = viadv + ∆tFpi (t)/mi . The source P m
dii = ∆t2 j − ρ2j ∇Wij (t)
term states the density invariance condition which i

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

3.1 Relaxed Jacobi and evaluate the pressure pl+1


i with

Employing relaxed Jacobi, we iteratively solve (6) for 1


the individual pressure values pi as pl+1
i = (1 − ω)pli + ω ρ0 − ρadv
i −
aii
!
ρadv l
P X 
ρ0 − − j6=i aij pj
X X
pl+1 = (1 − ω)pli + ω
i
, (8) mj dij plj − djj plj − djk plk ∇Wij .
i
aii j j k6=i
(13)
where l denotes the iteration index and ω is called the
relaxation factor.
3.1.1 Implementation
In order
P to compute (8), we need to determine aii
and j6=i aij plj which can be efficiently computed. For In our implementation, dii and aii are precomputed
extracting the coefficients, the displacement caused by and stored. The coefficients dij are computed to get
the pressure force is rewritten as aii , but not stored. In each iteration, two passes over
! the particles are required P to update pl+1
i . The first
p
2 Fi 2 pi
X pj pass computes and stores j dij plj . The second pass
∆t = −∆t mj + 2 ∇Wij computes pl+1 using the stored j dij plj and djj . The
P
mi j
ρ2i ρj i
l l l
P P
 X mj  X mj sum is computed as
k6=i djk pk P k djk pk − dji pi ,
= − ∆t2 2 ∇Wij pi + −∆t2 2 ∇Wij pj , where the term l
k djk pk can be accessed at the
ρ i ρj
|
j
{z }
j | {z } particle, while dji is computed. Thus, an explicit com-
dii dij putation of the non-diagonal elements aij is avoided.
(9) Alg. 1 summarizes the simulation update using the
proposed relaxed Jacobi pressure solve.
where dii pi denotes the displacement of i due to the IISPH performs two loops over all particles per itera-
pressure value pi and dij pj the movement caused tion (PCISPH requires three loops). Moreover, the two
by the pressure values pj of neighboring particle j. loops do not contain data dependencies. Accordingly,
Plugging (9) into (5) and denoting the neighbors of j the method is well suited for parallel architectures.
with k yields While an equation for a particle contains up to 402
non-zero coefficients, the implementation only stores
ρ0 − ρadv
i = seven scalar values per particle, namely aii , dii and
plj .
X   P
d
X X
mj dii pi + dij pj − djj pj − djk pk ∇Wij . j ij
j j k We observed an optimal convergence for the relax-
(10) ation factor ω = 0.5 in all settings. The convergence is
also optimized by initializing p0i = 0.5 pi (t−∆t). While
grid-based projection schemes commonly initialize
P
Note that k djk pk includes pressure values pi since
i and j are neighbors. In order to separate pi in this p0i = 0, e.g. [8], using p0i = pi (t−∆t) would be intuitive
sum, we write in our Lagrangian approach. In our experiments, how-
ever, we observed that the coefficient 0.5 generally
provides a close to optimal convergence. The right-
X X
djk pk = djk pk + dji pi . (11)
k k6=i hand side of (13) can be rearranged to compute the
density at t + ∆t including pressure forces. Thus, the
Taking these considerations into account, the right- compression of the fluid can be predicted in each iter-
hand side of (10) can be split up into parts that contain ation. By terminating the iterations for a compression
pi values and other parts that contain pressures pj and below a pre-defined value η, the user can control the
pk as compression.
X By enforcing ρi (t + ∆t) = ρ0 , pressure forces induce
ρ0 − ρadv
i = pi mj (dii − dji ) ∇Wij + a positive change of density for particles with a
j predicted density smaller than the rest density, i.e.
ρadv
X 
< ρ0 . In this case, pressure forces act as attraction
X X
mj dij pj − djj pj − djk pk ∇Wij . i
j j k6=i
forces [25]. Although this might be interpreted as
surface tension, we consider the induced cohesive
effect as too exaggerated, e.g., splashes are noticeably
Now, we can compute the coefficients aii as absorbed (Figure 2, left). In EOS solvers, attracting
X pressure forces are prohibited by clamping negative
aii = mj (dii − dji ) ∇Wij , (12) pressures to zero. We adopt the same concept and
j clamp negative pressures in each iteration.
IHMSEN et al.: IMPLICIT INCOMPRESSIBLE SPH 5

Fig. 2. Exaggerated surface tension by attracting pres-


sure forces (left). Distorted alignment of surface parti- Fig. 4. Subsequent frames of a resting fluid pillar
cles (right) caused by clamping bi = min(0, ρ0 − ρadv of 5 meters height, simulated at low resolution. The
i ).
Velocities are color coded, where white is maximum. convergence criterion is set to a maximum density
error of 1%. This leads to oscillations in the pressure
field and, thus, the free surface. Pressure values are
color coded, where red is maximum.

pressure forces. Intuitively, we could disallow a pos-


itive change of density due to pressure by clamping

bi to negative values with bi = min 0, ρ0 − ρadv
i . Un-
fortunately, this adaptation causes implausible align-
Fig. 3. A two-scale simulation based on [26] using ments of single particles at the fluid surface for CG
IISPH. The radii of the purple low-resolution and the and Jacobi as demonstrated in the right-hand side of
blue high-resolution particles are 0.004m and 0.002m, Figure 2.
respectively.

Finally, in contrast to hybrid particle-mesh solvers,


the proposed method builds purely on SPH. Thus, it
4 B OUNDARY H ANDLING
can be integrated into sophisticated SPH frameworks,
e.g. [26], as demonstrated in Figure 3. IISPH does not impose special requirements on the
boundary handling. All boundary handling schemes
that work with PCISPH or ISPH, can also be used
3.2 Conjugate Gradient with IISPH. This section describes the combination
of IISPH with an exemplary boundary handling ap-
We have implemented Conjugate Gradient (CG) proach presented in [29] that is used in all experi-
with a diagonal pre-conditioner. Although CG shows ments.
promising convergence rates, we experienced two
issues which are highlighted in the following. The rigid-fluid coupling [29] employs rigid bound-
ary particles bi that contribute to the density of a
Symmetry. The coefficient matrix is not symmetric fluid particle i. This contribution scales with the local
as each aij is scaled by mi /ρ2i . Symmetry can be number density δbi ≡
P
W b b and is defined as
bj i j
enforced by assuming that ρi = ρj = ρ0 and mi = mj Ψb (ρ0i ) = ρ0i /δbi . Incorporating this method, the
for all particles. While this symmetrization works for density estimation (3) is extended to
uniform masses, it is invalid for settings with non-
uniform masses such as adaptively sampled SPH, X X
e.g. [3], [27], or multi-phase simulations, e.g. [28]. ρi (t + ∆t) = mj Wij + Ψb (ρ0i )Wib
Note that non-symmetry is not an issue for relaxed j b
X
Jacobi. + ∆t mj vij (t + ∆t)∇Wij
j
Negative Pressure. Using relaxed Jacobi, we propose X
to clamp negative pressures in order to eliminate ex- + ∆t Ψb (ρ0i )vib (t + ∆t)∇Wib . (14)
aggerated cohesion effects. For CG, however, clamp- b
ing in between the iterations leads to invalid states.
We also observed instabilities in case of any change in For a weak coupling, we assume a constant rigid ve-
the final pressure field, such as clamping of negative locity vb throughout the pressure iterations. Therefore,
pressure values or disregarding pairwise-attracting we can estimate the density without pressure forces
6 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

PCISPH IISPH PCISPH / IISPH


total comp. time [s] total comp. time [s] ratio
∆t [s] avg. iter. pressure overall avg. iter. pressure overall iterations pressure overall
0.0005 4.3 540 1195 2.2 148 978 2.0 3.6 1.2
0.00067 7.2 647 1145 2.9 149 753 2.5 4.3 1.5
0.001 14.9 856 1187 4.9 164 576 3.0 5.2 2.1
0.0025 66.5 1495 1540 18.4 242 410 3.6 6.2 3.8
0.004 - - - 33.5 273 379 - - -
0.005 - - - 45.8 297 383 - - -

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.

PCISPH IISPH PCISPH / IISPH


total comp. time [s] total comp. time [s] ratio
∆t [s] avg. iter. pressure overall avg. iter. pressure overall iterations pressure overall
0.0025 4.2 416 978 2.0 106 709 2.1 3.9 1.4
0.005 15.4 688 964 4.9 132 435 3.1 5.2 2.2
0.01 - - - 13.2 182 338 - - -
0.02 – - - 78.8 510 588 - - -

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

total comp. time [s] avg. comp. time / ∆t


∆t [s] avg. iter. pressure overall scene part. r avg. ∆t iter. pressure total
0.0005 18.8 759 1588 6M 1.000m 0.0500s 5.2 2.5s 5.7s
City
0.00067 31.1 959 1563 40M 0.500m 0.0250s 4.1 15.8s 38.2s
0.001 55.9 1123 1535 Island 10M 0.075m 0.0054s 13.5 6.5s 13.6s
Cargo 30M 0.050m 0.0040s 16.1 24.9s 44.2s
TABLE 3 Street 28M 0.025m 0.0025s 17.3 23.1s 41.8s
Performance of ISPH [13] for the breaking dam
TABLE 4
scenario (Figure 5). The tolerated error was set to
Measurements for the large scale scenarios.
0.01%.

simulation step, Figure 7 compares the convergence


rate for varying time steps using the same setup. The
experiments show in all cases that the convergence
rate of the IISPH discretization is superior to the ISPH
discretization.
Furthermore, the approximation of the Laplacian (17)
employed in ISPH does not accurately consider the
pressure force, but uses different approximations for
the pressure gradient and the Laplacian. Therefore,
the predicted level of compression when solving the
PPE might significantly differ from the real compres-
sion at time t + ∆t. For the breaking dam scene, the
obtained density error of ISPH is 0.29% for a time
step of 0.004s. In contrast, the error introduced by
the semi-implicit formulation employed in IISPH is Fig. 9. A city with an area of 5 · 106 m2 is flooded
much smaller. IISPH could even obtain a compression at low resolution (top), 6 million particles, and high
of 0.011% for the largest time step of 0.005s. resolution (bottom), 40 million particles. Velocities are
Source term. IISPH employs velocity projection in the color coded.
source term. In order to illustrate the positive effect
of this choice on the time step, we have compared proposed method, incompressibility is enforced by
velocity projection (4) with position projection (18) as imposing density constraints. In contrast to ISPH and
proposed in [13]. For the comparison, we use the pro- IISPH, the incompressibility condition is not derived
posed IISPH formulation in (5) for the Laplacian. For from the continuity equation, but from constraint
the breaking dam scenario, the setting with position dynamics. Density constraints are enforced through
projection could only handle time steps up to 0.001s, the use of Lagrange multipliers and not by employing
whereas four times larger time steps can be handled standard SPH formulations for pressure and pressure
with velocity projection. force.
Performance. Finally, we compare the performance of In [15], a setup of a fluid pillar with 10K particles
ISPH [13] to IISPH on the breaking dam scenario. The of radius r = 0.01m is presented. For a time step of
timings of ISPH are given in Table 3, while the timings 0.0083s and a fixed number of 15 pressure iterations,
of IISPH are given in Table 1. ISPH reaches the best a volume compression of 17% has been reported.
performance at a time step of 0.001s for the breaking We simulated this test case with IISPH using the
dam scenario with an overall computation time of parameters given in [15]. For the same number of
1535s where 1123s is represented by the pressure pressure iterations per frame, IISPH enforced a vol-
computation. For the same time step, IISPH computes ume compression of 1.2% which is 14 times less com-
the pressure field in 164s which is 6.8 times faster than pression than stated for the constraint-based method.
ISPH. IISPH reaches the best overall performance at a This indicates an improved convergence of the IISPH
time step of 0.004s with 379s. This is an overall speed pressure solver compared to [15].
up of 4 compared to the ISPH formulation presented
in [13].
5.3 Large Scale Scenarios
Comparison to Constraint Fluids
Poor performance scaling has been reported for all
Another related approach for incompressible SPH previous global SPH methods, e.g., for ISPH in [11]
is presented in [15], [22], and [35]. Similar to the and for constraint fluids in [22]. In contrast, the per-
10 AUTHOR’S VERSION

well for large-scale scenarios. The straight-forward


derivation of our scheme shows that its accuracy
and fast convergence is based on the fact that only
few approximations are employed. As our approach
is closely related to ISPH, we thoroughly discussed
similarities and differences. Further, we compared
IISPH with PCISPH and constraint fluids [15]. These
comparisons indicate that IISPH yields higher conver-
gence rates than the previous schemes, independent
of the size of the domain.
Although the convergence rate of IISPH is superior to
PCISPH and ISPH, the required number of iterations
Fig. 10. A scripted island rises out of the water. still grows faster than linear with the time step. In
10 million SPH fluid particles. One simulation step is order to improve performance for larger time steps,
computed in 14 seconds with a time step of 0.0054 we plan to investigate more advanced solvers, e.g.,
seconds and a compression of less than 0.1%. multi-grid [11]. In this context, we would like to
eliminate the exaggerated cohesion caused by IISPH
with Conjugate Gradient. This might be addressed
formance of IISPH scales well with the size of the by employing a robust scheme for correcting the
simulation domain as the convergence and the costs erroneous SPH density values at the free surface.
per particle are invariant to the number of particles.
The IISPH formulation builds purely on established
This is verified on a large scale scenario where a city
SPH discretizations and accounts for physical values
with an area of 5 · 106 m2 is flooded at two different
such as pressure. Therefore, it might be possible to
resolutions (Figure 9). In the low resolution, we simu-
map the proposed discretization to simulate other ma-
lated up to 6 million particles with a radius of 1 meter.
terials, e.g., granular material [36], [37] or deformable
The high resolution contains up to 40 million particles
objects [38]. The robustness of IISPH and the alterna-
with radius 0.5 meter. The factor of 6.7 in the number
tive formulation for predicting the density might also
of particles instead of 8 stems from the shallow parts
improve the stability of multi-phase simulations with
of the simulation. The IISPH solver took 5.7s to update
high density contrasts and could lead to an alterna-
the low-resolution simulation and 38s for the high
tive formulation for multi-resolution SPH fluids. This
resolution, see Table 4. This is a performance ratio
might be a potential direction for future work.
of 6.7 which shows the perfect linear scaling of the
proposed method.
The practicability of the approach is further demon- ACKNOWLEDGMENTS
strated by three large-scale scenarios with particle
counts ranging from 10 to 30 million including two- This project is supported by the German Research
way coupling with rigid objects. Performance mea- Foundation (DFG) under contract numbers SFB/TR-
surements are given in Table 4. 8 and TE 632/1-2. The authors would like to thank
NVIDIA ARC GmbH for supporting this work.
In the Island scene (Figure 10), 10 million particles
of volume radius r = 0.075m were simulated with
an average time step of 0.0054s. On average, the R EFERENCES
simulation update took 13.6s where the pressure solve
[1] J. Monaghan, “Smoothed particle hydrodynamics,” Ann. Rev.
represents 6.5s. For the larger scenes, Street (Figure 11) Astron. Astrophys., vol. 30, pp. 543–574, 1992.
and Cargo (Figure 1), strong turbulences were gener- [2] M. Müller, D. Charypar, and M. Gross, “Particle-based fluid
ated by high-velocity inflows. The Street scene with 28 simulation for interactive applications,” in Proc. of ACM SIG-
GRAPH/Eurographics Symposium on Computer Animation, 2003,
million particles and r = 0.025m was updated in 41.8s pp. 154–159.
where 23.1s were spent on solving the pressure. This [3] B. Adams, M. Pauly, R. Keiser, and L. Guibas, “Adaptively
is similar to the performance of the Cargo scene, 30 sampled particle fluids,” ACM Trans. on Graphics (SIGGRAPH
Proc.), vol. 26, no. 3, pp. 48–54, 2007.
million particles and r = 0.05m, where a simulation [4] J. Monaghan, “Simulating free surface flows with SPH,” Jour-
step is computed in 44.2s with 24.9s represented by nal of Comp. Phys., vol. 110, no. 2, pp. 399–406, 1994.
the computation of the pressure field. [5] M. Becker and M. Teschner, “Weakly compressible SPH for free
surface flows,” in Proc. of the ACM SIGGRAPH/Eurographics
Symposium on Computer Animation, 2007, pp. 209–217.
[6] B. Solenthaler and R. Pajarola, “Predictive-corrective incom-
6 C ONCLUSION pressible SPH,” ACM Trans. on Graphics (SIGGRAPH Proc.),
vol. 28, pp. 40:1–40:6, 2009.
[7] X. He, N. Liu, H. Wang, and G. Wang, “Local Poisson SPH
We presented a discretization of the PPE that can be for viscous incompressible fluids,” Computer Graphics Forum,
solved efficiently, handles large time steps and scales vol. 31, pp. 1948–1958, 2012.
IHMSEN et al.: IMPLICIT INCOMPRESSIBLE SPH 11

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-

You might also like