Professional Documents
Culture Documents
Intro To Computational Fluid Dynamics: Brandon Lloyd COMP 259 April 16, 2003
Intro To Computational Fluid Dynamics: Brandon Lloyd COMP 259 April 16, 2003
Fluid Dynamics
Brandon Lloyd
COMP 259
April 16, 2003
Overview
Understanding the Navier-Stokes
equations
- Derivation (following [Griebel 1998])
- Intuition
Foundations
Operators
- gradient u u x , u y
div - divergence div u u u x u y
u
2
u
u
- Laplacian
x
y
- Hand waving / Lengthy math
compression
2
Transport Theorem
(c , t )
t t
dt t
x (c , t )
4
u ( x , t ) (c , t )
t
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL
Conservation of Mass
; is density
Transport theorem
(
x
,
t
)
d
x
div(
u
)
(
x
,
t
)
d
x
0
t t
dt t
div( u ) 0
t
is constant
for incompressible
fluids
Integrand vanishes
div u 0
Continuity equation
Conservation of Momentum
momentum
( x , t )u ( x , t )dx
(
x
,
t
)
u
(
x
,
t
)
d
x
(
x
,
t
)
f
(
x
,
t
)
d
x
(
x
, t )nds
t
t
dt t
6
Conservation of Momentum
d
( x, t )u ( x, t )dx ( x, t ) f ( x, t )dx ( x, t )nds
t
t
dt t
Transport theorem
Divergence
theorem
d
( u ) (u )(u ) ( u ) div u g div 0
dt
1
du
2
(u )u p u f
dt
Momentum equation
7
Navier-Stokes Equations
u 0
1
du
2
(u )u p u f
dt
convection
pressure viscosity
external
forces
10
umax t x,
vmax t y
Diffusion term
1
1
2t 2 2
y
x
11
~
1. Add forces: u1 ( x) u0 ( x) t f ( x)
2. Advection
3. Diffusion
12
~
~
u2 ( x ) u1 ( p( x,t ))
13
~
~
(I t )u3 ( x ) u2 ( x )
2
14
2.
3.
15
16
( n 1) ~ ( n )
du u
u
1
p ( n 1)
dt
t
Discretize in time
( n 1) ~ ( n ) t
u
u p ( n 1)
Rearrange terms
t
u ( n 1) u~ ( n ) 2 p ( n 1) 0
17
p
2
( n 1)
u~ ( n )
( n 1) ~ ( n ) t
u
u p ( n 1)
18
Projection Method
The Helmholtz-Hodge Decomposition Theorem states
that any vector field can be decomposed as:
w u q
where u is divergence free and q is a scalar field
defined implicitly as:
w 2q
We can define an operator P that projects a vector field
onto its divergence free part:
u w w q
19
Projection Method
Applying P to both sides of the momentum equation
yields a single equation only in terms of u:
du
2
P((u )u u f )
dt
Thus for the last step :
u~ 2 q
~
u u q
p
2
20
( n 1)
u~ ( n )
( n 1) ~ ( n ) t
u
u p ( n 1)
21
Boundary Conditions
No slip: Set velocity to 0 on the boundary.
Good for obstacles.
Free slip: Set only the velocity in the
direction normal to the boundary to zero.
Good for setting up a plane of symmetry.
Inflow: Specified positive normal velocity.
Good for sources.
Outflow: Specified negative normal velocity.
Good for sinks.
Periodic: Copy the last row and column of
cells to first row and column. Good for
simulating an infinite domain.
22
Staggered Grid
pi , j 1
vi , j 1
ui 1 , j
pi 1, j
ui 1 , j
2
pi , j
vi , j 1
pi , j 1
pi 1, j
u0
v0
p constant
ui , j 0
vi , j 0
MAC
Due to [Harlow and Welch 1965].
Track massless marker particles to determine
where the free surface is located.
Markers are transported according to the
velocity field.
Cells with markers are fluid cells. Fluid cells
bordering empty cells are surface cells.
There are boundary conditions that must be
satisfied at the surface.
Extended by [Chen et al. 1997] to track
particles only near the surface.
25
MAC
Problems:
Can lead to mass dissipation, especially with stable
fluid style advection.
No straight forward way to extract a smooth surface.
26
Front Tracking
Proposed by [Foster and Fedkiw 2001]
Front tracking uses a combination of a level set and
particles to track the surface.
The particles are used to define an implicit function. An
isocontour of this function represents the liquid
surface.
Front Tracking
Using the level set method, the isocontour can
be evolved directly over time by using the
fluid velocities.
Particles and level set evolution have
complementary strengths and weaknesses
-
28
Front Tracking
Combine the two techniques by giving particles more
weight in areas of high curvature. Particles escaping
the level set are rendered directly as splashing
droplets.
29
31
References
CHEN, J., AND LOBO, N. 1994. Toward interactive-rate simulation of fluids with moving
obstacles using the navier-stokes equations. Computer Graphics and Image Processing,
107116.
CHEN, S., JOHNSON, D., RAAD, P. AND FADDA, D. 1997. The surface marker and
micro cell method. International Journal of Numerical Methods in Fluids, 25, 749-778.
FOSTER, N., AND METAXAS, D. 1996. Realistic animation of liquids. Graphical Models
and Image Processing, 471483.
FOSTER, N., AND FEDKIW, R. 2001. Practical animation of liquids. In Proceedings of
SIGGRAPH 2001, 2330.
GRIEBEL, M., DORNSEIFER, T., AND NEUNHOEFFER, T. 1998. Numerical Simulation
in Fluid Dynamics: A Practical Introduction. SIAM Monographs on Mathematical
Modeling and Computation. SIAM
KASS, M., AND MILLER, G. 1990. Rapid, stable fluid dynamics for computer graphics. In
Computer Graphics (Proceedings of SIGGRAPH 90), vol. 24, 4957.
OBRIEN, J., AND HODGINS, J. 1995. Dynamic simulation of splashing fluids. In
Proceedings of Computer Animation 95, 198205.
STAM, J. 1999. Stable fluids. In Proceedings of SIGGRAPH 99, 121-128.
32