PHOTON USE
  ext
 
 
 
 
  view z
  msg Velocity vectors in a baffled vessel stirred by a paddle
  msg Only one sector is shown
  msg Press  for more
  gr ou z 1
  vec z 1
  pause
  msg pressure contours
  con p1 fi
  z 1
  1 20 1 10
  0.01
  msg press  for the outer half
  pause
  con p1 fi
  z 1
  1 20 13 22
  0.01
  msg Press  to continue
  pause
  con off
  red
  msg temperature contours
  con temp fi
  z 1
  1 20 1 10
  0.01
  msg press  for the outer half
  pause
  con temp fi
  z 1
  1 20 13 22
  0.01
  vec z 1
  msg  -
  msg Press e to END
  enduse
 
    GROUP 1. Run title and other preliminaries
TEXT(Y-Direction Link In XY; Xcycle=t 
TITLE
mesg(PC486/50 time last reported as appx. 2.5 min
  DISPLAY
  2-dimensional (x-y), polar, steady, elliptic simulation
 
  This file, ylink.q1, tests the "link" built in to PHOENICS
  It concerns steady flow through a duct of shape formed by the
  lateral displacement of one half of a rectangular duct relative
  to the other.
  enddis
REAL(XLENGTH,YLENGTH,ZLENGTH,FLORES,P1CO,U1IN,V1IN)
INTEGER(NYNOM,IXSHFT,ISHIFT,IXPLUS,IXLFT)
BOOLEAN(B2T)
B2T=F;FLORES=0.0
P1CO=1.0;U1IN=1.0;V1IN=1.0
XLENGTH=1.0;YLENGTH=1.0;ZLENGTH=1.0
NZ=1;NYNOM=20;NX=20
NPHI=20
NY=NYNOM+2
DO II=1,5
+ MESG(
ENDDO
MESG(NX=:NX:; NYNOM=:NYNOM:; NZ=:NZ:
MESGB(XLENGTH=:XLENGTH:; YLENGTH=:YLENGTH:; ZLENGTH=:ZLENGTH:
DELAY(200)
IF(NX.GT.1) THEN
 MESGm(What x-direction shift would you like ? (from 1-nx to nx-1 )
 READVDU(IXSHFT,INT,0)
ENDIF
ISHIFT=2-IXSHFT*NY
mesgm(ishift is the offset between linked points, =2 - ixshft*ny
ISHIFT
mesgm(Flow-resistance factor = :flores: If not OK, insert your value
READVDU(FLORES,REAL,:FLORES:)
FLORES
mesgm(pressure coefficient = :p1co: If not OK, insert your value
READVDU(P1CO,REAL,:P1CO:)
P1CO
mesgm(Flow is from bottom to top. OK? (y/n)
B2T=T
READVDU(ANS,CHAR,Y)
IF(:ANS:.EQ.N) THEN
 B2T=F
 B2T
ENDIF
IXLFT=1
mesgm(inflow is from :ixlft: to nx. If not OK, insert lowest ix
READVDU(IXLFT,INT,IXLFT)
IXLFT
    GROUP 3. X-direction grid specification
   **Domain is XLENGTH m long in x-direction, with equal intervals
GRDPWR(X,NX,XLENGTH,1.0)
    GROUP 4. Y-direction grid specification
   **Domain is YLENGTH m long in y-direction, with equal intervals
YVLAST=YLENGTH
YFRAC(1)=-NYNOM/2;YFRAC(2)=1/NYNOM
YFRAC(3)=2;YFRAC(4)=0.01*YFRAC(2)
YFRAC(5)=-YFRAC(1);YFRAC(6)=YFRAC(2)
    GROUP 5. Z-direction grid specification
   **Domain is ZLENGTH m long in z-direction, with equal intervals
GRDPWR(Z,NZ,ZLENGTH,1.0)
    GROUP 7. Variables stored, solved & named
   **Choose first-phase enthalpy (H1) as dependent variable
     and activate the whole-field elliptic solver
SOLUTN(H1,Y,Y,Y,N,N,N);NAME(H1)=TEMP
SOLVE(P1,U1,V1);SOLUTN(P1,Y,Y,Y,N,N,N)
    GROUP 8. Terms (in differential equations) & devices
   ** cut out built-in source term
TERMS(TEMP,N,Y,Y,Y,Y,Y)
    GROUP 9. Properties of the medium (or media)
   **Thermal conductivity will be ENUL*RHO1/PRNDTL(TEMP), so :
ENUL=1.0E-3;PRNDTL(TEMP)=0.1
    GROUP 11. Initialization of variable or porosity fields
IURINI=1;FIINIT(U1)=U1IN
INIADD=F
IF(B2T) THEN
 FIINIT(V1)=0.5*V1IN
ELSE
 FIINIT(V1)=-0.5*V1IN
ENDIF
FIINIT(TEMP)=0.9
PATCH(LOWER,INIVAL,1,NX,1,NYNOM/2+1,1,1,1,1)
COVAL(LOWER,P1,0.0,1.0)
COVAL(LOWER,TEMP,0.0,-0.9)
    GROUP 13. Boundary conditions and special sources
   ** cold in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AL(GP12DFN2,TEMP,0.5,0.0)
COVAL(GP12DFN2,U1,0.5,0.0)
PATCH(ROTA,PHASEM,1,NX,1,NYNOM/2+1,1,1,1,1)
COVAL(ROTA,U1,FIXFLU,GRND)
COVAL(ROTA,V1,FIXFLU,GRND)
ANGVEL=-U1IN
PATCH(PADDLE,EAST,1,1,1,3,1,1,1,LSTEP)
COVAL(PADDLE,U1,FIXVAL,0.0)
PATCH(BAFFLE,EAST,1,1,NY-2,NY,1,1,1,LSTEP)
COVAL(BAFFLE,U1,FIXVAL,0.0)
    GROUP 15. Termination of sweeps
LSWEEP=20;RESREF(P1)=1.E-10
    GROUP 16. Termination of iterations
  ** Set the frequencies of application of the one-dimensional
     correction features in the linear-equation solver to once
     per iteration for each direction.
ISOLX=1;ISOLY=1;ISOLZ=1
LITER(TEMP)=10;LITER(P1)=20
    GROUP 17. Under-relaxation devices
RELAX(P1,LINRLX,0.5)
RELAX(V1,FALSDT,0.005);RELAX(U1,FALSDT,0.005)
    GROUP 21. Print-out of variables
   **Print fields of temperature
OUTPUT(TEMP,Y,Y,Y,Y,Y,Y)
    GROUP 22. Spot-value print-out
IYMON=NY/2+1;IZMON=NZ/2+1;IXMON=NX-1;ITABL=1
    GROUP 23. Field print-out and plot control
IXPRF=NYNOM/2-1;IXPRL=NYNOM/2+3
NXPRIN=1;NYPRIN=1
   ** Plot contour diagrams for the plane
PATCH(FIRST,CONTUR,1,NYNOM/2,1,NY,1,NZ,1,1)
PLOT(FIRST,TEMP,0.0,20.0);PLOT(FIRST,P1,0.0,20.0)
PATCH(SECOND,CONTUR,NYNOM/2+3,NX,1,NY,1,NZ,1,1)
PLOT(SECOND,TEMP,0.0,20.0);PLOT(SECOND,P1,0.0,20.0)
    GROUP 24. Dumps for restarts
UWATCH=T;NPLT=1;TSTSWP=-1
LSWEEP=200
SELREF=T;RESFAC=1.E-2
RELAX(P1,LINRLX,0.5)
NYPRIN=1;NXPRIN=1;NPRINT=1000
IXPRF=1;IXPRL=NX;IYPRF=NYNOM/2;IYPRL=IYPRF+3
FIINIT(TEMP)=0.9
CARTES=F;RINNER=YVLAST/10
XCYCLE=T
lsg57=t