CCM Test : Lid driven flow in a cavern (X-Y plane).
  **************************************************************
  DISPLAY
   This case consider plane incompressible laminar/turbulent
   flow induced in  a square cavity  by the moving  lid. The
   main objectives of the test case is to provide comparison
   with the staggered  calculations of laminar  (LTURB=F) or
   turbulent (LTURB=T) flows. In case of the turbulent flow,
   the  calculation  is  performed  with  whether  the  Lam-
   Bremhorst low-Re K-E model (LTWOL=F) or two-layer  low-Re
   K-E model (LTWOL= T), rather than with the standard high-
   Re form plus wall functions.
 
   User can switch  from the staggered  computational method
   (STAG) to the colocated computational algorithm (CCM)  by
   setting LCCM=T.
   ---------------------------------------------------------
  ENDDIS
L(PAUSE
  **************************************************************
BOOLEAN(LCCM,LTURB,LTWOL);  LCCM= T;  LTURB= F;  LTWOL= T
  **************************************************************
  PHOTON USE
   p ; ; ; ; ;
 
   msg Computational Domain:
   gr k 1
   msg Press Any Key to Continue...
   pause
   cl
   set vec av off
   msg Velocity Vectors:
   vec k 1 sh
   msg Press Any Key to Continue...
   pause
   cl
   msg Contours of U-velocity Resolutes:
   con u1 k 1 fi;0.001
   msg Press E  to exit PHOTON ...
  ENDUSE
  **************************************************************
    GROUP 1. Run title and other preliminaries
REAL(REYNU,UIN,DCAV,FRIC,LMIX,TKEIN,EPSIN,DTHYD)
IF(LTURB) THEN
+ REYNU= 1.E6
+IF(LCCM) THEN
+ IF(LTWOL) THEN
+  TEXT(CCM : Square cavern (2-layer low-Re).
+ ELSE
+  TEXT(CCM : Square cavern (Lam-Brem low-Re).
+ ENDIF
+ELSE
+ IF(LTWOL) THEN
+ TEXT(STAG: Square cavern (2-layer low-Re).
+ ELSE
+ TEXT(STAG: Square cavern (Lam-Brem low-Re).
+ ENDIF
+ENDIF
ELSE
+ REYNU= 1.E4
+IF(LCCM) THEN
+ TEXT(CCM : Square cavern (Re=10000.).
+ELSE
+ TEXT(STAG: Square cavern (Re=10000.).
+ENDIF
ENDIF
TITLE
  ** Problem definition:
UIN= 1.0;  DCAV= 0.1;  ENUL= UIN*DCAV/REYNU;  RHO1= 1.198
NX = 40;   NY  = 40;   NZ  = 1
    GROUP 3. X-direction grid specification
GRDPWR(X,-NX,DCAV,1.5)
    GROUP 4. Y-direction grid specification
GRDPWR(Y,-NY,DCAV,1.5)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1)
IF(LTURB) THEN
+ STORE(ENUT,LEN1);
+ IF(LTWOL) THEN
+  TURMOD(KEMODL-2L)
+ ELSE
+  TURMOD(KEMODL-LOWRE)
+ ENDIF
ENDIF
IF(LCCM) THEN
L($F150)
ENDIF
    GROUP 11. Initialization of variable or porosity fields
INIADD= F
IF(LTURB) THEN
+ FRIC  = 0.018;      TKEIN      = 0.25*UIN*UIN*FRIC
+ LMIX  = 0.09*DCAV;  EPSIN      = 0.1643*TKEIN**1.5/LMIX
+ FIINIT(P1)= 1.3E-4; FIINIT(KE) = TKEIN;  FIINIT(EP)= EPSIN
ENDIF
    GROUP 13. Boundary conditions and special sources
    ** Walls.
PATCH(WS,SWALL,1, NX,1, 1, 1,NZ,1,LSTEP)
PATCH(WN,NWALL,1, NX,NY,NY,1,NZ,1,LSTEP)
PATCH(WW,WWALL,1, 1, 1, NY,1,NZ,1,LSTEP)
PATCH(WE,EWALL,NX,NX,1, NY,1,NZ,1,LSTEP)
IF(LTURB) THEN
+ COVAL(WS,  KE,1.0,0.0); COVAL(WN,  KE,1.0,0.0)
+ COVAL(WW,  KE,1.0,0.0); COVAL(WE,  KE,1.0,0.0)
+ COVAL(WS,LTLS,1.0,0.0); COVAL(WN,LTLS,1.0,0.0)
+ COVAL(WW,LTLS,1.0,0.0); COVAL(WE,LTLS,1.0,0.0)
+IF(LCCM) THEN
+ COVAL(WS,UC1,LOGLAW,0.0); COVAL(WS,VC1,LOGLAW,0.0)
+ COVAL(WN,UC1,LOGLAW,UIN); COVAL(WN,VC1,LOGLAW,0.0)
+ COVAL(WW,UC1,LOGLAW,0.0); COVAL(WW,VC1,LOGLAW,0.0)
+ COVAL(WE,UC1,LOGLAW,0.0); COVAL(WE,VC1,LOGLAW,0.0)
+ELSE
+ COVAL(WS,U1, LOGLAW,0.0); COVAL(WS,V1,LOGLAW,0.0)
+ COVAL(WN,U1, LOGLAW,UIN); COVAL(WN,V1, LOGLAW,0.0)
+ COVAL(WW,U1, LOGLAW,0.0); COVAL(WW,V1, LOGLAW,0.0)
+ COVAL(WE,U1,LOGLAW,0.0); COVAL(WE,V1, LOGLAW,0.0)
+ENDIF
ELSE
+IF(LCCM) THEN
+ COVAL(WS,UC1,1.0,0.0); COVAL(WS,VC1,1.0,0.0)
+ COVAL(WN,UC1,1.0,UIN); COVAL(WN,VC1,1.0,0.0)
+ COVAL(WW,UC1,1.0,0.0); COVAL(WW,VC1,1.0,0.0)
+ COVAL(WE,UC1,1.0,0.0); COVAL(WE,VC1,1.0,0.0)
+ELSE
+ COVAL(WS,U1, 1.0,0.0); COVAL(WS,V1, 1.0,0.0)
+ COVAL(WN,U1, 1.0,UIN); COVAL(WN,V1, 1.0,0.0)
+ COVAL(WW,U1, 1.0,0.0); COVAL(WW,V1, 1.0,0.0)
+ COVAL(WE,U1, 1.0,0.0); COVAL(WE,V1, 1.0,0.0)
+ENDIF
ENDIF
  ** Pressure relief
PATCH(FIXP,CELL,NX/2,NX/2,NY/2,NY/2,1,1,1,LSTEP)
COVAL(FIXP,P1,FIXP,0.0)
    GROUP 15. Termination of sweeps
LSWEEP = 250; TSTSWP = -1
    GROUP 16. Termination of iterations
SELREF = T;   RESFAC = 1.E-3
    GROUP 17. Under-relaxation devices
RELAX(P1, LINRLX,0.5);  DTHYD= 10.*DCAV/NX/UIN
IF(LCCM) THEN
+ RELAX(UC1,FALSDT,DTHYD); RELAX(VC1,FALSDT,DTHYD)
ELSE
+ RELAX(U1, FALSDT,DTHYD); RELAX(V1, FALSDT,DTHYD)
ENDIF
IF(LTURB) THEN
+ KELIN= 3; RELAX(KE,LINRLX,0.5); RELAX(EP,LINRLX,1.0)
ENDIF
    GROUP 22. Spot-value print-out
IXMON = NX/2+1; IYMON = NY/2+1; IZMON = 1