PHOTON USE
  p
 
 
  x1
 
  gr ou z 1
  vec z 1 sh
  msg            Velocity distribution
  msg  Press Enter to continue
  pause
  vec off;red
  con p1 z 1 fil;0.01
  msg            Pressure contours
  msg Press Enter to end
  ENDUSE
 
   *  GROUP 1. Run title and other preliminaries.

  DISPLAY

     Viscous flow in a converging-diverging channel.    

  ENDDIS
 
TEXT( Viscous flow in converging-diverging channel
 
   *  GROUP 3. X-direction grid specification.
NX=150
GRDPWR(X,NX,LENGTH,1.0)
   *  GROUP 4. Y-direction grid specification.
NY=20
GRDPWR(Y,NY,1,1.0)
bfc=t
nonort=t
dumpc(grid);readco(grid)
            PLANTed grid formulae
NAMSAT=MOSG

   PLANTBEGIN
REAL(LENGTH,WIDTH,RE,PR,PI,UIN)
PI=3.14157;LENGTH=6*PI ;WIDTH=2.;RG(1)=LENGTH;RG(2)=WIDTH
UIN=1.0;RE=800.0;PR = 1.0
    XC=RG(1)/FLOAT(NX)*FLOAT(I-1)
    YC=FLOAT(J-1)/FLOAT(NY)*$
               (1/:PI:+0.5*SIN(XC-1.6)-2/:PI:*$
               (COS(2*(XC-1.6))/3+COS(4*(XC-1.6))/15+$
                COS(6*(XC-1.6))/35+COS(8*(XC-1.6))/63+$
                COS(10*(XC-1.6))/99+COS(12*(XC-1.6))/143))+$
                RG(2)*FLOAT(J-1)/FLOAT(NY)
    ZC=1.*FLOAT(K-1)/FLOAT(NZ)
   PLANTEND
  
   *  GROUP 7. Variables stored, solved & named.
SOLVE(P1); SOLUTN(P1,Y,Y,Y,N,N,N)
SOLVE(U1,V1)
   *  GROUP 8. Terms (in differential equations) & devices.
RHO1= 1.000E+00   ;  ENUL= 1./RE
   *  GROUP 11. Initialization of variable or porosity fields.
   *  GROUP 13. Boundary conditions and special sources.
PATCH(INLET,WEST,1,1,1,NY,1,1,1,1)
COVAL(INLET,P1,FIXFLU,UIN*RHO1)
COVAL(INLET,U1,ONLYMS,UIN)
     ** Fixed pressure outlet
PATCH(OUTLET,EAST,NX,NX,1,NY,1,1,1,1)
COVAL(OUTLET,P1,fixp,0.0)
     ** HOT top wall
WALL(TOPWALL,NORTH,1,NX,NY,NY,1,1,1,1)
     ** COLD bottom wall
WALL(BOTWALL,SOUTH,1,NX,1,1,1,1,1,1)
 
   *  GROUP 15. Termination of sweeps.
LSWEEP=400
RESREF(P1)= 1.000E-06;RESREF(U1)= 1.000E-06
RESREF(V1)= 1.000E-06
   *  GROUP 16. Termination of iterations.
LITER(U1)=10; ENDIT(U1)= 1.000E-06
LITER(V1)=10; ENDIT(V1)= 1.000E-06
   *  GROUP 17. Under-relaxation devices.
RELAX(P1,LINRLX, 0.25)
REAL(SCALEL,SCALEU);SCALEL= 1.0;SCALEU=1.00
RELAX(U1,FALSDT, 1.0*SCALEL/SCALEU)
RELAX(V1,FALSDT, 1.0*SCALEL/SCALEU)
   *  GROUP 20. Preliminary print-out.
   *  GROUP 21. Print-out of variables.
OUTPUT(P1,Y,Y,Y,Y,Y,Y);OUTPUT(U1,Y,Y,Y,Y,Y,Y)
OUTPUT(V1,Y,Y,Y,Y,Y,Y)
   *  GROUP 22. Spot-value print-out.
IXMON=7;IYMON=8
   *  GROUP 23. Field print-out and plot control.
ITABL=3
tstswp=-1
CSG1=PHI
CSG2=XYZ;IDISPA=1

tstswp=-1
dmpstk=t
DISTIL=T
EX(P1)=1.161E+00; EX(U1)=8.726E-01; EX(V1)=3.026E-02
EX(VCRT)=3.213E-02; EX(UCRT)=8.848E-01
 LIBREF=514
STOP