PHOTON USE
  p




  vi x;up z
  con mark x 1 fil;0.01
  gr x 1
  msg MARK specifying the inlet areas
  pause
  con cl;gr cl;red
  gr ou x 1
  vec x 1 sh
  msg Velocity vectors at the inlet plane
  pause
  gr cl;ve cl
  vi y;up z
  gr ou y 5
  vec y 5 sh
  msg Velocity vectors at the plane of symmetry
  msg Press E to end
  ENDUSE
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>

  DISPLAY
    This example shows how  to  use  grid-free  features  of
    PLANT  for calculation of scaling factors resulting from
    the  presentation  of   circle   inlets   on   Cartesian
    coordinate system.

    The problem   is  to  introduce  the  correct  mass  and
    momentum in-fluxes for the concentric inlets at the east
    wall  of  lower  part  of  3D rectangular chamber with a
    swirl in annular secondary flow inlet.

    It is supposed  that  MARK  of  unity  value  marks  the
    primary  inlet  area,  while  MARK=2  is used to specify
    secondary inlet cells.
  ENDDIS

    PLANT information :
     * Data input groups used:    11, 13, 19-3
     * Ground groups planted : 1, 11, 13, 19-3
     * Headings used  : INIT??, SC03??, SORC??
     * Functions used : SPHERE, SUM
     * Commands used  : PRINT, REGION, TEXT

  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    GROUP 1. Run title and other preliminaries
TEXT(Inlet flux scaling: swirling flow in a chamber
    GROUP 3. X-direction grid specification
GRDPWR(X,10,10.0,1.0)
    GROUP 4. Y-direction grid specification
GRDPWR(Y,10,10.,1.0)
    GROUP 5. Z-direction grid specification
GRDPWR(Z,10,35.,1.0)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1,W1)
STORE(MARK)
    GROUP 9. Properties of the medium (or media)
RHO1=1.;ENUL=0.01
    GROUP 11. Initialization of variable or porosity fields
FIINIT(MARK)=0.
INIADD=F

    GROUP 13. Boundary conditions and special sources

     PLANTBEGIN
REAL(PI);PI=3.14159
REAL(UPRIM,USEC,USWIRL,YIC,ZIC)
    ** Primary inlet velocity
UPRIM=  5.
    ** Secondary inlet velocity
USEC=  10.
    ** Secondary inlet constant swirl angular velocity
USWIRL=25.
    ** Origin of inlet center
     *  Z-coordinate
ZIC=5.25
     *  Y-coordinate
YIC=5.00
    ** Inlet diameters
REAL(RAD1,RAD2)
RAD1=2.0;RAD2=4.
    ** Drill the hole of outer diameter of secondary inlet
PATCH(INITMRK1,INIVAL,1,1,1,NY,1,NZ,1,1)
  VAL=SPHERE(2.0,0.0,5.0,5.25,4.0)
INIT (INITMRK1,MARK,0.,GRND)
   PRINT(VAL1=VAL)
    ** Drill the hole of primary inlet  diameter
PATCH(INITMRK2,INIVAL,1,1,1,NY,1,NZ,1,1)
  VAL=SPHERE(1.0,0.0,5.0,5.25,2.0)
INIT (INITMRK2,MARK,0.,GRND)
   PRINT(VAL2=VAL)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    Two circular holes are "drilled" at the west face of the
    domain  by  way  of  SPHERE  function.  The  provide the
    primary inlet of 2 m diameter (  MARK=1)  and  secondary
    annulus  of  1 m width ( MARK=2) .  The origins of inlet
    center are at X=0.0, YIC and ZIC.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    ** Primary inlet mass flux coefficient
   PRIMF=SUM(AEAST/(:PI:*:RAD1:**2))
  TEXT(Primary inlet mass flux coefficient)
  REGION() 1 /ISWEEP.LE.2
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
   Here, primary  inlet  mass  flux  coefficient,  which  is
   reciprocal to scaling factor representing ratio of actual
   to cartesian areas is calculated as a sum over all  cells
   occupied by primary inlet marker.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<

    ** Secondary inlet mass flux coefficient
   SECNF=SUM(AEAST/(:PI:*(:RAD2:**2-:RAD1:**2)))
  TEXT(Secondary inlet mass flux coefficient)
  REGION() 2 /ISWEEP.LE.2
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
   Here, secondary  inlet  mass  flux coefficient,  which is
   reciprocal to scaling factor representing ratio of actual
   to  cartesian areas is calculated as a sum over all cells
   occupied by secondary inlet marker.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    ** Primary inlet mass flux
PATCH(SS001,WEST,1,NX,1,NY,1,NZ,1,1)
   CO =FIXFLU
   VAL=:RHO1:*:UPRIM:/PRIMF/FIXFLU
COVAL(SS001,P1,GRND,GRND)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    Primary inlet mass flux is corrected above for all cells
    occupied by primary inlet marker appearing in the number
    of PATCH name, SS001.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    ** Primary inlet momentum flux
   CO =0.0
   VAL=:UPRIM:
COVAL(SS001,U1,GRND,GRND)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    The corrected   momentum   influx   will  be  calculated
    following the above satement.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    ** Secondary inlet mass flux
PATCH(SS002,WEST,1,NX,1,NY,1,NZ,1,1)
   CO =FIXFLU
   VAL=:RHO1:*:USEC:/SECNF/FIXFLU
COVAL(SS002,P1,GRND,GRND)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    Secondary inlet mass flux is  corrected  above  for  all
    cells  occupied by primary inlet marker appearing in the
    number of PATCH name, SS002.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    ** Secondary inlet momentum flux
   CO =0.0
   VAL=:USEC:
COVAL(SS002,U1,GRND,GRND)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    The corrected   longitudinal  momentum  influx  will  be
    calculated following the above statement.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
    ** Secondary inlet  V1 swirl flux
   CO =0.0
   VAL=:USWIRL:*(ZGNZ-:ZIC:)/$
              SQRT((YV2D-:YIC:)**2+(ZGNZ-:ZIC:)**2)
COVAL(SS002,V1,GRND,GRND)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    The corrected lateral momentum influx will be calculated
    following the above statement.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
   ** Secondary inlet  W1 swirl flux
   CO =0.0
   VAL=-:USWIRL:*(YG2D-:YIC:)/$
          SQRT((YG2D-:YIC:)**2+(ZWNZ-:ZIC:)**2)
COVAL(SS002,W1,GRND,GRND)
  >>>>>>>>>>>>>>>>>>>>>> Comment begins >>>>>>>>>>>>>>>>>>>>
    The corrected  Z-wise momentum influx will be calculated
    following the above statement.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
     PLANTEND
   ** High outlet
PATCH(OUT,HIGH,1,NX,1,NY,NZ,NZ,1,1)
COVAL(OUT,P1,fixp,0.0)

    GROUP 15. Termination of sweeps
LSWEEP=100
resfac=0.01
    GROUP 17. Under-relaxation devices
RELAX(P1,LINRLX,0.5);RELAX(W1,FALSDT,1.)
RELAX(U1,FALSDT,1.);RELAX(V1,FALSDT,1.)
    GROUP 19. Data communicated by satellite to GROUND
NAMSAT=MOSG
    GROUP 20. Preliminary print-out
    GROUP 21. Print-out of variables
    GROUP 22. Spot-value print-out
IXMON=NX/2;IYMON=NY/2+4;TSTSWP=-1
NXPRIN=1;NYPRIN=1;NZPRIN=1
dmpstk=t
DISTIL=T
EX(P1)=7.215E+00; EX(U1)=2.095E+00; EX(V1)=1.708E+00
EX(W1)=4.871E+00; EX(MARK)=2.800E-02
 LIBREF=615
STOP