
NUMERICAL METHODS FOR SOLVING ELLIPTIC PARTIAL DIFFERENTIAL EQUATIONS 95
As the first application of Liebmann’s formula (2.8.6), we consider the flow
caused by a distribution of vorticity within a rectangular domain. Vorticity vector
ζ is defined as the curl of the velocity vector, or
∇ × V = ζ (2.8.15)
For two-dimensional fluid motion on the x-y plane, the velocity components may
be derived from the stream function ψ according to (2.1.14), and the vorticity is
a vector in the z direction whose magnitude is designated by ζ . Thus, (2.8.15)
can be written in the form of a scalar equation,
∂
2
ψ
∂x
2
+
∂
2
ψ
∂y
2
=−ζ(x, y) (2.8.16)
which belongs to the class of (2.8.1). Based on (2.8.6), the numerical scheme for
solving (2.8.16) is
ψ
i, j
=
1
4
ψ
i−1, j
+ψ
i+1, j
+ψ
i, j −1
+ψ
i, j +1
+h
2
ζ
i, j
(2.8.17)
Here the superscripts used to denote the number of iterations have been omit-
ted, because they are automatically taken care of if this equation is applied
successively at interior points in the same order as that described prior to (2.8.4).
In Program 2.5, we examine how the circular streamlines of a line vortex
deform when it is confined within a finite domain defined by −3 ≤ x ≤ 3and
−2 ≤ y ≤ 2. The location of the line vortex of finite vorticity ζ
0
is fixed at
(x
0
, y
0
). With the value 0.25 assigned to h, which is the size of increments in
both x and y directions, there will be 425 grid points corresponding to m = 25
and n = 17 in the notation of Fig. 2.8.1.
Since the stream function may take on an arbitrary additive constant, the value
zero will be assigned to the bounding streamline coinciding with the boundary
of the rectangular region. To start the iteration, a constant value of 0.5 is guessed
for the stream function at all interior points. After a new value of ψ is computed
from (2.8.17) at an interior point, the absolute value of the difference between
this and the previous value of ψ at the same point is calculated and is added to
the value of a variable called
ERROR, whose starting value at the beginning of an
iteration is zero. At the end of one iteration, when the values of ψ at all interior
points have been updated, the value of
ERROR is compared with ERRMAX,which
is the maximum allowable value of the total error. If
ERROR is less than or equal
to
ERRMAX, the desired accuracy has been reached, so the iterating process can
be stopped. Otherwise, the iteration counter
ITER is increased by 1 and a new
iteration is started. In our program we let
ERRMAX = 0.001. In other words, on
the average, the maximum error allowed at each of the 345 interior points is
approximately 3 × 10
−6
. The iteration process stops when the iteration counter
reaches this maximum value of 200 even if the result has not yet reached the
desired accuracy.