A staggered grid numerical method for the Navier-Stokes equation.

9

NATURAL-A Journal of Scientific Modeling & Computation, Volume 1 No.2 – 2014

A Staggered Grid Numerical Method for
the Navier-Stokes Equation
Sudi Mungkasi
Department of Mathematics, Faculty of Science and Technology,
Sanata Dharma University, Mrican, Tromol Pos 29, Yogyakarta 55002, Indonesia.
Email: sudi@usd.ac.id
Abstract— We consider incompressible fluid flows governed by the two-dimensional Navier-Stokes equation.
The Navier-Stokes equation is solved numerically using a staggered grid finite difference method. Our aim in this
paper is to assess the performance of this numerical method for the Navier-Stokes equation. The lid-driven
cavity problem is taken into account to test the numerical method. In order to achieve our aim we focus on the
motion of the fluid, and in particular, its velocity. Our results are compared with some available benchmark data.
Keywords— finite difference method, lid-driven cavity flow, Navier-Stokes equation, staggered grid.

1

INTRODUCTION
The Navier-Stokes equation has been used to simulate both compressible and incompressible fluid


flows. Its analytical solution is not available in general, until this paper is written. Due to its wide
applications, a robust numerical method is desired. Some simplification of the Navier-Stokes equation are
also available, such as the Euler equation for gas dynamics and the Saint-Venant system for shallow water
flows. This paper deals with incompressible fluid flows governed by the two-dimensional Navier-Stokes
equation.
A number of authors (see for example [1]-[6]) attempted to solve the Navier-Stokes equation. Biringen
and Chow [1] provides a detailed explanation on several staggered grid finite difference methods. Harlow and
Welch [2] proposed a staggered grid method called the Marker-And-Cell. Huser and Biringen [3] solved the
Navier-Stokes equation using a staggered grid method modified from some other authors. Li [4] proposed an
adaptive grid method, where grid positions with large errors are refined. Erturk et al. [5] provides benchmark
data that can be used to assess a new numerical method for the Navier-Stokes equation. Moin et al. [6]
proposed necessary conditions for the stability of staggered grid methods.
In this paper we are interested in assessing the staggered grid finite difference method presented by
Biringen and Chow [1]. We compare the numerical results with available benchmark data of Erturk et al. [5].
The comparison gives idea about difficulty, accuracy and robustness of the the staggered grid finite
difference method. This kind of comparison was not given in the work of Biringen and Chow [1]. Therefore,
this paper completes the work of Biringen and Chow [1].
The rest of this paper is organized as follows. The Navier-Stokes equation is recalled in Section 2. The
staggered grid finite difference method is summarized in Section 3. Numerical results of this staggered grid

method are presented and compared with benchmark data in Section 4. Finally, Section 5 draws some
concluding remarks.

2

THE NAVIER-STOKES EQUATION
In this subsection we recall the Navier-Stokes equation in two dimensions [1]. It is given by the

following system:

(1)

∇.V = 0,

ISSN 2303-0135

10

A Staggered Grid Numerical Method for the Navier-Stokes Equationta


∂V
+ V⋅∇V = −VP + Re−1 ∇ 2 V.
∂t

(2)

Here, the quantities are dimensionless. The free variables are time t and space (x, y) . The vector

V = [u v]T where u = u(x, y,t) is the velocity at the x -direction and v = v(x, y,t) is the velocity at the y direction. The variable P = p / ρ , where is thermodynamic pressure and ρ is the fluid density. Using (1) we
define

(3)

H = V⋅ ∇V = ∇ V ⋅ (VV).
The Reynolds number Re is defined as

Re =

Uo L
,

µ

(4)

in which U o is the characteristic velocity scale, L is the characteristic length and µ is the viscosity of the
fluid. Note that

(5)

V⋅ ∇V = ∇(VV) − V∇⋅ V.
Employing the continuity (1), we have

V∇ ⋅ V = 0.

(6)

Therefore, we obtain

$
&

&
&
V ⋅ ∇V = &
&
&&
%

'
∂u 2 ∂uv )
+
∂x ∂y )
)
).
2
∂uv ∂u )
+
∂x ∂y ))
(

(7)


The the Navier-Stokes equation can now be rewritten as

∂u ∂v
+ =0,
∂x ∂y

(8)

# ∂2 u ∂2 u & ∂P
∂u ∂u 2 ∂uv
+
+
= Re−1 % 2 + 2 ( −
,
∂t ∂x ∂y
$ ∂x ∂y ' ∂x

(9)


# ∂2 v ∂2 v & ∂P
∂v ∂uv ∂v 2
+
+
= Re−1 % 2 + 2 ( −
.
∂t ∂x ∂y
$ ∂x ∂y ' ∂y

(10)

Here (8) is equivalent to (1). Equations (9) and (10) are equivalent to (2).

3

THE NUMERICAL METHOD
In this section, we summarize the staggered finite difference method that was used by Biringen and

Chow [1]. The predictor-corrector finite difference method is applied. First we consider the evolution from
time t n to tˆ . When the pressure gradient is omitted, the Crank-Nicolson scheme is used to discretize the

time and the Adams-Bashforth is used to discretize the convective terms, we have

ˆ − Vn
V
3
1
1
ˆ + V n ).
= − H n + H n−1 +
∇ 2 (V
Δt
2
2
2 Re

(11)

Then in the similar way, the evolution from time t n to t n +1 leads to

3

1
1
V n+1 − V n
= − H n + H n−1 +
(∇ 2 V n+1 + ∇ 2 V n ) − ∇Pn+1.
2
2
2 Re
Δt

NATURAL-A © 2014 http://natural-a.ub.ac.id/

(12)

11

NATURAL-A Journal of Scientific Modeling & Computation, Volume 1 No.2 – 2014

The corrector step employs the following scheme


ˆ
1
V n+1 − V
=
(∇ 2 V n+1 − ∇ 2 V) − ∇P n+1 =:−∇ϕ n+1,
2 Re
Δt

(13)

where it is obtained by the subtraction (11) from (12). Taking the divergence of (13) results in

ˆ
∇ ⋅ V n+1 − ∇ ⋅ V
= −∇ 2ϕ n+1.
Δt

(14)

Now, enforcing continuity at the time level (n +1),


∇ ⋅ V n+1 = 0,

(15)

we have from (14):

ˆ
∇⋅V
= ∇ 2ϕ n+1.
Δt

(16)

The solution process can now be constructed as follows.
Step 1. Solve for V from (11):
n
ˆ
V
1
ˆ = − 3 H n + 1 H n−1 + 1 ∇ 2 V n + V .

∇2V
Δt 2 Re
Δt
2
2
2 Re
Multiplying through by Δt , the x component of (17) can be written in Cartesian coordinates:

Δt 2
3Δt n
Δt
Δt 2 n
∇ ûi, j = −
(H u )i, j + (H un−1 )i, j +
∇ ui, j + ui,n j .
2 Re
2
2
2 Re
Using second-order central difference approximations with Δx = Δy = h , we obtain
ûi, j −

−ûi+1, j − ûi−1, j − ûi, j+1 − ûi, j−1 + (4 + β1 )ûi, j = (RHSun )i, j .

(17)

(18)

(19)

n
u

The quantities β1 and (RHS ) are defined respectively as

β1−1 ≡

Δt
,
2 Re h 2

(20)

and

3Δt β1 n
Δt β1 n−1
(H u )i, j +
(H u )i, j
2
2
n
n
n
n
n
n
n
+ (ui+1,
j − 2u + ui−1, j )+ (ui, j+1 − 2ui, j + ui, j−1 )+ β1ui, j .

(RHSun )i, j = −

(21)

Equation (20) can be rewritten as:

−ûi+1, j − ûi−1, j − ûi, j+1 − ûi, j−1 + (4 + β1 )ûi, j = (RHSun )i, j .
Step 2. Solve for

(22)

φ n +1 using (16) with second-order central difference approximations. This equations is

written as
n+1
n+1
n+
n+1
n+1
(ϕ i+1,
j + ϕ i−1, j + ϕ i, j+1 + ϕ i, j−1 − 4ϕ i, j ) =

h 2 % ∂û ∂v̂ (
' + *.
Δt & ∂x ∂y )

(23)

Step 3. The velocity field is updated using (13):

ˆ
V n+1 − V
= −∇ϕ n+1,
Δt

(24)

that is,

ˆ − ( Δt ) ∇ϕ n+1 .
V n+1 = V

(25)

ISSN 2303-0135

12

A Staggered Grid Numerical Method for the Navier-Stokes Equationta

Writing (25) component-wisely, we have
n+1
n
ui+1/2,
j = ûi+1/2, j − ( Δt )

∂ϕ
∂x

n+1

,

(26)

.

(27)

i, j

and
n+1
i, j+1/2

v

n
i+1/2, j

= v̂

∂ϕ
− ( Δt )
∂y

n+1

i, j

n
n
Note that in Step 3 above, the variables ûi+1/2,
j and v̂i+1/2, j are defined at staggered grids and obtained

from the following procedure. First we take into account that the following derivative approximations are
used in the computations:
n+1
(u n+1 − u n )
" ∂u %
= i+1/2, j i+1/2, j ,
$ '
# ∂t &i+1/2, j
Δt

(28)

n+1

n+1
n+1
" ∂2 u %
(u n+1 − 2ui+1/2,
j + ui+3/2, j )
= i−1/2, j
,
$ 2'
Δx 2
# ∂x &i+1/2, j

(29)

n+1
(P n+1 − P n+1 )
" ∂P %
= i+1, j i, j .
$ '
# ∂x &i+1/2, j
Δx

(30)

Using the Marker-And-Cell method [2], the other terms in equations (9) and (10) are written as
n

2
2 n
" ∂u 2 %
(ui+1,
j − ui, j )
=
,
$
'
Δx
# ∂x &i+1/2, j

(31)

1
ui+1, j = (ui+1/2, j + ui+3/2, j ) ,
2
" ∂uv %
[(uv)i+1/2, j+1/2 − (uv)i+1/2, j−1/2 ]
=
'
$
Δy
# ∂y &i+1/2, j

(32)

(33)

1
= *+(ui+1/2, j+1/2 )(vi+1/2, j+1/2 ) − (ui+1/2, j−1/2 )(vi+1/2, j−1/2 ),- ,
Δy
where

1
ui+1/2, j+1/2 = (ui+1/2, j + ui+1/2, j+1 ) ,
2
1
vi+1/2, j+1/2 = (vi+1/2, j + vi+1/2, j+1 ) ,
2
1
ui+1/2, j−1/2 = (ui+1/2, j−1 + ui+1/2, j ) ,
2
1
vi+1/2, j−1/2 = (vi, j−1/2 + vi+1, j−1/2 ) .
2

(34)
(35)
(36)
(37)

Then we have
n
2
n
n
n
(u n )2 − (ui+1,
(uv)i+1/2,
ûi+1/2, j − ui+1/2,
j)
j−1/2 − (uv)i+1/2, j+1/2
j
= i, j
+
Δx
Δy
Δt
1
n
n
n
+
(ui+3/2,
j − 2ui+1/2, j + ui−1/2, j )
Re Δx 2
1
n
n
n
(ui+1/2,
+
j − 2ui+1/2, j + ui+1/2, j−1 ) ,
Re Δy 2

NATURAL-A © 2014 http://natural-a.ub.ac.id/

(38)

13

NATURAL-A Journal of Scientific Modeling & Computation, Volume 1 No.2 – 2014

and
n
n
(vi,n j )2 − (vi,n j+1 )2
v̂i, j+1/2 − vi,n j+1/2 (uv)i−1/2,
j+1/2 − (uv)i+1/2, j+1/2
=
+
Δx
Δy
Δt
1
n
n
n
+
(vi+1,
j+1/2 − 2vi, j+1/2 + vi−1, j+1/2 )
Re Δx 2
1
(vi,n j+3/2 − 2vi,n j+1/2 + vi,n j−1/2 ) .
+
Re Δy 2

(39)

The necessary conditions for stability of the method are:

( " | u | | v | %+
c1 (t) := max i, j *Δt $$ i, j + i, j ''- ≺ 0.5 ,
Δy j &-,
*) # Δxi

(40)

( Δt " 1
1 %+
'- ≺ 0.1 ,
+
c2 (t) = max i, j * $$
2
2'
*) Re # (Δxi ) (Δy j ) &-,

(41)

and

where the notation " ≺ " means "less than about."

4

NUMERICAL RESULTS
In this section we present the simulation results of the staggered grid finite difference method. We

consider the lid-driven cavity flow problem, where the space domain in a unit square, that is, all points
(x, y) ∈ [0, 1]×[0, 1]. The initial condition in the unit square is fluid at rest. The boundary conditions are
solid wall, except the positions (x, 1) with all x ∈ [0, 1] having velocity u ( x, t ) = 1 and v( x, t ) = 0 . This test is
taken from the work of Biringen and Chow [1], Huser and Biringen [3], Li [4] and Erturk et al. [5].

Figure 1. Streamlines for mesh size

ISSN 2303-0135

99× 99 .

14

A Staggered Grid Numerical Method for the Navier-Stokes Equationta

Taking the viscosity µ = 1000 , we obtain the streamlines at the steady state as shown in Figure 1. Here
we use the mesh size 99 × 99. The results are similar to those of Li [4] and Erturk et al. [5], which means that
our numerical solutions are correct up to a tolerance. Here we have used the tolerance is 10 −9 for the
difference between the maximum of absolute velocities u n at time t n and u n+1 at time t n+1 . We note that this
tolerance may not be very strict, because the machine precision is 10 −15 . However we are confident with this
solution as it has the correct behaviour. The solution produces three clear vortices: one at the center, one at
the bottom left corner and another one at the bottom right corner of the space domain.
When we plot the velocity profile and compare with the available benchmark data (see the data of
Erturk et al. [5]), we find that our numerical solutions mimic the benchmark data. The benchmark data is
obtained from a different numerical method, and the data is not an analytical solution. Even though some
errors occur, but these errors are not very large, as illustrated in Figure 2 and Figure 3. The errors could be
reduced if we used smaller tolerance. In addition, the errors are compromised with the simplicity of the
numerical method we have used here.

Figure 2. Horizontal profile of velocity field u at x=0,5 for mesh size 99 × 99 .
Here the horizontal axis is the velocity u in the x -direction. The vertical axis is the y -positions corresponding to x=0,5 . The
solid line is the present solution. The dashed line is the benchmark data of Erturk et al. [5].

Figure 3. Vertical profile of velocity field y at y=0,5 for mesh size 99 × 99 .
Here the horizontal axis is the variable y . in the y -direction. The vertical axis is the x -positions corresponding to y=0,5 . The
solid line is the present solution. The dashed line is the benchmark data of Erturk et al. [5].

NATURAL-A © 2014 http://natural-a.ub.ac.id/

NATURAL-A Journal of Scientific Modeling & Computation, Volume 1 No.2 – 2014

5

15

CONCLUSION
The staggered grid finite difference method has been tested to solve the lid-driven cavity flow problem.

We find that the method is simple to implement, and it couples the velocity and the pressure of the fluid
resulting in a stable solution. The solution is relatively accurate with respect to available benchmark data. In
general the method is robust, and may be used to solve problems with high Reynold numbers, which could
be our future research.

6
[1]
[2]
[3]
[4]
[5]
[6]

REFERENCES
S. Biringen and C.-Y. Chow, “An Introduction to Computational Fluid Mechanics by Example”, Hoboken, New Jersey: John Wiley and
Sons, 2011.
F. H. Harlow and J. E. Welch, “Numerical Calculation of Time-Dependent Viscous Incompressible Flow of Fluids with Free Surface”,
Physics of Fluids, Vol. 8, pp. 2182–2189, 1965.
A. Huser and S. Biringen, “Calculation of Wind-Driven Flow at High Reynolds Numbers”, International Journal for Numerical Methods in
Fluids, Vol. 14, pp. 1087–1109, 1992.
Z. Li, "Accuracy analysis of a mesh refinement method using benchmarks of 2-D lid-driven cavity flows and finer meshes", Journal of
Mathematical Chemistry, Vol. 52, pp. 1156–1170, 2014.
E. Erturk, T. C. Corke and C. Gökcöl, "Numerical solutions of 2-D steady incompressible driven cavity flow at high Reynolds numbers",
International Journal for Numerical Methods in Fluids, Vol. 48, pp. 747–774, 2005.
P. Moin, W. C. Reynolds and J. H. Ferziger, "Large Eddy Simulation of Incompressible Turbulent Channel Flow", Technical Report TF-12,
Thermosciences Division, Department of Mechanical Engineering, Stanford University, Stanford, California, 1978.

ISSN 2303-0135