|
|
|
|
|
|
|
|
|
|
|
9.5 Steady conduction |
305 |
|||
level of precision for the problem. The numerical method is only a substitute for |
|
||||||
solving the differential equation and not for determining the equation itself! Because |
|
||||||
of this, you will see that numerical packages always require you to use your physical |
|
||||||
understanding of the problem to choose among various governing equations. The |
|
||||||
package will only take care of the subsequent solution. |
|
||||||
2. Create a mesh or grid: As shown in Fig. 9.2, the domain of the problem is |
|
||||||
discretized into six discrete points that constitute the mesh for this problem. An |
|
||||||
additional ghost point outside the computational domain has been created to impose |
|
||||||
the Neumann boundary condition. |
|
||||||
Comment: The insulated tip results in the boundary condition |
dT |
= 0 at the right |
|
||||
|
|
|
|
dx |
|
||
end. This Neumann boundary condition can be handled in two different ways. The |
|
||||||
first one is to use just the 5 points given and use a backward difference scheme. So, |
|
||||||
we can apply dT |
≈ |
T5−T4 |
= 0, which results in T5 = T4 as the approximate boundary |
|
|||
dx |
|
dx |
|
||||
condition. However, this backward difference formula for the boundary condition is just first-order accurate, whereas we will be using second-order accurate formulae everywhere else in the domain. It is possible to improve the accuracy by cleverly introducing a “ghost” point outside of the domain. You can see below how this saves the day while retaining the simplicity of the method. Tricks such as this are a staple of the numerical community, and commercial packages have many such clever hacks thrown in but hidden from the user.
3. Discretize the governing equation and boundary conditions: The discretized form of the governing ODE and boundary conditions are as follows
•Governing equation.
Ti+1 − 2Ti + Ti−1 |
− |
|
hP |
(T − T |
) = 0 |
|
||||
|
kA |
|
||||||||
x2 |
|
|
i |
∞ |
|
|||||
|
|
|
|
|
c |
|
|
|
|
|
Ti = |
T |
+ T |
|
+ m2 |
x2T |
|
|
|
||
i+1 |
|
i−1 |
|
|
∞ |
(9.26) |
||||
|
(2 + m2 |
x2 ) |
|
|
||||||
|
|
|
|
|||||||
FIGURE 9.2
One-dimensional conduction in the fin for Example 9.1.
306CHAPTER 9 Numerical heat transfer
•Neumann boundary condition at the right end. At x = L, fin is insulated; that is,
dT |
= 0 |
T5′ − T4 |
= 0 T |
′ |
= T |
|||||||
|
|
|
||||||||||
dx |
|
|
|
2 x |
|
|
|
5 |
4 |
|||
|
|
|
|
|
|
|
|
|
||||
|
= |
T |
+ T + m2 |
x2T |
|
|
|
|||||
T |
5′ |
4 |
|
|
|
∞ |
|
|
|
|
||
|
(2 + m2 x2 ) |
|
|
|
||||||||
5 |
|
|
|
|
|
|||||||
|
= |
2T + m2 x2T |
|
|
= T ) |
|||||||
T |
|
4 |
|
|
|
∞ |
( T |
′ |
|
|||
(2 + m2 x2 ) |
|
|
||||||||||
5 |
|
5 |
|
4 |
||||||||
T5 |
= |
2T4 + 0.111 |
|
|
|
|
|
|
||||
|
2.004 |
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
||
•Dirichlet boundary condition at the left end. At x = 0, Tb = T0
T = |
|
T + T + m2 |
|
x2T |
|
|
0 2 |
|
∞ |
||
|
(2 + m2 |
x2 ) |
|||
1 |
|
|
|||
T1 |
= |
100.111 + T2 |
|
|
|
2.004 |
|
|
|||
|
|
|
|
||
•Discretized equations at the interior points.
T |
= |
T3 |
+ T1 + 0.111 |
|
2 |
|
|
2.004 |
|
|
|
|
|
|
T = |
T4 |
+ T2 + 0.111 |
||
3 |
|
|
2.004 |
|
|
|
|
|
|
T |
= |
T5 |
+ T3 + 0.111 |
|
4 |
|
|
2.004 |
|
|
|
|
|
|
(9.27)
(9.28)
(9.29)
(9.30)
(9.31)
Comment: Eqs. 9.26–9.31 are the combined set of governing equations and boundary conditions for the problem. Notice how both the ODE as well as the BCs have been combined into a set of equations. The equations are linear since the ODE, as well as the BCs, were linear. We have five equations and five unknowns, which can now be solved using multiple techniques. If we take smaller intervals, we will have a larger number of equations and unknowns.
4. Solve the set of equations: While linear systems of equations can be solved in multiple algorithms, all these fall under two major classes—iterative methods and direct methods. Direct methods such as Cramer’s rule or Gauss elimination solve for the variables exactly without any guesswork. Iterative methods, on the other hand, start with a guess for the solution and iteratively improve the guess. Iterative methods are often preferred computationally, especially in numerical approximations, for their ease of implementation. We will employ one such iterative method—the
9.5 Steady conduction 307
Gauss-Seidel algorithm—for the rest of the chapter. The algorithm is very intuitive and works as follows:
a. Initialize: Take an initial guess for all the variables, for example,
1,T20 ,T30 ,T40 ,T50
b.Formulate equations: Rewrite each equation with one variable on the left and all the others on the right-hand side. That is, each variable is written in terms of the remaining variables. Eqs 9.26–9.31 are already written in this form.
c.Update: Use the equations in the previous step to update each variable. For example, if all temperatures in the current example are initialized to 50, then this step will result in
T 1 |
= |
100.111 + T2 |
= |
100.111 + 50 |
≈ 74.90 |
|
|
||
|
|
|
|
|
|||||
1 |
|
2.004 |
|
|
2.004 |
|
|
|
|
|
|
|
|
|
|
|
|||
T21 = |
T3 + T1 + 0.111 |
= |
50 + 74.90 |
+ 0.111 |
≈ 62.38 |
(9.32) |
|||
2.004 |
|
2.004 |
|||||||
|
|
|
|
|
|
||||
Note that we always use the latest available value of the variables in the update. For example, in the update for T2, we used the latest available value of T1.
d.Check stopping criterion: We stop our iterations if either we have reached a predecided number of iterations (which we have specified as eight in this example), or if our error between the previous step and the current step is small enough. The error value can be seen in the table below for the current example.You will notice that the error constantly decreases with the number of iterations.
On following the above process, the results of the first eight iterations are given in Table 9.1
5. Postprocess to find desired quantities: To verify if our numerical solution respects the Neumann boundary condition, we calculate the heat transfer at the tip. The heat
transfer at the tip is given by q′′ = −k T5−xT4 , which equals 9 kW/m2. We can see that the
Table 9.1 Progress of Gauss-Seidel iterations for Example 9.1.
Iteration no. |
T1,°C |
T2, °C |
T3, °C |
T4, °C |
T5, °C |
∑i4=1(Ti j +1 −Ti j )2 |
0 |
50 |
50 |
50 |
50 |
|
- |
1 |
74.90 |
62.38 |
56.13 |
53.02 |
52.97 |
829.18 |
2 |
81.08 |
68.53 |
60.71 |
56.78 |
56.72 |
125.09 |
3 |
84.15 |
72.34 |
64.48 |
60.54 |
60.47 |
66.41 |
4 |
86.05 |
75.17 |
67.77 |
64.05 |
63.98 |
47.12 |
5 |
87.46 |
77.52 |
70.70 |
67.26 |
67.18 |
36.63 |
6 |
88.64 |
79.57 |
73.32 |
70.17 |
70.08 |
29.28 |
7 |
89.65 |
81.38 |
75.67 |
72.79 |
72.70 |
23.64 |
8 |
90.57 |
83.01 |
77.80 |
75.16 |
75.06 |
19.15 |
|
|
|
|
|
|
|
T1 = 90.57 °C,T2 = 83.01°C,T3 = 77.80 °C,T4 = 75.16 °C,T5 = 75.06 °C
308 CHAPTER 9 Numerical heat transfer
numerical solution is inaccurate and yet to converge to the correct solution. Therefore, we need more numbers of iterations for the correct solution. The high value of the stopping criterion at the end of 8 iterations confirms this.
We now apply the same process for two-dimensional steady state heat transfer without any heat generation.
Example 9.2: Consider steady two-dimensional heat transfer in a square metal plate, as shown in the figure below. The temperature at the boundaries is prescribed to be 300 K, all sides except at the top where the temperature is maintained at 400 K. The thermal conductivity of the body is k = 180 W/mK. There is no heat generation in the slab. Using the finite difference method with a mesh size of ∆x = ∆ y = 0.1 m, determine the temperature at nodes 1, 2, 3, and 4. Perform iterations with the Gauss-
Seidel method until ∑i4=1 (Ti j+1 − Ti j )2 ≤ 1×10−4 , where j is the iteration number, and
find the heat flux at a point P3(0.1,0.1). Start with an initial guess of 325 K for all the temperatures.
Solution:
1.Mathematical modeling: The governing equation for two-dimensional steady state heat conduction without heat generation is
∂2 T + ∂2 T = 0
∂x2 ∂y2
2.Create a mesh or grid: The two-dimensional grid is discretized into 4 × 4 uniformly spaced discrete points as shown in Fig. 9.3.
3.Discretize the governing equations: Using the central difference method, we
discretize the governing equation as follows.
Ti +1, j − 2Ti, j + Ti −1, j |
+ |
Ti, j +1 − 2Ti, j + Ti, j −1 |
= 0 |
|
( x)2 |
( y)2 |
|||
|
|
FIGURE 9.3
Two-dimensional conduction without heat generation for Example 9.2.
9.5 Steady conduction 309
Table 9.2 Progress of Gauss-Seidel iterations for Example 9.2.
Iteration no. |
T |
, K |
T |
, K |
T |
, K |
T |
, K |
∑4 (Ti j +1 |
−Ti j )2 |
|
1 |
|
2 |
|
3 |
|
4 |
|
i =1 |
|
1 |
325 |
325 |
325 |
325 |
- |
|
||||
2 |
337.5 |
340.63 |
315.63 |
314.06 |
607.91 |
|
||||
3 |
339.06 |
338.28 |
313.28 |
312.89 |
14.801 |
|
||||
4 |
337.89 |
337.7 |
312.7 |
312.6 |
2.146 |
|
||||
5 |
337.60 |
337.55 |
312.55 |
312.52 |
0.1341 |
|
||||
6 |
337.52 |
337.51 |
312.51 |
312.51 |
0.0084 |
|
||||
7 |
337.51 |
337.50 |
312.50 |
312.50 |
0.0005 |
|
||||
8 |
337.50 |
337.50 |
312.50 |
312.50 |
3 × 10-3 |
|
||||
|
|
|
|
|
|
|
|
|
|
|
T1 = 337.5K ,T2 = 337.5K ,T3 = 312.5K ,T4 = 312.5K
In this problem, ∆x = ∆y
T |
= |
|
Ti +1, j + Ti −1, j + Ti, j +1 + Ti, j −1 |
||
i, j |
|
|
|
4 |
|
|
|
|
|
|
|
T = |
|
T2 + T3 + 300 + 400 |
|
||
1 |
|
|
|
4 |
|
|
|
|
|
|
|
T |
|
|
T1 + T4 |
+ 300 + 400 |
|
2 |
|
|
|
4 |
|
|
|
|
|
|
|
T = |
T1 + T4 |
+ 300 + 300 |
|
||
|
|
|
|||
3 |
|
|
|
4 |
|
|
|
|
|
|
|
T |
= |
T2 + T3 + 300 + 300 |
|
||
4 |
|
|
|
4 |
|
|
|
|
|
|
|
4.Solve the set of equations: Using the Gauss-Seidel method of iteration, we get Table 9.2.
5.Postprocess to find desired quantities: The heat flux vector at P3 is given by
qP′′ |
T4 |
− 300 |
|
|
T1 − 300 |
|
|
|
. Therefore the heat flux |
|
= −k |
|
|
i |
+ |
|
j |
= −11.25kWi |
− 33.75kWj |
||
|
2 x |
2 y |
||||||||
3 |
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
at this point is 35.576 kW/m2K.
We now consider two-dimensional, steady state conduction with heat generation in the next example.
Example 9.3: Consider steady two-dimensional heat transfer in a rectangular metal plate with constant thermophysical properties, as shown in Fig. 9.4. The temperature at the boundaries are as prescribed in the figure. The thermal conductivity of the
310 CHAPTER 9 Numerical heat transfer
FIGURE 9.4
Two-dimensional conduction with heat generation for Example 9.3.
body is k = 150 W/m K. Assume that heat is generated in the plate uniformly at a rate of qv = 1 × 107 W/m3, as shown in the figure. Write the finite difference formulation for the given two-dimensional heat conduction problem with internal heat generation. Using the finite difference method with a mesh size of ∆x = 0.1 and ∆y = 0.08 m, determine the temperature at nodes 1, 2, 3, and 4. Perform iterations with the Gauss-
Seidel method until ∑i4=1 (Ti j+1 − Ti j )2 ≤ 1×10−4 , where j is the iteration number. Start
with an initial guess of 310 K for all the temperatures.
Solution:
1. Mathematical modeling: The governing equation for two–dimensional, steady state heat conduction with heat generation is
∂2 T + ∂2 T + qv = 0
∂x2 ∂y2 k
2.Create a mesh or grid: The two-dimensional grid is discretized into 4 × 4 uniformly spaced discrete points as shown in Fig. 9.4.
3.Discretize the governing equations: Using the central difference method, we
have
|
Ti+1, j − 2Ti, j + Ti−1, j |
+ |
Ti, j +1 − 2Ti, j + Ti, j −1 |
|
+ |
qv |
= 0 |
|
|
|
|
|
|||||||||||||
|
|
( |
x)2 |
|
|
|
( |
y)2 |
|
|
|
|
|
|
k |
|
|
|
|
|
|
|
|||
x2 (T |
+ T |
) + y2 (T |
|
|
+ T |
) − 2T ( x2 |
|
+ y2 ) |
|
|
q |
v |
|
||||||||||||
i, j +1 |
|
i, j −1 |
|
i+1, j |
i−1, j |
|
ij |
|
|
|
|
|
|
|
|
|
+ |
|
= 0 |
||||||
|
|
|
|
|
x2 |
y2 |
|
|
|
|
|
|
|
|
|
|
|
k |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
x2 (T |
|
+ T |
) + y2 (T |
|
+ T |
|
) + |
qv |
|
x2 y2 |
|
|
|
||||||||||
|
|
|
|
|
|
|
|
|
|||||||||||||||||
Tij = |
|
i, j +1 |
i, j −1 |
|
|
i+1, j |
i−1, j |
|
|
|
|
k |
|
|
|
|
|
|
|
||||||
|
|
|
|
2( x2 + |
y2 ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
x2 (373 + T3 ) + |
y2 (T2 + 298) + |
107 |
|
|
|
x2 |
y2 |
|
|
|
|
|||||||||||
T1 = |
|
|
|
|
|
|
|
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
2( x2 + |
y2 ) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||
9.5 Steady conduction 311
|
|
|
x2 |
(373 + T4 ) + |
y2 (T1 |
+ 323) + |
107 |
x2 |
y2 |
T2 |
= |
|
|
|
|
|
150 |
|
|
|
|
2( |
x2 + |
y2 ) |
|
|
|
||
|
|
|
x2 |
(298 + T1 ) + y2 (T4 |
+ 298) + |
107 |
x2 |
y2 |
|
T3 = |
|
|
|
|
150 |
|
|
||
|
2( |
x2 + |
y2 ) |
|
|
|
|||
|
|
|
x2 (298 + T2 ) + |
y2 (T3 |
+ 323) + |
107 |
x2 |
y2 |
|
T4 |
= |
|
|
|
|
|
150 |
|
|
|
|
2( |
x2 + |
y2 ) |
|
|
|
||
After inserting the values of ∆x and ∆y, we have
T1 |
= 0.3049T3 |
+ 0.1951T2 |
+ 301.95 |
(9.33) |
T2 |
= 0.3049T4 |
+ 0.1951T1 |
+ 306.82 |
(9.34) |
T3 |
= 0.3049T1 + 0.1951T4 |
+ 279.08 |
(9.35) |
|
T4 |
= 0.3049T2 |
+ 0.1951T3 + 283.96 |
(9.36) |
|
4.Solve the set of equations: Using the Gauss-Seidel method of iteration, we get Table 9.3.
5.Postprocess to find desired quantities: As we do not want to find any derived
quantity (like heat transfer rate), we can stop here and need not do any further postprocessing.
Notice the progression in the solved examples. We went from one-dimensional steady state to two-dimensional steady state without heat generation and finally added
Table 9.3 Progress of Gauss-Seidel iterations for Example 9.3.
Iteration no. |
T |
, K |
T |
, K |
T |
, K |
T |
, K |
∑4 (Ti j +1 |
−Ti j )2 |
|
1 |
|
2 |
|
3 |
|
4 |
|
i =1 |
|
0 |
310 |
310 |
310 |
310 |
- |
|
||||
1 |
456.95 |
490.48 |
478.88 |
526.94 |
129756.42 |
|||||
2 |
543.65 |
573.55 |
547.65 |
565.68 |
20646.37 |
|
||||
3 |
580.82 |
592.62 |
566.54 |
575.18 |
2192.23 |
|
||||
4 |
590.30 |
597.36 |
571.28 |
577.55 |
140.51 |
|
||||
5 |
592.67 |
598.55 |
572.46 |
578.14 |
8.78 |
|
||||
6 |
593.27 |
598.84 |
572.76 |
578.29 |
0.5496 |
|
||||
7 |
593.42 |
598.92 |
572.84 |
578.33 |
0.0343 |
|
||||
8 |
593.46 |
598.94 |
572.86 |
578.34 |
0.0021 |
|
||||
9 |
593.46 |
598.94 |
572.86 |
578.34 |
0.0001 |
|
||||
|
|
|
|
|
|
|
|
|
|
|
T1 = 593.46K ,T2 = 598.94K ,T3 = 572.86K ,T4 = 578.34K
312 CHAPTER 9 Numerical heat transfer
heat generation as well. If you try to solve these problems analytically, you will notice that each of these problems requires vastly different analytical methods and tricks. Contrast this with the numerical process. Notice that, throughout, our finite difference process hardly changed, and we were able to easily adapt it to the problem even as the equations changed. Indeed, it is this easy adaptability of the numerical approximation approach that makes it such a powerful tool for practical problems.
9.6 Unsteady conduction
The previous section looked at steady state conduction cases, usually governed by2T = 0. However, if we are interested in either the transient (i.e., how we got to the steady state), or a generally unsteady problem, we need to add one more wrinkle— time dependence—into the problem and see how to handle it numerically. Note that the steady state conduction problem is the steady state of a general, unsteady equation of the form
2 |
|
∂T |
|
|
T = α |
|
(9.37) |
∂t |
|||
|
|
|
We will start with an extremely simple case and then proceed to a more complex example. The example has been a little bit open-ended deliberately to encourage exploration and discussion and foster some intuition about discretization and its effect on the numerical solution.
Example 9.4: Consider a slab of thickness L = 1.6 cm with walls maintained at temperatures TL = 25 and TR = 100, on the left and right respectively. The initial temperature in the slab is uniformly Tint = 25 everywhere. The slab’s diffusivity is α = 1 × 105 cm2/s. Answer the following questions:
1.Write the governing equation, boundary conditions, and initial condition for this problem.
2.Discretize the slab with uniformly spaced points. Write approximate expressions for the governing equation. Comment on the order of accuracy of your approximation.
3.Are there alternate versions of the discretization that you can think of? Comment on the order of accuracy of these alternates.
4.Rearrange your discretization to write an expression for how the temperature of any location evolves in time. Does any nondimensional parameter naturally arise from this? What does it remind you of?
5.Calculate the temperatures in the center of the slab at Fo = 0.125,0.25,0.5,1,2
using an explicit scheme. Including the boundary points, try with 3,5 points in the computational domain. What are the effects of changing ∆t in your discretizations? What can you conclude from this?
6.Repeat the above for the implicit scheme.
9.6 Unsteady conduction 313
Solution:
1. The governing equation for the temperature T(x,t) is the unsteady conduction equation and is given by
∂T |
= α |
∂2 T |
x [0, L], t [0, |
∞) |
(9.38) |
|
∂t |
∂x2 |
|||||
|
|
|
|
The boundary conditions are Dirichlet and are given by
T (0, t) = TL |
t > 0 |
(9.39) |
T (x, t) = TR |
t > 0 |
(9.40) |
The initial condition is given by
T (x, 0) = TL x (0, L) |
(9.41) |
2. If there are just three points in the domain, there is just one unknown temperature,
Tmid. Let us say the three temperatures are T1 = TL, T2 = Tmid, and T3 = TR. Note that we have to discretize in time too. This is very much like the two-dimensional grid we had
used purely in space earlier. The only difference is that since the direction y is a spatial direction, the customary space-time notation is to use the index n as a superscript for stepping in time and i for stepping in space. That is, Tin denotes T (xi , tn ), where the superscript n denotes the index in time.
Fig. 9.5 shows a typical space-time stencil for unsteady problems. We can now discretize each of the derivatives in the governing equation as follows.
∂2 T |
≈ |
T n |
− 2T n |
+ T n |
(9.42) |
∂x2 |
i+1 |
i |
i−1 |
||
|
( x)2 |
|
|||
|
|
|
FIGURE 9.5
Space-time stencil for a one-dimensional, unsteady problem.
314 CHAPTER 9 Numerical heat transfer
∂T |
≈ |
Tin+1 − Tin |
(9.43) |
∂t |
t |
|
|
|
|
The order of accuracy of the two derivatives are O( x2 ) and O( t) respectively. The overall scheme is therefore given by
T n+1 |
− T n |
= α |
T n |
− 2T n + T n |
(9.44) |
|
i |
i |
i+1 |
i |
i−1 |
||
|
t |
|
( x)2 |
|
||
|
|
|
|
|
||
and is O( x2 , t) in accuracy.
Comment: You might ask, “Why did we choose the forward difference operator for the time derivative? Why not the central or the backward difference?” This would be an astute question. The current choice that we have made is called FTCS (forward time central space). The other two would also be legitimate choices and lead to CTCS (center time center space) and BTCS (backward time center space) methods. It turns out CTCS, for various reasons, is not a good choice despite seemingly being O( x2 , t2 ). We will, however, examine BTCS shortly.
3. Some alternate discretizations are as follows:
T n − T n−1 |
= α |
T n |
− 2T n + T n |
|
||
i |
i |
i+1 |
i |
i−1 |
(9.45) |
|
|
t |
|
( x)2 |
|
||
|
|
|
|
|
||
This, of course, is the BTCS discussed just previosly and is also O( x2 , t). There exists an alternate discretization with a nonobvious trick that enables O( x2 , t2 ) without resorting to CTCS. This is called the Crank-Nicolson scheme and is somewhat like an average of the FTCS and BTCS. The scheme is as follows:
|
Tin − Tin−1 |
= |
α Tin+1 − 2Tin + Tin−1 |
+ |
Tin+1−1 − 2Tin−1 + Tin−1−1 |
(9.46) |
||||||
|
t |
|
|
x |
2 |
|
x |
2 |
|
|||
|
|
2 |
|
|
|
|
|
|
||||
Comment: We will not prove the O( |
x2 , |
t2 ) accuracy of Crank-Nicolson here. You |
||||||||||
can try it as an advanced exercise yourself by writing out a Taylor series expansion of both sides in two variables.
4. For finding out how the temperature at any node will evolve in time, we need to find out how values at the future time step (tn+1) depend on the values at the current time step (tn). So, we will rearrange terms so that terms containing different time levels appear on different sides. We will consider two discretizations here—FTCS and BTCS.
For FTCS, rearranging Eq. (9.44), we obtain
T n+1 |
= T n + |
α t (T n |
− 2T n + T n |
) |
(9.47) |
||
i |
i |
x |
2 i +1 |
i |
i −1 |
|
|
|
|
|
|
|
|
|
|
