TALK=F;RUN( 1, 1) 

  photon use
  p
 
 
 
 
  up z
  msg the grid. press return for temperature contours
  gr x 1;pause; gr off;red;gr ou x 1
  msg temperature contours. press return for velocity vectors
  con temp x 1 fi;0.0002;pause; con off;red;se re ve 2;vec x 1 sh
  msg velocity vectors. press return for reduced-pressure contours
  pause;vec off;red;con p1 x 1 fi;0.0002
  enduse
 
INTEGER(GRD, NPT)
MESG(
MESG(
MESG(
MESG(     LAMINAR FREE CONVECTION IN CAVITY 
MESG(
MESG(
MESG( This case illustrates the speed-up that MIGAL 
MESG( produce with free convection flows and the way 
MESG( it increases with the number of cells. From 
MESG( library case 251.
MESG(
MESG(
MESG( Enter required grid ID :  1 - 40x40     1K cells (default)
MESG(                           2 - 120x120  14K cells
MESG(                           3 - 164x164  27K cells
MESG(                           4 - 200x200  40K cells
MESG(
READVDU(GRD,INT,1)
CASE GRD
WHEN 1
+ NPT=10
WHEN 2
+ NPT=30
WHEN 3
+ NPT=41
WHEN 4
+ NPT=50
ENDCASE


INTEGER(SLV)
MESG(
MESG( Enter required solver ID :  1 - MIGAL (default)
MESG(                             2 - SIMPLEST 
MESG(
READVDU(SLV,INT,1)

  GROUP 1. RUN TITLE AND OTHER PRELIMINARIES
CASE SLV
WHEN 1
+ TEXT(Laminar Free Convection : MIGAL
WHEN 2
+ TEXT(Laminar Free Convection : SIMPLEST
ENDCASE
TITLE
 
                   SPECIAL DATA
                   ============
 
    DVO1DT    the coefficient of thermal expansion      1/k
    AGRAV     gravity                                   m/s^2
    HREF      reference enthalpy                        j/kg
    CAVL      the length of the cavity                  m
 
REAL(TREF,AGRAV,CAVL)
DVO1DT = 2.874E-01*CP1; AGRAV = 9.81; TREF  = 0.0; CAVL  = 3.626E-02
    GROUP 4. Y-DIRECTION GRID SPECIFICATION
  *** The value of yvlast = zwlast = cavl , determines the
      Rayleigh number; this run is set for Ra=1e5 (a laminar value)
NREGY=3
IREGY=1; GRDPWR(Y,NPT,0.15*CAVL,1.0)
IREGY=2; GRDPWR(Y,2*NPT,0.70*CAVL,1.0)
IREGY=3; GRDPWR(Y,NPT,0.15*CAVL,1.0)
 
    GROUP 5. z-direction grid specification
GRDPWR(Z,4*NPT,CAVL,1.0)
 
    GROUP 7. Variables stored, solved & named
   *** whole-field solver for p1 is activated.
SOLVE(P1,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 13. Boundary conditions and special sources
 
   1. Hot wall boundary: constant temperature of 10 deg.
WALL (HOT,SOUTH,1,1,1,1,1,NZ,1,1)
COVAL(HOT,W1,1.0,0.0); COVAL(HOT,TEMP,1.0,10.0)
 
   2. Cold wall boundary: constant temperature of -10 deg.
WALL (COLD,NORTH,1,1,NY,NY,1,NZ,1,1)
COVAL(COLD,W1,1.0,0.0); COVAL(COLD,TEMP,1.0,-10.0)
 
   3. Low wall boundary: adiabatic but with friction
WALL (LOWAL,LOW,1,1,1,NY,1,1,1,1); COVAL(LOWAL,V1,1.0,0.0)
 
   4. High wall boundary: adiabatic but with friction
WALL (HIWAL,HIGH,1,1,1,NY,NZ,NZ,1,1); COVAL(HIWAL,V1,1.0,0.0)
 
   5. Buoyancy force
#gravity
gravdir=6; href=0.0
#bouss
 
   6. Reference pressure at the centre of the cavity
PATCH(REFP,CELL,1,1,NY/2,NY/2,NZ/2,NZ/2,1,1)
COVAL(REFP,P1,FIXP,0.0)
COVAL(REFP,V1,ONLYMS,0.0)
COVAL(REFP,TEMP,ONLYMS,SAME)
    GROUP 16. Termination of iterations
LITER(P1)=-30; LITER(V1)=20;LITER(W1)=20
    GROUP 17. Under-relaxation devices

RELAX(V1,FALSDT,1.E-02)
RELAX(W1,FALSDT,1.E-02)
RELAX(TEMP,FALSDT,1.0)
NPLT=1
CASE GRD
WHEN 1
+ LSWEEP=500
WHEN 2
+ LSWEEP=4000
WHEN 3
+ LSWEEP=8000
WHEN 4
+ NPLT=2
+ LSWEEP=13200
ENDCASE

IYMON=NY/10; IZMON=NZ/4; NYPRIN=NY/5; NZPRIN=NZ/5; 
TSTSWP=-1
itabl=3
 
    GROUP 23. Field print-out and plot control
  *** 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)

selref=F;
resref(P1)=1.E-5
resref(V1)=1.E-5
resref(W1)=1.E-5
resref(TEMP)=1.E-5

  
IF(SLV.EQ.1) THEN
+ RELAX(V1,FALSDT,1.E-02)
+ RELAX(W1,FALSDT,1.E-02)
+ RELAX(TEMP,FALSDT,1.0)
+ REFP=skip
+ SPEDAT(MIGAL,SOLVED1,c,HYDRO)
+ SPEDAT(MIGAL,LINRLX1,r,1.)
+ SPEDAT(MIGAL,SOLVED2,c,TEMP)
+ SPEDAT(MIGAL,LINRLX2,r,1)
ENDIF

IF(SLV.EQ.1.AND.GRD.EQ.1) THEN
+ LSWEEP=28
ENDIF
IF(SLV.EQ.1.AND.GRD.EQ.2) THEN
+ LSWEEP=28
ENDIF
IF(SLV.EQ.1.AND.GRD.EQ.3) THEN
+ SPEDAT(MIGAL,NBRELAX1,i,5)
+ LSWEEP=28
ENDIF
IF(SLV.EQ.1.AND.GRD.EQ.4) THEN
+ SPEDAT(MIGAL,RELAX1,r,0.8)
+ LSWEEP=28
ENDIF