PHOTON USE
  P
 
 
 
  gr x 11 11 y 1 15
  gr y 6 6 x 1 5; gr x 6 6 y 6 20
  gr y 21 21 x 6 15; gr x 16 16 y 6 20
  gr x 1 1 y 11 25;gr ou y 1 1 x 1 20
  gr y 26 26 x 1 20;gr x 21 21 y 1 25
  msg        labyrinth geometry
  msg Press Enter to continue
  pause;red
  CON DIST Z 1 fil;.003
  msg               Distance from the nearest wall
  gr x 11 11 y 1 15 col 7
  gr y 6 6 x 1 5 col 7; gr x 6 6 y 6 20 col 7
  gr y 21 21 x 6 15 col 7; gr x 16 16 y 6 20 col 7
  gr x 1 1 y 11 25 col 7;gr ou y 1 1 x 1 20 col 7
  gr y 26 26 x 1 20 col 7;gr x 21 21 y 1 25 col 7
  ENDUSE
   *  GROUP 1. Run title and other preliminaries.
TEXT(WALL DISTANCE CALCULATOR:147
 
  DISPLAY
   This case illustrates how to use PLANT to introduce the new wall
   distance calculator for the  labyrinth  geometry.  The  solution
   procedure  deduces  DIST  (the required quantity) by solving
   div grad L = -1 , with L fixed to zero in solid walls.
  ENDDIS
 
   *  GROUP 3. X-direction grid specification.
NX=20
SUBGRD(X,1,5, 2.500E-01, 1.000E+00)
INTEGER(NXF01,NXL01); NXF01=1; NXL01=5
SUBGRD(X,6,10, 2.500E-01, 1.000E+00)
INTEGER(NXF02,NXL02); NXF02=6; NXL02=10
SUBGRD(X,11,15, 2.500E-01, 1.000E+00)
INTEGER(NXF03,NXL03); NXF03=11; NXL03=15
SUBGRD(X,16,20, 2.500E-01, 1.000E+00)
INTEGER(NXF04,NXL04); NXF04=16; NXL04=20
   *  GROUP 4. Y-direction grid specification.
NY=25
SUBGRD(Y,1,5, 2.000E-01, 1.000E+00)
INTEGER(NYF01,NYL01); NYF01=1; NYL01=5
SUBGRD(Y,6,10, 2.000E-01, 1.000E+00)
INTEGER(NYF02,NYL02); NYF02=6; NYL02=10
SUBGRD(Y,11,15, 2.000E-01, 1.000E+00)
INTEGER(NYF03,NYL03); NYF03=11; NYL03=15
SUBGRD(Y,16,20, 2.000E-01, 1.000E+00)
INTEGER(NYF04,NYL04); NYF04=16; NYL04=20
SUBGRD(Y,21,25, 2.000E-01, 1.000E+00)
INTEGER(NYF05,NYL05); NYF05=21; NYL05=25
   *  GROUP 7. Variables stored, solved & named.
SOLVE(LTSL);SOLUTN(LTSL,Y,Y,Y,N,N,N)
   *  GROUP 8. Terms (in differential equations) & devices.
TERMS(LTSL,N,N,Y,N,Y,N)
   *  GROUP 9. Properties of the medium (or media).
RHO1= 1.;ENUL=1.;PRNDTL(LTSL)=1.
   *  GROUP 11. Initialization of variable or porosity fields.
CONPOR(0.0,SOUTH,NXF01,NXL01,NYF02,NYF02,1,1)
CONPOR(0.0,EAST,NXL01,NXL01,NYF02,NYL04,1,1)
CONPOR(0.0,NORTH,NXF02,NXL03,NYL04,NYL04,1,1)
CONPOR(0.0,WEST,NXF04,NXF04,NYF02,NYL04,1,1)
CONPOR(0.0,EAST,NXL02,NXL02,NYF01,NYL03,1,1)
   *  GROUP 13
PATCH(LEFT,WWALL,NXF01,NXF01,NYF03,NYL05,1,1,1,1)
COVAL(LEFT,LTSL,1./PRNDTL(LTSL), 0.000E+00)
   *  WALL Boundary Condition, Named TOP
PATCH(TOP,NWALL,NXF01,NXL04,NYL05,NYL05,1,1,1,1)
COVAL(TOP,LTSL,1./PRNDTL(LTSL), 0.000E+00)
   *  WALL Boundary Condition, Named RIGHT
PATCH(RIGHT,EWALL,NXL04,NXL04,NYF01,NYL05,1,1,1,1)
COVAL(RIGHT,LTSL,1./PRNDTL(LTSL), 0.000E+00)
   *  WALL Boundary Condition, Named FLOOR
PATCH(FLOOR,SWALL,NXF01,NXL04,NYF01,NYF01,1,1,1,1)
COVAL(FLOOR,LTSL,1./PRNDTL(LTSL), 0.000E+00)
   *  PLATE Boundary Condition, Named P1
PATCH(P1S,SWALL,NXF01,NXL01,NYF02,NYF02,1,1,1,1)
COVAL(P1S,LTSL,1./PRNDTL(LTSL), 0.000E+00)
PATCH(P1N,NWALL,NXF01,NXL01,NYL01,NYL01,1,1,1,1)
COVAL(P1N,LTSL,1./PRNDTL(LTSL), 0.000E+00)
   *  PLATE Boundary Condition, Named P2
PATCH(P2E,EWALL,NXL01,NXL01,NYF02,NYL04,1,1,1,1)
COVAL(P2E,LTSL,1./PRNDTL(LTSL), 0.000E+00)
PATCH(P2W,WWALL,NXF02,NXF02,NYF02,NYL04,1,1,1,1)
COVAL(P2W,LTSL,1./PRNDTL(LTSL), 0.000E+00)
   *  PLATE Boundary Condition, Named P3
PATCH(P3N,NWALL,NXF02,NXL03,NYL04,NYL04,1,1,1,1)
COVAL(P3N,LTSL,1./PRNDTL(LTSL), 0.000E+00)
PATCH(P3S,SWALL,NXF02,NXL03,NYF05,NYF05,1,1,1,1)
COVAL(P3S,LTSL,1./PRNDTL(LTSL), 0.000E+00)
   *  PLATE Boundary Condition, Named P4
PATCH(P4W,WWALL,NXF04,NXF04,NYF02,NYL04,1,1,1,1)
COVAL(P4W,LTSL,1./PRNDTL(LTSL), 0.000E+00)
PATCH(P4E,EWALL,NXL03,NXL03,NYF02,NYL04,1,1,1,1)
COVAL(P4E,LTSL,1./PRNDTL(LTSL), 0.000E+00)
   *  PLATE Boundary Condition, Named P5
PATCH(P5E,EWALL,NXL02,NXL02,NYF01,NYL03,1,1,1,1)
COVAL(P5E,LTSL,1./PRNDTL(LTSL), 0.000E+00)
PATCH(P5W,WWALL,NXF03,NXF03,NYF01,NYL03,1,1,1,1)
COVAL(P5W,LTSL,1./PRNDTL(LTSL), 0.000E+00)
   *  HEAT SOURCE Boundary Condition, Named SORC
PATCH(SORC,VOLUME,NXF01,NXL04,NYF01,NYL05,1,1,1,1)
COVAL(SORC,LTSL,FIXFLU, 1.000E+00)
   *  Number of Iterative Sweeps (Outer Iterations)
LSWEEP=15
   *  Reference Residual for the ENTHALPY
RESREF(LTSL)= 1.000E-06
   *  GROUP 16. Termination of iterations.
LITER(LTSL)=1; ENDIT(LTSL)= 1.000E-06
   *  Deactivate Print-Out of Satellite Data.
NAMSAT=MOSG
    GROUP 21. Print-out of variables
STORE(DLDX,DLDY,DIST)
     ** Calculate distance to the nearest wall
         DIST = sqrt((grad L)**2 + 2.*L) - grad L
     PLANTBEGIN 
   DLDX=(EAST(LTSL)-WEST(LTSL))/(2.*DXG2D)
   REGION(7,9,6,15,1,1)
   DLDX=(EAST(LTSL)-WEST(LTSL))/(2.*DXG2D)
   REGION(7,14,16,20,1,1)
   DLDX=(EAST(LTSL)-WEST(LTSL))/(2.*DXG2D)
   REGION(12,14,6,15,1,1)
   DLDX=(EAST(LTSL)-LTSL)/DXG2D
   REGION(6,6,6,20,1,1)
   DLDX=(LTSL-WEST(LTSL))/DXG2D
   REGION(10,10,6,15,1,1)
   DLDX=(EAST(LTSL)-LTSL)/DXG2D
   REGION(11,11,6,15,1,1)
   DLDX=(LTSL-WEST(LTSL))/DXG2D
   REGION(15,15,6,20,1,1)
   DLDX=(EAST(LTSL)-WEST(LTSL))/(2.*DXG2D)
   REGION(2,9,1,5,1,1)
   DLDX=(EAST(LTSL)-WEST(LTSL))/(2.*DXG2D)
   REGION(12,19,1,5,1,1)
 
   DLDX=(EAST(LTSL)-LTSL)/DXG2D
   REGION(1,1,1,5,1,1)
   DLDX=(LTSL-WEST(LTSL))/DXG2D
   REGION(10,10,1,5,1,1)
   DLDX=(EAST(LTSL)-LTSL)/DXG2D
   REGION(11,11,1,5,1,1)
   DLDX=(LTSL-WEST(LTSL))/DXG2D
   REGION(20,20,1,5,1,1)
 
   DLDX=(EAST(LTSL)-WEST(LTSL))/(2.*DXG2D)
   REGION(2,4,6,20,1,1)
   DLDX=(EAST(LTSL)-WEST(LTSL))/(2.*DXG2D)
   REGION(17,19,6,20,1,1)
   DLDX=(EAST(LTSL)-LTSL)/DXG2D
   REGION(1,1,6,20,1,1)
   DLDX=(LTSL-WEST(LTSL))/DXG2D
   REGION(5,5,6,20,1,1)
   DLDX=(EAST(LTSL)-LTSL)/DXG2D
   REGION(16,16,6,20,1,1)
   DLDX=(LTSL-WEST(LTSL))/DXG2D
   REGION(20,20,6,20,1,1)
 
   DLDX=(EAST(LTSL)-WEST(LTSL))/(2.*DXG2D)
   REGION(2,19,21,25,1,1)
   DLDX=(EAST(LTSL)-LTSL)/DXG2D
   REGION(1,1,21,25,1,1)
   DLDX=(LTSL-WEST(LTSL))/DXG2D
   REGION(20,20,21,25,1,1)
 
   DLDY=(NORTH(LTSL)-SOUTH(LTSL))/(2.*DYG2D)
   REGION(6,15,2,19,1,1)
   DLDY=(NORTH(LTSL)-LTSL)/DYG2D
   REGION(6,15,1,1,1,1)
   DLDY=(LTSL-SOUTH(LTSL))/DYG2D
   REGION(6,15,20,20,1,1)
   DLDY=(NORTH(LTSL)-SOUTH(LTSL))/(2.*DYG2D)
   REGION(1,5,2,24,1,1)
   DLDY=(NORTH(LTSL)-SOUTH(LTSL))/(2.*DYG2D)
   REGION(16,20,2,24,1,1)
   DLDY=(NORTH(LTSL)-LTSL)/DYG2D
   REGION(1,5,1,1,1,1)
   DLDY=(LTSL-SOUTH(LTSL))/DYG2D
   REGION(1,5,25,25,1,1)
   DLDY=(NORTH(LTSL)-LTSL)/DYG2D
   REGION(16,20,1,1,1,1)
   DLDY=(LTSL-SOUTH(LTSL))/DYG2D
   REGION(16,20,25,25,1,1)
   DLDY=(NORTH(LTSL)-SOUTH(LTSL))/(2.*DYG2D)
   REGION(6,15,22,24,1,1)
   DLDY=(NORTH(LTSL)-LTSL)/DYG2D
   REGION(6,15,21,21,1,1)
   DLDY=(LTSL-SOUTH(LTSL))/DYG2D
   REGION(6,15,25,25,1,1)
 
   DIST=SQRT(DLDX**2+DLDY**2+2.*LTSL)-$
   SQRT((DLDX**2+DLDY**2))
   REGION(1,20,1,25,1,1)
    PLANTEND
 
   *  GROUP 21. Print-out of variables.
OUTPUT(LTSL,Y,Y,Y,Y,Y,Y)
   *  X-Direction Index of Spot-Value
IXMON=10
   *  Y-Direction Index of Spot-Value
IYMON=10

tstswp=-1
dmpstk=t
DISTIL=T
EX(DIST)=6.649E-02; EX(DLDY)=2.199E-02; EX(DLDX)=3.455E-02
EX(EPOR)=9.100E-01; EX(NPOR)=9.700E-01; EX(LTSL)=5.424E-03
 LIBREF=147
STOP