#cls
text(In-Form Equivalent Of PLANT Case Z350
title
  DISPLAY
  
  This In-Form case does what Z350 does, but without fortran coding
  or re-compilation.

  This In-Form case illustrates the settings of a output mass flow
  with use of In-Form statements.
  This example use SUM In-Form function.
  
  First, case z350 is loaded.
  Then NAMSAT = NONE is set, in order to deactivate PLANT entries.
  Then WESTWALF=SKIP, EASTWALF=SKIP, FIXPRESS=SKIP, WESVEN=SKIP
  EASVEN=SKIP are set, to deactivate some PATCH commands.

  This case uses the In-Form functions:
    MAKE, STORE1, STORED, SOURCE, LONGNAME, SUM and OLD.
  
  Please inspect the bottom of the Q1 file so see how this is done.
  ENDDIS  
load(z350)
libref=786
text(In-Form equivalent of PLANT case Z350

  INFORM13BEGIN
    ** The next line de-activates PATCH commands of case Z350 **
namsat=none
WESTWALF=SKIP
EASTWALF=SKIP
FIXPRESS=SKIP
WESVEN=SKIP
EASVEN=SKIP
PATCH(WESTWALF,WEST,1,1,1,NY/2,1,NZ,1,LSTEP)
COVAL(WESTWALF,V1,0.0,0.0)
PATCH(EASTWALF,EAST,NX,NX,1,NY/2,1,NZ,1,LSTEP)
COVAL(EASTWALF,V1,0.0,0.0)

    
   ** In-Form formulae which are equivalent to the
       PLANT formulae of z350                               **
   *** In-Form inserts zero-slip-when-vents-closed
(MAKE :NX:*:NY: of SWTH is 0)
(STORE1 SWTH is OLD(TEM1[:IXP:,:IYP:,])-:TLIM: with TSTFIN)
  
  !!!!! note the use of the IF condition !!!!!
PATCH(WWALF,WEST,1,1,1,NY/2,1,NZ,1,LSTEP)
CHAR(FORM)
FORM=:ENUL:*2*:RHO1:/DXU
(SOURCE var V1 at WWALF is -:FORM:*V1 with IF(SWTH.LE.0))

PATCH(EWALF,EAST,NX,NX,1,NY/2,1,NZ,1,LSTEP)
FORM=:ENUL:*2*:RHO1:/DXU
(SOURCE var V1 at EWALF is -:FORM:*V1 with IF(SWTH.LE.0))

   *** In-Form switches off/on the pressure relief
PATCH(FIXPR,CELL,NX,NX,NY,NY,1,1,1,LSTEP)
(SOURCE var P1 at FIXPR is 0. with FIXV!IF(SWTH.LE.0))
COVAL(FIXPR,V1,ONLYMS,0.0)
COVAL(FIXPR,U1,ONLYMS,0.0)
COVAL(FIXPR,TEM1,ONLYMS,SAME)

   *** In-Form switches off/on the west vent
PATCH(WVEN,WEST,1,1,1,NY/2,1,NZ,1,LSTEP)
(SOURCE var P1 at WVEN is 0. with FIXV!IF(SWTH.GT.0))
COVAL(WVEN,TEM1,ONLYMS,1.0)

   *** In-Form switches off/on the east vent
PATCH(EVEN,EAST,NX,NX,1,NY/2,1,NZ,1,LSTEP)
(SOURCE var P1 at EVEN is 0. with FIXV!IF(SWTH.GT.0))
COVAL(EVEN,TEM1,ONLYMS,1.0)

   *** In-Form calculates the bulk room temperature
  
(MAKE of TBUL is 0)
(STORE1 TBUL is SUM(TEM1*VOL/(YVLAST*XULAST)) with ZSLFIN)

   *** In-Form store the bulk room temperature in RESULT file
       as BULT variable
STORE(BULT)
(STORED BULT is TBUL with ZSLFIN)
(LONGNAME BULT print as the_bulk_room_temperature)
  INFORM13END
RESFAC=2.E-2
libref=786
DISTIL=T
EX(P1)=1.823E-03; EX(U1)=6.912E-03; EX(V1)=9.454E-03
EX(BULT)=3.549E+00; EX(TEM1)=3.549E+00
  PHOTON USE
  p
  p1;

  use patgeo
  con tem1 z 1 fi;0.001
  vec z 1
  msg at 3 sec.
  pause
  p
  p2;

  use patgeo
  con tem1 z 1 fi;0.001
  vec z 1
  msg at 6 sec.
  pause
  p
  p3;

  use patgeo
  con tem1 z 1 fi;0.001
  vec z 1
  msg at 9 sec.
  pause
  p
  p4;

  use patgeo
  con tem1 z 1 fi;0.001
  vec z 1
  msg at 12 sec.
  pause
  p
  p5;

  use patgeo
  con tem1 z 1 fi;0.001
  vec z 1
  msg at 15 sec.
  ENDUSE
STOP