TALK=T;RUN(1,1)
  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
  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
     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)
    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
   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
   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)
    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)
    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)
    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)
    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)
    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)
    The corrected  Z-wise momentum influx will be calculated
    following the above statement.
  <<<<<<<<<<<<<<<<<<<<<<< Comment ends <<<<<<<<<<<<<<<<<<<<<
     PLANTEND
 ************************************************************
  Group 1. Run Title and Number
 ************************************************************
 ************************************************************
 
 TEXT(In-Form equivalent of PLANT case Z615   )
 
 ************************************************************
 ************************************************************
 
 IRUNN = 1 ;LIBREF = 615
 ************************************************************
  Group 2. Time dependence
 STEADY = T
 ************************************************************
  Group 3. X-Direction Grid Spacing
 CARTES = T
 NX = 30
 XULAST =10.
 XFRAC(1)=0.033333 ;XFRAC(2)=0.066667
 XFRAC(3)=0.1 ;XFRAC(4)=0.133333
 XFRAC(5)=0.166667 ;XFRAC(6)=0.2
 XFRAC(7)=0.233333 ;XFRAC(8)=0.266667
 XFRAC(9)=0.3 ;XFRAC(10)=0.333333
 XFRAC(11)=0.366667 ;XFRAC(12)=0.4
 XFRAC(13)=0.433333 ;XFRAC(14)=0.466667
 XFRAC(15)=0.5 ;XFRAC(16)=0.533333
 XFRAC(17)=0.566667 ;XFRAC(18)=0.6
 XFRAC(19)=0.633333 ;XFRAC(20)=0.666667
 XFRAC(21)=0.7 ;XFRAC(22)=0.733333
 XFRAC(23)=0.766667 ;XFRAC(24)=0.8
 XFRAC(25)=0.833333 ;XFRAC(26)=0.866667
 XFRAC(27)=0.9 ;XFRAC(28)=0.933333
 XFRAC(29)=0.966667 ;XFRAC(30)=1.
 ************************************************************
  Group 4. Y-Direction Grid Spacing
 NY = 30
 YVLAST =10.
 YFRAC(1)=0.033333 ;YFRAC(2)=0.066667
 YFRAC(3)=0.1 ;YFRAC(4)=0.133333
 YFRAC(5)=0.166667 ;YFRAC(6)=0.2
 YFRAC(7)=0.233333 ;YFRAC(8)=0.266667
 YFRAC(9)=0.3 ;YFRAC(10)=0.333333
 YFRAC(11)=0.366667 ;YFRAC(12)=0.4
 YFRAC(13)=0.433333 ;YFRAC(14)=0.466667
 YFRAC(15)=0.5 ;YFRAC(16)=0.533333
 YFRAC(17)=0.566667 ;YFRAC(18)=0.6
 YFRAC(19)=0.633333 ;YFRAC(20)=0.666667
 YFRAC(21)=0.7 ;YFRAC(22)=0.733333
 YFRAC(23)=0.766667 ;YFRAC(24)=0.8
 YFRAC(25)=0.833333 ;YFRAC(26)=0.866667
 YFRAC(27)=0.9 ;YFRAC(28)=0.933333
 YFRAC(29)=0.966667 ;YFRAC(30)=1.
 ************************************************************
  Group 5. Z-Direction Grid Spacing
 PARAB = F
 NZ = 40
 ZWLAST =35.
 ZFRAC(1)=0.014286 ;ZFRAC(2)=0.028571
 ZFRAC(3)=0.042857 ;ZFRAC(4)=0.057143
 ZFRAC(5)=0.071429 ;ZFRAC(6)=0.085714
 ZFRAC(7)=0.1 ;ZFRAC(8)=0.114286
 ZFRAC(9)=0.128571 ;ZFRAC(10)=0.142857
 ZFRAC(11)=0.157143 ;ZFRAC(12)=0.171429
 ZFRAC(13)=0.185714 ;ZFRAC(14)=0.2
 ZFRAC(15)=0.214286 ;ZFRAC(16)=0.228571
 ZFRAC(17)=0.242857 ;ZFRAC(18)=0.257143
 ZFRAC(19)=0.271429 ;ZFRAC(20)=0.285714
 ZFRAC(21)=0.302603 ;ZFRAC(22)=0.325882
 ZFRAC(23)=0.352393 ;ZFRAC(24)=0.381249
 ZFRAC(25)=0.411983 ;ZFRAC(26)=0.444303
 ZFRAC(27)=0.478004 ;ZFRAC(28)=0.512935
 ZFRAC(29)=0.548976 ;ZFRAC(30)=0.586034
 ZFRAC(31)=0.624032 ;ZFRAC(32)=0.662905
 ZFRAC(33)=0.702597 ;ZFRAC(34)=0.74306
 ZFRAC(35)=0.784253 ;ZFRAC(36)=0.826138
 ZFRAC(37)=0.868684 ;ZFRAC(38)=0.91186
 ZFRAC(39)=0.95564 ;ZFRAC(40)=1.
 ************************************************************
  Group 6. Body-Fitted Coordinates
 ************************************************************
  Group 7. Variables: STOREd,SOLVEd,NAMEd
 ONEPHS = T
 NAME(1)=P1 ;NAME(3)=U1
 NAME(5)=V1 ;NAME(7)=W1
 NAME(12)=KE ;NAME(13)=EP
 NAME(147)=SECF ;NAME(148)=PRIF
 NAME(149)=ENUT ;NAME(150)=MARK
    * Y in SOLUTN argument list denotes:
    * 1-stored 2-solved 3-whole-field
    * 4-point-by-point 5-explicit 6-harmonic averaging 
 SOLUTN(P1,Y,Y,Y,N,N,Y)
 SOLUTN(U1,Y,Y,Y,N,N,Y)
 SOLUTN(V1,Y,Y,Y,N,N,Y)
 SOLUTN(W1,Y,Y,Y,N,N,Y)
 SOLUTN(KE,Y,Y,N,N,N,N)
 SOLUTN(EP,Y,Y,N,N,N,N)
 SOLUTN(SECF,Y,N,N,N,N,Y)
 SOLUTN(PRIF,Y,N,N,N,N,Y)
 SOLUTN(ENUT,Y,N,N,N,N,Y)
 SOLUTN(MARK,Y,N,N,N,N,Y)
 VIST = 149
 ************************************************************
  Group 8. Terms & Devices
    * Y in TERMS argument list denotes:
    * 1-built-in source 2-convection 3-diffusion 4-transient
    * 5-first phase variable 6-interphase transport         
 TERMS(P1,Y,Y,Y,N,Y,Y)
 TERMS(U1,Y,Y,Y,Y,Y,Y)
 TERMS(V1,Y,Y,Y,Y,Y,Y)
 TERMS(W1,Y,Y,Y,Y,Y,Y)
 TERMS(KE,N,Y,Y,Y,Y,N)
 TERMS(EP,N,Y,Y,Y,Y,N)
 DIFCUT =0.5 ;ZDIFAC =1.
 GALA = F ;ADDDIF = F
 NEWENT = T
 ISOLX = -1 ;ISOLY = -1 ;ISOLZ = -1
 ************************************************************
  Group 9. Properties used if PRPS is not
  stored, and where PRPS = -1.0 if it is!
 RHO1 =1. ;TMP1 =0.
 EL1 = GRND4
 TSURR =0. ;TEMP0 =0.
 PRESS0 =0.
 DVO1DT =0. ;DRH1DP =0.
 EMISS =0. ;SCATT =0.
 RADIA =0. ;RADIB =0.
 EL1A =0. ;EL1B =0.
 EL1C =0.
 ENUL =1.0E-02 ;ENUT = GRND3
 ENUTA =0. ;ENUTB =0.
 ENUTC =0.
 IENUTA = 0
 PRNDTL(U1)=1. ;PRNDTL(V1)=1.
 PRNDTL(W1)=1. ;PRNDTL(KE)=1.
 PRNDTL(EP)=1.
 PRT(U1)=1. ;PRT(V1)=1.
 PRT(W1)=1. ;PRT(KE)=1.
 PRT(EP)=1.314
 CP1 =1. ;CP2 =1.
 ************************************************************
  Group 10.Inter-Phase Transfer Processes
 ************************************************************
  Group 11.Initial field variables (PHIs)
 FIINIT(P1)=1.0E-10 ;FIINIT(U1)=1.0E-10
 FIINIT(V1)=1.0E-10 ;FIINIT(W1)=1.0E-10
 FIINIT(KE)=1.0E-02 ;FIINIT(EP)=1.0E-02
 FIINIT(SECF)=1.0E-10 ;FIINIT(PRIF)=1.0E-10
 FIINIT(ENUT)=1.0E-02 ;FIINIT(MARK)=0.
 
 PATCH(.PATCH1 ,INIVAL,0. ,0. ,0. ,1. ,0. ,1. ,1. ,1. )
 INIADD = F
 FSWEEP = 1
 NAMFI =CHAM
 ************************************************************
  Group 12. Patchwise adjustment of terms
  Patches for this group are printed with those
  for Group 13.
  Their names begin either with GP12 or &
 ************************************************************
  Group 13. Boundary & Special Sources
 
 PATCH(OUT ,HIGH , 1, 10, 1, 10, 10, 10, 1, 1)
 COVAL(OUT ,P1 ,1. ,0. )
 
 PATCH(KESOURCE,PHASEM, 0, 0, 0, 0, 0, 0, 1, 1)
 COVAL(KESOURCE,KE , GRND4 , GRND4 )
 COVAL(KESOURCE,EP , GRND4 , GRND4 )
 
 PATCH(INLET1 ,WEST , 1, 1, 1, 30, 1, 40, 1, 1)
 COVAL(INLET1 ,P1 ,In-Form:source - see Grp 19)
 COVAL(INLET1 ,U1 ,In-Form:source - see Grp 19)
 
 PATCH(INLET2 ,WEST , 1, 1, 1, 30, 1, 40, 1, 1)
 COVAL(INLET2 ,P1 ,In-Form:source - see Grp 19)
 COVAL(INLET2 ,U1 ,In-Form:source - see Grp 19)
 COVAL(INLET2 ,V1 ,In-Form:source - see Grp 19)
 COVAL(INLET2 ,W1 ,In-Form:source - see Grp 19)
 XCYCLE = F
 EGWF = T
 WALLCO = GRND2
 ************************************************************
  Group 14. Downstream Pressure For PARAB
 ************************************************************
  Group 15. Terminate Sweeps
 LSWEEP = 200 ;ISWC1 = 1
 LITHYD = 1 ;LITFLX = 1 ;LITC = 1 ;ITHC1 = 1
 SELREF = T
 RESFAC =1.0E-02
 ************************************************************
  Group 16. Terminate Iterations
 LITER(P1)=20 ;LITER(U1)=10
 LITER(V1)=10 ;LITER(W1)=10
 LITER(KE)=20 ;LITER(EP)=20
 ENDIT(P1)=1.0E-03 ;ENDIT(U1)=1.0E-03
 ENDIT(V1)=1.0E-03 ;ENDIT(W1)=1.0E-03
 ENDIT(KE)=1.0E-03 ;ENDIT(EP)=1.0E-03
 ************************************************************
  Group 17. Relaxation
 RELAX(P1,LINRLX,1.)
 RELAX(U1,FALSDT,1.)
 RELAX(V1,FALSDT,1.)
 RELAX(W1,FALSDT,1.)
 RELAX(KE,LINRLX,0.5)
 RELAX(EP,LINRLX,0.5)
 RELAX(SECF,LINRLX,1.)
 RELAX(PRIF,LINRLX,1.)
 RELAX(ENUT,LINRLX,1.)
 RELAX(MARK,LINRLX,1.)
 KELIN = 0
 OVRRLX =0.
 EXPERT = F ;NNORSL = F
 ************************************************************
  Group 18. Limits
 VARMAX(P1)=1.0E+10 ;VARMIN(P1)=-1.0E+10
 VARMAX(U1)=0.3 ;VARMIN(U1)=-1.0E+11
 VARMAX(V1)=0.3 ;VARMIN(V1)=-1.0E+11
 VARMAX(W1)=0.3 ;VARMIN(W1)=-1.0E+11
 VARMAX(KE)=1.0E+10 ;VARMIN(KE)=1.0E-03
 VARMAX(EP)=1.0E+10 ;VARMIN(EP)=1.0E-03
 VARMAX(SECF)=1.0E+10 ;VARMIN(SECF)=-1.0E+10
 VARMAX(PRIF)=1.0E+10 ;VARMIN(PRIF)=-1.0E+10
 VARMAX(ENUT)=1.0E+10 ;VARMIN(ENUT)=-1.0E+10
 VARMAX(MARK)=1.0E+10 ;VARMIN(MARK)=-1.0E+10
 ************************************************************
  Group 19. Data transmitted to GROUND
 GENK = T
 PARSOL = F
 CONWIZ = T
 ISG50 = 1
 ISG52 = 1
 ISG62 = 1
 SPEDAT(SET,INFOB,*!.PATCH1,C,=SPHERE(0&5.&5.25&4.&0&0&0)-SPHERE(0$)
 SPEDAT(SET,INFOB,*!.PATCH1,C,&5.&5.25&2.&0&0&0)!INFOB_2)
 SPEDAT(SET,INFOB,*!.PATCH1,C,=SPHERE(0&5.&5.25&2.&0&0&0)!INFOB_1)
 SPEDAT(SET,MAKE,PRIMF,C,=1.)
 SPEDAT(SET,STORED,PRIMF!.PATCH1,C,=SUM(AEAST/(3.14159*2.^2))!INFO$)
 SPEDAT(SET,STORED,PRIMF!.PATCH1,C,B_1!IF(ISWEEP.LE.2)!ZSLFIN)
 SPEDAT(SET,STORED,PRIF,C,=PRIMF!IF(ISWEEP.LE.2)!ZSLFIN)
 SPEDAT(SET,LONGNAME,PRIF,C,Primary_inlet_mass_flux_coefficient)
 SPEDAT(SET,MAKE,SECNF,C,=1.)
 SPEDAT(SET,STORED,SECNF!.PATCH1,C,=SUM(AEAST/(3.14159*(4.^2-2.^2)$)
 SPEDAT(SET,STORED,SECNF!.PATCH1,C,))!INFOB_2!IF(ISWEEP.LE.2)!ZSLF$)
 SPEDAT(SET,STORED,SECNF!.PATCH1,C,IN)
 SPEDAT(SET,STORED,SECF,C,=SECNF!IF(ISWEEP.LE.2)!ZSLFIN)
 SPEDAT(SET,LONGNAME,SECF,C,Secondary_inlet_mass_flux_coefficient)
 SPEDAT(SET,SOURCE,R1!INLET1,C,=1.*5./PRIMF!INFOB_1)
 SPEDAT(SET,SOURCE,U1!INLET1,C,=1.*5.*5./PRIMF!INFOB_1)
 SPEDAT(SET,SOURCE,R1!INLET2,C,=1.*10./SECNF!INFOB_2)
 SPEDAT(SET,SOURCE,U1!INLET2,C,=1.*10.*10./SECNF!INFOB_2)
 SPEDAT(SET,SOURCE,V1!INLET2,C,=1.*10./SECNF*25.*(ZG-5.25)/SQRT((Y$)
 SPEDAT(SET,SOURCE,V1!INLET2,C,V-5.)^2+(ZG-5.25)^2)!INFOB_2)
 SPEDAT(SET,SOURCE,W1!INLET2,C,=1.*10./SECNF*(-25.)*(YG-5.)/SQRT(($)
 SPEDAT(SET,SOURCE,W1!INLET2,C,YG-5.)^2+(ZW-5.25)^2)!INFOB_2)
 SPEDAT(SET,STORED,MARK,C,=1!INFOB_1!IF(ISWEEP.LE.2)!ZSLFIN)
 SPEDAT(SET,STORED,MARK,C,=2!INFOB_2!IF(ISWEEP.LE.2)!ZSLFIN)
 SPEDAT(SET,MAXINC,KE,R,10.)
 SPEDAT(SET,MAXINC,EP,R,10.)
 ************************************************************
  Group 20. Preliminary Printout
 DISTIL = T ;NULLPR = F
 NDST = 0
 DSTTOL =1.0E-02
 EX(P1)=7.215 ;EX(U1)=2.095
 EX(V1)=1.708 ;EX(W1)=4.871
 EX(KE)=0. ;EX(EP)=0.
 EX(SECF)=0. ;EX(PRIF)=0.
 EX(ENUT)=0. ;EX(MARK)=0.028
 ************************************************************
  Group 21. Print-out of Variables
 INIFLD = F ;SUBWGR = F
    * Y in OUTPUT argument list denotes:
    * 1-field 2-correction-eq. monitor 3-selective dumping      
    * 4-whole-field residual 5-spot-value table 6-residual table
 OUTPUT(P1,Y,N,Y,Y,Y,Y)
 OUTPUT(U1,Y,N,Y,Y,Y,Y)
 OUTPUT(V1,Y,N,Y,Y,Y,Y)
 OUTPUT(W1,Y,N,Y,Y,Y,Y)
 OUTPUT(KE,Y,N,Y,Y,Y,Y)
 OUTPUT(EP,Y,N,Y,Y,Y,Y)
 OUTPUT(SECF,Y,N,Y,N,N,N)
 OUTPUT(PRIF,Y,N,Y,N,N,N)
 OUTPUT(ENUT,Y,N,Y,N,N,N)
 OUTPUT(MARK,Y,N,Y,N,N,N)
 ************************************************************
  Group 22. Monitor Print-Out
 IXMON = 5 ;IYMON = 9 ;IZMON = 1
 NPRMON = 100000 ;NPRMNT = 1 ;TSTSWP = -1
 UWATCH = T ;USTEER = T
 HIGHLO = F
 ************************************************************
  Group 23.Field Print-Out & Plot Control
 NPRINT = 100000 ;NUMCLS = 5
 NXPRIN = 1 ;IXPRF = 1 ;IXPRL = 10000
 NYPRIN = 1 ;IYPRF = 1 ;IYPRL = 10000
 NZPRIN = 1 ;IZPRF = 1 ;IZPRL = 10000
 XZPR = F ;YZPR = F
 IPLTF = 1 ;IPLTL = -1 ;NPLT = -1
 ISWPRF = 1 ;ISWPRL = 100000
 ITABL = 3 ;IPROF = 1
 ABSIZ =0.5 ;ORSIZ =0.4
 NTZPRF = 1 ;NCOLPF = 50
 ICHR = 2 ;NCOLCO = 45 ;NROWCO = 20
   No PATCHes yet used for this Group
 ************************************************************
  Group 24. Dumps For Restarts
 SAVE = T ;NOWIPE = F
 NSAVE =CHAM
STOP