Comparison Study on the Performances of Finite Volume Method and Finite Difference Method

Vorticity-stream function method and MAC algorithm are adopted to systemically compare the finite volume method (FVM) and finite difference method (FDM) in this paper. Two typical problems—lid-driven flow and natural convection flow in a square cavity—are taken as examples to compare and analyze the calculation performances of FVM and FDMwith variant mesh densities, discrete forms, and treatments of boundary condition. It is indicated that FVM is superior to FDM from the perspective of accuracy, stability of convection term, robustness, and calculation efficiency. Particularly ,when the mesh is coarse and taken as 20 × 20, the results of FDM suffer severe oscillation and even lose physical meaning.


Introduction
In the numerical solution of flow and heat transfer problems, the concepts of conservative and nonconservative equations were firstly proposed in [1,2] in the 1980s.It is noteworthy that, from the perspective of differential unit, the conservative and nonconservative equations are equivalent, which are both the mathematical expression of physical conservation law.Nevertheless, the numerical calculation is implemented on the calculation unit of finite size, for which the two forms of equations are of different characteristics.Practical calculation process shows that the influence of differences between conservative and nonconservative forms on accuracy, stability, and efficiency of numerical calculation is significant.
Conservative governing equation and the corresponding discrete form show some advantages; for example, in the control volume with finite size, only the conservative equation can guarantee that the conservation law of the problem studied is satisfied [3][4][5].The result obtained by the conservative equation is of higher accuracy generally.In the calculation of flow problem involving shock wave, the obtained flow field is usually smooth and stable employing the conservation form of governing equation, while using the non-conservation equation might lead to unsatisfactory spatial oscillations in the upstream and downstream regions of the shock wave [6][7][8].Moreover, when the conservation equation is used to a body-fitted coordinate system, the conservativeness of governing equation can still be satisfied [9,10].More related researches and applications are presented in the literature [11][12][13][14][15]. Hence, the conservation property of discretized equations is desirable in engineering calculation.Based on this, it is of great significance to investigate the influence from conservation property on the calculation performances and provide guidance for the better implementation of it.The present paper compares the calculation performances by analyzing the finite volume method which is conservative and finite difference method which is nonconservative.
Some researchers made comparisons of the two methods.Patankar [16] and West and Fuller [17] pointed out that the results obtained in the situation that grids numbers decrease and mass conservation is rigorously controlled lose its physical meaning.Leonard [18] made a comparison of the accuracy of truncation error of the convection term in FVM and FDM.By theoretical derivation, he indicated that the truncation error of FVM is smaller than that of FDM in second-order central difference and second-order upwind difference.Botte et al. [19] made comparison of the accuracy, mass conservation, and computation time.It was validated by examples that FDM cannot ensure mass conservation while FVM can.Meanwhile, the influence of boundary conditions on the accuracy of algorithm was taken into consideration.
Previous researchers mainly focused on the comparison of accuracy.There are few systemic studies on the stability, robustness, and computation efficiency.This paper compared the calculation performances of FVM and FDM based on previous research.Comprehensive comparison of accuracy, stability of convection term, robustness, and calculation efficiency was performed.The results obtained may enrich the study on the calculation performances of conservative and nonconservative methods, which are expected to provide some reference for the practical calculation.

Physical Problem
To make the study possess general significance, it is necessary to analyze the calculation performances of the two methods based on variant problems.Lid-driven flow and natural convection flow in a square cavity which are both typical problems in computational fluid mechanics and numerical heat transfer are solved in this paper to make a systemic analysis on the subject.
As Figure 1(a) shows, in the lid-driven flow the lid moves horizontally at a constant velocity  top while the other three boundaries keep still.The Reynolds number, Re (Reynolds number) adopted in this paper, is 1000.
Figure 1(b) shows the schematic of natural convection flow in a square cavity.The left and right boundaries are the first boundary conditions, between which the temperature on the left boundary is higher.The other two boundaries are adiabatic ones.In calculation, Pr (Prandtl number) is taken as 0.71 and Ra (Rayleigh number) is taken as 10 6 .

Numerical Method
Considering that the calculation approach is influential to the calculation, in order to compare the difference of calculation performances between FVM and FDM, this paper adopts both primitive variable method and nonprimitive variable method to solve the governing equations.For primitive variable method, MAC algorithm is adopted, and for nonprimitive variable method, the generally used vorticitystream function algorithm is adopted.The conservation property generally refers to the convection term, and thus only the difference of convective term between conservative and nonconservative forms is compared.MAC method is characterized by the direct solving of velocity and pressure.
The key point of this method is to obtain a nondivergent velocity field in every time step or iteration step.That is, the velocity field of every time layer or iteration layer should satisfy the continuity equation and pressure, and the velocity is decoupled by solving Poisson equation which is relevant to pressure.

Governing Equation.
In primitive variable method, pressure and velocity are directly used as variables to solve the equations.As to the incompressible fluid, the dimensionless unsteady-state conservative and nonconservative equations can be written as respectively, where the values of Φ, Γ  , and   for lid-driven flow and natural convection flow are shown in Table 1 and Table 2, respectively.From (1) and (2) we can see that the convection term of conservative equation is given in the form of divergence while that in nonconservative equation is not, where the nondimensional excessive temperature can be described as Θ = ( −   )/( ℎ −   ) and U, V are defined as nondimensional velocities in separate directions (X direction or Y direction).Governing equations of conservative and nonconservative equations of primitive variable method are given before.In the calculation process, MAC algorithm is adopted to obtain the result in steady state by unsteady calculation over enough time.The result of steady state is analyzed as follows from the angle of primitive variable method.Taking the vorticity-stream function method as example, the governing equations of conservative form and nonconservative form can be written as respectively, As to the vorticity-stream function method, only the liddriven flow is studied in this paper.Values of Φ,   , Γ  , and   are shown in Table 3. where "" stands for vorticity and "" stands for stream function.where "" stands for vorticity, and "" stands for stream function.

Discretization of Equations.
Uniform mesh is adopted in this paper.In order to compare the calculation performances of FVM and FDM with variant discretized schemes, central difference and second-order upwind scheme are adopted.As to FVM, taking e interface on X direction as example, the expressions can be written as, where "e" stands for the east interface between two nodes; "E" stands for east node and "W" means west node; and "" can be defined as the east node of "E" node.As to FDM, taking node  as example, the expressions can be written as x y ΔY (i,

Treatment of the Boundary Condition of Vorticity.
Since the influence from boundary condition of vorticity on the solution of equations is significant, in this section, the calculation performances of FVM and FDM with variant treatments of the boundary condition for vorticity are studied.Three boundary conditions of vorticity are compared and studied.In the boundary as shown in Figure 2, their expressions, Thom equations [20], Woods equation [21], and Jenson equation [22], as well as corresponding accuracy are shown in ( 9)-( 11); Thom equation: Woods equation: Jenson equation: 3.4.Deferred Correction.When MAC is adopted, momentum and energy equations are both solved in explicit scheme while in vorticity-stream function method, the convection term is treated in implicit scheme by deferred correction, which can guarantee the main-diagonal domination of the solving matrix and thus guarantee the calculation stability.As to FVM, taking Φ  as example, the expressions of deferred correction are as follows: when where " * " in these equations stands for the former calculation step.
As to FDM, similarly to the treatment of Φ  in FVM, the deferred correction for node  can be written as the sum of first-order upwind gradient and correction gradient which is shown as follows: when The first terms in the right side of ( 12)-( 14) are all first-order upwind term.The second terms are incorporated into the source term as the form of correction term.The discretized equation is solved by G-S solver with underrelaxation, of which the discrete expression is shown as (15) and the discretized equations of FVM and FDM are shown in (16a), (16b), (17a), and (17b), respectively: where   ,   ,   ,   , and   are coefficients in discretized equations and  is the source term in discretized equations.

Results Comparison and Analysis
In this section, the accuracy, stability of convection term, robustness and calculation efficiency of variant algorithms, schemes, and treatments of boundary condition which have been discussed previously are systemically compared and analyzed based on the calculation results of lid-driven flow and natural convection flow in a square cavity.

Accuracy.
Firstly, the accuracy of FVM and FDM is evaluated by comparing bench mark solution with the results obtained from variant mesh density, discrete schemes, and boundary conditions.Through precision analysis, FVM and FDM are, respectively, adopted with the Taylor expansion commenced at midpoint (P node), and their respective truncation error (TE) is just as shown Table 4 [19].The truncation errors of FVM are obviously less than the FDM's.

Influence of Mesh Density.
In [4], it is indicated that the conservative property can affect the accuracy while the nonconservative FDM loses its conservative property in the situation when the grid is too small.To make further analysis, the calculation results obtained by FVM and FDM with variant mesh densities are compared.The results of the velocity along the horizontal central axis V and velocity along the vertical central axis U obtained by FDM and FVM with central difference scheme of MAC algorithm are compared and illustrated in Figure 3.
From Figure 3 we can see that, when the mesh density is taken as 80 × 80, the results obtained by FVM and FDM both agree well with the benchmark solution.When the mesh density is reduced to 40 × 40, the results obtained by FVM are closer to the benchmark solution and if the mesh density is further reduced to 20 × 20, the results obtained by FDM differ from the benchmark solution greatly, in which FVM shows its advantage in accuracy.This phenomenon is in good agreement with the theoretical analysis in [18]; that is, the conservative property of FVM better ensures the accuracy of calculation.Therefore, whether the conservative property can be realized is of much significance to the accuracy of the obtained result.

Influence of Boundary Condition.
In the following section, FVM and FDM with variant boundary conditions are compared from the perspective of accuracy by vorticitystream function method.The results of the velocity along the horizontal central axis V and velocity along the vertical central axis U obtained by FDM and FVM with central difference scheme are compared and illustrated in Figure 4, and the influence of boundary condition of vorticity is also given.From Figure 4 we can see that no matter which treatment of boundary condition is adopted the accuracy of FVM is higher than that of FDM in vorticity-stream function method.

Influence of Discrete Scheme.
The selection of discrete forms is also influential to the accuracy.Thus the results obtained with variant discrete forms are studied.Taking the vorticity-stream function with boundary condition treated by first-order Thom equation as example, the results of the velocity along the horizontal central axis V and velocity along the vertical central axis U obtained by FDM and FVM with variant discrete schemes are compared and illustrated in Figure 5, from which we can see that, whether secondorder central difference or second-order upwind scheme is adopted, the accuracy of FVM is higher than that of FDM, the comparison between (a) and (b) indicates that second-order upwind difference possesses higher accuracy than secondorder central difference.

Influence of Physical Problem.
Finally, two methods in variant physical problems are compared from the perspective of accuracy based on the convection flow in a square cavity.Taking the result obtained by MAC algorithm as example, Figure 6 shows the comparison of results of the velocity along the horizontal central axis V and velocity along the vertical central axis U obtained by FDM and FVM.Temperature fields obtained by FVM and FDM are compared with the gridindependent solution (obtained with grid of 256 × 256) as Figure 7 shows.
From the comparison in Figure 6 and Figure 7 we can see that, based on the results obtained by MAC of natural convection flow in a square cavity, the accuracy of FVM is generally superior to that of FDM.Thus, it is indicated by comparison that, no matter which mesh density, scheme, and treatment of boundary condition is adopted, FVM shows better accuracy than FDM.

Stability of Convection Term.
Stability of mathematical meaning can only ensure that the oscillation of solution is controlled within a range but cannot eliminate the absence of oscillation.The amplification of oscillation may result in divergence.Stability of convection term originates from varied difference schemes for convective item and is independent of the introducing of rounding error in the calculation.This stability is the key point to obtain a solution with physical meaning.It is concluded that all the unstable schemes will result in the oscillation of solution.Stability condition of       the convection item (Mesh Peclet number) is affected by the following factors such as mesh density and boundary condition.Taking lid-driven flow as example, the stability of convection term of FVM and FDM with variant mesh densities treatments of boundary condition is compared.

Influence of Mesh Density.
Figure 8 shows the comparison of stream lines between FVM and FDM with variant mesh densities.With the grid of 40 × 40, the two methods both can capture the structure of primary vortex and secondary vortex as Figure 8(a) shows.It is seen in Figure 8(b) that, when the mesh of 20 × 20 is adopted, concussion phenomenon appears, which is more serious in FDM, and the location of the vortex center obviously moves upward.

Influence of Boundary Condition.
Similarly to the accuracy analysis, the results obtained by variant treatments for vorticity of wall boundary are compared as Figure 9 shows.Three treatments, Thom, Woods, and Jenson, are analyzed.
From Figure 9 we can see that, only when Jenson equation is adopted, the results obtained by FVM and FDM are relatively close, while when Thom and Woods are adopted, FVM shows better results than FDM.The results obtained by FDM suffer severe oscillation and even lack physical meaning.It is clear that, based on the lid-driven flow, stability of convection term of FVM is superior to that of FDM.The influence from the same boundary error (truncation error and rounding error) on difference solving methods is illustrated in Figure 9.With the treatment of boundary condition with the same truncation error or rounding error, the stability of FVM is better than that of FDM, especially in the situation with boundary treatment of (a) and (b) with relatively low precision truncation error; FDM is very unstable and very easy to slip into oscillation.

Robustness.
Robustness is a very critical index to evaluate the numerical approaches.In this section, the robustness of FVM and FDM is compared based on the lid-driven flow problem, which is solved by vorticity-stream function.Grids of 20 × 20, 40 × 40, and 80 × 80 are adopted, respectively, in the calculation.Relaxation factor is tentatively taken up from 0.2 to the maximum which can ensure the convergence of calculation.Iterations are correspondingly recorded as well.
It is shown in Figure 10 when the whether the central difference scheme or second-order upwind scheme is adopted, with the refining of calculation grids, the maximum relaxation factor () increases in both FVM and FDM, the robustness is enhanced, and the iterations (Niter) correspondingly decrease as well.
As Figure 10(a) shows, in the situation that central difference scheme is adopted, with the grid of 20 × 20 and 40 × 40, the maximum relaxation factor of FVM is bigger than that of FVM while with the grid of 80 × 80, the relaxation factor can be taken as 1.0 in both methods.Similarly, as Figure 10(b) shows, generally speaking, when second-order upwind difference scheme is adopted, the maximum relaxation factor is bigger than that of FDM.Based on the result of lid-driven flow, the conservative FVM is superior to the nonconservative FDM from the perspective of numerical robustness.
In the numerical simulation of complex flow field, calculation efficiency is another critical index, on which this paper makes analysis.From Figure 10 we can see that, with the increasing of relaxation factor, the iterations of two methods both decrease generally.What needs to be notified is that the iterations of FVM are smaller than those of FDM.4.4.Efficiency.In the numerical simulation of complex flow field, calculation efficiency is another critical index, on which this paper makes analysis.
As is shown in Table 5, although the calculation time required by every iteration step in FVM and FDM is almost the same, with the increasing of mesh numbers, calculation time required by FVM slightly decreases.Thus, total calculation time of FVM is much smaller than that of FDM.That is, FVM is much more efficient that FDM.Thus, it is validated that the efficiency of FVM is better than that of FDM in the same calculation condition.and calculation efficiency of conservative method are better than those of the nonconservative method.(4) In the lid-driven flow, with vorticity-stream function method, the calculation time required by every iteration step of FVM is slightly smaller than that of FDM.Together with the smaller total iteration steps, FVM is more efficient than FDM.

Figure 1 :
Figure 1: Schematic of different physical problem in a square cavity.

Figure 2 :
Figure 2: Schematic of the treatment for boundary conditions of vorticity-stream function method.

Figure 3 :
Figure 3: Velocity on the central axis of lid-driven flow obtained by MAC with variant mesh densities.

Figure 4 :Figure 5 :Figure 6 :
Figure 4: Velocity along the central axis obtained by second-order central difference scheme with two treatments of boundary condition when the mesh density is 40 × 40.

Figure 7 :
Figure 7: Comparison of temperature contours of natural convection flow in a square cavity with variant mesh densities (FVM in the left column and FDM in the right column).

Figure 8 :
Figure 8: Comparison of stream lines in lid-driven flow with variant mesh densities (FVM in the left column and FDM in the right column).

Figure 9 :
Figure 9: Stream functions of lid-driven flow under variant boundary treatments with the grid of 20 × 20 (FVM in the left column and FDM in the right column).

Figure 10 :
Figure 10: Comparison of the robustness of lid-driven flow with variant schemes.

Table 1 :
Parameters of equations for MAC of lid-driven flow.

Table 3 :
Parameters of equations for vorticity-stream function algorithm of lid-driven flow.

Table 4 :
Truncation error of FVM and FDM governing equations for vorticity-stream function algorithm of lid driven flow in a square cavity.

Table 5 :
Computation iterations and time of FVM and FDM in second-order central difference scheme for vorticity-stream function algorithm of lid driven flow.