Finite Difference Solutions of Heat Conduction Problem ... · The two dimensional heat conduction...
Transcript of Finite Difference Solutions of Heat Conduction Problem ... · The two dimensional heat conduction...
Finite Difference Solutions of Heat Conduction Problem with
Dirichlet and Neumann Boundary Conditions
1Dr. M.V.Shyla, 2Dr. H. Girija Bai, 3Mrs. M. Prasanna Jeyanthi
1,2,3 Asst. Professor, Department of Mathematics,
Sathyabama Institute of Science and Technology,
Chennai-600 119, Tamil Nadu, India
[email protected] , [email protected], [email protected]
ABSTRACT
This study discusses the application of Dirichlet and Neumann Boundary conditions for unsteady state heat
flow problem in the square domain using finite difference methods namely Locally One Dimensional Method and
Peacemann Rachford ADI method. Grid validation is performed. A program written in C language by the authors is used to solve the problem. Numerical results are presented and are found to be in good agreement with the physics
of the problem.
Key words: Finite difference method, LOD method, Peacemann Rachford ADI method, heat conduction.
1. INTRODUCTION
Numerical computation is an active area of research because of the wide engineering and physical
applications of Differential equations. Various finite difference methods which involve reasonable computation cost
with satisfactory results of higher order are developed [1-21]. Though new difference schemes are presented
constantly, it is observed that oldest finite difference methods are used in practical computations extensively. This
paper is concerned with the numerical solution of two dimensional heat conduction equation in a square domain
under unsteady state with Dirichlet and Neumann boundary conditions using locally one dimensional explicit and
implicit finite difference scheme and Peacemann Rachford ADI finite difference scheme. A program written in C
language by the authors is used to solve system of simultaneous equations derived from these finite difference
methods.
The paper is organized as follows. The brief introduction to the proposed problem is presented in section1.
Mathematical formulation of the proposed problem is presented in section2. Section3 is devoted to illustration of
Finite difference methods namely LOD explicit and implicit scheme along with ADI scheme under Dirichlet and
Neumann boundary conditions. Section 4 discusses the results elaborately.
2. MATHEMATICAL MODEL
The two dimensional heat conduction equation is given by
𝜕𝑢
𝜕𝑡=
𝜕2𝑢
𝜕𝑥12 +
𝜕2𝑢
𝜕𝑥22 (1)
It is considered in the unit square bounded by sides x1=0, x 1=1, x 2=0, x 2=1.
The initial condition is given by u(x1, x 2) = sin πx1 sin πx2 ; 0 ≤ x1, x2 ≤ 1 ; t=0 (2)
Case (i) Dirichlet boundary condition
u=300°K at x1=0 , t > 0
u=400°K at x1=1 , t > 0
u=325°K at x 2=0, t > 0 (3)
u=420°K at x 2=1, t > 0
International Journal of Pure and Applied MathematicsVolume 119 No. 15 2018, 1233-1242ISSN: 1314-3395 (on-line version)url: http://www.acadpubl.eu/hub/Special Issue http://www.acadpubl.eu/hub/
1233
Case (ii) Neumann boundary condition
𝜕𝑢
𝜕𝑥1=0 at x1=0, t > 0
𝜕𝑢
𝜕𝑥1=-2 at x1=1, t > 0 (4)
u=325°K at x 2=0, t > 0
u=400°K at x 2=1, t > 0
3. FINITE DIFFERENCE METHODS
25 points along x1 and x2 directions are considered. Hence temperature is calculated at 576 grid points by taking h=1/25 and r=1/3 with each time step k=1/1875 so that stability is ensured with r = 1/3.
3.1 Locally One Dimensional Method
The partial differential equation is split in such a way that the split equations are in one dimension. Solving the
equations arising out of such splitting either by explicit or by implicit method, the required values are obtained. The
method is illustrated with respect to the equation 𝜕𝑢
𝜕𝑡=
𝜕2𝑢
𝜕𝑥12 +
𝜕2𝑢
𝜕𝑥22
The split equations are the following pair of equations namely 1
2
𝜕𝑢
𝜕𝑡=
𝜕2𝑢
𝜕𝑥22 ,
1
2
𝜕𝑢
𝜕𝑡=
𝜕2𝑢
𝜕𝑥12 (5)
3.2 LOD Explicit Method
The explicit discretizations of these 2 equations are as follows
𝑢𝑖 ,𝑗
𝑛+1
2 = 1 − 2𝑟 𝑢𝑖 ,𝑗𝑛 + 𝑟(𝑢𝑖 ,𝑗+1
𝑛 + 𝑢𝑖 ,𝑗−1𝑛 ) (6)
𝑢𝑖 ,𝑗𝑛+1 = 1 − 2𝑟 𝑢
𝑖 ,𝑗
𝑛+1
2 + 𝑟(𝑢𝑖 ,𝑗+1
𝑛+1
2 + 𝑢𝑖 ,𝑗−1
𝑛+1
2 ) (7)
The first splitting is considered and values of u are calculated using (6) at the half step (n+1/2). Then
introducing the intermediate boundary conditions only in the x2 direction.
𝑢𝑖 ,𝑗
𝑛+12 = (1 + 𝑟𝛿𝑥2
2 ) 𝑔𝑖 ,𝑗𝑛
𝑢0,𝑗
𝑛+12 = 𝑔0,𝑗
𝑛 + 𝑟[𝑔0,𝑗+1𝑛 − 2 𝑔0,𝑗
𝑛 + 𝑔0,𝑗−1𝑛 ]
𝑢25,𝑗
𝑛+12 = 𝑔25,𝑗
𝑛 + 𝑟[𝑔25,𝑗+1𝑛 − 2 𝑔25,𝑗
𝑛 + 𝑔25,𝑗−1𝑛 ]
Where 𝑔𝑖 ,𝑗𝑛 𝑎𝑟𝑒 𝑡ℎ𝑒 𝑖𝑛𝑖𝑡𝑖𝑎𝑙 𝑣𝑎𝑙𝑢𝑒𝑠 (8)
At t = 0, 𝑢𝑖 ,𝑗
12 = 1 − 2𝑟 𝑢𝑖 ,𝑗
0 + 𝑟 𝑢𝑖 ,𝑗+10 + 𝑟 𝑢𝑖 ,𝑗−1
0
At t > 0 𝑢𝑖 ,1
𝑛+ 1 2 = 1 − 2𝑟 𝑢𝑖 ,1𝑛 + 𝑟 𝑢𝑖 ,2
𝑛 + 𝑟(325)
When j = 2 to 23 and for i = 1 to 24
𝑢𝑖 ,𝑗
𝑛+ 1 2 = 1 − 2𝑟 𝑢𝑖 ,𝑗𝑛 + 𝑟 𝑢𝑖 ,𝑗+1
𝑛 + 𝑟 𝑢𝑖 ,𝑗−1𝑛
When j = 24 and when i varies from 1 to 24
𝑢𝑖 ,24
𝑛+ 1 2 = 1 − 2𝑟 𝑢𝑖 ,24𝑛 + 𝑟 𝑢𝑖 ,23
𝑛 + 𝑟(420)
At last second splitting equation is used to calculate values of u at all interior points in the main step to
move from n+1/2 to n+1.
At t = 0, 𝑢𝑖 ,𝑗1 = 1 − 2𝑟 𝑢
𝑖 ,𝑗
12 + 𝑟 𝑢
𝑖+1,𝑗
12 + 𝑟 𝑢
𝑖−1,𝑗
12
International Journal of Pure and Applied Mathematics Special Issue
1234
At t>0 ,When i = 1 & j = 1 to 24, 𝑢𝑖 ,1𝑛+ 1 = 1 − 2𝑟 𝑢
𝑖 ,𝑗
𝑛+ 1 2 + 𝑟 𝑢2,𝑗
𝑛+ 1 2 + 𝑟(300)
When i = 2 to 23 & j = 1 to 24, 𝑢𝑖 ,𝑗𝑛+1 = 1 − 2𝑟 𝑢
𝑖 ,𝑗
𝑛+ 1 2 + 𝑟 𝑢𝑖+1,𝑗
𝑛+ 1 2 + 𝑟 𝑢𝑖−1,𝑗
𝑛+ 1 2 (9)
When j = 1 to 24 and i = 24, 𝑢24,𝑗𝑛+1 = 1 − 2𝑟 𝑢
24,𝑗
𝑛+ 1 2 + 𝑟 𝑢23,𝑗
𝑛+ 1 2 + 𝑟 (400)
Thereby one time step is calculated. The problem is solved with the help of the program written in C language.
3.3 LOD Implicit Method
The implicit discretizations of 2 split equations are as follows
1 + 𝑟 𝑢𝑖 ,𝑗
𝑛+1
2 − 𝑟
2𝑢
𝑖 ,𝑗+1
𝑛+1
2 − 𝑟
2𝑢𝑖 ,𝑗−1
𝑛+1
2 = 1 − 𝑟 𝑢𝑖 ,𝑗𝑛 +
𝑟
2𝑢𝑖 ,𝑗+1
𝑛 +𝑟
2𝑢𝑖 ,𝑗−1
𝑛 (10)
1 + 𝑟 𝑢𝑖 ,𝑗𝑛+1 −
𝑟
2𝑢𝑖+1,𝑗
𝑛+1 − 𝑟
2𝑢𝑖−1,𝑗
𝑛+1 = 1 − 𝑟 𝑢𝑖 ,𝑗
𝑛+1
2 +𝑟
2𝑢𝑖+1,𝑗
𝑛+1
2 +𝑟
2𝑢𝑖−1,𝑗
𝑛+1
2 (11)
In stage 1, values are initialized as zero at all interior points. In the next stage boundary conditions are used to
obtain values on the boundary. The temperature to be obtained at each time step is carried out in two steps. First the
temperature at half time step (n+1/2)k using the first split equation (8) where a system of equations are obtained.
Next the second split equation is used to calculate the temperature in the remaining half step (n+1)k.
3.4 ADI Method
Alternating Direction Implicit methods are two step methods involving the solution of tridiagonal system of
equations along lines parallel to x1 and x2 axes at the first and step respectively. The split equations are given by
1 + 𝑟 𝑢𝑖 ,𝑗
𝑛+1
2 − 𝑟
2𝑢
𝑖+1,𝑗
𝑛+1
2 − 𝑟
2𝑢𝑖−1,𝑗
𝑛+1
2 = 1 − 𝑟 𝑢𝑖 ,𝑗𝑛 +
𝑟
2𝑢𝑖 ,𝑗+1
𝑛 +𝑟
2𝑢𝑖 ,𝑗−1
𝑛 (12)
1 + 𝑟 𝑢𝑖 ,𝑗𝑛+1 −
𝑟
2𝑢𝑖 ,𝑗+1
𝑛+1 − 𝑟
2𝑢𝑖 ,𝑗−1
𝑛+1 = 1 − 𝑟 𝑢𝑖 ,𝑗
𝑛+1
2 +𝑟
2𝑢𝑖+1,𝑗
𝑛+1
2 +𝑟
2𝑢𝑖−1,𝑗
𝑛+1
2 (13)
4. STABILITY ANALYSIS
Stability analysis is performed using Von Neumann method where r = k/h2 with h and k being the grid
spacing in space and time directions respectively.
LOD Explicit Scheme: 0 < r ≤ ½
LOD Implicit Scheme: r ≥ 0
ADI METHOD: For N-dimensional, the stability condition is given by ≤ 𝑁
2 . Hence for 2 dimensional the condition
is r≤ 1
5. RESULTS AND DISCUSSION
The given Dirichlet problem is solved by LOD explicit, LOD implicit and ADI methods by taking h=1//6,
k=.00925, r=1/3 and later with h=1/25, k=0.000533 and r=1/3. A steady solution is obtained at t=0.6475 for LOD
explicit method, t=0.777 for LOD implicit method and t=0.74 for ADI method in both cases when h=1/6 and h=1/25. This was because the physical phenomena do not change by varying the space step. Therefore this problem
could be discussed by taking h=1/6, k=0.00925 and r=1/3 for convenience as seen in Table (1-4) and Figure (1-2).
Temperature distribution at different time steps is presented in Figure 4. The temperature distribution at a centre
point of the region under consideration at various time levels using various methods are tabulated in Table 3. From
the graph shown in Figure 1 and Figure 2 it is clear that whether we use LOD explicit method or LOD implicit
method they yield the same solution. Therefore it can be said that an explicit scheme is itself sufficient. A graph is
drawn to observe the temperature distribution along the centre of the plate (Fig. 2). It is clear from the graph that
temperature increases as time increases. Physically this should happen, as initially the entire plate has been kept at a
temperature in the interval (0,1) and suddenly the temperature at the four edges were increased and kept at the
increased temperature. The temperature distribution in the entire plate at t=0.777 is tabulated. The results tell us the
fact that temperature lies within the boundary temperature between 300°K and 400°K.
In Neumann problem the boundary x1=0 is insulated. The solution is found out by LOD explicit method,
LOD implicit method and ADI method as seen in Table (5-8). The temperature distribution graph in Fig. 3 shows
that there is a decrease of temperature from the left to right indicating that there is a dissipation of temperature at the
International Journal of Pure and Applied Mathematics Special Issue
1235
boundary x1=1 as the boundary condition 𝜕𝑢
𝜕𝑥1=-2 at x1=1 , t > 0 has been imposed. The negative sign indicates the
dissipation of temperature at the boundary x1=1 when t>0 from the plate to the surrounding.
The problem is solved taking two different step sizes into consideration namely h=1/6 and h=1/25. It is
inferred that steady state solution is obtained after a lapse of same time, t=1.221 using two different mesh size.
Hence the graphs and tables are drawn for the case h=1/6 only. However if the temperature at more number of
interior points, smaller step size can be chosen instead of employing some known interpolation procedure to
evaluate the temperature at some more equally spaced points.
TABLE 1 Temperature distribution in a plate – LOD explicit scheme- Dirichlet boundary conditions
420˚k
i=0 i=1 i=2 i=3 i=4 i=5 i=6 j=6
j=5
j=4
j=3
j=2
j=1
j=0
x2=1
352.01 384.43 395.95 401.93 402.84
40
0˚k
30
0˚k
332.88 358.72 375.89 386.64 394.14
323.63 344.22 360.75 374.46 387.21
318.49 334.75 348.62 362.68 379.75
316.51 328.80 337.02 346.30 367.33
x1=0 325˚k x1=1 TABLE 2 Temperature distribution in a plate – LOD implicit scheme- Dirichlet boundary conditions
420˚k
i=0 i=1 i=2 i=3 i=4 i=5 i=6 j=6
j=5
j=4
j=3
j=2
j=1
j=0
x2=1
354.11 381.93 394.45 400.80 402.83
40
0˚k
30
0˚k
334.50 359.15 375.08 385.92 393.85
324.75 345.09 360.81 373.94 386.64
319.42 335.64 349.14 363.41 378.76
317.29 328.91 337.71 347.78 366.01
x1=0 325˚k x1=1 TABLE 3 Temperature distribution at a centre point – Dirichlet boundary conditions
(No. of iterations)
Temperature
LOD- EXPLICIT LOD-IMPLICIT ADI
20 344.76 319.97 310.10
40 360.37 358.23 310.20
60 360.74 360.65 310.75
International Journal of Pure and Applied Mathematics Special Issue
1236
80 360.75 360.81 310.77
100 360.75 360.82 310.77 TABLE 4 Temperature distribution along the centre line x2 = 0.5 – Dirichlet problem (At t = 0.777)
Position Temperature
LOD- EXPLICIT LOD-IMPLICIT ADI
U11 323.63 324.75 306.27
U12 344.22 345.09 308.37
U13 360.75 360.82 310.77
U14 374.46 373.95 317.79
U15 387.21 386.64 340.55 TABLE 5 Temperature distribution in a plate – LOD implicit scheme- Neumann boundary conditions
400˚k
i=0 i=1 i=2 i=3 i=4 i=5 i=6 j=6
j=5
j=4
j=3
j=2
j=1
j=0
x2=1
387.43 387.41 387.37 387.28 387.11
𝜕𝑢
𝜕𝑥
1=
−2
𝜕𝑢
𝜕𝑥
1=
0
374.88 374.84 374.77 374.65 374.43
362.36 362.32 362.24 362.10 361.83
349.87 349.84 349.77 349.65 349.43
337.43 337.41 337.36 337.28 337.11
x1=0 325˚k x1=1
TABLE 6 Temperature distribution in a plate – ADI method - Neumann boundary conditions
400˚k
i=0 i=1 i=2 i=3 i=4 i=5 i=6 j=6
j=5
j=4
j=3
j=2
j=1
j=0
x2=1
387.43 387.41 387.37 387.29 387.14
𝜕𝑢
𝜕𝑥
1=
−2
𝜕𝑢
𝜕𝑥
1=
0
374.88 374.85 374.78 374.66 374.45
362.36 362.33 362.25 362.12 362.89
349.88 349.85 349.78 349.66 349.45
337.43 337.41 337.37 337.29 337.14
x1=0 325˚k x1=1
International Journal of Pure and Applied Mathematics Special Issue
1237
TABLE 7 Temperature distribution at a centre point – Neumann boundary conditions (At t = 1.43375)
Time (No. of iterations)
Temperature
LOD- EXPLICIT LOD-IMPLICIT ADI
30 332.33 301.85 300.09
60 360.45 354.80 354.59
90 362.15 361.33 361.31
120 362.26 362.14 362.14
150 362.26 362.24 362.25
180 362.26 362.25 362.26
TABLE 8 Temperature distribution along the centre line x2 = 0.5 – Neumann problem
Position Temperature
LOD- EXPLICIT LOD-IMPLICIT ADI
U11 362.38 362.36 362.37
U12 362.34 362.33 362.34
U13 362.26 362.25 362.26
U14 362.12 362.11 362.12
U15 361.89 361.88 361.90
Fig. 1. Temperature distribution of Dirichlet problem
Fig. 2. Steady state temperature distribution along x2=0.5 for Dirichlet Problem
0 10 20 30 40 50 60 70 80 90 1000
50
100
150
200
250
300
350
400Temparature distribution of Dirichlet problem
LOD Explicit
LOD Implicit
ADI
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9320
330
340
350
360
370
380
390
Position
Tem
para
ture
Steady state temparature distribution along x2=0.5
LOD Explicit
LOD Implicit
International Journal of Pure and Applied Mathematics Special Issue
1238
Fig.3. Temperature distribution of Neumann boundary condition
Fig4.(a) Fig4.(b)
Fig4.(c) Fig4.(d)
Fig4. Temperature distribution of Dirichlet problem at time (a) t=0 (b) t=1 (c) t=3 (d) t=6
0 10 20 30 40 50 60 70 80 90 1000
50
100
150
200
250
300
350
400
Position
Tem
para
ture
Temparature distribution of Neumann boundary condition
LOD Explicit
LOD Implicit
ADI
International Journal of Pure and Applied Mathematics Special Issue
1239
6. CONCLUSION
In this study, an attempt has been made to understand intricases of various finite difference methods namely Locally One Dimensional explicit method, LOD implicit method and Peacemann-Rachford ADI methods
and the results are compared. The same differential equation under 3 different types of boundary conditions namely
Dirichlet and Neumann are studied.
In the Dirichlet problem, it is observed that there is an increase in temperature as time increases. In the
Neumann problem there is a dissipation of temperature at the boundary x1=1.
This procedure can be extended to solve the problems for h=1/n, where n is large for an irregular region. It
may be of interest and left for further studies.
ACKNOWLEDGEMENT
Our gratitude to Dr. J.Pandurangan, Former Professor and Head, Department of Mathematics, Anna
University for his valuable suggestions and guidance.
REFERENCE:
[1] Chuan Li , Shan Zhao, “A matched Peaceman–Rachford ADI method for solving parabolic interface
problems,” Applied Mathematics and Computation, Vol. 299, 28–44, 2017.
[2] L. Adams, Z.L. Li, “The immersed interface/multigrid methods for interface problems”, SIAM J. Sci. Comput. Vol. 24,
463–479, 2002.
[3] C. Attanayake, D. Senaratne, “Convergence of an immersed finite element method for semilinear parabolic interface
problems,” Appl. Math. Sci., Vol. 5, 135–147, 2011.
[4] P.W. Bates, Z. Chen, Y.H. Sun, G.W. Wei , S. Zhao, “Geometric and potential driving formation and evolution of
biomolecular surfaces,” J. Math. Biol., Vol. 59, 193–231, 2009.
[5] F. Bouchon, G.H. Peichl, “An immersed interface technique for the numerical solution of the heat equation on a moving
domain, in: G. Kreiss, et al. (Eds.)”, Numerical Mathematics and Advanced Applications 2009, Springer, pp.181–189,
2010
[6] F. Bouchon, G.H. Peichl, “The immersed interface technique for parabolic problems with mixed boundary conditions”,
SIAM J. Numer. Anal., Vol 48, 2247–2266, 2010.
[7] Z. Chen, J. Zou, “Finite element methods and their convergence for elliptic and parabolic interface problems”, Numer.
Math., Vol. 79, 175–202, 1998.
[8] J. Douglas Jr., “On the numerical integration of ∂ 2 u ∂x 2 + ∂ 2 u ∂y 2 = ∂u ∂t by implicit methods”, J. Soc. Ind. Appl.
Math., Vol. 3, 42–65, 1955.
[9] J. Douglas Jr., D. Peaceman, “Numerical solution of two-dimensional heat flow problems”, Am. Inst. Chem. Eng. J.,
Vol. 1, 505–512, 1955.
[10] G. Horton, S. Vandewalle, “A space-time multigrid method for parabolic partial differential equations”, SIAM J. Sci.
Comput., Vol. 16, 848–864, 1995.
[11] J.D. Kandilarov, L.G. Vulkov, “The immersed interface method for a nonlinear chemical diffusion equation with local
sites of reactions”, Numer. Algo- rithms, Vol. 36, 285–307, 2004.
[12] J. Liu , Z. Zheng , “IIM-based ADI finite difference scheme for nonlinear convection-diffusion equations with
interfaces”, Appl. Math. Model. Vol.37, 1196–1207, 2013 .
[13] J. Liu , Z. Zheng, “A dimension by dimension splitting immersed interface method for heat conduction equation with
interfaces”, J. Comput. Appl. Math., Vol. 261, 221–231, 2014.
[14] D. Peaceman, H. Rachford, “The numerical solution of parabolic and elliptic equations”, J. Soc. Ind. Appl. Math. Vol.3,
28–41, 1955.
[15] R.K. Sinha, B. Deka, “Finite element methods for semilinear elliptic and parabolic interface problems”, Appl. Numer.
Math., Vol. 59, 1870–1883, 2009.
[16] W. Tian, S. Zhao, “A fast ADI algorithm for geometric flow equations in biomolecular surface generation”, Int. J.
Numer. Methods Biomed. Eng., Vol. 30, 490–516, 2014.
[17] S.Q. Wang, R. Samulyak, T.F. Guo, “An embedded boundary method for elliptic and parabolic problems with
interfaces and application to multi-material systems with phase transitions”, Acta Math. Sci., Vol. 30, 499–521, 2010.
International Journal of Pure and Applied Mathematics Special Issue
1240
[18] S. Zhao, “Operator splitting ADI schemes for pseudo-time coupled nonlinear solvation simulations”, J. Comput. Phys.,
Vol. 257, 1000–1021, 2014.
[19] S. Zhao, “A matched alternating direction implicit (ADI) method for solving the heat equation with interfaces”, J. Sci.
Comput., Vol. 63, 118–137, 2015.
[20] A.R. Mitchell, “Computational Methods in Partial Differential Equations” , John Wiley and Sons.
[21] G.D. Smith, “Numerical Solution of Partial Differential Equations” , London Oxford University Press.
International Journal of Pure and Applied Mathematics Special Issue
1241
1242