Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 17

Hanifrahmawan Sudibyo, S.T., M.Eng.

Symmetry of the problem

koefisien koefisien

m = 0  slab
m = 1 cylinder
m = 2  sphere
 Input initial condition:

 Input boundary condition:

 Matrice p represents the value of boundary condition


 Matrice q represents the form of boundary condition;
differential (q = 1) or ordinary form (q = 0)
𝜕 2 𝐶𝐵 𝜕𝐶𝐵
𝐷𝐵 . − 𝑘. 𝐶𝐴 . 𝐶𝐵 = 𝑣𝑍 .
𝜕𝑦 2 𝜕𝑧

𝜕 2 𝐶𝐴 𝜕𝐶𝐴
𝐷𝐴 . − 𝑘. 𝐶𝐴 . 𝐶𝐵 = 𝑣𝑍 .
𝜕𝑦 2 𝜕𝑧

Reaction:
TDB + SO3  product ; A + B  product
r = k.CA.CB

Boundary condition:
 Pada z = 0  CA = CA0 dan CB = 0
𝜕𝐶𝐴 𝜕𝐶𝐵
 Pada y = 0  = 0 dan =0
𝜕𝑦 𝜕𝑦
𝜕𝐶 𝑟 𝜕𝐶𝐵 𝑁𝐵 −𝑟𝐵 .𝛿
 Pada y = 𝛿  𝜕𝑦𝐴 = − 𝐷𝐴 . 𝛿 dan =−
𝐴 𝜕𝑦 𝐷𝐵
Hanifrahmawan Sudibyo, S.T., M.Eng.
𝜕2𝑇 ℎ 𝜌. 𝐶𝑃 𝜕𝑇 1 𝜕𝑇
Partial differential equation: − 4. . 𝑇 − 𝑇𝑈 = . = .
𝜕𝑧 2 𝑘. 𝐷 𝑘 𝜕𝑡 𝛼 𝜕𝑡

𝝏𝟐 𝑻 𝜶. 𝒉 𝝏𝑻
𝜶. 𝟐 − 𝟒. . 𝑻 − 𝑻𝑼 =
𝝏𝒛 𝒌. 𝑫 𝝏𝒕

• When t = 0, T = Tu = 30oC

• When t = t,

1). At z = 0, T = 400oC
𝜕𝑇
2). Case 1 : At z = L, 𝜕𝑧 = 0

𝜕𝑇 ℎ
Case 2 : At z = L, 𝜕𝑧 = − 𝑘 . 𝑇𝐿 − 𝑇𝑈
𝜕2𝑇 𝛼. ℎ 𝜕𝑇 𝜕𝑇 3. 𝑇𝑁+1 − 4. 𝑇𝑁 + 𝑇𝑁−1
𝛼. 2 − 4. . 𝑇 − 𝑇𝑈 = =
𝜕𝑧 𝑘. 𝐷 𝜕𝑡 𝜕𝑧 2. ∆𝑧

𝑇𝑖+1 − 2. 𝑇𝑖 + 𝑇𝑖−1 𝛼. ℎ 𝑑𝑇
𝛼 − 4. . (𝑇 − 𝑇 ) =
∆𝑧 2 𝑘. 𝐷 𝑖 𝑈
𝑑𝑡
 And then insert the boundary condition at z =L to the equation above.
However, you need to redefine the boundary condition into matrice
form.
𝜕𝑇 3. 𝑇𝑁+1 − 4. 𝑇𝑁 + 𝑇𝑁−1
At z = L, =0 0=
2. ∆𝑧
𝜕𝑧
𝜕𝑇 ℎ
At z = L, = − . 𝑇𝐿 − 𝑇𝑈 4. 𝑇𝑁 − 𝑇𝑁−1
𝜕𝑧 𝑘 𝑇𝑁+1 =
3
2. ℎ. ∆𝑧 4. 𝑇𝑁 − 𝑇𝑁−1
𝑇𝑁+1 =− . 𝑇𝑁 − 𝑇𝑈 +
3. 𝑘 3
Z=0 Z=L

i=1 i=N
2 3 …

4. 𝑇𝑁 − 𝑇𝑁−1 “i = N+1 is out of system so that we need to redefine”


𝑇𝑁+1 =
3
𝜕𝑇 𝑇𝑖+1 − 2. 𝑇𝑖 + 𝑇𝑖−1 𝛼. ℎ 𝑑𝑇
At z = L ( i=N ), =0 − 4. . (𝑇 − 𝑇𝑈 ) =
𝜕𝑧
∆𝑧 2 𝑘. 𝐷 𝑖 𝑑𝑡

𝜕𝑇 ℎ
At z = L ( i=N ), = − . 𝑇𝐿 − 𝑇𝑈
𝜕𝑧 𝑘

2. ℎ. ∆𝑧 4. 𝑇𝑁 − 𝑇𝑁−1
𝑇𝑁+1 =− . 𝑇𝑁 − 𝑇𝑈 +
3. 𝑘 3
 Main program: solve ordinary differential equation using
ode15s or ode 45
 Subroutine (t as i.v. and T as d.v.) :
 Inputting the differential equation BASED ON the defined
boundary condition.
4. 𝑇𝑁 − 𝑇𝑁−1
𝑇𝑁+1 =
 The differential equation will have 3 forms: 3

𝑑𝑇
o 1st form: for i = 0  T = Ts  =0 2. ℎ. ∆𝑧 4. 𝑇𝑁 − 𝑇𝑁−1
𝑑𝑡 𝑇𝑁+1 = − . 𝑇𝑁 − 𝑇𝑈 +
3. 𝑘 3

𝑇𝑖+1 − 2. 𝑇𝑖 + 𝑇𝑖−1 𝛼. ℎ 𝑑𝑇
o 2nd form: for i = N 𝛼 − 4. . (𝑇 − 𝑇 ) =
∆𝑧 2 𝑘. 𝐷 𝑖 𝑈
𝑑𝑡

o 3rd form: for other i (i = 1 until i = N-1)

𝑇𝑖+1 − 2. 𝑇𝑖 + 𝑇𝑖−1 𝛼. ℎ 𝑑𝑇
𝛼 − 4. . (𝑇 − 𝑇 ) =
∆𝑧 2 𝑘. 𝐷 𝑖 𝑈
𝑑𝑡
Hanifrahmawan Sudibyo, S.T., M.Eng.
 Partial differential equation:

𝑇𝑖,𝑗+1 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗−1 𝑇𝑖+1,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖−1,𝑗 𝑇𝑖+1,𝑗 − 𝑇𝑖−1,𝑗 𝑣𝑍 𝑇𝑖,𝑗+1 − 𝑇𝑖,𝑗−1 1 𝑑𝑇
+ + − =
∆𝑧 2 ∆𝑟 2 2∆𝑟 𝛼 2∆𝑧 𝛼 𝑑𝑡

 Radius refers to i and axial distance refers to j


 Boundary conditions:
r = R i = Nr

r=0 i=0
j = Nz
j=0
Z=01 2 … Z=L

 The size of matrix will be Nr x Nz. Meanwhile, ode45 or ode15s


can only solve differential with single matrix column.

 The reshape will create new matrix with the number of row
equal to Nr x Nz and have only ONE COLUMN.
𝑇𝑖,𝑗+1 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗−1 𝑇𝑖+1,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖−1,𝑗 1 𝑇𝑖+1,𝑗 − 𝑇𝑖−1,𝑗 𝑣𝑍 𝑇𝑖,𝑗+1 − 𝑇𝑖,𝑗−1 1 𝑑𝑇
+ + − =
∆𝑧 2 ∆𝑟 2 𝑟 2∆𝑟 𝛼 2∆𝑧 𝛼 𝑑𝑡

 For i = 1 to Nr and j =1 : T (i,j) = To


 T (i,j) = To can be stated in differential form as dT/dt = 0

 For i = Nr and j = 2 to Nz : T (i,j) = Ts


 Because i was fixed and j was in range, then dT/dz = 0

𝑇𝑠 − 2𝑇𝑖−1,𝑗 + 𝑇𝑖−2,𝑗 𝑇𝑖+1,𝑗 − 𝑇𝑖−1,𝑗 1 𝑑𝑇


0+ + − 0 =
∆𝑟 2 2∆𝑟 𝛼 𝑑𝑡
𝑇𝑖,𝑗+1 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗−1 𝑇𝑖+1,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖−1,𝑗 1 𝑇𝑖+1,𝑗 − 𝑇𝑖−1,𝑗 𝑣𝑍 𝑇𝑖,𝑗+1 − 𝑇𝑖,𝑗−1 1 𝑑𝑇
+ + − =
∆𝑧 2 ∆𝑟 2 𝑟 2∆𝑟 𝛼 2∆𝑧 𝛼 𝑑𝑡

 For i = 2 to Nr-1 and j = Nz :

𝑇𝑖,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗−2 𝑇𝑖+1,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖−1,𝑗 1 𝑇𝑖+1,𝑗 − 𝑇𝑖−1,𝑗 1 𝑑𝑇


+ + − 0 =
∆𝑧 2 ∆𝑟 2 𝑟 2∆𝑟 𝛼 𝑑𝑡
𝑇𝑖,𝑗+1 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗−1 𝑇𝑖+1,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖−1,𝑗 𝑇𝑖+1,𝑗 − 𝑇𝑖−1,𝑗 𝑣𝑍 𝑇𝑖,𝑗+1 − 𝑇𝑖,𝑗−1 1 𝑑𝑇
+ + − =
∆𝑧 2 ∆𝑟 2 2∆𝑟 𝛼 2∆𝑧 𝛼 𝑑𝑡

𝑇𝑖+1,𝑗 − 𝑇𝑖,𝑗
 For i = 1 and j = 2 to Nz-1 : =0
∆𝑟

𝑇𝑖,𝑗+1 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗−1 𝑇𝑖+2,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗 𝑣𝑍 𝑇𝑖,𝑗+1 − 𝑇𝑖,𝑗−1 1 𝑑𝑇


+ +0− =
∆𝑧 2 ∆𝑟 2 𝛼 2∆𝑧 𝛼 𝑑𝑡
𝑇𝑖,𝑗+1 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗−1 𝑇𝑖+1,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖−1,𝑗 1 𝑇𝑖+1,𝑗 − 𝑇𝑖−1,𝑗 𝑣𝑍 𝑇𝑖,𝑗+1 − 𝑇𝑖,𝑗−1 1 𝑑𝑇
+ + − =
∆𝑧 2 ∆𝑟 2 𝑟 2∆𝑟 𝛼 2∆𝑧 𝛼 𝑑𝑡

 For i = 1 to Nr and j =1 : dT/dt = 0

 For i = Nr and j = 1 to Nz :

𝑇𝑠 − 2𝑇𝑖−1,𝑗 + 𝑇𝑖−2,𝑗 𝑇𝑖+1,𝑗 − 𝑇𝑖−1,𝑗 1 𝑑𝑇


0+ + − 0 =
∆𝑟 2 2∆𝑟 𝛼 𝑑𝑡
 For i = 1 to Nr and j = Nz :

𝑇𝑖,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗−2 𝑇𝑖+1,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖−1,𝑗 1 𝑇𝑖+1,𝑗 − 𝑇𝑖−1,𝑗 1 𝑑𝑇


+ + − 0 =
∆𝑧 2 ∆𝑟 2 𝑟 2∆𝑟 𝛼 𝑑𝑡

 For i = 1 and j = 1 to Nz :

𝑇𝑖,𝑗+1 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗−1 𝑇𝑖+2,𝑗 − 2𝑇𝑖,𝑗 + 𝑇𝑖,𝑗 𝑣𝑍 𝑇𝑖,𝑗+1 − 𝑇𝑖,𝑗−1 1 𝑑𝑇


+ + 0 − =
∆𝑧 2 ∆𝑟 2 𝛼 2∆𝑧 𝛼 𝑑𝑡

You might also like