Você está na página 1de 8

# Numerical Simulation of Lid Driven Cavity with the

## Presence of a Block in Flow Field

OE 4628 CFD for Dredging & Offshore Engineering

Team 12

Yang Liu

4384954

Ang Li

4415671

Abstract: In this paper, the numerical simulation of both the classical Lid Driven Cavity Flow
and the Lid Driven Cavity Flow with a block in the flow field are present. They are simulated
through pressure correction method within collocated mesh. Pressure field is solved through
Poisson equation with application of Gauss-Seidel iteration, and velocity is updated from
momentum equation.
Keywords: Lid Driven Cavity; Pressure Correction Method; Poisson Solver; Block in flow field.

1. Learning Objects
In order to look into the behavior of the fluid in viscous flow, we will simulate Lid Driven Cavity
Flow though numerical methods. By adding a block in the flow field, compared with classical
Lid Driven Cavity flow in square control volume, we can inspect the influence of the boundary
on both the numerical discretization and the behavior of fluid. Through these two simulation
we can achieve better understanding about the application of numerical methods in flow
simulation problems and the use of stencil method regarding discretization at boundary.

## 2. Lid Driven Cavity Flow

The Lid Driven Cavity (LDC) flow is a well-known benchmark
problem for viscous incompressible fluid flow. In this paper,
we are dealing with a square area consisting of three rigid
walls and a lid moving with a tangential unit velocity, which
is illustrated in Figure 1. We are interested in the velocity and
pressure of the entire flow field under a Reynolds number of
100. Boundary conditions are shown in Table 1. Both the noslip boundary condition and Neumann boundary condition
are applied in this case. No-slip condition is applied at the
solid walls, whereby the two velocity components are zero at
the body surface. Neumann boundary condition is applied
during the computation of pressure from Poisson equation.

## Table 1 Boundary conditions of LDC

North

South

East

West

Velocity[m/s]

U=UN=1; v=0

u=0; v=0

u=0; v=0

u=0; v=0

Interface

du
0
dx

du
0
dx

du
0
dx

du
0
dy

du
0
dy

du
0
dx
du
0
dy

du
0
dy

dv
0
dx
dv
0
dy

dv
0
dx
dv
0
dy

dv
0
dx
dv
0
dy

dv
0
dx
dv
0
dy

P
=0
y

P
=0
y

P
=0
x

P
=0
x

derivatives

3. Space Discretization
With the implementation of pressure correction method, we consider the application of the
fractional step method to the simulation of incompressible flows. The method is described for
a Cartesian mesh, with all flow variables defined in the same points at the centers of the
computational cells, although the staggered grid approach is applied to connect the values at
the cell centers with face defined values. In this case, a cell-centered second order finite
volume discretization is selected. The two-dimensional incompressible Navier-Stokes equation
are discretized on the uniform Cartesian grid, which is illustrated in Figure 2. The uniform
Cartesian mesh has 41X41 nodes, dividing the domain into 40x40 square cells. The notations
and coordinates are also shown in Figure 2.

## Figure 2 Space discretization

(Ghost nodes in this figure only make sense when applying Poisson equation for pressure.)

## 4. Implementation of Pressure Correction Method

The velocities are updated from the momentum equations and pressures are obtained by
solving the Poisson equation using Gauss-Seidel method. The procedure includes three phases.
This process is shown in Figure 3.
Initial parameters
Next step

## U0i,j V0i,j P0i,j

(Ux,y)i+1/2,j (Vx,y)i,j+1/2
(Ux,y)i,j+1/2 (Vx,y)i+1/2,j

Pi+1/2,j
Pi,j+1/2

Pi,j

phase 1:
Intermedia
velociy

phase 3:
Velocity

phase 2: Poisson
equation

Intermedia
velocity
U*i,j V*i,j

## Figure 3 Computation procedure of velocity and pressure

3

When applying the numerical discretization at the boundary, there will be some problems.
Take the velocity gradient as an example. From the formula below, we can see if i reach the
max value at boundary, there will be no points at (i+1, j+1), (i-1, j+1), as illustrated in Figure 4.

Herewith, we will use stencil method to solve the problem. In this case, we use the points at
the boundary, instead of the ghost point outside the boundary. This is shown in Figure 4.

## Figure 4 Stencil method for numerical discretization at boundary

The same solution will be applied to the different situations at all the four boundary walls. The
Gauss-Seidel method is applied to approach the result of Poisson equation, where ghost nodes
are in use.

## 5. Simulation Result of LDC Flow

The total simulation time is 15 second, with time step of 0.01 second. The numerical
simulation process is finished in Matlab. Here are the results. The streamlines and velocity
quiver are shown in Figure 5, at t=15s. The velocity and pressure contour are shown
respectively in Figure 6, at t=15s.

4

## 6. The Presence of a Block in Flow Field

In order to inspect the behavior of LDC flow, a block is
placed in the flow field. The size of the block is 10x10 grid
cells. It locates at the middle of lateral wall, which is
shown in Figure 7.
With the presence of the block, the space discretization is
somewhat changed. In order to use loops in codes to
simplify the coding, it is in need to divide the control
volume into several parts to customize the presence of
the block. This is shown in Figure 8. Though this way we
can easily code with efficient loops. Considering the
difference between the calculation for the point driven by x momentum
and y momentum, the separation should be different.
Figure 7 Location of the block in flow fields

## Figure 8 Space division options for application of loops in coding

There are four special points around the corner of the block at the edge close to the center of
the flow field. At these points, when applying numerical discretization, there will be some
missing points from which we cant obtain a certain value. This problem is shown in Figure 9,
for instance, at left side. This problem can be solved though stencil method, with reference to
the numerical discretization near boundaries. The stencil method applied at the corners is also
shown in Figure 9, at right side.

## Figure 9 Stencil method for numerical discretization at block corner

Apart from all these problems, the simulation process is just similar to LDC flow simulation
with square flow field, which is shown in chapters above.

7. Simulation result of LDC Flow with the Presence of a Block in Flow Field
The total simulation time is 15 second, with time step of 0.01 second. The numerical
simulation process is still finished in Matlab. Here are the results. The streamlines and velocity
quiver are shown in Figure 10, at t=15s. The velocity and pressure contour, with respect to
different times (t=0.2, 0.5, 5, 15) are shown respectively in Figure 11 & 12.

Figure 10 Streamlines and velocity quiver of LCD flow with a block at t=15s

## Figure 12 Pressure contour of LDC flow with a block at t=0.2, 0.5, 5, 15

8. Conclusion
From the results of the simulations, it can be seen that changes of the boundary walls (the
presence of a block) have great effect not only on the behavior of fluid, but also on the
complexity of numerical discretization. With the presence of the block, more boundary walls
need to be taken into account. Besides, the corner points around the block behaves very
different from normal boundary walls when applying numerical discretization. As a result, they
should be worked on separately from normal boundary walls. Stencil method is still highly
recommended in use to deal with such points.

9. Recommendation
There are still some problems in the block present case.
For instance, at the end of the simulation, in the plot of
streamlines there are some strange tails drawn by
Matlab, which is shown in Figure 13. Most likely this is due
to the parameter of the plot, which makes Matlab
thinking the missing parts are too small to plot.
Hence, in further study, it is highly recommended to look
into the parameter and configuration of the simulation,
like size of the grid, complexity of boundary, velocity of
inflow and outflow, setting of the plot, etc.

## Figure 13 Streamlines with strange

tails

Reference
[1] Charles Hirsch. Numerical Computation of Internal & External Flows.
[2] Benjamin Seibold. A compact and fast Matlab code solving the incompressible NavierStokes equations on rectangular domains.