PHOTON USE
  p;;;;
 
  set vec ref 0.3;gr z 1;vec z 1 sh
  msg                     Velocity vectors
  msg Press  to continue
  pause;gr off;vec off;red;gr ou z 1
  msg Temperature contours
  con TEMP z 1 fil;.001
  msg Press Enter to continue
  pause;con off;red
  msg              Viscosity contours
  con VISL z 1 fil;.001
  msg Press e to END
  ENDUSE
    GROUP 1. Run title and other preliminaries
#cls
TEXT(SQUARE CAVITY WITH MOVING LID:Z100
title
libref
  DISPLAY
  This run analyses the flow in a cavity,  the top  wall  of  which
  moves   with  a  constant  velocity.  The  top  wall  is  at  one
  temperature,  the moving wall is at a different  temperature  and
  two  other  walls are adiabatic.  The calculation is made for the
  Reynolds number Re = 100 ,  for Prandtl number Pr = 1 and for the
  exponent in the viscosity formula EMU = EMU0*EXP(-beta.(T - T0)).
  ( See M. Morzynski and Cz. O. Popiel in Numerical Heat Transfer,
    v.13, pp. 265-273, 1988 for further details and comparison).
 
  The corresponding PIL statements are:
  REAL(ENULR,EXPO,TEMPR); ENULR=1.E-3;EXPO=-1.6;TEMPR=0.0
  followed by the PLANT property formula:
                     VISL=:ENULR:*EXP(:EXPO:*(TEMP-:TEMPR:))
 
  The values of ENULR, EXPO and TEMP may of course be changed;
  and the formula also.
  ENDDIS
    GROUP 3. X-direction grid specification
GRDPWR(X,-15,0.1,2.0)
    GROUP 4. Y-direction grid specification
  ** Set a symmetrical grid as in GROUP 3.
GRDPWR(Y,-15,0.1,2.0)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1,h1);STORE(VISL)
NAME(H1)=TEMP
    GROUP 9. Properties of the medium (or media)
PRNDTL(TEMP)=0.7;ENUL=GRND

  PLANTBEGIN
REAL(ENULR,EXPO,TEMPR); ENULR=1.E-3;EXPO=-1.6;TEMPR=0.0
    VISL=:ENULR:*EXP(:EXPO:*(TEMP-:TEMPR:))
  PLANTEND

    GROUP 13. Boundary conditions and special sources
  ** South wall, at rest
PATCH(SOUTH,SWALL,1,NX,1,1,1,1,1,1)
COVAL(SOUTH,U1,1.0,0.0);COVAL(SOUTH,TEMP,1.0,0.0)
  ** North wall, moving
PATCH(MOVING,NWALL,1,NX,NY,NY,1,1,1,1)
COVAL(MOVING,U1,1.0,1.0);COVAL(MOVING,TEMP,1.0,1.0)
  ** West wall, at rest
PATCH(WEST,WWALL,1,1,1,NY,1,1,1,1)
COVAL(WEST,V1,1.0,0.0)
  ** East wall, at rest
PATCH(EAST,EWALL,NX,NX,1,NY,1,1,1,1)
COVAL(EAST,V1,1.0,0.0)
  ** Pressure relief
PATCH(RELIEF,CELL,NX/2,NX/2,NY/2,NY/2,1,1,1,1)
COVAL(RELIEF,P1,FIXP,0.0)
    GROUP 14. Downstream pressure for PARAB=.TRUE.
    GROUP 15. Termination of sweeps
LSWEEP=50
RESREF(P1)=1.E-8;RESREF(U1)=1.E-6;RESREF(V1)=1.E-6
RESREF(TEMP)=1.E-6
    GROUP 17. Under-relaxation devices
RELAX(U1,FALSDT,1.);RELAX(V1,FALSDT,1.)
    GROUP 18. Limits on variables or increments to them
    GROUP 19. Data communicated by satellite to GROUND
NAMSAT=MOSG
    GROUP 20. Preliminary print-out
    GROUP 21. Print-out of variables
    GROUP 22. Spot-value print-out
IXMON=NX/2;IYMON=NY-1
    GROUP 23. Field print-out and plot control
PATCH(MIDX,PROFIL,NX/2,NX/2,1,NY,1,1,1,1)
PLOT(MIDX,U1,-1.0,1.0);PLOT(MIDX,TEMP,0.0,1.0)
PATCH(MAP,CONTUR,1,NX,1,NY,1,1,1,1)
PLOT(MAP,U1,0.0,10);PLOT(MAP,V1,0.0,10)
PLOT(MAP,TEMP,0.0,10)
tstswp=-1
DISTIL=T
EX(P1)=3.442E-02; EX(U1)=1.276E-01; EX(V1)=8.064E-02
EX(TEMP)=6.309E-01; EX(VISL)=4.492E-04
 LIBREF=100
STOP