TEXT(2D LAMINAR WALL-DRIVEN CAVITY
TITLE
  DISPLAY
  This case is identical to library case N102, except that the
  calculation may be performed in any plane by selecting the
  vertical and horizontal coordinate axes. This case serves to
  test the operation of the schemes in all coordinate panes.
  ENDDIS
CHAR(LWAL,RWAL,BWAL,TWAL,SCHM,DIRV,DIRH,VELV,VELH,PLANE)
INTEGER(IXP,IYP,IZP);REAL(RENO,ULID,YCAV,DTF)
IXP=1;IYP=1;IZP=1
MESG( Enter required vertical coordinate X,Y or Z
MESG( Default:  X
READVDU(DIRV,CHAR,X)
CASE :DIRV: OF
WHEN X,1
+ IREGX=1;BWAL=WEST;TWAL=EAST;VELV=U1
WHEN Y,1
+ IREGY=1;BWAL=SOUTH;TWAL=NORTH;VELV=V1
WHEN Z,1
+ IREGZ=1;BWAL=LOW;TWAL=HIGH;VELV=W1
ENDCASE
MESG( Enter required horizontal coordinate X,Y or Z
MESG( Default:  Z
READVDU(DIRH,CHAR,Z)
CASE :DIRH: OF
WHEN X,1
+ NREGX=1;LWAL=WEST;RWAL=EAST;VELH=U1
WHEN Y,1
+ NREGY=1;LWAL=SOUTH;RWAL=NORTH;VELH=V1
WHEN Z,1
+ NREGZ=1;LWAL=LOW;RWAL=HIGH;VELH=W1
ENDCASE
PLANE=:DIRV::DIRH:
TEXT(2D:PLANE: LAMINAR WALL-DRIVEN CAVITY
MESG(Enter Reynolds number - default 1000
READVDU(RENO,REAL,1000.)
ULID=1.0;YCAV=1.0
    GROUP 2. Transience; time-step specification
    GROUP 3. X-direction grid specification
    GROUP 4. Y-direction grid specification
GRDPWR(:DIRV:,-21,YCAV,1.4)
    GROUP 5. Z-direction grid specification
GRDPWR(:DIRH:,-21,YCAV,1.4)
    GROUP 6. Body-fitted coordinates or grid distortion
    GROUP 7. Variables stored, solved & named
SOLVE(P1,:VELV:,:VELH:);SOLUTN(P1,Y,Y,Y,N,N,N)
SOLUTN(:VELV:,Y,Y,N,N,N,N);SOLUTN(:VELH:,Y,Y,N,N,N,N)
    GROUP 8. Terms (in differential equations) & devices
MESG( Enter required convection scheme
MESG( Default: CUS - Cubic upwind
MESG( The options are:
MESG(  CUS   - Cubic upwind
MESG(  FOU   - 1st order upwind
MESG(  QUI   - QUICK
MESG(  KOR   - KOREN    - bounded QUICK
READVDU(SCHM,CHAR,CUS)
CASE :SCHM: OF
WHEN CUS,3
+ MESG(Cubic upwind scheme
+ SCHEME(CUS,:VELV:,:VELH:)
WHEN FOU,3
+ MESG(First-order upwind scheme
+ DIFCUT=0
WHEN QUI,3
+ MESG(Quadratic upwind scheme - QUICK
+ SCHEME(QUICK,:VELV:,:VELH:)
WHEN KOR,3
+ MESG(KOREN scheme - bounded QUICK
+ SCHEME(KOREN,:VELV:,:VELH:)
ENDCASE
    GROUP 9. Properties of the medium (or media)
ENUL=ULID*YCAV/RENO
    GROUP 10. Inter-phase-transfer processes and properties
    GROUP 11. Initialization of variable or porosity fields
    GROUP 13. Boundary conditions and special sources
  ** Bottom wall, at rest
WALL (BOT,:BWAL:,#1,#1,#1,#1,#1,#NREG:DIRH:,1,1)
COVAL(BOT,:VELH:,1.0,0.0)
  ** Top wall, moving
WALL(TOP,:TWAL:,#NREG:DIRV:,#NREG:DIRV:,#1,#1,#1,#NREG:DIRH:,1,1)
COVAL(TOP,:VELH:,1.0,-ULID)
  ** Left wall, at rest
WALL (LEFT,:LWAL:,#1,#NREG:DIRV:,#1,#1,#1,#1,1,1)
COVAL(LEFT,:VELV:,1.0,0.0)
  ** Right wall, at rest
WALL(RIGHT,:RWAL:,#1,#NREG:DIRV:,#1,#1,#NREG:DIRH:,#NREG:DIRH:,1,1)
COVAL(RIGHT,:VELV:,1.0,0.0)
  ** Pressure relief
IF(NX.GT.1) THEN
+ IXP=NX/2
ENDIF
IF(NY.GT.1) THEN
+ IYP=NY/2
ENDIF
IF(NZ.GT.1) THEN
+ IZP=NZ/2
ENDIF
PATCH(FIXPRESS,CELL,IXP,IXP,IYP,IYP,IZP,IZP,1,1)
COVAL(FIXPRESS,P1,FIXP,0.0);COVAL(FIXPRESS,:VELH:,ONLYMS,0.0)
COVAL(FIXPRESS,:VELV:,ONLYMS,0.0)
    GROUP 14. Downstream pressure for PARAB=.TRUE.
    GROUP 15. Termination of sweeps
LSWEEP=800;TSTSWP=-1
    GROUP 16. Termination of iterations
    GROUP 17. Under-relaxation devices
DTF=YCAV/(ULID*(N:DIRH:));RELAX(P1,LINRLX,1.0)
RELAX(:VELV:,FALSDT,5.0*DTF);RELAX(:VELH:,FALSDT,5.0*DTF)
    GROUP 18. Limits on variables or increments to them
    GROUP 22. Spot-value print-out
I:DIRH:MON=NZ/2;I:DIRV:MON=N:DIRV:-1;ITABL=3;NPLT=10
    GROUP 23. Field print-out and plot control