TALK=F;RUN( 1, 1) 


TEXT(3D Cubical Lid-Driven Cavity, Re=1000

INTEGER(GRD)
MESG(
MESG(
MESG(
MESG(    3D CUBICAL LID-DRIVEN CAVITY, Re=1000
MESG(
MESG(
MESG( This case illustrates the speed-up that MIGAL 
MESG( produces and the way it increases with the number
MESG( of cells. It also demonstrates that a pressure
MESG( relief condition is not necessary with MIGAL.
MESG(
MESG(
MESG(
MESG( Enter required grid ID :  1 - 10x10x10  (  1K cells) (default)
MESG(                           2 - 27x27x27  ( 20K cells)
MESG(                           3 - 34x34x34  ( 39K cells)
MESG(                           4 - 39x39x39  ( 59K cells)
MESG(                           5 - 43x43x43  ( 80K cells)
MESG(                           6 - 47x47x47  (104K cells) 
MESG(
READVDU(GRD,INT,1)
CASE GRD
WHEN 1
+ NX=10 
WHEN 2
+ NX=27
WHEN 3
+ NX=34
WHEN 4
+ NX=39
WHEN 5
+ NX=43
WHEN 6
+ NX=47
ENDCASE
NY=NX
NZ=NX

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

GRDPWR(X,NX,1.,1.)
GRDPWR(Y,NY,1.,1.)
GRDPWR(Z,NZ,1.,1.)
SOLVE(P1,U1,V1,W1)

DIFCUT=0
REAL(RE); RE=1000.
ENUL=1.0/RE

FIINIT(U1)=0.0
FIINIT(W1)=0.0
FIINIT(V1)=0.0
FIINIT(P1)=0.0

WALL (SOUTH,SOUTH,1,NX,1,1,1,NZ,1,1)
COVAL(SOUTH,U1,1.,0.)
COVAL(SOUTH,W1,1.,0.)
WALL (NORTH,NORTH,1,NX,NY,NY,1,NZ,1,1)
COVAL(NORTH,U1,1.,1.)
COVAL(NORTH,W1,1.,0.)

WALL (WEST,WEST,1,1,1,NY,1,NZ,1,1)
COVAL(WEST,V1,1.,0.)
COVAL(WEST,W1,1.,0.)
WALL (EAST,EAST,NX,NX,1,NY,1,NZ,1,1)
COVAL(EAST,V1,1.,0.)
COVAL(EAST,W1,1.,0.)

WALL (LOW,LOW,1,NX,1,NY,1,1,1,1)
COVAL(LOW,U1,1.,0.)
COVAL(LOW,V1,1.,0.)
WALL (HIGH,HIGH,1,NX,1,NY,NZ,NZ,1,1)
COVAL(HIGH,U1,1.,0.)
COVAL(HIGH,V1,1.,0.)

PATCH(REL1,CELL,1,1,1,1,1,1,1,1)
COVAL(REL1,P1,1.0000,0.0) 
COVAL(REL1,U1,ONLYMS,0.0)
COVAL(REL1,V1,ONLYMS,0.0)
COVAL(REL1,W1,ONLYMS,0.0)


  Simplest parameters
  -------------------

LITER(P1)=200;
CSG3=CNGR
LITER(U1)=20;LITER(V1)=20;LITER(W1)=20

IF(GRD.EQ.1) THEN
+ relax(u1,falsdt,1.E+0) 
+ relax(v1,falsdt,1.E+0)
+ relax(w1,falsdt,1.E+0)
+ lsweep=150
ENDIF
IF(GRD.EQ.2) THEN
+ relax(u1,falsdt,1.E+0) 
+ relax(v1,falsdt,1.E+0)
+ relax(w1,falsdt,1.E+0)
+ lsweep=600
ENDIF
IF(GRD.EQ.3) THEN
+ relax(u1,falsdt,5.E-1) 
+ relax(v1,falsdt,5.E-1)
+ relax(w1,falsdt,5.E-1)
+ lsweep=970
ENDIF
IF(GRD.EQ.4) THEN
+ relax(u1,falsdt,1.E-1) 
+ relax(v1,falsdt,1.E-1)
+ relax(w1,falsdt,1.E-1)
+ lsweep=2000
ENDIF
IF(GRD.EQ.5) THEN
+ relax(u1,falsdt,5.E-2) 
+ relax(v1,falsdt,5.E-2)
+ relax(w1,falsdt,5.E-2)
+ lsweep=2700
ENDIF
IF(GRD.EQ.6) THEN
+ relax(u1,falsdt,1.E-2) 
+ relax(v1,falsdt,1.E-2)
+ relax(w1,falsdt,1.E-2)
+ lsweep=5000
ENDIF

OUTPUT(U1,Y,N,N,Y,Y,Y)
OUTPUT(V1,Y,N,N,Y,Y,Y)
OUTPUT(W1,Y,N,N,Y,Y,Y)
IXMON=NX/2;IYMON=NY/2;IZMON=NZ/2;
NXPRIN=NX/3;NYPRIN=NY/3;NZPRIN=NZ/3
TSTSWP=-1
 
selref=F
resref(P1)=1.E-5
resref(U1)=1.E-5
resref(V1)=1.E-5
resref(W1)=1.E-5

ITABL=3

IF(SLV.EQ.1) THEN

   MIGAL parameters
   ----------------

  A relief pressure condition is not necessary for MIGAL

+ REL1=skip

  Use a false time step to damp non-linear instability

+ relax(u1,falsdt,1.E+0) 
+ relax(v1,falsdt,1.E+0)
+ relax(w1,falsdt,1.E+0)
 
+ spedat(MIGAL,SOLVED1, c, HYDRO)
+ spedat(MIGAL,LINRLX1, r, 1.)
+ spedat(MIGAL,RELAX1, r, .9)

ENDIF

IF(GRD.EQ.1.AND.SLV.EQ.1) THEN
+ lsweep=42
ENDIF
IF(GRD.EQ.2.AND.SLV.EQ.1) THEN
+ lsweep=50
ENDIF
IF(GRD.EQ.3.AND.SLV.EQ.1) THEN
+ lsweep=50
ENDIF
IF(GRD.EQ.4.AND.SLV.EQ.1) THEN
+ lsweep=55
ENDIF
IF(GRD.EQ.5.AND.SLV.EQ.1) THEN
+ lsweep=55
ENDIF
IF(GRD.EQ.6.AND.SLV.EQ.1) THEN
+ lsweep=60
ENDIF