Sie sind auf Seite 1von 10

CFD Analysis of a 2-D Lid Driven Cavity Flow


Anirban Guha

April 28, 2009

Abstract
The present paper deals with the modeling and valida-
tion of a 2-D laminar, incompressible, viscous lid-driven
cavity ow. Proper choices of articial compressibility,
articial viscosity and over-relaxation parameters were
made. Both square cavity and a cavity with aspect ra-
tio of 3:1 were analyzed. Vortex formation and its de-
pendence on Reynolds number as well as geometry were
studied. Quantitative estimations of the location of the
eye of vortex and its strength were made.

Introduction Figure 1: Schematic of a 3-D lid driven cavity ow [3]

Lid driven cavity ow is a class of internal, bounded ow


of an incompressible, viscous, Newtonian uid in which here is 2-D Cartesian.
the motion is generated by a portion of the containing
boundary. If L and U be the associated length and ve- • Time Dependence: The ow properties are de-
locity scales respectively, then the normalized continuity pendent on time, hence the problem needs to be
and Navier Stokes equations can be written as modeled as an unsteady problem.

• Fluid Properties: The uid is incompressible, vis-


∇.u = 0 (1) cous and Newtonian. The uid properties like den-
sity and viscosity are assumed to be constant.
∂u
+ (u.∇)u = −∇p + Re−1 ∇2 u (2) • Turbulence: The ow can become transitional or
∂t
turbulent depending on the Reynolds number. Since
where Re = U L/ν is the Reynolds number. The
we are interested in the laminar characteristics of the
boundaries have no-slip conditions and the initial con-
ow, we work at a much lower Reynolds number so
dition corresponds to a quiescent uid. The usefulness
that laminar ow can be safely assumed.
of studying driven cavity ows is that they exhibit almost
all phenomena that can possibly occur in incompressible • Energy: The uid is treated as an isothermal uid
ows, for example eddies, secondary ows, complex pat- and there are no sources or sinks involved. Hence
terns, instabilities, transition and turbulence. Figure 1 energy equation can be safely neglected.
shows the schematic diagram of a driven cavity ow. The
gure shows that in the plane of symmetry, there is a pri- • Body Forces: Body forces like gravity are not im-
mary eddy and also secondary eddies at the corners, two portant in understanding the ow physics, hence it
at upstream and one at downstream. Our interest is to can be safely neglected.
develop a CFD code which can correctly simulate the
ow physics of a 2-D lid driven cavity ow.

Code Verication and Validation


Modeling
1. General Validation
• Geometry: We are interested in modeling a 2-D lid
driven cavity ow, hence the geometry considered 1.1 Correctness of the residual
∗ Mechanical Engineering Department, University of British A square geometry of [0,1]×[0,1] with no slip boundary
Columbia conditions was considered. The ow variables (P,u,v)

1
No. of meshes mesh size continuity u-velocity v-velocity

10X10 0.1000000 0.0479470 0.1950580 0.1950580

20X20 0.0500000 0.0119830 0.0500260 0.0500260

40X40 0.0250000 0.0029960 0.0125860 0.0125860

80X80 0.0125000 0.0007490 0.0031510 0.0031510

(a) L2 norm of error


continuity u,v velocities
2.00 1.98
(b) Order of Accuracy

Table 1: Flux Integral verication

Pressure u-Velocity v-Velocity


8.174e − 20 4.999e − 12 4.999e − 12

Table 2: Error in Implicit Flux Integral Figure 2: Convergence history for the rst 200 time steps

were initialized to some known smooth functions of x


1.3 Block Thomas Algorithm
and y which satised the boundary conditions and this The Block Thomas Algorithm was supplied in UBC
enabled us to calculate the ux integrals exactly. The Vista. After incorporating it in the code and verifying
functions were the results with that posted in Vista, it was observed
that the result of rst pass of approximate factorization
was dierent. This is because of the reason that the data
   
P P0 cos (πx) cos (πy)
 u  =  u0 sin (πx) sin (2πy)  (3) posted in Vista didn't include the factor of time step
v v0 sin (2πx) sin (πy) which needs to be multiplied with the Flux Integrals to
get accurate results.
Since the continuity equation for incompressible uid
(Equation 1) doesn't have pressure term(s) in it, there is
no coupling between pressure and velocity between the 2. Lid Driven Cavity Flow - Lid Veloc-
momentum and continuity equations. This problem was ity=0
tacked by introducing an articial compressibility factor
(β ) in the continuity equation.
2.1 Validation Case: Stability
The ow variables (P,u,v) were initialized according to
(4) Equation 3. The lid was set to zero velocity. The pa-
∂P 1
+ ∇.u = 0
∂t β rameters chosen were P0 = u0 = v0 = β = 1 ,Re = 100
,4t = 0.05 and 20 × 20 mesh. Since the velocities at all
The correctness of the residuals, i.e L2 norm of ux
the boundaries were zero, the initial condition was much
integrals was calculated using a second order accurate
like a disturbance in a conned uid which eventually
centered ux evaluation scheme for Re = 10 and P0 =
decayed with time to zero velocity everywhere in the do-
u0 = v0 = β = 1. Because of geometric symmetry, the u
main. Figure 2 shows the convergence history for the rst
and v velocities had same residuals. Also from Table 1b,
200 time steps ( number of time-steps for convergence
it is evident that Flux Integral evaluation is second order
was 520 with convergence criteria of 10−9 ). The oscilla-
accurate as expected for a second order scheme.
tions in pressure (visible in Figure 3a) is a common is-
sue with collocated grids because of de-coupling between
1.2 Correctness of the Flux Jacobian pressure in the alternate lines of the mesh. The code was
able to take time-steps much larger than 0.05 and for
The function which evaluated the Flux Jacobian was
the same conditions the biggest time-step was 4t = 1.
tested by incorporating a small perturbation at the cen-
The pressure oscillations, i.e decoupling of the odd and
ter of the computational domain. The maximum error
even cells of the solution domain could be handled by
obtained for Re = 10 and P0 = u0 = v0 = β = 1 and a
introducing an articial viscosity term in the form of the
20×20 mesh is given in Table 3a. As expected, the errors
Laplacian of pressure, multiplied by a smoothing factor
are less than 10 . The code was run for 40 × 40 mesh
−10
into the continuity equation.
size and the errors were found to increase slightly. This
may be because of the fact that the errors were close to ∂P 1
machine round-o errors, hence physical justication of + ∇.u = A4x4y∇2 P (5)
∂t β
this behavior might be incorrect.

2
# Time Steps
β A=1 A=4
A # of Time Steps 0.1 659 659
0.5 539 539
0.0 614
1.0 520 519
0.5 520
1.5 538 523
1.0 520
2.0 600 580
4.0 519
2.5 651 627
40.0 512
3.0 690 664
(a) Choice of A 5.0 800 765
10.0 955 905
(b) Choice of β

Table 3: Convergence history under dierent conditions

2.2 Choice of Pressure Smoothing Factor(A)


(a) Pressure
The value of A should not be very high since it incorpo-
rates a second order error in the system. For A = 4, sig-
nicant coupling was achieved and the oscillations were
essentially damped out. It was observed that increasing
A increases the convergence rate too, since the oscilla-
tions are damped resulting into faster convergence. For
example, for a 40 × 40 mesh with P0 = u0 = v0 = β = 1
,Re = 100 ,4t = 0.05, the convergence with convergence
criteria of 10−9 is shown in Table 3a. For rest of the code
A = 4 was chosen as the optimal value.

2.3 Choice of Articial Compressibility Factor(β )


In Sub-section 1.1, the reason of introducing the arti-
(b) u-Velocity cial compressibility factor was stated. Since coupling is
very important for numerical stability, it is obvious that
higher values of β provides additional stability while low-
ering it increases the incompressibility and thereby ac-
celerate convergence.β → 0 gives a singular continuity
equation ( Equation 4) and the coupling is broken giving
rise to instability. Also it was found that at higher values
of β , the code converges to a wrong solution. Finding the
optimal value of β is critical. From Figure 5a it was found
that for a mesh of 40 × 40 and A = 1 the optimal value
of β shifts to the right with increasing 4t. Intuitively
this seems right and similarly, increasing the number of
meshes will make the optimal value of β to shift to the
left. For A = 1 and 4, the dependence of convergence
(c) v-Velocity rate on β was evaluated. The values are tabulated in
Table 3b and Figure 5b gives the diagramatic represen-
Figure 3: Contours of dierent ow properties with tion of the same. From the results obtained, it can be
Utop = 0 concluded that β = 1 is a reasonable choice for 4t=0.05.

2.4 Choice of Over-Relaxation Factor(ω)


It is well known that over-relaxation accelarates conver-
gence upto an optimal value. It is numerically imple-
mented as Qn+1 = Qn + ωδQ, where Q is the solution,

3
(a) A=0.5

(b) A=1.0 (a) β for dierent 4t

(c) A=4.0

(b) β for dierent A

Figure 5: Choice of β from convergence history

(d) A=40.0

Figure 4: Pressure Contours for dierent values of A

4
(a) Re=100

(a) u-Velocity

(b) Re=1000

Figure 6: Choice of ω from convergence history

n is the time-step number and δQ is the change in so-


lution. Thus a value of ω > 1 helps a faster update of
the solution. Theoritically, the solution will become un- (b) v-Velocity
stable for ω > 2. The optimal value of ω was explored
for two dierent Reynolds number, 100 and 1000. The
parameters which were kept constant were β = 1 ,A = 4
,mesh size of 20 × 20 and 4t = 0.1.For Re=1000, the
solution divereges at ω = 1.3 while at Re=100, the diver-
gence was detected for ω > 2. The results were checked
for mesh size of 40 × 40 and no signicant change in the
convergence characteristics was observed. The optimum
choice of ω being dependent on Re, ω = 1.5 was used for
Re=100 and ω = 1.1 was used for Re=1000.

3. Lid Driven Cavity Flow - Lid Veloc-


ity=1.0
3.1 Solution (c) Pressure with velocity vectors

Figure 7: Contours of ow variables for Utop = 1 and


For β = 1, A = 4, Re=100, ω = 1.5,4t=0.05 and mesh
20 × 20 mesh
size of 20 × 20, the dierent ow properties and the
convergence history is plotted in Figure 7 .Convergence
criteria was set to 10−9 .

5
Mesh Size Value Error(%)
10 × 10 -0.1485003 30.08
20 × 20 -0.1835620 13.57
40 × 40 -0.2032175 4.32
80 × 80 -0.2092910 1.46
160 × 160 -0.2123895 -

Table 4: Grid convergence study

(a) Convergence history up to 10−6

Figure 9: Sanity Check-Symmetry

3.2 Grid Convergence Study


The grid independence study is shown in Figure 8c. As-
suming that 160 × 160 has no error, the velocity at the
(b) u-velocity along mid-plane for 20 × 20 mesh
point y = 0.45 is evaluated for dierent mesh sizes. At
that point, the curvature is maximum and it can be a test
for dierent meshes to capture that curvature properly.
The dierent values of u-velocities for dierent meshes
at y = 0.45 is presented in Table 4. It is clearly visible
that for 80 × 80 mesh, the error is 1.46 % and thus this
mesh size is sucient for grid convergence.

3.3 Sanity Check-Symmetry


Because of symmetry in the geometry, the value of the ex-
pression uUtop=1 (x, y)+uUtop=−1 (1−x, y) = 0. This was
checked numerically and the result is shown in Figure 9.
As expected, the whole eld is zero for a calculation up
to 10 places of decimal.

3.4 Results for 80x80 mesh


For β = 1, A = 4, Re=100, ω = 1.5,4t=0.05 and mesh
(c) grid convergence study size of 80 × 80, the dierent ow properties are shown in
Figure 10. Convergence criteria was set to 10−9 . Com-
Figure 8: Dierent studies for Utop = 1 paring Figure 10 with Figure 7, the dierences in solution
with mesh renement is clearly visible.

6
(a) Results of Ghia et al.[2] for Re=100 and 1000

(a) u-Velocity

(b) Re=100 (c) Re=1000

Figure 11: Comparison of stream-lines with published


results

3.5 Identication of Vortices for dierent


Reynolds Number
Figure 11 compares the streamlines of Ghia et al. [2]
and that obtained from the solver. The results are very
similar. It was observed that increasing the Reynolds
(b) v-Velocity
number causes the primary vortex to move towards the
center of the domain which is well in agreement with
the theoretical results of Batchelor [1]. Increasing the
Reynolds number causes increase in momentum transfer
from the primary vortex to the secondary vortices and
thus the latter grows in size. It can be concluded that
the physics is well captured by the code.

4. Exploratory Case: Eect of height


With an increase in the cavity height, the primary vortex
becomes unstable and gives rise to a series of vortices
below it. With a height to width ratio of 3:1, simulations
were performed for dierent Reynolds number.

4.1 Grid Convergence Study


(c) Pressure with velocity vectors
The grid independence study is shown in Figure 12 for
Figure 10: Contours of ow variables for Utop = 1 Re=100. Assuming that 160 × 480 has no error, the
and 80 × 80 mesh velocity at the point y = 2.45 was evaluated for dierent
mesh sizes. At that point, the curvature is maximum
and it can be a test for dierent meshes to capture that

7
Mesh Size Value Error(%)
20 × 60 -0.16874568 15.16
40 × 120 -0.18915177 4.90
80 × 240 -0.19642846 1.24
160 × 480 -0.19889857 -

Table 5: Grid convergence study

Figure 13: Streamlines at dierent mesh-sizes(Re=100)

Figure 12: Grid Convergence Study

curvature properly. The dierent values of u-velocities at


y = 2.45 is tabulated for dierent meshes in Table 5. It is
clearly visible that for 80 × 240 mesh, the error is 1.24 %
and which makes it sucient for grid convergence. The
Figure 13 shows the streamlines at dierent mesh sizes.
From the results it is obvious that there is almost no Figure 14: Eect of Reynolds number on Vortex forma-
dierence between 80 × 240 and 160 × 480 mesh sizes. tion
Hence the subsequent analysis is performed on 80 × 240
mesh.
corners. It was observed that increasing the Reynolds
4.2 Eect of Reynolds Number on Vortex Forma- number from 10 to 100 caused the primary eddies to de-
tion crease in size while the corner eddies merged and growed.
Thus increasing the Reynolds number increases momen-
Vorticity is the tendency of uid to spin and is mathe- tum transfer from the primary to the secondary eddies.
matically dened as The Upper Upstream Eddy (UUE) was not visible in any
∂v ∂u of these Reynolds number because it is visible at higher
Γ=∇×V = − (6) values (Re > 3200) [3]. A case study was performed with
∂x ∂y
Re = 5000 and that vortex was identied. Although at
Using a second order central dierence scheme, vor- Re = 5000, the ow is turbulent and performing laminar
ticity was evaluated. The eect of Reynolds number on analysis was not a true depiction of the ow physics, yet
Vortex formation is interesting. Figure 14 shows that the study was done to see whether the code was able to
at Re=10, there exists two big primary vortices and two identify UUE.
secondary ones at the lower corners. The vortices were
found to be very symmetric. Increasing Re to 100 showed
the tendency of the two secondary vortices to merge to- 4.3 Location of Vortex Center and its strength
gether. Also two more very small vortices were found at
the lower corners. Increasing Re to 1000 showed that the For Re=100, 6 vortices were observed. Figure 16 shows
lower two vortices merged together to produce a big pri- the vortices with subsequent numbering. The results
mary vortex. Two secondary vortices were found at the were obtained from Tecplot. The location and strength

8
Vortex x y Γ Γrel
1 0.61480 2.73297 −2.451 −0.583 × 107
2 0.53015 1.57764 2.516 × 10−2 0.599 × 105
3 0.40275 0.23154 −7.060 × 10−5 −1.680 × 102
4 0.59501 0.23133 −7.116 × 10−5 −1.693 × 102
5 0.01869 0.01705 5.652 × 10−7 1.345
6 0.98354 0.01921 4.203 × 10−7 1.000

Table 6: Location and strength of vortices

Vortex No. |Γmax | |Γmin |


1 2.683 1.924
2 0.0257 0.020
3 8.388 × 10−5 6.821 × 10−5
4 7.122 × 10−5 6.623 × 10−5
5 6.724 × 10−7 0
6 5.260 × 10−7 0

Table 7: Vortex Estimation Error Band

of each of these are tabulated in Table 6. The location of


a vortex is the point where the velocity eld has a local
minimum. The ratio of strength of the two primary vor-
Figure 15: Upper Upstream Eddy at Re=5000 tices, i.e Vortex-1 : Vortex-2 is 97.417, considering the
absolute value.

4.4 Error Band


In order to nd the vortex center, it was needed to probe
at a sub-grid scale resolution. Since the data was only
at the cell centers, the accuracy of determining the ex-
act location should be within ±∆x in x direction and
±∆y in y direction. In our case, the uncertainty in vor-
tex location is ±0.00625 in both directions (∆x = ∆y
). The way Tecplot calculates the Vorticity at the eye
is probably by interpolating the neighboring cell-center
values. Thus the error band in calculating vorticity can
be written as Γmax ≥ Γ ≥ Γmin , where Γmax and Γmin
are the maximum and minimum vorticities in the neigh-
borhood respectively. Table 7 shows the error band in
Vortex strength estimation.

References
[1] G. K. Batchelor. On steady laminar ow with
closed streamlines at large reynolds number. Journal
of Fluid Mechanics Digital Archive, 1(02):177190,
1956.
Figure 16: Location of Vortices at Re=100
[2] U. Ghia, K. N. Ghia, and C. T. Shin. High-re solu-
tions for incompressible ow using the navier-stokes
equations and a multigrid method. Journal of Com-
putational Physics, 48:387411, December 1982.

9
[3] P. N. Shankar and M. D. Deshpande. Fluid mechanics
in the driven cavity. Annual Review of Fluid Mechan-
ics, 32(1):93136, 2000.

10

Das könnte Ihnen auch gefallen