Lecture11
Lecture11
1
Copyright © Sandip Mazumder
Lecture 11: What we will learn The Ohio State University
2
Copyright © Sandip Mazumder
Finite Difference Method for 2D Heat Conduction
The Ohio State University
Note that in this case, the fact that the GE is non-homogeneous and/or
the BCs may be non-homogeneous has no bearing on the method of
solution.
All possible variations can be addressed easily by the FDM.
3
Copyright © Sandip Mazumder
Finite Difference Method for 2D Heat Conduction
The Ohio State University
1,M N,M FD nodes are at the
intersections of the vertical
and horizontal lines
For uniform grid spacing
L H
H ∆x
= ;=
∆y
N −1 M −1
Governing Equation:
j ∂ 2T ∂ 2T
2
+ 2 =ST
∂x ∂y
1,1 N,1
L
i
Our objective is to derive a set of algebraic equations for the
unknowns. In this case, we have NxM unknowns.
Let K = NxM
To set up matrix, each unknown (node) must have a unique number
instead of a double index. 4
Copyright © Sandip Mazumder
Finite Difference Method for 2D Heat Conduction
The Ohio State University
NxM
j
N+1 N+2
1 2 3 4 N
L
i
Next task is to develop the FD approximations for a generic node, k.
5
Copyright © Sandip Mazumder
Finite Difference Method for 2D Heat Conduction
The Ohio State University
1 1 1 1 2 2
Re-write as Tk +1 + Tk −1 + Tk − N + Tk + N − + T =
2 k
ST , k
(∆x) 2 (∆x) 2 (∆y ) 2 (∆y ) 2 ( ∆x ) 2
( ∆y )
Re-write as A(k , k + 1)Tk +1 + A(k , k − 1)Tk −1 + A(k , k − N )Tk − N + A(k , k + N )Tk + N − A(k , k )Tk =
ST , k
6
Copyright © Sandip Mazumder
Finite Difference Method for 2D Heat Conduction
The Ohio State University
W k O 2
approximated as before: ∂y k (∆y ) 2
k-1
For the x derivative, use one/two backward TSEs:
S ∂ 2T 8Tk −1 − Tk − 2 − 7Tk + 6∆x ⋅ C
k-N = Lecture 10, Slide 18
∂x 2 k
2(∆x) 2
Re-write as A(k , k − 1)Tk −1 + A(k , k − 2)Tk − 2 + A(k , k − N )Tk − N + A(k , k + N )Tk + N − A(k , k )Tk =
Bk
Note: Highlighted term will be missing if a first-order scheme is used for the
boundary node.
7
Copyright © Sandip Mazumder
Finite Difference Method for 2D Heat Conduction
The Ohio State University
The last equation on Slides 6 and 7, when written in matrix form results
in a five-banded (for first-order BC) coefficient matrix, as follows:
0
0
=
0
0
[A] [Τ] = [B]
The three central bands are clustered, while the two outer bands (North
and South contributions) are removed from the center diagonal by N
elements.
Note that the size of the coefficient matrix is K x K (Note: K = N x M) 8
Copyright © Sandip Mazumder
Finite Difference Method for 2D Heat Conduction
The Ohio State University
10
Copyright © Sandip Mazumder
Finite Difference Method for 2D Heat Conduction
The Ohio State University
Step 3
Calculate Residual, R2
Check for convergence
Step 4
Repeat steps 1-3 until convergence
If the residual goes to zero at each node, then the nodal equation has
been satisfied at each node, and we should then have the correct
solution.
Computationally, performing an IF check on the residual for each node is
computationally expensive. To avoid that, we calculate a norm instead:
L2Norm R 2 = ∑ i, j
R 2
i, j
Keep moving up
Repeat for each line
Step 1
Start with a guess for values of Τ at all nodes. Let this be Τ*i,j
If any of the boundary nodes have isothermal boundary conditions, use
the boundary value as the guess.
Step 2
Set up tri-diagonal solver for each line (e.g., row-wise sweep B => T)
2 2 1 1 1 1
2
+ T
2 i, j
− T
2 i +1, j
− T
2 i −1, j
= T
2 i , j −1
+ T * − ST ,i , j
2 i , j +1
(∆x) (∆y ) (∆x) (∆x) (∆y ) (∆y )
Step 3
Calculate R2 (exact same equation as before)
Check for convergence
Step 4
Repeat steps 1-3 until convergence
15
Copyright © Sandip Mazumder
Finite Difference Method for 2D Heat Conduction
The Ohio State University
Convergence
41 x 41 mesh
17
Copyright © Sandip Mazumder
FDM for Unsteady Heat Conduction: Explicit
The Ohio State University
For that, we again use Taylor series expansions, but now in time.
n n
n +1 ∂T (∆t ) ∂ T 2 2
where a time index, n, has been
T = T + ∆t
i, j
n
i, j + 2
+ ... introduced such that t = n∆t
∂t 2! ∂t
n n
Ti ,nj+1 − Ti ,nj 2
Re-arranging, we get ∂T = −
∆t ∂ T
+ ...
2
∂t ∆t 2 ∂t
Neglecting the higher order derivative terms, we get
n n +1 n n Thus, the error introduced by
∂T Ti , j − Ti , j 2
∆t ∂ T discretization of the time
≈ , ε=
− + ...
∂t ∆t 2 ∂t 2 derivative is first order. 18
Copyright © Sandip Mazumder
FDM for Unsteady Heat Conduction: Explicit
The Ohio State University
Recall that we are trying to discretize the following governing equation
∂T ∂ 2T ∂ 2T q ′′′g
= α 2 + 2 +
∂t ∂x ∂y ρc
Since the left hand side of the above equation was evaluated at time
index n, the right hand side must also be evaluated at the same time
index. This yields (after using central difference for spatial derivatives)
Ti ,nj+1 − Ti ,nj Ti +n1, j + Ti −n1, j − 2Ti ,nj Ti ,nj +1 + Ti ,nj −1 − 2Ti ,nj q ′′′g
≈α + +
ρc
2 2
∆t ( ∆ x ) ( ∆ y )
Re-arrange equation with knowns on one side (RHS) and unknowns on
the other side (LHS)
T n
i +1, j + T n
i −1, j − 2φ n
i, j T n
i , j +1 + T n
i , j −1 − 2T n
i, j
q ′′′g
Ti ,nj+1 = Ti ,nj + α ∆t + + ∆t
ρc
2 2
( ∆ x ) ( ∆ y )
Note that in the above equation, all quantities on the RHS represent old
time-index values, i.e., initial conditions for current time index (n+1).
Therefore, these are known. 19
Copyright © Sandip Mazumder
FDM for Unsteady Heat Conduction: Explicit
The Ohio State University
Such a scheme is best represented pictorially as follows
Ti ,nj+1
Time index n+1 Unknown
Ti ,nj +1
Ti ,nj
Ti −n1, j φin+1, j
Time index n Knowns
Ti ,nj −1
Since, the determination of the nodal value of φ at the time index n+1
(new time step) requires only an explicit calculation, i.e., no solution of a
set of simultaneous equations, such a scheme is referred to as an
EXPLICIT or Forward Euler time-marching scheme.
20
Copyright © Sandip Mazumder
FDM for Unsteady Heat Conduction: Explicit
The Ohio State University
x
T − T∞ * x * α t
=
Non-dimensionalize using variables used before: θ =,x = ,t
T0 − T∞ L L2
∂θ ∂ 2θ IC: θ (0, x ) = 1
*
GE: *
= *2
∂t ∂x
∂θ ∂T hL
BCs: = 0, = − Bi θ (t * ,1) where Bi =
∂x* ( t * ,0) ∂x* ( t * ,1) k
22
Copyright © Sandip Mazumder
FDM for Unsteady Heat Conduction: Explicit
The Ohio State University
2∆t *
Substitute into GE and rearrange: θ1,n +1 =
θ1,n + * 2
[θ 2,n − θ1,n ]
(∆x )
∂θ (∆x* ) 2 ∂ 2θ (∆x* )3 ∂ 3θ
Right boundary node (i = N): θ N −=
1 θ N − ∆x *
+ − + ...
∂x* N 2 ∂x*2 N
6 ∂x*3 N
∂ 2θ 2
Substitute right BC: ≈ [θ N −1 − (1 + Bi ∆x* )θ N ]
∂x*2 N
* 2
(∆x )
2∆t *
Substitute into GE and rearrange: θ N ,n +1= θ N ,n + * 2
[θ N −1,n − (1 + Bi ∆x)θ N ,n ]
(∆x ) 23
Copyright © Sandip Mazumder
FDM for Unsteady Heat Conduction: Explicit
The Ohio State University
x* 24