9. 9
Pressure term
Fluid moves from high pressure to low pressure
Inversely proportional to fluid density, ρ
f
u
u
u
u
u
p
t
1
0
2
10. 10
External Force Term
Can be or represent anythying
Used for gravity or to let animator “stir”
f
u
u
u
u
u
p
t
1
0
2
12. 12
Discretizing in space and time
• We have differential equations
• We need to put them in a form
we can compute
• Discetization – Finite Difference
Method
16. 16
Make a linear system
It all boils down to
Ax=b.
d
d
d
d n
n
xn
n
x
b
b
x
x
x
2
1
2
1
?
?
?
?
?
?
?
17. 17
Simple Linear System
• Exact solution takes O(n3) time
where n is number of cells
• In 3D k3 cells where k is
discretization on each axis
• Way too slow O(n9)
18. 18
Need faster solver
• Our matrix is symmetric and
positive definite….This means we
can use
♦ Conjugate Gradient
• Multigrid also an option – better
asymptotic, but slower in
practice.
22. 22
Now we have a CFD simulator
• We can simulate fluid using only
the aforementioned parts so far
• This would be like Foster &
Metaxas first full 3D simulator
• What if we want it real-time?
23. 23
Time for Graphics Hacks
• Unconditionally stable advection
♦ Kills the CFL condition
• Split the operators
♦ Lets us run simpler solvers
• Impose divergence free field
♦ Do as post process
24. 24
Semi-lagrangian Advection
CFL Condition limits
speed of information
travel forward in time
Like backward Euler,
what if instead we
trace back in time?
p(x,t) back-trace
25. 25
Divergence Free Field
• Helmholtz-Hodge Decomposition
♦ Every field can be written as
• w is any vector field
• u is a divergence free field
• q is a scalar field
q
u
w
27. 27
Divergence Free Field
• We have w and we want u
• Projection step solves this equation
q
q
q
2
2
w
u
w
u
w
q
w
u
28. 28
Ensures Mass Conservation
• Applied to field before advection
• Applied at the end of a step
• Takes the place of first equation
in Navier-Stokes
29. 29
Operator Splitting
• We can’t use semi-lagrangian
advection with a Poisson solver
• We have to solve the problem in
phases
• Introduces another source of
error, first order approximation
36. 36
Inviscid Navier-Stokes
• Can be run faster
• Only 1 Poisson Solve needed
• Useful to model smoke and fire
♦ Fedkiw, Stam, Jensen 2001
37. 37
Solid Fluid Interaction
• Long history in CFD
• Graphics has many papers on 1
way coupling
♦ Way back to Foster & Metaxas, 1996
• Two way coupling is a new area
in past 3-4 years
♦ Carlson 2004
38. 38
Where to get more info
• Simplest way to working fluid
simulator (Even has code)
♦ STAM 2003
• Best way to learn enough to be
dangerous
♦ CARLSON 2004
39. 39
References
CARLSON, M., “Rigid, Melting, and Flowing Fluid,” PhD Thesis, Georgia Institute of Technology, Jul.
2004.
FEDKIW, R., STAM, J., and JENSEN, H. W., “Visual simulation of smoke,” in Proceedings of ACM
SIGGRAPH 2001, Computer Graphics Proceedings, Annual Conference Series, pp. 15–22, Aug. 2001.
FOSTER, N. and METAXAS, D., “Realistic animation of liquids,” Graphical Models and Image Processing,
vol. 58, no. 5, pp. 471–483, 1996.
HARLOW, F.H. and WELCH, J.E., "Numerical Calculation of Time-Dependent Viscous Incompressible
Flow of Fluid with a Free Surface", The Physics of Fluids 8, 2182-2189 (1965).
LOSASSO, F., GIBOU, F., and FEDKIW, R., “Simulating water and smoke with an octree data structure,”
ACM Transactions on Graphics, vol. 23, pp. 457–462, Aug. 2004.
OSHER, STANLEY J. & FEDKIW, R. (2002). Level Set Methods and Dynamic Implicit Surfaces. Springer-
Verlag.
STAM, J., “Real-time fluid dynamics for games,” in Proceedings of the Game Developer Conference,
Mar. 2003.