# Comparison of varieties of numerical methods applied to lid-driven cavity flow: coupling algorithms, staggered grid vs. collocated grid, and FUDS vs. SUDS

- 64 Downloads

## Abstract

The effectiveness of different methods, schemes, algorithms, and approaches is of substantial challenging problems in numerical modeling of transport phenomena. In the present paper, a lid-driven cavity problem is modeled via two basically different approaches of spatial discretization: collocated and staggered. The non-dimensionalized governing equations are semi-discretized by using a finite volume approach. Then, the full discretization is performed in each of collocated and staggered grids, separately. Upwind and central difference schemes are implemented in order to discretize the convective and diffusion terms of equations, respectively. After mesh independency study, the performances of collocated and staggered grids in comparison with the reference benchmark are presented. Next, the effectiveness of the first and the second order upwind schemes are presented, as well as different coupling algorithms of SIMPLE, SIMPLEC, and SIMPLER. Finally, an overall comparison of the methods is provided and acceptable agreements with benchmark are attained.

## Keywords

Numerical simulation Collocated Staggered Lid-driven cavity Upwind scheme Coupling algorithm## Introduction

As a classic problem, lid-driven cavity flow is widely implemented in order to validate, compare, and investigate numerical methods and schemes.

*Staggered grid* has been extensively used for the numerical modeling of lid-driven cavity flows. A two-dimensional computational model was developed to study the fluid dynamic behavior in a square cavity driven by an oscillating lid using staggered grid-based finite volume method (Indukuri and Maniyeri, 2018). The numerical simulations were performed for the case of top wall oscillations for various combinations of Reynolds number and frequencies. From these simulations, an optimum frequency was chosen and then the vortex behavior for the cases of parallel wall oscillations was explored. McDonough (2007) investigated lid-driven cavity problem by use of a new form of large-eddy simulation at moderate Reynolds number to demonstrate the ability of the procedure to automatically predict transition to turbulence. They reported parallel speedups observed on a general-purpose symmetric multiprocessor employing MPI for parallelization. Gutt and Groşan (2015) analyzed the motion of an incompressible viscous fluid through a porous medium located in a two-dimensional square lid-driven cavity flow described by a generalized Darcy–Brinkman model. The effect of inertia and rheology parameters on the flow of viscoplastic fluids inside a lid-driven cavity is investigated using a stabilized finite element approximation (dos Santos et al. 2011). Patil, Lakshmisha, and Rogg (2006) presented the results for deep cavities with aspect ratios of 1.5–4, and Reynolds numbers of 50–3200. Several features of the flow, such as the location and strength of the primary vortex, and the corner-eddy dynamics were investigated and compared with previous findings from experiments and theory.

Direct numerical simulations about the transition process from laminar to chaotic flow in square lid-driven cavity 2D incompressible flow with increasing Reynolds numbers flows were considered by (Peng, Shiau, and Hwang, 2003). The spatial discretization consisted of a seventh-order upwind-biased method for the convection term and a sixth-order central method for the diffusive term.

*Collocated grid* arrangement is also implemented in order to simulate lid-driven cavity flows. Peng (Ding, 2017) employed the SIMPLE algorithm and its variants to solve the driven-cavity problem at Re < 10,000 by proposing a new segregated solver for determining the solution of incompressible flow on structured collocated grid systems. Case studies of steady incompressible flow in a 2D lid-driven square cavity were investigated for 100 < Re < 5000 by AbdelMigid et al. (Tamer, Khalid, Mohamed, and Ahmed, 2017). Collocated grid arrangement along with a uniform structured Cartesian grid was used. Yapici, Karasozen, and Uludag (2009) presented a finite volume technique for the numerical solution of steady laminar flow of Oldroyd-B fluid in a lid-driven square cavity over a wide range of Reynolds and Weissenberg numbers. Second-order central difference (CD) scheme was used for the convection part of the momentum equation while first-order upwind approximation was employed to handle viscoelastic stresses. In another work, a numerical collocated finite volume method was presented to study Buongiorno’s nanofluid model for MHD mixed convection of a lid-driven cavity filled with nanofluid (Elshehabey and Ahmed, 2015).

## Methods

### Aim and design for the study

The principal aim of the following research is to compare different computational methods for simulation of a cavity fluid flow driven by a moving lid and to introduce appropriate schemes. The model is based on the finite volume method of the governing equation semi-discretization in two over ally different formulations of staggered and collocated grid systems. The full discretization is made by both the first-order and the second-order upwind schemes. Three different coupling algorithms of SIMPLE, SIMPLEC, and SIMPLER are developed. Afterward, the results of all the methods are compared.

### Description of the methodology

#### Semi-discretization of governing equations

The physical and computational domains of the problem area square cavity with the dimensions of *L* whose upper lid is moving rightward with the velocity of u0. The origin of the Cartesian coordinate is located at the left lower corner of the cavity.

- 1)
Working fluid is incompressible.

- 2)
The shear stress tensor is proportional to the deformation rate (Newtonian fluid)

- 3)
There are no external body forces.

- 4)
The flow is laminar.

The governing equations are continuity and momentum equations, which for a steady laminar flow of incompressible fluid with constant viscosity and no external force are as follows:

Making governing equations non-dimensional enables us to incorporate some fluid and geometric parameters and to generalize the results of the simulation. We scale the *x* and *y* coordinates by the dimension of cavity *L*, the velocities by lid velocity, and pressure by dynamic pressure as described below:

Substituting the definitions, one can attain non-dimensionalized equations:

The fluid properties are incorporated into Reynolds number:

The next step is to discretize the computational domain. Whether the grid system is collocated or staggered, integrating governing Eqs. (5)–(7) over an arbitrary control volume depicted in Fig. 2 gives semi-discretized Eqs. (9)–(11).

The velocities with that are convecting velocities, which convey mass or momentum of fluid parcels. Considering uniform Cartesian grid and Δ*x* = Δ*y*, divide the last three equations by cross-sectional area, we have

The above equations govern all the control volumes and are applicable for both collocated and staggered grid. In the following section, the discretization of the equations for the collocated and staggered grid will be presented in details.

#### Discretization in staggered grid

The schematic of staggered grid arrangement is depicted in Fig. 2. Apparently, the *u*, *v*, and scalar (pressure) control volumes are staggered with respect to each other. Firstly, consider *x*-momentum Eq. (13) for non-boundary *u*-control volumes shown in Fig. 2. Approximate the diffusion terms of viscous stresses by central difference scheme.

Note that at the vertex points (*s* and *n* for *x*-momentum and *w* and *e* for *y*-momentum), term *uv* is approximated by central difference scheme as follows:

The pressure force exerted on the faces of *u*-control volume does not need to be approximated because the faces of *u*-control volume coincide with pressure node, so that

*x*-momentum equation, we attained the following algebraic linear equation based on the central node and neighboring node values of

*u*-velocity.

The boundary conditions of *x*-momentum equation are

Near left wall: for the first column of half-volumes whose centers located at *x* = 0, the no-penetration condition must be satisfied.

*u*

_{ww}does not exist, so the equations must be modified based on the first order upwind as follows:

*x*= 1, no-penetration condition must be satisfied.

*y*= 0: in these volumes, the viscous term of ∂

*u*/∂

*y*must be approximated by forward scheme rather than central scheme.

*U*

_{y = 0}is the velocity of the lower wall. Similarly, for the upper wall at the vicinity of

*y*= 1 the viscous term of ∂

*u*/∂

*y*must be approximated by backward scheme rather than central scheme

For four corners, a combination of the mentioned boundary conditions must be used.

*y*-momentum Eq. (14) for non-boundary

*v*-control volumes depicted in Fig. 2. To discretize diffusion terms for those CVs, we use the CDS.

*by*CDS.

*w*and

*e*, the term

*uv*is approximated by central difference scheme as follows:

The pressures at vertical faces coincide with their nodal points as follows:

*y*-momentum equation based on central and neighboring node values is as follows:

*v*-velocity CVs except for boundaries. The relations of the coefficients for the second order upwind are

Boundary conditions of *y*-momentum equation are as follows:

For the second row of *v*-velocity CVs, the second-order upwind must be replaced by the first one at positive flow.

*y*= 1)

*x*= 0), use forward difference scheme instead of CDS for discretization of viscous stress as

Where *V*_{x = 0} is the left wall velocity.

*x*= 1), implement the backward scheme to discretize the diffusion term.

At four corners of the computational domain, a combination of the described boundary conditions must be utilized.

The velocities at the faces of scalar CVs are their nodal values so

*u*and approximate solution

*u**:

Note that a relaxation factor is used for pressure correction.

*x*-momentum equation can be written as follows:

*u*

^{’}

_{nb}=

*u*

^{’}

_{P}

Where, \( {d}_P^u \) for algorithms SIMPLE and SIMPLEC equals \( \frac{1}{ap} \) and \( \frac{1}{ap-\sum anb\ } \), respectively.

*v*, we have the following relations:

*b*is

*P*

^{*}itself is calculated in the initial stage by virtual velocity field. To perform this, guess pressure and velocities and put velocities in pressure-free momentum Eqs. (76) and (77) to attain pseudo-velocities.

*P*

^{*}. From this stage onwards, SIMPLER algorithm is similar to SIMPLE algorithm.

#### Discretization in collocated grid

Similarly, for \( \hat{u} \) _{w} and \( {\hat{\mathrm{v}}}_{\mathrm{s}} \), similar relationships can be derived.

Coefficients of pressure correction equation which vary in *x*-direction

| 1 | 2 | 3 to |
| |
---|---|---|---|---|---|

| 0 | 0 | \( -\frac{d_W}{4} \) | 0 | 0 |

| 0 | \( \frac{d_P}{2} \) | \( \frac{d_W+{d}_P}{2} \) | \( \frac{d_W+{d}_P}{2} \) | \( \frac{d_W}{2} \) |

| \( \frac{d_E}{2} \) | \( \frac{d_P+{d}_E}{2} \) | \( \frac{d_P+{d}_E}{2} \) | \( \frac{d_P}{2} \) | 0 |

| 0 | 0 | \( -\frac{d_E}{4} \) | 0 | 0 |

Coefficients of pressure correction equation which vary in *y*-direction

| 1 | 2 | 3 to |
| |
---|---|---|---|---|---|

| 0 | 0 | \( -\frac{d_S}{4} \) | 0 | 0 |

| 0 | \( \frac{d_P}{2} \) | \( \frac{d_S+{d}_P}{2} \) | \( \frac{d_S+{d}_P}{2} \) | \( \frac{d_S}{2} \) |

| \( \frac{d_N}{2} \) | \( \frac{d_P+{d}_N}{2} \) | \( \frac{d_P+{d}_N}{2} \) | \( \frac{d_P}{2} \) | 0 |

| 0 | 0 | \( -\frac{d_N}{4} \) | 0 | 0 |

In order to apply the boundary conditions in the collocated grid, we go through the same way as for the staggered grid. It is noteworthy that in the collocated grid, more inner CVs are influenced by the boundary conditions than in staggered grid.

## Results and discussions

### Staggered grid independency

First, we need to examine the grid independence of the results. Grid independence study is carried out with FUDS, for Reynolds numbers of 10, 100, and 1000. The *v*-velocity profiles at *y =* 1/2 and the vorticity profiles at *x =* 0.9 (due to the formation of the secondary vertex in the lower right corner of the area) are implemented to check grid independency, though the results of the latter are presented.

*x =*0.9 are illustrated in Fig. 3. Four different grid systems of 10 × 10, 20 × 20, 40 × 40, and 60 × 60 are investigated. It is clear from the figure that the grid independency is obtained by grid 40 × 40. Figure 4 displays the vorticity profiles at

*x =*0.9 for grids 20 × 20, 40 × 40, 60 × 60, and 80 × 80 at Reynolds number of 100. Obviously, the grid independency for

*Re =*100 is obtained by grid 60 × 60. The vorticity profiles of grids 40 × 40, 60 × 60, 80 × 80, 100 × 100, 120 × 120, and 140 × 140 for

*Re =*1000 are presented in Fig. 5. The mesh independency in this case is obtained by grid 120 × 120.

### Collocated grid independency

*x =*0.9 for investigating the grid independence. The vorticity profiles at

*x =*0.9 and Reynolds number 10 is presented for grids 20 × 20, 40 × 40, and 60 × 60 in Fig. 6. It is clear from the figure that grid independence is obtained by grid 40 × 40. Figure 7 presents the vorticity profiles at

*x =*0.9 and Reynolds number 100 for grids 40 × 40, 60 × 60, and 80 × 80. This figure reveals that grid 60 × 60 is appropriate for independent results at

*Re =*100. The vorticity profiles at

*x =*0.9 with Reynolds number 1000 are depicted for grids 60 × 60, 80 × 80, 100 × 100, 120 × 120, and 140 × 140 in Fig. 8. It is clear from the figure that grid independency is obtained for

*Re =*1000 by grid 120 × 120.

Consequently, collocated and staggered grids require the same grid size to attain independent results at each Reynolds number.

### Staggered versus collocated

*u*-velocity profiles at

*x =*1/2 are shown for the three Reynolds numbers of 10, 100, and 1000 obtained by FUDS. The results of (Ghia et al. 1982) are presented as benchmark for

*Re =*100, 1000.

The results prove that in cases of coarse grid (less number of nodes), the difference of the results of collocated grid and staggered grid is larger. Moreover, the values obtained with staggered grid are slightly more accurate than collocated ones by comparison with the reference values. It should be pointed out that the error of two implemented approaches is higher in higher Reynolds numbers, especially in the regions with steep velocity gradients (see Fig. 11 for *u* at *y* = 0.17 and *y* = 0.85). This problem can be resolved by implementing a TVD scheme instead of the upwind scheme.

### FUDS versus SUDS

To compare the results of the second order UDS, with the results presented in the previous sections, which are obtained by the first order USD, simulations have been done with different number of nodes at Reynolds numbers 10, 100, and 1000. Prior to that, we studied the grid independency of the results of SUDS. For *Re =* 10, grid 40 × 40 gives the independent results identical to that of FUDS. At Reynolds number 100, grid 50 × 50 and grid 40 × 40 give the independent results. However, with FUDS, the mesh independency is obtained by grid 60 × 60. Grid 80 × 80 attains independent outcomes, whereas the grid independence is obtained in grid 120 × 120 by FUDS.

According to the aforementioned results, it can be concluded that at low Reynolds numbers, the grid sizes in which independency is attained are the same for both FUDS and SUDS. In contrast, at the high Reynolds numbers (*Re >* 100), FUDS require a finer grid than SUDS to attain independency. Consequently, the second order upwind scheme is an appropriate approximation for the large convection term at high Reynolds numbers.

*u*-velocity profiles at

*x =*1/2 are illustrated in Figs. 12, 13, and 14 respectively for 3 Reynolds numbers of 10, 100, and 1000 obtained with staggered grid. The results of (Ghia et al. 1982) are also brought in Figs. 13 and 14 for comparison.

With regard to these profiles, there is no superiority of SUDS over FUDS at low Reynolds numbers of 10. By contrast, SUDS has significantly less error than FUDS at Reynolds number 100 in coarse grids, and this issue reveals the SUDS accuracy in the approximation of the momentum convection terms. Of course, the errors of both schemes reduce by fining the grid. In any case, SUDS have closer values to the reference results. The differences in values presented in Fig. 14 for *Re =* 1000 are more obvious. In this Reynolds number, FUDS has a considerable error even with a fine grid of 120 × 120 (noting that FUDS results are grid independent in this number of nodes). The SUDS results even by grid 40 × 40 have less error than grid independent results of FUDS. Furthermore, SUDS with grid 120 × 120 exactly coincide with the benchmark of (Ghia et al. 1982).

### Coupling algorithms of SIMPLE family

*x*-momentum equation is plotted for 3 algorithms of SIMPLE family at Reynolds numbers of 10, 100, and 1000. The residual in terms of iteration number for

*Re*= 10 for SIMPLE, SIMPLEC, and SIMPLER is shown in Fig. 15. Obviously, the SIMPLER algorithm apparently converges with the number of iterations about 40% of that of SIMPLE. Considering the fact that the number of calculations in each iterate involved in SIMPLER is about 30% larger than that for SIMPLE (Versteeg and Malalasekera, 2007), the simulation time SIMPLER is about half of the SIMPLE. Unfortunately, SIMPLER gives devastating oscillatory solution. SIMPLEC ranks the second in speed but it causes oscillatory solution and of course less than SIMPLER.

*Re =*100. The performance of SIMPLE and SIMPLEC algorithms are alike and nearly smooth while SIMPLER is still faster but substantially oscillatory. The residuals for Reynolds number 1000 are illustrated in Fig. 17. Here, the trends are thoroughly different from the previous graphs. From iteration number 800 onwards, SIMPLEC algorithm loses its performance and its convergence rate drops. SIMPLE and SIMPLER behave fairly smooth with acceptable convergence rate. Multiplying the number of iterations by the number of calculations in each iterate ranks SIMPLER as the fastest.

All in all, SIMPLEC algorithm is a proper choice for low Reynolds numbers of order of 10, SIMPLE is suitable for Reynolds numbers of order of 10^{2}, and SIMPLER is the fastest for moderate Reynolds numbers of order of 10^{3}.

### Overall comparison of the methods

*u*-velocity profiles along

*y*-axis

*x =*1/2 and

*v*-velocity profiles along

*x*-axis at

*y =*1/2 for

*Re =*1000 are depicted in Figs. 18 and 19, respectively.

According to the two figures, it can be inferred that FUDS is rather inaccurate due to numerical diffusion especially in the regions with large gradients, and it makes the velocity profile smoother. Moreover, staggered and collocated grids have the same results with FUDS. Nevertheless, with SUDS, staggered grid has more accuracy than the collocated grid. It is remarkable that the results of staggered grid with 120 × 120 and SUDS coincide with the results of (Ghia et al. 1982). Totally, staggered grid with SUDS gives the most accurate results followed by collocated grid with SUDS.

## Conclusion

In the present paper, a lid-driven cavity problem is modeled via two basically different approaches of spatial discretization: collocated and staggered. From CFD point of view, it is noteworthy that the semi-discrete equations of the staggered grid and the collocated grid are similar. The main difference is in the calculation of convecting velocities and applying the boundary conditions.

Grid independency study proves that collocated and staggered grids require equal grid size to attain independent results at same Reynolds numbers. By coarse grid, the difference of the results of the collocated grid and the staggered grid is larger. Also, the error of two approaches is higher in higher Reynolds numbers, especially in the regions with steep gradients. At low Reynolds numbers, the grid size in which independency is attained is the same for both FUDS and SUDS. In contrast, at the moderate Reynolds numbers, FUDS require a finer grid than SUDS to attain independency. There is no superiority of SUDS over FUDS at low Reynolds numbers whereas SUDS has considerably less error than FUDS at moderate Reynolds numbers. By comparing different coupling algorithms it can be concluded that SIMPLEC algorithm is a proper choice for low Reynolds numbers of order of 10, SIMPLE is suitable for Reynolds numbers of order of 10^{2}, and SIMPLER is the fastest for moderate Reynolds numbers of order of 10^{3}.

Briefly, FUDS is rather inaccurate due to numerical diffusion especially in the regions with large gradients, and it makes the velocity profile smoother and staggered, and collocated grids have the same results with FUDS. Besides, staggered grid with SUDS gives the most accurate results followed by collocated grid with SUDS.

## Nomenclatures

*A* cross-sectional area

*a* coefficient in discretized equation

*b* source term

*d* pressure term coefficient

*L* cavity dimension

*P* pressure

*P*_{0} reference pressure

*Re* Reynolds number

*u* velocity in *x*-direction

*u*_{0} lid velocity

*v* velocity in *x*-direction

*x* longitudinal coordinate

*y* transversal coordinate

### Greek letters

*ρ* density

*μ* dynamic viscosity

### Subscripts

*I* node number in *x*-direction

*i* face number in *x*-direction

*J* node number in *y*-direction

*j* face number in *y*-direction

### Superscripts

*** dimensional parameter

## Notes

### Acknowledgements

The authors express their special thanks to Professor Ali Ashrafizadeh from K.N. Toosi University of Technology for all his help.

### Authors’ contributions

AAB has developed the model and wrote the computer code. MMH has written the manuscript text and prepared the figures. The manuscript text is finally amended by AAB. Both authors read and approved the final manuscript.

### Funding

This research does not have any funding.

### Competing interests

The authors declare that they have no competing interests.

## References

- Ding, P. (2017). Solution of lid-driven cavity problems with an improved SIMPLE algorithm at high Reynolds numbers.
*International Journal of Heat and Mass Transfer, 115*, 942–954.CrossRefGoogle Scholar - dos Santos, D. D. O., et al. (2011). Numerical approximations for flow of viscoplastic fluids in a lid-driven cavity.
*Journal of Non-Newtonian Fluid Mechanics, 166*(12–13), 667–679.CrossRefGoogle Scholar - Elshehabey, H. M., & Ahmed, S. E. (2015). MHD mixed convection in a lid-driven cavity filled by a nanofluid with sinusoidal temperature distribution on the both vertical walls using Buongiorno’s nanofluid model.
*International Journal of Heat and Mass Transfer, 88*, 181–202.CrossRefGoogle Scholar - Ghia, V., Ghia, K. N., & Shin, C. T. (1982). High-resolutions for incompressible flow using the Navier-stokes equations and a multi-grid method.
*Journal of Computational Physics, 48*, 387–411.CrossRefGoogle Scholar - Gutt, R., & Groşan, T. (2015). On the lid-driven problem in a porous cavity. A theoretical and numerical approach.
*Applied Mathematics and Computation, 266*, 1070–1082.MathSciNetCrossRefGoogle Scholar - Indukuri, J. V., & Maniyeri, R. (2018). Numerical simulation of oscillating lid driven square cavity.
*Alexandria Engineering Journal, 57*, 2609–2625.CrossRefGoogle Scholar - McDonough, J. M. (2007). Parallel simulation of turbulent flow in a 3-D lid-driven cavity. In
*Parallel computational fluid dynamics 2006*(pp. 245–252). Elsevier Science BV. https://www.sciencedirect.com/science/article/pii/B978044453035650033X. - Patil, D. V., Lakshmisha, K. N., & Rogg, B. (2006). Lattice Boltzmann simulation of lid-driven flow in deep cavities.
*Computers & Fluids, 35*(10), 1116–1125.CrossRefGoogle Scholar - Peng, Y.-F., Shiau, Y.-H., & Hwang, R. R. (2003). Transition in a 2-D lid-driven cavity flow.
*Computers & Fluids, 32*(3), 337–352.CrossRefGoogle Scholar - Tamer, A. A. M., Khalid, M. S., Mohamed, A. K., & Ahmed, A. A. (2017). Revisiting the lid-driven cavity flow problem: Review and new steady state benchmarking results using GPU accelerated code.
*Alexandria Engineering Journal, 56*, 123–135.CrossRefGoogle Scholar - Versteeg, H. K., & Malalasekera, W. (2007).
*An introduction to computational fluid dynamics: The finite volume method*(2nd ed.). Pearson Education. https://www.amazon.com/Introduction-Computational-Fluid-Dynamics-Finite/dp/0131274988. https://pearson.com.au/products/Versteeg-Malalasekra/An-Introduction-to-Computational-Fluid-Dynamics-The-Finite-Volume-Method/9780131274983?R=9780131274983. - Yapici, K., Karasozen, B., & Uludag, Y. (2009). Finite volume simulation of viscoelastic laminar flow in a lid-driven cavity.
*Journal of Non-Newtonian Fluid Mechanics, 164*, 51–65.CrossRefGoogle Scholar

## Copyright information

**Open Access**This article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.