
PRIMITIVE VARIABLE FORMULATION: NUMERICAL INTEGRATION 275
is declared as sparse; for example,
A = sparse(B)
returns the matrix B in compact form storing all nonzero elements together with
information for the location of each nonzero element in the matrix (row and
column numbers). Operations such as LU decomposition (backslash operation)
will be performed in sparse form if A isasparsematrix.
A more efficient way of accomplishing the same computational efficiency with
less storage will be to define the A matrix (the coefficient matrix of the linear
system),
A = sparse(L, L)
where L is the dimension of A. This statement defines a zero L ×L matrix
without allocating any storage. When the nonzero components of A are defined,
A is stored and returned in compact form.
Solutions for the cavity problem for various Reynolds numbers are presented
in Fig. 4.5.10. For Re = 1, the solution has vertical symmetry, as displayed by
the stream function and vorticity contours, and the vorticity is concentrated close
to the upper corners where the problem is singular due to the double value
(0 and 1) of the u velocity at these locations. As the Re increases to Re = 100,
y symmetry is broken and the vortex center moves toward the right upper corner;
a substantial increase to Re = 4000 results in the formation of secondary vortices
in three corners of the cavity. Vorticity is concentrated on the upper and the right
walls, and a vorticity tongue extends deeply into the cavity from the right wall.
Table 4.5.1 summarizes vorticity and stream function values at the center of the
primary vortex for various Reynolds numbers. These values compare favorably
with previous work concerning this flow (see, e.g., Kim and Moin, 1985) for the
comparable number of grid points employed.
2. The shear-driven cavity flow is of interest because of its similarity to wind-
driven flows and can be useful to assess momentum transport from air to water
when the effect of waves on the interface is neglected. Let us assume that at
the air–water interface the shear stress τ = ρ
a
u
2
∗
is constant. The governing
equations (4.5.1) and (4.5.2) are nondimensionalized by the friction velocity u
∗
and the cavity height L,sothatRe= u
∗
L/ν. The physical constants used in
TABLE 4.5.1 Stream Function (ψ
c
) and Vorticity (ω
c
)
at the Center of the Primary Vortices; N
x
and N
y
Are
the Number of Grid Points along x and y Directions
Re ψ
c
ω
c
N
x
×N
y
1 −0.099 −3.207 65 ×65
100 −0.101 −3.157 65 ×65
400 −0.107 −2.609 65 ×65
1000 −0.113 −2.191 81 ×81
4000 −0.113 −1.842 81 ×81