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 may be made with the high-Re forms of either
  the k-e model, the Chen-Kim, RNG and realisable k-e models,
  and the Wilcox k-omega model. 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 model   0.017            3.88
    K-omega model          0.018            3.40
 
   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(  CHEN -  Chen-Kim k-e model
MESG(  KE   -  Standard k-e model
MESG(  KO   -  Wilcox   k-o model
MESG(  RNG  -  RNG      k-e model
MESG(  RKE  -  Realisable k-e model (default)
MESG(
READVDU(CTURB,CHAR,RKE)
CASE :CTURB: OF
WHEN CHEN,4
+ 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 KO,2
+ TEXT(K-OMEGA_1D DEVELOPED PIPE FLOW:T102
+ MESG(k-omega model
+ TURMOD(KOMODL);TLSC=OMEG
+ STORE(EP);EPSIN=EPSIN/(0.09*TKEIN)
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(RK 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)
   store(AS,PHI,ALF,ETA,GEN1,S_IJ,UST)
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)
 
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=NY-4;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 CHEN,4
+ 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 KO,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 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
ENDCASE