GROUP 1. Run title and other preliminaries
 
TEXT(2D Laminar Duct Flow And Heat Trans 
TITLE
 
  DISPLAY
  The case considered is three-dimensional fully-developed,
  laminar flow and heat transfer of an incompressible, constant-
  property fluid in a rectangular duct of aspect ratio alfa=0.5,
  where alfa=height/width. The calculations are performed for
  a Reynolds number of 100, a Prandtl number of 1.0 and a constant
  temperature boundary condition is applied on all four sides of
  the duct. The solution exploits symmetry by performing the
  calculation over one quadrant of the duct cross section only.
  The flow Reynolds number is based on the hydraulic diameter of
  the duct.
  ENDDIS
 
  Data on the friction factor, pressure drop and Nusselt number
  may be found in 'Handbook of Heat Transfer Fundamentals', Ed.
  W.M.Rohsenow, J.P.Hartnett & E.N.Ganic', Chapter 7, McGraw
  Hill, 2nd Edition, (1985). The friction factor ( and hence
  pressure drop ) is taken from the correlation of Shah and London,
  which is given in the reference just cited. The Nusselt number
  is based on the hydraulic diameter and the difference between
  the wall and the bulk temperature.
 
  For the Reynolds number, thermal boundary condition, and duct
  aspect ratio considered here, the data are friction factor
  f=0.1556, pressure drop dp/dz=0.233 and Nu=3.383. The PHOENICS
  predictions are in excellent agreement with the data, yielding
  f=0.1556, dp/dz=0.233 and Nu=3.41.
 
  It should be noted that, as predicted by PHOENICS, no secondary
  flows are expected for fully-developed laminar flow.
 
  Finally, one may BFC=T with NONORT=T or F to verify that the
  same results are obtained with the body-fitted-coordinates
  facility.
 
BOOLEAN(HEAT);HEAT=T
REAL(HEIGHT,WIDTH,ALF,HD2,WD2,WIN,DPDZ,REY,FRIC)
REAL(AIN,DHYD,FLOWIN)
REAL(QIN,DTDZ,CP,COND,AWAL,TW)
   ** ALFA = HEIGHT/WIDTH
WIDTH=2.0;ALF=0.5;HEIGHT=ALF*WIDTH
HD2=0.5*HEIGHT;WD2=0.5*WIDTH
WIN=1.0
REY=100.;DHYD=4.*WIDTH*HEIGHT/(2.*HEIGHT+2.*WIDTH)
    GROUP 3. X-direction grid specification
AIN=HD2*WD2
XULAST=WD2;NX=15;GRDPWR(X,NX,XULAST,1.0)
    GROUP 4. Y-direction grid specification
YVLAST=HD2;NY=15;GRDPWR(Y,NY,YVLAST,1.0)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1,W1)
    GROUP 8. Terms (in differential equations) & devices
TERMS(W1,N,P,P,P,P,P)
IF(HEAT) THEN
+ SOLVE(H1);TERMS(H1,N,P,P,P,P,P);PRNDTL(H1)=1.0
ENDIF
    GROUP 9. Properties of the medium (or media)
RHO1=1.0;ENUT=0.0
FLOWIN=RHO1*WIN*AIN;ENUL=WIN*DHYD/REY
  ** compute expected pressure drop from Shah-London
     correlation
REAL(ALF2,ALF3,ALF4,ALF5,TERM1);ALF2=ALF*ALF;ALF3=ALF2*ALF
ALF4=ALF3*ALF;ALF5=ALF4*ALF;TERM1=1.-1.3553*ALF+1.9467*ALF2
FRIC=24.*(TERM1-1.7012*ALF3+0.9564*ALF4-0.2537*ALF5)/REY
FRIC
DPDZ=4.*RHO1*FRIC*WIN*WIN/(2.*DHYD)
DHYD
DPDZ
 
IF(HEAT) THEN
+ QIN=0.1;CP=1.0
+ AWAL=(WD2+HD2)*ZWLAST
+ DTDZ=QIN*AWAL/(CP*FLOWIN)
+ TW=10.
ENDIF
 
    GROUP 11. Initialization of variable or porosity fields
FIINIT(W1)=WIN
IF(HEAT) THEN
+ FIINIT(H1)=0.5*TW
ENDIF
    GROUP 12. Convection and diffusion adjustments
PATCH(GP12CONH,CELL,1,NX,1,NY,1,NZ,1,1)
COVAL(GP12CONH,U1,0.0,0.0);COVAL(GP12CONH,V1,0.0,0.0)
COVAL(GP12CONH,W1,0.0,0.0)
    GROUP 13. Boundary conditions and special sources
PATCH(WALLT,NWALL,1,NX,NY,NY,1,NZ,1,1)
COVAL(WALLT,W1,1.0,0.0);COVAL(WALLT,U1,1.0,0.0)
 
PATCH(WALLS,EWALL,NX,NX,1,NY,1,NZ,1,1)
COVAL(WALLS,W1,1.0,0.0);COVAL(WALLS,V1,1.0,0.0)
 
PATCH(RELIEF,CELL,NX/2,NX/2,NY/2,NY/2,1,NZ,1,1)
COVAL(RELIEF,P1,FIXP,0.0);COVAL(RELIEF,H1,ONLYMS,SAME)
 
FDFSOL=T;USOURC=T
PATCH(FDFW1DP,VOLUME,1,NX,1,NY,1,NZ,1,1)
COVAL(FDFW1DP,W1,FLOWIN,GRND1)
 
IF(HEAT) THEN
  ** constant wall-temperature boundary condition
+ PATCH(FDFCWT,PHASEM,1,NX,1,NY,1,NZ,1,1)
+ COVAL(FDFCWT,H1,DTDZ,TW)
+ COVAL(WALLS,H1,1.0/PRNDTL(H1),TW)
+ COVAL(WALLT,H1,1.0/PRNDTL(H1),TW)
+ COVAL(GP12CONH,H1,0.0,0.0)
ENDIF
    GROUP 15. Termination of sweeps
LSWEEP=20;LITHYD=2;LITER(W1)=15
    GROUP 16. Termination of iterations
RESREF(P1)=1.E-12*WIN*AIN
RESREF(W1)=1.E-12*DPDZ*ZWLAST*AIN
RESREF(U1)=RESREF(W1);RESREF(V1)=RESREF(W1)
IF(HEAT) THEN
+ RESREF(H1)=1.E-12*QIN*ZWLAST*AWAL
+ ISWC1=5
+ QIN
+ COND=RHO1*CP*ENUL/PRNDTL(H1)
+ COND
ENDIF
    GROUP 17. Under-relaxation devices
REAL(DTF);DTF=5.*(YVLAST/NY)**2/ENUL
RELAX(U1,FALSDT,DTF);RELAX(V1,FALSDT,DTF)
RELAX(W1,FALSDT,DTF)
    GROUP 22. Spot-value print-out
IXMON=NX-2;IYMON=NY-2;TSTSWP=-1
    GROUP 23. Field print-out and plot control
NPLT=1;NYPRIN=3;NXPRIN=3
    GROUP 24. Dumps for restarts