PHOTON USE
         p;;;;;;
 
        block;1;13 20 1 15 1 9
        gr ou z 1;gr ou z m;gr ou x 1;gr ou x m
        gr ou x 13 z 1 9;gr ou x m z 1 9;gr ou z 10 x 13 m
        GR OU Z     1 X     1    12 Y     1     8 COL     4
        GR OU X    13 Y     1     8 Z     1     9 COL     5
        GR OU Z    10 X    13    20 Y     1     8 COL     6
        GR OU Z    21 X     1    20 Y     1     8 COL     7
        GR OU Y     9 X     1    20 Z     1    20 COL     8
        GR OU Z     1 X     1    12 Y     9    15 COL     9
        GR OU X    21 Y     9    15 Z    10    20 COL    10
        GR OU X    21 Y     1     8 Z    10    20 COL    11
        vec y 12 sh
        msg Air flow vectors
        pause
        vec cl;red;set vec ref .002
        vec y 3 sh
        msg Glass flow vectors - the glass is very viscous.
        pause
        vec cl;red;set con sca pl
        con tem1 y 3 sh;int 14
        msg Temperature in the glass - Glass enters at 1150K.
        msg Walls and floor are losing heat at 2kW/m**2.
        msg Heat transfer to the air above is by laminar contact.
        pause
        con cl;red
        con tem1 y 12 sh;int 14
        msg Temperature in the air - The walls and roof in the
        msg airspace are adiabatic
        pause
        con cl;red
        con tem1 x m 1 1 8 fi;.001
        msg Glass temperature at exit
        ENDUSE
 IRUNN   =       1 ;LIBREF =       0
 ************************************************************
  Group 1. Run Title
 TEXT(Flow Of Glass In T-shaped Channel
 ************************************************************
  Group 2. Transience
 STEADY  =    T
 ************************************************************
  Groups 3, 4, 5  Grid Information
    * Overall number of cells, RSET(M,NX,NY,NZ,tolerance)
 RSET(M,20,15,20)
    * Overall domain extent, RSET(D,name,XULAST,YVLAST,ZWLAST)
 RSET(D,T,1.250E+00,3.000E-01,2.000E+00)
    * Set objects: name  x0       y0        z0
    *                    dx       dy        dz
 RSET(B,BLOK1   , 7.500E-01, 0.000E+00, 0.000E+00                , $
5.000E-01, 3.000E-01, 9.000E-01)
 RSET(B,GLASS   , 0.000E+00, 0.000E+00, 0.000E+00                , $
1.250E+00, 1.520E-01, 2.000E+00)
 RSET(B,ING     , 0.000E+00, 0.000E+00, 0.000E+00                , $
7.500E-01, 1.520E-01, 0.000E+00)
 RSET(B,INA     , 0.000E+00, 1.520E-01, 0.000E+00                , $
7.500E-01, 1.480E-01, 0.000E+00)
 RSET(B,WALL1   , 7.500E-01, 0.000E+00, 0.000E+00                , $
0.000E+00, 1.520E-01, 9.000E-01)
 RSET(B,WALL2   , 7.500E-01, 0.000E+00, 9.000E-01                , $
5.000E-01, 1.520E-01, 0.000E+00)
 RSET(B,WALL3   , 0.000E+00, 0.000E+00, 2.000E+00                , $
1.250E+00, 1.520E-01, 0.000E+00)
 RSET(B,OUTG    , 1.250E+00, 0.000E+00, 9.000E-01                , $
0.000E+00, 1.520E-01, 1.100E+00)
 RSET(B,OUTA    , 1.250E+00, 1.520E-01, 9.000E-01                , $
0.000E+00, 1.480E-01, 1.100E+00)
 RSET(B,FLOOR   , 0.000E+00, 0.000E+00, 0.000E+00                , $
1.250E+00, 0.000E+00, 2.000E+00)
 ************************************************************
  Group 6. Body-Fitted coordinates
 ************************************************************
  Group 7. Variables: STOREd,SOLVEd,NAMEd
 ONEPHS  =    T
    * Non-default variable names
 NAME(46) =ENUL ; NAME(47) =BLOK
 NAME(48) =PRPS ; NAME(49) =DEN1
 NAME(50) =TEM1
    * Solved variables list
 SOLVE(P1  ,U1  ,V1  ,W1  ,TEM1)
    * Stored variables list
 STORE(DEN1,PRPS,BLOK,ENUL)
 SOLUTN(P1  ,Y,Y,Y,N,N,N)
 SOLUTN(TEM1,Y,Y,Y,N,N,Y)
 IVARBK  =      -1 ;ISOLBK =       1
 ************************************************************
  Group 8. Terms & Devices
 NEWRH1  =    T
 NEWENL  =    T
 ISOLX   =       0 ;ISOLY  =       0 ; ISOLZ  =       0
 ************************************************************
  Group 9. Properties
 RHO1    = FILE
 PRESS0  = 1.000E+05
 TEMP0   = 2.730E+02
 ENUL    = FILE    ; ENUT   = 0.000E+00
 DRH1DP  = FILE
 
 TMP1A   = 2.730E+02
  
   *  List of user-defined materials to be read by EARTH
    MATFLG=T; IMAT=2
   *  Name
   *Ind. Dens.  Viscos.  Spec.heat  Conduct.  Expans.  Compr.
   *  
    90 2480 1.0081E-01 840 1.7000E+00 0.0
   *  
    161 1.0000E+06 0.0 1.0000E-06 1.0000E-06 0.0
 ************************************************************
  Group 10.Inter-Phase Transfer Processes
 ************************************************************
  Group 11.Initialise Var/Porosity Fields
 FIINIT(BLOK) =  1.000E+00 ; FIINIT(PRPS) =  2.000E+00
 FIINIT(TEM1) =  1.150E+03
 
 PATCH (GLASS   ,INIVAL,#1,#2,#1,#1,#1,#2,1,1)
 INIT(GLASS   ,BLOK, 0.000E+00, 2.000E+00)
 INIT(GLASS   ,PRPS, 0.000E+00, 9.000E+01)
 
 CONPOR(BLOK1   , -1.00,CELL  ,-#2,-#2,-#1,-#2,-#1,-#1)
 INIT(BLOK1   ,BLOK, 0.000E+00, 3.000E+00)
 INIT(BLOK1   ,PRPS, 0.000E+00, 1.610E+02)
 
 INIADD  =    F
 ************************************************************
  Group 12. Convection and diffusion adjustments
 ************************************************************
  Group 13. Boundary & Special Sources
 
 INLET (ING     ,LOW   ,#1,#1,#1,#1,#1,#1,1,1)
 VALUE (ING     ,P1  , 3.626E+00)
 VALUE (ING     ,W1  , 1.462E-03)
 VALUE (ING     ,TEM1, 1.150E+03)
 
 PATCH (WALL1   ,EAST  ,#1,#1,#1,#1,#1,#1,1,1)
 COVAL (WALL1   ,TEM1, FIXFLU   ,-2.000E+03)
 
 PATCH (WALL2   ,LOW   ,#2,#2,#1,#1,#2,#2,1,1)
 COVAL (WALL2   ,TEM1, FIXFLU   ,-2.000E+03)
 
 PATCH (WALL3   ,HIGH  ,#1,#2,#1,#1,#2,#2,1,1)
 COVAL (WALL3   ,TEM1, FIXFLU   ,-2.000E+03)
 
 PATCH (FIXV    ,NORTH ,#1,#2,#1,#1,#1,#2,1,1)
 COVAL (FIXV    ,V1  , FIXVAL   , 0.000E+00)
 
 INLET (INA     ,LOW   ,#1,#1,#2,#2,#1,#1,1,1)
 VALUE (INA     ,P1  , 3.030E-01)
 VALUE (INA     ,W1  , 1.000E+00)
 VALUE (INA     ,TEM1, 1.150E+03)
 
 OUTLET(OUTA    ,EAST  ,#2,#2,#2,#2,#2,#2,1,1)
 VALUE (OUTA    ,P1  , 0.000E+00)
 VALUE (OUTA    ,TEM1, 1.150E+03)
 
 OUTLET(OUTG    ,EAST  ,#2,#2,#1,#1,#2,#2,1,1)
 VALUE (OUTG    ,P1  , 0.000E+00)
 VALUE (OUTG    ,TEM1, 1.150E+03)
 
 PATCH (FLOOR   ,SWALL ,#1,#2,#1,#1,#1,#2,1,1)
 COVAL (FLOOR   ,U1  , LOGLAW    , 0.000E+00)
 COVAL (FLOOR   ,W1  , LOGLAW    , 0.000E+00)
 
 PATCH (HOTFLOOR,SOUTH ,#1,#2,#1,#1,#1,#2,1,1)
 COVAL (HOTFLOOR,TEM1, FIXFLU   ,-2.000E+03)
 patch(BLOK1a   ,CELL  ,#2,#2,#1,#2,#1,#1,1,1)
 coval(blok1a,tem1,fixval,1150)
 
 EGWF    =    T
 ************************************************************
  Group 14. Downstream Pressure For PARAB
 ************************************************************
  Group 15. Terminate Sweeps
 LSWEEP  =      30
 SELREF  =    T
 RESFAC  = 1.000E-03
 ************************************************************
  Group 16. Terminate Iterations
liter(u1)=20; liter(v1)=20; liter(w1)=20
 ************************************************************
  Group 17. Relaxation
 RELAX(P1  ,LINRLX, 8.000E-01)
 RELAX(U1  ,FALSDT, 2.000E-02)
 RELAX(V1  ,FALSDT, 2.000E-02)
 RELAX(W1  ,FALSDT, 2.000E-02)
 RELAX(TEM1,FALSDT, 2.000E+04)
 ************************************************************
  Group 18. Limits
 ************************************************************
  Group 19. EARTH Calls To GROUND Station
 CSG10   =Q1
 ************************************************************
  Group 20. Preliminary Printout
 ************************************************************
  Group 21. Print-out of Variables
 ************************************************************
  Group 22. Monitor Print-Out
 IXMON   =       3 ; IYMON  =       3 ; IZMON  =      10
 TSTSWP  =      -1
 ************************************************************
  Group 23.Field Print-Out & Plot Control
 NPLT    =       1
   No PATCHes used for this Group
 ************************************************************
  Group 24. Dumps For Restarts
 NOWIPE  =    T
 ************************************************************
  DISPLAY
   **********************************************************
   This Q1 concerns the flow of molten glass through a channel
   lined with refractory brick, and the air above it.
 
   The glass enters at 1150 deg C, and loses heat to the walls
   and floor at 2kW/m**2. Some heat is transferred by contact
   to the air. The glass (userm1) has a viscosity of 0.1.
 
   The case takes about 10 min to run the 30 sweeps set on
   a 486/33, but requires several hundred sweeps to converge.
 
   Results can be viewed in PHOTON by typing 'use q1'
  ENDDIS
 mesg(Do you want to see the geometry? (n/y)
 readvdu(ans,char,n)
 if(:ans:.eq.y) then
+  rset(v,0); gview(p,1,1,1); gdom(1,nx+1,1,ny+1,1,nz+1,1,0)
+  gpatch(floor,15,0); gpatch(fixv,1,0)
+  gpatch(ina,3,0); gpatch(ing,5,0); gpatch(outa,3,0)
+  gpatch(outg,5,0); gpatch(wall1,13,0); gpatch(wall2,13,0)
+  gpatch(wall3,13,0); gdraw
 endif