TALK=F;RUN(1,1)

  photon use
  p
 
 
 
  gr x 1
  msg Press RETURN to continue
  pause
  msg temperature contours in solid and fluid
  con tem1 x 1 fi;0.05
  msg Press RETURN to continue
  pause
  msg outline of solid
  set property off
  con prps x 1;val 1; 100
  msg displacements in solid
  vec x 1 y 1 8 z 7 16 co 2
  msg Press RETURN to continue
  pause
  msg velocity vectors in the fluid
  vec x 1 y 1 m z 1 5  co 1
  vec x 1 y 1 m z 18 m co 1
  vec x 1 9 10 m z 6 17 co 1
  msg Press RETURN to continue
  pause
  con off
  gr off
  red
  gr ou x 1
  msg  axial stress contours
  con strz x 1 y 1 8 z 7 16 fi;0.001
  msg Press RETURN to continue
  pause
  con off
  gr off
  red
  msg vectors only
  con prps x 1;val 1; 2
  msg Press RETURN to continue
  pause
  msg radial strains
  con epsy x 1 y 1 8 z 7 16 fi;0.001
  msg
  msg Press e to END
  ENDUSE
#cls
TEXT(Centre-Heated, Edge-Cooled Block   
TITLE
  DISPLAY
  STRESS ANALYSIS IN SOLIDS - Centre-heated, edge-cooled block
 
  2-dimensional (y-z), cartesian, steady, elliptic simulation
 
 
  The problem simulated is sketched below. Metal block is heated at
  the centre and externally cooled. The centre is maintained at
  1500 K. Cool external gas flows through a porous media. Thermal
  stresses which arise from temperature difference cause metal
  dilatation.
 
                      ext. load
             +----------|---------+
             |          v         -->
             |       +-----+           outflow
    inflow   |     ->| bar |<-     -->               y ^
         -->         |     |                          |
             +--------------------+                   +---->
                                                           z
  ENDDIS
#pause
  STOREd variables are as follows:
  STRX Stress distribution in axial direction
  STRY Stress distribution in radial direction
 
 
REAL(WIN,PI)
REAL(RESCO,TIN)
INTEGER(IYNORT,IZLOW,IZHI)
 
  ** switch for stress & strain post-processing
         CALSTR=T
  ** porous media resistance coeff
RESCO=1.E5
 
WIN=0.01
TIN=300.0
 
  ** grid settings
IYNORT=8;NY=14
IZLOW=7;NZ=20;IZHI=NZ-4
 
    GROUP 1. Run title and other preliminaries
    GROUP 2. Transience; time-step specification
    GROUP 3. X-direction grid specification
XULAST=0.01
GRDPWR(X,NX,XULAST,1.0)
 
    GROUP 4. Y-direction grid specification
NREGY=2;YVLAST=1.0
IREGY=1;GRDPWR(Y,8,0.20,1.0)
IREGY=2;GRDPWR(Y,6,0.30,1.0)
 
    GROUP 5. Z-direction grid specification
NREGZ=3;ZWLAST=1.0
IREGZ=1;GRDPWR(Z,6,0.3,1.0)
IREGZ=2;GRDPWR(Z,10,0.20,1.0)
IREGZ=3;GRDPWR(Z,4,0.2,1.0)
 
    GROUP 7. Variables stored, solved & named
   *  Solve for P1, V1, W1 and TEM1 by whole-field method
SOLVE(P1,V1,W1,TEM1)
SOLUTN(P1,Y,Y,Y,N,N,N)
SOLUTN(V1,Y,Y,Y,P,P,P)
SOLUTN(W1,Y,Y,Y,P,P,P)
SOLUTN(TEM1,Y,Y,Y,N,N,Y)
   *  Store other variables
       STORE(PRPS,DILA,DVO1,DRH1)
STORE(PRPS,DVO1,DRH1)
STORE(EPSY,STRY,EPSZ,STRZ,EPST)
STORE(EPSX)
STRA=T    ! activate calculation of stress and strain in solid
   *    
    GROUP 8. Terms (in differential equations) & devices
TERMS(TEM1,N,Y,Y,Y,Y,Y)
 
    GROUP 9.  Properties of the medium (or media)
  ** set via prps values  
#fluidmat
#solidmat
    GROUP 11. Initialization of fields of variables,
              porosities, etc.
  ** working fluid is air
FIINIT(PRPS)=air20
  ** Initialize Temperature and density (to air density) Field
FIINIT(TEM1)=TIN
  ** Body properties are those of steel
PATCH(BODY,INIVAL,1,NX,1,IYNORT,IZLOW,IZHI,1,1)
INIT(BODY,PRPS,0.0,steel);INIT(BODY,TEM1,0.0,1400.0)
 
    
    GROUP 13. Boundary conditions and special sources
PATCH(INLET,LOW,1,NX,1,IYNORT,1,1,1,LSTEP)
COVAL(INLET,P1,FIXFLU,1.189*WIN)
COVAL(INLET,W1,ONLYMS,WIN)
COVAL(INLET,TEM1,ONLYMS,TIN)
  
  ** outlet boundary condition, name EXIT (at NORTH or HIGH)
PATCH(EXIT,HIGH,1,NX,1,NY,NZ,NZ,1,LSTEP)
COVAL(EXIT,P1,1.0,0.0);COVAL(EXIT,TEM1,ONLYMS,SAME)
  ** porous-medium resistances in parts of domain accessible to
     fluid
PATCH(PORMED1,PHASEM,1,1,1,NY-1,1,IZLOW-1,1,LSTEP)
COVAL(PORMED1,V1,RESCO,0.0)
PATCH(PORMED15,PHASEM,1,1,IYNORT+1,NY-1,IZLOW,IZHI,1,LSTEP)
COVAL(PORMED15,V1,RESCO,0.0)
PATCH(PORMED2,PHASEM,1,1,1,NY-1,IZHI+1,NZ,1,LSTEP)
COVAL(PORMED2,V1,RESCO,0.0)
PATCH(PORMED3,PHASEM,1,1,1,NY,1,IZLOW-2,1,LSTEP)
COVAL(PORMED3,W1,RESCO,0.0)
PATCH(PORMED35,PHASEM,1,1,IYNORT+1,NY,IZLOW-1,NZ,1,LSTEP)
COVAL(PORMED35,W1,RESCO,0.0)
PATCH(PORMED4,PHASEM,1,1,1,IYNORT,IZHI+1,NZ,1,LSTEP)
COVAL(PORMED4,W1,RESCO,0.0)
  ** HEAT-SOURCE boundary condition, name HOT
PATCH(HOT,volume,1,NX,1,1,IZHI,IZHI,1,LSTEP)
COVAL(HOT,TEM1,FIXFLU,1.0)

  ** fix displacement to zero at iy=IYNORT, along larger-z half 
PATCH(FIXV1,NORTH,1,NX,IYNORT,IYNORT,(IZHI+IZLOW)/2+1,IZHI,1,LSTEP)
COVAL(FIXV1,V1,FIXVAL,0.0)

  ** hold w1 to zero at larger-z face of block
PATCH(FIXW1,HIGH,1,NX,1,IYNORT,IZHI,IZHI,1,LSTEP)
COVAL(FIXW1,W1,FIXVAL,0.0)
  ** hold v1 to zero at south boundary by wall patch
PATCH(FIXV2,SWALL,1,NX,1,1,IZLOW,IZHI,1,LSTEP)
COVAL(FIXV2,V1,1.0,0.0)

LSWEEP=1200
 
  ** GROUP 16. Termination criteria for inner iterations.
LITER(P1)=20; LITER(V1)=20; LITER(W1)=20; LITER(TEM1)=20
RESREF(P1)=1.E-20;RESREF(V1)=1.E-20;RESREF(W1)=1.E-20;
RESREF(W1)=1.E-20
ENDIT(P1)=1.E-20;ENDIT(V1)=1.E-20;  ENDIT(W1)=1.E-20
ENDIT(W1)=1.E-20 
SELREF=F
 
  ** GROUP 21. Frequency and extent of field printout.
IYPRL=IYNORT
IZPRF=7 ;IZPRL=16
NPRINT=LSWEEP ; NZPRIN=1 ; NYPRIN=1
  
    GROUP 20. Preliminary print-out
  ** Assign cell-indices of spot-point monitoring location
IXMON=1;IYMON=IYNORT/2;IZMON=(IZLOW+IZHI)/2
  ** GROUP 24. Preparation for continuation runs.
TSTSWP=-1

STOP