PHOTON USE
   AUTOPLOT
   file
   phi 5
 
   cl
   msg U1 DIFFUSION OF A FORCED 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
 
TEXT(1D U1 Diffusion Of A Forced Vortex
TITLE
  DISPLAY
  
  The case considered is 1d radial diffusion of a forced vortex with
  fixed-value boundary conditions at the axis and outer boundary.
 
  ENDDIS
  
    GROUP 3. X-direction grid specification
REAL(GRADO,GUDR,GR,UA);INTEGER(JJM1);GRADO=1.0;GUDR=0.025
CARTES=F;XULAST=0.001
    GROUP 4. Y-direction grid specification
NY=20;RINNER=0.;GRDPWR(Y,NY,GRADO,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)=GUDR;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*GRADO
+ UA=GUDR*GR
INIT(IN:JJ:,UANA,ZERO,UA)
ENDDO
    GROUP 13. Boundary conditions and special sources
PATCH(INNER,CELL,1,NX,1,1,1,1,1,1);IURVAL=-1
COVAL(INNER,U1,FIXVAL,GUDR)
PATCH(OUTER,NORTH,1,NX,NY,NY,1,1,1,1)
COVAL(OUTER,U1,FIXVAL,GUDR)
    GROUP 15. Termination of sweeps
LSWEEP=4;RESREF(U1)=1.E-7
    GROUP 22. Spot-value print-out
IYMON=6;TSTSWP=1
    GROUP 23. Field print-out and plot control
ITABL=2;NYPRIN=1
PATCH(LONGPLOT,PROFIL,1,1,1,NY,1,1,1,1)
PLOT(LONGPLOT,U1,0.0,0.0)
    GROUP 24. Dumps for restarts