TALK=T;RUN( 1, 1)
 ** LOAD(502) from the PHOENICS Input Library
    GROUP 1. Run title and other preliminaries
 
TEXT(1D Turb Pipe Flow & Heat Trans
TITLE
 
  DISPLAY
  The case considered is fully-developed turbulent flow
  and heat transfer in a circular pipe at a Reynolds number
  of 1.E5 and a Prandtl number of 3.0. The tube wall is held
  at a constant temperature and calculations may be made with
  either a fully smooth or a fully rough surface with a relative
  sand-grain roughness of 0.015. Also, the calculation may be made
  with equilibrium (LOGLAW) or non-equilibrium (GENLAW) wall
  functions. Both types of wall function should produce the same
  results as the turbulence is in equilibrium for this flow.
  ENDDIS
 
  For fully-smooth conditions pipe-flow data indicates that
  the friction factor f = 0.018 and the Nusselt number Nu = 392.0.
  The Petukhov correlation ( see below ) is used to estimate
  the Nusselt number. The PHOENICS prediction yields f = 0.018
  and Nu = 393.0 with both LOGLAW and GENLAW type wall functions.
  These values agree very closely with the data.
 
  For fully-rough conditions pipe-flow data indicates that
  the friction factor f = 0.044 and the Nusselt number Nu = 786.0.
  The Petukhov correlation ( see below ) is used to estimate
  the Nusselt number. The PHOENICS prediction yields f = 0.041
  and Nu = 767.0 with both LOGLAW and GENLAW type wall functions.
  These values agree fairly well with the data.
 
  The PIL variable WALPRN has been set to T, thereby activating
  printout of the local friction factor (sloc) and Stanton number
  (Stloc) in the RESULT file. In order to convert these values to
  f and Nu above, the following relations should be used:
 
    f = 8.*sloc*(W1(NY)/WIN)**2
 
    Nu = REY*PRNDTL(H1)*Stloc*W1(NY)*(TW-H1(NY))/[WIN*(TW-TB)]
 
  where TB is the bulk temperature printed in the RESULT file.
 
  The energy equation may be solved via the H1 or TEM1 equation
  according to whether CH1 is set equal to H1 or TEM1.
 
CHAR(CH1);CH1=TEM1
  ** set ROUGH=F for a fully-smooth calculation
BOOLEAN(ROUGH);ROUGH=T
  ** WALLFN used to test with GENLAW & LOGLAW wall functions
INTEGER(WALLFN);WALLFN=2
REAL(DIAM,WIN,REY,TKEIN,EPSIN,MIXL,FRIC,DPDZ,MASIN,DTF)
REAL(EPS,BCON,RIN,AIN,DELT,US,QIN,DTDZ,CP,COND,TW,AWAL)
DIAM=0.1;WIN=1.0;REY=1.E5;RIN=0.5*DIAM
  ** set relative roughness & roughness height
     & then calculate expected friction factor
IF(ROUGH) THEN
+ EPS=0.015;BCON=0.5/EPS;FRIC=1./(2.0*LOG10(BCON)+1.74)**2
ELSE
+ EPS=0.;FRIC=1./(1.82*LOG10(REY)-1.64)**2
ENDIF
 
WALLA=EPS*DIAM
  ** compute expected pressure-drop for SATELLITE printout
DPDZ=FRIC*RHO1*WIN*WIN/(2.*DIAM);US=WIN*(FRIC/8.)**0.5
DPDZ
TKEIN=0.25*WIN*WIN*FRIC
MIXL=0.09*RIN;EPSIN=TKEIN**1.5/MIXL*0.1643
    GROUP 3. X-direction grid specification
CARTES=F;XULAST=0.1;AIN=0.5*RIN*RIN*XULAST
    GROUP 4. Y-direction grid specification
ENUL=WIN*DIAM/REY;DELT=2.*40.*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
  ** AWAL is wall surface area per unit length
AWAL=RIN*XULAST
    GROUP 7. Variables stored, solved & named
SOLVE(W1,:CH1:);TURMOD(KEMODL);KELIN=1;STORE(ENUT,LEN1,GENK)
    GROUP 8. Terms (in differential equations) & devices
  ** deactivate convection terms
TERMS(W1,N,N,P,P,P,P);TERMS(KE,Y,N,P,P,P,P)
TERMS(EP,Y,N,P,P,P,P);TERMS(:CH1:,N,N,P,P,P,P)
    GROUP 9. Properties of the medium (or media)
PRNDTL(:CH1:)=3.0;MASIN=RHO1*WIN*AIN
  ** prescribe energy flow from slab and fluid specific heat
     estimated from Dittus-Boelter Nu=0.023*Re**0.8*Pr**0.4
     with (Tw-Tb)=5.0
REAL(NUSS);NUSS=0.023*REY**0.8*PRNDTL(:CH1:)**0.4
CP=1.0;COND=RHO1*CP*ENUL/PRNDTL(:CH1:)
 
QIN=NUSS*5.0*COND/DIAM
NUSS
  ** compute d(tbulk)/dz for input to single-slab
     thermal solver ; if TEM1 solved, multiply by CP
IF(:CH1:.EQ.TEM1) THEN
+ DTDZ=QIN*AWAL/MASIN
ELSE
+ DTDZ=QIN*AWAL/(CP*MASIN)
ENDIF
  ** prescribe wall temperature
TW=10.
    GROUP 11. Initialization of variable or porosity fields
FIINIT(W1)=WIN;FIINIT(EP)=EPSIN;FIINIT(KE)=TKEIN
FIINIT(:CH1:)=0.5*TW
    GROUP 13. Boundary conditions and special sources
PATCH(WALLN,NWALL,1,1,NY,NY,1,NZ,1,1)
CASE (WALLFN) OF
WHEN 2
+  COVAL(WALLN,W1,LOGLAW,0.0)
+  COVAL(WALLN,KE,LOGLAW,LOGLAW)
+  COVAL(WALLN,EP,LOGLAW,LOGLAW)
+  COVAL(WALLN,:CH1:,LOGLAW,TW)
WHEN 3
+  COVAL(WALLN,W1,GENLAW,0.0)
+  COVAL(WALLN,KE,GENLAW,GENLAW)
+  COVAL(WALLN,EP,GENLAW,GENLAW)
+  COVAL(WALLN,:CH1:,GENLAW,TW)
ENDCASE
  ** activate pressure-drop calculation in single-slab solver
FDFSOL=T;USOURC=T
PATCH(FDFW1DP,VOLUME,1,NX,1,NY,1,NZ,1,1)
COVAL(FDFW1DP,W1,MASIN,GRND1)
 
  ** temperature source/sink term for fully-developed flow
PATCH(FDFCWT,PHASEM,1,NX,1,NY,1,NZ,1,1)
COVAL(FDFCWT,:CH1:,DTDZ,TW)
    GROUP 15. Termination of sweeps
LSWEEP=20;TSTSWP=-1;LITHYD=5
    GROUP 16. Termination of iterations
    GROUP 17. Under-relaxation devices
DTF=10.*ZWLAST/WIN
    GROUP 18. Limits on variables or increments to them
VARMIN(W1)=1.E-10
    GROUP 19. Data communicated by satellite to GROUND
COND=RHO1*CP*ENUL/PRNDTL(:CH1:)
    GROUP 21. Print-out of variables
    GROUP 22. Spot-value print-out
IYMON=NY-2;ITABL=3;NPLT=2;NZPRIN=1;NYPRIN=1;IYPRF=1
NTPRIN=2
    GROUP 24. Dumps for restarts
RELAX(W1,FALSDT,DTF)
RELAX(KE,FALSDT,DTF);RELAX(EP,FALSDT,DTF)
  ** use WALPRN for printout of near-wall y+ values
     & local friction factor & stanton number
WALPRN=T;STORE(SKIN,STAN,YPLS,STRS)
  ** compute expected Nusselt number from Petukhov
     correlation and printout from satellite
REAL(XR)
XR=1.07+12.7*(PRNDTL(:CH1:)**.666-1.)*(FRIC/8.)**0.5
NUSS=REY*PRNDTL(:CH1:)*FRIC/(8.*XR)
NUSS
 LIBREF = 502
STOP