PHOTON USE
   AUTOPLOT
   file
   phi 5
 
   cl
   msg U1 DIFFUSION IN AN ANNULUS: RINNER > 0
   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 In An Annulus
 
  The case considered is one-dimensional tangential laminar
  flow of an incompressible fluid between two coaxial
  cylinders of radius RADI and RADO, the outer one of which
  is rotating with an angular velocity of OMEGO and the inner
  one with angular velocity OMEGI. This case provides a test
  of the radial diffusion terms in the U1 equation and the
  wall boundary treatment when RINNER>0. The analyical solution
  for the tangential velocity is U1=A*R+B/R where R is the
  radius, A = OMEGI*(1./ALFA-BETA**2)/(1.-BETA**2), and B =
  OMEGI*RADI**2*(1.-1./ALFA)/(1.-BETA**2). Here, BETA=RADI/RADO
  and ALFA=OMEGI/OMEGO.
 
REAL(GRADI,GRADO,OMEGI,OMEGO,GAP,ALFA,BETA,AA,BB,GR,UA,PI)
INTEGER(JJM1)
  ** ALFA = OMEGI/OMEGO  **  BETA = GRADI/GRADO
ALFA=2.0;BETA=0.5;PI=3.14159265
OMEGI=10*PI;GRADI=0.05;GRADO=GRADI/BETA;OMEGO=OMEGI/ALFA
GAP=GRADO-GRADI
    GROUP 3. X-direction grid specification
CARTES=F
    GROUP 4. Y-direction grid specification
NY=10;RINNER=GRADI;GRDPWR(Y,NY,GAP,1.0)
    GROUP 7. Variables stored, solved & named
SOLVE(U1);STORE(UANA)
    GROUP 8. Terms (in differential equations) & devices
TERMS(U1,P,N,P,P,P,P)
    GROUP 9. Properties of the medium (or media)
RHO1=1000.0;ENUL=1.E-3/RHO1
    GROUP 11. Initialization of variable or porosity fields
IURINI=-1;FIINIT(U1)=OMEGI
  ** compute analytical solutions
AA=OMEGI*(1./ALFA-BETA*BETA)/(1.-BETA*BETA)
BB=OMEGI*GRADI*GRADI*(1.-1./ALFA)/(1.-BETA*BETA)
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*GAP+GRADI;UA=AA*GR+BB/GR
+INIT(IN:JJ:,UANA,ZERO,UA)
ENDDO
    GROUP 13. Boundary conditions and special sources
PATCH(OUTER,NWALL,1,NX,NY,NY,1,NZ,1,1)
COVAL(OUTER,U1,1.0,OMEGO*GRADO)
PATCH(INNER,SWALL,1,NX,1,1,1,NZ,1,1)
COVAL(INNER,U1,1.0,OMEGI*GRADI)
    GROUPS 14 to 24
LSWEEP=6;IYMON=3;NYPRIN=1;NPRINT=LSWEEP;NPLT=1
IPLTL=LSWEEP;TSTSWP=12345