PHOTON USE
  p;;;;
 
  vec x 1;pause
  msg Pressure field
  con p1 x 1 fi;0.01
  msg   -
  msg Press  to continue
  pause
  msg Temperature field
  con temp x 1 fi;0.01
  msg  -
  msg Press  to END
  enduse
 
    GROUP 1. Run title and other preliminaries
TEXT(Link Test In YZ Plane; 2 Dummy Cells
TITLE
mesg(PC486/50 time last reported as 1.min
  DISPLAY
  2-dimensional (y-z), Cartesian, steady, elliptic simulation
 
  This file, ylink.q1, tests the "link" built in to PHOENICS
  It concerns steady flow through a duct with two dummy cells
  inserted in the middle.
  enddis
 
REAL(XLENGTH,YLENGTH,ZLENGTH,flores,p1co)
INTEGER(NYNOM,NZNOM,KSHIFT,NZSUBD)
FLORES=0.0;P1CO=1.0
XLENGTH=1.0;YLENGTH=1.0;ZLENGTH=1.0
NZSUBD=2 ;NZNOM=10
NPHI=20
NX=1;NY=5
NZ=NZNOM+4*(NZSUBD-1)
KSHIFT=2*NY
MESG(test of link feature in yz plane with 2 dummy cells
MESG(NX=:NX:; NY=:NY:; NZ=:NZ:
MESG(FLOW RESISTANCE FACTOR=:flores: If not OK, insert your value
READVDU(FLORES,REAL,:FLORES:)
FLORES
    GROUP 3. X-direction grid specification
GRDPWR(X,NX,XLENGTH,1.0)
    GROUP 4. Y-direction grid specification
GRDPWR(Y,NY,YLENGTH,1.0)
    GROUP 5. Z-direction grid specification
REAL(ZSUBD);INTEGER(NZS)
ZSUBD=ZLENGTH/NZSUBD
NZS=NZNOM/NZSUBD
NREGZ=3
IREGZ=1;GRDPWR(Z,NZS,ZSUBD,1.0)
IREGZ=2;GRDPWR(Z,4,1/40,1.0)
IREGZ=3;GRDPWR(Z,NZS,ZSUBD,1.0)
ZLENGTH=ZLENGTH+1/40
MESG(XLENGTH=1; YLENGTH=1; ZLENGTH=:ZLENGTH:
    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,Y);NAME(H1)=TEMP
STORE(VPOR);SOLVE(P1,V1,W1)
SOLUTN(P1,Y,Y,Y,N,N,N)
    GROUP 8. Terms (in differential equations) & devices
   **For pure conduction, cut out built-in source and convection
     terms
TERMS(TEMP,N,N,Y,N,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)=1.0
    GROUP 11. Initialization of variable or porosity fields
INIADD=F
FIINIT(W1)=0.5 ;FIINIT(VPOR)=1.0
    GROUP 13. Boundary conditions and special sources
   **Cold
PATCH(COLD,LOW,1,1,1,NY,1,1,1,1)
COVAL(COLD,W1,ONLYMS,1.0)
COVAL(COLD,TEMP,1.E5,-0.9)
COVAL(COLD,P1,FIXFLU,1.0)
PATCH(HOT,CELL,1,1,1,NY,NZ,NZ,1,1)
COVAL(HOT,TEMP,1.E5,0.9)
COVAL(HOT,P1,1.e-2,0.0)
  link feature: for patch names beginning with +. This feature
  makes val = phi(i + nint(vphi)) Linking in the z-direction..
INTEGER(II)
II=NZNOM/NZSUBD+1
PATCH(+1L,LOW,1,NX,1,NY,II+1,II+1,1,1)
COVAL(+1L,TEMP,FIXVAL,KSHIFT); COVAL(+1L,P1,1.E5,KSHIFT)
COVAL(+1L,W1,FIXVAL,KSHIFT); COVAL(+1L,V1,FIXVAL,KSHIFT)
 
PATCH(+1H,LOW,1,NX,1,NY,II+2,II+2,1,1)
COVAL(+1H,TEMP,FIXVAL,-KSHIFT); COVAL(+1H,P1,1.E5,-KSHIFT)
COVAL(+1H,W1,FIXVAL,-KSHIFT); COVAL(+1H,V1,FIXVAL,-KSHIFT)
 
PATCH(FLOWRES,VOLUME,1,NX,1,3,3,3,1,1)
COVAL(FLOWRES,W1,FLORES,0.0); COVAL(FLOWRES,V1,FLORES,0.0)
    GROUP 15. Termination of sweeps
RESREF(P1)=1.E-10;LSWEEP=20;RESREF(W1)=1.E-10;RESREF(V1)=1.E-10
    GROUP 16. Termination of iterations
ENDIT(TEMP)=5.E-7
  ** 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(W1,FALSDT,0.02);RELAX(V1,FALSDT,0.02)
    GROUP 21. Print-out of variables
   **Print fields of temperature
OUTPUT(TEMP,Y,Y,Y,Y,Y,Y)
    GROUP 22. Spot-value print-out
IXMON=1;IYMON=NY/2+1;IZMON=NZ-1;ITABL=1
    GROUP 23. Field print-out and plot control
   **Plot a profile along the line Iy=ny/2
IZPRF=NZNOM/2-1;IZPRL=NZNOM/2+3
NZPRIN=1;NYPRIN=1
    GROUP 24. Dumps for restarts
UWATCH=T;NPLT=1;TSTSWP=-1
IZPRF=1;IZPRL=NZ
NYPRIN=1
IZDB1=NZNOM/2;IZDB2=IZDB1+4
LSWEEP=100