```

PHOTON USE
p

gr ou z 1
vec z 1 sh
msg Velocity and displacement vectors
pause
vec cl;red
con u1 z 1 fil;.001
msg X-component displacement contours
pause
con cl;red
con v1 z 1 fil;.001
msg Y-component displacement contours
msg Press E to end
enduse
GROUP 1. Run title and other preliminaries

TEXT(2D Stress in solid, XY plane

DISPLAY
CASE STUDY: Slab on constrained base
ENDDIS

REAL(LENGTH,WIDTH,ALFA)
BOOLEAN(ISOTHER)
INTEGER(SBIX)
ALFA  =1.0
LENGTH=2.0
WIDTH =1.0
NX  =10 ; NY  =10
SBIX=5
ISOTHER=t

GROUP 3. X-direction grid specification
GRDPWR(X,NX,LENGTH,1.0)
GROUP 4. Y-direction grid specification
GRDPWR(Y,NY,WIDTH,1.0)
GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1,TEM)
GROUP 8. Terms (in differential equations) & devices
TERMS(U1,Y,N,Y,Y,Y,Y)
TERMS(V1,Y,N,Y,Y,Y,Y)
terms(tem,n,n,y,p,p,p)
GROUP 9. Properties of the medium (or media)
ENUL=1.
GROUP 11. Initialization of variable or porosity fields
fiinit(tem)=1.
GROUP 13. Boundary conditions and special sources
** Temperature from cold to hot
IF(.NOT.ISOTHER) THEN
PATCH(HOT,NWALL,1,NX,NY,NY,1,1,1,1)
COVAL(HOT,TEM,1.,1.)
PATCH(COLD,SWALL,1,NX,1,1,1,1,1,1)
COVAL(COLD,TEM,1.,0.)
ENDIF

PLANTBEGIN
Stress - in -Solid BC
---------------- WEST ----------------------------
** Zero displacement at the west axis symmetry
PATCH(WESTZD,WWALL,1,1,1,NY,1,1,1,1)
COVAL(WESTZD,U1,1.,0.0)
---------------- EAST ----------------------------
** Zero displacement at the east axis symmetry
PATCH(EASZD,EWALL,NX-1,NX-1,1,NY,1,1,1,1)
COVAL(EASZD,U1,1.,0.0)
---------------- SOUTH ----------------------------
** Zero displacement at the south base
PATCH(SOUZD,SWALL,1,5,1,1,1,1,1,1)
COVAL(SOUZD,V1,1.,0.0)
** Zero normal stress at the free south boundary
PATCH(SOUZN,CELL,5+1,NX,1,1,1,1,1,1)
VAL=V1[,+1,]\$
-0.333*(P1+4.*:ALFA:*TEM)*DYV2D
COVAL(SOUZN,V1,FIXVAL,grnd)
** Zero shear stress at the free south boundary
PATCH(SOUTZS,SOUTH,5+1,NX-1,1,1,1,1,1,1)
VAL=-(V1[+1,,]-V1)/DXG2D
COVAL(SOUTZS,U1,FIXFLU,GRND)
** Fixed dilatation at the south boundary
PATCH(FDSOU,SOUTH,5+1,NX-1,1,1,1,1,1,1)
VAL=2.*:ALFA:*TEM-1.5*(U1-U1[-1,,])/DXU2D
COVAL(FDSOU,P1,FIXVAL, grnd)
PATCH(FDSE,SOUTH,NX,NX,1,1,1,1,1,1)
VAL=2.*:ALFA:*TEM-1.5*(U1[-1,,]-U1[-2,,])/\$
DXU2D[-1,,]
COVAL(FDSE,P1,FIXVAL, grnd)
---------------- NORTH ----------------------------
** Zero normal stress at the free north boundary
PATCH(NORZN,CELL,1,NX,NY-1,NY-1,1,1,1,1)
VAL=V1[,-1,]\$
+0.333*(P1+4.*:ALFA:*TEM)*DYV2D
COVAL(NORZN,V1,FIXVAL,grnd)
** Zero shear stress at the free north boundary
PATCH(NORZS,NORTH,1,NX-1,NY,NY,1,1,1,1)
VAL=-(V1[+1,-1,]-V1[,-1,])/DXG2D
COVAL(NORZS,U1,FIXFLU,GRND)
** Fixed dilatation at the free north boundary
PATCH(FDNW,NORTH,1,1,NY-1,NY,1,1,1,1)
VAL=2.*:ALFA:*TEM-1.5*(U1[+1,,]-U1)/\$
DXU2D[+1,,]
COVAL(FDNW,P1,FIXVAL, grnd)
PATCH(FDNOR,NORTH,2,NX-1,NY-1,NY,1,1,1,1)
VAL=2.*:ALFA:*TEM-1.5*(U1-U1[-1,,])/DXU2D
COVAL(FDNOR,P1,FIXVAL, grnd)
PATCH(FDNEC,NORTH,NX,NX,NY-1,NY,1,1,1,1)
VAL=2.*:ALFA:*TEM-1.5*(U1[-1,,]-U1[-2,,])/\$
DXU2D[-1,,]
COVAL(FDNEC,P1,FIXVAL, grnd)

** Volumetric mass source for dilatation
PATCH(DILAT,VOLUME,1,nx,1,ny,1,1,1,1)
VAL=-P1/3.+8./3.*:ALFA:*TEM
COVAL(DILAT,P1,FIXFLU,GRND)
PLANTEND

RELAX(P1,LINRLX,0.005)
RELAX(U1,FALSDT,0.005)
RELAX(V1,FALSDT,0.005)

NAMSAT=MOSG

GROUP 15. Termination of sweeps
LSWEEP=3000
selref=f
RESREF(P1)=1.E-8
RESREF(U1)=1.E-8;RESREF(V1)=1.E-8
tstswp=-1
GROUP 22. Spot-value print-out
IYMON=NY/2-2;
GROUP 23. Field print-out and plot control
NXPRIN=1;NYPRIN=1
LIBREF=456

tstswp=-1
dmpstk=t
DISTIL=T
EX(P1)=2.001E+00; EX(U1)=1.723E-03
EX(V1)=1.004E+00; EX(TEM)=1.000E+00
LIBREF=456
STOP
```