TALK=T;RUN( 1, 1)
 ** LOAD(x102) from the x Input Library
    GROUP 1. Run title and other preliminaries
TEXT(RNG K-E_1D DEVELOPED PIPE FLOW:T102
TITLE
 
  DISPLAY
  The case considered is the 1d solution of fully-developed
  turbulent flow in a circular pipe at a Re=1.E5. The solution
  is performed by use of the single-slab solver with a specified
  mass flow rate. Calculations can be made with the high-Re 
  forms of the standard, Chen-Kim, RNG & realisable k-e models, 
  the Wilcox 1988 & 2008 k-w models, and the Menter k-w and
  k-w-SST models. For this case all models produce similar 
  results, and the comparisons between measured and computed 
  friction factors f and velocity-defect parameters vdp are 
  given below:
                        f         vdp
 
    Data              0.018      3.75
    Standard k-e      0.018      3.50
    Chen-Kim k-e      0.017      3.49
    RNG k-e model     0.017      3.86
    Realisable k-e    0.017      3.88
    Wilcox 1992 k-w   0.018      3.40
    Wilcox 2008 k-w   0.018      3.49
    Menter k-w        0.018      3.38 
    k-w SST           0.017      3.41
 
   where f =8.*(ustar/ubulk)**2 and vdp=(wcl-wbulk)/u*. For
   testing purposes, the cases can also be run with non-
   equilibrium and scalable wall functions. 
  ENDDIS
   The following AUTOPLOT use file produces two plots;
   the first is the axial velocity profile; and the
   second is the turbulent 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 enut
   col9 1
   msg ENUT profile
   msg Press e to END
   ENDUSE
 
CHAR(CTURB,TLSC)
REAL(DELT,US,DIAM,WIN,REY,TKEIN,EPSIN,MIXL,FRIC,DPDZ,MASIN,DTF)
REAL(YPLUS_W)
DIAM=0.1;WIN=1.0; REY=1.E5;FRIC=1./(1.82*LOG10(REY)-1.64)**2
DPDZ=FRIC*RHO1*WIN*WIN/(2.*DIAM);US=WIN*(FRIC/8.)**0.5
TKEIN=0.25*WIN*WIN*FRIC;MIXL=0.09*0.5*DIAM
EPSIN=TKEIN**1.5/MIXL*0.1643
    GROUP 3. X-direction grid specification
CARTES=F;XULAST=0.1
    GROUP 4. Y-direction grid specification
 
    MESG( DO you want to test scalable wall functions(y/N)?
READVDU(ANS,CHAR,N)
IF(:ANS:.EQ.Y) THEN
+ MESG( Scalable wall functions activated
+ MESG( Near-wall set to y+=10
  *** switch for scalable wall function
+ SCALWF=T
+ YPLUS_W=10.0
ELSE
+ MESG( No scalable wall functions.
+ MESG( Near-wall set to y+=40
+ YPLUS_W=40.0
ENDIF
 
ENUL=WIN*DIAM/REY;DELT=2.*YPLUS_W*ENUL/US;
NREGY=2; REGEXT(Y,0.5*DIAM)
IREGY=1;GRDPWR(Y,29,0.5*DIAM-DELT,0.8);IREGY=2;GRDPWR(Y,1,DELT,1.0)
    GROUP 5. Z-direction grid specification
ZWLAST=0.1*DIAM
DTF=15.*ZWLAST/WIN
    GROUP 7. Variables stored, solved & named
SOLVE(W1);STORE(ENUT,LEN1);SOLUTN(W1,P,P,P,P,P,N)
STORE(STRS,YPLS,SKIN)
MESG( Enter the required turbulence model:
MESG(  CK   -  Chen-Kim k-e model
MESG(  KE   -  Standard k-e model
MESG(  RNG  -  RNG      k-e model
MESG(  RKE  -  Realisable k-e model (default)
MESG(  KW   -  Wilcox 1988 k-w model
MESG(  KWR  -  Wilcox 2008 k-w model
MESG(  KWM  -  Menter 1992 k-w model
MESG(  KWS  -  k-w SST model
MESG(
READVDU(CTURB,CHAR,RKE)
CASE :CTURB: OF
WHEN CK,2
+ TEXT(CHEN-KIM K-E_1D DEVELOPED PIPE FLOW:T102
+ MESG(Chen-Kim k-e model
+ TURMOD(KECHEN);KELIN=1;TLSC=EP
WHEN KE,2
+ TEXT(K-E_1D DEVELOPED PIPE FLOW:T102
+ MESG(Standard k-e model
+ TURMOD(KEMODL);KELIN=1;TLSC=EP
WHEN RNG,3
+ MESG(RNG k-e model
+ TURMOD(KERNG);KELIN=1;TLSC=EP
+ STORE(ETA,ALF,GEN1);DTF=10.*ZWLAST/WIN
+ OUTPUT(ALF,Y,N,P,Y,Y,Y);OUTPUT(ETA,Y,N,P,Y,Y,Y)
WHEN RKE,3
+ TEXT(REAL K-E_1D DEVELOPED PIPE FLOW:T102
+ MESG(Realisable k-e model
+ TURMOD(KEREAL);TLSC=EP
+ STORE(CMU,C1E)
+ OUTPUT(CMU,P,P,P,P,Y,Y);OUTPUT(C1E,P,P,P,P,Y,Y)
WHEN KW,2
+ TEXT(Wilcox 1988 k-w 1D DEVELOPED PIPE FLOW:T102
+ MESG(Wilcox 1988 k-w model
+ TURMOD(KWMODL);TLSC=OMEG
+ EPSIN=EPSIN/(0.09*TKEIN)
WHEN KWR,3
+ TEXT(Wilcox 2008 k-w 1D DEVELOPED PIPE FLOW:T102
+ MESG(Wilcox 2008 k-w model
+ TURMOD(KWMODLR);TLSC=OMEG
+ STORE(XWP,FBP,CDWS)
+ EPSIN=EPSIN/(0.09*TKEIN)
WHEN KWM,3
TEXT(Menter k-w_1D DEVELOPED PIPE FLOW:T102
+ MESG(Menter 1992 k-w model
+ TURMOD(KWMENTER);TLSC=OMEG
+ EPSIN=EPSIN/(0.09*TKEIN) 
+ STORE(BF1,CDWS);FIINIT(BF1)=1.0
WHEN KWS,3
TEXT(SST k-w_1D DEVELOPED PIPE FLOW:T102
+ MESG(Menter 1992 k-w SST model
+ TURMOD(KWSST);TLSC=OMEG
+ EPSIN=EPSIN/(0.09*TKEIN)
+ STORE(BF1,BF2,CDWS);FIINIT(BF1)=1.0;FIINIT(BF2)=1.0
ENDCASE
 
REY;FRIC;US;DPDZ
    GROUP 8. Terms (in differential equations) & devices
    GROUP 11. Initialization of variable or porosity fields
FIINIT(W1)=WIN;FIINIT(:TLSC:)=EPSIN;FIINIT(KE)=TKEIN
    GROUP 13. Boundary conditions and special sources
MESG( Do you want equilibrium (GRND2) wall functions? (y/N)
READVDU(ANS,CHAR,Y)
IF(:ANS:.EQ.Y) THEN
+ WALLCO=GRND2
+ MESG( GRND2 equilibrium wall functions
ELSE
+ WALLCO=GRND3
+ MESG( GRND3 non-equilibrium wall functions
ENDIF
WALLCO
WALL(WALLN,NORTH,1,1,NY,NY,1,NZ,1,1)
  ** re-instate OMEG wall coval for Menter k-w & SST k-w
IF(IENUTA.EQ.17.OR.IENUTA.EQ.19) THEN
+ COVAL(WALLN,EP,0.0,0.0)
+ COVAL(WALLN,OMEG,GRND2,GRND2)
ENDIF
 
MASIN=RHO1*WIN*DIAM*DIAM/80.
  ** activate single-slab solver
FDSOLV(FLOW,MASIN)
    GROUP 15. Termination of sweeps
SELREF=T;RESFAC=1.E-5
LSWEEP=30;LITHYD=10
    GROUP 16. Termination of iterations
    GROUP 17. Under-relaxation devices
VARMIN(W1)=1.E-10;WALPRN=T
RELAX(W1,FALSDT,DTF)
 
IF(IENUTA.EQ.14) then
   ** Realisable k-e model
+ RELAX(KE,FALSDT,DTF/10.); RELAX(EP,FALSDT,DTF/10.)
ELSE
+ RELAX(KE,FALSDT,DTF); RELAX(:TLSC:,FALSDT,DTF)
ENDIF
    GROUP 22. Spot-value print-out
ITABL=3;IYMON=2;NPLT=2;NZPRIN=1;NYPRIN=1
IYPRF=1;TSTSWP=-1
   ** compute flow output parameters
(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  )=1.047E+00;EX(KE  )=4.647E-03
+ EX(EP  )=2.820E-02;EX(VDP )=3.492E+00
+ EX(UTAU)=1.567E-03;EX(FRIC)=5.824E-04
+ EX(STRS)=7.280E-05;EX(LEN1)=5.440E-03
+ EX(ENUT)=1.863E-04;EX(SKIN)=1.649E-04
+ EX(YPLS)=1.315E+00
WHEN KE,2
+ EX(W1  )=1.046E+00;EX(KE  )=4.624E-03
+ EX(EP  )=2.835E-02;EX(VDP )=3.502E+00
+ EX(UTAU)=1.582E-03;EX(FRIC)=5.932E-04
+ EX(STRS)=7.415E-05;EX(LEN1)=5.335E-03
+ EX(ENUT)=1.808E-04;EX(SKIN)=1.644E-04
+ EX(YPLS)=1.327E+00
WHEN RNG,3
+ EX(W1  )=1.050E+00;EX(KE  )=4.634E-03
+ EX(EP  )=2.823E-02;EX(VDP )=3.863E+00
+ EX(UTAU)=1.556E-03;EX(FRIC)=5.737E-04
+ EX(GEN1)=2.019E+03;EX(ALF )=4.773E-01
+ EX(ETA )=2.918E+00;EX(STRS)=7.172E-05
+ EX(LEN1)=4.604E-03;EX(ENUT)=1.554E-04
+ EX(SKIN)=1.653E-04;EX(YPLS)=1.305E+00
WHEN RKE,3
+ EX(W1  )=1.051E+00;EX(KE  )=4.176E-03
+ EX(EP  )=2.762E-02;EX(VDP )=3.890E+00
+ EX(UTAU)=1.534E-03;EX(FRIC)=5.577E-04
+ EX(CMU )=1.099E-01;EX(C1E )=4.344E-01
+ EX(EPKE)=4.786E+00;EX(STRS)=6.972E-05
+ EX(LEN1)=4.203E-03;EX(ENUT)=1.714E-04
+ EX(DWDY)=1.328E+01;EX(SKIN)=1.661E-04
+ EX(YPLS)=1.287E+00
WHEN KW,2
+ EX(W1  )=1.045E+00;EX(KE  )=4.512E-03
+ EX(EP  )=2.814E-02;EX(VDP )=3.395E+00
+ EX(UTAU)=1.591E-03;EX(FRIC)=6.001E-04
+ EX(OMEG)=4.919E+01;EX(STRS)=7.501E-05
+ EX(LEN1)=5.602E-03;EX(ENUT)=1.840E-04
+ EX(SKIN)=1.641E-04;EX(YPLS)=1.335E+00
WHEN KWR,3
+EX(W1  )=1.045E+00;EX(KE  )=4.521E-03 
+EX(EP  )=2.817E-02;EX(VDP )=3.489E+00
+EX(UTAU)=1.578E-03;EX(FRIC)=5.902E-04 
+EX(DWDY)=1.261E+01;EX(FBP )=1.000E+00 
+EX(OMEG)=4.910E+01;EX(SKIN)=1.645E-04 
+EX(YPLS)=1.324E+00;EX(STRS)=7.377E-05 
+EX(CDWS)=1.547E+01;EX(GEN1)=4.244E+03
+EX(LEN1)=5.434E-03;EX(ENUT)=1.775E-04
WHEN KWM,3
+EX(W1  )=1.045E+00;EX(KE  )=4.522E-03
+EX(EP  )=2.815E-02;EX(VDP )=3.382E+00
+EX(UTAU)=1.592E-03;EX(FRIC)=6.011E-04
+EX(BF1 )=1.000E+00
+EX(LTLS)=3.882E-04;EX(WDIS)=1.786E-02
+EX(OMEG)=4.912E+01;EX(SKIN)=1.640E-04
+EX(YPLS)=1.336E+00;EX(STRS)=7.514E-05
+EX(LEN1)=5.623E-03;EX(ENUT)=1.850E-04
+EX(CDWS)=1.948E-09
WHEN KWS,3
+EX(W1  )=1.045E+00;EX(VDP )=3.382E+00
+EX(BF2 )=1.000E+00;EX(BF1 )=1.000E+00
+EX(LTLS)=3.882E-04;EX(WDIS)=1.786E-02
+EX(OMEG)=4.912E+01;EX(SKIN)=1.640E-04
+EX(LEN1)=5.623E-03;EX(ENUT)=1.806E-04
+EX(KE  )=4.388E-03;EX(EP  )=2.738E-02
+EX(UTAU)=1.557E-03;EX(FRIC)=5.748E-04
+EX(CDWS)=1.863E-09;EX(GEN1)=5.360E+03
+EX(YPLS)=1.306E+00;EX(STRS)=7.184E-05
ENDCASE
 LIBREF = 102
STOP