Professional Documents
Culture Documents
CARLETON UNIVERSITY
Lecture summary
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
Z
Z
Z
Z
(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
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
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
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
(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)
(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
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
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
(15)
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
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)
(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
b Ab
e Ae
, ab =
, aP = aE + ab Sp , b = ab b |given + Su .
xP E
xb
(20)
(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)