Escolar Documentos
Profissional Documentos
Cultura Documentos
CARLETON UNIVERSITY
Lecture summary
In problems where fluid flow plays an important role, convection will accompany
diffusion. Because diffusion will always occur alongside convection in nature, we
consider in this lecture the combined effects of convection and diffusion. Recall the
integral form of the general conservation equation considered in the last lecture:
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
To obtain the steady convection-diffusion equation, drop the unsteady term on the
left-hand side and eliminate the time integration. This yields
Z
Z
Z
n (u)dA = n ( grad )dA +
S dV.
(1)
A
CV
The term on the left-hand side is the convective term, the first term on the right-hand
side is the diffusive term, and the second term on the right-hand side is the source
term. Together, they represent flux balance in the control volume.
The principal difficulty in discretizing the convective term is calculating the value
of the transported property at control volume faces and calculating the fluxes of
AERO 4304
Lecture 10
across these boundaries. In the previous lecture, we used the central differencing
method to obtain discretized equations for the diffusive and source terms on the righthand side of Eqn. 1, and it worked quite well. However, the convective term is not
so simple. In diffusion, the diffusion process affects the quantity of a transported
quantity along its gradient in all directions, whereas convection affects the quantity
only in the flow direction. This difference presents itself as a strict upper-limit on the
grid size when central differencing is used. The restriction is a function of the relative
strengths of convection and diffusion.
A final note before we begin the discussion of the different discretization methods:
the velocity u in the convective term is the velocity vector at the boundary faces of
the control volume. These velocities are generally unknown; they a part of the CFD
solution and what we are interested in finding. However, in this lecture, we will not
discuss their evaluation; we will assume that they are somehow known. The method
for computing these velocities will be discussed in Lecture 11.
udA = 0.
(3)
(5)
To obtain a discretized form of the convection-diffusion equation, we must approximate the terms in Eqn. 4. It is convenient to define two variables F and D to
AERO 4304
Lecture 10
xwP
uw
xPe
ue
e
P
xwe
Figure 1: Control volume around node P for discretizing the convection-diffusion
equation.
represent the convective mass flux per unit area and the diffusion conductance at cell
faces:
F = u and D =
(6)
x
The cell-face values of the variables F and D can be written as
Fw = (u)w ,
w
Dw =
,
xW P
Fe = (u)w
e
De =
xP E
For now, lets assume that Aw = Ae = A and use central differencing to represent the
contribution of the diffusion terms on the right hand side. The integrated convectiondiffusion equation (Eqn. 4) can now be written as
Fe e Fw w = De (E P ) Dw (P W )
(7)
(8)
Assuming that the velocity field is somehow known (see above note) takes care of
the Fe and Fw . In order to solve Eqn. 7 we need to calculate the transported property
at the e and w faces. Schemes for this purpose are assessed in the following sections.
3.1
Centered differencing
The central differencing scheme has been used already to represent the diffusion terms
that appear on the right-hand side of Eqn. 7. It seems logical that we try the same
AERO 4304
Lecture 10
approach to discretize the convective term on the left-hand side. For a uniform grid,
we can write the cell-face property values as
e = (P + E )/2
w = (W + P )/2
(9)
(10)
(11)
Fw
Fe
, ae = De + , and aP = aw + aE + (Fe Fw )
2
2
It is clear that Eqn. 13 for steady convection-diffusion problems takes the same
form as the discretized equation for pure diffusion problems. The difference is that
now the coefficients contain extra terms to account for convection. To solve a 1D
convection-diffusion problem, we write discretized equations in the form of Eqn. 13
for all cells, which results in an algebraic system of equations for the transported
property .
To illustrate the solution of a 1D steady convection-diffusion problem, lets consider a worked example.
aw = Dw +
(14)
AERO 4304
Lecture 10
u
=0
=1
x=0
x=L
(15)
For control volume 5, the value of on the east face is known (w = B = 0). We
obtain
Fw
(P + W ) = DB (B P ) Dw (P W ).
(16)
FB B
2
Rearrangement of the above two equations for CVs 1 and 5, noting that DA = DB =
2/x = 2D and FA = FB = F , gives the discretized equations at the boundary
nodes as
aP P = aW W + aE E + Su
(17)
where
aP = aW + aE + (Fe Fw ) SP
(18)
=1
=0
B
AERO 4304
Lecture 10
Node
1
2,3,4
5
aW
aE
Sp
0
D F/2
(2D + F )
D + F/2
D F/2
0
D + F/2 0 (2D F ) (2D F )B
Table 1:
Node aW
1
0
2
0.55
3
0.55
4
0.55
5
0.55
Su
(2D + F )A
0
1.55 0.45
0
0
0
1
1.1
0.55 1.0 0.45
0
0
2 0
0
3 = 0 .
0
0
0.55 1.0 0.45 4 0
5
0
0
0
0.55 1.45
0
The solution to this equation set is
1
2
4
5
0.9421
0.8006
0.6276
0.4163
0.1579
(20)
AERO 4304
Lecture 10
Table 2:
Node aW
1
0
2
1.75
3
1.75
4
1.75
5
1.75
Coefficients for
aE
Su
-0.75 3.5A
-0.75
0
-0.75
0
-0.75
0
0
-1.5B
Case 2 of Example 1.
Sp aP = aW + aE Sp
-3.5
2.75
0
1.0
0
1.0
0
1.0
1.5
0.25
AERO 4304
Lecture 10
3.2
The above example shows that central differencing failed under the conditions of Case
2 when the grid was too coarse (5 control volumes) but produced good results when
the grid was refined to 20 control volumes. It suggests that the convective term is
sensitive to the properties of the discretization scheme. In this section, lets take
a more in-depth look at the properties of discretization schemes. In theory, if we
have an infinite number of control volumes, all schemes will achieve results that are
indistinguishable from the exact results. But in practice, only a finite number of cells
can be used and the results obtained from a particular discretization scheme will only
be physically realistic if the scheme possesses certain properties. The most important
ones are:
Conservativeness
Boundedness
Transportiveness
3.2.1
Conservativeness
AERO 4304
Lecture 10
Gradient = (2 - 1)/x
2
qA
x/2
qB
x/2
x
x
x
(4 3 )
(3 2 )
(4 3 )
+ qB
= 0
(21)
x
x
x
Since is constant, the fluxes across control volume faces cancel out, and the expression simplifies to qB qA = 0. Therefore, Eqn. 21 express overall conservation of
throughout the whole domain, as well as conservation across each control boundary.
The scheme is there conservative.
Non-conservative schemes can occur when the flux across control volume faces are
interpolated inconsistently on either side of the face. For example, consider Fig. 8.
The variation of in control volume 2 is represented by a quadratic function is fitted
based on the values of at 1, 2, and 3, and similarly, a quadratic function based on
the values at 2, 3, and 4 is used to represent the variation of in control volume 3.
Fig. 8 shows that the resulting quadratic functions can be quite different, and that
the gradients at the face between volumes 2 and 3 are unequal. If this is the case,
the two fluxes are not equal and so they do not cancel out when summed. Therefore,
overall conservation is not satisfied, and the scheme is non-conservative. Figure 8
does not imply that all quadratic interpolation schemes are always non-conservative;
later in this lecture, the QUICK scheme will be described; it is a popular quadratic
discretization scheme that is consistent.
AERO 4304
10
Lecture 10
Gradient of function 3
Gradient of function 2
Quadratic function 3
Quadratic function 2
2
qA
x/2
qB
x/2
Boundedness
For reasons that were described earlier in the course, the algebraic system of equations that result from the discretization at each nodal point are normally solved with
iterative methods. These methods start the solution process from a guessed distribution of and performs successive updates until a converged solution is achieved.
Boundedness is a property of the discretization method that determines whether the
method will achieve a converged solution. The Scarborough criterion already brought
up provides a sufficient condition for convergence:
P
|anb |
1 for all grid cells
|aP |
< 1 for at least one grid cell
where aP is the net coefficient of the central node P (i.e. aP Sp ) and the summation
operator is taken over the neighbouring nodes (nb). If the differencing scheme produces coefficients that satisfy the above criterion, the resulting matrix is diagonallydominant. To achieve this, the value (aP Sp ) should be large, so it is common
practice to linearize the source terms such that Sp is always negative and Sp adds
to aP .
Another essential requirement for boundedness is that all the coefficients must
have the same sign (usually all positive). Physically, this means that an increase of
at one node should produce an increase in at the neighbouring nodes. If a scheme
does not produce coefficients with all the same sign, it is possible to contain wiggles
in the solution, or not converge at all. Such was the case in Case 2 of Example 1;
most of the east coefficients were negative (see Table 3.1) and the solution contained
large undershoots and overshoots.
AERO 4304
11
Lecture 10
Pe = 0
Pe > 0
Pe
W
Direction of flow
Transportiveness
The transportiveness of a discretization scheme relates to how well the directionality of influence in the physical problem is represented in the discretization scheme.
Transportiveness can be illustrated by considering a constant source of at a point P
as shown in Fig. 9. We define the non-dimensional cell Peclet number as a measure
of the relative strengths of convection and diffusion:
Pe =
F
u
=
D
/x
(22)
where x is a characteristic length (e.g. cell width). The contour lines shown in Fig.
9 indicate the general shape of contours of constant for different values of the Peclet
number. To illustrate the effect of the Peclet number on the influence of the upstream
node P on the downstream node E, lets consider two extremes:
pure diffusion (P e = 0)
pure convection (P e )
In the case of pure diffusion (P e = 0), the fluid is stagnant and the contours of will
be concentric circles about P because diffusion will spread evenly in all directions.
Conditions at E will be influence by P and equally by conditions further downstream.
As the Peclet number increases, the contours change shape from circular to elliptical
and are shifted in the direction of flow as indicated in Fig. 9. Influence is strongly
biased to the upstream direction, so that E is strongly affected by conditions at P ,
but there is a weak or no influence of E on the conditions at P . In the case of pure
convection (P e ), the elliptical contours are completely stretched out in the flow
direction. All of property emanating from P is convected downstream towards E.
Thus the conditions at E are influenced only by the upstream conditions at P , and
because there is no diffusion, E is equal to P . For a discretization scheme to have
the transportiveness property, the relationship between the Peclet number and the
directionality of influence must be present within the scheme.
AERO 4304
4
4.1
Lecture 10
12
Fe
Fw
, aE = De , aP = aW + aE + (Fe Fw ).
2
2
(23)
If P ee is greater than 2, the east coefficient will be negative and the solution will
be unbounded, leading to oscillations and a physically impossible solution. In the
example in Section 3.1, Case 2 takes a Peclet number of 5, so the above condition is
violated. The consequences were evident in the results in Fig. 5, which shows undershoots and overshoots in the solution. When the number of control volumes
is increased to 20, the Peclet number reduces to below 2 and the discretization gives
answers close to the analytical solution.
Transportiveness. The central differencing scheme introduces influencing at node
P from the directions of all its neighbours to calculate the convective and diffusive
flux. Thus the scheme does not recognize the direction of flow or the strength of
convection relative to diffusion. Therefore, it does not possess the transportiveness
property at high Peclet numbers.
Accuracy. The Taylor series truncation error of the central differencing scheme is
second order. The requirement for positive coefficients in the central differencing
scheme implies that the scheme will be stable and accurate only if P e = F/D < 2.
AERO 4304
Lecture 10
13
4.2
Upwind differencing
One of the main deficiencies of the centered differencing scheme is its lack of transportiveness; that is, its inability to identify flow direction. The value of property
at a west cell face is always influenced by both P and W in centered differencing.
However, in a strongly convective flow from west to east, such a treatment is unsuitable because the west face should receive much strongly influencing from node W
than from node P , as was illustrated in Fig. 9. The upwind differencing scheme takes
the flow direction into account when determining the value of at a cell face by setting it equal to the value of the upstream node. The definition of upstream varies
depending on the value of ue and uw , which results in coefficients that are functions
of the values of Fe and Fw . Compactly, the coefficients for the upwind differencing
method applied to the one-dimensional convection-diffusion equation are
aP = aW + aE + (Fe Fw )
aW = Dw + max(Fw , 0)
aE = De + max(0, Fe )
(24)
AERO 4304
Lecture 10
14
The resulting error has a diffusion-like appearance and is referred to as false diffusion or numerical diffusion. In practice, grid refinement can reduce the amount of
numerical diffusion in an upwind differencing scheme, but the level of refinement that
is required to reduce the error to an acceptable level can be prohibitively expensive.
Therefore, upwind differencing is not entirely suitable for accurate flow calculations.
In certain cases, the numerical diffusion inherent in upwind differencing schemes
can be exploited to damp the solution and ease convergence, particularly in flows
that are sensitive to the initial conditions. If oscillatory-type errors are preventing
convergence of a particular flow with a higher-order accuracy discretization scheme,
switching to a first-order-accurate scheme such as upwind differencing can sometimes
damp the oscillations and allow the solution to converge to a smoother flow field,
after which a higher-order accuracy scheme can be resumed to obtain a final solution with higher overall accuracy. This approach is not always applicable, however,
especially if the solution field is transient.
4.3
Hybrid differencing
The hybrid differencing scheme was developed to combine the higher accuracy of the
centered differencing scheme and the improved boundedness and transportiveness
properties of the upwind differencing scheme. The central differencing scheme is
employed in control volumes with small local Peclet numbers (P e < 2), while the
upwind scheme is used for control volumes with larger Peclet numbers (P e 2).
Compactly, the coefficients for the hybrid differencing method applied to the onedimensional convection-diffusion equation are
aP = aW + aE + (Fe Fw )
Fw
,0
aW = Dw + max Fw , Dw +
.
2
Fe
aE = De + max Fe , De
,0
2
(25)
Conservativeness. The hybrid differencing scheme exploits the favourable properties of the upwind and centered differencing schemes. Because both of those schemes
are conservative, the hybrid scheme is also conservative. It switches to upwind differencing when centered differencing produces inaccurate results at high Peclet numbers.
Boundedness. Since the coefficients of the hybrid scheme are always positive, it is
unconditionally bounded.
Transportiveness. The hybrid scheme possess the transportiveness property by using an upwind formulation for large values of cell Peclet number.
AERO 4304
Lecture 10
15
4.4
Power-law differencing
Because the hybrid scheme is only first-order accurate, alternate schemes were developed that retain its desirable features while improving the accuracy. The power-law
scheme is a more accurate approximation to the one-dimensional exact solution of
the convection-diffusion equation and hence produces better results than the hybrid
scheme. In the power-law scheme, the diffusion is set to zero when the cell Peclet
number exceeds 10. If 0 < P e < 10, the flux is evaluated by using a polynomial
expression. For example, the net flux per unit area at the west control volume face
is evaluated using
qw = Fw [W w (P W )] for 0 < P e < 10
(26)
(27)
The coefficients of the discretized equation using the power-law scheme for the onedimensional convection-diffusion equation are given by
aP = aW + aE + (Fe Fw )
aW = Dw max 0, (1 0.1|P ew |)5 + max[Fw , 0] .
aE = De max 0, (1 0.1|P ee |)5 + max[Fe , 0]
(28)
4.5
The hybrid, power-law, and upwind schemes are only first-order accurate in terms
of the Taylor series truncation error. The use of upwind quantities ensures that the
schemes are very stable, bounded, and obey the transportiveness requirements, but
AERO 4304
Lecture 10
16
also makes them suffer from numerical diffusion-type errors. These errors can be minimised by employing higher-order methods of discretization. To achieve higher-order
accuracy, the computational stencil needs to be enlarged by incorporating neighbouring points and bringing in a wider influence onto the point of interest. The centered
differencing scheme does this but it is not bounded for large Peclet numbers and
does not possess the transportiveness property. Therefore, alternate formulations are
sought that are more accurate than upwind schemes but still preserve the stability
and sensitivity to flow direction. A widely-used approach is the quadratic upwind
differencing scheme developed by Leonard (1979), which is termed the quadratic upstream interpolation for convective kinetics (QUICK) scheme. This scheme uses a
three-point upstream-weighted quadratic interpolation for cell face values. The face
value of is obtained from a quadratic function passing through two bracketing nodes
on each side of the face plus a node on the upstream side, as shown in Fig. 10. The
resulting expression for the face values is
3
1
6
(29)
f ace = i1 + i i2
8
8
8
For example, when uw > 0 and ue > 0, a quadratic fit through W W , W , and P is used
to evaluate w , and a quadratic fit through W , P , and E is used to evaluate e . For
uw < 0 and ue < 0, a quadratic fit through W , P , and E is used to evaluate w , and a
quadratic fit through P , E, and EE is used to evaluate e . The diffusion terms may be
evaluated using the gradient of the appropriate parabola. It is interesting to note that
on a uniform grid this practice gives the same expressions as central differencing for
diffusion. General expressions of the QUICK scheme for one-dimensional convectiondiffusion problems valid for positive and negative flow directions is summarized as
follows:
ap P = aW W + aE E + aW W W W + aEE EE
(30)
with a central coefficient
aP = aW + aE + aW W + aEE + (Fe Fw )
(31)
(32)
(33)
where
AERO 4304
Lecture 10
17
Figure 10: Schematic illustrating the quadratic interpolation between nodes in the
QUICK scheme
Properties of the QUICK scheme. The scheme uses consistent quadratic profiles
the cell face values of fluxes are always calculated by quadratic interpolation between
two bracketing nodes and an upstream nodeand is therefore conservative. Since
the scheme is based on a quadratic function, its accuracy in terms of the Taylor series
truncation error is third-order on a uniform mesh. The transportiveness property is
built into the scheme as well, since the quadratic function is based on two upsteam
and one downstream nodal values. Additionally, if the flow field satisfies continuity,
the coefficient aP equals the sum of all neighbour coefficients, which is desirable for
boundedness.
There are certain undesirable features of the QUICK scheme. Firstly, the main
coefficients (E and W ) are not guaranteed to be positive and the coefficients aW W
AERO 4304
Lecture 10
18
and aEE are negative. For example, if uw > 0 and ue > 0, the east coefficient becomes
negative at relatively modest cell Peclet numbers (P ee = Fe /De > 8/3), which gives
rise to stability problems and unbounded solutions under certain flow conditions.
Similarly the west coefficient can become negative when the flow is in the negative
direction. The QUICK scheme is therefore conditionally stable. Secondly, because
the discretized equations involve not only immediate-neighbour nodes but also nodes
further away, the algebraic system of equations is not triadiagonal and the efficient
tridiagonal-matrix methods are not directly applicable.
4.5.1
Because the QUICK scheme as presented above can be unstable due to the appearance of negative main coefficients, it has been reformulated in various different ways
to alleviate the stability constraints. For the most part, the reformulations place
negative coefficients in the source term so as to retain positive main coefficients. The
contributing part is appropriately weighted to give better stability and positive coefficients as far as possible. Hayase et al. (1992) generalized the approach for re-arranging
QUICK schemes and derived a stable and fast-converging variant. Their scheme can
be summarized as follows:
1
w = W + [3P 2W W W ] for Fw > 0
8
1
e = E + [3E 2P W ] for Fe > 0
8
(34)
1
w = W + [3W 2P E ] for Fw < 0
8
1
e = E + [3P 2E EE ] for Fe < 0
8
The discretized equation takes the form
aP P = aW W + aE E + S
(35)
(36)
(37)
The advantage of this approach is that the coefficients are always positive and now
satisfy the requirements for conservativeness, boundedness, and transportiveness.
AERO 4304
Lecture 10
19
Figure 11: Comparison of QUICK and upwind differencing schemes against the exact
solution of the convection-diffusion equation
4.5.2
The QUICK differencing scheme has greater formal accuracy than the central differencing or hybrid schemes while also retaining the upwind-weighted characteristics
that make it conservative and possess transportiveness property. The resultant numerical diffusion is small and solutions achieved with coarse grids are often considerably more accurate than those achieved with upwind or hybrid schemes. Figure 11
shows a comparison between upwind and QUICK against the exact solution of the
convection-diffusion equation. It can be seen that the QUICK scheem matches the
exact solution much more accurately than the upwind scheme on a 50 50 grid.
Figure 11 also illustrates that the QUICK scheme can give minor undershoots
and overshoots in the solution. In complex flow calculations, such oscillations can
AERO 4304
Lecture 10
20
cause QUICK schemes to give unbounded results, and such a possibility needs to
be considered when interpreting solutions. Classes of QUICK schemes with limiter
functions that are specially formulated to achieve oscillation-free solutions have been
proposed but are beyond the scope of this course. Interested readers can refer to
Hirsch (1990).
References
Hayase, T., Humphrey, J.A.C & Greif, R. 1992 A consistenly formulated
QUICK scheme for fast and stable convergence using finite-volume iterative calculation procedures. Journal of Computational Physics 98, 108118.
Hirsch, C. 1990 Numerical Computation of Internal and External Flows, , vol. 2.
John Wiley & Sons, Chichester, England.
Leonard, B.P. 1979 A stable and accurate convective modelling procedure based
on quadratic upstream interpolation. Computer Methods in Applied Mechanics and
Engineering 19, 5998.