To Obtain Numerical Solution of Diffusion Equation with the help of Finite Difference Method

Error estimation and comparison of numerical and analytical solutions for diffusion equation

by Abhishek Mishra*, Dr. Uma Shankar, Dr. Sonu Kumar,

- Published in Journal of Advances and Scholarly Researches in Allied Education, E-ISSN: 2230-7540

Volume 19, Issue No. 1, Jan 2022, Pages 270 - 274 (5)

Published by: Ignited Minds Journals


ABSTRACT

This work estimates error for the numerical solution of the diffusion equation using the finite difference method. To find the numerical approximation of the Diffusion equation, the Explicit centred difference scheme is explained. The numerical scheme is used to carry out the numerical features of error estimation. We present the variable separation method to obtain an analytic solution. We create a computer programme in scientific programming language to implement the finite difference method. For comparison, an example is used numerical results are then compared to analytical solutions.

KEYWORD

numerical solution, diffusion equation, finite difference method, error estimation, explicit centred difference scheme, variable separation method, analytic solution, computer programme, scientific programming language, comparison, numerical results, analytical solutions

INTRODUCTION

Finite difference methods in mathematics are numerical methods for approximating the solutions to differential equations by using finite difference equations to approximate derivatives. Our goal is to approximate differential equation solutions. i.e. to find a function (or some discrete approximation to this function) that fulfils a given relationship between many of its derivatives on a given area of space time, as well as some initial conditions along the domain's edges. The derivatives in the differential equation are replaced by finite difference approximations in the finite difference method. This results in a large algebraic system of equations that can be solved on a computer instead of the differential equation. Mohamed, Salleh, et al. (2016) take into account the mathematical modelling of free convection boundary layer flow on a solid sphere in their research study. The partial differential equations are then solved using the Keller-box method, an implicit finite difference method combined with Newton's linearization method. This method is appropriate for solving parabolic partial differential equations. This method is also effective for solving convective boundary layer problems that involve partial differential equations.After evaluating all of the literature on the proposed research topic, it was discovered that the Variational Iteration Method is not used to solve some specific non-linear differential equation. As a result, researchers used this method to solve such equations.Sharma, D. (2015) provide a method for solving the advection-diffusion equation using a fuzzy finite difference scheme. The explicit finite difference method is used in this case.They demonstrate that the fuzzy finite difference method is efficient and accurate. It also serves as a tool for estimating uncertainty associated with radon concentration, which is crucial for having uncertainty in inhalation exposure by propagation through breathing rate uncertainty.The author of (Sweilam et al, 2012) introduces the C-N-FDM method for solving the linear time fractional diffusion equation. They claimed that the C-N-FDM produces excellent results. The authors investigated spectral methods for solving the one-dimensional parabolic heat equation (Juan- Gabriel et al 2006). The authors of (Hikment Koyunbakan and Emrah Yilmaz, 2010) asserted that the ADM model is more effective. The authors of (Subir et al., 2011) present the Adomian Decomposition method for solving the nonlinear diffusion equation with fractional time derivatives. With the preceding discussion in mind, our intention is to investigate mathematical models, create the stability of the model of the numerical scheme, and analyse the scheme's error. Section 2 includes a brief discussion of the derivation of the Diffusion equation as IBVP. The variable separation method is used to illustrate the analytical solution of the diffusion equation in section 3. In section 4, we describe an explicit centred Section 4 also establishes the numerical scheme's stability condition. In section 5, we write a computer programme in a scientific programming language to implement the numerical scheme and run numerical simulations to test the behaviour for varying factors. Finally, in the final section, the paper's results are summarized.

GOVERNING EQUATION AND ITS DERIVATION

In this study, we consider the governing equation to be IBVP C denotes the concentration at point x at time t, Dis denotes the diffusive constant in the x direction, and t denotes the time. With appropriate initial and boundary condition c(t0,x)=c0(x);a≤ x≤b c(t,a)= ca(t);t0≤ t≤ T c(t,b) =cb(t) Consider the equation of mass conservation of the tracer. The continuity equation states that divergence of massflux equals change in mass in a control volume. If we assume thatisconstant in time and space, the continuity equation can be written as Using Fick‘s law for q , we have a general Diffusion equation The diffusion coefficient theoretically is a tensor. However, for most cases, we assume it is a scalar. The diffusion equation written in the Cartesian coordinate system in a one dimensional.

VARIABLE SEPARATION METHOD

Consider c = XT to be the diffusion equation's solution.

with the homogeneous boundary condition

Initial condition , and boundary condition Then and Now from the given equation, we have Each side of (2) must be constant, (say) Then T‘+D and whose solution are, and Thus a solution of the partial differential equation is Applying the boundary condition Since c(0,t)= . Thus from (3), we have Since If the solution is identically zero, so we must have since In order to satisfy the last condition, Using Fourier series, The solution of the governing equation can be written as follows

FORMULATION OF THE DIFFUSION EQUATION

We would like to consider the diffusion equation as an initial and homogeneous boundary value problem.

Initial condition and boundary condition ). In order to develop the scheme, we discretize the x-t plane by choosing a mesh width h=x space and a time step k=Δt . The finite difference methods we will develop produce approximations to the solution at the dicrete points by

Let the solution () be denoted by and its approximate value by . Simple approximations to the first derivative in the time direction by forward difference can be obtained from (Δt) Discretization of is obtain from second order central difference in space. We obtain

This is the required explicit centered difference scheme for the IBVP This scheme uses a second order central difference in space and the first order forward Euler scheme in time. Where Note that if 0then the solution at the new time is a weighted average of the solution at the old time .This implies a discrete maximum principle, and therefore numerical stability. It also implies monotonocity: if for all ,then However, we must choose the time step to be small: we must have λ≤ or equivalently that This time step restriction typically requires an unacceptably large number of time steps, unless the diffusion constant D is very small. 4.1 Stability of the explicit centered difference scheme (8) is given by the conditions Proof: The explicit centered difference scheme (8) takes the form

Where Δ

The equation (10) implies that if , and then the solution at the new time is a weighted average of the solution at the old time. This implies a discrete maximum principle. We can conclude that the explicit centered difference scheme (10) is stable for

ERROR ESTIMATION OF THE SCHEME

c(x,0) = c0(x) =x(1-x)and homogeneous boundary condition. We get We compute the error defined by

for all time where ceis the exact solution and cNis the Numerical solution computed by the finite differencescheme.

Findings and Discussion

We solve the diffusion equation by using the centred difference scheme and varying the various parameter values.

Fig.1: The behavior of numerical solutionat D= 0.001 m2/s, 0.005 m2/s.

At time t=24 minutes, the concentration distribution for each diffusion rate is shown. In figure-1, the profile for varying contaminant diffusion rate, we can see that the contaminant concentration decreases faster with a higher diffusion rate than with a lower diffusion rate. The "star" curve represents the concentration profile for diffusion rate D= 0.001m / s2, while the "dot line" curve represents the concentration profile for diffusion rate D= 0.005m / s2.

various times. The curve denoted by "blue line" represents the numerical solution, while the curve denoted by "red line" represents the numerical solution. The outcomes are extremely close.

Fig.3: The Numerical solution and Analytical solution in mesh.

Fig.4: The error in the numerical result is shown for ∆x=0.1

Fig.5: The error in the numerical result is shown for ∆x=0.01

Fig. 4 and 5 show the error in the numerical solution from each method when compared to the analytical solution for the two cases N=10 and N=100, which correlate to x=0.1 and 0.01 respectively. When the solution is compared at different times, the errors become smaller as x decreases.The central difference scheme's errors reduce as the grid size decreases. to the Diffusion equation. To perform the numerical features of error estimation, the explicit centred difference scheme is used. We can see that the contaminant concentration decreases faster with a higher diffusion rate than with a lower diffusion rate. To carry out the numerical method, we created a computer programme in the scientific computing language that has a very good agreement with the finite difference method for the diffusion equation.

REFERENCE

 N. H. Sweilam, M. M. Khader, A. M. S. Mahdy ( 2012, Jan.), ―Crack Nicolson finite difference method for solving time-fractionaldiffusion equation‖, Journal of Fractional Calculus and Application, Vol. 2, No. 2, pp. 1-9.  N.Azizi, R. Pourgholi and M. Ebrahimi, ―Application of finite difference method to estimation of diffusion coefficient in a one dimensional nonlinear inverse diffusion problem‖.  Hikment Koyunbakan and Emrah Yilmaz,―Numerical Simulation of Diffusion Equation byMeans of He‘s Variational IterationMethods and Adomina‘s Decomposition method‖ , Cankaya University Journal of Science and Engineering, Vol. 7, No. 1, 25 -38,2010.  Subir Das, Praveen Kumer Kupta, Pradyumna Ghosh ―An Approximate analytic Solution of Non Linear Fractional DiffusionEquation‖, International Journal of Nonlinear science, 2011, Vol.12, No.3, pp.339-346.  S.B.Yuste and L.Acedo ―An explicit finite difference method and a new VonNumann-type stability analysis for fractional diffusionequations‖, 2005 society for industrial and applied Mathematics,vol.42, No. 5, pp.1862-1874.  Gerald W. Rectenwald ―Finite difference approximations to the heat equation‖, March 9, 2011.  Numerical Solution of Differential Equations: Introduction to Finite Difference and Finite Element Methods Published date on 30 November 2017by Zhilin Li (Author), Zhonghua Qiao (Author), Tao Tang (Author). ISBN-13- 978-1107163225.  Numerical solutions of partial differential equations using finite difference method and mathematica paperback – january 1, 2019 .By sujaul chowdhury (author), ponkog kumar das (author). ISBN-10 ‍‍:‍‍‍1631819933‍ISBN-13 ‍‍:‍‍‍978-1631819933

10 ‏‍:‍‍‍0128498943‍ISBN-13 ‏‍:‍‍‍978-0128498941

 A.N. Richmond (2006, July), ―Analytical solution of a class of diffusion problems‖, International journal of mathematical educationin Science and Technology, Vol.15, issue 5, p. 643-648.  Rama Cont and Ekaterina Voltchkova ―A finite difference scheme for option princing in jump diffusion and exponential levymodels‖, ECCOMAS 2004.  S.S.Sastry, ―Introductory Methods of Numerical Analysis‖, Fourth edition, 2007. T.Papakostas, A.G.Bratsos, I.Th.Famelis, A.I.Dlisand D.G.Natsis, ―An implicit numerical scheme for the atmospheric pollution‖.

Corresponding Author Abhishek Mishra*

Research Scholar, Sunrise University, Alwar, Rajasthan