Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

Numerical Methods for Conduction Heat Transfer 33

4.3 DIMENSIONAUlY IN CONDUCTION

Depending on the physical processes involved, a conduction problem may be one,


two- or three-dimensional. One and two-dimensional configurations are common.

4.4 SOME IMPORTANT EXAMPLES OF HEAT


GENERATION IN A BODY
NUMERICAL METHODS The internal heat generation may be due to flow of electrical current in a body,
chemical reaction or release of nuclear energy as in nuclear fuel rods in a nuclear
FOR CONDUCTION reactor. The source of energy may be concentrated, as in a small-diameter cur-
rent-carrying electrical conductor inside thick insulation or the source may be
HEAT TRANSFER distributed, as in the elements or shield of a nuclear reactor. The example of
uniform heat generation is the electrical heating throughout a material, as for
example in coil of an electric heater or in a microwave oven.

4.5 HOW DOES THE ClASSIFICATION OF


4.1 APPLICATIONS OF HEAT CONDUCTION A CONDUCTION PROBLEM HELP?

Heat conduction has numerous applications in modern technology, in geological The classification of a problem as mentioned earlier essentially helps the heat
sciences, and in many other evolving areas such as materials processing '.Some transfer analyst to decide on the approach to be used to solve the problem. It also
examples are cooling fins or extended surfaces, solidification .and meltm~ of tells us the level of difficulty to be encountered in obtaining the solution, that is,
metals and alloys in metallurgical industries, welding, metal cutti~g: quenching, the temperature distribution within the body.
electrical, chemical and nuclear heating, periodic temperature variations of earth
surface, baking oven, furnace walls, heating and cooling of buildings, to name
4.6 BASIC APPROACH IN NUMERICAL
just a few. To analyse thermal stress conditions in a mat~rial, te~perature HEAT CONDUCTION
distribution must be obtained by solving the heat conduction equation. The
Many difficult problems arise in conduction, for example, variable thermal con-
starting point of all such analyses is the differential equation (energy eq.uation)
ductivity, distributed energy sources, radiation boundary conditions for which
based on the physical formulations of the phenomena relevant to conduction.
analytical solutions are not available. Approximate solution is then obtained by
4.2 STEADY AND UNSTEADY CONDUCTION numerical method. The basic approach is to arrive at the relevant governing
differential equation based on the physics of the particular problem. They are
Since the numerical treatment of a conduction problem depends on the nature of then converted to the required finite difference forms. To begin with, the numeri-
the conduction process, all conduction processes are divided broadly into two cal solution procedure for the problem of a simple one-dimensional steady state
categories, namely, steady and unsteady. Steady state means that temperature, heat conduction in a cooling fin is described. It is to be noted that simple, closed-
density, etc. at all points of the conduction region is independent of time. Un- form straight forward analytical solution for this problem is available. The idea is
steady state means a change with time, usually only of the temperature. Unsteady to show the use of numerical method and to compare the numerical solution with
state problems can be further split into the categories, that is, periodic an~ tran- its analytical counterpart.
sient. Daily variation of earth's temperature due to solar effects examplifies a
typical periodic heat conduction problem. Another example is the engine wall 4.7 ONE-DIMENSIONAL STEADY STATE PROBLEM
temperature variations due to cyclic changes in combustion gas temperature. The
immersion of hot steel plate in a cold quenching tank is an example of transient Consider the one-dimensional steady state heat conduction in an isolated rectan-
conduction. Transient periodic heat conduction is also not uncommon. gular horizontal fin as shown in Fig. 4.1. The base temperature is maintained at
=
T To and the tip of the fin is insulated. The fin is exposed to a convective envi-
ronment (neglecting radiation heat transfer from the fin) which is at T~ (T~ < To).
Numencat r-iemoos tor Conduction Heat Transfer 3
34 Computer Simulation of Flow and Heat Transfer
The average heat transfer coefficient of the fin to the ambient is h. The length of hP
m2::::-
where kA
the fin is L and the coordinate axis begins at the base of the fin. The
one-dimensionality arises from the fact that thickness of the fin is much small as
and
e(o) =I (4.2a)
compared to its length and width can be considered either too long or the sides of
the fin to be insulated.
e'(l) =0 (4.2b)

where
()' = de
T= To h, T"" dX
dT
dx =0
4.1.4 Discretization Interior grid point

2 M-l M
I-----+-x Equation (4.2) is discretized at any in-
L terior grid point i (see Fig. 4.2) using o 0 000

Fig. 4.1 Physical domain of the rectangular fin central difference for
d2e
--2- as follows:
i-l i+l
dX
4.7.1 Governing Differential Equation Fig. 4.2 Computational domain of
the rectangular fin with
The energy equation for the fin at the steady state (assuming constant k) is (
--d2e ) - «mL) 29).
dx2 . I
=0 equally spaced grid points
I

(4.1) or

where P and A are the perimeter and the cross-sectional area of the fin respec-
tively. or 8i _1 - D 8i + 8i + 1 = 0, i = 2, .... M (4.3)

where D = 2 + (mLi (IlXl


4.7.2 Boundary Conditions
Since Eq. (4.1) is a linear, second order ordinary differential equation, two bound- Handling of the boundary condition Atx = L, i.e., at i = M, Eq. (4.3) reduces to
ary conditions are needed to completely describe this problem (which is a bound-
ary value problem or elliptic problem). eM-I - DeM + eM + 1 = 0 (4.4)
Boundary conditions are A careful look at Eq. (4.4) reveals that eM + 1 represents
a fictitious temperature
B.C.l : atx = 0, T= To (4.1a) e at point M + I which lies outside the computational domain. So, what is the
remedy?
B.C.2: at x = L, dT =0 (4.1b)" Remedy 1: Image Point Technique It is assumed that vs X curve extends e
dx
beyond X = I so that at X = 1, the condition de = 0 is satisfied. In other words, e
4.7.3 Non-dimensionalisation dX
vs X curve can be imagined to look as in Fig. 4.3. The dotted line represents the
Non-dimensionalising Eq. (4.1) and Eqs 4.1(a) and 4.1(b) using the
mirror-image extension of the solid line indicating that a minima exists at X 1. =
dimensionless variables Figure 4.4 shows a mirror-image extension of the fin. Therefore, the boundary
T-T conditionatX =
Ican be approximately satisfied by taking
e= "" and X= ~
L' 8M + I = eM _ I (4.5)
To - T""
2
we obtain d e _ (mL)2 e = 0 (4.2) Eq. (4.5) also follows from the central difference approximation of de
dX
at i = M.
dx2
36 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 37

Remedy 2: Use of Higher Order Backward Difference Expression An alterna-


tive to image-point techniq~e is to use a second order backward difference for

~ at i = M, that is,
dX
dO) 30M -40M_1 +O,M-2
- ----~---=-- + 0(LlK)2
( dX j=M - 2(~ X)

30 M - 40 M - I + M -
--------=0
° 2

2(~X)
x or 30M - 40M_1 + 0M-2 = 0 (4.9)
Fig. 4.3 Mirror-image extension of () vs/ X curve near the fin tip
Eq. (4.9) is valid at the grid point on the right boundary. The second order scheme
is used to match the order of accuracy of the central difference scheme used for
interior points.
It is clearly seen that higher order backward difference scheme for 0' at i = M
does not give any more advantage than the image-point technique because the
order of accuracy is same for both.
However, for non-uniform grid spacing near the boundary, use of a higher
order backward difference scheme derived from polynomial fitting involving
three points (including one on the boundary) would be advantageous. The scheme
Fig. 4.4 A mirror-image extension of the fin of polynomial fitting is described next.
Polynomial Fitting The basic principle is to assume a polynomial passing
Substituting Eq. (4.5) into Eq. (4.4), we get through a given number of grid points. For an nth order polynomial, (n + 1) grid
20M _ 1 - D OM = 0 (4.6) points are needed to evaluate all the coefficients that appear in the polynomial.
With reference to Fig. 4.5, let us consider fitting a second-order polynomial to
Therefore, we can write that
three grid points that are located at non-uniform distances from each other.
01 =1 for i = 1 (known)
OJ_l - D OJ + OJ + 1 = 0 for i = 2, ... M - 1 (4.7)
20M _ 1 - D OM = 0 for i = M
Hence, we have a set of M - 1 linear simuitaneous algebraic equations and
M - 1 unknowns which can be easily solved by standard numerical methods.
= = =
For the case in which M 5, we have N M - 1 4 equations to solve. The
four equations can be written in the matrix form as

(4.8)
Ax RAx

It should be noted that 01 corresponds to temperature at grid point 2 in Fig. 4.1, xi ; 1 Xi+2
and so on for 02' 8:3, 04' Fig. 4.5 Polynomial fitting to three unequally spaced grid points
38 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 39

The algebra is simplified if xi is taken as 0 so that xi + t = &, and TM-1 - TM L\x


Xi+2= (R + 1)&, where R is the ratio of the larger to smaller grid spacing. The or kA = hp -(TM- T~)
L\x 2
functionj{x) = Y is taken as
2 hP 2
Y = ao + atx + ar (4.10) or 2TM_I-2TM= kA (~x) (TM-T~)

Now, Yi=aO (4.11)

Yi+t = ao + at & + a2(&)2 (4.12) or 2TM-t - TM (2 + ~: (~x)2 ) = - ~: (~x)2 T~


Yi+2 = ao + at (R + 1)& + a2(R + 1)2 (&)2 (4.13)
or 2TM_I-TM(2+m2(&)2)=-m2(&)2T~ (4.18)
with y' (x) = at (4.14)
The non-dimensional form ofEq. (4.18) is
and y"'(x) = 2a2 (4.15)

From Eqs (4.11), (4.12), and (4.13), ao, at and a2 are evaluated. Substituting
28M-I - (2 + (mL)2 (Mi) 8M =0
at and a2 in Eq. (4.14) and Eq. (4.15), we obtain or 28M_I - D8M =0 (4.19)
Eq. (4.19) is exactly the same as Eq. (4.6) obtained earlier by using the image
, -Yi+2 + (1 + R)2 Yi+t - R(2 + R)Yi
(4.16) point technique. . ..
Yi= R(1 + R) ~ x For other coordinate systems, the two are very close, III the finite-difference
approximation for numerical computation (Jaluria and Torrance, 1986). The
" Yi+2 - (1 + R) Yi+1 + RYi
and (4.17) image-point technique is very frequently used for complex geometries and flow
Yi = .!. (R + 1)(~x)2 problems. In this book we shall in general, use this technique for handling bound-
2
ary conditions unless a situation demands otherwise.
Eq. (4.16) and Eq. (4.17) are the forward difference expressions. Using a similar
approach, backward difference expressions can also be derived. 4.7.5 Methods of Solution
Some Comments on the Image-Point Technique For the cartesian system, the In Eq. (4.8), the coefficient matrix has three diagonals-main diagonal, sub-
image-point technique yields the same result as that obtained from an energy diagonal and super-diagonal, and hence the name tridiagonal matrix (abbreviated
balance for the half-control volume surrounding the grid point on the boundary as as TDM). The set of equations in Eq. (4.8) is called tridiagonal system of
shown in Fig. 4.6. In this approach, the temperature of the nodal pointM (the grid equations. See Fig. 4.7 for a pictorial representation ofTDM.
point M) represents the temperature of a thin wall &/2 thick surrounding the
node. The energy balance results in the following equation
Main diagonal Super-diagonal

~-diagOnal

~
qconvection= hp - (T M - T~)
2

qconductedin= qM-l,M
i,-----t-----.--!- __
r-e
Insulated boundary

MO-_-l----ti::*_~___________ M (no heat transfer) \


-v
I "-y---J "-y---J
Tridiagonal Unknown Right hand
I----~ qconvectedout= 0
coefficient matrix column column
vector vector
'A' 'X' 'c'
Fig. 4.6 Energy balance on the half control-volume surrounding the Fig. 4.7 Pictorial representation of a tridiagonal coefficient
grid point M on the insulated boundary matrix, unknown vector and known right hand vector
40 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 41

The set of equations in Eq. (4.8) can be solved by any of the three methods: nd-off errors arise in the solution of such systems. Obviously, the computer
u
1. Gaussian elimination ro
time is much less for solution . by TDMA. Th us, Iarge tnidilagon al systems are
2. Thomas Algorithm (or Tridiagonal Matrix Algorithm or simply TDMA) ge·nerallysolved by this method.
3. Gauss-Seidel Iterative Method
Thomas Algorithm or Tridiago~al Matrix Algorithm '" rr:~ .The set of
Gaussian Elimination (G- E) This method reduces a given set of N equations equations in Eq. (4.7) can be ~eadliy solved b~ the GaussI~ elimination method
to an equivalent triangular set, so that one of the equations has only one unknown. with a maximum of three vanables per equation. The solution can be expressed
This unknown is determined and the remaining unknowns are obtained by the
very concisely. . .
process of back substitution. The basic approach is shown in a step-by-step form Equation (4.7) is actually a special form of the system (using N = M -1)
as given. The set of equations to be solved are written in matrix form in
Eq. (4.20).
bl r, + ci T2 = a,
~~+~~+~~ =~
all al2 a3T2 + b3T3 + C3T4 = d3 (4.23)

a21 a22 (4.20)


[
a31 a32
aN_I TN-2 + bN_ITN_1 + CN_ITN = dN_1
all is called the pivot below which the terms are to be made zero. + bN TN = dN
aNTN_l
Step I First, let us demonstrate the validity of a recursion solution of the form
(Carnahan et. al., 1969)

(4.21) (4.24)

in which the constants 13iand Ii are to be determined.


The superscript represents the step number. a~~is now the pivot for the next Substitution ofEq. (4.24) into Eq. (4.7) gives
operation.
Step II
(4.25)

(4.22) Rearranging Eq. (4.25), we obtain


d., - ai Yi-I
Ti=----- (4.26)
aici-l a·ci I
Solution Accuracy Round-off error may significantly affect the accuracy if a b. - b. - I -

large number of equations is involved. In addition, the round-off error is cumula- I 13i-1 I 13i-1
tive because the errors are carried on from one step to the other during the elimi-
Equation (4.26) verifies the form ofEq. (4.24), subject to the following recur-
nation process. Consequently, G-E is generally used if the number of equations is
sion relations:
typically less than 20 when the coefficient matrix is dense. For sparse coefficient
matrix, however, a large number of equations can be solved. TDM system is a
good example of sparse coefficient matrix. If Gaussian elimination is applied to
this system, only one of the 'a's is eliminated from the column containing the
pivot element in each step, since the remaining elements below the diagonal are Ii=
zero. Therefore, only one elimination process is employed at each step. The Pi
number of operations needed for solving a tridiagonal system is of order N, that Also, from the first equation of Eq. (4.23),
is, O(M as compared to O(N3) for a system with a dense coefficient matrix. dl ci
Therefore, much smaller number of operations and consequently much lower T ----T,
I - hi hi 2
42 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 43

from which we get erical solution is only what arises in the computation for the final iteration.
num
However, the solution is not exact but IS . obtaine
. d to an arbiitrary, speer'fiie d ,
dl
and YI=- convergence criterion.
PI Jacobi Method (Predecessor of G-S Method) Let us consider the set of linear
Finally, substitution of the recursion solution into the last equation of equations given by
Eq. (4.23) yields
all XI + al2 X2 + + alN = CI
XN

TN=
_d_N_-_a_N_T_NI _- d
N
-aN (rN-t -? TN )
~I Xl + a22 X2 +
............................
aNI X I
+ a2N XN = C2

+ aN2 X2 + ... + aNN XN = CN


(4.29)

bN bN
The equation in the set of Eq. (4.29) may be rewritten by solving for the
dN-aNYN-I
from which unknowns Xi' as follows
aNcN_I
bN ----- CI - a12x2 - al3x3 - .. , - alN XN
P N-I
all
In a nut-shell, the complete algorithm for the solution of the tridiagonal system
C2 - a21xI - a23x3 - ..• - a2N xN
is (4.30)
a22
(4.27)

Ci 1i+1 .
Ti = 1';- Pi ,z=N-I,N-2, ...,1
aNN

where, f3's and /"s are determined from the recursion formulae The set of equations in Eq. (4.30) may be written in a compact form as

dl
PI = b., YI = 7i:
a, c,
Pi = b, - fi 1-
1
, i = 2, 3, ..., N (4.28)
To start the iterative process, initial guess values are assigned to all the
i-I
unknowns. Ifx\O),xiO), ... ,1iO), ... xJO) are taken as the initial values, the value ofx,

1';=
di - ai Yi-l
Pi
.
,z=2,3, ...,N
after the first iteration, x\')
is obtained from
(0) (0) (0)
(I) _ cl - al2 x2 - an x3 - .•. - alN xN
(4.32)
The above algorithm is also known as Thomas Algorithm. See Appendix C for XI -
listing of subroutine TDMA.
Finally, it is to be noted that Eq. (4.7) might also be solved by the Gauss-
Seidel iteration scheme discussed next.
Similarly, (4.33)
Gauss-Seidel Iterative Method(G-S) For a large number of equations (typically
of the order of several hundred) iterative methods, which initiate the computa-
tions with a guessed solution and iterate to the desired solution of the systems of The values obtained after the first iteration are then used for the next iteration.
equations within a specified convergence criterion, using improved guesses in the Thus,
second, third iterations till the final one, are often more efficient. In this method,
N
unlike in direct methods like Gaussian elimination the round-off error does not Ci - L.aij xJP)
accumulate. The round-off error after each iteration simply produces a less :x!f + I) = _---'J'-. =_':-'0'tz:_- for i = 1, 2, ..., N (4.34)
accurate input for the next iteration. Therefore, the resulting round-off error in the I
Numerical Methods for Conduction Heat Transfer 45
44 Computer Simulation of Flow and Heat Transfer

This process is known as Jacobi iterative method. that is, when the system is diagonally dominant. .This is a~bsolkno,,:n has
Scarborough Criterion. However, convergenc~ may sun
be pO.SSl ~ even 1f t e
Disadvantages of Jacobi Method The main disadvantage is that the computer e condition is not satisfied. Fortunately, It turns out that in fluid flow and
b OV
aheat •• 1 d di 11
storage is needed for the present iteration as well as the previous one. This is transfer pro~lems, fi~te-di~fer~nce formulation indeed ea s to iagona y
because all the values are computed, using previous values before any unknown dominant coefficient matnx which IS the reason why for large systems Gauss-
is updated. Seidel method is so widely used.
Gauss-Seidel Method: An Improvement over Jacobi Method A significant Application of G-S Iterative Method. In order. to ~emolnstdrabteGthesi.tteratt~on
improvement in the rate of convergence and in the storage requirements can be process, the following system of three linear equations IS so ve y - 1 era ive
obtained by replacing the values from the previous iteration by new ones as soon method using a pocket calculator.
as they are computed. Then, only the values of the latest iteration are stored, and
IOx, + x2 + 2x3 = 44
each iterati ve computation of the unknown employs the most recent values of the
other unknowns. This computational scheme is known as point-by-point Gauss- 2x1 + lOXz + x3 = 51 (4.36)
Seidel method. XI + 2x2 + 10x3 = 61
Example of G-S iteration Clearly, the coefficient matrix in Eq. (4.36) is diagonally dominant because

110 I > 11 + 21
1101>12+11
110 I> 11 + 21
Here, the value of XI is known after the second iteration, and the others are
known only after first iteration. Therefore, the Scarborough criterion is satisfied and hence, one is certain to
get a converged solution using G-S iterative method. As a first guess, let us take
i-I N
c, - Laij XJP+I) - Laij xjP) [XI' x2' X3]O = [0, 0, 0]
(p+l) _ j=1 j e i + I Let e = 0.02.
Xi - fori=I,2, ... ,N (4.35)
au
Then, x(1) = _1_ [44 - xiO) - 2x~O)]
It may be noted that G-S iteration consumes 2N steps (not to be confused with
I 10
number of arithmetic operations) in each iteration.
= _1 [44 - (0) - 2(0)] = 4.40
Convergence Criteria for G-S Method Typical convergence criteria used are 10

(1) IxY'+I)-lf)l$e fori=I,2, ... ,N xiI) = 1~ [51 - 2xfl) - x~O)]

x(p+l) - x(p) I< = _1 [51- 2(4.40) - 0]


(2) I I
e for i = 1,2, ..., N
I Xi
(p) _ 10
=4.22
where s is a very small number like 0.01, 0.001, 0.0000l.
The criterion #2 is applicable if an estimate of the magnitude of the unknowns X(I) = _1_ [61- x(1) - 2x(1)]
3 10 I 2
Xj is not available and none of the unknowns is expected to be zero.

Condition for Convergence in G-S Method: Scarborough Criterion The = _1 [61- 4.40 - 2(4.22)] = 4.81
10 .
convergence is guaranteed for linear systems if
Now, [Xl' X2' X3]l = [4.40,4.22,4.81]
N
la ii I> I.la ij I Check for convergence after first iteration:
j=lJ~i
10 - 4.401 = 4.40 > e
46 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 47

10 - 4.221 = 4.22 > E -' .x!1) =.!!:... (44 - xeD) - 2x(D)) + xeD) (1- a) (4.38)
~ 1 10 2 3 1
10-4.811 = 4.81> E

Result: No convergence From Eq. (4.38), it is readily seen that for


One more iteration gives a = 0, xP) = xlD) No progress
[xI' x2' x3f = [3.01,4.01,4.99] a = 1
'I
x(l) = x(1)1 G-S Basic G-S iteration
Check for convergence after second iteration. O < a < 1, Under-relaxation -----7 Interpolation between xlO) and:ill G-S

13.01 - 4.401 = 1.39> E 1 < a < 2 -----7 Over-relaxation -----7 Extrapolation beyond Xli) G-S
In compact form, the relaxation method may be written as
14.01 - 4.221 = 0.21 > E
14.81 - 4.991 = 0.18> E
a[Ci - i~aij xjP+l) - faij X]P)]
Result: Still no convergence. x/( + I) = ---..!=---=--=-----~~..:....::....--~
j=l i=i+t + (1 - a)x/( )
One more iteration gives au
[xl' X2' X3]3 = [3.00,4.00,5.00] for i = 1,2, ..., N (4.39)

Check for convergence after third iteration: Successive under-relaxation (SUR) or under-relaxation is generally used for
nonlinear equations and for systems that result in a divergent G-S iteration.
13.01 - 3.001 = 0.01 < E Successive over-relaxation (SOR) or over-relaxation is widely used for
14.01 - 4.001 = 0.01 < E accelerating convergence in linear systems.
14.99 - 5.00 1= 0.01 < E Optimum Relaxation Factor, aopt The question is-What value of over-
Result: Convergence reached. relaxation factor should be used. There is no set rule to determine this. One has to
Hence, further computation stops. Therefore, it required three iterations to do numerical experimentations to find out the relaxation factor which gives the
obtain a converged solution. Incidentally, the converged solution is also the exact highest rate of convergence. This is called optimum relaxation factor, aopt and
solution of this set of equations. The reason is that the number of unknowns is lies between 1 and 2 and varies from one problem to another. For the simple case
very small in this case. of Laplace's equation (\j2T = 0) in a square with Dirichlet boundary conditions,
Young (1954) and Frankel (1950) show that aopt equals the smaller root of
Relaxation: Over-relaxation and Under-relaxation One of the problems with
G-S method is that it is relatively slow to converge to the solution. The rate of P« - 16a + 16 = 0 (4.39a)
convergence can often be improved by relaxation method which is explained next. With t = 2 cos (rein), where n is the total number of increments into which the
Consider the example problem that has been solved by G-S method. side of the square is divided. In other words, n is the number of grid spacings. The
number of iterations required for a given convergence criterion falls very rapidly
_1_ {44 _ xeD) _ 2x(D)} _ xeD) when the parameter is in the immediate vicinity of aopl' and it is generally better
10 2 3 I
(4.37) to overestimate aopt than to underestimate it (Carnahan et al., 1969).
change produced by the current iteration
4.7.6 Summary of the Three Methods
Now, the change produced by the current iteration can be increased if we mul- G-E TDMA G-S
tiply it by a factor a (a> 1). However, a also has an upper limit. For a> 2, the
l. Nature: Direct Direct Iterative
change is so great that instead of convergence, divergence occurs, that is, the 2. Salient Features: Based on Based on
solution never converges. a recursion an initial
Therefore, Eq. (4.36) can now be written as Elimination of elements formula, guess of
below pivot in each step unknowns and
X~l) = xfO) +a [_1_
10
{44 - xeD) -
2
2x(O)}
3
- xeD) ]
I
thus resulting in an A variety of its subsequent
(Contd)
48 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 49

(Contd) 1
G-E TDMA G--S
+ R2 ~ -1 1.81 -1
][8
02
]
=[
0.444
11
equivalent triangular set
and obtaining unknowns by
G-E. improvement in
each iteration
R1I2.25
[ -1 2.25
-2
-1
2.25
03
04
0
0
back substitution. Used only for which employs the most
TDM. recent values of the
other unknowns. Step Il: Now, the pivot is 1.81. So, eliminate all terms below the pivot.
3. Round-off Error:
High cumulative round- Low round-off Low round-off 2.25 -1
off error, particularly error as number error.
for dense matrices as
number of arithmetic
operations is O(n\
of operations is
O(n) thus leading
to efficient
algorithm.
Round-off error
in the solution is
only what arises in the
computation for the
R2/1.81 + R3
[
1.81
[!!!] -1
1.7
-2 2.25
-I] I::]04
= [~::]
0
final iteration.
4. Maximum number of Step Ill: Now, the pivot is 1.7. So, eliminate all terms below the pivot.
equations that can be
solved: 2.25 -1
Usually, 20 for dense Quite high. Typically, of
matrices. More for the order of
R3 x 1.176 + R4
1.81 -1
~ 01]
82
r 0.4441 ]
sparse matrices. several hundred.
[
L1.1J -1
1.07
] [°
0 3

4
0.246
0.290
4.7.7 Solution of Eq. (4.8) by All Three Methods
We shall now solve Eq. (4.8) having tridiagonal coefficient matrix by Gaussian The Step ill is the last step as now the triangular coefficient matrix is produced.
elimination, TDMA and Gauss-Seidel iterative method and choose the proper Rl, R2, R3, R4 are used to denote first, second, third and fourth row respec-
method. tively.
Recall Eq. (4.8) given below: The unknowns are obtained by back substitution.
Back Substitution

8 = 0.290 = 0.271
4 1.07
1.7 83 - 04 = 0.246 ~ 83 = 0.304
1.81 O2 - 83 = 0.444 ~ O2 = 0.413
where, D = 2 + (mL)2 (Ml
2.25 81 - 02 = 1 ~ °
1 = 0.628
Let us consider a fin with mL = 2. Also, M= 1.- = 0.25. Therefore, the unknown temperatures are
4
Therefore, D = 2 + (2)2 (0.25)2 = 2.25. 81 = 0.628; 02 = 0.413 83 = 0.304 84 = 0.271
Hence, Eq. (4.8) now becomes
b T~e total number of arithmetic operations (multiplications and divisions) to
1
o tam the solution is 13 (9 for elimination and 4 for back substitution).
2.25
-1 -1
2.25 -1 ] [882] = [1]0 (4.40)
n
EqSOlutioby IDMA Recall the tridiagonal matrix algorithm (TDMA) given by
-1 2.25 -1 83 0 . (4.27) and Eq. (4.28).
[ With respect to Eg. (4.40),
-2 2.25 84 0

Solution by Gaussian Elimination Step I: The pivot is 2.25. So, first eliminate
all terms below the~i~v.:::.ot~. ~_
50 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 51

d, = 1, d2 = 0, d3 = 0, d4 = 0 =0.246- (-1)(0.304) =0.414


b, = 2.25, b2 = 2.25, b3 = 2.25, b4 = 2.25
1.805

a2 = -1, a3 = - 1, a4 = - 2 2 c,8
8,=y,---
c, = -1, c2 = - 1, c3 = - 1
f3,

From the TDMA, =0.444- (-1)(0.414) =0.628


2.25
84 = Y4,
Therefore, 8, = 0.628; 82 = 0.414; 83 = 0.304; 84 = 0.271
f31 = b, = 2.25
The total number of arithmetic operations required to obtain the solution is 10.
dl 1
y, =-=-- =0.444
f31 2.25 Solution by Gauss-Seidel Iteration
Let [8" 82, 83, 84]0 = [1,1,1, 1]
f32 -- b 2- a2 CI
f3, and £= 0.001

= 2.25 _ (-1) (-1) = 1.805 Iteration 1 [8" 82, 83, 84]' = [0.888,0.839,0.817,0.726]
2.25 Iteration 2 [8,,82,83,84]2 = [0.817, 0.726, 0.645, 0.573]
f33-- b 3---a3 C2 Iteration 3 [8" 82, 83, 84]3 = [0.767, 0.627, 0.6, 0.533]
f32
Iteration 4 [8" 82, 0:" 84]4 = [ 0.723, 0.588, 0.498, 0.442]
= 2.25 _ (-1)(-1) = 1.695
1.805 Iteration 5 [8" 82, 83, 84]5 = [0.705, 0.535, 0.434, 0.385]

a4 C3 Iteration 6 [8" 82, 0:" 84]6 = [0.682, 0.496, 0.391, 0.347]


f34 = b4---
f33 Iteration 7 . [8" 82, 83, 84]7 = [0.664, 0.468, 0.362, 0.321]
= 2.25 _ (-2)(-1) = 1.07 Iteration 8 [8" 82, 83, 84]8 = [0.652, 0.45, 0.342, 0.304]
1.695
Iteration 9 [81, 82, 0:" 84]9 = [0.644, 0.438, 0.329, 0.292]
d2, - a2 y,
Y2 = Iteration 10 [81, 82, 83, 84]10 = [0.639, 0.43, 0.32, 0.284]
f32
= 0 - (- 1)(0.444) = 0.246 Iteration 11 [81, 82, 83, 84]" = [0.635,0.424,0.314,0.279]
1.805
Iteration 12 [81, 82, 83, 812 = [0.632, 0.42, 0.31, 0.275]
d3 - a3 Y2 0 - (-1)(0.246)
Y3= = =0.145 Iteration 13 [81, 82, 83, 84]13 = [0.631, 0.418, 0.308, 0.273]
f33 1.695
d4 - a4Y3 Iteration 14[81, 82, 83, 84]14 = [0.63,0.416,0.306,0.272]
Y4 = f34 Iteration 15 [81, 82, 83, 84]15 = [0.629,0.415,0.305,0.271]
= 0 - (-2)(0.145) = 0.271 The convergence is reached on the 15th iteration. Hence, further computation
1.07 stops. .
84 = Y4 = 0.271 Total number of iterations required = 15.
Total number of arithmetic operations in each iteration = 5.
8 = _ C3 84 = 0.145 _ (-1)(0.271) = 0.304
3 Y3 f3 3 1.695 Therefore, total number of arithmetic operations = 75.

c2 83
82=Y2---
f32
52 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 53

4.7.8 The Number of Arithemtic Operations for Table 4.2 A Comparison of the Numerical and Analytical
Each Method: A Comparison Solution of the Fin Problem

Table 4.1 A Comparative Study of Number of Arithmetic Operations


-- X
.
LoCatIOn Temperature, e Absolute percent
error with respect
Needed to Solve Eq. (4.40) by Three Methods to exact solution

Numerical Exact
Name of the Method Number of Arithmetic Operations
Gaussian Elimination 13 e= cos h m L (1- X) )
(_ cos h mL _
Tridiagonal Matrix Algorithm 10
(TDMA) *0 1 1 o
Gauss-Seidel Iteration 75 0.628 0.625 0.48
0.25
(Initial Guess = [1, 1, 1, 1], 0.50 0.414 0.410 0.97
e = 0.001) 0.75 0.304 0.2995 1.50
0.271 0.266 1.88
1
From Table 4.1, it is obvious that TDMA is the fastest method and Gauss-
* Dirichlet boundary condition and hence not computed.
Seidel iteration is the worst method for solving a tridiagonal system of equations.
Therefore, the choice falls on the TDMA for the solution of Eq. (4.40). Table 4.2 clearly reveals that ~ X =
0.25 is not good enough and the grid
Hence, for solving a tridiagonal system of linear equations, Thomas spacing needs to be finer. In other words, morenumber of grid points is necessary
algorithm (TDMA) is preferred. to obtain more accurate solution. However, one has to be also careful in increas-
ing the number of grid points as this will result in higher round-off error. There-
4.7.9 Checking for Accuracy fore, a grid independence test which gives an optimum Mis called for. A point to
The accuracy of a numerical solution is usually checked by one of the three ways: note is that even with a relatively coarse grid the accuracy is quite good. Which
1. Comparison with the analytical solution. For most practical problems means that with a slight decrease in the grid spacings, the numerical solution will
analytical solutions do not exist. But, this is a good way of checking be even closer to its analytical counterpart. Another interesting feature of Table
accuracy of a new numerical method. 4.2 is the gradually increasing error for increasing X. This is possible because of
2. Comparison with the limiting case analytical solution. This is possible the fact that at the left boundary (X = 0) Dirichlet condition is imposed and there-
when the analytical solution for some limiting value of a parameter fore, for both numerical and exact solution same temperature is used for calcula-
governing the solution is available. =
tion of temperature atX 0.25. Hence, the temperature of the grid point closest to
3. Comparison with experimental results. This is most desirable for complex =
the left boundary (i.e., at X 0.25) computed by the numerical method is most
problems such as turbulence, combustion, Non-Newtonian fluid flow and accurate and the error accumulates as the distance of a grid point with respect to
heat transfer which require many assumptions for the purpose of the left boundary increases.
modelling.
4.7.11 Convective Boundary Condition
If ~e tip of the fin was convective instead of insulated, the discretization equation
4.7.10 Comparison of the Present Numerical at =
M would have to be modified.
I
Result with the Corresponding The dimensionless boundary condition at the fin tip in the changed scenario
Analytical Solution Would be written in the mathematical form as

For the present fin heat conduction problem, the analytical solution is available. dO + he L 0 = 0 (4.41)
Therefore, a comparison of the numerical results with the exact solution (for dX k
mL = 2) will enable us to obtain an estimate of the numerical error. Table 4.2
Where he is the convection heat transfer coefficient from the tip of the fin to the
indicates a comparison of the numerical and analytical solution.
surrounding.
< ,

54 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 55

Using the image-point technique as discussed earlier and central difference


4.8.1 Consideration of Symmetry
scheme for discretization of dO at i = M, Eq. (4.41) is expressed as lose look at the physics of the problem reveals that the problem is geometri-
dX Aa1~ and thermally symmetric. Therefore, from the temperature distribution in
c yquarter of the physical domain, by mirror-imaging one can get the solution
OM+1 - 0M-l
:nYthe entire region. Figure 4.9 shows the computational domain (top right hand
2~X :rarter). The use of symmetry enables the numerical analyst to obtain the solu-
tion much faster as the number of grid points is greatly reduced.
or oM+l -
- 0
. M-l -
2 he L~X
k
0
M
(4.42)
y
Substituting the expression for OM+I from Eq. (4.42) into Eq. (4.4), we obtain, T=T~

L .-i----L~-----,
(4.43)

Therefore, only the last equation is changed. The method of solution remains
same as before.
.: ~T=T~
To check the accuracy of Eq. (4.43), substituting he = 0 (corresponding to
insulation condition), we obtain
20M_I - D OM =0
which is same as the one obtained for insulated tip.

4.8 TWO-DIMENSIONAL STEADY STATE PROBLEM


Fig. 4.9 Computational domain (top right hand quarter)
Consider the case of steady heat conduction in a long square slab (2L x 2L) in considering symmetry
which heat is generated at a uniform rate of q'" W/m3 (Fig. 4.8). The problem
can be assumed to be a two-dimensional one as the dimension of the slab is much 4.8.2 Governing Differential Equation
longer in the direction normal to the cross-sectional plane and therefore, end
The governing non-dimensional energy equation (assuming constant k) is
effects can be neglected. All four sides are maintained at aT = T~, temperature of
the surrounding fluid, assuming large heat transfer coefficient. 2 2
d 0 + d 0 + 1= 0 (4.44)
dX2 dy2

Where, T- T~ x y
0= X=-y=-
(q'" L2 / K) , L ' L

4.8.3 Boundary Conditions


q'"
The non-dimensional boundary conditions are

T=T~
~1·------2L------~·1
1 at
at

at

at
X = 0, ex
X=l,O=O
dO = 0

Y= 0 dO = 0
, dY
(4.44a)

(4.44b)

(4.44c)

Fig. 4.8 Physical domain of the slab with square cross-section (2L x 2L) Y=l,O=O (4.44d)
56 Computer Simulation of Flow and Heat Transfer
Numerical Methods for Conduction Heat Transfer 57
4.8.4 Discretization Handling of Corner Points Comer points need special attention because they
The computational domain including the notations for the interior grid points is belong to both horizontal and vertical surfaces. Therefore, the boundary condi-
shown in Fig. 4.10. tions at both the surfaces apply there. However, if one or both of the surfaces has
DiricWet condition, then there is no problem because the comer point can be
2
Equation (4.44) is discretized using central difference for a8 and a82
at assumed to be having a specified temperature. But, if both surfaces have
sx? ay2 Neumann and/or Robbins conditions, then the corner point- has to be handled
any interior grid point (i, j) as follows. separately since both conditions exist there. With respect to the present problem,
out of the four comer points, only the bottom left comer point is exposed to
8 1j
- ·-28
1•
, ..
I,j +8·1+
1· ,j + 8··I,j-I -28 j,j +8 j,j+] Neumann conditions in X and Y directions. Other three have either one or both
+1=0 (4.45)
(1!:.X)2 (.1.Y)2 surfaces exposed to Dirichlet condition. Figure 4.11 shows the image points for
bottom left hand corner represented by the grid point (1, 1).
Taking I!:.X= .1.Y,Eq. (4.45) reduces to Using image-point technique.
(4.46) 80, I = 82, I (4.49)
8J, 0 = 81,2 (4.50)
Boundary Condition Along X = 0 Using image-point technique 8. . = 8. .
and setting i = 1, Eq. (4.46) becomes 'I-I,j 1+I,j 80,1 - 281,1 + 82,1
Now, (4.51)
(.1.X)2
-282,j - 81,j_1 + 4~,j - 81,j+1 = (1!:.X)2 (4.47)

Boundary Condition Along Y = 0 Using image-point technique, (4.52)


8·I,j-. I = 8·l,j+. I
and settingj = 1, Eq. (4.47) becomes Substituting Eq. (4.49) into Eq. (4.51), and Eq. (4.50) into Eq. (4.52), we get
2 282,1 -281,1
-8j +1, I - 28j, 2 + 48j, I - 8j _ I, I = (1!:.X)2 (4.48) ( a8 ) = (4.53)
sx? 1,1 (.1.X) 2

YN
;=0 and
2
( a 8 )
ay2 ]]
=
28!,2 - 28],
(.1.y)2
I
(4.54)

(1,2)
(i,j+l)

sx
L\y
df) '<, f)= o
dX =0
<, (i -l,j) (i,}) (i + I,})

(0,1) O-------------------t#-------{ (2, 1)


(i,j-l)
i (I, 1)
=0

X1=0
df)
-, XM
--0
dY - 6
(1,0)
Fig. 4.10 Interior grid points in the computational domain
Fig.4.11 Image points for the bottom left hand corner point 0, 1)
58 Computer Simulation of Flow and Heat Transfer
Numerical Methods for Conduction Heat Transfer 59
Setting i = l,j = I and substituting Eq. (4.53) and Eq. (4.54) into Eq. (4.45), Since there are 16 unknowns, there will be 16 equations to solve. Using the
we obtain for t:.X = LlY,
matrix representation for these equations, Eq. (4.56) is obtained from Eqs (4.46),
2°2, , - 40" , + 20;,2 + (LlX)2 =0 (4.55)
(4.47), (4.48), and (4.55).
A close look at Eq. (4.56) reveals that
4.8.5 Method of Solution 1. Division of X and Y in relatively coarse sub-divisions leads to many
equations (4 x 4 = 16). In a practical situation, number of equations may
Let us consider an example in which t:.X = 1/4. The grid points that are unlabelled
be hundreds or more.
(Fig. 4.12) are all at temperature, 0= 0 as imposed by the boundary condition.
2. The coefficient matrix is banded which means that the non-zero
Thus, there are 16 unknown temperatures to find (Fig. 4.13).
components only appear in a band on either side of the main diagonal.
There are 9 diagonals (Fig. 4.14). So, the bandwidth is large as compared
y
to TOM. The advantage of having a banded matrix (this is true also for
9= ° (known) TOM) is that special subroutines can be written to solve the problem in
/ less computer time than if the matrix was filled with non-zero components.
3. The zero matrix components outside the band need not be stored in the
(1,4) (2,4) (3,4) (4,4) computer. This is of great significance in large problems where computer
memory size becomes a limiting factor.
Choice of the Proper Method Equation (4.56) can be solved in two ways:
(1,3) (2,3) (3,3) (4,3)
(i) by Gaussian elimination,
9= ° (known) (ii) by Gauss-Seidel iteration.
(1,2) (2,2) (3,2) (4,2)
Let us weigh the pros and cons of both methods before we make our final
~ choice.
It is interesting to note that the banded coefficient matrix in Eq. (4.56) has 124
(1, 1) (2, 1) (3, 1) (4, 1) components within the band rather than the 256 spaces that would have been
° x required to store the entire matrix. One could even reduce the bandwidth by
recognizing the physical and geometrical symmetry across one of the diagonals of
Fig. 4.12 ° 1
the square as shown in Fig. 4.13. This means that Oi,J = OJ, i or

'0
Labelling of grid points using double subscript notation

(known) Band width

4 8 12
.:
l7
L/
Line of symmetry
3 7 15

2
V 10 14
'0°
V
= (known)
5 9 13
o
o
Fig. 4.14 Pictorial representation of the banded coefficient
Fig.4.13 Labelling of the same grid points using single subscript
matrix showing nine diagonals
60 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 61

4 -2 0 0 -2 81 1/16 the second sweep, the computation ygain begins for the first chosen line and
-1 4 -1 0 0 -2 82 1/16 sweep continues till the other boundary is reached. The same procedure is fol-
lowed for third, fourth, till final sweep when there is virtually no change in the
o -1 4 -1 0 0 -2 83 1/16
temperature distribution in consecutive sweeps. An alternating direction method
o 0 -1 4 0 0 0 -2 84 1/16
is also possible. In this method sweeping of the computational domian is done
-1 0 0 0 4 -2 0 0 -1 8s 1/16
alternately in x (or y) and y(or x) direction.
-1 0 0 1 4 -1 0 0 -1 86 1/16 The sweep direction is also important in cases where in one direction one of
-1 0 0 -1 4 -1 0 0 -1 87 1/16 the boundaries has insulation or convection condition while at the other bound-
-1 0 0 -1 4 0 0 0 -1 8g 1/16 ary, Dirichlet condition is specified. For example, in the present problem
(Fig. 4.15),a right-to-left sweep would transmit the known temperature on the
-1 0 0 0 4 -2 0 0 -1 89 1/16
right boundary into the domain; on the other hand, since no temperature is given
-1 0 0 -1 4 -1 0 0 -1 810 1/16
on the left boundary, a left-to-right sweep would bring no such useful informa-
-1 0 0 -1 4 -1 0 0 -1 8ll 1/16 tion. Based on the same argument, in the y-direction, top-to-bottom sweep is de-
-1 0 0 -1 4 0 0 0 -1 812 1/16 sirable.
-1 0 0 0 4 -2 0 0 813 1/16 The fast convergence of the line-by-line method is due to the fact that the
-1 0 0 -1 4 -1 0 814 1/16 boundary condition information from the ends of the line is transmitted at once to
the interior of the domain in sharp contrast with point-by-point Gauss-Seidel
-1 0 0 -1 4 -1 81s 1/16
method in which the boundary condition information is transmitted at a rate of
-1 0 0 -1 4 816 1/16
one grid interval per iteration.
(4.56)
Guessed Known
82 = 8s' 83 = 89, 84 = 8J3and so on. This would reduce the number of equations
from 16to 10. \ I
Furthermore, it may noted that many of the components within the band itself
are zero. In this case, 60 of 124band components are zero. These components
must still be stored, however, if Gaussian elimination is to be used, because
during the elimination process they will, in general, change to non-zero values. If
\
~
Known (Start the
process at the
--- right boundary)
computer storage is critical, one might like to use a method which does not require
storage of these zero components in the band. The Gauss-Seidel iteration method
Sweep
is one way of doing this. In addition to this, round-off error is minimum in Gauss- direction ~
Seidel method. Therefore, in view of the aforesaid two overwhelming merits, in
spite of the clear-cut advantage of Gaussian elimination because of its non-
iterative nature, G-S method is chosen to solve Eq. (4.56).

4.8.6 Line-by-LineMethod
~7
To alleviate the problem of slow convergence of Gauss-Seidel (G-S) method for
large number of grid points, a line-by-line method which is a convenient combi- Chosenline at which
temperaturesare
nation of the direct method (TDMA) for one-dimension and the G-S method can calculated
be used. Basically, the method makes use of the direct nature of TDMA and low
round-off error of G-S scheme. Fig. 4.15 Pictorial representation of the line-by-line method
In the line-by-line method, a grid line (say, in the y-direction) is chosen assum- 4.8.7 Check for Accuracy
ing that the unknowns (say, temperature, 1) along the neighbouring lines (i.e., the
x-direction neighbours of the points on the chosen line) are known from their For the present problem, the accuracy of the numerical results can be checked by
latest values. Now, Ts along the chosen line (Fig. 4.15) is solved by TDMA. comparing it with the corresponding analytical solution which is available. Sub-
This procedure is repeated for all the lines in the y-direction in the first sweep. In sequently, a grid independence test must be done to obtain the desired results.
62 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 63
The analytical (or exact) solution in the dimensionless form is given below
For

eo; y) = 1.. [1-


2
X2] _ 2 i (_I)n
13
cosh
h
An Y
1 COS A II X (4.57)
Tj+I,j,k + Tj_1,j,k + Tj,j+l,k +Tj,j_l,k + Tj,j,k+l + Tj,j,k_l - 6Tj,j.k =0 (4.59)
n=O /\'" cas /\,n If temperature is specified on all six faces and even if five grid spacings are
taken in each direction, the total number of equations to solve is 4 x 4 x 4 64, =
where, All = (2n + I)!!... n = 0 I 2 which shows that even for a relatively coarse grid, one has to solve much larger
2 ", ....
number of equations in comparison with one-dimensional and two-dimensional
problems in which same number of grid points are taken in each direction. Hence,
4.9 THREE-DIMENSIONAL PROBLEMS the computer storage requirement for three-dimensional problems is much more
severe as compared to that for two-dimensional problems. Also, more computer
For three ~im~nsional steady heat conduction in Cartesian coordinates the basic time is necessary for solving such problems. In a practical situation, for a typical
approach IS still th~ same. In this case, a grid point (or a nodal point) is re re- three-dimensional problem, number of equations to solve may be as high as
sented by the notation (i,j, k) as shown in Fig. 4.16. P
several thousands.
For steady three-dimensional heat conduction in a solid body of di .
L x W x t, t h e energy equation
. IS
. ImenSlOns
4.10 lRANSIENT ONE-DIMENSIONAL PROBLEM
J2T J2T J2 Consider a hot infinite plate (Fig. 4.17) of finite thickness 2 L, that is suddenly
T
Jx2 + Jy2 + J 2
Z
=0 (4.58) exposed to a cool fluid at T ee • Initial temperature of the plate is Tj (Tj > T ~). Heat
transfer coefficient is large. We wish to find the temperature of the plate as a
Discretizing Eq. (4.58) at any interior grid point (i j k) using central diff function of space and time using numerical method.
ence, we get ' , 1 er-

k - 211 J' k + T I .k Tj 2T i J' + T.


---'11+1 j-.----'.:' :..:.,::---_'~-...:.::..J'_=__, + "j + I k -
, ,k .
I,J-
1, k
(L\x)2 (L\y)2

211,J' ,k + TI,J,. k -
T(x. 0) = r,
+ 11"j k+1 - I
=0 k. Po C
(L\Z)2 T=T~
Constant

Fig.4.17 Physical domain of the one-dimensional transient


conduction in an infinite plane slab

The problem can be modelled as a one-dimensional unsteady state problem


be
cause
st
ay =az
st = 0 as the plate is infinitely long in y and z directions.

ConSideration of Symmetry Since the problem is a thermally and geometrically


x
symmetric one, only one half of the plate can be taken as the computational do-
Fig. 4.16 Grid point notations for a tl dl . I
iree- imensrona Cartesian system main with insulation boundary condition atx = L (Fig. 4.18).
64 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 65

The equation for X = 1 is obtained by using image-point technique, that is,


substituting OM+ I = OM_ I in Eq. (4.61) for i = M~

dOM = 20M_I -20M


T(x, 0) = t, Therefore. (4.62)
d-r (ilX)2
T = Too st
-=0 For the sake of demonstration, let us take four equal sub-divisions in the
dx X-direction (Fig. 4.19). Therefore, LlX= 114.

,, ,,
,, ,,
,, ,,
,, ,,
,, ,,
,, ,,,
,, ,
,,
,, 1,

(0) (1) t: (2) • (3) • (4)


Fig. 4.18 Computational domain of the one-dimensional :
transient conduction problem

4.10.1 Governing Differential Equation !,


L---~-----L----~--~~--~X
For constant thermophysical properties, k, p, C the non-dimensional energy equa- o .i, 1
tion for the plate is 4 2 4
Fig. 4.19 Equally spaced grid points in the x-direction of
(4.60) the computational domain

° = T - Too X = ~ t = at
°°
At i = 0, = (known).
At i = 1,2,3 from Eq. (4.61), we obtain
where
T - T' L' L2
I

4.10.2 Initial and Boundary Conditions


00

dOl
dr
= 1
(ilx)2
(0
0
_ 20
I
_ ° )=
2 (ilX)2
1 (-2°1 + (2) (4.63)

The initial and boundary conditions are d02 = (4.64)


d-r
r.c.: at r = 0, 0= 1 for all X (4.60a)
For -r> 0, d03 _ 1
dr - (ilX)2 (02 - 2°3 + (4) (4.65)
B.C. 1: atX= 0, 0=0 (4.60b)
At i = 4, from Eq. (4.62), we obtain
s.c. 2: atX= 1, dO
dX
= ° (4.60c)
dO
_4 -
1
(20 20) (466)
dr - (ilx)2 3 - 4 .
4.10.3 Discretization
Thus, we have four simultaneous ordinary differential equations [Eqs (4.63) to
For any interior grid point, finite-difference formulation gives. (4.~~)~to solve. This system of ordinary differential equations may be classified
as InItial-value problems. This is because these equations are to be solved for the
dO; = 0i_1 - 20; + 0i+1
(4.61) Unknowns as a function of time beginning with an initial value for each of the
dT (ilX)2 ~~ow~s. In this case the initial values are obtained from the initial temperature
for i = 1, ..., M stributlOn in the plate which is given by
66 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 67

01 (0) = O2(0) = 03(0) = 0iO) = 1 (4.67)


(4.68c)
4.10.4 Methods of Solution
There are three ways by which the initial-value problem mentioned 10
(4.68d)
Section 4.10.3 can be solved. They are:
(i) Euler method (or explicit method)
Substituting Eg. (4.68a) into Eg. (4.63), Eg. (4.68b) into Eg. (4.64), Eg.
(ii) Crank-Nicholson method
(4.68c) into Eq. (4.65), Eq. (4.68d) into Eq. (4.66), we obtain Eqs (4.69) to
(iii) Pure implicit method
(4.72) as shown below.
Euler Method (also known as Explicit Method) Since the present problem is an
initial value one, we will know the solution OP at some point in time t" and will Op+1 - oP
be seeking Op+1 at some later point in time 'l"P+1= r P + ~ r, In the Euler method
1 1 = 1 (_ 2 0 P + 0 P ) (4.69)
~'l" (~X)2 1 2
of solution, the solution at a future time, t" +1 is obtained by computing the de-
rivative at the present time, t" and then move ahead in time in the following way.
(4.70)
P
Op+1 = OP + dO I ~'l" (4.68)
dr
The Euler scheme is pictorially represented in Fig. 4.20. For the grid points 1, (4.71)
2,3,4. Eq. (4.68) can be written as

Op+1 OP
(4.68a) 4 - 4 = 1 (20P -20P) (4.72)
~'l" (~X)2 3 4

Egs (4.69) - (4.72) are then rearranged to give


(4.68b)
OP+I-(1 2~'l"JOp+ ~'l" oP (4.73)
1 - - (~X)2 1 (~X)2 2

Op+1
2
= ~r
(~X)2
OP
1
+(1- 2~r
(~X)2
Jop
2
+ ~'l"
(~X)2
e:
3
(4.74)

OJ"
+ 1
=
~ 'l"
(~X)2
0P
2 +
(1 - 2~ J (~X)2
'l" 0P
3
~r
+ (~X)2
0P
4
(4.75)
Obtained from earlier
computations beginning with
the condition at 'f= 0
e Op+1= 2~r OP+(I- 2~r Jop (4.76)
4 (~X)2 3 (~X)2 4

Linear Eqs (4.73)- (4.76) can be written in the following matrix form as
extrapolation
, ~ of slope at 'fP
- - ,- - - -- --::-::- ~,
-- ------ -- ------- --- -------~
,, ,, r
,, ,
, 1-2r r
: ilt : (4.77)
if r 1-2r
'f -rP -rp+1 2r
Fig. 4.20 Pictorial representation of the Euler method
68 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 69

.1'l' Equations (4.79)-(4.82) are rearranged resulting in a set of four simultaneous


where, r=
(.1X)
2 algebraic equations in -r:
Ol+l, Orl, er'.
represented in the matrix form as

The tridiagonal matrix (TDM) on the right hand side of Eq. (4.77) is known 1+r -r/2 OI]P+I
(and constant) once the size of the time-step.zrris chosen. The known values of 0 -r/2 l+r -r/2
at t" (that is OP) are multiplied by this TOM to obtain the new values of 0 at
-rl2 l+r -r/2 ][ ::
r p+l. This matrix multiplication is quite easy to carry out on the computer since [
only the non-zero terms will contribute to the calculation. Thus, OP + 1 values are -r 1 + r 04
obtained explicitly in terms of 0 P values and hence the name, explicit method.
Note that the solution of simultaneous algebraic equations is not necessary in this
scheme which makes it a very attractive method. Once 0 P + I,S are obtained, they 1- r (r/2) ][OI]P
are stored in OP, and the computation is repeated for the next time-step. This _ (r/2) 1- r (r/2) O2
(4.83)
procedure continues until the result at the desired time is obtained or till the steady - (r/2) 1- r (r/2) 03
[
state is reached. r l-r 04
However, a major drawback of this method, is that for r » 0.5, that is when
1-2r is negative, the solution becomes unstable. Therefore, a stability limit of Just as was the case in the Euler method, the right hand side can be comp~ted
r ~ 0.5 is imposed resulting in considerable restriction on the time-step, .1'l'for a directly because all the components are known. This results i? a column .~atnx as
particular value of .1X. Thus more computer time is required to obtain the desired before. The difference comes in the fact that this does not grve an explicit result
solution at a particular point in time. The stability is discussed in detail in for the unknowns on the left hand side. Rather an implicit TOM system of alg~-
Section 4.11. braic equations results. This system of algebraic equations m~st then be solved ill
Crank-Nicholson Method In the Euler method the value of the derivative at the each time step. The Crank-Nicholson method, although technically called uncon-
beginning of the time interval was used to progress in time. A more accurate ditionally stable gives erroneous results if the time-step is too large.
method would be to use the arithmetic mean value of the derivatives at the begin- Pure Implicit Method In contrast with the Euler or the Cran~-~icholson
ning and the end of the time interval. method, in the pure implicit scheme, the time derivative at the new time 1S used to
That is, using the time derivative atp + 112, a time which is mid-way between move ahead in time. Thus,
p and p + 1. Therefore,
P+I
P P 1 OP + 1 = OP + dO (4.84)
OP+I=OP+.l[dO/
2 dr
+ dO/ +
dr
]L1'l' (4.78) d'l' I L1'l'

From Eqs (4.63)-(4.66) and Eq. (4.84), we obtain


Substituting Eqs (4.63)-(4.66) in Eq. (4.78), we obtain /'

ap+1 - OP
Op+1 - OP 171 1 = 1 (-20p+1 _ Op+l) (4.85)
1 1 = 1 [(-20P +OP)+(-20p+1 +OP+I)] (4.79) .1 r (.1X)2 1 2
.1'l' 2(.1X)2 1 2 1 2

(4.86)

(4.87)

(4.82)
(4.88)
70 Computer Simulation of Flow and Heat Transfer
Numerical Methods for Conduction Heat Transfer 71
Equations (4.85)-(4.88) are rearranged resulting in a set of four simultaneous
algebraic equations in or:
0l+ I, 0l+1 and 0[+1, represented in matrix form as
In the Crank-Nicholson method, dO is evaluated atp + 112,that is,
d'r

dO IP+1/2 OP+I - OP
1+
-r 2r 1+2r
-r -r I [OIIP+1
02 = [OIIP
02 = I I
(4.92)
(4.89) dr j
-r 1+2r -r 03 03 2( ~'r)
[
- 2r 1 + 2r ° 4 ° 4 dO IP+1/2
=
OP+I
I
- OP
I
(4.92a)
Equation (4.89) is an implicit set of equations to solve for the new tempera- dr j Ll'r
tures at each step in time. Pure implicit scheme is an unconditionally stable Again, although the R.H.S. ofEq. (4.92 a~looks s~e ~s thatof.Eq ..(4.90).and
scheme, that is, there is no restriction on time-step in sharp constrast with the Eq. (4.91), the former is actually central difference In time, which IS ObVIOUS
Euler and the Crank-Nicholson method. from Eq. (4.92). .
However, the Euler and the pure implicit methods have the same order of Therefore, the order of accuracy of time is O(Ll'rf This explains why the
accuracy while the Crank-Nicholson method is more accurate than either of the Crank-Nicholson scheme is one order more accurate in time as compared to Euler
two for the same time-step. The accuracy and stability of each of the three or pure implicit scheme.
methods are detailed in the sections to follow. In all the three methods, the space derivatives are discretized using central
difference scheme. Therefore, the order of accuracy in space in Euler, pure
4.11 ACCURACY OF EULER, CRANK-NICHOLSON
implicit and Crank-Nicholson methods is O(LlXl
AND PURE IMPLICIT METHOD The Euler method, the Crank-Nicholson method and the pure implicit method
are also called FTCS (forward time, central space), CTCS (central time, central
In the Euler method, at any grid point i, :: is evaluated at t", that is, space) and BTCS (backward time, central space) respectively.
To summarise, the order of accuracy of each method can be written as
Euler or Explicit: 0[(LlX)2,(Ll'r)] FTCS
dO IP = 0;+1 - 0; (4.90)
Crank-Nicholson:
Pure Implicit:
0[(LlX)2,(Ll'r)2] CTCS
0[(LlX)2,(Ll'r)] BTCS
dr j Ll'r

Equation (4.90) is forward difference in time. Therefore, the order of accuracy 4.12 STABILI1Y: NUMERICAlLY INDUCED
in time is 0(..1't). OSCILlATIONS
. .. met h 0 d ,- dO ISeva
In the pure implicit . Iuate d at t p+1 , th at i
IS, From the preceding discussion, it is apparent that all the three schemes will give
d'r better results if time steps are made smaller. In practice, however, one would
uSually like to take as large a time-step as one can to reduce the computational
dO IP+I = 0;+1 - 0; (4.91)
effort and time. In addition to decreasing the accuracy of the solution, large time
dr j Ll'r ste~s can introduce some unwanted, numerically induced oscillations into the so-
lution making it physically unrealistic. Such solutions are not acceptable and the
Equation (4.91) actually arises from Eq. (4.91a) shown below. ~ethod which produces such solution is called unstable method. This brings us to
fr e formal definition of a stable numerical scheme which is one for which errors
dO IP+I = 0;+1 - O~p+I)-1 . om any source (round-off, truncation, mistakes, etc.) are not permitted to grow
(4.91a)
1Il the sequence of numerical procedures as the calculation proceeds from one
dr j ~'r
marChing step to the next.
Although the R.H.S. ofEq. (4.91) looks same as that ofEq. (4.90), the former
~~e of.One Grid Point Consider the case of only one grid point, that is, the
is actually backward difference in time, which is obvious from Eq. (4.9Ia).
r:::: :OInt on the insulated boundary of the plate (Fig. 4.21). Therefore, t1X = I,
Therefore, the order of accuracy in time is O(~-r).
T, Hence, we have only one equation to solve, that is,
72 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 73

t
Steadyunbounded
Known
temperature +I ----------------:-;:;;:;------------gTt~
(0) (1)
Steady
decay
). 0 ~-..\--~----+--~--t--
2 r
Stable
--~-----------4~*X oscillations
k---1 ---~
-1
Fig. 4.21 Case of only one grid point
Unstable
oscillations
dOl _ 20 (4.93)
dr -- I

Fig. 4.22 Stability curves for the case of one grid point
subject to the initial condition,
01(0) =1 (4.93a) is increased, in each case, the solutions begin to deviate from each other. The
The analytical solution of Eq. (4.93) is: Euler method can have either steady decay, stable oscillations or unstable oscil-
lations. The Crank-Nicholson method can have either steady decay or stable
01 = e-2f (4.94)
oscillations. The pure implicit method has only a steadily decaying type of
The following three equations are obtained corresponding to the three numeri- solution. From the graph, it is also seen that the stability limit for Euler is 0.5
cal schemes. while that for Crank-Nicholson is 1.0. The Euler method becomes totally
unstable at r = 1.0. While the Euler method is called conditionally stable, the
Euler: Orl = (1- 2r) ot (4.95)
Crank-Nicholson method is called unconditionally stable because the oscillations
Crank-Nicholson: (1 + r) Or l
= (1 - r)O{ (4.96) ultimately damp out with time. The pure implicit method is truly unconditionally
Pure implicit: (1 + 2r) Or l
= OIP (4.97) stable method.
Figure 4.23 compares the three numerical solutions to the corresponding exact
Each of these may be put in the following general form
solution (drawn qualitatively), 01 = e-2f for r = 1.2 which exceeds the stability
Op+l = AOP (4.98) limit for both the Euler method and the Crank-Nichloson method.
where A is defined by The figures reversal that oscillations in the Euler solution grow without bound,
and oscillations are seen in the Crank-Nicholson solution but gradually damp out
Euler: A = 1- 2r (4.99) for large time. The pure implicit solution doesn't show any oscillations.
l-r Case of More than One Grid Point The example of one grid point may be
Crank-Nicholson: A=- (4.100)
l+r ~xtended to the more general case in which there is more than one grid point, that
IS, more than one equation. The matrix representation for any of three numerical
Pure implicit: A=_I_ (4.101) SChemescan be written as
1 + 2r
. A Op+1 = B OP (4.102)
The value of A determines the character of the solution. This is self-explana-
tory from Fig. 4.22 which shows A. as a function of r (r = ~ 't' for this special case) ~here, A and B are matrices that depend on the particular method. Equation
.102) can be written as
for each of the three numerical methods we have considered.
A close inspection of Fig. 4.22 reveals that as r~ 0, that is if the time-step (4.103)
is made smaller and smaller, all three schemes become identical. As the time-step
74 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 75

r= 1.2 r= 1.2 Class I: If all eigenvalues are between 0 and 1, there will be no oscillations.
2 2 2 The solution will gradually approach a steady-state value.
Crank-Nicholson Pure implicit
Class II: If one of the eigenvalues falls between 0 and - 1, numerically induced
81 81 81
Exact Exact oscillations will appear.
1 1 1
Class III: If one of the eigenvalues is less than - 1, the oscillations will be
0 0
unstable.
0 Example of the Two-node Case for Euler Method As an example, let us con-
2 2
sider the two node case for the Euler method. The matricesA and B are then given
t 'f
-1 -1 -1 by

-2 -2 -2 A = [~ ~]
B=[1-2r r]
Fig. 4.23 Comparison of the numerical solutions based on Euler, 2r 1- 2r
Crank-Nicholson and pure implicit methods with the
corresponding exact solution for the case of one grid point

I
Then, B - A.A = [1-2r-A.
2r
r
1 - 2r - A.
]
Note that in the right hand side ofEq. (4.103)A- B is a square matrix. We also
know that associated with every square matrix (let's call this matrix'S') is a The determinant of the above matrix is given by
special set of vectors, called eigenvectors and a related set of scalars, called
eigenvalues. Formally, the vector 'x' is an eigen vector of S if and only if x is a
det (B - A. A) = (l - 2r - A.)2 - 2,-2 = 0 (4.108)
non-zero vector and A. is a scalar (which may be zero), such that Solving Eq. (4.108), we get
Sx=A.X (4.104) =1-
A.I r (2 + J2)
The scalar A. is an eigenvalue of S if and only if there exists a non-zero vector
'x' such that Eq. (4.104) holds.
~ = 1- r (2 - J2)
The eigenvalues A. of the matrix A -IB playa similar role to the A. in the case of The value of A.I will determine the character of the solution since it is this one
one grid point (see Eq. (4.98)). If there are N simultaneous equations being han- that is most likely to be negative (because of the larger coefficient of r).
dled, there will beN eigenvalues of A-lB. These values will determine the charac- A.I vs. r plots (Fig. 4.24) show the same general trend of Fig. 4.22, but the
ter of the solution. Now, curves have shifted to the left so that critical values of r are smaller than those for
A-IB ()P = A. ()P
+ 1 ---------------------------------------------------------_.
or (KIB - A.l)()P =0 (4.105)
where I is an N x N unit matrix. Pure implicit
To get a non-trivial solution of Eq. (4.105),
det (KIB - A. I) =0 (4.106)
r
We may now multiply both sides ofEq. (4.106) by det(A) to get 2
det(A) det (A-I B - A.I) =0 L-- Crank-Nicholson
I
or det (AA- B -A A.I) = 0
or det (B - A. A) = 0 (4.107) -1 ~ ~ _

There will be three general classes of solutions which will arise in this
problem. Fig. 4.24 Stability curves for the case of two grid points
76 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat Transfer 77

the one-node case. The upper limit for stable oscillations of the Euler method is STABll.llY UMIT OF THE EULER METiiOD
4.1 4
now 2/(2 +./2) = 0.586 (since, A.eritieal
= -1 = l-r (2 + ./2» as compared to 1.0 FROM PHYSICAL STANDPOINT
in one-node case.
In the limit as the number of nodes becomes infinite, it can be shown that Let us consider the non-dimensional governing equation for one-dimensional
stability limit for the Euler method approaches 0.5 (Myers, 1971). transient condition.

4.13 CONVECTION BOUNDARY CONDmON ao a20 (4.111)


at = ax 2

Figure 4.25 shows the same problem but with a finite heat transfer coefficient, h.
. .. Eq (4 111) at (p i) using the Euler method, we obtain
Solving the problem using the Euler method (keeping the grid spacings same Dlscreuzmg .. ,
as before), the following matrix equation is obtained.
0;+1 _ Or = Of-I - 20r + Or+1 (4.112)
Op+l=BOP (4.109)
A-r (AX)2

1- 2r(1+BiAX) 2r
r 1-2r r Defining r = A-r ,Eq. (4.112) becomes
(Ax)2
where, B= r 1-2r r
Or +1= r OPj_1 + (1 - 2r) er + ref+l (4.113)
r 1-2r r
2r 1-2r Now if the coefficient of OP turns negative, that is, if r > 112,we generate a
conditi~n that will violate the s~cond law of thermodynamics: This can be better
The critical stability limit can be shown to be (Myers, 1971) explained by using the dimensional form of Eq. (4.111), that IS,

1 (4.114)
rerit= 0.5 ---- (4.110)
1+ BiAX

Discretizing Eq. (4.114) at (p, i) using Euler method, we obtain


h B·l =B·rot number =-.
were hL
k
It is obvious from Eq. (4.110) that the stability limit for the convection bound- TP+l
a st
= ---(Ax)2 p]
[T~l +T+l + 1-
[ 2aAt]2 T,P
(4.115)
ary condition becomes more restrictive. I I I (Ax)

Now, let us take an example in which Tj~1 = 100°C, T]> 0 DC, Ttl= 100 DC.
aAt
We seek to find the Tr 1, that is after a time interval A t. Let us also take (Ax)2
T(x, 0) = t,
= 1. Substituting all this in Eq. (4.115), we obtain
h, Too TP+
I
1= 200°C

So, we see that temperature at grid point i at time p + 1 will exceed the tem-
perature at the two neighbouring grid points at time level p (Fig. 4.26). This
seems unreasonable since maximum temperature which we would expect to find
at point i at time p + 1 is 100°C. So, the aforesaid result is in clear violation of the
second law of thermodynamics.
If+-' -- 2L---+l·1 The reason why this occurs IS . that by usmg
. ---a S: = 1, the coe ffici icient 0 fTP i
(Ax)2
Fig. 4.25 Physical domain of the one-dimensional transient
problem with convective boundary conditions becomes - 1, that is, negative.
Numerical Methods for Conduction Heat Transfer 79
78 Computer Simulation of Flow and Heat Transfer
4.16 PHYSICAL REPRESENTATION OF ALL
THREE METHODS
t +!:'t p + 1 (Future time
level) The different values of the weighting ~actor, 11 can be physically ~isualize~ in
Ax Ax i T. vs t van'ations as shown m Fig. 4.27 for the case of a transient cooling.
termS a '1
O"C 100 ·C
I •
The Euler or Explicit scheme essentially a.ssumes that the old v~lue
P
prevai s !.i
hr hout the entire time step except at time t + Lit. The pure implicit scheme
P (Presenttime level) t oug P TP+l d th t tTP+1
i-I i i+ 1 telle us that, at time t, T; suddenly changes from T; to; an en says a ;
over the whole time step. The Crank-Nicholson scheme on the other hand,
Fig. 4.26 An example showing a physically impossible situation assumes a linear variation of T; (Patankar, 1980).
a 6.t 1
arising out of using (6.X)2 >"2 in the Euler method Explicit (Euler)

T,P ------------------
Therefore, a simple way of obtaining the stability limit is to set the coefficient Crank-Nicholson
,,
of the temperature at the present time level of the grid point at which the solution ,,
T; ,,
is desired greater than or equal to zero. Therefore, for stability, ,,
,,
,,

P + 1 ------------------t--~---r---->!
,
T;
,,
,
: Pure
or (4.116)
i, implicit
,,
,,
,,
The above principle is also applicable to two or three-dimensional transient t + !:'t
heat conduction problems.
Fig. 4.27 Physical representations of explicit, Crank-Nicholson
and pure implicit methods
4.15 MATIIEMATICAL REPRESENTATION OF ALL
TIlREE METIIODS BY A SINGLE 4.17 ADVANTAGES AND DISADVANTAGES OF
DISCRETIZATION EQUATION EACH OF THE TIlREE METIIODS
Finally, the Euler, pure implicit, and Crank-Nicholson-all the three methods Euler
can be expressed in the form of one discretization equation which is a function of Advantages Simple, no simultaneous equations to solve.
weighting factor, 11as follows Easy to program on computer.
Disadvantages : Conditionally stable.
Restriction on time-step due to stability limit, thus making the
computations slow.
Pure Implicit
Or-l - 20r + Or+1
(4.117) Advantages Unconditionally stable method.
+ (1- 11) (!:.X) 2
No restriction on time-step.
For 11= 0, Eq. (4.117) represents the Euler method. Disadvantages : A set of simultaneous equations to be solved in each time-
For 11= 1, Eq. (4.117) represents the Pure implict method. step and hence, more computational effort.
For 11= 112,Eq. (4.117) represents the Crank-Nicholson method. Difficult to program on computer.
80 Computer Simulation of Flow and Heat Transfer Numerical Methods for Conduction Heat

Crank-Nicholson
or' = 1- 2r
1+2r
()p-I +~
1+2r
(()'! + ()p ) (4.118)
Advantages More accurate than the Euler and the pure implicit methods or I I 1+1 I-I

for the same time-step.


Stable.
Disadvantages: A set of simultaneous equations to be solved in each time-step where,
and hence, more computational effort.
Difficult to program on computer. Although this method is unconditionally stable, it is not self-starti~g beca.use
alues at -r- ,1-r are needed for computing those at r + ~-r. Thus, It requires
v .
4.18 HOW TO CHOOSE A PARTICUlAR MEmOD another method to start the computation.
From the Taylor series expansion, the truncation error can be shown to be
The answer is not so straightforward. Because the final choice depends on the
accuracy requirement of the problem, whether the solution at earlier or later times llP
17,+1
_ llf+l
17,
_ Op-l
,
+ Of,-I llf+l
17,
_ Of-I
,
[ a2ll17 ao]
is desired, and the speed and memory of the computer. (~X)2 - 2~-r - ax2 - a-r i, p

0(i:i): )-(:: )' ( ~:n.


For example, if the solution at an earlier time is required and the accuracy can
be compromised, the Euler method should be preferred. On the other hand, if the
entire temperature-history is the one sought, then either Crank-Nicholson or pure = o[ (L\X)'] + o[ (M)'] + p (4.119)
implicit can be used depending on the accuracy requirement.
For larger time-steps, the pure implicit scheme is better than Crank-Nicholson The consistency of the Dufort-Frankel method depends on the way in which
as over a larger interval, the steep rise or fall in the beginning followed by a flat
tail is more realistic as compared to a linear profile throughout. For small time ~-r, ~x tend to zero. If ~-r 2 is held constant as ~-r and ~x ~ 0, then the
interval, however, the Crank-Nicholson scheme is physically more sound (~x)
(Patankar, 1980). 'f ~-r
Furthermore, the computer speed and memory should also be looked at. If one
scheme is consistent with the original PDE. On the other han d ,1 --
~x
= C, a
is using a PC-XT, use of the Euler method won't be wise while for a mainframe
system which has much larger computer memory and higher speed, using the
Euler method will not be unwise for solving the same problem.
constant, as ~-r and ilX ~ 0, then the term C2 (aa-ro)
2
--2 .
remains, an d th e
i.p

4.19 CONSISTENCY difference procedure is consistent instead with an entirely different PDE,

A finite-difference procedure is consistent if it approximates the solution of the (4. 119a)


PDE under study, and not the solution of some other PDE.
For example, consider the solution of a one-dimensional transient heat conduc-
tion problem by explicit method (or Euler method).
4.20 lWO-DIMENSIONAL TRANSIENT PROBLEMS
We know that the truncation error of Euler method is O[(~-r, (~2]. Since the
truncation error tends to zero as ~-r, ilX ~ 0, the explicit representation is con- The governing differential equation for the two-dimensional transient conduction
sistent with the original PDE. (assuming constant k, p, C) is
On the other hand, another explicit procedure called Dufort-Frankel scheme
(which is unconditionaly stable) may not be always consistent. This can be dem-
onstrated as follows. (4.120)
Dufort-Frankel scheme (Carnahan et al., 1969):

llP+1 _ llP-I oP - Op+1 - Op-I + OP


17, 17, ,+1, , ,-I
.-..!.----'--=--.::....----::---:...-.:..
2~-r (~X)2
(4.121)

You might also like