GROUP 1. Run title and other preliminaries
TEXT(Channel Flow; Mixing-Length Model 
TITLE
  DISPLAY
  Steady turbulent flow develops in a 2D channel with smooth
  uniform-temperature walls. The length/width ratio is 30, which
  suffices for the flow to be fully developed at the outlet.
 
                            Wall at temperature TWALL
             ///////////////////////////////////////////////////////
  Constant   -------------------------------------------------------
  specified --->                                                ->
  mass-flux --->                                                -->
  and       --->                                                --->
  velocity    - - - - - - - - - - -Symmetry plane - - - - - - - - -
                    ------>z
 
  The Q1 contains PHOTON USE commands
  ENDDIS
  PHOTON USE
  p
  parphi
  1 10 1
 
 
  gr x 1
  msg the grid, enlarged 10 times in the cross-stream direction
  msg press return for the pressure distribution
  gr off
  gr ou x 1
  msg pressures. Press return for contours of temperature
  con p1 x 1 fi;0.1
  pause
  con off
  red
  msg Temperature contours. Press return for contours of W1
  con TEMP x 1 fi;0.1
  pause
  con off
  red
  msg Longitudinal-velocity contours. Press return for LEN1
  con W1 x 1 fi;0.1
  pause
  con off
  red
  msg Mixing-length contours. Press return for contours of ENUT
  con LEn1 x 1 fi;0.1
  pause
  con off
  red
  msg Turbulent-viscosity contours. Press return for vectors
  con ENUT x 1 fi;0.1
  pause
  con off
  red
  msg velocity vectors. Press E to end
  vec x 1 sh
  enduse
 
 
 
REAL(AK,WD23,TIN,TWALL,EWAL,GMIXL,CLEN,WIDTH,WIN,REYNO,WD2)
REYNO=1.E5;WIDTH=0.1;WIN=50.;TIN=10.;TWALL=5.;AK=0.41;EWAL=8.6
 
    GROUP 2. Transience; time-step specification
    GROUP 3. X-direction grid specification
    GROUP 4. Y-direction grid specification
NY=30;WD2=0.5*WIDTH;GRDPWR(Y,NY,WD2,0.75)
 
    GROUP 5. Z-direction grid specification
PARAB=T;NZ=20;CLEN=30.*WIDTH;GRDPWR(Z,NZ,CLEN,1.0)
 
    GROUP 6. Body-fitted coordinates or grid distortion
    GROUP 7. Variables stored, solved & named
SOLVE(P1,W1,V1,H1);STORE(ENUT);NAME(H1)=TEMP
STORE(LEN1)
 
    GROUP 8. Terms (in differential equations) & devices
DIFCUT=0.0;TERMS(TEMP,N,Y,Y,Y,Y,Y)
 
    GROUP 9. Properties of the medium (or media)
  In this case, the Prandtl mixing-length turbulence model is used
  and the mixing-length distribution is prescribed according to the
  Nikuradse formulae, ie:
 
      2(Lm/H) = 0.14 - 0.08(2y/H)**2 - 0.06(2y/H)**4
 
  where y is the normal distance from the channel wall. The
  turbulent Prandtl number is set to 0.86 and the molecular Prandtl
  number to 0.71.
 
  GXLEN, GXENUT and GXWFUN are used for this case.
ENUL=WIN*WIDTH/REYNO;PRT(TEMP)=0.86;PRNDTL(TEMP)=0.7
  ** Select Mixing-Length Formula : Group 9/Sect. 5 of GREX3
ENUT=MIXLEN
  ** Use Nikuradse's formula noting that wall is at north boundary
     at distance WD2 from the centre-line...
EL1=NIKURPIP
WD23=WD2**3;EL1A=0.14*WD2;EL1B=-0.08/WD2;EL1C=-0.06/WD23
 
    GROUP 11. Initialization of variable or porosity fields
FIINIT(W1)=WIN;FIINIT(TEMP)=TIN
 
    GROUP 13. Boundary conditions and special sources
  ** North-Wall Boundary
WALL(WFUN,NORTH,1,1,NY,NY,1,NZ,1,100);COVAL(WFUN,TEMP,LOGLAW,TWALL)
  ** Inlet Boundary
INLET(IN,LOW,1,1,1,NY,1,1,1,1);VALUE(IN,P1,WIN)
VALUE(IN,W1,WIN);VALUE(IN,TEMP,TIN)
 
    GROUP 15. Termination of sweeps
SELREF=T;RESFAC=0.01
 
    GROUP 16. Termination of iterations
LITHYD=15;RESREF(P1)=1.E-5;RESREF(V1)=1.E-5;RESREF(W1)=1.E-5
RESREF(TEMP)=1.E-5
    GROUP 18. Limits on variables or increments to them
VARMIN(W1)=1.E-10
    GROUP 19. Data communicated by SATELLITE to GROUND
  ** Select strain-rate for use in Mixing-Length model
DWDY=T
    GROUP 22. Monitor print-out
IZMON=1;IYMON=27;ITABL=2;IPLTL=30;NPLT=2;NPRMON=4
UWATCH=T;TSTSWP=LITHYD
    GROUP 23. Field print-out and plot control
PATCH(IZEQNZ,PROFIL,1,1,1,NY,NZ,NZ,1,1)
PLOT(IZEQNZ,W1,0.0,0.0);PLOT(IZEQNZ,TEMP,0.0,0.0)
NZPRIN=40;IDISPA=1;IDISPB=1;IDISPC=NZ
    GROUP 24. Dumps for restarts