GROUP 1. Run title and other preliminaries
TEXT(Laminar Natural Convec In A Cavity
TITLE
  DISPLAY
  This case is the three-dimensional counterpart of case 251,
  but with a somewhat coarser grid in the y-z plane. The cavity
  is now a cubical box, with adiabatic end walls. Only one half
  of the domain is included, by reason of symmetry.
  ENDDIS
 
   The locally-defined variables are as follows:
 
    DVO1DT    The coefficient of thermal expansion      1/K
    AGRAV     Gravity                                   m/s^2
    TREF      Reference temperature                     C deg.
    BOXL      The length of the box                     m
 
REAL(TREF,AGRAV,BOXL)
DVO1DT=2.874E-1*CP1; AGRAV=9.81; TREF=0.0; BOXL=3.626E-02
 
    GROUP 3. X-direction grid specification
IREGX=1; GRDPWR(X,5,0.5*BOXL,1.0)
 
    GROUP 4. Y-direction grid specification
  *** The value  YVLAST = ZWLAST = BOXL , determines the
      Rayleigh number
      This run set for Ra=1.E5  (a laminar value)
NREGY=3
IREGY=1; GRDPWR(Y, 5,5.439e-3,1.0)
IREGY=2; GRDPWR(Y,10,0.02538 ,1.0)
IREGY=3; GRDPWR(Y, 5,5.439e-3,1.0)
 
    GROUP 5. Z-direction grid specification
IREGZ=1; GRDPWR(Z,30,BOXL,1.0)
 
    GROUP 7. Variables stored, solved & named
   *** Whole-field solver for P1 is activated.
SOLVE(P1,U1,V1,W1,H1); SOLUTN(P1,Y,Y,Y,N,N,N); NAME(H1)=TEMP
 
    GROUP 8. Terms (in differential equations) & devices
   *** Deactivate the built-in source in TEMP equation.
TERMS(TEMP,N,Y,Y,Y,Y,Y)
csg3=cngr
    GROUP 9. Properties of the medium (or media)
RHO1=1.207; ENUL=1.5E-04; PRNDTL(TEMP)=0.71
 
    GROUP 11. Initialization of variable or porosity fields
FIINIT(P1)=1.0E-06; FIINIT(V1)=0.05; FIINIT(W1)=0.05
 
    GROUP 13. Boundary conditions and special sources
 
   1. Hot wall boundary: constant temperature of 10 deg.
 
WALL (HOT,SOUTH,#1,#NREGX,#1,#1,#1,#NREGZ,1,1)
COVAL(HOT,W1,1.0,0.0);COVAL(HOT,U1,1.0,0.0)
COVAL(HOT,TEMP,1.0,10.0)
 
   2. Cold wall boundary: constant temperature of -10 deg.
 
WALL (COLD,NORTH,#1,#NREGX,#NREGY,#NREGY,#1,#NREGZ,1,1)
COVAL(COLD,W1,1.0,0.0);COVAL(COLD,U1,1.0,0.0)
COVAL(COLD,TEMP,1.0,-10.)
 
   3. Low wall boundary: Adiabatic but with friction
 
WALL (LOWAL,LOW,#1,#NREGX,#1,#NREGY,#1,#1,1,1)
COVAL(LOWAL,V1,1.0,0.0);COVAL(LOWAL,U1,1.0,0.0)
 
   4. High wall boundary: Adiabatic but with friction
 
WALL (HIWAL,HIGH,#1,#NREGX,#1,#NREGY,#NREGZ,#NREGZ,1,1)
COVAL(HIWAL,V1,1.0,0.0);COVAL(HIWAL,U1,1.0,0.0)
 
   5. West wall boundary: Adiabatic but with friction
 
WALL (WESTWAL,WEST,#1,#1,#1,#NREGY,#1,#NREGZ,1,1)
COVAL(WESTWAL,W1,1.0,0.0);COVAL(WESTWAL,V1,1.0,0.0)
 
   6. Buoyancy force
 
   *** Buoyancy source for the z-direction momentum equation
       is set in GREX3, Group 13, Sec.15, and GXBUOY;
       VAL=GENLAW activates the Boussinesq approximation as follows:
       RHO*Volume*grav.*DVO1DT*(Tref-T).
       The following data need to be set for this purpose:
       BUOYE=TREF; BUOYC=grav.
BUOYE=0.0; BUOYC=-AGRAV
 
PATCH(BUOY,PHASEM,1,NX,1,NY,1,NZ,1,1); COVAL(BUOY,W1,FIXFLU,BOUSS)
 
   7. Reference pressure at centre of cavity
 
PATCH(FIXPRESS,CELL,NX,NX,NY/2,NY/2,NZ/2,NZ/2,1,1)
COVAL(FIXPRESS,P1,FIXP,0.0);COVAL(FIXPRESS,U1,ONLYMS,0.0)
COVAL(FIXPRESS,V1,ONLYMS,0.0);COVAL(FIXPRESS,W1,ONLYMS,0.0)
 
    GROUP 15. Termination of sweeps
LSWEEP=200
 
    GROUP 16. Termination of iterations
LITER(P1)=-30; LITER(U1)=20; LITER(V1)=20; liter(w1)=20
 
    GROUP 17. Under-relaxation devices
RELAX(U1,FALSDT,1.E-2); RELAX(V1,FALSDT,1.E-2)
RELAX(W1,FALSDT,1.E-02)
 
    GROUP 22. Spot-value print-out
IYMON=3; IZMON=20 ; tstswp=-5
 
    GROUP 23. Field print-out and plot control
NYPRIN=NY/5; NZPRIN=NZ/5; NPLT=1
   *** Temperature and velocity profiles
PATCH(PROF,PROFIL,1,1,1,NY,NZ/2,NZ/2,1,1)
PLOT (PROF,W1,0.0,0.0); PLOT (PROF,TEMP,-10.0,10.0)
 
   *** Temperature contours
PATCH(CONT,CONTUR,1,1,1,NY,1,NZ,1,1)
PLOT (CONT,TEMP,0.0,10.0)