CCM Test: Swirling flow in the expanding pipe.
  **************************************************************
  DISPLAY
   This case  concerns axisymmetric  incompressible laminar/
   turbulent flow in the  expanding pipe. The flow  exhibits
   recirculation not only behind the step at the pipe  wall,
   but in the region on the pipe axis.
 
   Calculations  of  the  turbulent  flow (LTURB=T) could be
   made with low-Re extensions of whether standard K-E model
   (LOWKE=T) or Chen-Kim K-E model (LCHEK=T).
 
   User can switch from the default colocated  computational
   algorithm (CCM)  to the  staggered one  (STAG) by setting
   LCCM= F.
   ---------------------------------------------------------
  ENDDIS
L(PAUSE
  **************************************************************
BOOLEAN(LCCM,LTURB,LOWRE,LCHEK); LCCM= T
LTURB= F;  LOWRE= F;  LCHEK= F
  **************************************************************
  PHOTON USE
   p ;;;;;
 
   set vec av off
   msg Velocity vectors:
   vec i 1 sh
   msg Press any key to continue ...
   pause
   cl
   msg Pressure contours:
   con p1 i 1 fi;0.01
   pause
   msg Press any key to continue ...
   cl
   msg Swirl velocity contours:
   con uc1 i 1 fi;0.01
   pause
   msg Press any key to continue ...
   cl
   msg W-component contours:
   con w1 i 1 fi;0.01
   msg Press any key to continue ...
  ENDUSE
  **************************************************************
    GROUP 1. Run title and other preliminaries
IF(LCCM) THEN
+IF(LTURB) THEN
+ IF(LOWRE) THEN
+  TEXT(CCM: Swirl-flow (K-E low-Re).
+ ELSE
+  TEXT(CCM: Swirl-flow (Chen-Kim K-E low-Re).
+ ENDIF
+ELSE
+ TEXT(CCM: Swirl-flow (Re=100).
+ENDIF
ELSE
+IF(LTURB) THEN
+ IF(LOWRE) THEN
+  TEXT(STAG: Swirl-flow (K-E low-Re).
+ ELSE
+  TEXT(STAG: Swirl-flow (Chen-Kim K-E low-Re).
+ ENDIF
+ELSE
+ TEXT(STAG: Swirl-flow (Re=100).
+ENDIF
ENDIF
TITLE
INTEGER(NZST,NYST,NZ1,NY1,IC)
REAL(REYNO,WIN,UIN,HSTEP,LSTPP,HCHAN,LCHAN,DXX,DTHYD,UCUR)
REAL(TKEIN,EPSIN)
  ** Problem definition:
IF(LTURB) THEN
+ REYNO= 1.0E5
ELSE
+ REYNO= 100.0
ENDIF
HSTEP= 1.0;  LSTPP= 2.0;  HCHAN= 2.0;  LCHAN= 20.0
WIN  = 1.0;  DXX  = 0.1;  UIN  = 3.0;  ENUL = WIN*HSTEP/REYNO
NZST = 6;    NYST = 6;    NZ1  = 27;   NY1  = 12
    GROUP 3. X-direction grid specification
CARTES= F; NX= 1; GRDPWR(X,NX,DXX,1.0)
    GROUP 4. Y-direction grid specification
NREGY = 2; NY = NY1+NYST
IREGY = 1; GRDPWR(Y,-NY1, HCHAN-HSTEP,1.0)
IREGY = 2; GRDPWR(Y,-NYST,HSTEP,      1.0)
    GROUP 5. Z-direction grid specification
NREGZ = 2; NZ = NZST+NZ1
IREGZ = 1; GRDPWR(Z,NZST,LSTPP,      -1.4)
IREGZ = 2; GRDPWR(Z,NZ1, LCHAN-LSTPP, 1.3)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,W1,V1)
IF(LTURB) THEN
+ IF(LCHEK) THEN
+  TURMOD(KECHEN-LOWRE)
+ ELSE
+  TURMOD(KEMODL-LOWRE)
+ ENDIF
+ STORE(ENUT,LEN1)
ENDIF
IF(LCCM) THEN
L($F150)
+ NAME(C1)= UC1; SOLVE(UC1); SOLUTN(UC1,Y,Y,Y,N,N,N)
ELSE
+ SOLVE(U1)
ENDIF
    GROUP 11. Initialization of variable or porosity fields
INIADD= F
CONPOR(STEP,0.0,CELL,1,NX,NY1+1,NY,1,NZST)
IF(LCCM) THEN
+ FIINIT(WC1) = 1.E-3; FIINIT(VC1) = 1.E-3
ELSE
+ FIINIT(W1)  = 1.E-3; FIINIT(V1)  = 1.E-3
ENDIF
IF(LTURB) THEN
+ TKEIN= (0.05*WIN)**2; EPSIN     = TKEIN**1.5*0.1643/0.09*HSTEP
+ FIINIT(P1)= 1.3E-4;   FIINIT(KE)= TKEIN;  FIINIT(EP)= EPSIN
ENDIF
    GROUP 13. Boundary conditions and special sources
    ** Inlet.
DO II = 1,NY1
+ UCUR = (2*II-1)*UIN/NY1/2
+ INLET(INL:II:,LOW,1,NX,II,II,1,1,1,LSTEP)
+ VALUE(INL:II:,P1,WIN*RHO1)
+ VALUE(INL:II:,W1,WIN); VALUE(INL:II:,V1,0.0)
+ IF(LTURB) THEN
+  VALUE(INL:II:,KE,TKEIN); VALUE(INL:II:,EP,EPSIN)
+ ENDIF
+ IF(LCCM) THEN
+  VALUE(INL:II:,UC1,UCUR); VALUE(INL:II:,WC1,WIN)
+  VALUE(INL:II:,VC1,0.0)
+ ELSE
+  VALUE(INL:II:,U1, UCUR)
+ ENDIF
ENDDO
    ** Outlet.
PATCH(OUT1,HIGH,1,1,1,NY,NZ,NZ,1,1); COVAL(OUT1,P1,1.E5,0.0)
    ** Walls.
PATCH(WN1,NWALL,1,NX,  NY1,NY1,     1,NZST  ,1,LSTEP)
PATCH(WN2,NWALL,1,NX,   NY, NY,NZST+1,NZ    ,1,LSTEP)
PATCH(WL, LWALL,1,NX,NY1+1, NY,NZST+1,NZST+1,1,LSTEP)
IF(LTURB) THEN
+ COVAL(WN1,  KE,1.0,0.0); COVAL(WN2,  KE,1.0,0.0)
+ COVAL(WN1,LTLS,1.0,0.0); COVAL(WN2,LTLS,1.0,0.0)
+ COVAL( WL,  KE,1.0,0.0); COVAL( WL,LTLS,1.0,0.0)
+IF(LCCM) THEN
+ COVAL(WN1,WC1,LOGLAW,0.0); COVAL(WN1,VC1,LOGLAW,0.0)
+ COVAL(WN1,UC1,LOGLAW,0.0)
+ COVAL(WN2,WC1,LOGLAW,0.0); COVAL(WN2,VC1,LOGLAW,0.0)
+ COVAL(WN2,UC1,LOGLAW,0.0)
+ COVAL(WL, WC1,LOGLAW,0.0); COVAL(WL, VC1,LOGLAW,0.0)
+ COVAL(WL, UC1,LOGLAW,0.0)
+ELSE
+ COVAL(WN1,W1, LOGLAW,0.0); COVAL(WN1,V1, LOGLAW,0.0)
+ COVAL(WN1,U1,LOGLAW,0.0)
+ COVAL(WN2,W1, LOGLAW,0.0); COVAL(WN2,V1, LOGLAW,0.0)
+ COVAL(WN2,U1, LOGLAW,0.0)
+ COVAL(WL ,W1, LOGLAW,0.0); COVAL(WL ,V1, LOGLAW,0.0)
+ COVAL(WL ,U1, LOGLAW,0.0)
+ENDIF
ELSE
+IF(LCCM) THEN
+ COVAL(WN1,WC1,1.0,0.0); COVAL(WN1,VC1,1.0,0.0)
+ COVAL(WN1,UC1,1.0,0.0)
+ COVAL(WN2,WC1,1.0,0.0); COVAL(WN2,VC1,1.0,0.0)
+ COVAL(WN2,UC1,1.0,0.0)
+ COVAL(WL, WC1,1.0,0.0); COVAL(WL, VC1,1.0,0.0)
+ COVAL(WL, UC1,1.0,0.0)
+ELSE
+ COVAL(WN1,W1, 1.0,0.0); COVAL(WN1,V1, 1.0,0.0)
+ COVAL(WN1,U1, 1.0,0.0)
+ COVAL(WN2,W1, 1.0,0.0); COVAL(WN2,V1, 1.0,0.0)
+ COVAL(WN2,U1, 1.0,0.0)
+ COVAL(WL ,W1, 1.0,0.0); COVAL(WL ,V1, 1.0,0.0)
+ COVAL(WL ,U1, 1.0,0.0)
+ENDIF
ENDIF
    GROUP 15. Termination of sweeps
LSWEEP = 200; TSTSWP = -1
    GROUP 16. Termination of iterations
SELREF = T;   RESFAC = 1.E-3
    GROUP 17. Under-relaxation devices
DTHYD = HCHAN/(NY*WIN)
IF(LCCM) THEN
+ RELAX(P1, LINRLX,1.0)
+ RELAX(UC1,FALSDT,DTHYD); RELAX(VC1,FALSDT,DTHYD)
+ RELAX(WC1,FALSDT,DTHYD)
ELSE
+ RELAX(P1,LINRLX,0.25)
+ RELAX(U1,FALSDT,DTHYD); RELAX(V1,FALSDT,DTHYD)
+ RELAX(W1,FALSDT,DTHYD)
ENDIF
IF(LTURB) THEN
+ KELIN= 1; RELAX(KE,FALSDT,DTHYD); RELAX(EP,FALSDT,DTHYD)
ENDIF
    GROUP 22. Spot-value print-out
IXMON = NZ/2+1; IYMON = NY/2+1; IXMON=1
    GROUP 23. Field print-out and plot control
NYPRIN= 1; NZPRIN = 1