Lecture 10
Lecture 10
1
Copyright © Sandip Mazumder
Lecture 10: What we will learn The Ohio State University
2
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University
x
This problem can be solved analytically
d 2T qg 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 i+1
W O E
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
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.
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
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
i 1 T1 TL
Ti 1 Ti 1 2Ti
i 2,..., N 1 ST ,i
(x) 2
iN 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
14
Copyright © Sandip Mazumder
Finite Difference Method for 1D Heat Conduction
The Ohio State University
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
iN [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
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 6x 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
Note that the leading error (last term in above equation) is first order.
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
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 (2x) d T
2 2
(2x) d T
3 3
TN 2 TN 2x ...
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 2x ...
dx N 3! dx3 N