9.6 Unsteady conduction 315
Notice the appearance of the term αx 2t . This is a nondimensional term. It is called the diffusion number, and we will label it with D from now on. It should remind you of the Fourier number αL2t . In terms of D, the equation is
Tin+1 = (1 − 2D)Tin + D(Tin+1 + Tin−1 ) |
(9.48) |
Comment: Notice how naturally the diffusion number appears out of the discretization. If ∆x = L, we would, in fact, directly obtain the Fourier number. It is remarkable how many times numerical discretizations throw up physical parameters naturally.
Consider BTCS now. For convenience, we will replace the (future, present) time levels (n–1,n) in Eq. (9.45) with (n,n + 1). Rearranging Eq. (9.45) and substituting
D = αx2t , we obtain
−D (Ti+n1+1 + Ti−n1+1 )+ (1+ 2D)Tin+1 = Tin |
(9.49) |
Comment: Notice that, unlike FTCS, where it was possible to calculate Tin+1 for each i independent of the values at other nodes, in BTCS we obtain Tin+1 as a part of a system of equations that have to be solved simultaneously for all nodes. Similarly, Crank-Nicolson also requires solution of a system of equations. Since the expression for the updated temperature is available explictly for each node in FTCS, it is commonly called the explicit scheme, whereas BTCS and Crank-Nicolson are called implicit schemes. Clearly, implicit schemes require more computational effort. Is there any reason to use them then? We will see shortly that it does make sense to use them in several situations.
5. Consider just three points in the domain. Two of them are known and fixed due to Dirichlet boundary conditions. So, T1n = TL = 100 and T3n = TR = 25. The only unknown temperature is T2n. Since there are only two intervals, ∆x = L/2 = 0.8 cm = 0.008 m.
The initial condition is that at t = 0 T (x = L/2, 0) = Tinit = 25 °C. We now evolve this in time using the evolution Eq. (9.48). This becomes, for our case,
T2n+1 = (1 − 2D)T2n + D(100 + 25) |
(9.50) |
The evolution of the temperature depends on the diffusion number D, which, in turn,
depends on our choice of ∆t. We want our first solution at |
Fo = αt = 0.125. This |
||
|
2 |
|
L2 |
corresponds to a time of t = 0.125L = 3.12 ×10−6 s. |
|
||
Let us choose our time step ∆tαsuch that we obtain the Fo = 0.125 solution in one |
|||
time step. This corresponds to D = |
α t |
= 10 × 3.12 ×10−6 /0.0082 = 0.5. For D = 0.5, |
|
|
|||
Eq. (9.50) gives |
x2 |
|
|
|
|
|
|
T21 = (1 − 2 × 0.5)T20 + 0.5 × (100 + 25) |
(9.51) |
||
That is, T21 = 62.5 °C, the average temperature of the ends at Fo = 0.125. You might suspect that something is not quite accurate here. After all, the mid-plane temperature
316CHAPTER 9 Numerical heat transfer
is supposed to be the average temperature only at steady state and not at early times
such as Fo = 0.125. The reason we obtain this inaccurate temperature is because of the finite ∆x and ∆t that we are using. So, with numerical methods one always has to be careful about a certain amount of numerical error, as we have been seeing so far in this chapter.
Now, we might ask, if we have already reached steady state at Fo = 0.125, what happens beyond this time? Let us check. If we take one more time step with the same ∆t from here, we obtain
T22 = (1 − 2 × 0.5)T21 + 0.5 × (100 + 25) |
(9.52) |
That is, T22 = 62.5 °C, and the center-point stays at the steady state temperature, which is physically sound.
A natural question to ask now is to see what happens as ∆t from the one we chose
here. Let us take two extreme limits to understand what happens as ∆t → 0 and
∆t → ∞.
In the lower limit of time steps, as ∆t → 0, D → 0 we obtain from Eq. (9.48), Tin+1 = Tin. That is, the value at every point will be stuck at the initial value itself. Extrapolating from here, for very low time steps (D 0.5) we will obtain very slow convergence to steady state.
In the upper extreme, as ∆t → ∞, we notice that D → ∞. We obtain from Eq. (9.48) that T21 = T20 + D(100 + 25 − 2 × 25. So, as D → ∞, T21 → ∞, which is obviously absurd. Reaching such unphysically large temperatures is called numerical instability, and one of the most common ways in which it occurs in numerical methods is by choosing large time steps. For FTCS on the one-dimensional conduction equation, one can prove that any choice of D > 0.5 will ultimately result in unphysical temperatures. So, FTCS for one-dimensional conduction works only for 0 < D ≤ 0.5. In general, it is important to remember that explicit schemes always work only under certain ranges of time steps. The determination of these ranges is typically covered in full-scale numerical methods courses, and we will avoid that here.
In Table 9.4 there are the results of numerical experiments for various values of ∆t that are within the above stability range. You will notice that the solution gets more
Table 9.4 Values of central temperature using three points with explicit scheme for Example 9.4.
|
|
|
|
D |
|
|
|
|
Fo |
|
t |
|
0.25 |
|
0.1 |
|
Texact |
|
0.5 |
|
|
|||||
0.125 |
|
3.2e-06 |
62.5 |
57.812 |
|
52.670 |
|
48.596 |
0.25 |
|
6.4e-06 |
62.5 |
61.328 |
|
59.279 |
|
58.451 |
0.5 |
|
1.28e-05 |
62.5 |
62.427 |
|
62.154 |
|
62.157 |
1.0 |
|
2.56e-05 |
62.5 |
62.5 |
|
62.496 |
|
62.498 |
2.0 |
|
5.12e-05 |
62.5 |
62.5 |
|
62.5 |
|
62.5 |
|
|
|
|
|
|
|
|
|
9.6 Unsteady conduction 317
Table 9.5 Values of central temperature using five points with explicit scheme for Example 9.4.
|
|
|
|
D |
|
|
|
Fo |
|
t |
|
0.25 |
|
0.1 |
Texact |
|
0.5 |
|
|||||
0.125 |
|
3.2e-06 |
53.125 |
51.614 |
|
49.759 |
48.596 |
0.25 |
|
6.4e-06 |
60.156 |
59.433 |
|
58.690 |
58.451 |
0.5 |
|
1.28e-05 |
62.354 |
62.257 |
|
62.159 |
62.157 |
1.0 |
|
2.56e-05 |
62.499 |
62.498 |
|
62.497 |
62.498 |
2.0 |
|
5.12e-05 |
62.5 |
62.5 |
|
62.5 |
62.5 |
|
|
|
|
|
|
|
|
accurate as ∆t reduces. This is as predicted by the Taylor series analysis, which says that the error is O( t, x2 ).
What happens if we use FTCS but with five points in the domain now? Notice that our ∆x is now 0.004, and our error, therefore, should reduce. The scheme stays the same as before (see Eq. (9.48)). The difference now is that T2n ,T3n ,T4n have to evolve at each time step. The results for the center temperature are given in Table 9.5. As expected, you can see that the prediction is better as ∆t and ∆x decrease.
6. Let us consider the same experiments as above, but with BTCS. We start
with |
three points in |
the domain. Recall |
that, as |
before, T n = T = 100 °C and |
||||||||
|
|
|
|
|
|
|
|
|
|
|
1 |
L |
T n = T = 25 °C. The |
only unknown |
temperature |
is T n. Since |
there are only |
||||||||
3 |
R |
|
|
|
|
|
|
|
|
|
2 |
|
two intervals, ∆x = L/2 = 0.8 cm = 0.008 m. The initial condition is that at t = 0 |
||||||||||||
T (x = L /2, 0) = Tinit = 25 °C. From Eq. (9.49), we obtain for the evolution of T2 |
||||||||||||
|
|
Tin+1 = |
|
|
Tin |
+ |
|
|
D |
(TL + TR ) |
(9.53) |
|
|
|
1 |
+ 2D |
1 |
+ 2D |
|||||||
|
|
|
|
|
|
|
||||||
Let us consider the two extreme cases, ∆t → 0 and ∆t → ∞ now. In the lower extreme, ∆t → 0, we obtain that Tin+1 = Tin. That is, there is no evolution at all, since we are stuck at the same time. This is the same as it was in the explicit case. So, as we take smaller time steps, evolution will become slower.
What is interesting, however, is the other extreme case ∆t → ∞. In this case,
D → ∞. Taking limits, we obtain |
T n |
→ 0 and |
D |
→ |
1 |
. So we see that as |
i |
|
|
||||
1+2D |
1+2D |
2 |
∆t → ∞, Tin+1 → TL +2 TR .
The above result is very useful for two reasons. Firstly, it is completely physical that the correct steady state temperature is reached as time tends to ∞. Secondly, we no longer seem to have the time step restrictions from which the explicit scheme suffered. That is, we may take as large a time step as we please without becoming unstable. Indeed, this is a major advantage of implicit schemes. Implicit schemes are usually stable for practically any time step.
In the Table 9.6, we run some numerical experiments with the implicit BTCS and just three points in space.
318 CHAPTER 9 Numerical heat transfer
Table 9.6 Values of central temperature using three points with implicit scheme for Example 9.4.
|
|
|
|
|
D |
|
|
Fo |
|
t |
|
1.0 |
|
2.0 |
Texact |
|
0.5 |
|
|||||
0.125 |
|
3.2e-06 |
62.5 |
62.5 |
|
62.5 |
48.596 |
0.25 |
|
6.4e-06 |
62.5 |
62.5 |
|
62.5 |
58.451 |
0.5 |
|
1.28e-05 |
62.5 |
62.5 |
|
62.5 |
62.157 |
1.0 |
|
2.56e-05 |
62.5 |
62.5 |
|
62.5 |
62.498 |
2.0 |
|
5.12e-05 |
62.5 |
62.5 |
|
62.5 |
62.5 |
|
|
|
|
|
|
|
|
Let us now increase the number of points to five within the domain. Notice now that we have T2n ,T3n ,T4n as unknown points within the domain. At each time step, we see from Eq (9.49) that we have to solve a simultaneous system of equations for T2 ,T3 ,T4. The equation is:
|
1 + 2D −D |
0 |
|
|
T |
(n) |
|
T |
(n−1) |
|
T |
(n−1) |
|
|
2 |
|
|
2 |
|
|
1 |
|
|||||
|
−D 1 |
+ 2D |
−D |
|
|
T3 |
|
= |
T3 |
|
+ D |
0 |
|
|
0 |
−D |
1 + 2D |
|
|
T |
|
|
T |
|
|
T |
|
|
|
|
|
|
5 |
||||||||
|
|
|
|
4 |
|
|
4 |
|
|
|
|
||
For the first time step, this looks like
1 + 2D −D |
0 |
|
T2 |
|
|
25 |
|
|
25 |
|
|
||
|
−D |
1 + 2D |
−D |
|
T3 |
|
|
25 |
|
|
0 |
|
(9.54) |
|
|
= |
|
+ D |
|
||||||||
|
0 |
−D |
1 + 2D |
|
T |
|
|
25 |
|
|
100 |
|
|
|
|
|
|
|
4 |
|
|
|
|
|
|
|
|
For various values of D, the solutions are as follows (Table 9.7):
Notice that we are able to use much larger time steps and also obtain good accuracy with the implicit scheme. This is particularly advantageous when we wish to obtain solutions in problems with very small, inherent timescales.
Table 9.7 Values of central temperature using five points with implicit scheme for Example 9.4.
|
|
|
|
D |
|
|
|
Fo |
|
t |
|
1.0 |
|
2.0 |
Texact |
|
0.5 |
|
|||||
0.125 |
|
3.2e-06 |
50.023 |
51.239 |
|
53.028 |
48.596 |
0.25 |
|
6.4e-06 |
58.017 |
57.991 |
|
58.096 |
58.451 |
0.5 |
|
1.28e-05 |
61.926 |
62.786 |
|
61.563 |
62.157 |
1.0 |
|
2.56e-05 |
62.491 |
62.482 |
|
62.458 |
62.498 |
2.0 |
|
5.12e-05 |
62.5 |
62.5 |
|
62.5 |
62.5 |
|
|
|
|
|
|
|
|
9.7 Introduction to methods for convection 319
Summary of unsteady conduction
We have covered a lot of ground rapidly, so we will summarize the essence of numerical methods for unsteady conduction here.
1.The unsteady conduction equation is parabolic in nature. Therefore, it is useful to take one-sided differences in time and central differences in space.
2.It is possible to use either explicit (e.g., FTCS) or implicit (e.g., BTCS or CrankNicolson) methods for unsteady conduction.
3.For a single given time step, explicit methods are faster than implicit methods.
4.Explicit schemes are, however, restricted in terms of the size of the time step
that can be taken. Typically, the time restriction is of the form t ≤ Dcri |
x2 |
. |
α
For one-dimensional conduction Dcri = 0.5. Beyond this time step, explicit schemes are unstable and lead to “blow up.”
5. Implicit schemes are usually highly stable and, in cases such as BTCS for conduction, they can be unconditionally stable. That is, one can take as large a time step as one desires while not blowing up. Though implicit schemes require solving a system of equations, they are often preferred for unsteady conduction problems, as the explicit time restriction can be prohibitively restrictive.
9.7 Introduction to methods for convection
While convection is an extremely important part of heat transfer, we will be only briefly talking about the numerical aspects here, as it requires a full-fledged discussion to be applied practically.
By means of introduction, we will note here that the discretization of convective terms such as u ∂∂Tx
reason is that the physics of these terms is different.
Recall that conduction is a diffusive process and that this diffusion does not distinguish one direction from the other. This is why our spatial derivatives in conduction are symmetric and central. However, convection has a preferred direction. This is precisely in the direction of local flow. Not obeying this aspect of physics typically causes instability in the numerical method (it is remarkable to see how often violating physics causes numerical problems).
So, convective terms are usually upwinded. That is, we take one-directional de-
rivatives in the direction of local convection. For instance, if the flow is in the positive |
|||||
x direction, that is, u > 0, then u |
∂T |
would be discretized as |
|
||
∂x |
|
||||
|
∂T |
Ti − Ti−1 |
|
|
|
|
|
(9.55) |
|||
|
u |
∂x ≈ ui xi − xi−1 |
|||
|
|
||||
On the other hand, if the flow is in the opposite direction, then u < 0, and we should write the derivative in the other way. We would obtain, therefore,
320 CHAPTER 9 Numerical heat transfer
|
∂T |
|
Ti+1 |
− Ti |
(9.56) |
|
u |
∂x |
≈ ui xi+1 − xi |
||||
|
||||||
In other ways, discretization of the convective equation stays similar to everything else we have seen so far.
9.8 Practical considerations in engineering problems
As mentioned in the introduction to this chapter, numerical methods are now an indispensable part of industrial design, research, and development. Many industries use commercial software packages for heat transfer and flow predictions. The essentials even of these packages remain similar to what we have discussed here. However, in the interests of “making things as simple as possible but not any simpler,” let us see how practical problems differ from the toy problems seen in this chapter. We will use the same framework we discussed earlier in Section 9.2 to highlight the additional considerations required in practice.
1.Mathematical modeling: Deciding on an appropriate mathematical model for a given industrial problem is often a matter of balancing detail with the computational expense. For example, if we are modeling a heat exchanger, to what physical accuracy do we model rust? More commonly, we need to select the appropriate level of turbulence modeling required for turbulent flows. Chemical reactions, phase change, mass transfer, etc., are additional complications. All these require detailed computations by means of providing additional PDEs or by using empirical correlations to model terms. In addition, modeling interface and boundary conditions are also, usually, not straightforward. In theory, it is always possible to compute everything (for example, by simulating every single molecule!), but in practice, a good engineer shines at this step by choosing a model that is expected to provide adequate accuracy in a reasonable amount of time. Software packages regularly ask the user to specify the required mathematical model for a problem within a prespecified number of choices. Some packages also have the option of providing new PDEs to model novel physical effects.
2.Creating a mesh: Unlike our toy problems that conveniently lived in a “rectangle
world,” real geometries are complex. Imagine, for instance, the interior of an engine! These do not lend themselves easily to the kind of simple, uniform mesh we have used so far. Usually, such complex domains require both
•Nonuniform meshes—grid spacing is not equal everywhere in space.
•Non-Cartesian meshes—we use shapes other than rectangles and cuboids to fill the space; for example, triangles and tetrahedrons fill complex domains more easily.
There are dedicated pieces of software for this step alone, and it is an important portion of industrial solutions. Obtaining a “good mesh” can often be the difference between an excellent and a useless solution.
9.8 Practical considerations in engineering problems 321
3.Discretize the governing equation: The discretization we choose should be consistent with the mesh. If the mesh is non-Cartesian, we use finite volume or finite element methods instead of finite difference.
Further, as we discussed earlier, discretization must take into account the physics of the problem. Convection-dominated problems must have some form of upwinding. There are many other tricks of the trade that are applied at this step that enhance either speed or accuracy, or both. Choosing the appropriate discretization scheme is also given as a choice to the user in many software packages for this reason.
4.Solve the set of equations: There are a variety of methods that are used to solve
the resultant set of linear or nonlinear equations. Often there is a balance between speed and accuracy that must be maintained. Some popular general choices (which we have not discussed here) include the multigrid method and the conjugate gradient method. These tend to work for large classes of problems with a high degree of speed and accuracy.
5. Postprocessing: All the effort above is all in the service of this step—obtaining insight from our computation. Computation is not all about numbers. It is about inferring something from the data.
Something that beginners in numerical methods often forget is to have a clear physical picture of what the final plots are expected to look like. Without this preliminary picture, it is easy to accept anything that the computer throws up.
It is also important to choose variables to display that will enable us to determine if anything has gone wrong in the previous steps. Choosing which primary variables, such as temperature and velocity, or derived variables, such as stress, vorticity, etc., to plot, monitor, and display is a matter of insight and engineering sense.
As you can see, practical problems follow the same overall framework as our problems here but differ in subtle (but important) ways. We hope that this chapter has whet your appetite enough to pursue a more detailed study of numerical methods.
Problems
9.1Revisit problem 2.4 of chapter 2. Do the following.
a.Write down the governing equation and the boundary conditions for this problem. (Hint: use symmetry at the center.)
b.Discretize the governing equation using the finite difference formulation at any point i inside the wire.
c.Take five points between the center and the outer rim of the wire. Write the discrete formulation for these points.
d.Write the appropriate finite difference formulation of the boundary conditions.
e.Solve the above system of equations using the Gauss-Siedel method.
f.Write a computer program using 50 points between the center and the outer rim.
g.Compare your results with the analytical solution.
322CHAPTER 9 Numerical heat transfer
9.2Revisit problem 2.2 of Chapter 2. Do the following.
a.Write the governing equation and the boundary conditions.
b.Discretize the governing equation using the finite-difference formulation.
c.What kind of system of equations you will get after discretization, Linear or Non-linear?
9.3Revisit problem 2.10 of chapter 2. Do the following.
a.Write down the governing equation for the fin temperature distribution, along with the boundary conditions.
b.Discretize the governing equation using finite difference method.
c.What will be the boundary condition at the tip of the fin?(Hint: use energy balance at the tip.) Write down the finite difference formulation for this boundary condition.
d.Take five internal points along the length of the fin and write the finite difference equations for these points.
e.Solve the above system of equation using the Gauss-Siedel method.
f.Compare the solution with the exact solution.
g.Write a computer program for this problem. Experiment with the internal number of points.
9.4Consider a cylindrical pin fin with a length of 5 cm, a diameter of 12 mm, and
athermal conductivity of 15 W/mK that is insulated at its tip. The convection process is characterized by a fluid temperature at 30 °C and a heat transfer coefficient of 25 W/m2K. The base of the fin is at 100 °C. Do the following.
a.Write down the governing equation along with the boundary conditions.
b.Write down the finite difference formulation at any internal point i along the fin length.
c.Take five internal points along the length of the fin and write down the finite
difference formulation for these points.
d.Write down the appropriate finite difference formulation for the tip of the fin.
e.Solve the above system of equations using the Gauss-Seidel method.
f.Write a computer program and experiment on the number of points. Comment on the results.
9.5A square slab of dimensions 10 cm × 10 cm is very deep in the direction perpendicular to the plane of the paper. The slab is made of a material with thermal conductivity of k = 15 W/mK. Steady state prevails in the slab, there is no heat generation, and all the properties are assumed to be constant. The boundary conditions are given in the accompanying Fig. 9.6. Do the following.
a.Write the governing equation for the temperature distribution inside the plate along with the boundary conditions.
b.Discretize the above equation for any internal point (i,j) in the plate.
c.Take a 2 × 2 grid with equal ∆x, ∆y inside the plate. Write down the finite difference equations for these points.
d.Solve the above set of equations using the Gauss-Siedel method for five iterations.
9.8 Practical considerations in engineering problems 323
FIGURE 9.6
Schematic Representation of problem 9.5.
e.Write a computer program using a 10 × 10 grid. Decide upon an appropriate stopping criteria for the iterations.
f.Compare the temperature distribution with the analytical series solution.
g.Experiment with the number of grid points. Comment on the results.
9.6Consider steady two-dimensional heat transfer in a square metal. The temperature at the boundaries is prescribed to be 300 K on all sides except the top where the temperature is maintained at 400 K. The thermal conductivity of the body is k = 180 W/mK. There is heat generation of 107W/m3 in the slab. Using the finite difference method with a mesh size of ∆x = ∆y = 0.1 m, determine the
temperatures at nodes 1, 2, 3, and 4. Perform iterations with the Gauss-Seidel
method till max(Tij(n+1) − Tij(n) ) < 10−4, where the superscript n is the iteration number. Take the initial guess for the temperature at all nodes as 375 K.
9.7The time constant of a K-type (Chromel-Alumel) thermocouple of diameter
0.70mm has been determined to be 1 s, and the temperature indicated by the thermocouple at 0.5 s is 57.54 °C. The specific heat and density of ChromelAlumel are 420 J/kgK and 8600 kg/m3respectively, and the temperature of the medium is 100 °C. Using the lumped heat capacity model, do the following.
a.Write down the governing equation for this problem.
b.Use a first-order, finite difference approximation for the time derivative at any time t.
c.By taking ∆t = 0.05 s, calculate the temperature until t = 1s.
d.Using the same ∆t, march backward in time and find the initial temperature of the thermocouple.
e.Plot the temperature with respect to time and compare it with the analytical solution.
324CHAPTER 9 Numerical heat transfer
9.8Consider a slab of thickness L = 1 m with walls maintained at temperatures
TL = TR = 0 °C. The initial temperature distribution in the slab is given by T (x) = 4 x − 42 (x). The slab’s diffusivity is α = 0.1 m2 s-1. The slab is now allowed to cool for the next 1 second in a quiescent environment. Based on the information given, answer the following questions.
a.Write the governing law, boundary conditions, and initial condition for this problem. Specify the assumptions you made.
b.To solve this problem with FDM, we discretize the domain into five uniformly
spaced points along x and t axes, respectively, that is, x = t = 0.25. Using FTCS, write a computer program to calculate the temperature distribution of the slab after 1 second.
c.Recall that truncation errors in the approximation of derivatives depend upon the step sizes. It seems logical to reduce the step sizes for ∆x and ∆t to get a more accurate solution. Therefore run the previous computer
program with reduced step size of 0.1, that is, x = t = 0.1. Do you get some counterintuitive results? If yes, explain why.
d.Repeat previous problems with the Crank-Nicolson method. Do you observe any nonphysical results with the reduced grid size? Explain why or why not.
