PBF Sig Preprint
PBF Sig Preprint
PBF Sig Preprint
NVIDIA
Abstract
In fluid simulation, enforcing incompressibility is crucial for real-
ism; it is also computationally expensive. Recent work has im-
proved efficiency, but still requires time-steps that are impractical
for real-time applications. In this work we present an iterative den-
sity solver integrated into the Position Based Dynamics framework
(PBD). By formulating and solving a set of positional constraints
that enforce constant density, our method allows similar incom-
pressibility and convergence to modern smoothed particle hydro-
dynamic (SPH) solvers, but inherits the stability of the geometric,
position based dynamics method, allowing large time steps suit- (a) Real-time rendered fluid surface using ellipsoid splatting
able for real-time applications. We incorporate an artificial pressure
term that improves particle distribution, creates surface tension, and
lowers the neighborhood requirements of traditional SPH. Finally,
we address the issue of energy loss by applying vorticity confine-
ment as a velocity post process.
Müller [2003] showed that SPH can be used for interactive fluid
simulation with viscosity and surface tension, by using a low stiff-
ness equation of state (EOS). However to maintain incompressibil-
ity, standard SPH or weakly compressible SPH (WCSPH) [Becker
and Teschner 2007] require stiff equations, resulting in large forces
that limit the time-step size. Predictive-corrective incompressible
SPH (PCISPH) [Solenthaler and Pajarola 2009] relaxes this time-
step restriction by using an iterative Jacobi-style method that accu-
mulates pressure changes and applies forces until convergence. It
has the advantage of not requiring a user-specified stiffness value
and of amortizing the cost of neighbor finding over many density
1
To appear in ACM TOG 32(4).
2
To appear in ACM TOG 32(4).
and the total position update ∆pi including corrections from neigh- This purely repulsive term keeps particle density slightly lower than
bor particles density constraint (λ j ) is the rest density. Consequently, particles pull their neighbors in-
wards causing surface tension-like effects similar to the ones de-
1 scribed in [Clavet et al. 2005]. We note that this effect is a non-
∆pi = λi + λ j ∇W (pi − p j , h). (12)
ρ0 ∑
j physical artifact of the anti-clustering term and requires a trade off
between clustering errors and surface tension strength.
Without clustering problems our algorithm is free from the rule of
thumb that in SPH a particle must have 30-40 neighbors at all times,
improving efficiency.
ω i = ∇ × v = ∑ vi j × ∇p j W (pi − p j , h) (15)
j
vorticity
fi = ε (N × ω i ) . (16)
3
To appear in ACM TOG 32(4).
Figure 4: Density over the bunny drop simulation. Our algorithm Position based dynamics is popular for simulating deformable ob-
maintains compressibility similar to PCISPH at time-steps more jects such as cloth. We have prototyped two-way interaction be-
than twice as large. Color key: Blue, rest density. Red, PCISPH. tween position based cloth and fluid with promising results.
Green, our method.
Table 1: Performance results for several examples. A frame time of
16ms is used in all cases.
7 Rendering
Scene particles steps/frame iters/step time/step [ms]
Real-time fluid surfacing is performed using a GPU based ellipsoid Armadillo Splash 128k 2 3 4.2
splatting technique. Particle anisotropy is first computed using the Dam Break 100k 4 3 4.3
method of Yu and Turk [2013], and the surface is reconstructed Bunny Drop 80k 4 10 7.8
using a method based on the screen-space filtering presented in
[van der Laan et al. 2009].
Table 2: Breakdown of a frame (percentages) for two examples.
Constraint Solve includes collision handling with static objects, and
8 Results Velocity Update includes vorticity confinement and viscosity calcu-
lation.
We tested our algorithm by dropping a liquid bunny into a pool of
water (Figure 3) and compared our results with a PCISPH imple- Step Armadillo Splash Dam Break
mentation. For this scenario PCISPH is not stable with less than Integrate 1 1
10 sub-steps per frame (∆t = 0.0016s). In contrast our algorithm is Create Hash Grid 8 6
stable with a single step (∆t = 0.016s). Detect Neighbors 28 28
Constraint Solve 38 51
To compare compressibility we run PCISPH with 10 sub-steps and Velocity Update 25 14
4 pressure iterations, and our algorithm with 4 sub-steps and 10
iterations per sub-step, so that each performs 40 pressure iterations
per-frame in total. The point of this comparison is to show that
our method can achieve comparable results with larger time-steps, 10 Acknowledgments
allowing us to amortize the per-step costs of grid construction and
neighbor finding over more density iterations. The authors would like to thank NVIDIA for supporting our re-
search, especially Nuttapong Chentanez, Tae-Yong Kim and Simon
Our results are in good accordance, and a plot of density over the Schirm for their valuable feedback, Simon Green for his rendering
simulation confirms that the level of compression is similar despite work, and Adam Moravanszky and Christian Sigg for their encour-
the larger time-step for our method (Figure 4). Tables 1 and 2 sum- agement. We also wish to thank the anonymous reviewers for their
marize the performance of our algorithm in a selection of scenarios. generous comments and suggestions. The Bunny and Armadillo
4
To appear in ACM TOG 32(4).
models are used courtesy of the Stanford Computer Graphics Lab- muller-fischer presenation videos are available from the citation
oratory. page. In ACM SIGGRAPH 2006 Courses, ACM, New York, NY,
USA, SIGGRAPH ’06, 1–87.
C LAVET, S., B EAUDOIN , P., AND P OULIN , P. 2005. Particle-
based viscoelastic fluid simulation. In Proceedings of the 2005
ACM SIGGRAPH/Eurographics symposium on Computer ani-
mation, ACM, New York, NY, USA, SCA ’05, 219–228.
F EDKIW, R., S TAM , J., AND J ENSEN , H. W. 2001. Visual sim-
ulation of smoke. In Proceedings of the 28th annual conference
on Computer graphics and interactive techniques, ACM, New
York, NY, USA, SIGGRAPH ’01, 15–22.
G REEN , S. 2008. Cuda particles. nVidia Whitepaper 2, 3.2, 1.
H ONG , J.-M., L EE , H.-Y., YOON , J.-C., AND K IM , C.-H. 2008.
Figure 5: Dam break scenario at t=6.0, Left: vorticity confine- Bubbles alive. In ACM SIGGRAPH 2008 papers, ACM, New
ment disabled. Right: vorticity confinement enabled, note the visi- York, NY, USA, SIGGRAPH ’08, 48:1–48:4.
bly higher splash.
L ENTINE , M., A ANJANEYA , M., AND F EDKIW, R. 2011. Mass
and momentum conservation for fluid simulation. In Proceed-
ings of the 2011 ACM SIGGRAPH/Eurographics Symposium on
Computer Animation, ACM, New York, NY, USA, SCA ’11, 91–
100.
M ONAGHAN , J. J. 1992. Smoothed particle hydrodynamics. An-
nual Review of Astronomy and Astrophysics 30, 1, 543–574.
M ONAGHAN , J. J. 1994. Simulating free surface flows with sph.
J. Comput. Phys. 110, 2 (Feb.), 399–406.
M ONAGHAN , J. J. 2000. Sph without a tensile instability. J.
Comput. Phys. 159, 2 (Apr.), 290–311.
M ÜLLER , M., C HARYPAR , D., AND G ROSS , M. 2003. Particle-
based fluid simulation for interactive applications. In Proceed-
Figure 6: Convergence of our method over multiple iterations at ings of the 2003 ACM SIGGRAPH/Eurographics symposium on
t = 1.0 in the dam break scenario. Computer animation, Eurographics Association, Aire-la-Ville,
Switzerland, Switzerland, SCA ’03, 154–159.
References M ÜLLER , M., H EIDELBERGER , B., H ENNIX , M., AND R AT-
CLIFF , J. 2007. Position based dynamics. J. Vis. Comun. Image
A KINCI , N., I HMSEN , M., A KINCI , G., S OLENTHALER , B., AND Represent. 18, 2 (Apr.), 109–118.
T ESCHNER , M. 2012. Versatile rigid-fluid coupling for incom- R AVEENDRAN , K., W OJTAN , C., AND T URK , G. 2011. Hybrid
pressible sph. ACM Trans. Graph. 31, 4 (July), 62:1–62:8. smoothed particle hydrodynamics. In Proceedings of the 2011
A LDU ÁN , I., AND OTADUY, M. A. 2011. Sph granular flow ACM SIGGRAPH/Eurographics Symposium on Computer Ani-
with friction and cohesion. In Proceedings of the 2011 ACM mation, ACM, New York, NY, USA, SCA ’11, 33–42.
SIGGRAPH/Eurographics Symposium on Computer Animation, S CHECHTER , H., AND B RIDSON , R. 2012. Ghost sph for animat-
ACM, New York, NY, USA, SCA ’11, 25–32. ing water. ACM Trans. Graph. 31, 4 (July), 61:1–61:8.
B ECKER , M., AND T ESCHNER , M. 2007. Weakly compressible S MITH , R. 2006. Open dynamics engine v0.5 user guide.
sph for free surface flows. In Proceedings of the 2007 ACM SIG-
GRAPH/Eurographics symposium on Computer animation, Eu- S OLENTHALER , B., AND G ROSS , M. 2011. Two-scale particle
rographics Association, Aire-la-Ville, Switzerland, Switzerland, simulation. ACM Trans. Graph. 30, 4 (July), 81:1–81:8.
SCA ’07, 209–217.
S OLENTHALER , B., AND PAJAROLA , R. 2009. Predictive-
B ELL , N., Y U , Y., AND M UCHA , P. J. 2005. Particle-based sim- corrective incompressible sph. In ACM SIGGRAPH 2009 pa-
ulation of granular materials. In Proceedings of the 2005 ACM pers, ACM, New York, NY, USA, SIGGRAPH ’09, 40:1–40:6.
SIGGRAPH/Eurographics symposium on Computer animation,
ACM, New York, NY, USA, SCA ’05, 77–86. VAN DER L AAN , W. J., G REEN , S., AND S AINZ , M. 2009. Screen
space fluid rendering with curvature flow. In Proceedings of the
B ODIN , K., L ACOURSIERE , C., AND S ERVIN , M. 2012. Con- 2009 symposium on Interactive 3D graphics and games, ACM,
straint fluids. IEEE Transactions on Visualization and Computer New York, NY, USA, I3D ’09, 91–98.
Graphics 18, 3 (Mar.), 516–526.
Y U , J., AND T URK , G. 2013. Reconstructing surfaces of particle-
B RACKBILL , J. U., AND RUPPEL , H. M. 1986. Flip: A method based fluids using anisotropic kernels. ACM Trans. Graph. 32, 1
for adaptively zoned, particle-in-cell calculations of fluid flows (Feb.), 5:1–5:12.
in two dimensions. J. Comput. Phys. 65, 2 (Aug.), 314–343.
Z HU , Y., AND B RIDSON , R. 2005. Animating sand as a fluid.
B RIDSON , R., F EDKIW, R., AND M ÜLLER -F ISCHER , M. 2006. In ACM SIGGRAPH 2005 Papers, ACM, New York, NY, USA,
Fluid simulation: Siggraph 2006 course notes fedkiw and SIGGRAPH ’05, 965–972.