CCM Test: Laminar flow over back-facing step (Y-Z plane).
  **************************************************************
  DISPLAY
   The problem concerns 2D incompressible, laminar/turbulent
   flow over a back-facing step. The case is similar to that
   described for library case  T103. The main objectives  of
   it are:
   1. Provide comparative test against calculations by stag-
      gered algorithm for the case set whether as  Cartesian
      (CARTES= T, or cylindrical geometry (CARTES= F).
   2. Provide test for the use of turbulence model with CCM-
      method (LTURB=T).  The calculation  is performed  with
      either the Lam-Bremhorst low-Re K-E model (LTWOL=F) or
      the 2-layer  low-Re K-E  model (LTWOL=T),  rather than
      with the standard high-Re form plus wall functions.
   User can switch from the default colocated  computational
   algorithm (CCM)  to the  staggered one  (STAG) by setting
   LCCM = F. While using  CCM-method, it is possible to  use
   higher order convective schemes (see settings at the  end
   of Q1-file).
 
   A fully developed parabolic  laminar flow profile can  be
   prescribed at the inflow by setting LUNIF = F.  Otherwise
   inflow is uniform.
  ----------------------------------------------------------
  ENDDIS
L(PAUSE
  **************************************************************
BOOLEAN(LCCM,LUNIF,LTURB,LTWOL)
LCCM = T;  LUNIF = F;  CARTES= T;  LTURB= T;  LTWOL = T
IF(LTURB) THEN
+ LUNIF = T
ENDIF
  **************************************************************
  PHOTON USE
   p ; ; ; ; ;
 
   msg Computational Domain:
   gr i 1
   msg Press Any Key to Continue...
   pause
   cl
   set vec av off
   msg Velocity Vectors:
   vec i 1 sh
   msg Press Any Key to Continue...
   pause
   cl
   msg Contours of Pressure:
   con p1 i 1 fi;0.1
   pause
   cl
   msg Contours of W1-velocity:
   con w1 i 1 fi;0.1
   pause
   cl
   msg Contours of V1-velocity:
   con v1 i 1 fi;0.1
   msg Press E  to exit PHOTON ...
  ENDUSE
  **************************************************************
    GROUP 1. Run title and other preliminaries
IF(LTURB) THEN
+IF(LTWOL) THEN
+ IF(LCCM) THEN
+  TEXT(CCM: Back-facing step (2 layer K-E).
+ ELSE
+  TEXT(STAG: Back-facing step (2 layer K-E).
+ ENDIF
+ELSE
+ IF(LCCM) THEN
+  TEXT(CCM : Back-facing step (Lam-Brem K-E).
+ ELSE
+  TEXT(STAG: Back-facing step (Lam-Brem K-E).
+ ENDIF
+ENDIF
ELSE
+IF(LCCM) THEN
+ TEXT(CCM : Back-facing step (Re=150).
+ELSE
+ TEXT(STAG: Back-facing step (Re=150).
+ENDIF
ENDIF
TITLE
INTEGER(NZST,NYST,NZ1,NY1,IC)
REAL(REYNO,WIN,UIN,HSTEP,STEPL,HCHAN,LCHAN,YCUR,UCR,USW)
REAL(FRIC,LMIX,TKEIN,EPSIN,DTHYD)
  ** Problem definition:
IF(LTURB) THEN
+ REYNO= 4.5E4; WIN= 13.0
ELSE
+ REYNO= 150.0; WIN= 1.0
ENDIF
UIN = 0.2; HSTEP= 0.5; STEPL= 3.0; HCHAN= 1.5; LCHAN= 22.0
ENUL= WIN*HSTEP/REYNO; RHO1 = 1.189
NYST= 10;  NZST = 7;   NY1  = 15;  NZ1  = 38
    GROUP 3. X-direction grid specification
NX= 1; IREGX= 1; GRDPWR(X,NX,0.1,1.0)
    GROUP 4. Y-direction grid specification
NREGY = 2;
IF(CARTES) THEN
+ IREGY= 1; GRDPWR(Y,-NYST,HSTEP,       1.4)
ELSE
+ IREGY= 1; GRDPWR(Y, NYST,HSTEP,      -1.4)
ENDIF
IREGY= 2;   GRDPWR(Y,-NY1, HCHAN-HSTEP, 1.4)
    GROUP 5. Z-direction grid specification
NREGZ = 2;
IREGZ = 1; GRDPWR(Z,NZST,STEPL,      -1.4)
IREGZ = 2; GRDPWR(Z,NZ1, LCHAN-STEPL, 1.3)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,V1,W1)
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
CONPOR(STEP,0.0,CELL,1,NX,1,NYST,1,NZST)
IF(LTURB) THEN
+ FRIC  = 0.018;      TKEIN     = 0.25*UIN*UIN*FRIC
+ LMIX  = 0.09*HSTEP; 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
    ** Inlet.
IC = NY-NYST
DO II = 1,IC
+ YCUR = HSTEP+(2*II-1)*HCHAN/NY/2
+ IF(LUNIF) THEN
+  UCR = WIN
+ ELSE
+  UCR = WIN*(1.0-((2*YCUR-HCHAN-HSTEP)/(HCHAN-HSTEP))**2)
+ ENDIF
+ USW = UIN*(YCUR-HSTEP)/(HCHAN-HSTEP)
+ INLET(INL:II:,LOW,1,NX,NYST+II,NYST+II,1,1,1,LSTEP)
+  VALUE(INL:II:,P1,UCR*RHO1)
+ IF(LTURB) THEN
+  VALUE(INL:II:,KE,TKEIN); VALUE(INL:II:,EP,EPSIN)
+ ENDIF
+ IF(LCCM) THEN
+  VALUE(INL:II:,VC1,0.0); VALUE(INL:II:,WC1,UCR)
+ ELSE
+  VALUE(INL:II:,V1, 0.0); VALUE(INL:II:,W1, UCR)
+ ENDIF
ENDDO
    ** Walls.
PATCH(WS1,SWALL,1,NX,NYST+1,NYST+1,1,     NZST,  1,LSTEP)
PATCH(WN, NWALL,1,NX,NY,    NY,    1,     NZ,    1,LSTEP)
PATCH(WL, LWALL,1,NX,1,     NYST,  NZST+1,NZST+1,1,LSTEP)
IF(LTURB) THEN
+ COVAL(WS1,KE,1.0,0.0); COVAL(WS1,LTLS,1.0,0.0)
+ COVAL(WN, KE,1.0,0.0); COVAL(WN, LTLS,1.0,0.0)
+ COVAL(WL, KE,1.0,0.0); COVAL(WL, LTLS,1.0,0.0)
+IF(LCCM) THEN
+ COVAL(WS1,VC1,LOGLAW,0.0); COVAL(WS1,WC1,LOGLAW,0.0)
+ COVAL(WN, VC1,LOGLAW,0.0); COVAL(WN, WC1,LOGLAW,0.0)
+ COVAL(WL, VC1,LOGLAW,0.0); COVAL(WL, WC1,LOGLAW,0.0)
+ELSE
+ COVAL(WS1,V1, LOGLAW,0.0); COVAL(WS1,W1, LOGLAW,0.0)
+ COVAL(WN ,V1, LOGLAW,0.0); COVAL(WN ,W1, LOGLAW,0.0)
+ COVAL(WL ,V1, LOGLAW,0.0); COVAL(WL ,W1, LOGLAW,0.0)
+ENDIF
ELSE
+IF(LCCM) THEN
+ COVAL(WS1,VC1,1.0,0.0); COVAL(WS1,WC1,1.0,0.0)
+ COVAL(WN, VC1,1.0,0.0); COVAL(WN, WC1,1.0,0.0)
+ COVAL(WL, VC1,1.0,0.0); COVAL(WL, WC1,1.0,0.0)
+ELSE
+ COVAL(WS1,V1, 1.0,0.0); COVAL(WS1,W1, 1.0,0.0)
+ COVAL(WN ,V1, 1.0,0.0); COVAL(WN ,W1, 1.0,0.0)
+ COVAL(WL ,V1, 1.0,0.0); COVAL(WL ,W1, 1.0,0.0)
+ENDIF
ENDIF
IF(CARTES) THEN
+ PATCH(WS2,SWALL,1,NX,1,1,NZST+1,NZ,1,LSTEP)
+ IF(LTURB) THEN
+  COVAL(WS2,KE,1.0,0.0); COVAL(WS2,LTLS,1.0,0.0)
+  IF(LCCM) THEN
+   COVAL(WS2,VC1,LOGLAW,0.0); COVAL(WS2,WC1,LOGLAW,0.0)
+  ELSE
+   COVAL(WS2,V1, LOGLAW,0.0); COVAL(WS2,W1, LOGLAW,0.0)
+  ENDIF
+ ELSE
+  IF(LCCM) THEN
+   COVAL(WS2,VC1,1.0,0.0); COVAL(WS2,WC1,1.0,0.0)
+  ELSE
+   COVAL(WS2,V1, 1.0,0.0); COVAL(WS2,W1, 1.0,0.0)
+  ENDIF
+ ENDIF
ENDIF
    ** Outlet.
PATCH(OUT1,HIGH,1,NX,1,NY,NZ,NZ,1,LSTEP)
COVAL(OUT1,P1,1000.0,0.0)
IF(LTURB) THEN
+ COVAL(OUT1,KE,ONLYMS,0.0); COVAL(OUT1,EP,ONLYMS,0.0)
ENDIF
    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
DTHYD= LCHAN/NZ/WIN
IF(LCCM) THEN
+ RELAX(P1, LINRLX,0.5)
+ RELAX(VC1,FALSDT,10.*DTHYD); RELAX(WC1,FALSDT,10.*DTHYD)
ENDIF
IF(LTURB) THEN
+ KELIN= 1; RELAX(KE, FALSDT,DTHYD); RELAX(EP, FALSDT,DTHYD)
ENDIF
    GROUP 19. Data communicated by satellite to GROUND
IF(LCCM) THEN
    * LSG7 permits CCM-solver to use higher order schemes.
     + lsg7 deactivated= T    deactivated
ENDIF
  SCHMBEGIN
      VARNAM VC1  SCHEME MINMOD
      VARNAM WC1  SCHEME MINMOD
      VARNAM KE   SCHEME MINMOD
      VARNAM EP   SCHEME MINMOD
  SCHMEND
    GROUP 22. Spot-value print-out
IXMON= 1; IYMON= NY/2+1; IZMON= NZ/2+1