Fluid Simulation for Computer Graphics

Fluid Simulation for Computer Graphics
Xiaosheng Li∗
Insititute of Software, Chinese Academy of Sicences
Figure 1: Complex surface tension phenomena such as this crown splash can be simulated by fluid simulation, courtesy of Nils Thuerey
Abstract
1
Introduction
This paper introduces the foundational theory for fluid simulation in
computer graphics. Two popular methods are discussed and compared in details. The hot topics of fluid simulation in recent 10
years are also discussed and a regular way to get a research idea is
introduced. Finally, the paper end up with my own work in the past
two years.
Fluid phenomena are very common in daily life, such as smoke,
fire, water et al. Fluid simulation remains one of the hottest topics
in recent year due to its application in feature film special effects,
computer games, et al. Fig. 2 is a snapshot from Shark Night 3D,
an 18ft Mako shark dines on a waverunner garnished with college
boy. The complex water shot was produced by Exotic Matter.
CR Categories: I.3.7 [Computer Graphics]: Three-Dimensional
Graphics and Realism—Animation;
Keywords: fluid simulation, computer graphics, animation
Links:
∗ e-mail:
DL
PDF
[email protected]
Figure 2: A snapshot from Shark Night 3D
Most of the algorithms used in computer graphics originate from
the field of computational fluid dynamics(CFD). Though CFD has a
long history, it is quite different to most of the research in computer
graphics. CFD aims at solving the problems in fluid dynamics as
accurate as possible while CG aims at simulating plausible visual
effects efficiently. Many CG researchers get inspired by methods
used in CFD. Based on these inspirations, they proposed lots of
effective and efficient methods for CG applications.
The 3D Navier-strokes equation was first introduced to computer
graphics by Foster et al. [Foster and Metaxas 1995], which is solved
on a staggered MAC-grid along with marker particles to represent fluid. Stam [Stam 1999] proposed a semi-Lagrangian method to
solve these equations, stable for large time step. Foster and Fedkiw [Foster and Fedkiw 2001] and Enright et al. [Enright et al. 2002]
extended level set method with massless particles to track the free
surface of the water. Particles were used to correct the error of level
set caused by advection. Highly realistic results were achieved by
their method. Muller et al. [M¨uller et al. 2003] used smoothed particle hydrodynamics (SPH) to interactively simulate water motion.
Zhu and Bridson [Zhu and Bridson 2005] used FLIP method to animate sand as water. FLIP couples grid based method and particle
based method to simulate fluid and it can easily avoid the problems
caused by pure grid based method or pure particle based method.
Lattice Boltzmann Method (LBM) is another class of method for
fluid simulation. Thurey [Thurey 2007] presented excellent works.
For a more detail survey, please refer to Bridson [Bridson 2008].
2
to be a linear system and solve for velocity with preconditioned
conjugate gradient technique(PCG). All steps are computed on a
regular or MAC-style grid (Fig. 3).
One big problem with grid-based method is that we use semiLagrangian method to solve the advection term. Semi-Lagrangian
method traces one time step back, and takes the interpolation of last
step as current step, which is actually weighted average of last time
step. So it suffers lots of numerical dissipation. In fluid simulation,
the details will disappear very soon, which is not desired.
Another class of method for solving NSE is particle-based method,
such as simple particle system or smoothed particle hydrodynamics(SPH) [M¨uller et al. 2003]. Particle-based method is suitable
for solving extern force and advection. However it’s difficult to
ensure truly incompressibility and surface representation often appears blobby. In addition, since we use explicit integration, we need
smaller time step.
The advantages and disadvantages are roughly illustrated in
Fig. 4 [Tan and Yang 2009]
Fluid Simulation Basis
Fluid movement is governed by the Navier-Strokes Equations
(NSE), the inviscid version can be written as
∂u
1
+ (u · ∇)u = − ∇p + g
∂t
ρ
(1)
∇·u=0
(2)
NSE can be easily derived from Newton’s equation. Derivation is
omitted here for simplicity. Equ. 1 describes the movement of the
fluid while Equ. 2 enforces the incompressibility of the fluid body.
Figure 4: Comparision between Lagrangian method and Eulerian
method
Two simple fluid simulations are demonstrated in Fig. 5, which you
can view the differences between grid-based method and particlebased method.
4
Research Topics
Most fluid simulations in CG are phenomenon-driven. One effective way to find a research topic may be:
1. Find a phenomenon, which is difficult to be simulated with
existing methods
Figure 3: Steps for solving NSE in grid-based method, note that we
omit viscosity term in Equ. 1
2. Search literatures on this phenomenon
3. Pick a method for modeling this phenomenon
3
Numerical Simulation
Typically, NSE can be solved with gird-based method and particlebased method. There are also a lot of hybrid method combining
these two kinds of method. The basic grid-based method for solving
NSE is operator splitting. We can solve NSE by splitting it into
three terms, namely extern force, advection and incompressibility.
Extern force is solved with explicit integration; advection is solved
with semi-Lagrangian method proposed by J. Stam in 1999 [Stam
1999]; incompressibility is solved by discretizing pressure equation
4. Make improvements on the method to fit requirements of CG
5. Demonstrate results
You can see this regular routine in many fluid simulation papers,
such as [Pfaff et al. 2012].
Recent years, the research topics of fluid simulation are focused on:
• Better numerical methods for solving NSE
• Better surface tracking methods
Figure 5: Fluid solver: Left: particle-based Right: grid-based
• Interesting fluid phenomena simulation
• Coupling between fluid and rigid body, deformable body, thin
shell et al.
Though we have met a lot of success but it’s still a long way to go
in fluid simulation for CG.
5
Summary
I will end up with my work in the past two years in IOS. In the first
year, I had to take some courses to get enough credits but I spent
most of my time reading papers on rendering and modeling. In addition, I carried out a project on modeling and rendering of feathers, which was an improvement of the work of [Chen et al. 2002].
Fig. 6 is the final result of my work. In the second year, I spent
all my time reading papers on fluid simulation and implementing
some of the algorithms. Coding is boring and time-consuming but
it’s necessary if you want to achieve some great results in this area.
Some fluid simulation results are demostrated in Fig. 7
In this year, I will focus all my effort on a NSFC project of my
advisor. I will conduct animation behavior simulation of flying lives
like birds, fishes etc. in the fluids such as air or water.
References
B RIDSON , R. 2008. Fluid simulation for computer graphics. A K
Peters.
C HEN , Y., X U , Y., G UO , B., AND S HUM , H.-Y. 2002. Modeling
and rendering of realistic feathers. ACM Trans. Graph. 21, 3
(July), 630–636.
E NRIGHT, D., M ARSCHNER , S., AND F EDKIW, R. 2002. Animation and rendering of complex water surfaces. ACM Trans.
Graph. 21 (July), 736–744.
Figure 6: Modeling and rendering of realistic feathers on a bald
eagle
F OSTER , N., AND F EDKIW, R. 2001. Practical animation of liquids. In Proceedings of the 28th annual conference on Computer
graphics and interactive techniques, ACM, New York, NY, USA, SIGGRAPH ’01, 23–30.
F OSTER , N., AND M ETAXAS , D. 1995. Realistic animation of
liquids. In Graphical Models and Image Processing, 23–30.
¨
M ULLER
, M., C HARYPAR , D., AND G ROSS , M. 2003. Particlebased fluid simulation for interactive applications. In Proceedings of the 2003 ACM SIGGRAPH/Eurographics symposium on
Computer animation, Eurographics Association, Aire-la-Ville,
Switzerland, Switzerland, SCA ’03, 154–159.
Figure 7: fluid simulation with instructed mesh
P FAFF , T., T HUEREY, N., AND G ROSS , M. 2012. Lagrangian
vortex sheets for animating fluids. ACM Trans. Graph. 31, 4
(July), 112:1–112:8.
S TAM , J. 1999. Stable fluids. In Proceedings of the 26th annual conference on Computer graphics and interactive techniques,
ACM Press/Addison-Wesley Publishing Co., New York, NY,
USA, SIGGRAPH ’99, 121–128.
TAN , J., AND YANG , X. 2009. Physically-based fluid animation:
A survey. Science in China Series F: Information Sciences 52,
723–740. 10.1007/s11432-009-0091-z.
T HUREY, N. 2007. Physically based animation of free surface
flows with the lattice boltzmann method. PhD thesis.
Z HU , Y., AND B RIDSON , R. 2005. Animating sand as a fluid.
ACM Trans. Graph. 24 (July), 965–972.