TALK=T;RUN( 1, 1)
 ** LOAD(x206) from the x Input Library
    GROUP 1. Run title and other preliminaries
TEXT(LAM-BRE KE_1D DEVEL CHANNL FLOW   :T206
TITLE
  DISPLAY
  The case considered is 2d fully-developed turbulent flow in a
  plane closed channel at a Re=1.E5. The turbulence is simulated by
  use of the Lam-Bremhorst low-Re k-e model. solution is obtained by
  use of the single-slab solver with a specified mass flow rate. A
  non-uniform grid is employed so as to concentrate cells very close
  to the wall. For this purpose a grid is generated which is a
  geometric progression with the property that the ratio of any two
  adjacent cell lengths is a constant. The calculation may also be
  performed with the low-Re Chen-kim k-e model, the Wilcox low-Re
  k-w models, the Menter k-w model, and k-w-SST model. No grid-
  dependency studies have been carried out. All models produce 
  similar velocity and turbulence profiles, and the comparison 
  between measured and computed friction factors f and velocity-
  defect parameters vdp are given below:
                             f          vdp
    Data                   0.0156      2.32     
    Chen-Kim k-e           0.0163      2.18      
    Lam Bremhorst k-e      0.0177      2.16    
    Wilcox 1988 k-w model  0.0163      2.08      
	Wilcox 2088 k-w model  0.0155      2.14
    Menter k-w model       0.0162      2.04  
    k-w SST model          0.0152      2.11	

  where f=8.*(wstar/wbulk)**2 and and vdp=(wcl-wbulk)/wstar.
  ENDDIS
 
   The following AUTOPLOT use file produces three plots;
   the first is the axial velocity profile; the second
   is the turbulence energy profile; and the third is the
   eddy-viscosity profile.
 
   AUTOPLOT USE
   file
   phi 5
 
   da 1 w1;col9 1
   msg Velocity (W1) profile
   msg Press RETURN to continue
   pause
   clear
   da 1 ke;col9 1
   msg KE profile
   msg Press RETURN to continue
   pause
   clear
   da 1 ENUT;col9 1
   msg Press e to END
   ENDUSE
 
CHAR(CTURB,TLSC);BOOLEAN(VARLAM);VARLAM=T
REAL(HGHT,WIN,REY,REYH,DHYDR,MIXL,FRIC,DPDZ,MASIN,DTF)
REAL(TKEIN,EPSIN,DELT1,DELT2,DELT3,US,EPSPLS)
REAL(KFAC,DELY,GR,GYPLUS,GWPLUS,GWR);INTEGER(JJM,JJM1)
  ** NB: The the hydraulic diameter is equal to 2.*duct height,
         so that pipe-flow correlations still apply
         with diameter replaced by 2.*height
HGHT=0.1;WIN=1.0; REY=1.E5;DHYDR=2.*HGHT; REYH=2.*REY
FRIC=1./(1.82*LOG10(REYH)-1.64)**2
US=WIN*(FRIC/8.)**0.5;DPDZ=0.5*RHO1*WIN*WIN*FRIC/DHYDR
  ** estimate initial values from K+=2 & EP+=1./(ak*Y+)
EPSPLS=1./(0.41*100.)
TKEIN=2.*US*US;ENULA=WIN*HGHT/REY;EPSIN=EPSPLS*US**4/ENULA
    GROUP 4. Y-direction grid specification
ENULA=WIN*HGHT/REY
  ** define first dely from wall and the grid-expansion
     factor Kfac which defines a constant ratio of lengths of
     two adjacent cells.
DELT1=1.*ENULA/US;KFAC=1.1;DELY=DELT1/(0.5*HGHT)
  ** calculate NY from dely & Kfac
REAL(AA)
AA=(YVLAST/DELY)*(KFAC-1.0)+1.0;AA=LOG(AA)/LOG(KFAC)+1.0001
NY=AA
  ** define uniform grid initially
IREGY=1;GRDPWR(Y,NY,YVLAST,1.0)
  ** compute expanding grid from north boundary
YFRAC(NY)=1.0
DO JJ=NY,2,-1
+ JJM=JJ-1
+ YFRAC(JJM)=YFRAC(JJ)-DELY
+ DELY=KFAC*DELY
ENDDO
YVLAST=0.5*HGHT
    GROUP 5. Z-direction grid specification
ZWLAST=0.1*HGHT
    GROUP 7. Variables stored, solved & named
SOLVE(W1);STORE(ENUT,LEN1);SOLUTN(W1,P,P,P,P,P,N)
MESG( Enter the required turbulence model:
MESG(  CK   -  Chen-Kim low-Re k-e model
MESG(  LB   -  Lam-Bemhorst low-Re k-e model (default)
MESG(  KW   -  Wilcox 1988 low-re k-omega model
MESG(  KWR  -  Wilcox 2008 low-re k-omega model
MESG(  KWM  -  Menter 1992 k-w model
MESG(  KWS  -  k-w SST model
MESG(
READVDU(CTURB,CHAR,LB)
CASE :CTURB: OF
WHEN CK,2
+ TEXT(CHEN-KIM KE_1D DEVEL CHANNL FLOW   :T206
+ MESG(Chen-Kim low-Re k-e model
+ TURMOD(KECHEN-LOWRE);STORE(REYN);TLSC=EP
WHEN LB,2
+ MESG(Lam-Bremhorst low-Re k-e model
+ TURMOD(KEMODL-LOWRE);STORE(REYN);TLSC=EP
WHEN KW,2
+ TEXT(Wilcox 1988 k w_1D DEVEL CHANNL FLOW    :T206
+ MESG(Wilcox 1988 k-w low-Re model
+ TURMOD(KWMODL-LOWRE);TLSC=OMEG
+ EPSIN=EPSIN/(0.09*TKEIN)
WHEN KWR,3
+ TEXT(Wilcox 2008 k w_1D DEVEL CHANNL FLOW    :T206
+ MESG(Wilcox 2008 k-w low-Re model
+ TURMOD(KWMODLR-LOWRE);TLSC=OMEG
+ EPSIN=EPSIN/(0.09*TKEIN);FIINIT(FBP)=1.0
WHEN KWM,3
+ TEXT(MENTER K-W DEVELOPED CHANNEL FLOW:T206
+ MESG(Menter 1992 k-w low-Re model
+ TURMOD(KWMENTER-LOWRE);TLSC=OMEG
+ EPSIN=EPSIN/(0.09*TKEIN)
+ STORE(DKDY,DFDY,CDWS,SIGK,SIGW)
WHEN KWS,3
TEXT(SST K-W DEVELOPED CHANNEL FLOW:T206
+ MESG(Menter 1992 k-w SST low-Re model
+ TURMOD(KWSST-LOWRE);TLSC=OMEG
+ EPSIN=EPSIN/(0.09*TKEIN)
+ STORE(DKDY,DFDY,CDWS,SIGK,SIGW)
ENDCASE
    GROUP 8. Terms (in differential equations) & devices
  ** Deactivate convection
TERMS(W1,N,N,P,P,P,P);TERMS(KE,Y,N,P,P,P,P)
TERMS(:TLSC:,Y,N,P,P,P,P)
    GROUP 9. Properties of the medium (or media)
ENUL=ENULA
   ** test for ground-set enul
IF(VARLAM) THEN
+ TMP1=CONST;TMP1A=0.0;ENUL=LINTEM
ENDIF
    GROUP 11. Initialization of variable or porosity fields
FIINIT(:TLSC:)=EPSIN;FIINIT(KE)=TKEIN
  ** use log-law for initial W profile
DO JJ=1,NY
+PATCH(IN:JJ:,INIVAL,1,NX,JJ,JJ,1,NZ,1,1)
+GR=0.5*YFRAC(JJ)
IF(JJ.NE.1) THEN
+ JJM1=JJ-1
+ GR=YFRAC(JJM1)+0.5*(YFRAC(JJ)-YFRAC(JJM1))
ENDIF
+GYPLUS=YVLAST*(1.-GR)*US/ENULA
+GWPLUS=LOG(GYPLUS)/0.41+5.25
IF(GYPLUS.LE.11.5) THEN
+ GWPLUS=GYPLUS
ENDIF
+INIT(IN:JJ:,W1,ZERO,GWPLUS*US)
ENDDO
    GROUP 13. Boundary conditions and special sources
WALLCO=GRND2
WALL(WALLN,NORTH,1,1,NY,NY,1,NZ,1,1);COVAL(WALLN,W1,LOGLAW,0.0)
MASIN=RHO1*WIN*0.5*HGHT
  ** Activate single-slab solver with specified mass flow rate
FDSOLV(FLOW,MASIN)
    GROUP 15. Termination of sweeps
LSWEEP=30;LITHYD=10
    GROUP 16. Termination of iterations
    GROUP 17. Under-relaxation devices
DTF=5.0*ZWLAST/WIN; RELAX(W1,FALSDT,DTF)
IF(:TLSC:.EQ.OMEG) THEN
+ DTF=DTF*10.; RELAX(KE,FALSDT,DTF); RELAX(:TLSC:,FALSDT,DTF)
ELSE
+ KELIN=3; RELAX(KE,LINRLX,0.6); RELAX(EP,LINRLX,1.0)
ENDIF
    GROUP 18. Limits on variables or increments to them
VARMIN(W1)=1.E-10
    GROUP 22. Spot-value print-out
ITABL=3;IYMON=NY-2;NZPRIN=1;NYPRIN=2;IYPRF=1;NUMCLS=5
TSTSWP=-1
    GROUP 24. Dumps for restarts
IF(IENUTA.LE.11) THEN	
+ STORE(FMU,REYT,FONE,FTWO)
ENDIF
STORE(STRS,YPLS,SKIN)
(stored of FRIC is 8.*STRS/(:WIN:*:WIN:))
(stored of UTAU is STRS^0.5)
(stored of VDP is (W1[&1&]-WIN)/UTAU[&NY&])
(make ffac is 0.0)
(make ustar is 0.0)
(make vdus  is 0.0)
(store1 of ffac at walln is fric)
(store1 of ustar at walln is utau)
(store1 of vdus at walln is vdp)
   ** print to inforout file
(print of f  is ffac)
(print of u* is ustar)
(print of (ucl-ub)/u* is vdus)
distil=t
CASE :CTURB: OF
WHEN CK,2
+EX(W1  )=7.491E-01;EX(KE  )=5.482E-03
+EX(EP  )=1.735E-01;EX(VDP )=2.178E+00
+EX(UTAU)=8.024E-04;EX(FRIC)=2.864E-04
+EX(SKIN)=6.703E-02;EX(YPLS)=8.975E-03
+EX(STRS)=3.580E-05;EX(FTWO)=9.570E-01
+EX(FONE)=2.824E+00;EX(REYT)=9.896E+02
+EX(FMU )=7.315E-01;EX(EPKE)=6.976E+07
+EX(REYN)=5.583E+02;EX(LTLS)=3.426E-04
+EX(WDIS)=9.268E-03;EX(LEN1)=2.593E-03
+EX(ENUT)=8.609E-05
WHEN LB,2
+EX(W1  )=7.528E-01;EX(KE  )=6.019E-03 
+EX(EP  )=1.933E-01;EX(VDP )=2.163E+00 
+EX(UTAU)=8.367E-04;EX(FRIC)=3.118E-04 
+EX(SKIN)=6.158E-02;EX(YPLS)=9.364E-03 
+EX(STRS)=3.897E-05;EX(FTWO)=9.576E-01 
+EX(FONE)=2.369E+00;EX(REYT)=1.039E+03 
+EX(FMU )=7.372E-01;EX(EPKE)=8.555E+07 
+EX(REYN)=5.732E+02;EX(LTLS)=3.426E-04 
+EX(WDIS)=9.268E-03;EX(LEN1)=2.616E-03
+EX(ENUT)=9.020E-05 
WHEN KW,2
+EX(W1  )=7.417E-01;EX(KE  )=5.438E-03 
+EX(EP  )=4.047E-01;EX(SKIN)=6.731E-02 
+EX(YPLS)=8.957E-03;EX(STRS)=3.565E-05 
+EX(FTWO)=8.509E-01;EX(FONE)=1.346E+00 
+EX(REYT)=9.210E+01;EX(FMU )=7.602E-01 
+EX(OMEG)=1.406E+04;EX(LEN1)=2.790E-03 
+EX(ENUT)=8.769E-05;EX(VDP )=2.077E+00
+EX(UTAU)=8.007E-04;EX(FRIC)=2.852E-04
WHEN KWR,3
+EX(W1  )=7.405E-01;EX(KE  )=4.227E-03
+EX(EP  )=1.808E-01;EX(VDP )=2.141E+00
+EX(UTAU)=7.824E-04;EX(FRIC)=2.721E-04
+EX(SKIN)=7.055E-02;EX(YPLS)=8.749E-03
+EX(STRS)=3.402E-05;EX(DWDY)=3.144E+02
+EX(GEN1)=4.287E+05;EX(FBP )=1.000E+00
+EX(OMEG)=1.499E+04;EX(LEN1)=2.620E-03
+EX(ENUT)=8.327E-05
WHEN KWM,3
+EX(W1  )=7.441E-01;EX(VDP )=2.031E+00 
+EX(UTAU)=8.049E-04;EX(FRIC)=2.882E-04 
+EX(SKIN)=6.661E-02;EX(YPLS)=9.004E-03 
+EX(STRS)=3.603E-05;EX(DFDY)=6.437E+08 
+EX(BF1 )=9.986E-01;EX(LTLS)=3.426E-04 
+EX(WDIS)=9.268E-03;EX(OMEG)=1.407E+04 
+EX(LEN1)=2.767E-03;EX(ENUT)=9.029E-05 
+EX(KE  )=4.453E-03;EX(EP  )=1.942E-01
+EX(SIGW)=1.998E+00;EX(SIGK)=1.997E+00
+EX(CDWS)=9.188E-03;EX(DKDY)=2.548E+00
WHEN KWS,3
+EX(W1  )=7.415E-01;EX(KE  )=4.187E-03 
+EX(EP  )=1.770E-01;EX(VDP )=2.107E+00 
+EX(UTAU)=7.743E-04;EX(FRIC)=2.665E-04 
+EX(SKIN)=7.203E-02;EX(YPLS)=8.658E-03 
+EX(STRS)=3.332E-05;EX(SIGW)=1.998E+00 
+EX(SIGK)=1.998E+00;EX(CDWS)=1.285E-02 
+EX(DFDY)=6.418E+08;EX(DKDY)=2.351E+00 
+EX(LTLS)=3.426E-04;EX(WDIS)=9.268E-03 
+EX(GEN1)=4.179E+05;EX(BF2 )=1.000E+00 
+EX(BF1 )=9.977E-01;EX(OMEG)=1.418E+04 
+EX(LEN1)=2.711E-03;EX(ENUT)=8.368E-05 
ENDCASE
 LIBREF = 206
STOP