A Numerical Solution of Heat Equation for Several Thermal Diffusivity Using Finite Difference Scheme with Stability Conditions

Abstract

The heat equation is a second-order parabolic partial differential equation, which can be solved in many ways using numerical methods. This paper provides a numerical solution that uses the finite difference method like the explicit center difference method. The forward time and centered space (FTCS) is used to a problem containing the one-dimensional heat equation and the stability condition of the scheme is reported with different thermal conductivity of different materials. In this study, results obtained for different thermal conductivity of distinct materials are compared. Also, the results reveal the well-behavior properties of the materials in good agreement.

Share and Cite:

Loskor, W. and Sarkar, R. (2022) A Numerical Solution of Heat Equation for Several Thermal Diffusivity Using Finite Difference Scheme with Stability Conditions. Journal of Applied Mathematics and Physics, 10, 449-465. doi: 10.4236/jamp.2022.102034.

1. Introduction

Heat propagation in a continuous medium, such as a solid, liquid, or gas, is described by the heat equation, which is a partial differential equation. It is the basic mathematical theory of thermal conductivity. In other words, the heat equation narrates the distribution of heat (or temperature fluctuation) in a particular area over time.

The one-dimensional heat equation solution is crucial since it appears often in numerous scientific and engineering applications. Also, the matter of simulation techniques of the heat equation has become an interesting area within the sector of numerical solution methods. Many scientific groups are involved in handling the matter of numerical simulation of heat flow [1]. [2] provides a numerical solution for transient thermal distribution in a portion where chemical, electrical, or nuclear energy is transformed into thermal energy. [3] used an exponential-sinusoidal one-dimensional analytical model to define the temperature property, demonstrating that the heat equation can still be solved analytically. [4] solved one-dimensional transient heat transport during a compound slab using a natural analytical technique. He investigated the transient response of one-dimensional multilayered compound conduction slabs to rapid temperature changes in the surrounding fluid. [1] provided a completely unique analytical approach utilized to solve the transient heat conduction equation in a one-dimensional hollow compound cylinder with time-dependent boundary conditions. In [5], the stability analysis of a one-dimensional heat equation is presented. They investigated the analytical solution of heat equation as an initial value problem in infinite space. It’s found that centered difference schemes (CNS) are more efficient and accurate solutions than explicit centered difference schemes (ECDS) in terms of time step selection for this equation. In [6], they build and validate mathematical models and numerical algorithms for the simulation of heat transfer in composite materials. The problem’s key characteristics are the heat source’s dependency on the solution, discontinuous diffusion coefficients, and nonlinear convection and radiation boundary conditions. This [7] study proposes a novel technique for solving diffusion and heat equations that combines the variation iterative method with an integral transform similar to the Sumudu transform. The method is accurate and efficient in the generation of approximate solutions for partial differential equations, it says. This [8] paper proposes a numerical technique to obtain the solution for the heat conduction equation of Copper. It says Copper is highly able to conduct heat and electrical conductivity. The results indicate that the finite difference method is highly effective for obtaining approximate solutions of thermal conductivity equations for Copper.

The flowing of heat through a thin rod formed of a homogenous material that is fully heated towards its length so that heat can only flow with its edges is considered in this work. Any position towards the rod is symbolized by x, and the length of the rod is symbolized by L in order that 0 x L . Therefore the temperature, u ( x , t ) of the rod at any point is a function of position, x (in meters or centimeters) and time t (in second). The heat equation is also named expansion equation.

The present study involves the implementation of a finite difference scheme for heat equation for different thermal diffusivities with stability conditions and performs a computer programming for the method to compare the efficiency and perfection of the solution for seven different thermal diffusivities for seven different materials such as Silver, Gold, Copper, Aluminum, Cast Iron, Granite and Brick materials.

1.1. Mathematical Model of Heat Equation and Analytic Solution

The heat equation is resulting from the principles of conservation of energy and Fourier’s law of cooling. The heat flow is used to identify the equation in terms of temperature measurements. The one-dimensional heat equation is a partial differential equation of second order that describes how heat moves through an object over time and written as [9],

u t = k 2 u (1)

where k = K ρ c is called the thermal diffusivity of the rod’s substance.

K = thermal conductivity of the rod’s material;

ρ = mass per unit volume of the rod;

c = the rod’s specific heat.

To find the analytic solution of the one-dimensional heat equation appended by initial and boundary conditions that formulate an initial boundary value problem (IBVP) is considered. As a result, with beginning and boundary conditions, the heat equation becomes:

u t ( x , t ) = k u x x ( x , t ) for 0 x L and t > 0 u ( x , 0 ) = f ( x ) for 0 x L u ( 0 , t ) = u ( L , t ) = 0 for t > 0 } (2)

The exact solution can be found by applying separation of variables which is described in the following.

Consider u ( x , t ) = X ( x ) T ( t ) then the heat equation becomes: X ( x ) T ( x ) = k X ( x ) T ( t ) .

Divided by k T ( t ) and X ( x ) , it implies, T ( t ) k T ( t ) = X ( x ) X ( x ) .

Let μ be a constant such that T ( t ) k T ( t ) = μ and X ( x ) X ( x ) = μ .

Or, X μ X = 0 and T μ k T = 0 (3)

Incident-I: If μ = 0 , the equation becomes X = 0 . It has a solution of general form, X ( x ) = A x + B through boundary conditions 0 = X ( 0 ) = B and 0 = X ( L ) = A L + B . So A = B = 0 , then the solution becomes a zero solution.

Incident-II: For μ = λ 2 , we get X λ 2 X = 0 , also T λ 2 k T = 0 .

Then the general solution is formulated by X ( x ) = C 1 e λ x + C 2 e λ x and T = C e λ 2 k t .

And applying the boundary conditions, 0 = X ( 0 ) = C 1 + C 2 C 1 = C 2 and 0 = X ( L ) = C 1 e λ L + C 2 e λ L . Therefore 0 = C 1 ( e λ L e λ l ) .

This indicates that C 1 = 0 , also C 2 = 0 which implies X ( x ) = 0 .

Incident-III: If μ = λ 2 then (3) becomes X + λ 2 X = 0 and T + λ 2 k T = 0 . Then the general solution of the form X ( x ) = A cos λ x + B sin λ x , also T = C e λ 2 k t with the boundary conditions X ( 0 ) = 0 which means A = 0 .

And X ( L ) = 0 becomes B sin λ L = 0 sin λ L = 0 .

Which implies λ L = n π .

This leads to λ 2 = n 2 π 2 L 2 .

Therefore X ( x ) = B sin ( n π x L ) .

Considering B = 1 , μ n = n 2 π 2 L 2 and X n ( x ) = sin ( n π x L ) .

Here μ n is an Eigen-value of the Sturn-Liouville problem and X n ( x ) is an eigenfunction.

The group of eigenvalues and eigenfunctions for n 1 to n is the entire solution to the Sturn-Liouville problem.

Therefore the solution becomes, u n ( x , t ) = e n 2 π 2 k t L 2 sin ( n π x L ) that meets the boundary conditions.

Any linear combination of two solutions is, once again, a solution.

So, u ( x , t ) = n = 1 B n e n 2 π 2 k t L 2 sin ( n π x L ) (4)

that is the solution of the heat equation. Using initial condition the coefficient Bn becomes,

u ( x , 0 ) = f ( x ) = n = 1 B n sin ( n π x L ) implies B n = 2 L 0 L f ( x ) sin ( n π x L ) d x .

As a result, Equation (4) is the heat equation’s analytic solution.

1.2. Thermal Diffusivity

The one-dimensional Heat Equation is as follows:

u t = k 2 u x 2

where k is Thermal diffusivity [10]. Thermal diffusivity is different for different materials. Thermal diffusivity is a material attribute that specifies how quickly heat flows through a substance. Thermal diffusivity measures how quickly heat moves through a substance. Materials with high thermal diffusivity quickly regulate their temperature to the temperature around them, as they conduct heat faster. The thermal diffusivity of a substance is calculated by dividing its thermal conductivity by its density and specific heat capacity at constant pressure.

k = K ρ c

where K = Thermal conductivity of the rod’s material (W/m·K).

ρ = Density or the mass of the rod per unit volume (K/m3);

c = the rod’s specific heat capacity (J/kg·K).

The denominator ρ c can be considering the volumetric heat capacity (J/m3·K).

The units of k must be: ( length ) 2 time .

Thermal diffusivity is typically measured in units of m2/s, cm2/s, mm2/s.

The thermal diffusivity is calculated using the material’s properties. Table 1 below shows typical values for thermal diffusivity.

Table 1. Value of thermal diffusivity for some materials.

1.3. Numerical Method

The explicit center finite difference technique, implicit finite difference method, and Crank-Nicolson finite difference method are three types of finite difference methods for heat equations. This paper presents the explicit center difference method, a well-known and well-understood numerical method that is required for the heat equation [11].

The finite difference approach for solving the heat equation is described next. Consider a rectangle [ 0 , L ] × [ 0 , T ] into a finite number of nodes ( x i , t n ) . The notation u i n = u ( x i , t n ) to represent the numerical solution on a finite rod x [ 0 , L ] and t [ 0 , T ] .

1.4. Finite Difference Method for the Heat Equation

The explicit centered difference scheme, which is obtained by a first-order forward difference in time and a second-order centered difference in space, is the simplest numerical discretization of the heat equation [12].

The forward difference in time: u t ( x i n ) u i n + 1 u i n Δ t .

The centered difference in space: 2 u x 2 ( x i n ) = 1 ( Δ x ) 2 [ u i 1 n 2 u i n + u i + 1 n ] .

Therefore the explicit centered difference scheme of the 1-D heat equation is

u i n + 1 u i n Δ t = k ( Δ x ) 2 [ u i 1 n 2 u i n + u i + 1 n ]

u i n + 1 = u i n + r [ u i 1 n 2 u i n + u i + 1 n ] where r = k Δ t ( Δ x ) 2

u i n + 1 = ( 1 2 r ) u i n + r [ u i 1 n + u i + 1 n ] .

Stability Condition

If 0 < r < 1 2 then the solution at the new time is a weighted average of the solution at the old time. This implies a discrete maximum principle max | u i n + 1 | max | u i n | and therefore numerical stability. The explicit centered difference scheme is stable if r < 1 2 that is k Δ t ( Δ x ) 2 < 1 2 .

2. Numerical Computations and Results

Here a computer program (code) in MATLAB Scientific programming language is developed and implement the explicit centered difference method for heat equation for some initial and Dirichlet boundary conditions. In this paper, seven different materials such as Silver, Gold, Copper, Aluminum, Cast Iron, Granite, and Brick are taken and these seven different materials will provide seven different numerical solutions. For the seven materials the values of the thermal diffusivities that is k are different which are given in Table 1. So, these different thermal diffusivities with initial and boundary conditions provide seven different one-dimensional initial-boundary value problems (IBVP). Consider the same initial and boundary condition for the described IBVP. Also, we compare these seven results and analysis the stabilities (Figure 1).

Figure 1. Initial condition for temperature distribution of heat equation for seven materials.

u ( x , 0 ) = { 0 if 0 x 50 10 if 50 x 100

and the boundary conditions:

u ( 0 , t ) = 0 for all t;

u ( 100 , t ) = 10 for all t.

Case-I

Here we take total time 5 minutes that is 300 seconds and the length of the rod is 100 cm. Total time step 12,000 and time step size, Δ t = 300 12000 = 0.025 .

The total length step 40 and space step size, Δ x = 100 40 = 2.5 .

Problem 1: we consider Silver material.

(a)(b)

Figure 2. (a) Variation of temperature distribution along rod according to length at various time steps with initial condition for Silver material. (b) Variation of temperature distribution along rod with time for Silver material.

Problem 2: we consider Gold material.

(a)(b)

Figure 3. (a) Variation of temperature distribution along rod according to length at various time steps with initial condition for Gold material. (b) Variation of temperature distribution along rod with time for Gold material.

Problem 3: we consider Copper material.

(a)(b)

Figure 4. (a) Variation of temperature distribution along rod according to length at various time steps with initial condition for Copper material. (b) Variation of temperature distribution along rod with time for Copper material.

Problem 4: we consider Aluminium material.

(a)(b)

Figure 5. (a) Variation of TEmperature distribution along rod according to length at various time steps with initial condition for Aluminium material. (b) Variation of temperature distribution along rod with time for Aluminium material.

Problem 5: we consider Cast Iron material.

(a)(b)

Figure 6. (a) Variation of temperature distribution along rod according to length at various time steps with initial condition for Cast Iron material. (b) Variation of temperature distribution along rod with time for Cast Iron material.

Problem 6: we consider Granite material.

(a)(b)

Figure 7. (a) Variation of temperature distribution along rod according to length at various time steps with initial condition for Granite material. (b) Variation of temperature distribution along rod with time for Granite material.

Problem 7: we consider Brick material.

(a)(b)

Figure 8. (a) Variation of temperature distribution along rod according to length at various time steps with initial condition for Brick material. (b) Variation of Temperature distribution along rod with time for Brick material.

Figure 2(a), Figure 3(a), Figure 4(a), Figure 5(a), Figure 6(a), Figure 7(a) and Figure 8(a) show the variation of temperature distribution along rod according to length at various time steps with the above described initial and boundary conditions for the given seven materials such as Silver, Gold, Copper, Aluminium, Cast Iron, Granite, and Brick respectively.

Figure 2(b), Figure 3(b), Figure 4(b), Figure 5(b), Figure 6(b), Figure 7(b) and Figure 8(b) show the variation of temperature distribution along rod with time for Silver, Gold, Copper, Aluminium, Cast Iron, Granite, and Brick respectively.

In these cases time-step Δ t = 0.025 and space step Δ x = 2.5 then the values of “r” are 0.00684, 0.00508, 0.00456, 0.00344, 0.00048, 0.000044, and 0.0000152 for Silver, Gold, Copper, Aluminium, Cast Iron, Granite, and Brick respectively, which satisfy the stability condition that is, r = k Δ t ( Δ x ) 2 < 0.5 (Figure 9).

Figure 9. Comparison of Heat distribution between seven different materials w.r.t. initial stage for Δ t = 0.025 after 300 seconds.

Case-II

Here we take total time 5 minutes that is 300 seconds and the length of the rod is 100 cm. Total time step 36,000 and time step size, Δ t = 300 36000 = 0.0083 .

The total length step 40 and space step size, Δ x = 100 40 = 2.5

In these cases time-step Δ t = 0.0083 and space step Δ x = 2.5 then the values of “r” are 0.0022708, 0.0016865, 0.0015139, 0.00114208, 0.00015936, 0.000014608, and 0.00000504 for Silver, Gold, Copper, Aluminium, Cast Iron, Granite, and Brick respectively, which satisfy the stability condition that is, r = k Δ t ( Δ x ) 2 < 0.5 (Figure 10).

Figure 10. Comparison of Heat distribution between seven different materials w.r.t. initial stage for Δ t = 0.0083 after 300 seconds.

Case-III

Here we take total time 20 minutes that is 1200 seconds and the length of the rod is 100 cm. Total time step 12,000 and time step size, Δ t = 1200 12000 = 0.1 .

The total length step 40 and space step size, Δ x = 100 40 = 2.5

Figure 11. Comparison of Heat distribution between seven different materials w.r.t. initial stage for Δ t = 0.1 after 300 seconds.

In these cases time-step Δ t = 0.1 and space step Δ x = 2.5 then the values of “r” are 0.02736, 0.02032, 0.01824, 0.01376, 0.00192, 0.000176, and 0.0000608 for Silver, Gold, Copper, Aluminium, Cast Iron, Granite, and Brick respectively, which satisfy the stability condition that is, r = k Δ t ( Δ x ) 2 < 0.5 (Figure 11).

3. Conclusions

In this paper, one-dimensional heat equation as an Initial Boundary Value Problem (IBVP) for the seven different materials such as Silver, Gold, Copper, Aluminium, Cast Iron, Granite, and Brick with seven different thermal diffusivities are considered. The numerical method of the parabolic partial differential equation such as an explicit centered difference scheme with the stability conditions and advantages has been described. By using the MATLAB codes and at the same time step size, the sample tests were performed with Silver, Gold, Copper, Aluminium, Cast Iron, Granite and Brick materials and seven different results were found. The most efficient results were found with Silver, Gold and Copper materials, the third one was Aluminium whereas, efficiency of Cast Iron was found medium. However, the results with Granite and Brick materials were not at all satisfactory. But when we decrease the time step then we were obtained the same result for all materials. Also for better results with Granite and Brick materials, we increase the total time but we were found a small change.

From the definition of the thermal diffusivity and the comparative results of this analysis, we observed that Gold, Silver and Copper materials act as the best heat conductor compared to Aluminium and Cast Iron. Aluminium was found the second good conductor and Cast Iron was found medium whereas, Granite and Brick materials conduct very less amount of heat.

Explicit scheme is conditionally stable. It depends on time step size, Δ t . From stability conditions, we obtained that for Silver, Gold, Copper, Aluminium, Cast Iron, Granite and Brick materials stability conditions are satisfied.

Conflicts of Interest

The authors declare no conflicts of interest regarding the publication of this paper.

References

[1] Marwah, J. and Chopra, M.G. (1992) Transient Heat Transfer in a Slab with Heat Generation. Defence Science Journal, 32, 143-149.
https://doi.org/10.14429/dsj.32.6274
[2] Elias, E.A., Cichota, R., Torrioni, H.H. and van Lier, Q.D.J. (2004) Analytical Soil-Temperature Model: Correction for Temporal Variation of Daily Amplitude, Soil Science Society of America Journal, 68, 784-788.
https://doi.org/10.2136/sssaj2004.7840
[3] de Monte, F. (2000) Transient Heat Conduction in One-Dimensional Composite slab: A ‘Natural’ Analytic Approach. International Journal of Heat and Mass Transfer, 43, 3607-3619.
https://doi.org/10.1016/S0017-9310(00)00008-9
[4] Lu, X., Tervola, P. and Viljanen, M. (2005) An Efficient Analytical Solution to Transient Heat Conduction in a One-Dimensional Hollow Composite Cylinder. Journal of Physics A: Mathematical and General, 38, 10145-10155.
https://doi.org/10.1088/0305-4470/38/47/007
[5] Rozin Khatun, M. and Shajib Ali, Md. (2020) Stability Analysis of Finite Difference Schemes for Heat Equation with Various Thermal Conductivity. International Journl of Scientific & Engineering Reserch, 11, 1275-1282.
[6] Čiegis, R., Jankevičiūtė, G. and Suboč, O. (2010) Numerical Simulation of the Heat Conduction in Composite Materials. Mathematical Modelling and Analysis, 15, 9-22.
https://doi.org/10.3846/1392-6292.2010.15.9-22
[7] Yang, X.-J. and Gao, F. (2017) A New Technology for Solving Diffusion and Het Equations, Thermal Science, 21, 133-140.
https://doi.org/10.2298/TSCI160411246Y
[8] Maturi. D., Alsulami, N. and Alaidarous, E. (2020) Finite Difference Approximation for Solving Transient Heat Conduction Equation of Copper. Advances in Pure Mathematics, 10, 350-358.
https://doi.org/10.4236/apm.2020.105021
[9] Crank, J. and Nicolson, P. (1947) A Practical Method for Numerical Evaluation of Solutions of Partial Differential Equations of the Heat Conduction Type. Mathematical Proceedings of the Cambridge Philosophical Society, 43, 50-67.
https://doi.org/10.1017/S0305004100023197
[10] Gerald, C.F. and Wheatley, P.O. (2002) Applied Numerical Analysis. Pearson Education, Singapore.
[11] Dhawan, S. and Kumar, S. (2009) A Numerical Solution One Dimensional Heat Equation Using Cubic B-Spline Basis Functions. International Journal of Research and Reviews in Applied Science, 1, 71-77.
[12] Leveque, R.J. (1992) Numerical Methods for Conservation Law. Birkhauser Verlag, Germany.
https://doi.org/10.1007/978-3-0348-8629-1

Copyright © 2024 by authors and Scientific Research Publishing Inc.

Creative Commons License

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.