#cls
TEXT(Pot. Flow; In-Form-Created Source-Sink 
libref=129
TITLE
  DISPLAY
  
  An inviscid fluid flows steadily past a symmetrical body created
  by way of sources and sinks.
  
  These are introduced by way of In-Form, and specifically the
  statements:
 
  PATCH(AXIS,VOLUME,1,1,1,1,3*NZ/8+1,5*NZ/8-1,1,1)
    which states where the formula is to be applied
    and
  (SOURCE OF POT AT AXIS IS 100*(4-ZW)^3)
    which provides the formula.
    
  The Q1 contains PHOTON USE commands
  ENDDIS
  PHOTON USE
  p
  phi
 
 
  msg         Potential flow past source-sink distribution
  msg
  gr ou x 1
  msg        Axial velocity contours:
  con w1 x 1 fi;.01
  msg
  msg Press  to continue
  pause
  con off;red
  msg        Streamlines and contours of velocity potential:
  con pot x 1 sh; int 20
  stre 2d x 1 sh; -3.66 0 50
  msg Press e to END
  enduse
    GROUP 1. Run title and other preliminaries
TEXT(Pot. Flow; In-Form-Created Source-Sink 
   GROUPs 3, 4 and 5: grid specification
nx=1; ny=40; nz=80
xulast=1.0; yvlast=4.0; zwlast=8.0
#unigrid
 
    GROUP 7. Variables stored, solved & named
STORE(POT,P1,V1,W1); SOLUTN(POT,Y,Y,Y,N,N,N)
 
    GROUP 13. Boundary conditions and special sources
   **Upstream boundary
PATCH(UPSTRM,LOW,1,1,1,NY,1,1,1,1)
COVAL(UPSTRM,POT,FIXVAL,4.0)
  ** Corresponding initial-value patches, needed to endure one-sweep solution
PATCH(UPSTRMI,inival,1,1,1,NY,1,1,1,1)
COVAL(UPSTRMI,POT,FIXVAL,4.0)
   **Downstream boundary
PATCH(DWNSTRM,HIGH,1,1,1,NY,NZ,NZ,1,1)
COVAL(DWNSTRM,POT,FIXVAL,-4.0)
  ** Corresponding initial-value patches, needed to endure one-sweep solution
PATCH(DWNSTRMI,inival,1,1,1,NY,NZ,NZ,1,1)
COVAL(DWNSTRMI,POT,FIXVAL,-4.0)
   ** source-sink combination to create (the effect) an
      axi-symmetrical body
  INFORM13BEGIN
PATCH(AXIS,VOLUME,1,1,1,1,3*NZ/8+1,5*NZ/8-1,1,1)
(source of pot at axis is 100*(4-zw)^3)
  INFORM13END  
 
    GROUP 15. Termination of sweeps
LSWEEP = 1
    GROUP 16. Termination of iterations
LITER(POT)=-500; OVRRLX=2.5; ISOLZ=1
    GROUP 19. Data communicated by satellite to GROUND
POTVEL=T
    GROUP 21. Print-out of variables
OUTPUT(POT,Y,Y,Y,Y,N,N)
    GROUP 22. Spot-value print-out
IYMON=NY/2;IZMON=NZ/2;IPLTF=2;UWATCH=T
    GROUP 23. Field print-out and plot control
NYPRIN=NY/10;IZPRF=16;IZPRL=25
PATCH(CONT,CONTUR,1,1,1,NY,1,NZ,1,1);PLOT(CONT,POT,0.0,20.0)
DISTIL=T
EX(P1)=1.211E+00; EX(V1)=1.198E-01
EX(W1)=1.020E+00; EX(POT)=2.177E+00
libref=129
STOP