#$r002
  PHOTON USE
  p;;;;
 
  msg velocity field
  gr ou z 1
  vec z 1 sh
  msg Press RETURN to continue
  pause
  cl
  gr ou z 1
  con tem1 z 1 fil;0.01
  msg temperature distribution
  msg Press RETURN to continue
  pause
  cl
  con c1 z 1 fi;0.01
  msg non-radiating-scalar distribution
  msg Press e to END
  enduse
 
   SQUARE CAVITY WITH MOVING LID with radiation
  DISPLAY
  2-dimensional, Cartesian, steady, elliptic simulation
 
  This case is based on core-library case 249, the square cavity
  with a moving lid. The lid temperature is held at 293 K and the
  base at 273 K. The side walls are adiabatic.
 
  In addition to conduction and convection in the fluid (namely
  air), radiation is supposed to take place from wall to wall.
  For simplicity, each wall is divided in two equal patches. Each
  side-wall patch takes up a temperature which corresponds to a
  zero net heat flux.
 
  To enable the effect of radiation on the temperature distribution
  to be clearly seen,
  (1) the moving-lid velocity is set to zero, so that the
  temperature distribution must be symmetrical; and
  (2) the scalar variable C1 is solved, the properties and boundary
  conditions being the same as for TEM1, excapt that, of course, its
  values are uninfluenced by radiation.
  ENDDIS
 
  filename icb2.q1 ish/snd/dbs 12.12.91 + fgm 20.07.93
    GROUP 1. Run title and other preliminaries
TEXT(SQUARE CAV. WITH MOVING LID + RADI:R120
TITLE
mesg(PC486/50 time last reported as appx. 30.sec
    GROUP 3. X-direction grid specification
GRDPWR(X,-10,0.1,2.0)
    GROUP 4. Y-direction grid specification
  ** Set a symmetrical grid as in GROUP 3.
GRDPWR(Y,-10,0.1,2.0)
    GROUP 5. Z-direction grid specification
ZWLAST=XULAST
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1,TEM1,C1);STORE(PRPS)
    GROUP 8. Terms (in differential equations) & devices
TERMS(TEM1,N,P,P,P,P,P)
    GROUP 9. Properties of the medium (or media)
;;;PRNDTL(C1)=0.7
    GROUP 11. Initialization of variable or porosity fields
FIINIT(TEM1)=283.;FIINIT(PRPS)=0.;FIINIT(C1)=283.0
    GROUP 13. Boundary conditions and special sources
  ** South wall, at rest
WALL (SOUTH,SOUTH,1,NX,1,1,1,1,1,1);COVAL(SOUTH,U1,1.0,0.0)
COVAL(SOUTH,TEM1,1.0,273.0);COVAL(SOUTH,C1,1.0,273.0)
  ** North wall, moving
WALL (MOVING,NORTH,1,NX,NY,NY,1,1,1,1);COVAL(MOVING,U1,1.0,0.0)
COVAL(MOVING,TEM1,1.0,293.0);COVAL(MOVING,C1,1.0,293.0)
  ** West wall, at rest
WALL (WEST1,WEST,1,1,1,NY,1,1,1,1);COVAL(WEST1,V1,1.0,0.0)
  ** East wall, at rest
WALL (EAST5,EAST,NX,NX,1,NY,1,1,1,1);COVAL(EAST5,V1,1.0,0.0)
  ** Radiation patches
BOOLEAN(LRAD) ; LRAD=T
  CHAR(ANS)
  MESG( RADIATION ACTIVE?
  READVDU(ANS,CHAR,Y)
  IF(:ANS:.NE.Y) THEN
  +  LRAD=F
  ENDIF
IF(LRAD) THEN
+ PATCH(@RI001,WEST , 1, 1, 1,NY/2, 1, 1, 1, 1)
+ COVAL(@RI001,TEM1,GRND1,0.0)
 
+ PATCH(@RI002,WEST , 1, 1,NY/2+1,NY, 1, 1, 1, 1)
+ COVAL(@RI002,TEM1,GRND1,0.0)
 
+ PATCH(@RI003,NORTH, 1,NX/2,NY,NY, 1, 1, 1, 1)
+ COVAL(@RI003,TEM1,0.0,293.)
 
+ PATCH(@RI004,NORTH,NX/2+1,NX,NY,NY, 1, 1, 1, 1)
+ COVAL(@RI004,TEM1,0.0,293.)
 
+ PATCH(@RI005,EAST ,NX,NX,NY/2+1,NY, 1, 1, 1, 1)
+ COVAL(@RI005,TEM1,GRND1,0.0)
 
+ PATCH(@RI006,EAST ,NX,NX, 1,NY/2, 1, 1, 1, 1)
+ COVAL(@RI006,TEM1,GRND1,0.0)
 
+ PATCH(@RI007,SOUTH,NX/2+1,NX, 1, 1, 1, 1, 1, 1)
+ COVAL(@RI007,TEM1,0.0,273.)
 
+ PATCH(@RI008,SOUTH, 1,NX/2, 1, 1, 1, 1, 1, 1)
+ COVAL(@RI008,TEM1,0.0,273.)
ENDIF
  ** Pressure relief
PATCH(RELIEF,CELL,NX/2,NX/2,NY/2,NY/2,1,1,1,1)
COVAL(RELIEF,P1,FIXP,0.0)
COVAL(RELIEF,TEM1,ONLYMS,SAME);COVAL(RELIEF,C1,ONLYMS,SAME)
    GROUP 15. Termination of sweeps
LSWEEP=100;SELREF=T; RESFAC=1.E-2
LITER(TEM1)=20 ; LITER(C1)=20
    GROUP 17. Under-relaxation devices
RELAX(U1,FALSDT,0.001);RELAX(V1,FALSDT,0.001)
    GROUP 19. Data communicated by satellite to GROUND
INTEGER(NTZ)
  ** Next 3 lines to activate  GXS2SR
IF(LRAD) THEN
S2SR=T
  + NTZ=8
  + NAMGRD=GXSR
  + NFUSER=NTZ*17+4+NX*NY*NZ+NTZ*NTZ
ENDIF
    GROUP 21. Print-out of variables
OUTPUT(PRPS,N,N,N,N,N,N)
    GROUP 22. Spot-value print-out
IXMON=NX/2;IYMON=NY
    GROUP 23. Field print-out and plot control
PATCH(MIDX,PROFIL,NX/2,NX/2,1,NY,1,1,1,1)
PLOT(MIDX,U1,-1.0,1.0);PLOT(MIDX,TEM1,0.0,1.0)
PATCH(MAP,CONTUR,1,NX,1,NY,1,1,1,1)
PLOT(MAP,TEM1,0.0,10);PLOT(MAP,C1,0.0,10)
 
TSTSWP=-1;itabl=1
  NXPRIN=1;NYPRIN=1
spedat(set,cvd,radcvd,l,t)
LIBREF=120