TEXT(RSTM_1DY DEVELOPED CHANNEL FLOW    :T600
TITLE
  DISPLAY
  The problem considered is 1dy fully-developed turbulent
  flow in a channel at a Reynolds number of 5.E4 with heat
  and mass transfer. The turbulence is simulated by use of
  the Reynolds stress transport model (RSTM), and optionally
  by use of the k-e model. For heat and scalar transport with
  the RSTM, one of the following models may be employed: a
  simple gradient-diffusion model (IRSMSM=0); a generalised
  gradient-diffusion model (IRSMSM=1); or a full transport
  model (IRSMSM=2). The laminar Prandtl number is 3.0, and the
  energy equation may be solved via H1 or TEM1.
  ENDDIS
 
  For fully-smooth conditions channel-flow data indicates that
  the friction factor f = 0.018 and the Nusselt number Nu =392.
  The Petukhov correlation ( see below ) is used to estimate
  the Nusselt number. The PHOENICS predictions yield the
  following results:
     k-eps model                      f = 0.018    Nu = 401
     RSTM gradient-diffusion model    f = 0.018    Nu = 391
     RSTM generalised-diffusion model f = 0.018    Nu = 412
     RSTM full transport model        f = 0.018    Nu = 409.
  These values agree closely 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 = REYH*PRNDTL(H1)*Stloc*W1(NY)*(TW-TEM1(NY))/[WIN*(TW-TB)]
 
  where TB is the bulk temperature printed in the RESULT file. The
  expected values are: sloc=4.923E-3 and Stloc=2.512E-3.
 
BOOLEAN(KEMOD,HEAT);CHAR(CH1); REAL(DHYDR,DELT,US,REYH)
REAL(HGHT,WIN,REY,TKEIN,EPSIN,MIXL,FRIC,DPDZ,MASIN,DTF)
  ** CH1=H1    activates solution of the energy eqn via H1
        =TEM1      ''       ''    ''  ''   ''    ''  '' TEM1
CH1=TEM1
  ** KEMOD =T  selects k-eps solution
  ** HEAT  =T  activates heat/scalar transport
  ** IRSMSM=0  simple-gradient model for heat/scalar transport
           =1  generalised-gradient model
           =2  flux transport model
KEMOD=F;HEAT=T;IRSMSM=2
  ** 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=1.0;WIN=1.0; REY=5.E4;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
REY
FRIC
US
DPDZ
TKEIN=0.25*WIN*WIN*FRIC
MIXL=0.09*0.5*HGHT;EPSIN=0.1643*TKEIN**1.5/MIXL
ENUL=WIN*HGHT/REY;DELT=2.*40.*ENUL/US;NREGY=2; REGEXT(Y,0.5*HGHT)
IREGY=1;GRDPWR(Y,29,0.5*HGHT-DELT,0.8);IREGY=2;GRDPWR(Y,1,DELT,1.0)
SOLVE(W1)
IF(HEAT) THEN
+ SOLVE(:CH1:);SOLVE(SC1,SC2)
ENDIF
  ** prescribed pressure-force for w1-equation
PATCH(PFOR,VOLUME,1,1,1,NY,1,NZ,1,1);COVAL(PFOR,W1,FIXFLU,DPDZ)
IF(KEMOD) THEN
+ TURMOD(KEMODL);STORE(ENUT,LEN1);IRSMSM=0
+ PATCH(WAL1,NWALL,1,1,NY,NY,1,NZ,1,1)
+ COVAL(WAL1,W1,LOGLAW,0.0);COVAL(WAL1,EP,LOGLAW,LOGLAW)
ELSE
+ PATCH(WAL1,NWALL,1,1,NY,NY,1,NZ,1,1);COVAL(WAL1,W1,1.0,0.0)
+ STORE(V1,KE,DWDY,PVW,PW2,PV2,PU2,DVW)
+ STORE(PK,EPDK,FWAL,VWDK,U2DK,V2DK,W2DK)
+ DTF=0.02;TURMOD(REYSTRS,DTF,WAL1)
+ PATCH(SMPLS,SOUTH,1,1,1,1,1,NZ,1,1);COVAL(SMPLS,VWRS,GRND1,0.0)
ENDIF
  ** deactivate convection for single-slab solution
TERMS(W1,P,N,P,P,P,P);TERMS(EP,P,N,P,P,P,P)
IF(KEMOD) THEN
+ COVAL(WAL1,KE,LOGLAW,LOGLAW);TERMS(KE,P,N,P,P,P,P)
ELSE
+ TERMS(U2RS,P,N,P,P,P,P);TERMS(V2RS,P,N,P,P,P,P)
+ TERMS(W2RS,P,N,P,P,P,P);TERMS(VWRS,P,N,P,P,P,P)
ENDIF
FIINIT(W1)=WIN;FIINIT(V1)=0.0;FIINIT(KE)=TKEIN;FIINIT(EP)=EPSIN
REAL(FLOW);FLOW=RHO1*WIN*HGHT
RESREF(W1)=1.E-12*FLOW*WIN; RESREF(EP)=1.E-12*FLOW*EPSIN
IF(KEMOD) THEN
+ RELAX(W1,FALSDT,1.E2)
+ RELAX(EP,FALSDT,10.0); RELAX(KE,FALSDT,10.0)
+ RESREF(KE)=1.E-12*FLOW*TKEIN
ELSE
+ FIINIT(W2RS)=2.*FIINIT(KE)/3.;FIINIT(V2RS)=2.*FIINIT(KE)/3.
+ FIINIT(U2RS)=2.*FIINIT(KE)/3.;FIINIT(VWRS)=0.3*FIINIT(KE)
+ RELAX(W1,FALSDT,0.3)
+ RESREF(U2RS)=1.E-12*FLOW*FIINIT(U2RS)
+ RESREF(V2RS)=1.E-12*FLOW*FIINIT(V2RS)
+ RESREF(W2RS)=1.E-12*FLOW*FIINIT(W2RS)
+ RESREF(VWRS)=1.E-12*FLOW*FIINIT(VWRS)
ENDIF
IF(KEMOD) THEN
+ LSWEEP=15;NPLT=5;LITHYD=10
ELSE
+ LSWEEP=160;LITHYD=8;NPLT=20
+ OUTPUT(PU2,N,N,N,N,N,N);OUTPUT(PV2,N,N,N,N,N,N)
ENDIF
OUTPUT(V1,N,N,N,N,N,N);NYPRIN=1;IYMON=NY-1;TSTSWP=-1
YPLS=T;WALPRN=T
  ** 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
IF(HEAT) THEN
+ REAL(NUSS,COND,CP,QIN,DTDZ,AWAL,TW,XR,DTSC,HW,DSDZ)
+ PRNDTL(H1)=3.0;TW=10.
+ PRNDTL(SC1)=PRNDTL(H1);PRNDTL(SC2)=PRNDTL(H1)
+ NUSS=0.023*REYH**0.8*PRNDTL(H1)**0.4
+ CP=3.0;COND=RHO1*CP*ENUL/PRNDTL(H1)
+ CP1=CP
  ** AWAL is wall surface area per unit length
+ AWAL=0.5*HGHT*XULAST;QIN=NUSS*5.0*COND/DHYDR
+ NUSS
+ QIN
+ DSDZ=QIN*AWAL/(CP*FLOW);DTDZ=CP*DSDZ
IF(:CH1:.EQ.H1) THEN
+ TMP1A=0.0;TMP1B=1./CP;TMP1=LINH;HW=CP*TW
+ STORE(TEMP);OUTPUT(TEMP,Y,Y,Y,Y,Y,Y)
ENDIF
IF(:CH1:.EQ.TEM1) THEN
+ HW=TW
ENDIF
+ AWAL
+ TERMS(:CH1:,N,N,P,P,P,P)
+ TERMS(SC1,N,N,P,P,P,P);TERMS(SC2,N,N,P,P,P,P)
+ FIINIT(:CH1:)=0.5*HW;FIINIT(SC1)=0.5*TW
+ COVAL(WAL1,:CH1:,LOGLAW,HW);COVAL(WAL1,SC1,LOGLAW,TW)
+ COVAL(WAL1,SC2,LOGLAW,TW)
  ** temperature source/sink term for fully-developed flow
+ PATCH(FDFCWT,PHASEM,1,NX,1,NY,1,NZ,1,1)
+ COVAL(FDFCWT,:CH1:,DTDZ,HW);COVAL(FDFCWT,SC1,DSDZ,TW)
+ COVAL(FDFCWT,SC2,DSDZ,TW);DTSC=20.
+ FDFSOL=T; RESREF(:CH1:)=1.E-12*QIN*AWAL*ZWLAST
+ RESREF(SC1)=RESREF(:CH1:); RESREF(SC2)=RESREF(SC1)
  ** compute expected Nusselt number from Petukhov
     correlation and printout from satellite
+ XR=1.07+12.7*(PRNDTL(H1)**.666-1.)*(FRIC/8.)**0.5
+ NUSS=REYH*PRNDTL(H1)*FRIC/(8.*XR)
+ NUSS
+ COND
+ DHYDR
IF(IRSMSM.EQ.1) THEN
+ DTSC=1.0;STORE(DSDY)
+ RELAX(VTRS,LINRLX,0.2); RELAX(VSC1,LINRLX,0.2)
+ RELAX(VSC2,LINRLX,0.2)
+ OUTPUT(VTRS,Y,Y,Y,Y,Y,Y);FIINIT(:CH1:)=0.9*HW
+ FIINIT(SC1)=0.9*TW
ENDIF
IF(IRSMSM.EQ.2) THEN
+ TERMS(VTRS,N,N,P,P,P,P);TERMS(VSC1,N,N,P,P,P,P)
+ TERMS(VSC2,N,N,P,P,P,P);STORE(DSDY)
+ COVAL(SMPLS,VTRS,GRND1,0.0);DTSC=10.
+ COVAL(SMPLS,VSC1,GRND1,0.0);COVAL(SMPLS,VSC2,GRND1,0.0)
ENDIF
+ FIINIT(SC2)=FIINIT(SC1); RELAX(:CH1:,FALSDT,DTSC)
+ RELAX(SC1,FALSDT,DTSC); RELAX(SC2,FALSDT,DTSC)
 
IF(:CH1:.EQ.TEM1) THEN
PRNDTL(TEM1)=CONDFILE;
STORE(PRPS);FIINIT(PRPS)=35
  ** mat no. rho enul cp kond expan
  **   1        air
CSG10='q1'
  MATFLG=T;NMAT=1
  35 1. 2.E-5  3.0 2.E-5 0
ENDIF
ENDIF
  ** Expected values
FLOW