Numerical Computation of A Two-Dimensional Navier-Stokes Equation Using An Improved Finite Difference Method
Numerical Computation of A Two-Dimensional Navier-Stokes Equation Using An Improved Finite Difference Method
c
Department of Mathematics, UTM.
1,5
Nursalasawati Rusli, 2 Erwan Hafizi Kasiman
3
Ahmad Kueh Beng Hong, 4 Airil Yasreen Mohd Yassin, 5 Norsarahaida Amin
1 Institute of Engineering Mathematics, Universiti Malaysia Perlis
02000 Kuala Perlis, Perlis, Malaysia
1,5 Department of Mathematics, Faculty of Science,
1 Introduction
Numerical simulation of fluid flow has been a major topic of research for the past few
decades, [1]. Computational fluid dynamics (CFD) is one of the prominent physical disci-
plines that involves the description of the fluid flow in terms of mathematical models that
include convective and diffusive transport of some variables. These mathematical mod-
els consist of a set of governing equations in the form of ordinary or partial differential
equations. Over the years, the finite difference method (FDM) is frequently used in CFD.
One of the main challenges in the FDM is in the handling of the pressure of the flow. In
general, no physical specification of pressure exists. Even though there are three equations
for the three unknowns u, v, p, there is no explicit equation which can be used for pressure.
In most finite difference solution schemes for incompressible steady flows, the pressure field
is obtained from a Poisson equation which is derived from the momentum equations and
the continuity equation, [2]. The difficulty inherent in this approach is the need to decide
on additional boundary conditions for the pressure [3]. Petersson [4] discussed this problem
in details.
To overcome this problem, Zhang et al. [5] used a fully explicit second-order accurate
time marching scheme via a pointbased compact finite difference method,where the pressure
Poisson equation was solved by a pseudo-time marching procedure. Petersson [4] proposed
a new scheme that was implemented with SIMPLE-type algorithm for the pressure field cal-
culation similar to that of finite volume methods. The discretised equations were developed
2 Nursalasawati, Erwan Hafizi, Ahmad Kueh, Airil Yasreen
as a purely finite difference formulation. The convective terms in the momentum equations
were approximated using the first or second order finite difference formula.
A number of experimental and numerical studies have been conducted to investigate
the flow field of a lid-driven cavity flow in the last several decades ( [1], [7], [8], [9]). It is
known that the lid-driven cavity flow problem is not only technically important but also
of great scientific interest because it displays almost all fluid mechanical phenomena in the
simplest geometrical settings, [10]. The problem is also attractive because of its importance
in industrial applications such as coating and drying technologies, melt spinning processes
and many others, [11]. The present work is concerned with the validation of a lid-driven
cavity flow using a new FDM approach.
2 Governing Equations
The dimensionalised governing equations of the fluid flow are given respectively by the
continuity equation
∂u∗ ∂v∗
+ =0 (1)
∂x∗ ∂y∗
x-momentum equation
∂ 2 u∗ ∂ 2 u∗
∂u∗ ∗ ∂u
∗
1 ∂p∗
u∗ + v = − +ν + (2)
∂x∗ ∂y∗ ρ ∂x∗ ∂x∗2 ∂y∗2
y-momentum equation
∂ 2 v∗ ∂ 2 v∗
∂v∗ ∂v∗ 1 ∂p∗
u∗ + v∗ ∗ = − +ν 2 + (3)
∂x ∗ ∂y ρ ∂y∗ ∂x ∗ ∂y∗2
where u and v are the velocity components in the x and y directions respectively, p is the
pressure, ρ is the constant density, and ν is the viscosity.
Using the dimensionless definitions, [12],
t∗ U x∗ y∗ u∗ v∗ p∗
t= ,x = ,y = ,u = ,v = ,p = .
h h h U U ρU 2
∂u ∂v
+ =0 (4)
∂x ∂y
∂2u ∂2u
∂u ∂u ∂p 1
u +v =− + + 2 (5)
∂x ∂y ∂x Re ∂x2 ∂y
∂2v ∂2v
∂v ∂v ∂p 1
u +v =− + 2
+ 2 (6)
∂x ∂y ∂y Re ∂x ∂y
where Re = U h/ν is the Reynolds number.
Numerical Computation of a Two-Dimensional Navier-Stokes Equation 3
3 Numerical Method
3.1 Finite Differencing on a Staggered Grid
Consider a two-dimensional rectangular cavity flow domain which is discretised using a
regular Cartesian mesh as shown in Figure 1. The mesh is uniform in x and y directions.
A staggered grid is used to store the velocity components u and v and the pressure p.
As indicated in Figure 1, the values of u and v are stored at the i-1,j and i,j+1 locations
respectively and p is stored at i,j. Thus, the u-momentum (equation 5) is discretised at
i-1,j, the v-momentum (equation 6) at i,j+1, and the continuity (equation 4) at i,j. Here,
a first-order upwind differencing scheme is used to approximate the convective terms in
the momentum equations, while a second-order central differencing is used for the diffusion
terms. The pressure gradients are approximated by a second order central difference scheme.
accurate expression while the diffusion term takes the first order accurate expression. It
hence leads to the creation of different formulae for different node locations. On the other
hand, equally spaced grid points are chosen in this study. Discretisation of the u- and v-
momentum equations at interior nodes can be used at the wall boundary. The discretisation
of the momentum equations are summarized as follows.
p̂i−2,j − p̂i,j
aint int int int int
P ui−1,j + aN ui−1,j+2 + aS ui−1,j−2 + aW ui−3,j + aE ui+1,j =
2ρ∆x
where
ûi−1,j 1 1
aint
P = +ν +
2∆x 2∆x2 2∆y2
v̂i−1,j ν
aint
N = −
4∆y 4∆y2
v̂i−1,j ν
aint
S =− −
4∆y 4∆y2
ûi−1,j ν
aint
W =− −
2∆x 4∆x2
ν
aint
E =−
4∆x2
Variables with the carets above them are the quantities that will be calculated at the
previous iteration. Because of the use of a staggered grid, the values of v in the u-momentum
equation and u in the v-momentum equation, appearing as the coefficients of the convective
derivatives, are not available at the desired points.
Therefore, these velocities are computed to a second order accuracy using the velocities
of four surrounding grid points at which they are stored,
ui+1,j + ui+1,j+2 + ui−1,j + ui−1,j+2
u|i,j+1 =
4
vi,j−1 + vi,j+1 + vi−2,j−1 + vi−2,j+1
v|i−1,j =
4
The discrete u-momentum equations at boundary nodes are the same as interior node
with some modifications. For example, the discrete u-momentum equations at the inlet
nodes is the same as interior node except that the value of u1,j is known.
where
ûi,j+1 1 1
bint
P = +ν +
2∆x 2∆x2 2∆y2
v̂i,j+1 ν
bint
N = −
4∆y 4∆y2
v̂i,j+1 ν
bint
S =− −
4∆y 4∆y2
ûi,j+1 ν
bint
W =− −
2∆x 4∆x2
ν
bint
E =−
4∆x2
where
1 1 1 1
cint
P = 2
+ 2
+ 2
+ 2
4ρ∆x ai+1,j 4ρ∆x ai−1,j 4ρ∆y bi,j+1 4ρ∆y bi,j−1
1
cint
E =−
4ρ∆x2 ai+1,j
1
cint
W =−
4ρ∆x2 ai−1,j
1
cint
N =−
4ρ∆y2 bi,j+1
1
cint
S =− 2
4ρ∆y bi,j−1
ii) Solve the momentum equations to obtain the intermediate velocity components U ∗ ,
V ∗.
0
iii) Solve the pressure-correction equation to obtain the pressure correction p .
iv) Update the intermediate pressure and velocity fields with the corrected values p =
0 0 0
p∗ + p , U = U ∗ + U , V = V ∗ + V .
6 Nursalasawati, Erwan Hafizi, Ahmad Kueh, Airil Yasreen
v) Take the newly corrected pressure p as a new initial pressure p∗ and repeat the entire
procedure until a fully converged solution is obtained.
Note that the pressure-correction equation is also prone to divergence unless an under-
relaxation is implemented.
Zogheib [6] used the Tri-Diagonal Matrix Algorithm (TDMA) to solve the system of
discretised equations. However, this algorithm takes a considerable long time to converge.
In the present algorithm, a modification is provided in the form of a direct method to
remedy the problem. It has been shown that a rapid convergence can be achieved through
this method, [13].
4 Numerical Results
The developed finite difference formulation is applied to a well-establised benchmark prob-
lem, namely, the flow in a lid-driven cavity. This problem is considered to be important
validation test case for any numerical method. The lid-driven cavity problem has long been
used as the test or validation case for new codes or new solution methods. The problem
geometry is simple and two-dimensional, and the boundary conditions are also simple. The
standard case is fluid contained in a square domain with the Dirichlet boundary conditions
on all sides, with three stationary sides and one moving side (with a prescribed velocity
tangent to the side). The boundary conditions for the present problem are illustrated in
Figure 2.
A good set of data for comparison is the data of Ghia at el. [1]. It includes tabulated
results for various Reynolds numbers. Figure 3 shows the velocity component u along the
vertical line through the geometric centre of cavity for Re=100. Figure 4 shows the velocity
component v along the horizontal line through the geometric centre of cavity for Re=100.
It is demonstrated in the figures that very good agreements have been achieved through the
comparison of the present model with those obtained by Ghia at el. [1].
Numerical Computation of a Two-Dimensional Navier-Stokes Equation 7
0.9
0.8
0.7
0.6
0.5
Y
0.4
0.3
0.2
Ghia et. al (1982)
0.1 Zogheib (2006)
Present Method
0
−0.2 0 0.2 0.4 0.6 0.8 1
u
Figure 3: Velocity Along the Vertical Line Through the Geometric Centre of Cavity for
Re=100
0.2
0.15
0.1
0.05
−0.05
v
−0.1
−0.15
−0.2
Ghia et. al (1982)
−0.25 Zogheib (2006)
Present Method
Figure 4: Velocity Along the Horizontal Line Through the Geometric Centre of Cavity for
Re=100
The velocity contour of the cavity flow for Re=100 is shown in Figure 5.
5 Conclusions
An improved finite difference method for solving the two-dimensional, steady, incompress-
ible, laminar, viscous flow equations on a staggered grid is presented for the validation of
the fundamental lid-driven cavity flow problem. Good agreements have been achieved for
the benchmark test.
Acknowledgemnts
The first author is financially supported by Universiti Malaysia Perlis (UniMAP) and SLAI
(JPA) during the course of this work.
8 Nursalasawati, Erwan Hafizi, Ahmad Kueh, Airil Yasreen
0.9 0.9
0.8 0.8
0.7 0.7
0.6 0.6
0.5 0.5
0.4 0.4
0.3 0.3
0.2 0.2
0.1 0.1
0
0 0.2 0.4 0.6 0.8 1
References
[1] Ghia, U., Ghia, K.N. and Shin, C.T. High-Re Solutions for Incompressible Flow Us-
ing the Navier-Stokes Equations and a Multigrid Method. Journal of Computational
Physics. 1982. 48 : 387–411.
[2] Johnston, H. and Liu, J.G. Finite difference schemes for incompressible flow based
on local pressure boundary condition. Journal of Computational Physics. 2002. 180 :
120–154.
[3] Strikwerda, J.C. High order-accurate schemes for incompressible viscous flow. Inter-
national Journal for Numerical Methods in Fluids. 1997. 24 : 715–734.
[4] Petersson, N.A. Stability of Pressure Boundary Conditions for Stokes and Navier-
Stokes Equations. Journal of Computational Physics. 2001. 172 : 40–70.
[5] Zhang, K.K.Q., Shotorban, B., Minkowycz, W.J., and Mashayek, F. A. Compact Finite
Difference Method on Staggered Grid for Navier-Stokes flows. International Journal
for Numerical Methods in Fluids. 2006. 52 : 867–881.
[6] Zogheib, B. Velocity-Pressure Coupling in Finite Difference Formulations for the
Navier-Stokes Equations. Windsor, Ontario, Canada. 2006.
[7] Burggraf, O.R. Analytical and numerical studies of the structure of steady separated
flows. Journal of Fluid Mechanics. 1966. 24 : 113–151.
[8] Cheng, M. and Hung, K.C. Vortex structure of steady flow in a rectangular cavity.
Computers & Fluids. 2006. 35: 1046–1062.
[9] Pan, F. and Acrivos, A. Steady flows in rectangular cavities. Journal of Fluid Mechan-
ics. 1967. 28: 643–655.
[10] Bruneau, C.H. and Saad, M. The 2D lid-driven cavity problem revisited. Computers
& Fluids. 2006. 35: 326–348.
Numerical Computation of a Two-Dimensional Navier-Stokes Equation 9
[11] Gupta, M.M. and Kalita, J.C. A new paradigm for solving Navier-Stokes equations:
Streamfunction-Velocity formulation. Journal of Computational Physics. 2005. 207:
52–68.
[12] Midya, C., Layek, G.C., Gupta, A.S., and Mahapatra, T.R. Magnetohydrodynamic
Viscous Flow Separated in a Channel With Constrictions. Journal of Computational
Physics. 2003. 125: 952–962.
[13] Ferziger, J.H. and Peric, M. Computational Methods for Fluid Dynamics. 3rd Edition,
Springer, USA. 2002.