TALK=f;RUN(1,1)
DISPLAY

A cubical solid with a numerical grid of nx=1, ny=1, nz=1,
is heated to 100 degrees above its initial temperature,
under four different conditions of constraint, viz:
1. it can expand freely in all directions
2. its high-z and low-z ends are fixed, but it can expand
freely in the x- and y-directions
3. its high-z and low-z ends are fixed, but it can expand
freely in the x-direction only.
4. it is prevented from expanding in the x-, y- and z directions.

The textbook values for the stresses and strains are computed
and printed, for comparison with thuse resulting from the solution
for w1.

ENDDIS
************************************************************
Group 1. Run Title and Number
************************************************************

TEXT(THERMal stress in a cube
integer(caseno)
caseno = 1        !     all directions free
caseno = 2        !     z ends held, x & y free
caseno = 3        !     z ends held, x free but not y
caseno = 4        !     all movement prevented
real(apptem)
boolean(direct)
apptem=100
direct=t
************************************************************
Group 2. Time dependence
************************************************************
Group 3. X-Direction Grid Spacing
CARTES  =    t
CARTES  =    f
NX      =         1
************************************************************
Group 4. Y-Direction Grid Spacing
NY      = 1
************************************************************
Group 5. Z-Direction Grid Spacing
NZ      =         10
ZWLAST  = 1.0*(NZ+2)
************************************************************
#UNIGRID
Group 7. Variables: STOREd,SOLVEd,NAMEd
ONEPHS  =    T
SOLVE(P1,w1,TEM1)
STORE(PRPS,DEN1,ENUL,DVO1,DRH1)
STORE(PTH)
STORE(STRX,SXTH)
STORE(STRY,SYTH)
STORE(STRZ,SZTH)
STORE(EPSX,EXTH)
STORE(EPSY,EYTH)
STORE(EPSZ,EZTH)
STORE(EPST,ETTH)
GROUP8. ITERATION NUMBERS ETC
RESREF(W1)=0.0
************************************************************
GROUP 9. PROPERTIES
CSG10='Q1'
MATFLG=T;NMAT=1
160    7800.0    0.3       473.0   43.0    1.e-5   0.5E-11
************************************************************
GROUP 11. INITIAL VALUES
FIINIT(PRPS)=0
fiinit(p1)=0.0
fiinit(u1)=0.0
fiinit(v1)=0.0
fiinit(w1)=0.0
fiinit(exth)=-1.234e-11  ! to print as none
fiinit(eyth)=-1.234e-11  ! to print as none
fiinit(ezth)=-1.234e-11  ! to print as none
fiinit(sxth)=-1.234e-11  ! to print as none
fiinit(syth)=-1.234e-11  ! to print as none
fiinit(szth)=-1.234e-11  ! to print as none
fiinit(epst)=-1.234e-11  ! to print as none
fiinit(etth)=-1.234e-11  ! to print as none
PATCH(block,INIVAL,1,1,1,1,2,nz-1,1,1)
INIT (block,PRPS,FIXVAL,160)

************************************************************
GROUP 13. BOUNDARY & SPECIAL SOURCES

PATCH(low,high,1,1,1,1,1,1,1,1)
COVAL(low,w1,fixval, 0.0)

if(caseno.gt.1) then
patch(high,high,1,1,1,1,nz-1,nz-1,1,1)
coval(high,w1,fixval, 0.0)

endif
patch(tblock,volume,1,1,1,1,2,nz-1,1,1)
coval(tblock,tem1,fixval,apptem)

************************************************************
GROUP 15. TERMINATE SWEEPS
LSWEEP  =       200
ISG21=LSWEEP
************************************************************
GROUP 17. RELAXATION
#CONPROM
************************************************************
GROUP 19. DATA TRANSMITTED TO GROUND
STRA    =    T

************************************************************
GROUP 23.FIELD PRINT-OUT & PLOT CONTROL
NYPRIN=1
TSTSWP=-1
#MAXABS
#ENDPAUSE
REAL(YOUNG, POISSON,PTH,ETTH,EXTH,EYTH,EZTH,SXTH,SYTH,SZTH,ALPHA)
POISSON = 0.3          ! must conform with matflg value
ALPHA   = 1.e-5          ! must conform with matflg value
YOUNG   = 1/(0.5E-11)  ! must conform with matflg value

if(caseno.eq.1) then
etth=apptem*alpha
exth=etth
eyth=etth
ezth=etth
sxth=0.0
syth=0.0
szth=0.0
endif

if(caseno.eq.2) then
etth=apptem*alpha
ezth=0
exth=etth*(1+poisson)
eyth=exth
szth=-etth*young
sxth=0.0
syth=0.0
endif

if(caseno.eq.3) then
etth=apptem*alpha
ezth=0
eyth=0
exth=etth*(1+poisson)/(1-poisson)
szth=-etth*young/(1-poisson)
syth=szth
sxth=0.0
endif

if(caseno.eq.4) then
etth=apptem*alpha
exth=0
eyth=0
ezth=0
sxth=-etth*young/(1-2*poisson)
syth=sxth
szth=sxth
endif

pth=exth+eyth+ezth

(STORED VAR SxTH IS :SXTH: WITH IMAT>100)
(STORED VAR SYTH IS :SYTH: WITH IMAT>100)
(STORED VAR SZTH IS :SZTH: WITH IMAT>100)
(STORED VAR EXTH IS :EXTH: WITH IMAT>100)
(STORED VAR EYTH IS :EYTH: WITH IMAT>100)
(STORED VAR EZTH IS :EZTH: WITH IMAT>100)
(STORED VAR ETTH IS :ETTH: WITH IMAT>100)

(STORED VAR PTH IS :PTH:)

SPEDAT(RLXFAC,RLXU1D,R,1.0)
IF(CASENO.EQ.3) THEN
SPEDAT(BOUNDARY,YCONST,R,1.E20)
ENDIF
IF(CASENO.EQ.4) THEN
SPEDAT(BOUNDARY,XCONST,R,1.E20)
SPEDAT(BOUNDARY,YCONST,R,1.E20)
ENDIF

STOP