0% found this document useful (0 votes)
9 views24 pages

Lecture 10

The document discusses the numerical solution of transient heat conduction problems using the Finite Difference Method (FDM) in 1D. It covers the derivation of the governing equations, the application of boundary conditions, and the formulation of the problem in matrix form for computational solving. Additionally, it addresses the importance of satisfying both boundary conditions and governing equations at the boundaries to ensure accuracy in numerical solutions.

Uploaded by

ackshaya1311
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views24 pages

Lecture 10

The document discusses the numerical solution of transient heat conduction problems using the Finite Difference Method (FDM) in 1D. It covers the derivation of the governing equations, the application of boundary conditions, and the formulation of the problem in matrix form for computational solving. Additionally, it addresses the importance of satisfying both boundary conditions and governing equations at the boundaries to ensure accuracy in numerical solutions.

Uploaded by

ackshaya1311
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Copyright © Sandip Mazumder

Lecture 9: What we learnt The Ohio State University

 Transient (unsteady) heat conduction (large Bi) for 2D


o Separation of Variables
o Product Solution Method

 Numerical Solution of Heat Conduction Problems


o Finite Difference Method in 1D

1
Copyright © Sandip Mazumder
Lecture 10: What we will learn The Ohio State University

 Numerical Solution of Heat Conduction Problems


o Finite Difference Method in 1D
o Application of Boundary Conditions

2
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Consider a 1D Steady State Heat Conduction Equation

The objective is to find the


constant qg distribution of T within the
T  TL T  TR
slab
L

x
This problem can be solved analytically

d 2T qg T (0)  TL
GE 2
   ST BCs
T ( L)  TR
dx k

Closed-form TR  TL x ( L  x)
T ( x)  TL  x  ST
analytical solution L 2
We will later use this closed-form analytical solution for verification of
3
the numerical results
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

In the FDM, we will seek the solution of the GE at discrete points within
the computational domain, called nodes.
In general, the node spacing may be equal or unequal.

i=1 i = N-1 i=N


i=2 x

For simplicity, let us assume that we have uniform discretization.


Therefore, the grid spacing may be expressed as
L
x 
N 1
In order to enable a digital computer to solve this problem, we must
express the second derivative in the form of one or more algebraic
equations.
Generally, the objective is to express the derivative in terms of the nodal
values of f, which in turn, becomes the unknowns that we solve for. 4
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

In order to express the derivatives in terms of nodal values, employ


Taylor series expansions.
x x

i-1 i i+1
W O E

We perform two Taylor series expansions—one forward and one


backward
dT (x) 2 d 2T (x)3 d 3T (x) 4 d 4T
TE  TO  x     ...
dx O 2! dx 2 O 3! dx3 O 4! dx 4 O
dT (x) 2 d 2T (x)3 d 3T (x) 4 d 4T
TW  TO  x     ...
dx O 2! dx 2 O
3! dx3 O
4! dx 4 O

Adding the two expressions, we get

d 2T (x) 4 d 4T
TE  TW  2TO  (x) 2
  ...
dx 2 O
12 dx 4 O
5
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Rearranging, we get
d 2T TE  TW  2TO (x) 2 d 4T
   ...
dx 2 O
(x) 2
12 dx 4 O

Clearly, the fourth derivative of T is an unknown, and therefore, it does


not serve any purpose to retain it.
We can throw out that term and all other higher order terms from the
above equation with the understanding that this will lead to an error.
This implies
d 2T TE  TW  2TO
FD approximation of the derivative
dx 2 O
(x) 2
(x) 2 d 4T Error introduced by the FD
   ... approximation, i.e., in converting the
12 dx 4 O derivative to an algebraic equivalent

Since this error is introduced due to truncation of the Taylor series or


due to discretization, it is known as Truncation or Discretization Error6
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Properties of the Truncation Error


(x) 2 d 4T
  4
 ...
12 dx O
Note that the error in this case is proportional to the square of the grid
spacing, i.e.,   (x)2
This means that if the number of nodes is doubled (or the grid spacing is
halved), the error will decrease by a factor or 4.
It also implies that as the grid spacing tends to a small value, the error
will also approach a small value but much faster. This is known as the
consistency condition of a scheme.
This is the reason we endeavor to use “fine” mesh in numerical
computations.
The term shown in the above expression is the so-called leading order
error term. All other higher order terms will have higher powers of x.
This implies that those terms will approach zero even faster, and
therefore, we need not worry about them. The accuracy of our
computation will be dominated by the leading order error term. 7
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Order of FD Approximation
(x) 2 d 4T
  4
 ...
12 dx O
Note that the error in this case is proportional to the square of the grid
spacing, i.e.,   (x)2
The power to which the grid spacing is raised to in the leading order
error term is known as the Order of the FD scheme.
In this case it is second order.
As long as the power is a positive definite number, it is a valid scheme.

x x Recall that to obtain our FD approximation, we


used 2 TSEs, one forward and one backward. The
i-1 i i+1 pivot point, O, is located centrally.
W O E
Such an approximation is known as the
Central Difference Approximation or Scheme
8
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Thus far, we have derived a FD approximation of the governing


equation. To recall

i=1 i = N-1 i=N


i=2 x

d 2T TE  TW  2TO d 2T Ti 1  Ti 1  2Ti
 ST ,O or  ST ,i
dx 2 O
(x) 2
dx 2 i
(x) 2

This equation is valid only for the so-called interior nodes, i.e., i = 2 to N-1.
This is because at the first boundary node (i = 1), there is no “W” node.
Similarly, at the last boundary node (i = N), there is no “E” node.
Therefore,
Ti 1  Ti 1  2Ti
 ST ,i for i  2,..., N  1 N-2 equations
(x) 2

9
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Prescribe temperature (Isothermal) Boundary Condition


T (0)  TL ; T ( L)  TR
Since the values of T at the boundaries are known, and since we are
seeking a solution for T at each node, we can use them directly
T1  TL ; TN  TR
Now we have N equations with N unknowns, and this system of algebraic
equations can be solved to obtain T at each node.
However, one problem with this approach is that the governing equation
has not been satisfied at the boundary nodes. We chose to use the
boundary condition instead mainly because the problem cannot be solved
without applying boundary conditions. Therefore, application of boundary
condition was given first priority.
What is desirable is that we satisfy both boundary conditions (BCs) and
the governing equation (GE) at the boundaries.
10
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Prescribe temperature (Isothermal) Boundary Condition


Why do we need to satisfy both BC and GE at boundaries?
Because, unless we do that, we are not satisfying the GE in (0,L) but in a
domain smaller than (0,L). How much smaller depends on how coarse/fine
the mesh is.
Note that in an analytical (exact) solution, both are satisfied. For example

d 2T T (0)  TL
To solve 2
 ST Subject to
T ( L)  TR
dx
x2
we first solve the GE analytically T ( x)  ST  C1 x  C2
2
Then, we substitute the solution into the boundary conditions to obtain
the two unknown constants.

This procedure clearly shows that we are satisfying both the governing
equation and the boundary conditions at the boundary.
11
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Prescribe temperature (Isothermal) Boundary Condition


In the context of FDM with Isothermal BCs, if we also want to satisfy the GE
at the boundaries, we get an over-specified problem, i.e., more equations
than unknowns. Therefore, we put first priority on satisfying the BCs.
In summary, our FDM equations are as follows:

i 1 T1  TL
Ti 1  Ti 1  2Ti
i  2,..., N  1  ST ,i
(x) 2

iN TN  TR

The next goal is to write them in a matrix form [A][T] = [B], so that the set
of equations can be solved on a computer.

12
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University
In matrix form, the equations may be written as
 1 0 ... 0 
  T1   L 
T
 1 2
 1    
0   T2   ST ,2 
 (x) 2 (x) 2 (x) 2 
   .   . 
 . .    
.   . 
 
   Ti 1   . 
 0 1 2 1    
... 0 0 ... 0   Ti    ST ,i 
 (x) 2 (x) 2 (x) 2 
   Ti 1   . 
  .   . 
    
. 
 .  . 
.

 1 2 1    

0 T   S 
(x) 2 (x) 2 (x) 2   N 1   T , N 1 
   TN   TR 
 0 0 ... 0 1 

For a 1D problem, we get a tri-diagonal matrix system. This system of


equations can be solved using the Thomas Algorithm or Tri-Diagonal
Matrix Algorithm (TDMA).
13
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Prescribed Flux Boundary Condition


dT
T (0)  TL ; k  qR Prescribed flux on right wall only.
dx xL
The value of T at the left boundary is known, but the value of T at the right
boundary is not known.
dT qR
T1  TL ;  C
dx N k
Therefore, we have to set up a discrete equation for the right boundary
node. This is done using a backward Taylor series expansion.
dT (x) 2 d 2T (x)3 d 3T
TN 1  TN  x    ...
dx N 2! dx 2 N
3! dx3 N
i = N-1 i=N
Substitute right BC:
(x) 2 d 2T (x)3 d 3T
TN 1  TN  x C    ...
2! dx 2 N
3! dx3 N

14
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Prescribed Flux Boundary Condition


Rearrange to get second derivative at the boundary
d 2T 2 1 d 3T
2 [ N 1
 T  TN  C x ]  x 3  ...
dx 2 N
(x) 3 dx N

If we throw away last term, then we have an expression for the second
derivative that is only first order accurate.
Now satisfy GE
d 2T 2
2 [ N 1
T  TN  C x ]  ST , N
dx 2 N
(x)
In summary, our FDM equations are as follows:
i 1 T1  TL
Ti 1  Ti 1  2Ti
i  2,..., N  1  ST ,i
(x) 2

2 2C
iN [T N 1  T ]  S 
(x) 2 x
N T ,N
15
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University
In matrix form, the equations may be written as
 1 0 ... 0 
 1 2   T1   TL 
 1
0   S 

 (x) 2 (x) 2 ( x) 2   T2   
T ,2

   . 
. .   .   
    .
  .  
  T   . 
 0 1 2 1  
... 0 0 ... 0   i 1   ST ,i 
 (x) 2 (x) 2 ( x) 2   Ti  
   . 

   Ti 1   
  . 
. .  .   
   .
 1 2 1  .  
0    S 
 (x) 2 (x) 2 ( x) 2  TN 1   T , N 1 
 
 0 2 2   TN   ST , N  2C 

0 ...  x 
(x) 2 (x) 2 

The matrix is still tri-diagonal. However, the last row has changed.
16
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Prescribed Flux Boundary Condition


The fact that the last nodal equation is only first order accurate is not
desirable. Essentially, the lower accuracy of the last note will contaminate
the solution to some extent. Since the interior nodes have second order
accuracy, it is also desirable to derive a second order accurate FD
approximation for the last node.
To do so, use two backward Taylor series expansions instead of one.
dT (x) 2 d 2T (x)3 d 3T
TN 1  TN  x    ...
dx N 2! dx 2 N
3! dx3 N
i = N-2 i = N-1 i=N
dT (2x) d T
2 2
(2x) d T
3 3
TN  2  TN  2x    ...
dx N 2! dx 2 N
3! dx3 N

Multiply first equation by 8 and subtract from second equation to


eliminate third derivative.
dT d 2T (x) 4 d 4T
8TN 1  TN  2  7TN  6x  2(x) 2
  ...
dx N dx 2 N
3 dx 4 N
17
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Prescribed Flux Boundary Condition


Substitute right BC
d 2T (x) 4 d 4T
8TN 1  TN  2  7TN  6x  C  2(x) 2
  ...
dx 2 N
3 dx 4 N

Rearrange to get second derivative at the boundary


d 2T 8TN 1  TN  2  7TN  6x  C (x) 2 d 4T
   ...
dx 2 N
2(x) 2
6 dx 4 N

Note that the leading error (last term in above equation) is now second
order instead of first order.
Throw away last term and satisfy governing equation.
d 2T 8TN 1  TN  2  7TN  6x  C
  ST , N
dx 2 N
2(x) 2

8TN 1  TN  2  7TN 3C
Rearrange  S 
2(x) 2 x
T ,N
18
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University
In matrix form, the equations may be written as
 1 0 ... 0 
 1 2   T1   TL 
 1
0   S 

 (x) 2 (x) 2 ( x) 2   T2   
T ,2

  
.   .  
.
 . 
   . 
  . 
  T   . 
 0 1 2 1  
... 0 0 ... 0   i 1   ST ,i 
 (x) 2 (x) 2 ( x) 2   Ti  
   . 

   Ti 1   
  . 
. .  .   
   .
 1 2 1  .  
0    S 
 (x) 2 (x) 2 ( x) 2  TN 1   T , N 1 
 
 0 1 8 7   TN   ST , N  3C 

0
2(x) 2 2(x) 2 2(x) 2   x 

The matrix is no longer tri-diagonal because of the extra element in the


last row.
19
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Newton Cooling (or external convection) Boundary Condition


dT
T (0)  TL ; k  h[ T ( L)  T ] Newton cooling on right wall only.
dx xL
The value of T at the left boundary is known, but the value of T at the right
boundary is not known.
dT dT hT h
T1  TL ; k  h[TN  T ]   TN
dx N
dx N k k
Therefore, we have to set up a discrete equation for the right boundary
node. This is done using a backward Taylor series expansion.
dT (x) 2 d 2T (x)3 d 3T
TN 1  TN  x    ...
dx N 2! dx 2 N
3! dx3 N
i = N-1 i=N
Substitute right BC:
 hT h  (x) d T (x)3 d 3T
2 2
TN 1  TN  x   TN     ...
 k k  2! dx 2 N
3! dx3 N
20
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

Robin (Robbins) or Mixed Boundary Condition


Rearrange to get second derivative at the boundary
d 2T 2   h  hT  x d 3T
 TN 1  TN 1  k x   k x   3 dx3  ...
dx 2 N
(x) 2     N

Note that the leading error (last term in above equation) is first order.

Throw away last term and satisfy governing equation.


d 2T 2   h  hT 
 
 N 1 N  k 
T T 1  x  x   SN
dx 2 N
(x) 2    k 

Rearrange

2   h  2 hT
 
 N 1 N  k  
T T 1 x  S 
(x) 2 (x) k
T ,N
   

21
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University
In matrix form, the equations may be written as
 1 0 ... 0 
 1 2  T   TL 
 1
0  1   S 
 (x) 2 (x) 2 (x) 2   T2   
T ,2

  .   . 
 . .   
  . 
  . 
   . 
2 
 0 ... 0
1 1
0 ... 0   Ti 1   
  Ti    
S
 (x) 2 (x) 2 (x) 2 T ,i

   . 

   Ti 1   
 . .  .   . 
   
 .
 1 2 1  .   
 T   
0
 (x) 2 (x) 2 (x) 2
ST , N 1
   N 1   
 2 2  h    TN   ST , N  2 hT

 0 0 ...  1  x   x k 
 (x) 2 (x) 2  k  

The matrix is tri-diagonal because we implemented only a first order


accurate scheme for the last node. For second order, follow the same
procedure as for prescribed heat flux BC. 22
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University
Post-Processing
For heat transfer applications, we often desire certain quantities of
engineering interest at the boundaries. These may include:
 Heat flux at isothermal boundaries
 Temperature at prescribed flux boundaries
 Both temperature and heat flux at Newton cooling boundaries

Calculating Heat Flux at Isothermal Boundaries:

Use TSEs to derive flux expression (1 TSE for 1st order, 2 for 2nd order):
Consider second order as an example for the right wall:
dT (x) 2 d 2T (x)3 d 3T
TN 1  TN  x    ...
dx N 2! dx 2 N
3! dx3 N
i = N-2 i = N-1 i=N
dT (2x) d T
2 2
(2x) d T
3 3
TN  2  TN  2x    ...
dx N 2! dx 2 N
3! dx3 N

Here the objective is to derive the first derivative. So, we cancel the
second derivative. Therefore, multiply first equation by 4 and subtract. 23
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University

dT 4(x)3 d 3T
4TN 1  TN  2  3TN  2x   ...
dx N 3! dx3 N

dT 3TN  TN  2  4TN 1 (x) 2 d 3T


Rearrange:    ...
dx N 2x 3 dx3 N

Therefore, heat flux at the right wall is given by


dT  3TN  TN  2  4TN 1 
qR   k  k  
dx N  2x 

Calculating Temperature at Prescribed Flux Boundaries:

Rearrange above expression to express temperature in terms of heat flux:


qR 1
TN  2x   4TN 1  TN  2 
3k 3
Newton Cooling boundary condition: derive at home.

You might also like