0% found this document useful (0 votes)
23 views25 pages

2D - Heat Conduction - Cart - Coordinates - Transient - ADI - Corrected

Uploaded by

lsl
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)
23 views25 pages

2D - Heat Conduction - Cart - Coordinates - Transient - ADI - Corrected

Uploaded by

lsl
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/ 25

1

Objectives

• Present a simple 2D Transient heat conduction problem with no heat


generation
• We discretize the domain into 4 x 4 grid
• We consider 2 half time steps and solve the problem using Alternating
Direct Implicit (ADI) finite difference method
• Vary grid spacings and time steps and resolve the problem and obtain
temperatures inside the domain

2
T1 = 100 °C
x

T2 = 100 °C
T4 = 100 °C
w=1m
Tin = 200 °C
α = 1e-4 m2/s Copper Plate

T3 = 100 °C

l=1m

2D Transient Heat Conduction Problem 3


General Heat Conduction Equation in 3D Cartesian Coordinates
𝜕 2𝑇 𝜕 2𝑇 𝜕 2𝑇 𝑔 1 𝜕𝑇
• + + + = (1) ; T(Temp) = T(x,y,z,t); x,y,z – spatial coordinates, t - time
𝜕𝑥2 𝜕𝑦2 𝜕𝑧2 𝑘 α 𝜕𝑡
𝑚2
• α − 𝑇ℎ𝑒𝑟𝑚𝑎𝑙 𝑑𝑖𝑓𝑓𝑢𝑠𝑖𝑣𝑖𝑡𝑦,
𝑠
• α =𝑘/ ρ∗𝑐
• k – thermal conductivity of the material , W/(m K)
• ρ - density of the material, kg/m3
• c – specific heat capacity of the material, J/(kg K)
• g – volumetric rate of internal heat generation, W/(m3)
Assumption of material thermal conductivity
• kx, ky, kz does not vary along each of x, y or z axis homogeneous
• kx = ky = kz = k (isotropic) 4
For 2D transient heat conduction with no heat generation,
equation (1) reduces to a simpler form
• We assume temperature does not vary significantly along the z direction when
compared with x, y directions.
• g = 0 (no heat generation);
𝜕2 𝑇 𝜕2 𝑇 1 𝜕𝑇
• + = ………. (2); T = T(x,y,t);
𝜕𝑥2 𝜕𝑦2 α 𝜕𝑡
𝜕𝑇 𝜕2 𝑇 𝜕2 𝑇
• =α * + 2 ; T = T(x,y,t); t >=0;
𝜕𝑡 𝜕𝑥2 𝜕𝑦
• IC: T(x,y,t=0) = Tin;
• BCs: T(x,y = 0,t) = T1; T(x=l,y,t) = T2; T(x,y=w,t) = T3; T(x=0,y,t) = T4 (3)
• l = length of the domain in x direction; w = length of the domain in y direction.
• To obtain T, we need to solve the above PDE.
• We will utilize Finite Difference Method to solve the above PDE.
• To do so, we need to replace the partial derivatives with finite difference approximations
• We will follow the procedures as shown in the next slide 5
• For the first ADI time step
1 1 1 1
𝑛+2 𝑛 𝑛+2 𝑛+2 𝑛+2
𝑇𝑖,𝑗 − 𝑇𝑖,𝑗 𝑛 𝑛 𝑛 𝑇𝑖,𝑗−1 −2∗𝑇𝑖,𝑗 + 𝑇𝑖,𝑗+1
𝑇𝑖−1,𝑗 −2∗𝑇𝑖,𝑗 + 𝑇𝑖+1,𝑗
• Δ𝑡 = α ∗ + …Eq(4)
Δ𝑥 2 Δ𝑦 2
2
• For simplicity, let Δx = Δy
α ∗ Δ𝑡
• Also, let d = ( ) ; where d – diffusion number, we then get
Δ𝑥 2
1 1 1 1
𝑛+2 𝑛 𝑑 𝑛 𝑛 𝑛 𝑛+2 𝑛+2 𝑛+2
• 𝑇𝑖,𝑗 - 𝑇𝑖,𝑗 = * 𝑇𝑖−1,𝑗 + 𝑇𝑖+1,𝑗 − 2 ∗ 𝑇𝑖,𝑗 + 𝑇𝑖,𝑗−1 − 2 ∗ 𝑇𝑖,𝑗 +𝑇𝑖,𝑗+1
2
• Rearranging,
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇𝑖,𝑗−1 + 2 1 + 𝑑 ∗ 𝑇𝑖,𝑗 − 𝑑 ∗ 𝑇𝑖,𝑗+1 = 𝑑∗𝑇𝑖−1,𝑗 + 2 ∗ 1 − 𝑑 ∗ 𝑇𝑖,𝑗 + 𝑑 ∗ 𝑇𝑖+1,𝑗 Eq(5)
• Equation (5) is the finite difference approximation for the first ADI step of the original
equation we were trying to solve.
• Here i represents the node location along the x direction, j represents the node
location along the y direction and n represents the time step.
6
• For the second ADI time step
1 1 1 1
𝑛+1 𝑛+ 𝑛+2 𝑛+2 𝑛+2
𝑇𝑖,𝑗 − 𝑇𝑖,𝑗 2 𝑛+1
𝑇𝑖−1,𝑗 𝑛+1
−2∗𝑇𝑖,𝑗 𝑛+1
+ 𝑇𝑖+1,𝑗 𝑇𝑖,𝑗−1 −2∗𝑇𝑖,𝑗 + 𝑇𝑖,𝑗+1
• Δ𝑡 = α ∗ + …Eq(6)
Δ𝑥 2 Δ𝑦 2
2
• For simplicity, let Δx = Δy
α ∗ Δ𝑡
• Also, let d = ( ) ; where d – diffusion number, we then get
Δ𝑥 2
1 1 1 1
𝑛+1 𝑛+2 𝑑 𝑛+1 𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2
• 𝑇𝑖,𝑗 - 𝑇𝑖,𝑗 = * 𝑇𝑖−1,𝑗 − 2 ∗ 𝑇𝑖,𝑗 + 𝑇𝑖+1,𝑗 + 𝑇𝑖,𝑗−1 − 2 ∗ 𝑇𝑖,𝑗 + 𝑇𝑖,𝑗+1
2
• Rearranging,
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2
• − 𝑑∗𝑇𝑖−1,𝑗 + 2 ∗ 1 + 𝑑 ∗ 𝑇𝑖,𝑗 − 𝑑 ∗ 𝑇𝑖+1,𝑗 = 𝑑 ∗ 𝑇𝑖,𝑗−1 + 2 1 − 𝑑 ∗ 𝑇𝑖,𝑗 + 𝑑 ∗ 𝑇𝑖,𝑗+1 … Eq(7)
• Equation (7) is the finite difference approximation for the second ADI step of the
original equation we were trying to solve.
• Here i represents the node location along the x direction, j represents the node
location along the y direction and n represents the time step.
7
• The above approximation is called Alternating Direct Implicit (ADI)
method
• This is an implicit method. Hence, temperatures Ti,j’s at future times
(n+1) need to be obtained based on Ti,j’s at present times as shown in
equation (5).
• Equations need to be solved simultaneously as we have unknown
temperatures at neighbouring points for the same time step.
• The advantage being implicit methods are unconditionally stable.
• But d (diffusion number) / time step (Δt) still need to be smaller for
accuracy considerations, not stability considerations in general
• The truncation error is O(Δt2) + O(Δx2) + O(Δy2)

8
• Now let us discretize the 2D domain into a 4 x 4 grid equally spaced,
as shown below. T1
(1,1) (2,1) (3,1) (4,1) (5,1)

(1,2) (2,2) (3,2) (4,2) (5,2)

Tin
(1,3) (2,3) (3,3) (4,3) (5,3)
T4 T2

(1,4) (2,4) (3,4) (4,4) (5,4)

(1,5) (2,5) (3,5) (4,5) (5,5)

T3 9
• We have 25 nodes in total
• Temperatures are fixed at the boundary nodes as shown
• Our interest is on the (9) interior nodes (2,2)……(4,4)
• Let us apply equation (5) on the (9) interior nodes
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇𝑖,𝑗−1 + 2 1 + 𝑑 ∗ 𝑇𝑖,𝑗 − 𝑑 ∗ 𝑇𝑖,𝑗+1 = 𝑑∗𝑇𝑖−1,𝑗 + 2 ∗ 1 − 𝑑 ∗ 𝑇𝑖,𝑗 + 𝑑 ∗ 𝑇𝑖+1,𝑗 Eq(5)
1 1 1
𝑛+ 𝑛+ 𝑛+ 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇2,1 2 + 2 1+𝑑 ∗ 𝑇2,2 2 − 𝑑∗ 𝑇2,3 2 = 𝑑∗𝑇1,2 + 2 ∗ 1 − 𝑑 ∗ 𝑇2,2 + 𝑑 ∗ 𝑇3,2 ; for (i = 2, j = 2)
1 1 1
𝑛+ 𝑛+ 𝑛+ 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇3,1 2 + 2 1+𝑑 ∗ 𝑇3,2 2 − 𝑑∗ 𝑇3,3 2 = 𝑑∗𝑇2,2 + 2 ∗ 1 − 𝑑 ∗ 𝑇3,2 + 𝑑 ∗ 𝑇4,2 ; for (i = 3, j = 2)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇4,1 + 2 1+𝑑 ∗ 𝑇4,2 − 𝑑∗ 𝑇4,3 = 𝑑∗𝑇3,2 + 2 ∗ 1 − 𝑑 ∗ 𝑇4,2 + 𝑑 ∗ 𝑇5,2 ; for (i = 4, j = 2)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇2,2 + 2 1+𝑑 ∗ 𝑇2,3 − 𝑑∗ 𝑇2,4 = 𝑑∗𝑇1,3 + 2 ∗ 1 − 𝑑 ∗ 𝑇2,3 + 𝑑 ∗ 𝑇3,3 ; for (i = 2, j = 3)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇3,2 + 2 1+𝑑 ∗ 𝑇3,3 − 𝑑∗ 𝑇3,4 = 𝑑∗𝑇2,3 + 2 ∗ 1 − 𝑑 ∗ 𝑇3,3 + 𝑑 ∗ 𝑇4,3 ; for (i = 3, j = 3)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇4,2 + 2 1+𝑑 ∗ 𝑇4,3 − 𝑑∗ 𝑇4,4 = 𝑑∗𝑇3,3 + 2 ∗ 1 − 𝑑 ∗ 𝑇4,3 + 𝑑 ∗ 𝑇5,3 ; for (i = 4, j = 3)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇2,3 + 2 1+𝑑 ∗ 𝑇2,4 − 𝑑∗ 𝑇2,5 = 𝑑∗𝑇1,4 + 2 ∗ 1 − 𝑑 ∗ 𝑇2,4 + 𝑑 ∗ 𝑇3,4 ; for (i = 2, j = 4)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇3,3 + 2 1+𝑑 ∗ 𝑇3,4 − 𝑑∗ 𝑇3,5 = 𝑑∗𝑇2,4 + 2 ∗ 1 − 𝑑 ∗ 𝑇3,4 + 𝑑 ∗ 𝑇4,4 ; for (i = 3, j = 4)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇4,3 + 2 1+𝑑 ∗ 𝑇4,4 − 𝑑∗ 𝑇4,5 = 𝑑∗𝑇3,4 + 2 ∗ 1 − 𝑑 ∗ 𝑇4,4 + 𝑑 ∗ 𝑇5,4 ; for (i = 4, j = 4)
10
• Moving the boundary nodal temperatures to RHS and rearranging, we get
1 1 1
𝑛+ 𝑛+ 𝑛 𝑛 𝑛 𝑛+
• 2 1+𝑑 ∗ 𝑇2,2 2 − 𝑑 ∗ 𝑇2,3 2= 2∗ 1−𝑑 ∗ 𝑇2,2 + 𝑑 ∗ 𝑇3,2 + 𝑑∗𝑇1,2 + 𝑑 ∗ 𝑇2,1 2 ; for (i = 2, j = 2)
1 1 1
𝑛+ 𝑛+ 𝑛 𝑛 𝑛 𝑛+
• 2 1+𝑑 ∗ 𝑇3,2 2 − 𝑑 ∗ 𝑇3,3 2 = 𝑑∗𝑇2,2 + 2∗ 1 − 𝑑 ∗ 𝑇3,2 + 𝑑 ∗ 𝑇4,2 + 𝑑 ∗ 𝑇3,1 2 for (i = 3, j = 2)
1 1 1
𝑛+ 𝑛+ 𝑛 𝑛 𝑛 𝑛+
• 2 1+𝑑 ∗ 𝑇4,2 2 − 𝑑 ∗ 𝑇4,3 2= 𝑑∗𝑇3,2 + 2∗ 1 − 𝑑 ∗ 𝑇4,2 + 𝑑 ∗ 𝑇5,2 + 𝑑 ∗ 𝑇4,1 2 ; for (i = 4, j = 2)
1 1 1
𝑛+ 𝑛+ 𝑛+ 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇2,2 2 + 2 1+𝑑 ∗ 𝑇2,3 2 − 𝑑∗ 𝑇2,4 2 = 𝑑∗𝑇1,3 + 2 ∗ 1 − 𝑑 ∗ 𝑇2,3 + 𝑑 ∗ 𝑇3,3 ; for (i = 2, j = 3)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇3,2 + 2 1+𝑑 ∗ 𝑇3,3 − 𝑑∗ 𝑇3,4 = 𝑑∗𝑇2,3 + 2 ∗ 1 − 𝑑 ∗ 𝑇3,3 + 𝑑 ∗ 𝑇4,3 ; for (i = 3, j = 3)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇4,2 + 2 1+𝑑 ∗ 𝑇4,3 − 𝑑∗ 𝑇4,4 = 𝑑∗𝑇3,3 + 2 ∗ 1 − 𝑑 ∗ 𝑇4,3 + 𝑑 ∗ 𝑇5,3 ; for (i = 4, j = 3)
1 1 1
𝑛+2 𝑛+2 𝑛 𝑛 𝑛 𝑛+
• −𝑑 ∗ 𝑇2,3 + 2 1+𝑑 ∗ 𝑇2,4 = 𝑑∗𝑇1,4 + 2 ∗ 1 − 𝑑 ∗ 𝑇2,4 + 𝑑 ∗ 𝑇3,4 + 𝑑∗ 𝑇2,5 2 ; for (i = 2, j = 4)
1 1 1
𝑛+2 𝑛+2 𝑛 𝑛 𝑛 𝑛+2
• −𝑑 ∗ 𝑇3,3 + 2 1+𝑑 ∗ 𝑇3,4 = 𝑑∗𝑇2,4 + 2 ∗ 1 − 𝑑 ∗ 𝑇3,4 + 𝑑 ∗ 𝑇4,4 +𝑑∗ 𝑇3,5 ; for (i = 3, j = 4)
1 1 1
𝑛+2 𝑛+2 𝑛 𝑛 𝑛 𝑛+2
• −𝑑 ∗ 𝑇4,3 + 2 1+𝑑 ∗ 𝑇4,4 = 𝑑∗𝑇3,4 + 2 ∗ 1 − 𝑑 ∗ 𝑇4,4 + 𝑑 ∗ 𝑇5,4 + 𝑑∗ 𝑇4,5 ; for (i = 4, j = 4)

• Let 2* (1 + d) = β and 2*(1-d) = γ

11
• We get
1 1 1
𝑛+ 𝑛+ 𝑛 𝑛 𝑛 𝑛+
• β ∗ 𝑇2,2 2 − 𝑑 ∗ 𝑇2,3 2 = γ ∗ 𝑇2,2 + 𝑑 ∗ 𝑇3,2 + 𝑑∗𝑇1,2 + 𝑑 ∗ 𝑇2,1 2 ; for (i = 2, j = 2)
1 1 1
𝑛+ 𝑛+ 𝑛+ 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇2,2 2 + β ∗ 𝑇2,3 2 − 𝑑 ∗ 𝑇2,4 2 = 𝑑∗𝑇1,3 + γ ∗ ∗ 𝑇2,3 + 𝑑 ∗ 𝑇3,3 ; for (i = 2, j = 3)
1 1 1
𝑛+ 𝑛+ 𝑛 𝑛 𝑛 𝑛+
• −𝑑 ∗ 𝑇2,3 + β ∗ 𝑇2,4 = 𝑑∗𝑇1,4 + γ ∗ 𝑇2,4 + 𝑑 ∗ 𝑇3,4 + 𝑑 ∗ 𝑇2,5 2;
2 2
for (i = 2, j = 4)
1 1 1
𝑛+2 𝑛+2 𝑛 𝑛 𝑛 𝑛+2
• β ∗ 𝑇3,2 − 𝑑 ∗ 𝑇3,3 = 𝑑∗𝑇2,2 + γ ∗ 𝑇3,2 + 𝑑 ∗ 𝑇4,2 + 𝑑 ∗ 𝑇3,1 for (i = 3, j = 2)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇3,2 + β ∗ 𝑇3,3 − 𝑑 ∗ 𝑇3,4 = 𝑑∗𝑇2,3 + γ ∗ 𝑇3,3 + 𝑑 ∗ 𝑇4,3 ; for (i = 3, j = 3)
1 1 1
𝑛+2 𝑛+2 𝑛 𝑛 𝑛 𝑛+
• −𝑑 ∗ 𝑇3,3 + β ∗ 𝑇3,4 = 𝑑∗𝑇2,4 + γ ∗ 𝑇3,4 + 𝑑 ∗ 𝑇4,4 + 𝑑 ∗ 𝑇3,5 2; for (i = 3, j = 4)
1 1 1
𝑛+2 𝑛+2 𝑛 𝑛 𝑛 𝑛+
• β ∗ 𝑇4,2 − 𝑑 ∗ 𝑇4,3 = 𝑑∗𝑇3,2 + γ ∗ 𝑇4,2 + 𝑑 ∗ 𝑇5,2 + 𝑑 ∗ 𝑇4,1 2; for (i = 4, j = 2)
1 1 1
𝑛+2 𝑛+2 𝑛+2 𝑛 𝑛 𝑛
• −𝑑 ∗ 𝑇4,2 + β ∗ 𝑇4,3 − 𝑑 ∗ 𝑇4,4 = 𝑑∗𝑇3,3 + γ ∗ 𝑇4,3 + 𝑑 ∗ 𝑇5,3 ; for (i = 4, j = 3)
1 1 1
𝑛+2 𝑛+2 𝑛 𝑛 𝑛 𝑛+2
• −𝑑 ∗ 𝑇4,3 + β ∗ 𝑇4,4 = 𝑑∗𝑇3,4 + γ ∗ 𝑇4,4 + 𝑑 ∗ 𝑇5,4 + 𝑑 ∗ 𝑇4,5 ; for (i = 4, j = 4)

• Rearranging in a matrix form,

12
β −𝑑 0 0 0 0 0 0 0 𝑇2,2
−𝑑 β −𝑑 0 0 0 0 0 0 𝑇2,3
0 −𝑑 β 0 0 0 0 0 0 𝑇2,4
0 0 0 β −𝑑 0 0 0 0 𝑇3,2
• 0 0 0 −𝑑 β −𝑑 0 0 0 𝑇3,3 (n+1/2)

0 0 0 0 −𝑑 β 0 0 0 𝑇3,4
0 0 0 0 0 0 β −𝑑 0 𝑇4,2
0 0 0 0 0 0 −𝑑 β −𝑑 𝑇4,3
0 0 0 0 0 0 0 −𝑑 β 𝑇4,4

γ 0 0 𝑑 0 0 0 0 0 𝑇2,2 𝑇1,2 + 𝑇2,1


0 γ 0 0 𝑑 0 0 0 0 𝑇2,3 𝑇1,3
0 0 γ 0 0 𝑑 0 0 0 𝑇2,4 𝑇1,4 + 𝑇2,5
𝑑 0 0 γ 0 0 𝑑 0 0 𝑇3,2 𝑇3,1
• = 0 𝑑 0 0 γ 0 0 𝑑 0 𝑇3,3 (n) +d* 0
0 0 𝑑 0 0 γ 0 0 𝑑 𝑇3,4 𝑇3,5
0 0 0 𝑑 0 0 γ 0 0 𝑇4,2 𝑇4,1 + 𝑇5,2
0 0 0 0 𝑑 0 0 γ 0 𝑇4,3 𝑇5,3
0 0 0 0 0 𝑑 0 0 γ 𝑇4,4 𝑇5,4 + 𝑇4,5

13
• The equation is of the form A*T(n+1/2) = B*T(n) + C
• The A matrix shown above is a tri-diagonal matrix
• The above set of equations can be solved using Thomas Algorithm method
• Iterative methods such as Gauss-Seidel, Successive Over Relaxation (SOR)
method can also be used to solve the above set of equations.
• Let Δt = 100 s (Note: higher value chosen for illustration purposes; for
accuracy purposes use smaller value);
• Δx = l/nx = 1/4 = 0.25 m; Δy = Δx = 0.25 m.
α ∗ Δ𝑡 1 x 10−4 x 100
• Then d = ( 2) = = 0.16 <= 0.25 (note no stability criteria
Δ𝑥 0.252
required to be met)
• Here, β = 2 * (1 + d) = 2 * (1 + 0.16) = 2.32;
• γ = 2*(1-d) = 2*(1-0.16) = 1.68
• Substituting the values of d, β, γ and the initial/previous time step and
boundary conditions, we get, for n = 0,
14
𝑇2,2
2.32 −0.16 0 0 0 0 0 0 0
𝑇2,3
−0.16 2.32 −0.16 0 0 0 0 0 0
0 −0.16 2.32 0 0 0 0 0 0 𝑇2,4
0 0 0 2.32 −0.16 0 0 0 0 𝑇3,2
• 0 0 0 −0.16 2.32 −0.16 0 0 0 𝑇3,3 (1/2)

0 0 0 0 −0.16 2.32 0 0 0 𝑇3,4


0 0 0 0 0 0 2.32 −0.16 0 𝑇4,2
0 0 0 0 0 0 −0.16 2.32 −0.16 𝑇4,3
0 0 0 0 0 0 0 −0.16 2.32 𝑇4,4

1.68 0 0 0.16 0 0 0 0 0 200


200
0 1.68 0 0 0.16 0 0 0 0 200 100
0 0 1.68 0 0 0.16 0 0 0 200 200
0.16 0 0 1.68 0 0 0.16 0 0 200 100
• = 0 0.16 0 0 1.68 0 0 0.16 0 200 (0) + 0.16 *
0
0 0 0.16 0 0 1.68 0 0 0.16 200 100
0 0 0 0.16 0 0 1.68 0 0 200 200
0 0 0 0 0.16 0 0 1.68 0 200 100
0 0 0 0 0 0.16 0 0 1.68 200
200
15
• Solving the above equation using TA method on MATLAB produces
the following results at first half time step, time t = Δt /2 = 50 s.
• T2,2 = 185.5942; T2,3 = 191.1164; T2,4 = 185.5942;
• T3,2 = 193.0372; T3,3 = 199.0396; T3,4 = 193.0372;
• T4,2 = 185.5942; T4,3 = 191.1164; T4,4 = 185.5942;

16
• For the second time step, let us apply equation (7) on the (9) interior nodes
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+
• − 𝑑∗𝑇𝑖−1,𝑗 + 2 ∗ 1 + 𝑑 ∗ 𝑇𝑖,𝑗 − 𝑑 ∗ 𝑇𝑖+1,𝑗 2
= 𝑑 ∗ 𝑇𝑖,𝑗−1 + 2 1 − 𝑑 ∗ 𝑇𝑖,𝑗 2 2
+ 𝑑 ∗ 𝑇𝑖,𝑗+1 … Eq(7)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+
• − 𝑑∗𝑇1,2 + 2∗ 1+𝑑 ∗ 𝑇2,2 −𝑑∗ 𝑇3,2 = 𝑑∗ 𝑇2,1 2 + 2 1−𝑑 ∗ 𝑇2,2 2 + 𝑑∗ 𝑇2,3 2 ; for (i = 2, j = 2)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2
• − 𝑑∗𝑇2,2 + 2 ∗ 1 + 𝑑 ∗ 𝑇3,2 − 𝑑 ∗ 𝑇4,2 = 𝑑∗ 𝑇3,1 + 2 1−𝑑 ∗ 𝑇3,2 + 𝑑∗ 𝑇3,3 ; for (i = 3, j = 2)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+
• − 𝑑∗𝑇3,2 + 2 ∗ 1 + 𝑑 ∗ 𝑇4,2 − 𝑑 ∗ 𝑇5,2 = 𝑑∗ 𝑇4,1 2 + 2 1−𝑑 ∗ 𝑇4,2 2 + 𝑑∗ 𝑇4,3 2 ; for (i = 4, j = 2)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2
• − 𝑑∗𝑇1,3 + 2 ∗ 1 + 𝑑 ∗ 𝑇2,3 − 𝑑 ∗ 𝑇3,3𝑗 = 𝑑∗ 𝑇2,2 + 2 1−𝑑 ∗ 𝑇2,3 + 𝑑∗ 𝑇2,4 ; for (i = 2, j = 3)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2
• − 𝑑∗𝑇2,3 + 2 ∗ 1 + 𝑑 ∗ 𝑇3,3 − 𝑑 ∗ 𝑇4,3 = 𝑑∗ 𝑇3,2 + 2 1−𝑑 ∗ 𝑇3,3 + 𝑑∗ 𝑇3,4 ; for (i = 3, j = 3)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2
• − 𝑑∗𝑇3,3 + 2 ∗ 1 + 𝑑 ∗ 𝑇4,3 − 𝑑 ∗ 𝑇5,3 = 𝑑∗ 𝑇4,2 + 2 1−𝑑 ∗ 𝑇4,3 + 𝑑∗ 𝑇4,4 ; for (i = 4, j = 3)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2
• − 𝑑∗𝑇1,4 + 2 ∗ 1 + 𝑑 ∗ 𝑇2,4 − 𝑑 ∗ 𝑇3,4 = 𝑑∗ 𝑇2,3 + 2 1−𝑑 ∗ 𝑇2,4 + 𝑑∗ 𝑇2,5 ; for (i = 2, j = 4)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2
• − 𝑑∗𝑇2,4 + 2 ∗ 1 + 𝑑 ∗ 𝑇3,4 − 𝑑 ∗ 𝑇4,4 = 𝑑∗ 𝑇3,3 + 2 1−𝑑 ∗ 𝑇3,4 + 𝑑∗ 𝑇3,5 ; for (i = 3, j = 4)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+
• − 𝑑∗𝑇3,4 + 2 ∗ 1 + 𝑑 ∗ 𝑇4,4 − 𝑑 ∗ 𝑇5,4 = 𝑑∗ 𝑇4,3 2 + 2 1−𝑑 ∗ 𝑇4,4 2 + 𝑑 ∗ 𝑇4,5 2 ; for (i = 4, j = 4)

17
• Moving the boundary nodal temperatures to RHS, we get
1 1 1
𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+ 𝑛+1
• 2∗ 1+𝑑 ∗ 𝑇2,2 −𝑑∗ 𝑇3,2 = 𝑑∗ 𝑇2,1 2 + 21−𝑑 ∗ 𝑇2,2 2+ 𝑑 ∗ 𝑇2,3 2 + 𝑑∗𝑇1,2 ; for (i = 2, j = 2)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+
• − 𝑑∗𝑇2,2 + 2∗ 1+𝑑 ∗ 𝑇3,2 − 𝑑 ∗ 𝑇4,2 = 𝑑 ∗ 𝑇3,1 2 + 2 1 − 𝑑 ∗ 𝑇3,2 2 + 𝑑 ∗ 𝑇3,3 2 ; for (i = 3, j = 2)
1 1 1
𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+ 𝑛+1
• − 𝑑∗𝑇3,2 + 2∗ 1+𝑑 ∗ 𝑇4,2 = 𝑑 ∗ 𝑇4,1 2 + 2 1 − 𝑑 ∗ 𝑇4,2 2 + 𝑑 ∗ 𝑇4,3 2 + 𝑑 ∗ 𝑇5,2 ; for (i = 4, j = 2)
1 1 1
𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+ 𝑛+1
• 2 ∗ 1 + 𝑑 ∗ 𝑇2,3 −𝑑∗ 𝑇3,3𝑗 = 𝑑 ∗ 𝑇2,2 + 2 1 − 𝑑 ∗ 𝑇2,3 + 𝑑 ∗ 𝑇2,4 2 + 𝑑∗𝑇1,3
2 2
; for (i = 2, j = 3)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+
• − 𝑑∗𝑇2,3 + 2∗ 1+𝑑 ∗ 𝑇3,3 − 𝑑 ∗ 𝑇4,3 = 𝑑 ∗ 𝑇3,2 + 2 1 − 𝑑 ∗ 𝑇3,3 + 𝑑 ∗ 𝑇3,4 2 ;
2 2
for (i = 3, j = 3)
1 1 1
𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2 𝑛+1
• − 𝑑∗𝑇3,3 + 2∗ 1+𝑑 ∗ 𝑇4,3 = 𝑑 ∗ 𝑇4,2 + 2 1 − 𝑑 ∗ 𝑇4,3 + 𝑑 ∗ 𝑇4,4 + 𝑑 ∗ 𝑇5,3 ; for (i = 4, j = 3)
1 1 1
𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2 𝑛+1
• 2 ∗ 1 + 𝑑 ∗ 𝑇2,4 −𝑑∗ 𝑇3,4 = 𝑑 ∗ 𝑇2,3 + 2 1 − 𝑑 ∗ 𝑇2,4 + 𝑑 ∗ 𝑇2,5 + 𝑑∗𝑇1,4 ; for (i = 2, j = 4)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+
• − 𝑑∗𝑇2,4 + 2∗ 1+𝑑 ∗ 𝑇3,4 − 𝑑 ∗ 𝑇4,4 = 𝑑 ∗ 𝑇3,3 2 + 2 1 − 𝑑 ∗ 𝑇3,4 2 + 𝑑 ∗ 𝑇3,5 2 ; for (i = 3, j = 4)
1 1 1
𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+ 𝑛+1
• − 𝑑∗𝑇3,4 + 2∗ 1+𝑑 ∗ 𝑇4,4 = 𝑑 ∗ 𝑇4,3 2 + 2 1 − 𝑑 ∗ 𝑇4,4 2 + 𝑑 ∗ 𝑇4,5 2 + 𝑑 ∗ 𝑇5,4 ; for (i = 4, j = 4)

• Again, let 2* (1 + d) = β and 2*(1-d) = γ

18
• We get,
1 1 1
𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+ 𝑛+1
• β∗ 𝑇2,2 −𝑑∗ 𝑇3,2 = 𝑑∗ 𝑇2,1 2 +γ ∗ 𝑇2,2 2 + 𝑑 ∗ 𝑇2,3 2 + 𝑑∗𝑇1,2 ; for (i = 2, j = 2)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+
• − 𝑑∗𝑇2,2 + β ∗ 𝑇3,2 − 𝑑 ∗ 𝑇4,2 = 𝑑 ∗ 𝑇3,1 2 + γ ∗ 𝑇3,2 2 + 𝑑 ∗ 𝑇3,3 2 ; for (i = 3, j = 2)
1 1 1
𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+ 𝑛+1
• − 𝑑∗𝑇3,2 + β ∗ 𝑇4,2 = 𝑑 ∗ 𝑇4,1 2 + γ ∗ 𝑇4,2 2 + 𝑑 ∗ 𝑇4,3 2 + 𝑑 ∗ 𝑇5,2 ; for (i = 4, j = 2)
1 1 1
𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+ 𝑛+1
• β ∗ 𝑇2,3 − 𝑑 ∗ 𝑇3,3𝑗 = 𝑑 ∗ 𝑇2,2 + γ ∗ 𝑇2,3 + 𝑑 ∗ 𝑇2,4 2 + 𝑑∗𝑇1,3
2 2
; for (i = 2, j = 3)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+
• − 𝑑∗𝑇2,3 + β ∗ 𝑇3,3 − 𝑑 ∗ 𝑇4,3 = 𝑑 ∗ 𝑇3,2 + γ ∗ 𝑇3,3 + 𝑑 ∗ 𝑇3,4 2;
2 2
for (i = 3, j = 3)
1 1 1
𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2 𝑛+1
• − 𝑑∗𝑇3,3 + β ∗ 𝑇4,3 = 𝑑 ∗ 𝑇4,2 + γ ∗ 𝑇4,3 + 𝑑 ∗ 𝑇4,4 + 𝑑 ∗ 𝑇5,3 ; for (i = 4, j = 3)
1 1 1
𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2 𝑛+1
• β ∗ 𝑇2,4 − 𝑑 ∗ 𝑇3,4 = 𝑑 ∗ 𝑇2,3 + γ ∗ 𝑇2,4 + 𝑑 ∗ 𝑇2,5 + 𝑑∗𝑇1,4 ; for (i = 2, j = 4)
1 1 1
𝑛+1 𝑛+1 𝑛+1 𝑛+ 𝑛+ 𝑛+
• − 𝑑∗𝑇2,4 + β ∗ 𝑇3,4 − 𝑑 ∗ 𝑇4,4 = 𝑑 ∗ 𝑇3,3 2 + γ ∗ 𝑇3,4 2 + 𝑑 ∗ 𝑇3,5 2; for (i = 3, j = 4)
1 1 1
𝑛+1 𝑛+1 𝑛+2 𝑛+2 𝑛+2 𝑛+1
• − 𝑑∗𝑇3,4 + β ∗ 𝑇4,4 = 𝑑 ∗ 𝑇4,3 + γ ∗ 𝑇4,4 + 𝑑 ∗ 𝑇4,5 + 𝑑 ∗ 𝑇5,4 ; for (i = 4, j = 4)

• Rearranging in a matrix form,

19
β −𝑑 0 0 0 0 0 0 0 𝑇2,2
−𝑑 β −𝑑 0 0 0 0 0 0 𝑇3,2
0 −𝑑 β 0 0 0 0 0 0 𝑇4,2
0 0 0 β −𝑑 0 0 0 0 𝑇2,3
• 0 0 0 −𝑑 β −𝑑 0 0 0 𝑇3,3 (n+1)

0 0 0 0 −𝑑 β 0 0 0 𝑇4,3
0 0 0 0 0 0 β −𝑑 0 𝑇2,4
0 0 0 0 0 0 −𝑑 β −𝑑 𝑇3,4
0 0 0 0 0 0 0 −𝑑 β 𝑇4,4

γ 0 0 𝑑 0 0 0 0 0 𝑇2,2 𝑇1,2 + 𝑇2,1


0 γ 0 0 𝑑 0 0 0 0 𝑇3,2 𝑇3,1
0 0 γ 0 0 𝑑 0 0 0 𝑇4,2 𝑇4,1 + 𝑇5,2
𝑑 0 0 γ 0 0 𝑑 0 0 𝑇2,3 𝑇1,3
• = 0 𝑑 0 0 γ 0 0 𝑑 0 𝑇3,3 (n+1/2) +d* 0
0 0 𝑑 0 0 γ 0 0 𝑑 𝑇4,3 𝑇5,3
0 0 0 𝑑 0 0 γ 0 0 𝑇2,4 𝑇1,4 + 𝑇2,5
0 0 0 0 𝑑 0 0 γ 0 𝑇3,4 𝑇3,5
0 0 0 0 0 𝑑 0 0 γ 𝑇4,4 𝑇4,5 + 𝑇5,4

20
• The equation is of the form A*T(n+1) = B*T(n+1/2) + C
• The A matrix shown above is a tri-diagonal matrix
• The above set of equations can be solved using Thomas Algorithm method
• Iterative methods such as Gauss-Seidel, Successive Over Relaxation (SOR)
method can also be used to solve the above set of equations.
• Let Δt = 100 s (Note: higher value chosen for illustration purposes; for
accuracy purposes use smaller value);
• Δx = l/nx = 1/4 = 0.25 m; Δy = Δx = 0.25 m.
α ∗ Δ𝑡 1 x 10−4 x 100
• Then d = ( 2) = = 0.16 <= 0.25 (note no stability criteria
Δ𝑥 0.252
required to be met)
• Here, β = 2 * (1 + d) = 2 * (1 + 0.16) = 2.32;
• γ = 2*(1-d) = 2*(1-0.16) = 1.68
• Substituting the values of d, β, γ and the initial/previous time step and
boundary conditions, we get, for n = 0,
21
𝑇2,2
2.32 −0.16 0 0 0 0 0 0 0
−0.16 2.32 −0.16 0 0 0 0 0 0 𝑇3,2
0 −0.16 2.32 0 0 0 0 0 0 𝑇4,2
0 0 0 2.32 −0.16 0 0 0 0 𝑇2,3
• 0 0 0 −0.16 2.32 −0.16 0 0 0 𝑇3,3 (1)

0 0 0 0 −0.16 2.32 0 0 0 𝑇4,3


0 0 0 0 0 0 2.32 −0.16 0 𝑇2,4
0 0 0 0 0 0 −0.16 2.32 −0.16 𝑇3,4
0 0 0 0 0 0 0 −0.16 2.32 𝑇4,4

1.68 0 0 0.16 0 0 0 0 0 185.5942 200


0 1.68 0 0 0.16 0 0 0 0 193.0372 100
0 0 1.68 0 0 0.16 0 0 0 185.5942 200
0.16 0 0 1.68 0 0 0.16 0 0 191.1164 100
• = 0 0.16 0 0 1.68 0 0 0.16 0 199.0396 (1/2) + 0.16 *
0
0 0 0.16 0 0 1.68 0 0 0.16 191.1164 100
0 0 0 0.16 0 0 1.68 0 0 185.5942 200
0 0 0 0 0.16 0 0 1.68 0 193.0372 100
0 0 0 0 0 0.16 0 0 1.68 185.5942 200
22
• Solving the above equation using TA method on MATLAB produces
the following results at first full time step, time t = Δt = 100 s.
• T2,2 = 174.0881; T3,2 = 184.4211; T4,2 = 174.0881;
• T2,3 = 184.4211; T3,3 = 196.1954; T4,3 = 184.4211;
• T2,4 = 174.0881; T3,4 = 184.4211; T4,4 = 174.0881;

23
• Likewise, we can find the temperatures at these interior nodes at
the next time step by choosing n = 1 and so on
• Graphical results are presented using MATLAB for this case.
• Using MATLAB or other software, we can develop codes for a general
case where the number of grid spacings and time steps can be altered
as desired and solutions obtained accordingly.

24
Summary
In this video,
• We presented a 2D transient heat conduction problem
• The temperature at each of the 4 sides of the square copper plate is fixed.
• The initial temperature in the domain is known.
• We discretized our domain and solved the problem using (ADI) Finite difference
method
• Note ADI method is an implicit method and is unconditionally stable
• We varied the grid spacings and time steps and presented the results graphically
using MATLAB
• In future videos, we can explore more challenging problems.

25

You might also like