PHOTON USE
  p;;;;;
  gr ou z 1 1
  gr ou y m z 1 1;gr ou z 2;gr ou x 1 z 1 1 ;gr ou x m z 1 1
  gr ou y m z 2 2;gr ou z 3;gr ou x 1 z 2 2 ;gr ou x m z 2 2
  gr ou y m z 3 3;gr ou z 4;gr ou x 1 z 3 3 ;gr ou x m z 3 3
  gr ou y m z 4 4;gr ou z 5;gr ou x 1 z 4 4 ;gr ou x m z 4 4
  vec z 1 sh
  msg
  msg        In slab of IZ=1 the flow is 45 degree
  msg        from right bottom corner.
  msg
  pause
  vec off;con off;red
  vec z 2 sh
  msg
  msg        In slab IZ=2 the flow is a solid body
  msg        counter clockwise rotation.
  msg
  pause
  vec off;con off;red
  con h1 z 3 fil;.001
  vec z 3 sh
  msg
  msg        In slab IZ=3 the flow is the superposition
  msg        of those in slabs 1 and 2.
  msg
  msg        The source dispersion plume is as shown.
  msg
  msg        Hit Enter to get the result of convection
  msg        fluxes transformation.
  pause
  vec off;con off;red
  con h1 z 4 fil;.001
  vec z 4 sh
  msg
  MSG
  msg        In slab IZ=4 the dispersion is exactly the same as
  msg        before in spite of background flow being in opposite
  msg        direction.
  ENDUSE
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>

  DISPLAY
    The four problems are arranged in  four  slab  cartesian
    box. Each slab is devoted to the particular problem.

    The PLANTing  of  initial velocity fields,  manipulation
    with them and the alteration  of  convection  fluxes  by
    add-extra-velocity option are demonstrated.
  ENDDIS

    PLANT information :
     * Data input groups used:  8, 11
     * Ground groups planted :  1, 8-1, 8-3, 11
     * Headings used  : INIT??, SCUF01, SCVF01
     * Functions used : None
     * Commands used  : IF, REGION

  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<

TEXT( Alteration of convection fluxes

    GROUP 3. X-direction grid specification
GRDPWR(x,20,20.,1.0)

    GROUP 4. Y-direction grid specification
GRDPWR(Y,20,20.,1.0)

    GROUP 5. Z-direction grid specification
GRDPWR(Z,4,4.,1.0)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
     The provision is made above for cartesian box to have 4
    slabs.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<

    GROUP 7. Variables stored, solved & named
SOLVE(H1)
STORE(U1,V1,W1,HPOR)
    GROUP 8. Terms (in differential equations) & devices
TERMS(H1,N,Y,Y,Y,Y,Y)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
     The convection  -diffusion  transport of scalar will be
     considered here.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    GROUP 9. Properties of the medium (or media)
ENUL=1.e-04
    GROUP 11. Initialization of variable or porosity fields
INIADD=F
FIINIT(HPOR)=0.0
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
     The nulification,  by  above   line,   of   high   face
     porosities   provides  the  independency  of  the  slab
     sub-domains.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
FIINIT(V1)=5.0;FIINIT(U1)=-5.0
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
     This set of initialisations make the 45 degree flow  of
     5  m/s  from south-east edge of the domain.  It will be
     maintained as 1st slab velocity field.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    PLANTBEGIN
PATCH(INITZ2,INIVAL,1,NX,1,NY,2,2,1,1)
   VAL= -(YG2D-15.)
COVAL(INITZ2,U1,zero,GRND)
   VAL= XG2D-15.
COVAL(INITZ2,V1,zero,GRND)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
     The velocity field in the second slab is initialised as
     solid body rotation.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
PATCH(INITZ3,INIVAL,1,NX,1,NY,3,3,1,1)
   VAL= U1[,,1]+U1[,,2]+YG2D
COVAL(INITZ3,U1,zero,GRND)
   VAL= V1[,,1]+V1[,,2]-XG2D
COVAL(INITZ3,V1,zero,GRND)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
     The velocity field for the third sub-domain,  IZ=3,  is
     the superposition of the  velocity  components  in  two
     previous  slabs  and  the  cell  node  coordinates.  It
     results in 45 degree flow of  10  m/s  from  north-west
     edge of the domain.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
NAMSAT=MOSG
U1AD=GRND
   VELAD=U1[,,2]+YG2D
  REGION(,NX-1) /IZ.EQ.4
V1AD=GRND
   VELAD=V1[,,2]-XG2D
  REGION(,,,NY-1)
  IF(IZ.EQ.4)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
      Although, the velocity field at the fourth slab is the
      same  as for first one,  the add-extra-velocity option
      is  activated  as  above  pointers  tell.  The   extra
      velocities  added  to  the  main  velocity  components
      alters the convection fluxes to be equal  to  ones  at
      third  slab.  The  expected  distribution of convected
      property H1 should be identical to the one at IZ=3.

      Please note the differences in REGION  commands.  They
      are  attributed  to  the  staggered nature of velocity
      nodes and the usage of either switch or IF command  to
      limit the Z-direction extent of velocity alterations.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
      PLANTEND

    GROUP 13. Boundary conditions and special sources
        ** Fix the scalar value at the slab centre
PATCH(FIXSOR,CELL,nx/2,nx/2,NY/2,NY/2,3,4,1,1)
COVAL(FIXSOR,H1,FIXVAL,1.0)
    GROUP 16. Termination of iterations
LSWEEP=10
    GROUP 22. Spot-value print-out
IYMON=5;IXMON=5
    GROUP 23. Field print-out and plot control
NXPRIN=1;NYPRIN=1;TSTSWP=-1
dmpstk=t
DISTIL=T
EX(U1)=6.563E+00; EX(V1)=6.563E+00; EX(W1)=1.000E-10
EX(H1)=2.162E-02; EX(HPOR)=1.000E-11
 LIBREF=621
STOP