PHOTON USE
   AUTOPLOT
   file
   phi 5
 
   cl
   msg U1 DIFFUSION OF A COMBINED VORTEX
   msg Velocity (U1) profile
   msg Green line --- PHOENICS solution
   msg crosses ---   analytical solution
   da 1 u1;da 1 uana
   col9 1;blb4 2
 
   msg press  to end
   pause
   end
   END_USE
 
    GROUP 1. Run title and other preliminaries
TEXT(1D U1 Diffusion Of A Combined Vortex
TITLE
  DISPLAY
  
  The case considered is 1d radial diffusion of a combined vortex
  with a fixed-value boundary condition at the outer boundary. The
  U1 velocity is fixed at the radius where the swirling motion
  changes from a forced vortex at the core to a free vortex in the
  surrounding fluid. This distribution of U1 forms a very close
  approximation to most swirling motions which occur in practice.
 
  ENDDIS
REAL(GRAD2,GUR,GUDR,GR,UA,GR1,GR2)
INTEGER(NY1,JJM1);GRAD2=1.0;GUDR=2.0
    GROUP 3. X-direction grid specification
CARTES=F;XULAST=0.001
    GROUP 4. Y-direction grid specification
NY1=6;NY=40;RINNER=0.;GRDPWR(Y,NY,GRAD2,1.0)
    GROUP 7. Variables stored, solved & named
SOLVE(U1);STORE(UANA);TERMS(U1,P,N,P,P,P,P)
    GROUP 9. Properties of the medium (or media)
ENUL=1.0
    GROUP 11. Initialization of variable or porosity fields
FIINIT(U1)=GUR;IURINI=1
  ** compute analytical solutions
DO JJ=1,NY
+PATCH(IN:JJ:,INIVAL,1,NX,JJ,JJ,1,NZ,1,1)
+GR=0.5*YFRAC(JJ)
IF(JJ.NE.1) THEN
+JJM1=JJ-1
+GR=YFRAC(JJM1)+0.5*(YFRAC(JJ)-YFRAC(JJM1))
ENDIF
+GR=GR*GRAD2
IF(JJ.EQ.NY1) THEN
+ GR1=GR
ENDIF
IF(JJ.EQ.NY) THEN
+ GR2=GR
ENDIF
IF(JJ.LE.NY1) THEN
+ UA=GUDR*GR
ELSE
+ UA=GUDR*GR1*GR1/GR
ENDIF
INIT(IN:JJ:,UANA,ZERO,UA)
ENDDO
GUR=GUDR*GR1*GR1
    GROUP 13. Boundary conditions and special sources
PATCH(INNER,CELL,1,NX,NY1,NY1,1,1,1,1)
COVAL(INNER,U1,FIXVAL,GUDR*GR1)
PATCH(OUTER,CELL,1,NX,NY,NY,1,1,1,1)
COVAL(OUTER,U1,FIXVAL,GUR/GR2)
    GROUP 15. Termination of sweeps
LSWEEP=10;RESREF(U1)=1.E-7
    GROUP 22. Spot-value print-out
IYMON=6;TSTSWP=1;NYPRIN=1
    GROUP 23. Field print-out and plot control
IURPRN=0;ITABL=2
PATCH(LONGPLOT,PROFIL,1,1,1,NY,1,1,1,1)
PLOT(LONGPLOT,U1,0.0,0.0)
    GROUP 24. Dumps for restarts