A Comparitive Study of FVM and FDM

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

American Journal of Computational and Applied Mathematics 2011; 1(2): 67-73

DOI: 10.5923/j.ajcam.20110102.13

A Comparative Study of Finite Volume Method and Finite


Difference Method for Convection-Diffusion Problem
Anand Shukla*, Akhilesh Kumar Singh, P. Singh

Department of Mathematics, MNNIT, Allahabad, 211 004, India

Abstract Now-a-days computational fluid mechanics has become very vital area in which obtained governing equations
are differential equations. Sometimes, these governing equations cannot be easily solved by existing analytical methods.
Due to this reason, we use various numerical techniques to find out approximate solution for such problems. Among these
techniques, finite volume method is also being used for solving these governing equations here we are describing compara-
tive study of Finite volume method and finite difference method.
Keywords Convection-Diffusion Problems, Finite Volume Method, Finite Difference Method

air. For solving these types of problems, authors presented an


1. Introduction iterative, non-overlapping domain decomposition method
for solving these problems. A reformulation of the problem
Finite Volume Method is widely being used for solving leads to an equivalent problem, where the unknowns are on
convection diffusion problems appearing different branches the boundary of the sub-domains[3].The solving of this in-
of fluid engineering. Mainly, we would like to introduce terface problem by a Krylov type algorithm[4], was done by
some real life problems where it is arising. B. Guo and X. the solving of independent problems in each subdomain,
Wang[1] proposed an article in which numerical simulation which permits to use efficiently parallel computation. In
is used as a common mean of predicting performance of oil order to have very fast convergence, C. Japhet et. al use
and gas reservoirs in the petroleum industry. It is a differential interface conditions of order one in the normal
time-consuming task due to the large dimension of the direction and of order two in the tangential direction to the
simulation grids and computing time required to complete a interface, which was optimized approximations of absorbing
simulation job. Commercial software used in the petroleum boundary conditions[5].
reservoir simulation employs the first-order-accuracy finite The present paper deals with the description of the finite
difference method to solve the convection-diffusion equation. volume method for solving differential equations. The
This method introduces numerical dispersion because of comparison is done between the analytical solutions (AS),
truncation error caused by neglecting higher-order terms in the solutions obtained by implementing finite volume
Taylor’s expansion. This study is focused on providing so- method and the finite difference method (FDM). This paper
lutions to the above problem. B. Guo and X. Wang devel- is organized as follows: Section 1 contains the description
oped and tested two new algorithms to speed up computation about finite volume method (FVM), Section 2 contains FVM
and minimize numerical dispersion. In this research article, for solving differential equations, and Section 3 contains real
they have derived the second and third order accurate finite l i f e p r o b l e m , e s p e c i a l l y t i m e i n d e p e n d e n t con
difference formulations to solve the convection-diffusion vection-diffusion problem and its solution by FVM. The-
equation, and also applied a counter-error mechanism to Section 4 involves the comparison between the numerical
reduce numerical dispersion. The results indicated that the results obtained by using finite volume method and finite
use of the second- and third-order accuracy finite difference difference method. Finally, in Section 5, we are given the
formulations can speed up numerical simulations and retain a conclusion for this paper. Some citation is also needed to
sharp displacing slope controlled by the physical diffusion understand the article, which are given in references.
coefficient. C. Japhet et. al[2] were proposed an article in
which they are taking convection-diffusion models which
was implementing on the concentration of a pollutant in the
2. Finite Volume Method
* Corresponding author:
anandshukla86@gmail.com (Anand Shukla)
The finite volume method is a method for representing and
Published online at http://journal.sapub.org/ajcam evaluating partial differential equations in the form of alge-
Copyright © 2011 Scientific & Academic Publishing. All Rights Reserved braic equations[3]. Similar to the finite difference method or
68 Anand Shukla et al.: A Comparative Study of Finite Volume Method and Finite Difference Method
for Convection-Diffusion Problem

finite element method, values are calculated at discrete volume to yield a discretized equation to yield a discretized
places on a meshed geometry. "Finite volume" refers to the equation at its nodal points P.
small volume surrounding each node point on a mesh. In the Step 3: Solution
finite volume method, volume integrals in a partial differen- After discretization over each volume method, we are
tial equation that contain a divergence term are converted to finding a system of algebraic equation. Which are easily
surface integrals, using the divergence theorem. These terms solved by numerical scheme such as Gauss-Siedel method.
are then evaluated as fluxes at the surfaces of each finite Generally equations are in tri-diagonal form in next section
volume. Because the flux entering a given volume is iden- we are describing this method by a suitable example
tical to that leaving the adjacent volume, these methods are
conservative. Another advantage of the finite volume
method is that it is easily formulated to allow for unstruc- 3. Finite Volume Method for Real Life
tured meshes. The method is used in many computational
fluid dynamics packages. In finite difference,[5] the de-
Problem
pendent variable values are stored at the nodes only. Infinite In this section, we describe the finite volume method for
element method, the dependent values are stored at the ele- solving convection-diffusion problem. Firstly, we shall de-
ment nodes. But in finite volume method, the dependent fine a convection-diffusion problem.
values are stored in the centre of the finite volume. In FVM,
conservation of mass, momentum, energy is ensured at each Convection-diffusion problem
cell/finite volume level. This is not true in finite difference The general transport equation for any fluid property is
and finite element approach. It is always better to use gov- given by
∂ ( ρϕ )
erning equation in conservative form with finite volume + div( ρϕ u ) =
div(Γgradϕ ) + Sϕ .
approach to solve any problem which ensures conservation
∂t (1)
of all the properties in each cells/control volume. One ad- In problems where fluid flow plays a significant role we
vantage of the finite volume method over finite difference must account for the effects of convection. Diffusion always
methods is that it does not require a structured mesh (al- occurs alongside convection in nature so here we examine
though a structured mesh can also be used). method to predict combined convection and Diffusion. The
Now we shall discuss the steps involving FVM for solving steady convection-diffusion equation can be derived from
differential equation: transport equation (1) for a general property by deleting
Step 1: Grid Generation transient term
The first step in the finite volume method is grid genera- div( ρ uΦ=
) div(Γgrad Φ ) + sΦ . (2)
tion by dividing the domain in to discrete control volumes. Formal integration over control volume gives
Let us place a number of nodal points in the space between A ∫ n.( ρ uΦ)dA = ∫ n(Γgrad Φ)dA + ∫ S
A A CV
Φ dV .

and B. The boundaries of control volumes are positioned


mid-way between adjacent nodes. Thus each node is sur-
rounded by a control volume or cell. It is common practice to
set up control volumes near the edge of the domain in such a
way that the physical boundaries coincide with the control
volume boundaries. A general nodal point defined by and its
neighbours in a one-dimensional geometry, the nodes to the
west and east, are defined by W and E, respectively. The
west face of the control volume is referred by ‘w’ and east
side by ’e’. The distances of these points are given in figure.

In the absence of sources, the steady convection and dif-


fusion of a property in a given one-dimensional flow field u
is governed by
d d  d 
u   
dx dx  dx  (3)
And continuity equation becomes d ( ρu ) = 0
dx
Integrating equation (3) and we have
 ∂Φ   ∂Φ 
( ρ uAΦ )e − ( ρ uAΦ ) w =  ΓA  −  ΓA  .
 ∂x e  ∂x  w
Step 2: Discretization And continuity equation becomes
The most important features of finite volume method are ( ρ uA) e − ( ρ uA) w =
0.
the integration of the governing equation over a control To obtain discretized equation, we shall take some as-
American Journal of Computational and Applied Mathematics 2011; 1(2): 67-73 69

sumption:
Let F = ρu represent convective mass flux per unit area
and D = Γ represent diffusion conductance.
δx
Now we are taking Aw = Ae = A and applying the cen-
tral differencing the integrated convection-Diffusion be-
comes
The discretization of equation (7) and its coefficient apply
Fe Φ e − FwΦ=
w De (Φ E − Φ P ) − Dw (Φ P − ΦW ). (4) at internal nodal points 2, 3, 4, but control volume 1 and 5
And continuity equation becomes need special treatment we integrate equation (3) and using
Fe − Fw =
0. (5) central differencing for both diffusion and convective flux
Central differencing scheme through the east face of cell 1.
Fe
The central differencing approximation has been used to    F   D    D (  ) (8)
P E A A e E P A P A
2
represent the diffusion terms which appears in equation (4).
and similarly for control volume 5, we may write
So e ( P E) ( W P)
Φ = Φ +Φ / 2; Φ = Φ +Φ / 2. Fw
 P W   DB  B  P  Dw ( P W ) (9)
w
FB B 
Putting these values on equation (4) becomes 2
Fe F But value of  in west face and east face is given
(Φ P + Φ E ) − e (Φ W + Φ P ) = D e (Φ E − Φ P ) − D w (Φ P − Φ W )
2 2 ( w   A  1) and (e   B  0). (10)
 Fw   Fe   Fw   Fe 
 Dw −  +  De −  Φ P =  Dw + Φ W +  De − Φ E
Using (10) in equation (8) and (9) and rearranging, we
2   2  2  2
   note that DA  DB  2 /  x and FA  FB gives discretized
 Fw   Fe    Fw   Fe 
 Dw +  +  De −  + ( Fe − Fw ) Φ P =  Dw + Φ W +  De − Φ E equation at boundary nodes of the following form
2   2 2  2
    (6) a P  P  aW W  aE  E  SU (11)
Equation (6) can be written as
and central coefficients are
a p = aw + aE + ( Fe − Fw ) − S P (12)
aP P  aW W  aE  E , (7)
Where aP , aW and aE are coefficients of Φ P , ΦW and Node aW aE SP SU
Φ E , respectively.
F
1 0 D -(2D+F) (2 D  F ) A
Example: A property Φ is transported by means of con- 2

vection and diffusion through the one dimensional Domain


F F
2,3,4 D D 0 0
the governing the governing equation is given below 2 2

boundary conditions are Φ 0 =1 at x=0 and Φ L =0 at 5 D


F
0 -(2D-F) (2 D  F ) B
2
x=L. using five equally spaced cells and the central differ-
Case1:  0.1
encing scheme for convection and diffusion calculate the u  0.1 m / s : F  u  0.1, D 
  0.5
 x 0.2
distribution of Φ as a function of x for gives the coefficient as summarized as given below
Case (1): u=0.1 m/s
Node aW aE SU SP aP  aW  aE  S P
Case (2): u=2.5 m/sThe following data apply
1 0 0.45 1.1 A -1.1 1.55

2,3,4 .55 .45 0 0 1.0

5 .55 0 0.9 B -0.9 1.45

1.551  .45 2  1.1


Solution .551   2  .453  0
.55 2  3  .45 4  0
It is given that u=0.1 m/s let domain is divided in to five
.553   4  .455  0
control volume so x  0 m. Let
.55 4  1.455 0
F  u , D   /  x, Fe  Fw  F ; De  Dw  D everywhere.
The boundaries are denoted by A and B. The algebraic equations are given below
70 Anand Shukla et al.: A Comparative Study of Finite Volume Method and Finite Difference Method
for Convection-Diffusion Problem

 1.55 -0.45 0 0 0  1  1.1 1 


 
1.0356 
       
 -0.55  2   2   0.8694 
1.0 -0.45 0 0   
0     
       1.2573 
 0 -0.55 1.0 -0.45 0     0   3  
  3      0.3521 
 0 0 -0.55 1.0 -0.45   0   4  
  4      2.4644
 0   5   
 0 0 -0.55 1.45  5 
0 
 
The solutions of above equations are given below: Finite
1 
Analytical Percentage
 0.9421 Node Distance volume Difference
    solution error
 2   0.8006 solution
   
    0.6276
 3   1 0.1 1.0356 1.0000 -0.0035 -3.56
   0.4163
 4  
   0.1579
5    2 0.2 0.8694 0.9999 0.131 13.03
Comparison with analytical solution is given below:
3 0.3 1.2573 0.9999 -0.257 -25.74
Finite
Analytical Percentage
Node Distance volume Difference
solution error 4 0.4 0.3521 0.9994 0.647 64.70
solution

1 0.1 0.9421 0.9387 -0.003 -0.36


5 0.5 2.4644 0.9179 -1.546 -168.48

2 0.2 0.8006 0.7963 -0.004 -0.53


After solving this problem, we see that, when velocity is
3 0.3 0.6276 0.6224 -0.005 -0.83 u=0.1, then numerical solution converges to analytical solu-
tion but when u = 2.5 then solution for final grid node di-
4 0.4 0.4163 0.4100 -0.006 -1.53 verges, but when we are taking 20 grid nodes then numerical
solution converges this is due to velocity 25 times more than
5 0.5 0.1579 0.1505 -0.007 -4.91 u = 2.5 this problem occur very frequently in convec-
tion-diffusion problems. It happen when velocity is large
Case (2): then convection is dominated and velocity is small then
In this case velocity is u=2.5 m/s, flow term is. diffusion is dominated to omit these problems. There are two
 methods, first is that increase grid size and second one is that
F  u  2.5, D   0.5 . Thus coefficients are given be-
x set up new scheme, known as up-winding but this differ-
low: encing scheme is not focus of our paper.
Node aW aE Su SP a p  aW  aE  S P
1 0 -0.75 3.5 A -3.5 2.75 4. Finite Difference Method
2 1.75 -0.75 0 0 1.0 S. M. Choo et.al. published an article[8] “High-order
perturbation-difference scheme for a convection diffusion
3 1.75 -0.75 0 0 1.0 problem” using finite difference methods and with uniform
meshes considered for a one-dimensional singularly per-
4 1.75 -0.75 0 0 1.0
turbed convection diffusion problem. In order to obtain
5 1.75 0 1.5 B 1.5 1.0 high-order of convergence, the difference methods are
combined with a perturbation technique. The methods have
The discretizing equations are given below uniform convergence and did not give non-physical oscilla-
tions in the numerical solutions. Existence and correspond-
2.751  .75 2  3.5
ing error estimates of the solution for the difference schemes
1.751  2  .753  0
have been shown. Numerical experiments were provided to
1.75 2 3  .75 4  0
back up the analysis.
1.753  4  .755  0
In mathematics and engineering, finite-difference meth-
1.75 4  .255  0.
ods[6] are numerical methods for approximating the solu-
The matrix form is tions to differential equations using finite difference equa-
 2.7500 0.7500 0 0 0  Φ1  3.5 tions to approximate derivatives (11). Assuming the function
-1.7500 1.0000 0.7500 0 0  Φ  0 
  2   whose derivatives are to be approximated is prop-
 0 -1.7500 1.0000 0.7500 0  Φ 3  = 0  . erly-behaved, by Taylor's theorem
    
 0 0 -1.7500 1.0000 0.7500  Φ 4  0  h2 h3
 0 0 0 -1.7500 0.2500  Φ 5  0  ( x  h)  ( x)  h' ( x)  '' ( x)  ''' ( x)  ...
2 3 (13)
Solution of the problems is From which we obtain
American Journal of Computational and Applied Mathematics 2011; 1(2): 67-73 71

( x  h) ( x) h '' 2000  1  11


' ( x)    ( x)  ...     
h 2 11 200   2  0 
Thus, we have     
    
( x  h) ( x)  11 200 3   0 
' ( x)   O(h).     
h
(14)  11 20   4   0 
'   20    0 
Which is the forward difference approximation for  ( x) .    5   
Similarly expansion of ( x  h) in Taylor’s series gives. After solving above equation, we have
h2 h3  1    0.9048
( x  h)  ( x)  h' ( x)  '' ( x)   '''( x)  .... (15)    
     0.7884
2 6  2   
      0.6461
From which we obtain  3   
     0.4722
( x) ( x  h)   4    
' ( x)   O ( h) (16)    
h  5    0.2597
which is the backward difference approximation for Case2: U=2.5
 '( x) .Subtracting equation (15) from equation (!3) we In this case, the discretized equation is
obtain the following central difference approximation:
( x  h) ( x  h) 7 A  41  3 2  0
 ( x )   O ( h) 71  4 2  33  0
2h (17) 7 2  43  3 4  0
It is clear that central difference approximation is better 73  4 4  35  0
than backward and forward difference approximation. 7 4  45  3 B  0
Similarly, we can obtain approximation for higher order
The above equation may be written in matrix form as:
derivative terms, such as adding equations (13) and (15), we
get  ''( x ) . 

-4 -3 0 0 0 1  7
   
( x  h)  2( x) ( x  h)  7 -4 -3 0 0   2   0 
   
( x)   O(h 2 ) (18)  0 7 -4 -3 0  3    0 
h2 
To solve given boundary value problems, we can divide the

 0 0 7 -4 -3   4   0 
range  x0 , xn  in to n equal subintervals of width h so that

 0 0 0 7 -4  5   0 

xi  x0  ih, i=1,2, ,n. The solution of above system of equation is given below:
The corresponding value of  at these points are denoted by 1  1.0208 
   
( xi )  i  ( x0  ih).  2   0.9723
   
Thus from equation (17) And (18) we obtain    1.0854 
 3  
  1.4375 
i1 i1  4  
 'i   O(h 2 )  
5 
 2.4644
 
2h
  2i i1 Result:
and  ''i  i1  o(h 2 ).
h2 The result and graph of both cases are given below.
We solve the above problem by finite difference method for
Case1: U=0.1
same nodal points and finding how FVM is better than Finite
difference method. Finite
Analytical
Finite
Node Distance volume difference
Case1: U=0.1 solution
Solution solution
Since the governing equation is d (ρuΦ ) = d  Γ dΦ  , we can
dx dx  dx  0.9048
1 0.1 0.9421 0.9387
write this equation in discretized form as for  x  0.2,
i1  2i i1  i1
2
 'i  i1  0. 0.7884
h 2h 2 0.2 0.8006 0.7963
After simplifying this equation we may write
11i1  20i  9i1  0. Thus set of algebraic equation
is 0.6461
3 0.3 0.6276 0.6224
11 A  201  9 2  0
111  20 2  93  0
11 2  203  9 4  0 0.4722
4 0.4 0.4163 0.4100
113  20 4  95  0
11 4  205  9 B  0.

In matrix form the above set of algebraic equations may be 5 0.5 0.1579 0.1505 0.2597
written as
72 Anand Shukla et al.: A Comparative Study of Finite Volume Method and Finite Difference Method
for Convection-Diffusion Problem

5. Conclusions
After analysing the results and by above discussion, we
see that when velocity is larger, finite volume solution does
not have better convergence. The reasons for this are given
below:
1. The internal coefficients of discretized scalar transport
equation (7) are
A steady one-dimensional flow field is also governed by
the discretized continuity equation (5).When this equation
holds then flow field satisfies continuity and also satisfi-
esScarborough condition, which is given as
Σ|a |  1 at all nodes
nb 

| a' | < 1 at one nodeat least


P
2. In case two when velocity is 2.5 m/s, the solution does
Fe
not provide better convergence, with aE  De  . The
Figure 1. Comparison of FVM and FDM with Analytical Solution (AS), 2
U=0.1 convective contribution to the east coefficient is negative; if
Case2:U=2.5 the convection dominates it is possible for aE to be negative.
Finite Finite Given that Fw  0 and Fe  0 (that is flow is unidirectional),
Analytical
Node Distance volume difference for aE to be positive De and Fe must satisfy the condition
solution
Solution solution
1.0208 Fe
1 0.1 1.0356 1.0000  Pee  2.
De
2 0.2 0.8694 0.9999 0.9723
If Pe is greater than two then east confidents will be
e

3 0.3 1.2573 0.9999 1.0854


negative. This violates one of the requirements for bound-
edness and may lead to physically impossible solution.
4 0.4 0.3521 0.9994 0.8214 These types of problems are called convection-dominated
problems. It is well known that the convection-dominated
5 0.5 2.4644 0.9179 1.4375 diffusion problem has strongly hyperbolic nature; the solu-
tion often develops sharp fronts that are nearly shocks. So the
finite difference method or finite element method does not
work well when problem is convection dominated[13].

REFERENCES
[1] B. Guo and X. Wang, Testing of new high-order finite
difference methods for solving the convection-diffusion eq-
uation, E-Journal of Reservoir Engineering, 1,(1)(2005), 1-14
[2] C. Japhet, F. Natafand and F. Rogier, The optimized order
two method Application to convection-diffusion problems,
Future Generation Computer Systems, 18(1)(2001), 17-30
[3] J. D. Anderson, Computational Fluid Dynamics: The Basics
with Applications, Macgraw-Hill Publications, Edition 6,
2008.
Figure 2. Comparison of FVM and FDM with Analytical Solution (AS),
[4] H. Versteeg and W. Malalasekra,, An Introduction to Com-
U=2.5
putational Fluid Dynamics: The Finite Volume Method,
Lomgman Scientific and Technical Publishers, 1995.
aW aE aP [5] Tapan K Sengupta and Orient Longman, Fundamentals of
Computational Fluid Dynamics, Orient Longman Pvt. Ltd.,
FW FE 2004.
DW  DE  aW  aE  ( Fe  Fw )
2 2 [6] P. K. Kundu and I. M. Cohen, Mechanics, third edition, El-
American Journal of Computational and Applied Mathematics 2011; 1(2): 67-73 73

sevier, 2004. [11] B. Garcia-Archilla and J. A. Mackenzie, Analysis of a super


convergent cell vertex volume method for one-dimensional
[7] Randall J. Leveque, Finite Volume Methods for Hyperbolic convection-diffusion problems, IMA Journal of Numerical
Problems, Cambridge University Press, 2002. Analysis, 15(1995), 101-115.
[8] S.M. Choo and S.K. Chung, High-order perturba- [12] C. Japhet, Méthode de decomposition de domaine et condi-
tion-deference scheme for a convection diffusion problem, tions aux limitesartificielles en mecanique des fluides: me-
Computer Methods in Applied Mechanics and Engineering, thod optimised’Ordre 2, Thèse de Doctorat, Université Paris
190(10)(2000), 721-732. XIII, 1998; F. Nataf, F. Rogier, M3 AS, 5 (1) (1995) 67–93.
[9] F. Nataf, F. Rogier and E. de Sturlerin: A. Sequeira (Ed.), [13] L. Quian, X. Feng and Y. He, The characteristic finite dif-
Navier–Stokes Equations on Related Nonlinear Analysis, ference streamline diffusion method for convec-
Plenum Press, New York, 1995, 307–377. tion-dominated diffusion problem, Applied Mathematical
Modeling, 36 (2012), 561-572.
[10] Y. Saad, Iterative Methods for Sparse Linear Systems, PWS
Publishing Company, 1996.

You might also like