Abstract
The convection-diffusion equation is a problem in the field of fluid mechanics. In addition to proving its validity, obvious phenomena of convection and diffusion are also observed. This paper did three numerical experiment using finite difference method (FDM) for trialing feasibility of FDM to solve 1, 2 and 3-dim convection-diffusion equation. We compared this equation’s numerical solution with its explicit solution and observed convection and diffusion. In conclusion, we demonstrate the effectiveness of FDM.
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
The convection diffusion equation
describes quantities in situations where there is both diffusion and convection or advection. It is important to get the solution of the equation with physics situation. Equation (1) is very important in computational fluid dynamics to model the transport phenomena. The coefficients \({\mathbf{v}}{ }\) and \(D\) are convection velocity and diffusion coefficient, \(\nabla \cdot {\mathbf{v}}u{ }\) picture the convention and \(\nabla \cdot \left( {\mu \nabla u} \right){ }\) picture the diffusion. 1 and 2-dimension cases have the analytical solutions. But, in general, it is difficult to obtain the explicit solutions in high space dimensions, which cause trouble in predicting the distribution of matter or energy. Then we have to try to obtain a numerical solution which balances computational speed and accuracy.
This paper deals with solving the convection diffusion equation with 1, 2 or 3 dimensions using the finite difference method.
2 Literature Review
Finite difference method, finite element method and finite volume method are common methods in engineering application. Finite difference method (FDM) is the classical way to calculate the numerical solution of PDE and ODE.
Cheng Aijie, Zhao Weidong [1] given a economical difference scheme for convection-diffusion equation with Dirichlet’s condition.
\({\Omega } = \left( {0,1} \right) \times \left( {0,1} \right),\) \(\vec{b} = \left( {b_{1} \left( {x,y} \right),b_{2} \left( {x,y} \right)} \right),a \in C^{3} \left( {{\overline{\Omega }}} \right),\) \(b_{1} \in C^{0} \left( {{\overline{\Omega }}} \right),b_{2} \in C^{0} \left( {{\overline{\Omega }}} \right),{ }f \in C^{0} \left( {\left( {0,T} \right] \times {\overline{\Omega }}} \right)\) and \(a\left( {x,y} \right){ }\) has positive low boundary. By discretizing the equation along characteristics, they have improved the computational efficiency without sacrificing accuracy. When it is a convection-dominated problem, the method of characteristics is faster than CDS. Even some cases will converge on the method of characteristic but CDS when diffusion coefficient is small.
Muhammad Saqib, Shahid Hasnain, Daoud Suleiman Mashat [2] extend Crank-Nicholson and ADI scheme to non-linear two dimension convection-diffusion equation.
To compare with other numerical method, the computational solution is more approach the exact solution.
Murli M. Gupta, Jun Zhang [3] give an explicit fourth-order finite difference scheme for 3D convection diffusion equations in a highly efficient procedure for small to medium values of the grid Reynolds number in 2000.
Ewa Majchrzak, Łukasz Turchan [4] present the other algorithm based on the FDM for 1-dimension convection diffusion equation.
We will compare the explicit solution with numerical solution of Eq. (1) using FDM in the 1 - dimension and 2 dimensions cases and try to get 3 - situation.
3 Methodology
The FDM uses the finite difference in place of the derivative. Suppose \(u\left( x \right):R \to R\) is a real function. We approximate \(u^{\prime}{ }\) by calculate
where \(h\) is a small and positive value [5]. By the definition, the smaller \(h\) is, the closer \(D_{ + } u\left( x \right){ }\) is to \(u^{\prime}\left( x \right)\). Similarly, we have many schemes to approximate \(u^{\prime}\left( x \right)\), such as
We expand the function \(u\) about the point \(x\) in Taylor series
Then the errors of \(D_{ + } ,D_{ - } ,D_{0}\) are
So centered approximation is more accurate than these formulas have different accuracy although all of them be used to approximate \(u^{\prime}\left( x \right)\)
We call \(D_{ + } ,D_{ - }\) are one order accuracy and \(D_{0} { }\) is two order accuracy of approximation.
The second order derivative of \(u{ }\) can be approximation by same way
To sum up, the method of approximation of derivatives we need are enough. Then, let’s discuss how to solve the equation by numerical method.
Let’s start with the simplest case. There only one space dimension ‘\(x\)’ in the equation:
We will express the equation as upwind scheme. First, The first order time derivative uses forward approximation
Then, first and second space derivatives use centered approximation
3.1 1-Dim Case
If we plug the difference back into the Eq. (17), we obtain
Finally, we rewrite the equation as
This is an algebraic equation. We can calculate it by irritation method.
3.2 2-Dim Case
The 2-dim convection diffusion equation also could use upwind scheme. We can obtain that
Rewrite the equation as
3.3 3-Dim Case
It follows that
4 Result
4.1 First Case
Let’s take \(v = 1,\mu = 0.5\), and equip suitable boundary condition. Then we can get a initial boundary value problem
When we set \(\Delta t = 0.01s,{ }\Delta x = 0.05,\) there is the irritation formula
Through computer calculation by Matlab, we can get the solution and draw the figure of the equation (Fig. 1)
4.2 Case Two
When we take \(v = - 1,\;\mu = 0.05,\; \Delta x = 0.05,\;\Delta y = 0.05,\;\Delta t = 0.01s\), the 2-dimensional question become to (Figs. 2, 3, and 4)
4.3 Case Three
We take \(v = 1,\mu = 0.1,{\Delta }t = 0.01s,{\Delta }x = 0.1,{\Delta }y = 0.1\), then we get the equation
we equip initial condition and boundary condition,
The irritation is
Calculated by Matlab, we can obtain the solution of the problem (Figs. 5, 6, and 7).
5 Discussion
In view of the above, we get some several picture of numerical solution of convection-diffusion with different dimension. We can compare 1-dim cases with its explicit solution. The observation that its numerical solution approach its explicit solution suggest us that the finite difference method is visible to solve the fixed coefficient convection-diffusion equation. In the other two cases, the high value domain move over time, which accord with convection physical phenomenon. The diffusion process also represented by the picture of the solution.
For 1-dim case, the numerical solution close with its explicit solution \(e^{{x - \frac{1}{2}t}}\), and 2,3-dim cases display convection and diffusion phenomena.
In the case of improper coefficient setting, we find that there may be numerical oscillation. According to preliminary analysis, this may be caused by the positive and negative coefficients of the iterative formula. For convection-dominated problems these schemes have much smaller time-truncation errors than those of standard methods [6]. Improper coefficient may result in negative value of \(u\), which violates the laws of physics. When you look at the coefficients of the 3-dimensional equation, the \(1 - \frac{{2\mu {\Delta }t}}{{{\Delta }x^{2} }} - \frac{{2\mu {\Delta }t}}{{{\Delta }y^{2} }} - \frac{{2\mu {\Delta }t}}{{{\Delta }z^{2} }}\) term requires \({\Delta }t\) to be small enough, the \({\Delta }x\) to be large enough for the coefficient of \(U_{i,j,k}^{n}\) to be positive, and the \(\frac{{\mu {\Delta }t}}{{{\Delta }x^{2} }} - \frac{{v{\Delta }t}}{{2{\Delta }x}}\) term requires \({\Delta }x\) to be small enough for it to be positive. So when we have numerical oscillations, we should pick the appropriate \({\Delta }t\) and \(\Delta x,\;\Delta y,\;\Delta z\).
6 Conclusion
Based on FDM, we derive the calculation format and iterative formula suitable for the convection-diffusion equation. Numerical experiments are carried out for the above three cases. The results are close to the theoretical solution and show the convection and diffusion phenomena.
References
Weidong, C.A.Z.: An economical difference scheme for convection-diffusion equations. Math. Numer. Sin. 3 (2000)
Saqib, M., Hasnain, S., Mashat, D.S.: Computational solutions of two dimensional convection diffusion equation using Crank-Nicolson and time efficient ADI. Am. J. Comput. Math. 07(03), 208–227 (2017)
Gupta, M.M., Zhang, J.: High accuracy multigrid solution of the 3D convection–diffusion equation. Appl. Math. Comput. 113(2–3), 249–274 (2000)
Majchrzak, E.: The Finite Difference Method for transient convection-diffusion problems. Sci. Res. Inst. Math. Comput. Sci. 11(1), 63–72 (2012)
Leveque, R.J.: Finite Difference Methods for Ordinary and Partial Differential Equations
Douglas, J., Jr., Russell, T.F.: Numerical methods for convection-dominated diffusion problems based on combining the method of characteristics with finite element or finite difference procedures. SIAM J. Numer. Anal. 19(5), 871–885 (1982)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Li, C. (2021). Finite Difference Method for Convection-Diffusion Equation. In: Cao, W., Ozcan, A., Xie, H., Guan, B. (eds) Computing and Data Science. CONF-CDS 2021. Communications in Computer and Information Science, vol 1513. Springer, Singapore. https://doi.org/10.1007/978-981-16-8885-0_16
Download citation
DOI: https://doi.org/10.1007/978-981-16-8885-0_16
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-16-8884-3
Online ISBN: 978-981-16-8885-0
eBook Packages: Computer ScienceComputer Science (R0)