You are on page 1of 8

Department of Mechanical & Aerospace Engineering

CARLETON UNIVERSITY

AERO 4304: Computational Fluid Dynamics


Winter 2013

Lecture 16: Finite Volume Methods for Unsteady Flows


Lecture summary
In this lecture, we will discuss
FVM in unsteady, one-dimensional diffusion problems
FVM in unsteady, one-dimensional convection-diffusion problems
Pseudo-transient approach for steady-state simulations

Introduction to unsteady flows

Up to now, our discussion of the FVM has been limited to flows that are timeindependent (i.e steady). Having finished the discussion on such flows, we are now
ready to apply the FVM to the more general category of time-dependent (i.e. transient
or unsteady) flows. The general conservation law for the transport of a scalar in an
unsteady flow has already been derived:

() + div(u) = div (grad ) + S .


t
The first term of the equation represents the rate of change term (i.e. the unsteady
term) and it is zero in steady flows. In transient flows, we must retain this term in the
discretization process, and hence the finite-volume integration of the scalar transport
equation over a control volume CV must be augmented by a further integration over a
finite time-step, t. By replacing the volume integrals of the convective and diffusive
terms with surface integrals and changing the order of integration in the unsteady
term, we obtain:
t

Z
Z
Zt Z
()dt d + n (u)dA dt
t
t
t
A
CV
(1)

t
Z Z
Zt Z
= n (grad )dA dt +
S ddt
t

t CV

AERO 4304

Lecture 12

So far we have made no approximations, but to proceed further, we need to make use
of the techniques in previous lectures for evaluating the integrals. The control-volume
integration is essentially the same as in steady flows, so the methods of previous lectures are adopted to ensure successful integration of the convection, diffusion, and
source terms. But what about the unsteady term? In this lecture, we focus our discussion on methods for time integration, first for unsteady, one-dimensional diffusion
problems, and then for unsteady, one-dimensional convection-diffusion problems.

Time-integration of unsteady diffusion problems

Unsteady one-dimensional heat conduction is a type of unsteady diffusion problem.


It is governed by the equation



T
T
=
k
+S
(2)
c
t
x
x
where the unsteady term contains the specific heat of the material, c, which has units
of J/(kgK).
Consider the one-dimensional control-volume mesh shown in Fig. 1. Integration
of Eqn. 2 over the control volume over a time interval from t to t gives
Zt Z

T
c ddt =
t

t CV

Zt Z

t CV

T
k
x

ddt +

Zt Z

Sddt

t CV

which may be written as



 
Zt
Zt
Z Zt
T
T
T
c dt d =
kA
kA
dt + Sdt
t
x e
x w
CV

(3)

(4)

where A is the face area of the control volume, is its volume, and S is the average
source strength in the control volume. If a temperature at a node is assumed to
prevail over the whole control volume, the left hand side can be written as

Z Zt
c T dt d = c(TP TP0 )
(5)
t
CV

where the superscript 0 refers to temperatures at time t; temperatures at times t + t


are not superscripted. The same result could be attained by substituting (TP TP0 )/t
for T /t, so this term has been discretized with a first-order backward differencing
scheme. Higher-order schemes can also be used to discretize the unsteady term, as

AERO 4304

Lecture 12

well see shortly. Now, if we apply second-order central differencing to the diffusion
terms on the RHS, we may write Eqn. 4 as



 
Zt
Zt
Z Zt
T

T
T

T
T
E
P
P
W
c dt d =
kA
kA
dt + Sdt (6)
t
xP E
xP W
e
w
CV

To evaluate the RHS of this equation, we need to make an assumption about the
variation of TP , TE , and TW with time. We could use temperatures at time t or time
t + t to calculate the time integral or, alternatively, a combination of both. We may
generalize the approach by means of a weighting parameter that may hold values
between 0 and 1 and then write the integral IP of temperature TP with respect to
time as
t+t
Z


IT =
TP dt = TP + (1 )TP0 t
(7)
t

From this, several cases become clear: if = 1, the temperature at the new time level
t + t is used; if = 0, the temperature at the old time level t is used; and if = 1/2,
the temperatures at t and t + t are equally weighted. Using Eqn. 7 for TW and TE
in Eqn. 6 and diving by At throughout yields




ke (TE TP ) kw (TP TW )
TP TP0
x =

c
t
xP E
xW P


(8)
0
0
0
)
ke (TE TP ) kw (TP0 TW

+ Sx
+ (1 )
xP E
xW P
which may be rearranged to give





x
ke
kw
x
ke
kw
+
+
TP = c
(1 )
(1 )
TP0
c
t
xP E xW P
t
xP E
xW P




ke
kw
0
+
TE + (1 )TE0 +
TW + (1 )TW
+ Sx
xP E
xW P
(9)
If we identify the coefficients of TE and TW as aE and aW , we can write Eqn. 9 in
standard form:
0
aP TP = aW [TW + (1 )TW
] + aE [TE + (1 )TE0 ]
+ [a0P (1 )aW (1 )aE ]TP0 + b

(10)

AERO 4304

Lecture 12

Figure 1: One-dimensional finite volume mesh


where
aP = (aW + aE ) + a0P
x
a0P = c
t
kw
aW =
xW P
ke
aE =
xP E
b = Sx
The exact form of the final discretized equation depends on the value of . When is
0
zero, we only use temperatures TP0 , TW
, and TE0 at the old time level t to evaluate TP at
the new time; the resulting scheme is called explicit. When 0 < 1, temperatures
at the new time level are used on both sides of the equation; the resulting schemes
are called implicit. The extreme case of = 1 is called fully implicit and the case
corresponding to = 1/2 is called the Crank-Nicholson scheme (Crank & Nicholson,
1947). Lets consider these methods a bit more in-depth.

2.1

Explicit scheme

In the explicit scheme, the source term is linearised as b = Su + Sp TP0 . Now the
substitution of = 0 gives the explicit discretization of the unsteady conductive heat
transfer equation:
0
aP TP = aW TW
+ aE TE0 + [a0P (aW + aE SP )]TP0 + Su

(11)

where aP = a0P and the other coefficients are the same as above. Now, the RHS
contains only values at the old time step so the LHS can be calculated by forwardmarching in time. The scheme is baced on backward differencing and its Taylor series

AERO 4304

Lecture 12

truncation-error accuracy is first-order with respect to time. As discussed earlier, for


stability, all coefficients of the discretized equation need to be positive. The coefficient
TP0 may therefore be viewed as the neighbour coefficient connecting the values at the
old time level to those at the new time level. For this coefficient to be positive, we
must have a0P aW aE > 0. For a constant value of conductivity k and uniform
grid spacing (xP E = xW P = x, this condition may be written as
c

2k
x
>
t
x

or
t < c

(x)2
2k

(12)

This restriction defines a maximum limit on the time step size, which represents
a serious limitation for the explicit scheme. It becomes very expensive to improve
spatial accuracy because the maximim possible time step needs to be reduced as the
square or x. Consequently, the explicit method is not recommended in general for
transient problems. Of course, there are other explicit schemes that can be used,
such as the Richardson and DuFort-Frankel methods described in the section on
finite-difference methods. Nevertheless, provided that the time step size is chosen
appropriately, the explicit scheme is suitable for simple conduction calculations.

2.2

Crank-Nicholson scheme

The Crank-Nicholson method results from setting = 1/2 in Eqn. 10. Now the
discretized unsteady heat conduction equation is
aP TP = aE



 h
0
TE + TE0
TW + TW
aE
aW i 0
+ aW
+ a0P

TP + b
2
2
2
2

(13)

where
1
1
1
aP = (aW + aE ) + a0P SP , and b = Su + Sp TP0
2
2
2
Now, since more than one unknown value of T at the new time level is present in
the equation, the method is implicit and simultaneous equations for all node points
need to be solved at each time step. Although schemes with 1/2 1 are
unconditionally stable for all values of the time step, it is also important to ensure
that all coefficients are positive physically realistic and bounded results. This is the
case if the coefficient of TP0 satisfies the following condition:


aE + aW
0
aP >
2

AERO 4304

Lecture 12

which leads to

x2
(14)
k
In comparison to Eqn. 12, the time step limitation for the Crank-Nicholson method
given in Eqn. 14 is only slightly less restrictive than the explicit method. However,
because the Crank-Nicholson method is based on central differencing, it is secondorder accurate, and so with sufficiently-small time steps, it is possible to achieve
considerably greater accuracy than with the explicit method. As a result, the CrankNicholson scheme is normally used in conjunction with a higher-order spatial discretization method.
t < c

2.3

Fully implicit scheme

When the value of in Eqn. 10 is set equal to 1, we obtain the fully implicit scheme.
The discretized equation is
aP TP = aW TW aE TE + a0P TP0 + Su

(15)

where
aP = a0P + aW + aE ) SP
As in the Crank-Nicholson method, both sides of the equation contain temperatures
at the new time step, so a system of algebraic equations must be solved at each time
level. The time-marching procedure starts with a given initial field of temperatures
T 0 . The system of equations represented by Eqn. 15 is solved after selecting a time
step t. Next the solution T is assigned to T 0 and the procedure is repeated to
progress the solution one step further in time.
It can be seen from Eqn. 15 that all coefficients are positive, which makes the
implicit scheme unconditionally stable for any size of time step. The accuracy of the
method is only first-order in time, which means that small time step sizes are needed
to ensure accuracy of the results. The implicit method is used in general-purpose
transient calculations because of its robustness and unconditional stability, despite
the added computational cost associated with the solution of the algebraic system of
equations at each time step.

Time-integration of unsteady convection-diffusion


problems

If we compare the fully-implicit discretized equation for unsteady diffusion problems


(Eqn. 15) to that for steady-state problems, we see that the only difference is the
addition of the a0P term in the aP coefficient and the a0P TP0 term in the discretized equation. This suggests that the discretized equations for unsteady convection-diffusion

AERO 4304

Lecture 12

problems are the same as for the steady-state (discussed in Lecture 10) plus a0P TP0
and also including a0P term in the definition of aP . Therefore, we can define a generic
discretized equation for unsteady convection-diffusion problems as follows:
0
aP TP = aW [TW + (1 )TW
] + aE [TE + (1 )TE0 ]

+ [a0P (1 )aW (1 )aE ]TP0 + Sx

(16)

The blending parameter 0 1 has the same meaning as above. The central
coefficient aP is defined as
0P x
.
t
The neighbour coefficients aW and aE can be defined according to any of the methods
discussed in Lecture 10. As before, the unsteady terms can be integrated using an
explicit method by setting = 0 or by an implicit method by setting 0 < 1. For
= 1/2, the Crank-Nicholson method is obtained. The restrictions on the choice of
x and t to ensure stability and boundedness are the same in unsteady convectiondiffusion problems as in unsteady diffusion problems.
aP = aW + aE + F , F = Fe Fw , and a0P =

Solving the unsteady momentum and continuity


equations

In Lecture 11, the steady momentum and continuity equations were discretized on
a staggered grid and solved using an algorithm like SIMPLE. Now, the unsteady
momentum equation contains transient terms that need to be formulated with the
procedure described in Section 3. In addition, the continuity equation contains a
transient term, so an additional term is required in pressure-correction equation. For
example, the pressure correction equation for a transient two-dimensional developed
using the SIMPLE algorithm will be
X
aP pP =
anb pnb + b
(17)
nb

where
aE
aW
aN
aS
aP

=
=
=
=

e de yv
w dw yv
n dn xu
s ds xu
X
=
anb
nb

b = Fw Fe + Fs Fn +

(0P P )yv xu
.
t

AERO 4304

Lecture 12

The overall solution procedure would then be:


1. Initialize u, v, p, and .
2. Set time step t.
3. Let t = t + t and u0 = u, v 0 = v, p0 = p, 0 = .
4. Perform the SIMPLE or SIMPLER algorithm until convergence is reached.
5. If t > tmax , where tmax is the maximum simulation time, stop. Else, go to step
3.

References
Crank, J. & Nicholson, P. 1947 A practical method for numerical evaluation of
solutions of partial differential equations of the heat-conduction type. Proceedings
of the Cambridge Philosophical Society 43, 5067.

You might also like