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
REAL(LENGTH,WIDTH,ALFA)
BOOLEAN(ISOTHER)
ALFA  =1.0
LENGTH=2.0
WIDTH =1.0
NX  =10 ; NY  =10
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,NX,1,1,1,1,1,1)
  COVAL(SOUZD,V1,1.,0.0)
   ** Zero normal stress at the free south boundary
PATCH(SOUZN,CELL,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,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(FDSW,SOUTH,1,1,1,1,1,1,1,1)
    VAL=2.*(:ALFA:*TEM-RG(3))$
                -1.5*(U1[+1,,]-U1)/DXU2D[+1,,]
COVAL(FDSW,P1,FIXVAL, grnd)
PATCH(FDSOU,SOUTH,2,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.05)
RELAX(U1,FALSDT,0.009)
RELAX(V1,FALSDT,0.009)
LITER(P1)=2 
NAMSAT=MOSG
 
    GROUP 15. Termination of sweeps
LSWEEP=500
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=451

tstswp=-1
dmpstk=t
DISTIL=T
EX(P1)=2.002E+00; EX(U1)=3.563E-05
EX(V1)=1.533E+00; EX(TEM)=1.000E+00
 LIBREF=451
STOP