```
TALK=T;RUN(1,1)
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
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
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 1. Run Title and Number
************************************************************
************************************************************

TEXT(WALL DISTANCE CALCULATOR:147            )

************************************************************
************************************************************

IRUNN = 1 ;LIBREF = 147
************************************************************
Group 2. Time dependence
************************************************************
Group 3. X-Direction Grid Spacing
CARTES = T
NX = 20
XULAST =1.
XFRAC(1)=0.05 ;XFRAC(2)=0.1
XFRAC(3)=0.15 ;XFRAC(4)=0.2
XFRAC(5)=0.25 ;XFRAC(6)=0.3
XFRAC(7)=0.35 ;XFRAC(8)=0.4
XFRAC(9)=0.45 ;XFRAC(10)=0.5
XFRAC(11)=0.55 ;XFRAC(12)=0.6
XFRAC(13)=0.65 ;XFRAC(14)=0.7
XFRAC(15)=0.75 ;XFRAC(16)=0.8
XFRAC(17)=0.85 ;XFRAC(18)=0.9
XFRAC(19)=0.95 ;XFRAC(20)=1.
************************************************************
Group 4. Y-Direction Grid Spacing
NY = 25
YVLAST =1.
YFRAC(1)=0.04 ;YFRAC(2)=0.08
YFRAC(3)=0.12 ;YFRAC(4)=0.16
YFRAC(5)=0.2 ;YFRAC(6)=0.24
YFRAC(7)=0.28 ;YFRAC(8)=0.32
YFRAC(9)=0.36 ;YFRAC(10)=0.4
YFRAC(11)=0.44 ;YFRAC(12)=0.48
YFRAC(13)=0.52 ;YFRAC(14)=0.56
YFRAC(15)=0.6 ;YFRAC(16)=0.64
YFRAC(17)=0.68 ;YFRAC(18)=0.72
YFRAC(19)=0.76 ;YFRAC(20)=0.8
YFRAC(21)=0.84 ;YFRAC(22)=0.88
YFRAC(23)=0.92 ;YFRAC(24)=0.96
YFRAC(25)=1.
************************************************************
Group 5. Z-Direction Grid Spacing
PARAB = F
NZ = 1
ZWLAST =1.
ZFRAC(1)=1.
************************************************************
Group 6. Body-Fitted Coordinates
************************************************************
Group 7. Variables: STOREd,SOLVEd,NAMEd
ONEPHS = T
NAME(145)=DIST ;NAME(146)=DLDY
NAME(147)=DLDX ;NAME(148)=EPOR
NAME(149)=NPOR ;NAME(150)=LTSL
* Y in SOLUTN argument list denotes:
* 1-stored 2-solved 3-whole-field
* 4-point-by-point 5-explicit 6-harmonic averaging
SOLUTN(DIST,Y,N,N,N,N,Y)
SOLUTN(DLDY,Y,N,N,N,N,Y)
SOLUTN(DLDX,Y,N,N,N,N,Y)
SOLUTN(EPOR,Y,N,N,N,N,N)
SOLUTN(NPOR,Y,N,N,N,N,N)
SOLUTN(LTSL,Y,Y,Y,N,N,N)
EPOR = 148 ;HPOR = 0 ;NPOR = 149 ;VPOR = 0
************************************************************
Group 8. Terms & Devices
* Y in TERMS argument list denotes:
* 1-built-in source 2-convection 3-diffusion 4-transient
* 5-first phase variable 6-interphase transport
TERMS(LTSL,N,N,Y,N,Y,N)
DIFCUT =0.5 ;ZDIFAC =1.
GALA = F ;ADDDIF = F
ISOLX = -1 ;ISOLY = -1 ;ISOLZ = -1
************************************************************
Group 9. Properties used if PRPS is not
stored, and where PRPS = -1.0 if it is!
RHO1 =1. ;TMP1 =0.
EL1 =0.
TSURR =0. ;TEMP0 =0.
PRESS0 =0.
DVO1DT =0. ;DRH1DP =0.
EMISS =0. ;SCATT =0.
ENUL =1. ;ENUT =0.
PRNDTL(LTSL)=1.
PRT(LTSL)=1.
CP1 =1. ;CP2 =1.
************************************************************
Group 10.Inter-Phase Transfer Processes
************************************************************
Group 11.Initial field variables (PHIs)
FIINIT(DIST)=1.0E-10 ;FIINIT(DLDY)=1.0E-10
FIINIT(DLDX)=1.0E-10 ;FIINIT(EPOR)=1.
FIINIT(NPOR)=1. ;FIINIT(LTSL)=1.0E-10

PATCH(CMP0 ,INIVAL, 1, 5, 5, 5, 1, 1, 1, 1)
INIT(CMP0 ,NPOR,0. ,0. )

PATCH(CMP1 ,INIVAL, 5, 5, 6, 20, 1, 1, 1, 1)
INIT(CMP1 ,EPOR,0. ,0. )

PATCH(CMP2 ,INIVAL, 6, 15, 20, 20, 1, 1, 1, 1)
INIT(CMP2 ,NPOR,0. ,0. )

PATCH(CMP3 ,INIVAL, 15, 15, 6, 20, 1, 1, 1, 1)
INIT(CMP3 ,EPOR,0. ,0. )

PATCH(CMP4 ,INIVAL, 10, 10, 1, 15, 1, 1, 1, 1)
INIT(CMP4 ,EPOR,0. ,0. )
FSWEEP = 1
NAMFI =CHAM
************************************************************
Group 12. Patchwise adjustment of terms
Patches for this group are printed with those
for Group 13.
Their names begin either with GP12 or &
************************************************************
Group 13. Boundary & Special Sources

PATCH(LEFT ,WWALL , 1, 1, 11, 25, 1, 1, 1, 1)
COVAL(LEFT ,LTSL,1. ,0. )

PATCH(TOP ,NWALL , 1, 20, 25, 25, 1, 1, 1, 1)
COVAL(TOP ,LTSL,1. ,0. )

PATCH(RIGHT ,EWALL , 20, 20, 1, 25, 1, 1, 1, 1)
COVAL(RIGHT ,LTSL,1. ,0. )

PATCH(FLOOR ,SWALL , 1, 20, 1, 1, 1, 1, 1, 1)
COVAL(FLOOR ,LTSL,1. ,0. )

PATCH(P1S ,SWALL , 1, 5, 6, 6, 1, 1, 1, 1)
COVAL(P1S ,LTSL,1. ,0. )

PATCH(P1N ,NWALL , 1, 5, 5, 5, 1, 1, 1, 1)
COVAL(P1N ,LTSL,1. ,0. )

PATCH(P2E ,EWALL , 5, 5, 6, 20, 1, 1, 1, 1)
COVAL(P2E ,LTSL,1. ,0. )

PATCH(P2W ,WWALL , 6, 6, 6, 20, 1, 1, 1, 1)
COVAL(P2W ,LTSL,1. ,0. )

PATCH(P3N ,NWALL , 6, 15, 20, 20, 1, 1, 1, 1)
COVAL(P3N ,LTSL,1. ,0. )

PATCH(P3S ,SWALL , 6, 15, 21, 21, 1, 1, 1, 1)
COVAL(P3S ,LTSL,1. ,0. )

PATCH(P4W ,WWALL , 16, 16, 6, 20, 1, 1, 1, 1)
COVAL(P4W ,LTSL,1. ,0. )

PATCH(P4E ,EWALL , 15, 15, 6, 20, 1, 1, 1, 1)
COVAL(P4E ,LTSL,1. ,0. )

PATCH(P5E ,EWALL , 10, 10, 1, 15, 1, 1, 1, 1)
COVAL(P5E ,LTSL,1. ,0. )

PATCH(P5W ,WWALL , 11, 11, 1, 15, 1, 1, 1, 1)
COVAL(P5W ,LTSL,1. ,0. )

PATCH(SORC ,VOLUME, 1, 20, 1, 25, 1, 1, 1, 1)
COVAL(SORC ,LTSL, FIXFLU ,1. )
XCYCLE = F
EGWF = T
WALLCO = GRND2
************************************************************
Group 14. Downstream Pressure For PARAB
************************************************************
Group 15. Terminate Sweeps
LSWEEP = 15 ;ISWC1 = 1
LITHYD = 1 ;LITFLX = 1 ;LITC = 1 ;ITHC1 = 1
SELREF = T
RESFAC =1.0E-04
************************************************************
Group 16. Terminate Iterations
LITER(LTSL)=1
ENDIT(LTSL)=1.0E-06
************************************************************
Group 17. Relaxation
RELAX(DIST,LINRLX,1.)
RELAX(DLDY,LINRLX,1.)
RELAX(DLDX,LINRLX,1.)
RELAX(LTSL,FALSDT,1.0E+09)
OVRRLX =0.
EXPERT = F ;NNORSL = F
************************************************************
Group 18. Limits
VARMAX(DIST)=1.0E+10 ;VARMIN(DIST)=-1.0E+10
VARMAX(DLDY)=1.0E+10 ;VARMIN(DLDY)=-1.0E+10
VARMAX(DLDX)=1.0E+10 ;VARMIN(DLDX)=-1.0E+10
VARMAX(EPOR)=1.0E+10 ;VARMIN(EPOR)=-1.0E+10
VARMAX(NPOR)=1.0E+10 ;VARMIN(NPOR)=-1.0E+10
VARMAX(LTSL)=1.0E+10 ;VARMIN(LTSL)=-1.0E+10
************************************************************
Group 19. Data transmitted to GROUND
NAMSAT =MOSG
PARSOL = F
ISG62 = 1
************************************************************
Group 20. Preliminary Printout
DISTIL = T ;NULLPR = F
NDST = 0
DSTTOL =1.0E-02
EX(DIST)=0.06649 ;EX(DLDY)=0.02199
EX(DLDX)=0.03455 ;EX(EPOR)=0.91
EX(NPOR)=0.97 ;EX(LTSL)=5.424E-03
************************************************************
Group 21. Print-out of Variables
INIFLD = F ;SUBWGR = F
* Y in OUTPUT argument list denotes:
* 1-field 2-correction-eq. monitor 3-selective dumping
* 4-whole-field residual 5-spot-value table 6-residual table
OUTPUT(DIST,Y,N,Y,N,N,N)
OUTPUT(DLDY,Y,N,Y,N,N,N)
OUTPUT(DLDX,Y,N,Y,N,N,N)
OUTPUT(EPOR,Y,N,Y,N,N,N)
OUTPUT(NPOR,Y,N,Y,N,N,N)
OUTPUT(LTSL,Y,Y,Y,Y,Y,Y)
************************************************************
Group 22. Monitor Print-Out
IXMON = 10 ;IYMON = 10 ;IZMON = 1
NPRMON = 100000 ;NPRMNT = 1 ;TSTSWP = -1
UWATCH = T ;USTEER = T
HIGHLO = F
************************************************************
Group 23.Field Print-Out & Plot Control
NPRINT = 100000 ;NUMCLS = 5
NXPRIN = -1 ;IXPRF = 1 ;IXPRL = 10000
NYPRIN = -1 ;IYPRF = 1 ;IYPRL = 10000
IPLTF = 1 ;IPLTL = -1 ;NPLT = -1
ISWPRF = 1 ;ISWPRL = 100000
ITABL = 3 ;IPROF = 1
ABSIZ =0.5 ;ORSIZ =0.4
NTZPRF = 1 ;NCOLPF = 50
ICHR = 2 ;NCOLCO = 45 ;NROWCO = 20
No PATCHes yet used for this Group
************************************************************
Group 24. Dumps For Restarts
SAVE = T ;NOWIPE = F
NSAVE =CHAM
STOP
```