PHOTON USE AUTOPLOT file phi 5 cl msg U1 DIFFUSION IN A CYLINDER: 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 pressto end pause end END_USE The case considered is one-dimensional tangential laminar flow of an incompressible fluid inside a rotating cylinder. The case provides a test of the radial diffusion terms in the U1 equation, as well as the treatment of the wall boundary conditions. The analytical velocity distribution is simply one of solid-body rotation with U1=OMEGA*R where OMEGA is the angular velocity of the cylinder and R is the radius. TEXT(1D U1 Diffusion In A Rotating Cylinder REAL(OMEGO,GRADO,GR,UA,PI);INTEGER(JJM1) PI=3.14159265;OMEGO=10*PI;GRADO=0.05 GROUP 3. X-direction grid specification CARTES=F GROUP 4. Y-direction grid specification NY=10;GRDPWR(Y,NY,GRADO,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)=OMEGO ** 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 +UA=OMEGO*GR*GRADO +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) GROUPS 14 to 24 LSWEEP=6;IYMON=3;NYPRIN=1;NPRINT=LSWEEP;NPLT=1 IPLTL=LSWEEP;TSTSWP=12345