Вы находитесь на странице: 1из 15

Applied Numerical Mathematics 1 (1985) 515-529

North-Holland

515

FINITE DIFFERENCE CALCULATIONS OF BUOYANT CONVECTION IN AN


ENCLOSURE: VERIFICATION OF THE NONLINEAR ALGORITHM
Ronald G. REHM and P. Darcy BARNETT
Center for Applied

Mathenlatics,

National

Bureau of Standards.

Washington, D. C. 3234.

U. S. A,

Howard R. BAUM and Daniel M. CORLEY


Center for Fire Research, National

Bl.reau of Standards,

Washington.

D.C. 20234.

U.S A.

Solutions are presented to nonlinear finite difference equations uccd to represent fire-driven buoyant
convection in enclosures. The solutions depend upon the fact that these difference equations permit the
decomposition of the discretized velocity field into solenoidal and irrotational components. The irrotational field
is shown to satisfy a finite difference analog of Bernoullis equation when the density is constant. This leads to a
three-dimensional time-dependent solution to the difference equations. The solenoidal field is shown to possess
steady-state two-dimensional solutions corresponding to a constant non-zero value of the discretized vorticity.
The two solutions, together with results presented elsewhere describing finite difference approximations to linear
internal waves in enclosures, have been used in the development and testing of the computer-based algorithms
used to solve these equations. They have proved particularly useful in assessing the accuracy of finite difference
approximations
to the equations of inviscid fluid mechanics. as well as in debugging the computer codes
implementing these algorithms.

1. Introduction
Over the past few years, the authors have been engaged in a research project to develop,
starting from basic conservation laws, a mathematical model of fire development within a room.
Large-scale convection is an essential component of such a model because this fluid motion
governs the smoke and hot gas transport within a room and also supplies fresh oxygen to the fuel
to sustain combustion. Therefore, development of a mathematical model of buoyant convection
was begun as a first step toward a more complete room-fire model, which would include effects
of combustion chemistry, radiation and smoke dynamics. The mathematical model for convection, the partial differential equations and boundary conditions, are derived in [l].
It is the nonlinear nature of the equations of fluid dynamics that makes them difficult to solve:
analytical tools for the solution of nonlinear problems are very limited. For this reason numerical
techniques have become very widely used; numerical solution of nonlinear equations is the only
systematic method of solving them under a wide variety of conditions. Yet, if these numerical
solutions are to be trusted, it is essential that they be carefully checked to determine their
accuracy.
It is the purpose of this paper to describe specialized solutions to the nonlinear equations
derived in [l] and [2], which were used to verify the quality of the numerical results obtained for
the more general equations. These solutions have been extremely useful, as was the solution
reported in [4], for providing insight into the seleciion of the discretization scheme and for testing
the stability and accuracy of the numerical scheme. Solutions to both the partial differential
equations and to the finite difference equations in two special cases are obtained by a
016%9274/85/$3.30

0 1985, Elsevier Science Publishers B.V. (North-Holland)

R.G. Rehrvt et (11./ Difference Culculatio~u of Corruection

516

combination

of analytical and numerical techniques entirely independent of the purely numerical


procedure
described in [2]. Agreement between the exact solution to the difference equations
described in this paper and the numerical solutions described in [2] was found nearly to the
accuracy specified for the iterative procedure used to solve the pressure equation described in [3].
On the other hand, comparison of the solution to the difference equations and of the corresponding solution to the partial differential equation, which is outlined in the paper, can be used to
determine the magnitude of the discretization error made by replacing the partial differential
equations by finite difference equations. For the number of grid points used in most of the
calculations performed to date (typically 30 by 30) the discretization error was a few percent.
In Section 2 the partial differential equations are presented. These equations already are
restricted from the more general ones presented in [l] and [2]. The grid is also shown upon which
the discretized variables are defined. The first solution, presented in Section 3, is for a fully
three-dimensional time-dependent irrotational, incompressible flow in an enclosure driven by
sources and sinks of fluid as specified by the heat source. This problem arises from the full
nonlinear equations with boundary conditions, in continuous or discrete form, by requiring that
the velocity field be irrotational and the density remain constant. The resulting nonlinear partial
differential equations and difference equations are presented and the difference equations are
solved. The solution to the difference equations is used to determine. in detail, the accuracy with
which the code described in [2] solves the nonlinear finite difference equations in this special
case. The solution to the corresponding continuous problem could be used to assess the
discretization errors involved as a function of mesh size.
The second problem is presented and discussed in Section 4. This problem arises when the
density is taken to be constant, the heating is assumed to be zero. the velocity field is taken to be
IWO dimensional and derivable from a stream function only, the vorticity is taken to be a
constant. and the flow is independent of time. The discretized problem can be solved exactly,
using a combination of analytical and numerical techniques. The solution to the difference
equations is used to determine, in detail, the accuracy with which the code described in [2] solves
the nonlinear finite difference equations in this special case. The solution to the corresponding
continuous problem could be used to assess the discretization errors involved as a function of
mesh size. Concluding remarks are presented in Section 5.

2. Equations
The general problem considered is that of the fluid motion in a rectangular enclosure produced
by a specified heat source. The equations, derived in [l] and rewritten in more convenient form
for numerical integration in 121, are for an inviscid, non-heat-conducting
perfect gas. In the
solutions presented in this paper. density variations are taken to be small. and buoyancy effects
are neglected. Then the effects of density variations do not alter the flow to a first approximation.
The equations describing such a flow fluid are presented below. They are a simplified version
of equations (11) of [2].
ap/at

uap/ax

cyap/ale + lllap/az = -P,,D(s. y.

au/at+7q2-uxo=
(VP,,WP = - [aolaf

-(i/p,)~p,

-+- ;v++ v+xw)],

Z.

t).

(14
Ub)
(1C)

R. G. Rehnt et al. / Differeertce Culculutiotts of Cowection

where u = (u, U, w) is the vector velocity and


42 = u2 + v2 + w2,

(2a)

o=VXll,
dp,/dt

517

(2b)

Y-1
=?/;-lp(x.
y.z,t)dK

C1
(2

- UQb,

D(x, y. z, t) = (k&))[(v
I

Q(x. y, z, t)=Q,-,$/(&/~)(&/~)

y+ 3, t) - dp,,/dt].

(24

tanh Atexp[-p,(x-x,.)2-~,.(p-J:.)2-XZ];
(24

p. is a constant, reference density, Q( x, y, L, t ) is a heat source of form specified in (2e) with


constants )By./!$. and A used to determine its spatial extent and A its temporal scale. Q. the heat
source magnitude, and pO(t) is a mean pressure in the enclosure.
The boundary conditions specify that there will be no outflow or inflow at boundaries: the
normal velocity is zero. Hence

u= 0
W= 0

and consequently
8p/dn

or 0= 0 at vertical boundaries,
at horizontal boundaries,
the normal derivative of pressure at boundaries is zero
= 0.

(3a )
W )

The equations can be made dimensionless by introducing a length scale equal to the height of the
enclosure, a velocity scale determined by the magnitude of the divergence (or the heat source)
specified in (2d), the ambient density pO and the ambient or initial pressure, p,. When this is
done, the enclosure becomes one unit high, and in the equations above, pn, pm and Q. can be
taken as unity.
In Fig. 1, a two-dimensional rectangular enclosure in dimensionless variables is shown together
with a schematic two-dimensional representation of the spatial grids used for the finite difference
scheme. The grid formed from solid lines represents the basic mesh into which the enclosure is
divided: in general there are I mesh cells in the x-direction, J mesh cells in the y-direction. and
K mesh cells in the z-direction.
Upon this basic mesh, the components of the vector (u, v, w) and the component of the vector
vorticity are defined: the location of the velocity components for a sample mesh cell are also
shown in Fig. 1.
A second grid, formed by joining the center points of the basic grid cells, is that upon which
scalar quantities such as pressure p are defined. In Fig. 1 the pressure at the center of the sample
mesh cell is shown.
The following discretely evaluated functions will denote approximations to the corresponding
solutions to (1) and (2):
l4yik1 u(iEix. (jV:)k

r v(( i - $3x,

w,YA s w(( i - :)8x,

,)&y, (k - i)Sz,
jSy,

(k - $Vz,

r&t),
nst),

(j - i)Sy. k6z, n&),

p:,,Ip((i-#lx.(j-$)Sy.(k-f)Sz.

nat).

D,!ix.= D(( i -~)Sx,(j-~)Sy.(k-~)6z,nst).


c#fjk 22 +((i - i)Sx,

(j - +)a)?, (k - $)SZ, I?&)+

(4

R.G. Reh

518

er al. / Difference

Cdculuriotts of CotwecGon

1.0

/
/

/
p,,(-_-____T

__--.---

r----y

I
p,3:_-____t

/I

I
__I___

--.---

<

dilj

Plj . Pij
l4.j

Dij

-1p,*~_-_t___~___t___~__i_
i
I
L jl

6, = l/J
i

Fig. 1. A rectangular
which

the enclosure

z-direction.
variables,

enclosure
is divided.

in dimensionless
There

variables

and the a schematic

are I cells in the x-direction.

Also shown is a single mesh cell and the location within


velocity components

representation

of the basic mesh into

J cells in the F-direction

and

K cells in the

this mesh cell of the discretely defined dependent

II. 11 and W. pressure p and velocity potential

9.

l/K are the mesh cell sizes in the X-, .v- and
whereSx=1/(1oAR),6~=1/(J~BR)andS==
z-directions respectively and where 6t is the time-step size. Such a staggered grid is commonly
used for multidimensional finite difference integrations [S].
In the following two sections, solutions to nonlinear equations (l)-(3) under additional
restrictions are given. Then the discretized approximation to each restricted set of partial
differential equations is also presented and solved. It should be noted that each of the
discretizations chosen to approximate the restricted set of partial differential equations is
compatible with the discretizations chosen in [2] for the more general partial differential
equations describing buoyant convection due to heating. Because of this compatibility, the
solutions given in Section 3 and 4 have been found to be very usefu! for comparison with the
numerical results obtained from the general algorithm described in [2].

3. Irrotational

flow driven by a divergence

The nonlinear problem is one in which the density is taken to be constant and the velocity is
assumed to be derivable from a velocity potential. In this section, first the solution to the partial
differential equations under these assumptions will be presented, and then the corresponding
solution for the difference equations is given.
3. I. Continuous solution
We start the analysis by noting generally that the fluid velocity can be written as the a gradient
of a scalar potential. +, ph~s the curl of a vector potential 9:
u=v++vxl/&

(5)

R. G. Rehttr et (11./ Difference Cukuluriotts

For an irrotational

of Cowectiott

519

flow, 4 ==0, and (Id) becomes:

V2@= D(x, L, 2, t),

(6)
on 0 < x < 1/AR, 0 B y < l/RR, 0 < z < 1. The boundary conditions are found from (3) to be
d+/dn = 0 on all boundaries. When D( x, y, z, t ) is separable, the equation for @ is separable,
and $Bcan be determined either by Fourier series or by Greens functions and complex-variable
techniques in the two-dimensional case. Then the spatial distribution of (p is specified by the
spatial distribution of D and the time dependence of C$is equal to that of D. The velocity field is
found from
u =- vC#L

(7)
The pressure field is found from the dimensionless version of (lb) by noting that the vorticity is
zero. With the density constant and the above definitions for the velocity components in terms of
the potential, (lb) becomes in component form

(-$(gf)=-(&)b+h2).
(g)(g)=-(-$)b+WL
(i)(Z)= -(g$P+h).
where the density p0 in dimensionless
42 3 u2 + v2 + w2 = ( i3+/ax)2

(8a 1
@b)
(8C)

form is unity and


+ ( acp/aJg2

+ ( a+/az)2.

(9)

Integration of (8) yields


@/at

+ p + ; [ (@/ax)

+ ( a+/aJg2

The function g(t) is determined


~dz~l/lKdx~

+ ( a&G-)]

= g(t).

(10)

from the condition

dyP(x,

y, z, t)=O.

(11)

See the discussion following (8) of [2] concerning this condition. Integration of (10) over the total
volume 0 g x < l/AR, 0 <y < l/BR, 0 < i < 1 and requiring that
~dz~nndx~Rdy

+(x, y, z, c) = 0

(12)

yields for g( t )
g(r) = (AR ~RR)~dz~Rdx~nRdy
0
0
0

(13)

The pressure field is then found from the potential field through (10) where g( t ) is determined
from (13). Comparison of the solution obtained above for the continuous case with that obtained
below for the discretized equations then provides an estimate of the discretiza+ion error for a
specified mesh size.
3.2. Discrete solution
When the density is constant and the discrete velocity components are derivab!e from a
discretized potential, a solution to the difference equations can be obtained by a procedure

R.G. Rehm et ul. / Difference Calculutions of Conwction

520

analogous to that used above to obtain a solution to the partial differential equations. First,
reference should be made to Fig. 1 where the discretized potential is defined at the center of a
grid cell. Then, the discretized velocity components and the potential are determined by the
relations

Substitution
l<k<K.

of these relations into the discrete version of (Id), yields for 1 < i < I. 1 <j <J,

1
-(+
&x2

1
II
I+ 1.,x,-2~~,~+~~-,.,,)+~(~~.,+,.~-2~~,,+~.,-,.~)

where Dtyx is the discretized version of (2d) and (2e).


The discrete boundary conditions are

#I.,,.= %-.,A and G+I./h


C/J
~t.0.h
cp:,.o

+; . 1. A

=
=

#,.I

and

#,./ + I .h

and

#,.K+,

G.,h

forO<j<J,O<k<K,

(16a)

#..Lh

forO<i<I,O<k<K,

wd

#,.I(

forO<i<I,O<j<J,

(16c)

=
=

are values defined at the center of fictitious


where+:,,A9 #+ ,.,hq #&.h* +:,./+,.A
and
#,.W
#,.A.+,
cells adjacent to and outside the region considered. These values are eliminated from the problem
when (16) are substituted into (15). Equation (15) and boundary conditions (16) can be solved
using fast direct methods such as a three-dimensional
generalization of the package of
Swarztrauber and Sweet [6]. When D,>his a separable function of i, j, k and n as is the case for
the form chosen, the spatial portion of #,h for all II can be determined by only one solution of
the linear algebraic system represented by (15) and (16). The discretized velocity field is then
determined from (14).
The discretized pressure field is derived from the discretized version of (1 b). Since the vorticity
is zero and p. = 1, these equations can be written

(4::
Il,h 1 =
t1

v,;h+\

I --

1. ,A

1
26~[(4:I,+,.h)l-(4::r)i]

) - (q:;k)2]
- &( P::

I.

,h -

P :, A,)

1
-,(P::,+Lh-P:;h)

I1 + I
)2?
1th

(174

(17b)

WC)

where

sz

6t

f 2St

for n = 1,
for 17> 1.

Wa)

and where #)k is defined by (2a) in discretized form.


( &:,A ) = ( &

)* + ( qy, ) + ( $yk )

and

ii,:, = i ( t$, + N:_ I* ,l, ).

etc.

The upper bracketed values in (18) are the ones to be chosen during a first-order. explicit starting
time step whereas the lower value is to be chosen for a leap-frog time step. In this form. therefore.
(17) and (18) can be used to represent succinctly both first-orde? and leap-frog time steps. It is
important to note that the time step may be reduced during the computation to avoid violating
the stability criterion,

When this is done, the time-marching algorithm is restarted with the values of the dependent
variables at the last successful time step used as initial conditions. A first-order time step is then
taken using the new time step size to obtain values of the dependent variables at two levels. and
then the leap-frog is resumed. We substitute definitions 34) into (17) and define a potential

(20)
as in (18) to take account of the different
Then (17) become
O/~+Clr.,,

- ip::,*,,)/~

form of (17) during a first-order, starting time step.

+ G::l.,nY

- I +;;I - @;;,)/a + ; ( gyrc )? + p;;J)


(l/SL){(+;.;L.r

g;

I(

+P::,+,.L
cm

+ 9 (#/A ) + P:,k 1) = 0.

- @;:.k+,)/6+
-

(21a)

= 0,

- @/Y,+,*,)/~ + !?(4::,+1.J

- I( C#$ - @;;$6
(1/W{(~~/?+,

+#+,.,A

a;;,)/is +

i ( q$

1(9::.,.J2

+p::.r,+1

) + p:;J } = 0.

(2lc)

The difference equations are satisfied by a function independent


( 9 ;;
Equation

- q:,

(22) is

)/s +

;( #/A ) + p;;,

= g.

the discretized version of (10). To determine

of i. j and k
02)

R. we must apply the discrete

analogue of (11)
cw

and require
(24)

Then

or

where we have used the relation

Therefore, once the discretized potential has been determined from (15). the discretized pressure
field is obtained from (22) using (26) to determine 8 and using (27) for ~4~~~
). The solution
procedure outlined above has been carried out, namely (15) was solved n~Imerically using 8
three-dimensio~~al Poisson solver and then the velocity field was determined from (14) and the
pressure field from ~22) The results in the two dimensional case were compared with those
computed from the algorithm described in f2], when. in this algorithm, the perturbation density
#, and the vorticity wy#were specified to be zero. The parameter in the pressure solver described
in 121. which determined the accuracy to which the linear algebraic system for the discretized
pressure is solved, was taken to be E = IQ? This value was chosen as a reasonable compromise
given the machine accuracy (36 bits) of the NBS UNIVAC 1200 and the iterative nature of the
pressure solver. Agreement up to a few tens of time steps, between dependent variables (both
s~~ntp~~nentsof v&city and pressure) determined by the two different procedures, was found to a
few parts in 10 _a Accuracy of the nuntcrical procedure described in (21 was found to degrade
slowly, bring a few parts in 10 - s after a few hundred time steps.
It is interesting to describe the physical content of the problem discussed in this section. When
the density is taken to be constant. the driving function D( x, _L z, t) can no longer be assumed
to result from heating and cannot be interpreted as a source of specific volume, Rather, D(x, y,
I.- t ) must be interpreted as a distribution of sources and sinks of fluid in an enclosure. With this
interpretati~?i~ the potential flow. with no outflow or inflow at the boundaries of the enclosure,
has some interesting features, which are described briefly below.
The fornt of D( .Y, _r, 2, t ) used for these calculations is defined by (20) and (2d) with Q(x, y9
2, t ) given by (2e). (For the solutions shown below, Q is centered aiong floor of the enclosure.)
Since the ~ontinu~~us potential is given by (6), with the corresponding velocities given by (7), and,
since Q and therefore D is separable in time, the spatial dependence of the potential and the
velocity components remains the same throughout the history of the problem. The function D(x,
j. z. f 1 represents sources of fluid of greatest strength at the center of the heat source Q and
decreasing in strength as the distance from the center increases. At some distance from the center,
the sources become sinks so that the integral of the sources (and sinks) over the enclosure is zero.
Therefore. the velocity field is one describing flow from the heat source to the remainder of the
enclosure as shown in Fig. 2 for all times during the history of the flow.

523

Fig. 2. The velocity field in the two-dimensional


each case as a function
function

of the vertical

in each case of the horizontal

case. The horizontal

coordinate).
coordinate.

does not change with time for thus potential

The vertical

velocity is plotted at three horizontal


velocity

is shown at three vertical

locations (in
locations

as a

The flow field is from the source to the sinks; the spatial pattern

flow.

In contrast, the pressure changes dramatically during the flow. During the early portion of the
flow, all nonlinear manifestations can be neglected, and in (lo), p s - &#I/&. The potential $I
will behave qualitatively like the negative of the source function D; i.e., where the source is
maximum (at the center of the heat source) the potential is minimum. and the pressure is
highest, as shown in Fig. 3. Hence the pressure is maximum where D is and decreases to negative
values away from the heat source Q. Later in the flow, when the source is asymptoting to its
final value, the nonlinear terms dominate and @/at becomes relatively small in (10). At any
particular time g( t ) is a constant, and (10) becomes approximately

The term in square brackets is the magnitude of the velocity squared. This equation states that
the pressure is minimum where the velocity magnitude is largest, and this velocity magnitude is
largest where the gradient of the heat source Q is maximum. Figure 4 shows contours of
constant pressure late in the flow when the heat source is asymptoting to its final value.

4. Two-dimensional, steady-state flow with vorticity


4.1. Continuous solution
When the density is constant, no heat source is present and we restrict the flow to be two
dimensional, then the continuity equation, (Id), becomes
du/8x

+ ao/ay

and the velocity components

= 0
are derivable from a vector potential of one component.

(29)
the stream

R. G. Re/tttr et ul. / Difference

524

Fig. 3. Contours

of constant pressure early in the caWation

CdadUtim~

of

of the two-dimensional

potential

flow. Contours

greater

than the mean pressure are shown as solid lines, while those below the mean are dashed. The pressure is maximum
where the distribution

function

of sources is and decreases to negative values away from the

heat source (where the sinks are).

#. (see (5))
II = a$+5ys.

(30)

I = - aijJ/a.u.

In the steady state. the x- and j-components

of the momentum equation (lb),

; a( 12 + 1) )/as

- 113= - ( 1/$I{, ) ap/ax.

Ja(u

+ UC3= -(l/p,,)ap/$v.

+ rq/$v

where p,, is constant and the scalar vorticity


0 = al?/&

become
(31)

is defined by

- au/i)?* = - CJ,.

(32)

Define
H = p//l+, + 1( 12 + I: )
and substitute

for

14

(33)

tind 17 from (30) into (31). Then

i)ff/as+oa~/aA-=o. ~~H/i)~~+c~3~/;3~*=0.

(34)

If we now assume that w is a constant


I*
(3%

c3= +h
then (34) become
(3( H + i,lc,)/&u

= 0.

a(

H+b;Cl)/ay=O.

525

Fig. 4. Contours

of constant

pressure late in the calculation

of the two-dimensional

potential

flea.

Contours

greater

than the mean pressure are shown as solid lines. while those below mean are dashed. Nute that the pressure is negative
where the sources are and positive away from the sources in contrast to Fig. 3. The change in charyctrr
Bernoulli

results from the

effect (see the text for an explanation).

or

H + h# = C = constant

(36)

where C is evaluated, for example, by requiring that the mean value of p, integrated over the
enclosure be zero.
Equation (32) becomes
v2$=

-h

(37)

subject to the impervious wall boundary conditions, which become


(38)
.v=O,l.
Therefore, procedurally, one can solve the Helmholtz equation (37) subject to boundary conditions (38) to obtain the stream function \c/. Then (30) yield the velocities, and (33) and (36) the
pressure.
a,!~=0 at x=0,1

and

4.2. Discrete solution


As in the continuous case, when the density is constant, nc heat source is present and the flow
is two dimensional, the continuity equation becomes

(u
I

- u:_,,,)/Sx + (I$ -

q,._

,)/6_r= 0

(33)

and the discretized velocity components


14:: =

( #:,

q,

are obtained from the stream function as follows


q,

_ , )/6_L

( $:, -

(40)

gJ:_ 1. ,)/6x.

The momentum equations (31). become in discretized form


(l/2~_~)[(y::,.,)2-(q:l,)]

1 1
,o:I,_,)+,,(P::l.,-p::)=0.
0 -

-!(r:,,q,+(II,,

(4la)

where
q, = ( r;, , , - (y, )/6x
r;

- ( 14;:, + , - 14;;)/6_r.

= 1 ( ry, + r:, ,. , ) .

(424

11: = 1 ( use, , , + uy, ).

Wb)

II ?=I 4 ( IIy, + li;_ ,. , ) + : ( r;, + $I , _ , ).


(I( iI )

(42c)

Equations (40) imply that


- 0:: = 7

6x-

( #:I+ l., - w:,

1
+ K-

1.1) +Q

ll
(4 , . /+1 -W,+#,-11.

(43)

and
11;. = (l//2S*,*)(q:,, , -a/(,

,).

(44)

(1; = -(1/2S-~)(~:+,.,-~:-,.,).

Equiltions (41) can be written


( 1/s.v I[ I ( 4:. I., I2 + /I:, ,. ,/Pu - : ( 4:: ! - P::/p,,]
+ l(w:,il/2ss)(~:+,.,-~:_

(l/&r)[
+l[

~(Y:l,,,)2+P:l,+,/Pl,-

w:,(l/2s.~~)(~:.,+, -#J

,.,)+w::,_,(l/2s-~)(~:+~.,-,

-#Y-,.,-J]

=O,

(45a)

-&.,-I)]

=O* (45b)

Lkc/)?-P::h]

\)+a:-

,.,(1/2~.r~)(~:-,.,i,

As in the continuous case. we take


w;,= + h.

(46)

and note that

~(4:;) +P::/po

+ 34 c, + +: I./ + #: . , , + 4: , . , _ , ) = C = constant.

(47)

The constant in this equation is evaluated by requiring that the mean value of p,, over all mesh
points be zero (to make it compatible with the general definition of this quantity in the algorithm
described in [2]).
To determine a solution to the nonlinear difference equations, therefore, the discretized
Helmholtz equation obtained by combining (43) and (46)
WW(~:+

I./ - 244:,++:. ,.,)+(l/s_V)($::,+,

-L/J:,++::,_,)=

-/I

(49)

0.8-

0.6 -

0.4-

0.2-

0.0-

I.1DX
I

Fig.

5. Horizontal

function
velocity
direction

velocity

of horizontal
component

as a function

location

of vertical

and the solid

0.8

1.0 u

location at three horizontal

positions.

The

positions

dashed tmes represent

curves associated with

The magnitude of the horizontal

magnitude of the vertical component

0.6

at three vertical

is displayed,

of the component.

0.4

0.2

0.0

coqxnent

and vertical velocity as a

the positions

the dashed lines show

at which each

the magnitude

and

is given by the U scale below the plot and the

is given, by the V scale to the left. A positive horizontal

velocity component

is

represented by a solid curve to the right of its dashed line. and a positive vertical component by a solid curve above its
dashed line. The

flow

velocities in the interior,

field is rotating
representing

in the clockwise direction

a stirring

in the lectangular

with

greatest velocities

at the edges and smaller

region.

with boundary conditions that $,, = 0 on the boundaries, i = 0. I and j = 0, J, is solved using a
software package such as the one develop by Swarztrauber and Sweet in [6]. From this solution
for the stream function, the velocities are determined from (40) and the pressure from (47). This
solution procedure involves analytical and numerical techniques totally independent of the
numerical algorithm described in [2].
The steady-state solution to the difference equations was used to test the algorithm of [2] by
using the values as initial conditions to the code (for both initial time levels) with the heat source
set to zero and the perturbation &nsity also set to zero. The computer code was then allowed to
take several hundred time steps, and the values after different numbers of time steps were
compared. It was found that there was no instability in the algorithm. The solution replicated
itself very well, with a slow degradation in the number of significant figures with which the
solution was able to duplicate itself as the number of time steps increased. Initially. the solution
after a few time steps agreed with the exact solution to a few parts in the sixth significant figure.
as expected from the tolerance set on the pressure solver. After four hundred time steps. the
agreement was to a few parts in the fourth significant figure. representing a degradation which we
felt was reasonable.
In Fig. 5 we present plots of the horizontal velocity as a function of vertical location at three
horizontal positions and of the vertical velocity as a function of horizontal location at three
vertical positions. This figure shows a flow field which is rotating in a clockwise direction with

the greatest velocities at the edges and smaller velocities in the interior. The flow field represents
stirring in a rectangular tea cup with no dissipative effects of viscosity. Horizontal velocity plots
at a specified horizontal position do not agree with vertical velocity plots at the corresponding
vertical location due to details in the graphics package used to display the data.

5. Concluding

remarks

The numerical solution of nonlinear partial differential equations arising in applications.


particularly in fluid dynamics. has generally focussed on the results for the particular application.
R&tively
little attention has been given to developing a methodology for assessing the accuracy
with which the solutions are obtained. Such a focus is in distinct contrast to the development of
good mathematical software where much attention is devoted to testing. In earlier papers. [l--3].
the authors have developed a mathematical model of fire-driven buoyant convection in enclosures and solved the nonlinear partial differential equations for this model by finite difference
techniques. In [4] an exact analytical solution is presented to the linear difference equations
which arise when the full nonlinear ones are specialized to describe small-amplitude internal
waves. The exact solutions presented in [4] have provided analytical guidance in the selection of
the finite difference equations and represented a very valuable tool with which to test computational procedures and programming.
In this paper. we have described two additional special cases in which the full nonlinear partial
differential equations and the approximating difference equations can be solved exactly using
analytical and well-established computational techniques (fast, direct methods for solving Poissons equation). Although the solutions to the nonlinear partial differential equations in these
special case> might be expected. the fact that the difference equations can also be solved is
.~omeu.hat more surprising. The solutions to the nonlinear difference equations are rather
skccialized. but are very useful both for testing the accuracy and stability of the algorithm and in
the detection of coding errors. For example. they provided guidance on how to make time-sfep
changes to avoid violating the stability criterion. In addition. these solutions have provided
insight into the fidelity with which the dynamics of the flow is simu!ated by the difference
approximations. This has been accomplished for nonlinear flow fields. and the physical content
of each solution was discussed.
Perhaps thu most important feature of this paper and [4] is that they describe a process or a
systematic methodology for testing an algorithm for solving the nonlinear partial differential
equations describing a physically interesting problem. In [4] the linear solution was used to test
the linear portions of the full nonlinear algorithm. including buoyancy effects. In this paper two
p~rtkhr
nonlinear solutions were used to test complementary,
non-linear features of the
algorithm. All of these solutions are rather .;pecialized because they are C.lr specific simplifications of the equations for this particular model and because they are for a single discretization.
Yet.

calculations

of flow

fields generally

are specialized:

both

numerical method are problem specific. Determination


of simple,
pr(Jblm-specific
equations is difficult and will also lead generally

the flow equations

and

the

particular solutions for those


to highly specialized results.
Nevertheless. such testing is important and will be increasingly important if computational
fluid-dynamics codes are to be credible predictive tools. rather than sophisticated interpolators
tuned to specific experimental data.

R. 6. Rehm et al. / Differewe Cukulutiorts of Corwectiorr

529

References
VI R.G. Rehm and H.R. Baum, The equations of motion for thermally driven, buoyant flows, J. Res. Nut. Bur.
Sturtdurds 83 (3) (1978) 297-308.

PI H.R. Baum, R.G. Rehm, P.D. Barnett and D.M. Corley. Finite difference calculations of buoyant convection in an
enclosure. Part I: The basic algorithm. SIAM J. Sci. Statist. Comput. 4 (1) (1983) 117- 135.
131 J. Lewis and R.G. Rehm. The numerical solution of a nonseparable elliptic partial differential equation by
preconditioned conjugate gradients, J. Res. Nut. Bur. Sturtdurds U (5) (1980) 367-389.
VI H.R. Baum and R.G. Rehm. Finite difference solutions for internal waves in enclosures. SIAM J. Sci. Stutist.
Conzput. 5 (4) (1984) 958-977.
151 F.H. Harlow and A.A. Amsden, Fluid dynamics, a LASL monograph. Los Alamos Scientific Laboratory Report
LA 4700. Los Alamos, NM, June 1971.
WI P. Swarztrauber and R. Sweet, Efficient FORTRAN subprograms for the solution of elliptic partial differential
equations, NCAR-TN/IA-109.
July 1975.

Вам также может понравиться