PHOTON USE
  p;p1;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 1 sec
  msg Hit Enter to continue
  pause
  p;p2;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 2 sec
  msg Hit Enter to continue
  pause
  p;p3;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 3 sec
  msg Hit Enter to continue
  pause
  p;p4;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 4 sec
  msg Hit Enter to continue
  pause
  p;p5;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 5 sec
  msg Hit Enter to continue
  pause
  p;p6;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 6 sec
  msg Hit Enter to continue
  pause
  p;p7;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 7 sec
  msg Hit Enter to continue
  pause
  p;p8;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 8 sec
  msg Hit Enter to continue
  pause
  p;p9;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 9 sec
  msg Hit Enter to continue
  pause
  p;p10;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 10 sec
  msg Hit Enter to continue
  pause
  p;p11;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 11 sec
  msg Hit Enter to continue
  pause
  p;p12;

  con MARK z 1 fil;.001
  gr ou z 1;set vec ref 35;vec z 1
  msg  Velocity vectors field at 12 sec
  msg Type E to end
  ENDUSE
    GROUP 1. Run title and other preliminaries
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>

  DISPLAY
  This run shows  what  happens  around  rectangular  object
  suddenly  sent  in  motion.  It  calculates  the  unsteady
  velocity distribution,  generated by moving object,  in  a
  channel with orifice.

  The PLANT  settings  are  virtually grid-free for they are
  introduced in terms of physical distances rather than cell
  extents
  ENDDIS.

    PLANT information :
     * Data input groups used: 9, 11, 13, 19
     * Ground groups planted : 1, 9-6, 11, 13, 19-3
     * Headings used  : PRPT??, INIT??, SORC??, SC03??
     * Functions used : VELBC, XYBOX
     * Commands used  : IF, PLACE, REGION

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

TEXT( Block passing through orifice

    GROUP 2. Transience; time-step specification
STEADY=F;GRDPWR(T,12,12.,1.0)
    GROUP 3. X-direction grid specification
GRDPWR(X,60,360.,1.0)
    GROUP 4. Y-direction grid specification
GRDPWR(Y,21,126.,1.0)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1)
    ** Harmonic averaging
SOLUTN(U1,Y,Y,N,P,P,Y)
SOLUTN(V1,Y,Y,N,P,P,Y)
STORE(MARK)
    GROUP 8. Terms (in differential equations) & devices
    GROUP 9. Properties of the medium (or media)
RHO1=1.
    ** Domain, object and orifice viscosities
ENUL=GRND
    GROUP 11.  Initialization  of variable or porosity fields
FIINIT(MARK)=0.0;FIINIT(P1)=0.0
FIINIT(U1)=0.0;FIINIT(V1)=0.0
INIADD=F
    GROUP 13. Boundary conditions and special sources
PATCH(INLW,WEST,1,1,1,NY,1,NZ,1,LSTEP)
COVAL(INLW,P1,1000.,0.0)
PATCH(OUTLE,EAST,NX,NX,1,NY,1,NZ,1,LSTEP)
COVAL(OUTLE,P1,1000.,0.0)

    GROUP 15. Termination of sweeps
LSWEEP=50
    GROUP 17. Under-relaxation devices
relax(p1,linrlx,0.25)
RELAX(U1,FALSDT,.10)
relax(v1,falsdt,.10)

NAMSAT=MOSG

    PLANTBEGIN
     * Set domain viscosity
   VISL=10.0
      * Set large viscosity in object
   VISL=1.E5
   REGION() 1
      * Set large viscosity in orifice blocks
   VISL=1.E5
   REGION() 2
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    The above settings introduce the  viscous  domain  fluid
    and  large artificial viscosities for solid blocks.  The
    latter is essential for non-slip boundary conditions.

    By way of  dummy  REGION  command  with  MARK  value  as
    parameter, PLANT is told to make the coding in grid-free
    manner,   looking   for   the   corresponding    marker.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    ** Orifice initialization
     * Orifice LOWER block locations
PATCH(LOWBLOK,INIVAL,1,NX,1,NY,1,NZ,1,LSTEP)
   VAL=2.
INIT(LOWBLOK,MARK,0.0,GRND)
  PLACE(120.,240.,0.,48.)
     * Orifice UPPER block locations
PATCH(UPBLOK,INIVAL,1,NX,1,NY,1,NZ,1,LSTEP)
   VAL=2.
INIT(UPBLOK,MARK,0.0,GRND)
  PLACE(120.,240.,78.,126.)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    All orifice cells are marked by  MARK=2.  PLACE  command
    overwrites  the  whole-domain  extants  of  the PATCH by
    physical extents of the blocks.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    ** Set the object velocities
RG(1)=30.0; RG(2)=0.0
PATCH(OBJVEL,CELL,1,NX,1,NY,1,NZ,1,LSTEP)
   CO = VELBC(1.,FIXVAL)
   VAL= VELBC(1.,RG(1))
COVAL(OBJVEL,U1,GRND,GRND)
   CO = VELBC(1.,FIXVAL)
   VAL= VELBC(1.,RG(2))
COVAL(OBJVEL,V1,GRND,GRND)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    Function VELBC  is  used  to  set  the  COefficients and
    VALues for all object  cells  .  It  fixes  all  lateral
    velocity  components  to  zero  and longitudinal ones to
    RG(1), which is the object velocity magnitude. The first
    function  argument  is  set to object marker value.  The
    second arguments are set  equal  to  either  FIXVAL  for
    COefficients or object velocity components for VALues of
    momentum sources.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    ** Nulify velocities in orifice blocks
PATCH(ORIVEL,CELL,1,NX,1,NY,1,NZ,1,LSTEP)
   CO = VELBC(2.,FIXVAL)
   VAL= VELBC(2.,0.0)
COVAL(ORIVEL,U1,GRND,GRND)
   CO = VELBC(2.,FIXVAL)
   VAL= VELBC(2.,0.0)
COVAL(ORIVEL,V1,GRND,GRND)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    Function VELBC  fixes  velocities normal to the faces of
    all orifice (1st argument is 2) cells to zero.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    ** Set the block positions at each time steps
     1. Nulify MARK field first
   MARK =0.
  IF(ISWEEP.EQ.1)
     2. Set lower orifice block
   MARK =2.
   PLACE(120.,240.,0.,48.) /ISWEEP.EQ.1
     3. Set upper orifice block
   MARK =2.
   PLACE(120.,240.,78.,126.) /ISWEEP.EQ.1
     4. Set the current object position
   MARK =XYBOX(1.0,RG(1)*(TIM-1.),48.,30.,30.,0.0,0.0)
  IF(ISWEEP.EQ.1)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    Above set  of  PLANT  blocks is responsible for planting
    codings to distribute the markers for each time step  at
    the start of the first sweep.  It is done in four stages
    indicated.

    First three reproduce the location of stationary orifice
    and  clean  the domain space.  At the fourth stage,  the
    function  XYBOX  is  used  to  calculate  time   varying
    re-location  of unity object marker ( 1st argument) as a
    linear function of current time and  object  velocity  (
    2nd  argument expression).  The next three arguments set
    the cartesian coordinate of south-west  box  corner  and
    the sizes of its sides. The sixth and seventh arguments,
    representing rotation angles, are zeros here.

  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    PLANTEND
SPEDAT(SET,GXMONI,TRANSIENT,L,F)
    Group 21. Print-out of Variables
OUTPUT(U1  ,Y,N,Y,N,N,N)
OUTPUT(V1  ,Y,N,Y,N,N,N)
    GROUP 22. Spot-value print-out
NPRMON=LSWEEP;IXMON=5;IYMON=12;IZMON=1
NXPRIN=1;NYPRIN=1
    GROUP 23. Print-out & plot control
TSTSWP=-1;idispa=1; csg1=p; selref=t; resfac=1.e-2
dmpstk=t
DISTIL=T
EX(P1)=8.271E+01; EX(U1)=6.576E+00  
EX(V1)=8.536E-01; EX(MARK)=5.278E-01
 LIBREF=618
STOP