Title: Fluid Simulation for Computer Animation
1Fluid Simulation forComputer Animation
- Greg Turk
- College of Computing and GVU Center
- Georgia Institute of Technology
2Why Simulate Fluids?
- Feature film special effects
- Computer games
- Medicine (e.g. blood flow in heart)
- Because its fun
3Fluid Simulation
- Called Computational Fluid Dynamics (CFD)
- Many approaches from math and engineering
- Graphics favors finite differences
- Jos Stam introduced fast and stable methods to
graphics Stam 1999
4Navier-Stokes Equations
??u0 ut k?2u (u??)u ?p f
Incompressibility
5Navier-Stokes Equations
??u0 ut k?2u (u??)u ?p f
Incompressibility
Diffusion
Pressure
Advection
Body Forces
Change in Velocity
6Finite Differences Grids
- All values live on regular grids
- Need scalar and vector fields
- Scalar fields amount of smoke or dye
- Vector fields fluid velocity
- Subtract adjacent quantities to approximate
derivatives
7Scalar Field (Smoke, Dye)
5.1
1.2
3.7
cij
8Diffusion
cij
9Diffusion
ct k?2c
cijnew cij k Dt (ci-1j ci1j cij-1
cij1 - 4cij)
10Diffusion Blurring
11Vector Fields (Fluid Velocity)
uij (ux,uy)
12Vector Field Diffusion
ut k?2u
blur the x-velocity and the y-velocity
13Effect of Viscosity
Low Medium High Very
High
- Each one is ten times higher viscosity than the
last
Melting and Flowing Mark Carlson, Peter J.
Mucha, Greg Turk Symposium on Computer Animation
2002
14Low Viscosity
15High Viscosity
16Variable Viscosity
- Viscosity can vary based on position
- Viscosity field k can change with temperature
- Need implicit solver for high viscosity
17Wax
18(No Transcript)
19(No Transcript)
20Navier-Stokes Equations
??u0 ut k?2u (u??)u ?p f
Incompressibility
Diffusion
Pressure
Advection
Body Forces
Change in Velocity
21Advection Pushing Stuff
22Advection
23Advection
0.3
2.7
0.3
24Scalar Field Advection
ct (u??)c
25Vector Field Advection
ut (u??)u
push around x-velocity and y-velocity
26Advection
- Easy to code
- Method stable even at large time steps
- Problem numerical inaccuracy diffuses flow
27Diffusion/dissipation in first order advection
After 360 degree rotation using first order
advection
Original Image
28Solution BFECC
1) Perform forward advection 2) Do backward
advection from new position 3) Compute error and
take correction step 4) Do forward advection from
corrected position
Flowfixer Using BFECC for Fluid
Simulation ByungMoon Kim, Yingjie Liu, Ignacio
Llamas, Jarek Rossignac Eurographics Workshop on
Natural Phenomena 2005
29Intuition to BFECC
30(No Transcript)
31Navier-Stokes Equations
??u0 ut k?2u (u??)u ?p f
Incompressibility
Diffusion
Pressure
Advection
Body Forces
Change in Velocity
32Divergence
High divergence
33Enforcing Incompressibility
- First do velocity diffusion and advection
- Find closest vector field that is
divergence-free - Need to calculate divergence
- Need to find and use pressure
34Measuring Divergence
??u?
??uij(uxi1j - uxi-1j) (uyij1-uyij-1)
35Pressure Term
unew u ?p
Take divergence of both sides
?? unew ?? u ???p
?? u ?2p
36Pressure Term
?? u ?2p
pnew p e(?? u - ?2p)
Let dij ?? uij
pnewij pij e(dij - (pi-1j pi1j pij-1
pij1 - 4pij))
37Pressure Term
unew u ?p
and velocity is now divergence-free
Found nearest divergence-free vector field to
original.
38Fluid Simulator
- Diffuse velocity
- Advect velocity
- Add body forces (e.g. gravity)
- Pressure projection
- Diffuse dye/smoke
- Advect dye/smoke
39Real-Time Fluid Dynamics for Games Jos Stam,
March 2003 (CDROM link is to source code)
www.dgp.toronto.edu/people/stam/reality/Research/p
ubs.html
40Rigid Objects
- Want rigid objects in fluid
- Use approach similar to pressure projection
Rigid Fluid Animating the Interplay Between
Rigid Bodies and Fluid Mark Carlson, Peter J.
Mucha and Greg Turk Siggraph 2004
41Rigid Fluid Method
1) Solve Navier-Stokes on entire grid, treating
solids exactly as if they were fluid
2) Calculate forces from collisions and relative
density
3) Enforce rigid motion for cells inside rigid
bodies
42(No Transcript)
43 Small-scale liquid-solid Interactions
What makes large water and small water behave
differently? Surface Tension (water 72
dynes/cm at 25º C) Viscosity (water 1.002 x 10-3
Ns/m2 at 20º C)
Lake ( gt1 meter)
Water drops (millimeters)
44Surface Tension
Normal (always pointing outward) Surface Tension
Force
45Water/Surface Contact
hydrophillic
hydrophobic
46Contact Front
47Virtual Surface Method
Air
Liquid
Solid
48Virtual Surface Method
1) Creating a virtual surface 2) Estimate
curvature from new fluid surface 3) Kink will
push the fluid towards stable contact angle
49Virtual Surface Method
1) Creating a virtual surface 2) Estimate
curvature from new fluid surface 3) Kink will
push the fluid towards stable contact angle
50(No Transcript)
51Swimming Creatures
- Create assemblies of rigid objects (figures with
joints) - Use Rigid Fluid method
- Work in progress (Nipun Kwatra, Chris Wojtan,
Peter J. Mucha, Irfan Essa, Greg Turk)
52(No Transcript)
53(No Transcript)
54(No Transcript)
55Erosion and Corrosion
- Fluids modify rigid objects
- Erosion fluid sweeps away particles
- Corrosion fluid eats away objects
- Work in progress (Chris Wojtan, Peter J. Mucha,
Mark Carlson, Greg Turk)
56(No Transcript)
57(No Transcript)
58(No Transcript)
59(No Transcript)
60Fluid Researchers at Georgia Tech
Mark Carlson Peter J. Mucha Huamin Wang ByungMoon
Kim Yingjie Liu Ignacio Llamas Jarek
Rossignac Chris Wojtan Nipun Kwatra Irfan
Essa Greg Turk
61Questions?
62Implementation of BFECC
A Advection step u velocity field
h A(g, u) r A(h,-u) s g (g-r)/2 g
A(s,u)