finite difference calculations of buoyant convection in an enclosure i the basic algorithm

Upload: luis-miguel-rv

Post on 07-Aug-2018

220 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    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 Mathenlat ics, National Bureau of Standards. Washing ton, D. C. 3234. U. S. A,

    Howard R. BAUM and Daniel M. CORLEY

    Center for Fire Research, Nation al Bl.reau o f Stand ards, Wash ing ton . 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 Bernoulli’s 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 convec-

    tion, 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)

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    2/15

    516

    R.G. Rehrvt et 11. Difference Culculatio~u of Corruec’tion

    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 correspond-

    ing 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/ae lllap/az =

    -P,,D(s. y.

    Z. t).

    au/at+7q2-uxo=

    - i / p, ) ~p,

    (VP,,WP = -

    [aoaf -

    ;v++

    v+xw ],

    (14

    Ub)

    (1 )

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    3/15

    R. G. Rehnt et al. /

    Differeertce

    Cu lc ulutiottsof Cowec t i o n

    517

    where u =

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

    42 =

    u2 + v2 + w2,

    o=VXll,

    Y-1

    dp,/dt

    =?/;-lp x. . , )dK

    D(x, y. z,

    t) = (k&))[(v - UQb, y+ 3, t) - dp,,/dt].

    I

    (2a)

    (2b)

    2

    24

    Q(x. y, z, t)=Q,-,$/(&/~)(&/~) 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( ) 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

    or

    0=

    0 at vertical boundaries,

    at horizontal boundaries,

    (3 )

    and consequently the normal derivative of pressure at boundaries is zero

    8p/dn = 0.

    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):

    l4yik

    1 u(iE ix. (j- ‘ ,)&y, (k - i)Sz, r& t),

    V: k r

    v(( i -

    $3x, jSy, (k - $Vz, nst),

    w,Y

    w(( i - :)8x, (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

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    4/15

    518

    R.G. Reh er al. / Difference Cdculur iotts of CotwecGon

    1. 0

    6, =

    /J

    i

    /

    /

    /

    /

    p,,(-_-____T __--.---

    r--“--y

    /

    I

    I

    I

    I I /

    /-

    I

    I

    I

    ;

    I

    I

    I

    /

    p,3:_-_‘___t‘

    __I___ t - <

    /

    I

    -1 ,*~_-_t___~___t___~__i 

    -

    “l4.j

    dilj

    Plj . Pij

    Dij

    I

    L

    l

    Fig. 1. A rectangular enclosure in dimensionless variables and the a schematic representation of the basic mesh into

    which the enclosure is divided. There are I cells in the x-direction.

    J

    cells in the F-direction and K cells in the

    z-direction. Also shown is a single mesh cell and the location within this mesh cell of the discretely defined dependent

    variables, velocity components II. 11 and W. pressure p and velocity potential 9.

    whereSx=1/(1oAR),6~=1/(J~BR)andS==

    l/K are the mesh cell sizes in the X-, .v- and

    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)

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    5/15

    R. G. Rehttr et (11. Di ff erence Cukulur io t ts of Cow ec t io t t

    For an irrotational flow, 4 ==0, and (Id) becomes:

    519

    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 Green’s 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$ s 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”).

    (8 1

    @b)

    (8 )

    where the density p0 in dimensionless form is unity and

    42 3

    u2 + v2 + w2

    = ( i3+/ax)2 + ( acp/aJg2 + ( a+/az)2.

    Integration of (8) yields

    (9)

    @/at + p + ; [ (@/ax)’ + ( a+/aJg2 + ( a&G-)‘] = g(t).

    The function g(t) is determined from the condition

    (10)

    ~‘dz~l/lKdx~ ““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

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    6/15

    520

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

    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 of these relations into the discrete version of (Id), yields for 1 < i < I. 1

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    7/15

    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 form of (17) during a first-order, starting time step.

    Then (17) become

    O/~+Clr.,, - ip::,*,,)/~ + G::l.,nY +#+,.,A

    - +;;I

    I

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

    (21a)

    (l/SL’){(+;.;L.r - @/Y,+,*,)/~ + ?(4::,+1.J +P::,+,.L

    -

    I(

    C#$

    - @;;$6 + 9 /A )’ + P‘,k 1 = 0.

    cm

    (1W{(~~/?+, - @;:.k+,)/6+ 19::.,.J2 +p::.r,+1

    -

    I(

    g; ’ -

    a;;,

    )/is

    + i ( q$ )’ +

    p:;J }

    = 0.

    (2lc)

    The difference equations are satisfied by a function independent of i. j and k

    (

    9

    ;;’ - q:,

    )/s

    + ;( #/A )’ + p;;, = g”.

    02)

    Equation (22) is the discretized version of (10). To determine R”. we must apply the discrete

    analogue of (11)

    cw

    and require

    (24)

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    8/15

    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~~nents f 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,

    -. 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.

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    9/15

    523

    Fig. 2. The velocity field in the two-dimensional case. The horizontal velocity is plotted at three horizontal locations (in

    each case as a function of the vertical coordinate). The vertical velocity is shown at three vertical locations as a

    function in each case of the horizontal coordinate. The flow field is from the source to the sinks; the spatial pattern

    does not change with time for thus potential 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 = 0

    (29)

    and the velocity components are derivable from a vector potential of one component. the stream

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    10/15

    524

    R. G. Re/tt tr et ul. / Difference CdadUtim~ of

    Fig. 3. Contours of constant pressure early in the caWation 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 of sources is and decreases to negative values away from the

    ‘heat

    source‘ (where the sinks are).

    function .

    (see (5))

    II = a$+5ys. I’ = - aijJ/a.u.

    In the steady state. the x- and j’-components of the momentum equation (lb),

    become

    ; a( 12 + 1’) )/as - 1’13= - ( 1 $I{, ) ap/ax.

    Ja(u’ + rq/$v + UC3= -(l/p,,)ap/$v.

    where p,, is constant and the scalar vorticity is defined by

    0 = al?/& - au/i)?* = - C’J,.

    Define

    H =

    p//l+, + 1( 12 + I’: )

    and substitute for

    14

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

    i ff/as+oa~/aA-=o.

    ~~H/i ~~+c~3~/;3~*=0.

    If we now assume that w is a constant

    c3= +h

    then (34) become

    (3( H + i,lc,)/&u = 0.

    a( H+b;Cl /ay=O.

    (30)

    (31)

    (32)

    (33)

    (34)

    I *

    (3%

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    11/15

    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 results from the

    Bernoulli 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

    a, ~=0 at x=0,1 and

    v=O,l.

    (38)

    .

    Therefore, procedurally, one can solve the Helmholtz equation (37) subject to boundary condi-

    tions (38) to obtain the stream function \c/. Then (30) yield the velocities, and (33) and (36) the

    pressure.

    4.2.

    iscrete 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” - u:‘_

    ,,)/Sx + (I$ -

    ‘I

    q,._ ,)/6_r=

    0

    (33)

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    12/15

    and the discretized velocity components are obtained from the stream function as follows

    14 :: = ( : ‘ , - q, _ , )/6 _L

    q, = - ( $:‘ , - gJ: ‘ _ 1. )/6 x.

    (4 0 )

    The momentum equations (31). become in discretized form

    1 1

    (l/2~_~)[(y::,.,)2-(q:l,)‘] - (r’:,,q,+(‘II,, ,o:I,_,)+,,(P::l.,-p::)=0. (4la)

    0 -

    where

    q, = ( r;‘, , , -

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

    r; = 1 ry, + r:‘, ,. , .

    )

    11: = 1 use, , ,

    + uy, ).

    (I )

    II ?=I

    iI

    4 ( IIy, + li;‘_ ,. , )’ + : ( r;‘, + $I , _ , )‘.

    Equations (40) imply that

    (424

    Wb)

    (42c)

    1

    - 0:: = 7 ( #:I+ l.,

    1

    6x-

    - w:‘, + K- 1.1) +Q

    (4

    ll

    ,

    .

    /+1 -W,+#‘,-11.

    .

    (43)

    and

    11;.

    = (l//2S*,*)(q:‘,, , -a/(, ,).

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

    (44)

    Equiltions (41) can be written

    ( 1 s.v I[ I ( 4:‘. I., I2 + / I:‘, . / Pu - : ( 4:: ’ - P::/ p ,,]

    +

    l(w:‘,il/2ss)(~:‘+,.,-~:‘_ ,.,)+w::,_,(l/2s-~)(~:‘+~.,-, -#Y-,.,-J] =O, (45a)

    (l/&r)[

    ~(Y:l,,,)2+P:l,+,/Pl,- Lkc / )?-P::h]

    +l[

    w:‘,(l/2s.~~)(~:‘.,+, -#J \)+a:‘- ,.,(1/2~.r~)(~:‘-,.,i, -&.,-I)] =O* (45b)

    As in the continuous case. we take

    w;‘,= + h.

    (46)

    and note that

    ~(4:; ’ + ::/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)

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    13/15

    V

    0. 8

    0. 6

    0. 4

    0. 2

    0. 0

    I

    I.1

    DX

    I

    I

    I

    I

    I

    I

    I

    I

    I

    I

    0.0 0. 2

    0. 4 0. 6

    0. 8 1. 0

    u

    Fig. 5. Horizontal velocity as a function of vertical location at three horizontal positions and vertical velocity as a

    function of horizontal location at three vertical positions. The dashed tmes represent the positions at which each

    velocity component is displayed, and the solid curves associated with the dashed lines show the magnitude and

    direction of the component. The magnitude of the horizontal coqxnent is given by the U scale below the plot and the

    magnitude of the vertical component 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 field is rotating in the clockwise direction with greatest velocities at the edges and smaller

    velocities in the interior, representing a stirring in the lectangular 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

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    14/15

    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 en-

    closures 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 computa-

    tional 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 Pois-

    son’s 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 simplifica-

    tions of the equations

    for this particular model and because

    they are for

    a single discretization.

    Yet. calculations of flow fields generally are specialized: both the flow equations and the

    numerical method

    are

    problem specific. Determination

    of simple, particular solutions for those

    pr(Jblm-specific equations is difficult and

    will also lead generally 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.

  • 8/19/2019 Finite Difference Calculations of Buoyant Convection in an Enclosure I the Basic Algorithm

    15/15

      eferences

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

    529

    VI

    PI

    131

    VI

    151

    WI

    R.G. Rehm and H.R. Baum, The equations of motion for thermally driven, buoyant flows,

    J. Res. Nut. Bur.

    Stur tdur ds 83 (3) (1978) 297-308.

    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.

    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.

    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.

    F.H. Harlow and A.A. Amsden, Fluid dynamics, a LASL monograph. Los Alamos Scientific Laboratory Report

    LA 4700. Los Alamos, NM, June 1971.

    P. Swarztrauber and R. Sweet, Efficient FORTRAN subprograms for the solution of elliptic partial differential

    equations, NCAR-TN/IA-109. July 1975.