PHOTON USE
  p;;;;;;
 
  msg streamlines and potential contours for flow around an oval
  msg body of revolution
  gr ou x 1
  msg streamlines
  stre 2d x 1 sh;-1 0 200
  msg constant-potential contours
  con pot x 1 sh;-.99 .99 40
  red
  msg Press e to END
  ENDUSE
 
    GROUP 1. Run title and other preliminaries
TEXT(Potl. 2D Flow; Source-Sink Pair   
TITLE
#cls
  DISPLAY
 
  ******************************************************************
  *  Axi-symmetrical potential flow around a spaced source-sink    *
  *  pair, within a uniform-potential-gradient field, is known to  *
  *  generate a field in which a closed streamline has an oval     *
  *  shape.                                                        *
  *                                                                *
  *  This is illustrated in the present case.                      *
  *                                                                *
  *  A PHOTON USE file is provided to facilitate display.          *
  *                                                                *
  ******************************************************************
 
  ENDDIS
#pause

cartes=f; xulast=0.01
ny=20; yvlast=1.0; nz=40; zwlast=2.0
l(unigrid
 
    GROUP 7. Variables stored, solved & named
SOLVE(POT); STORE(U1,V1,W1)
  ** Select whole-field solution procedure for potential,
SOLUTN(POT,Y,Y,Y,N,N,N)
    GROUP 8. Terms (in differential equations) & devices
  ** conjugate-gradient solver
TERMS(POT,N,N,Y,P,P,P); CSG3=CNGR
    GROUP 13. Boundary conditions and special sources
   ** Upstream boundary
PATCH(UPSTRM,LOW,1,NX,1,NY,1,1,1,1); COVAL(UPSTRM,POT,FIXVAL,1.0)
   ** Downstream boundary
PATCH(DWNSTRM,HIGH,1,NX,1,NY,NZ,NZ,1,1)
COVAL(DWNSTRM,POT,FIXVAL,-1.0)
   ** Source and sink patches
PATCH(SOURCE1,CELL,1,1,1,1,NZ/4,NZ/4,1,1)
COVAL(SOURCE1,POT,FIXFLU,0.001)

PATCH(SINK1,CELL,1,1,1,1,3*NZ/4+1,3*NZ/4+1,1,1)
COVAL(SINK1,POT,FIXFLU,-0.001)
    
    GROUP 15. Termination of sweeps
LSWEEP=3; SELREF=T; RESFAC=1.E-2
    GROUP 16. Termination of iterations
LITER(POT)=-100
    Group 19.
POTVEL=t
    GROUP 21. Print-out of variables
YZPR=T
    GROUP 22. Spot-value print-out
IXMON=5; IYMON=5; IZMON=5; UWATCH=T
    GROUP 22. Spot-value print-out
OUTPUT(POT,Y,N,N,N,N,N); OUTPUT(U1,N,N,N,N,N,N)
OUTPUT(V1,Y,N,N,N,N,N); OUTPUT(W1,Y,N,N,N,N,N)
    GROUP 23. Field print-out and plot control