You are on page 1of 9

Department of Mechanical & Aerospace Engineering

CARLETON UNIVERSITY

AERO 4304: Computational Fluid Dynamics


Winter 2013

Lecture 13: Finite Volume Method I: Steady Diffusion


1

Lecture summary

In this lecture, we will discuss


a review of the general transport equation and the integral formulations of the
conservation laws
FVM applied to one-dimensional, steady-state diffusion

Integral form of the conservation equations: basis for FVM

The finite difference method that has been our focus for the past several lectures is
based on discretization of the differential form of the conservation laws. In lecture
2, we used an appropriate Taylor series expansion to approximate the differential
equation by an algebraic difference equation. Now, we will switch gears and begin
discussing the finite volume method (FVM). The basis for this method is the integral
form of the conservation equations. Let us recall the general conservation equation
for a conserved variable in integral form:
Z
Z
Z
Z
()
dV +
div (u)dV =
div ( grad )dV +
S dV
(1)
t
CV

CV

CV

CV

The symbol S is a source of per unit volume per unit time. The symbol is the
diffusion coefficient. Depending on what the conserved variable represents (whether
velocity, temperature, energy, etc.), the diffusion coefficient will represent different
physical properties such as the kinematic viscosity, thermal conductivity, etc. For
now, lets deal with this equation in its most general form for a general conserved
variable that has a diffusion coefficient .
The volume integrals in the second term on the left hand side of Eqn. 1, termed
the convective term, and in the first term on the right hand side, termed the diffusive
term, can be re-written as integrals over the bounding surfaces of the control volume

AERO 4304

Lecture 9

by applying Gauss divergence theorem. The result is

Z
Z
Z
Z

dV + n (u)dA = n ( grad )dA +


S dV
t
CV

(2)

CV

Now, lets recall the physical meaning of the terms in this equation. The order of
integration and differentiation has been changed in the first term on the left hand side
of Eqn. 2 to better reflect its physical meaning. This term signifies the rate of change
of the total amount of in the control volume. The product n (u) expresses the
flux of due to fluid flow along the outward normal vector n, so the second term in
Eqn. 2, the convective term, represents the net rate of decrease of in the control
volume due to convection across its boundaries.
A diffusive flux is positive in the direction of negative gradient of , i.e. along
the direction grad . For instance, heat is conducted in the direction of negative
temperature gradients (from hot to cold). Thus, the product n ( grad ) is the
component of diffusion along the inward normal vector n, and so into the control
volume. The first term on the right hand side of Eqn. 2 therefore represents the net
rate of increase of in the control volume due to diffusion.
Finally, the last term on the right hand side of Eqn. 2 represents the rate of
increase of as a result of sources inside the control volume. We can therefore reexpress Eqn. 2 in words as follows:
Rate of increase + Net
rate
of
of in the condecrease of
trol volume
due to convection across the
boundaries

= Rate of increase + Net rate of creof due to difation of due to


fusion across the
internal sources
boundaries

In time-dependent problems, it is also necessary to integrate with respect to time


t over a small interval t from, say, t until t + t. This yields the most general form
of the integral transport equation:

Z
Z Z
Z Z
Z Z
Z

dV dt+
n (u)dAdt =
n ( grad )dAdt+
S dV dt
t

CV

t A

t A

t CV

(3)
It is this form of the conservation equation that we begin with as we formulate the
FVM.

AERO 4304

3
3.1

Lecture 9

FVM for one-dimensional, steady-state diffusion


Governing equation

The equation for steady state diffusion of a property in a one-dimensional domain


can be derived from Eqn. 2 by dropping the convective and unsteady terms:
Z
Z
d
dA +
Sdv = 0
(4)
dx
A

3.2

CV

Spatial grid

To solve this equation, the solution domain is subdivided into a finite number of small
control volumes (CVs) by a grid which, in contrast to the finite difference method,
defines the CV boundaries, not the computational nodes. There are two common
approaches for generating a CV grid: the first approach defines the locations of
the nodes and then construct CVs around them so that the boundaries of the CV
are centered between the nodes, while the second approach defines the locations
of the CVs and assigns the computational node to the centroid of the CV. These
two approaches are illustrated in Fig. 1(a) and (b), respectively. The hollow nodes
correspond to the field locations and the filled nodes correspond to locations where
boundary information is applied.
The advantage of the first approach is that the centered-difference approximations
of derivatives at CV faces are more accurate because the face is midway between
nodes. The advantage of the second approach is that the nodal value represents the
mean over the CV volume to higher accuracy because the node is located at the
centroid of the CV. As a result, the second variant is used more often and will be
followed in this course.

Figure 1: Types of FV grids: (a) CV boundaries centered between nodes (b) nodes
centered in CVs. Filled points represent locations where boundary information is
applied.

AERO 4304

Lecture 9

Figure 2: A typical CV and the notation used for a 1D grid.


Figure 2 illustrates the grid that is used to discretize the 1D solution domain. A
general nodal point is identified by P and its neighbours to the east and west in a
1D geometry are identified by E and W , respectively. The east and west faces of
the CV are denoted with lower case e and w, respectively. The distances between
nodes W and P and P and E are denoted xW P and xP E , respectively. Similarly,
the distances between the east and west faces of the CV and the point P are denoted
xwP and xP e , respectively. The control volume width is x = xwe .

3.3

Discretization

With the grid shown in Fig. 2, we can discretize Eqn. 4 by integrating them over a
control volume to yield a discretized equation at its nodal point P . For the control
volume defined above, this yields:




Z
Z
d
d
d
dA +
SdV = A
A
+ SV = 0
(5)
dx
dx e
dx w
A

CV

where A is the cross-sectional area of the control volume face, V is the volume of the
control volume, and S is the average value of the source S within the control volume.
This discretized equation has a clear physical meaning; it states that the diffusive flux
of leaving the east face minus the diffusive flux of entering the west face is equal
to the generation of . In other words, the discretized equation constitutes a balance
equation for within the control volume. That the discretized equation has this clear
physical interpretation is a very attractive feature of the finite volume method.
In order to derive a useful version of Eqn. 5, expressions for the diffusion coefficient and the gradient d/dx at the east and west faces are required. Following
established practice, values of and are evaluated and defined at the node locations
P , W , E, and so forth. To approximate the fluxes through the control-volume faces,

AERO 4304

Lecture 9

we must assume something about the distribution of and between nodal points.
A common approximation is that these properties vary linearly between nodal points.
Assuming a uniform grid, the interface values of are therefore approximated as:
W + P
2
P + E
=
2

w =
e

and the diffusive flux terms are






d
E P
A
= e Ae
dx e
xP E




d
P W
A
= w Aw
dx w
xW P

(6)
(7)

The source term may be a function of the dependent variable, which requires an
approximation for the source term as follows:
SV = Su + Sp P
Substituting Eqns. 6, 7, and 8 into Eqn. 5 gives




E P
P W
e Ae
w Aw
+ (Su + Sp P ) = 0
xP E
xW P
which can be rearranged into






e
w
w
e
Ae +
Aw Sp P =
W +
Ae E Su
xP E
xW P
xW P
xP E

(8)

(9)

(10)

This equation is further simplified by defining the coefficients of P , W , and E as


aP , aW , and aE , respectively:
aP P = aW W + aE E + Su
where

(11)

e
w
Ae , aW =
Aw , aP = aW + aE Sp .
(12)
xP E
xW P
Equations 8 and 12 represent the discretized form of Eqn. 4. This type of discretized
equation is a canonical form for FVM methods, and as such, it is central to the
remaining discussion on FVM.
We can conveniently express Eqn. 12 as
X
aP P =
anb nb + Su
(13)
aE =

nb

where the subscript nb denotes the cell neighbours W and E.

AERO 4304

3.4

Lecture 9

Discussion

We make the following important points about the discretization we have done so far:
1. The discrete equation expresses a balance of discrete flux terms and the source
term. Thus conservation over individual control volumes is guaranteed, and if
the diffusion transfer from one cell enters the next cell, conservation over the
whole domain is also guaranteed. This is an attractive property of FVM that
the finite difference method does not have.
2. The coefficients aE , aW , and aP all have the same sign. In our case, they are
all positive. This has an important physical significance. If the value of at E
increased, we can readily see that the value of at P will increase as well, as
our physical intuition dictates. The solution of the elliptic differential equation
has the same property. On the other hand, the relational dependence between
points P , W , and E is not always so obvious, as many higher-order schemes
have coefficients with different signs.
3. When the source term Sp is zero, we have
aP = aW + aw
and Eqn. 13 can be written as
P =

X anb
nb

aP

nb

(14)

P
and nb (anb /aP ) = 1. This means that the value of P is the weighted sum
of its neighbour values, and as a result, P will be always bounded by them.
This indicates that the method is bounded on the level of the control volume by
the neighbour values, which implies that the whole solution will be bounded by
the boundary values of . This property of boundedness is also shared by our
elliptic equation. When Sp 6= 0, P need not be bounded in this manner, and
overshoots or undershoots of the boundary value are physically realistic.

3.5

Solution of the discretized equation

The discrete algebraic equation represented by Eqn. 13 results in a system of equations that must be solved to obtain discrete values for at each control volume in the
solution domain. The equations may be linear if the coefficients are not functions of
or they may be non-linear if they are functions of . We have already described
solution techniques for the system of discrete algebraic equations that were obtained
from the finite difference method. Recall that the two methods were direct methods
and iterative methods. These will be reviewed briefly in the context of the system of
equations obtained by applying the finite volume method.

AERO 4304
3.5.1

Lecture 9

Direct methods

We may write the system of equations obtained by the FVM discretization as


A = B

(15)

where A is the coefficient matrix, = [1 , 2 , ...]T is a vector consisting of the discrete


values of , and B is the vector resulting from the source terms. Direct methods solve
the matrix equation using the methods of linear algebra, such as through matrix inversion, Gaussian elimination, or other techniques that are suited to the special structure
of A. Direct methods are not widely used in CFD because of the large storage requirements (every element in A must be held in memory) and the high computational
expense. Most CFD problems involve many thousandsor even millionsof cells,
with multiple unknowns in each cell, so A can be very large. Many direct methods
require O[N 2 ] operations, where N is the number of cells in the grid. Furthermore,
the matrix A is frequently non-linear, which means that the direct method must be
embedded within an iterative loop to update the non-linearities of A. Thus, the direct
method is repeated over and over again, making the process all the more expensive.
3.5.2

Iterative methods

As described in Lecture 6, iterative methods are preferred for CFD owing to their
increased efficiency compared to direct methods. These methods follow a guessand-correct philosophy that progressively improves the guessed solution by repeated
application of the discrete equations. Let us consider a very simple iterative method,
the Gauss-Seidel method. The overall solution loop for this method may be written
as:
1. Guess the discrete values of at all points in the domain.
2. Visit each grid point in turn. Update using
P =

(aE E + aW W + Su )
aP

(16)

The neighbour values, E and W , are required for the update of P . These are
assumed to be known at neighbouring values. Points that have been recently
visited will have updated values, while points that have not been visited recently
will have old values.
3. Sweep the domain until all grid points are covered. Once all the points in the
domain have been updated, one iteration has been completed.
4. Check to see if the solution has converged to a suitable level. We may require
that the maximum change in between an old and updated value be 0.01%, for
example. If the convergence criterion has been met, stop. If not, then return to
step 2 and perform another iteration.

AERO 4304

Lecture 9

xb
P

Figure 3: Schematic of a control volume near a boundary


The iterative method described here is not guaranteed to converge for arbitrary
combinations of aE , aP , and aW . For linear problems (ones in which the coefficients
are independent of ), convergence is guaranteed if the Scarborough criterion is met.
The Scarborough criterion requires that
|aE | + |aW |
1 for all grid cells
|aP |
< 1 for at least one grid cell
Matrices that satisfy the Scarborough criterion have diagonal dominance; the terms
along the diagonals in the coefficient matrix are larger than the off-diagonal terms.
This review of solution methods presented here is purposely brief. The iterative
methods that were described in Lecture 6 can also be applied to solve the system of
algebraic equations obtained from FVM discretization.

3.6

Boundary conditions

How boundary conditions are dealt with in FVM is a topic that is worth discussing.
A typical boundary control volumedefined as a control volume that has one or
more faces on the boundaryis shown in Fig. 3. As before, discrete values of are
stored at the cell centroids, shown by the hollow circles. In addition, we store discrete
values of at the centroids of the boundary faces b. Let us consider the discretization
process for the boundary control volume shown in Fig. 3. The face area is denoted by
Ab and it points outward from the cell. Integrating the governing transport equation
over the control volume P gives
Ae e

(b P )
(E P )
+ Ab b
+ (Su + Sp P ) = 0
xP E
xb

(17)

or following our canonical form,


aP P = aE E + ab b + Su

(18)

The coefficient ab will vary depending on the type of information that is provided at
the boundary face. We will discuss the three main types of boundaries now.

AERO 4304
3.6.1

Lecture 9

Dirichlet boundary condition

A Dirichlet boundary condition is given by


b = b |given
and using this equation in Eqn. 18 yields the following discrete equation for the
boundary control volume P :
aP P = aE E + b
(19)
where
aE =

b Ab
e Ae
, ab =
, aP = aE + ab Sp , b = ab b |given + Su .
xP E
xb

(20)

We note the following properties of this discrete equation:


1. At Dirichlet boundaries, aP > aE , which ensures that the Scarborough criterion
is satisfied for problems with Dirichlet boundaries.
2. The value of P is guaranteed to be bounded by the values of E and b if Su
and Sp are zero. This is in keeping with the behaviour of the elliptic partial
differential equation that governs this problem.
3.6.2

Neumann boundary condition

At a Neumann boundary, the gradient of normal to the boundary is given:


()b = qb |given

(21)

and using this equation in Eqn. 18 yields the following discrete equation for the
boundary control volume P :
aP P = aE E + b
(22)
where

e Ae
, aP = aE Sp , b = qb |given + Su .
xP E
We note the following properties of this discrete equation:
aE =

(23)

1. aP = aE at boundaries if Sp is zero.
2. If both qb |given and Sp are zero, P is bounded by its neighbours. Otherwise,
P can exceed or fall below its neighbouring values. This is admissible. For
example, if heat is being added at the boundary, we expect the temperature
near the boundary to be higher than that in the interior.
3. Once P is computed, the boundary value b may be calculated as
b =

qb |given + (b /xb )P
(b /xb )

(24)

You might also like