PHOTON USE
  p;;;;
 
  msg the grid
  gr z 1;pause
  msg the horizontal component of velocity
  cont ucrt z 1 fil;.001; pause
  msg the vertical component of velocity
  cont vcrt z 1 fil;.001; pause
  msg the velocity potential
  cont p1 z 1 fil;.001; pause
  msg Type e to End
  ENDUSE
    GROUP 1. Run title
TEXT(POT. FLOW AROUND A HALF-CYL X-Y :   B521
TITLE
  DISPLAY
  As for case 520 but this time the X-Y plane is used for the
  calculation.
  ENDDIS
    GROUP 6. Body-fitted coordinates or grid distortion
BFC=T;NONORT=T; SYMBFC=T
INTEGER(NXTOT,NYTOT)
NXTOT=80; NYTOT=40
 
GSET(D,NXTOT,NYTOT,1,2.0,1.0,1.0)
INTEGER(DNX);DNX=NX/4
REAL(AA,YLEN);AA=XULAST/3;YLEN=1.0
   ** Set corner points for frame
GSET(P,A,0,0,0)
GSET(P,D,XULAST,0,0)
GSET(P,E,XULAST,YLEN,0)
GSET(P,H,0,YLEN,0)
   ** Set corner points for cylinder
GSET(P,B,AA,0,0)
GSET(P,C,AA*2,0,0)
GSET(P,F,AA*2,YLEN,0)
GSET(P,G,AA,YLEN,0)
   ** Set EAST and WEST boundaries of frame
GSET(L,L8,H,A,NY,1.0)
GSET(L,L4,D,E,NY,1.0)
   ** Set NORTH and SOUTH boundaries of cylinder
GSET(L,L6,F,G,DNX*2,1)
   -- Using S.57 to approximate equal division on arc **
GSET(L,L2,B,C,DNX*2,S.57,ARC,XULAST/2,AA/2,0)
   ** Set NORTH and SOUTH boundaries of rest of frame
GSET(L,L1,A,B,DNX,1.0)
GSET(L,L3,C,D,DNX,1.0)
GSET(L,L5,E,F,DNX,1.0)
GSET(L,L7,G,H,DNX,1.0)
   ** Define frame
GSET(F,F1,A,B.C,D,-,E,F.G,H,-)
   ** Match frame on to K1, with "MAGIC" (ie Laplace) solver
                                 and 10 iterations **
GSET(M,F1,+I+J,1,1,1,LAP10)
   ** Copy K1 to K2
GSET(C,K2,F,K1,+,0,0,1)
 
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1)
    GROUP 9. Properties of the medium (or media)
RHO1=1.0; ENUL=1.0E-10
    GROUP 11. Initialization of variable or porosity fields
FIINIT(U1)=1.0
    GROUP 13. Boundary conditions and special sources
   ** Inlet
INLET(INLET,WEST,1,1,1,NY,1,1,1,1)
VALUE(INLET,P1,1.0);VALUE(INLET,U1,1.0)
   ** Outlet
PATCH(OUTLET,EAST,NX,NX,1,NY,1,1,1,1);COVAL(OUTLET,P1,FIXP,0.0)
COVAL(OUTLET,U1,ONLYMS,0.0);COVAL(OUTLET,V1,ONLYMS,0.0)
   ** Whole field flow-resistance
DARCY=T
    GROUP 15. Termination of sweeps
LSWEEP=100
    GROUP 22. Spot-value print-out
IYMON=3;IXMON=NX/2;TSTSWP=-1
    GROUP 23. Field print-out and plot control
PATCH(XY,CONTUR,1,NX,1,NY,1,1,1,1)
PLOT(XY,P1,0.0,20.0);PLOT(XY,U1,0.0,20.0)
PATCH(INNER,PROFIL,1,NX,1,1,1,1,1,1)
PLOT(INNER,P1,0.0,0.0);PLOT(INNER,U1,0.0,0.0)
IZPRF=5;IZPRL=15
    GROUP 24. Dumps for restarts