Sie sind auf Seite 1von 3

Solving the fluid equations

Charles Xie
The Advanced Educational Modeling Laboratory
The Concord Consortium, Concord, MA 01742
Airflow contributes to the convective effect in forced and natural convection. Air is assumed to
be an incompressible Newtonian fluid that can be modeled by the following form of the NavierStokes equation:

v
= 2 v ( v ) v p + f
t

(1)

where v is the velocity vector, is the kinematic viscosity, p is the pressure, and f is the body
force such as gravity or buoyancy. The first term on the right-hand side describes the diffusion of
momentum. The second term describes advection. The mass continuity condition ensures the
conservation of mass:

v = 0

( 2)

For the temperature distribution to affect the flow of the air, we can add a thermal buoyancy term
to the body force f(x, y, z, t):

r
f ( x, y, z , t ) = [T ( x, y, z , t ) T0 ( x, y, t )]z

(3)

where T0(x, y, t) is the average temperature of the column of air at the location (x, y) and at time t
and is the thermal expansion coefficient.
The Navier-Stokes equation
Eq. (1) can be decomposed into two steps (assuming a uniform distribution of pressure or
incorporating the pressure gradient term into the body force term):
1. The diffusion step

v1
= 2 v 1 + f
t

(4)

2. The advection step

v 2
= ( v 1 ) v 2
t

(5)

The diffusion step Eq. (4) can be solved efficiently using a relaxation method like in the case of
solving the heat equation. The advection step Eq. (5) can be solved using the MacCormack
method1, which consists of the following two steps:
1. The predictor step

i ,nj+,1k = in, j ,k

t
win, j ,k +1 in, j ,k +1 win, j ,k 1 in, j ,k 1
2z

2. The corrector step

in, +j ,1k =

t n
t n
ui +1, j ,k in+1, j ,k uin1, j ,k in1, j ,k
vi , j +1,k in, j +1,k vin, j 1,k in, j 1,k
2x
2y

(6)

t n
t n
1 n
i , j ,k + i ,nj+,1k
ui , j ,k i +n1+,1j ,k i n1+,1j ,k
vi , j ,k i ,nj++11,k i ,nj+11,k
2
4x
4y

t n
wi , j ,k i ,nj+,1k +1 i ,nj+,1k 1
4z

(7)

The function can be any component of the velocity (u, v, w).


The continuity condition
The solution of Eq. (1) will not automatically satisfy the conservation of mass. The mass
continuity condition Eq. (2) must be imposed at each step. This condition is also important in
simulating convective loops as it forces the velocity fields to have vortices. The discretized form
of the continuity equation requires that:

V =

u in+1, j ,k u in1, j ,k
2 x

vin, j +1,k vin, j 1,k


2 y

win, j ,k +1 win, j ,k 1
2 z

=0

(8)

Recall the Helmholtz decompostion2 that states any vector field can be decomposed into the
following form:

V = V ' +

(9)

where V is a divergence-free vector field ( V ' = 0 ) and is a scalar field. We can apply the
gradient operator to both sides of Eq. (9) and obtain:

V = 2

(10)

This is a Poisson equation for the scalar field , given that V is known. If can be solved, then
we can fix the solution by subtracting from V3:

http://en.wikipedia.org/wiki/MacCormack_method

http://en.wikipedia.org/wiki/Helmholtz_decomposition

V ' = V

(11)

The discretized form of this equation is simply:

n
i , j ,k

:= u

n
i , j ,k

vin, j ,k := vin, j ,k

in+1, j ,k in1, j ,k
2x
n
i , j +1,k in, j 1,k

win, j ,k := win, j ,k

2y

in, j ,k +1 in, j ,k 1
2z

(12a )
(12b)
(12c)

Again, the Poisson equation can be solved by using a relaxation method4. The method uses the
following iteration until convergence is reached:

in, j ,k :=

1
2
2
2
+
+
2
2
(x)
( y )
(z ) 2

in+1, j ,k + in1, j ,k in, j +1,k + in, j 1,k in, j ,k +1 + in, j ,k 1

+
+
V

2
2
2
(x)
( y )
( z )

(13)

A multigrid method5 may be used to accelerate the convergence. If accuracy is less important
than visual effect, 5-20 iteration steps can be used without worrying about if convergence has
been reached.

N. Foster and D. Metaxas, Modeling the Motion of a Hot, Turbulent Gas, Proceedings of the 24th annual
conference on Computer graphics and interactive techniques, Pages: 181 - 188, 1997
4

http://en.wikipedia.org/wiki/Relaxation_method

http://en.wikipedia.org/wiki/Multigrid_method

Das könnte Ihnen auch gefallen