Encyclopaedia Index

1.5 The language and syntax of PLANT

Contents

  1. The main concepts
  2. What variables may be set
  3. Expressions to which the variables may be set equal
  4. Statements which set the variables
  5. Tags, indicating for what the settings are to be used
  6. Qualifiers, indicating where and when the settings are to be applied
  7. Auxiliary functions
  8. Miscellaneous additional features

1.5.1 The main concepts

PLANT is a means of setting the values of variables. This account of the PLANT language and syntax therefore begins, in section 1.5.2, with a list of what variables, and types of variables, can be set via PLANT.

The settings are made by way of PLANT-language statements. It is therefore necessary to explain that these have the form:

  1. Tag, also called heading, followed by
  2. PLANT variable = PLANT-language expression
  3. and (perhaps) qualifiers;

and then to describe the components of these statements.

Within the Q1 file, PLANT-related statements are arranged in blocks; and PIL statements may also be included in such blocks. The rules governing the ordering of these statements are explained in section 1.5.

The variables can be used, within the GROUND coding, in several different ways. PLANT enables the user to indicate the use to which they should be put by the inclusion of tags, each of which must have a name and a number.

These concepts are explained in section 1.5.5?.

Unless otherwise qualified, PLANT-made settings prevail at all locations and times within the flow-simulation space. Several settings qualifiers are provided in the PLANT language.

They, and their associated arguments and optional extensions, are described in section 1.5.6 ?.


1.5.2 What variables may be set

PLANT can set values of variables of several distinct types, defined as follows:
Click here for the variable types

The full list of variables, here arranged in the group-by-group manner which is used in Q1 files, is as follows:
Click here for the variable list

Settings are made by inclusion in the Q1 file of lines such as:
VAR=expression

Such lines, comprising an equals sign, the to-be-set variable on the left, and the expression on the right, are called PLANT settings or relationships. Examples are:-

In connexion with the last of these, it should be noted that, since NU does not feature explicitly in the just-presented list of variables, it must, if the setting is to be valid, feature implicitly. This is possible only if NU is recognised by PIL as a full-field variable, i.e. the subject of a prior PIL statement such as:
STORE(NU) .

It is now time to turn attention to the right-hand-side of the setting statement and to state the rules governing the formation of expressions. This is done in the next sub-section.


1.5.3 Expressions to which the variables may be set equal

An expression, in the present sense, is an algebraic sequence of operands and operators.

The operands which may be used in PLANT expressions can be:-

Note that the arguments must be contained within the square brackets. Obviously, the use of arguments is the more convenient when more than one index shift is needed to reach the neighbour cell from the current one.

The operators, which specify the actions to be performed on the operands, are the same as the arithmetic and intrinsic functions provided by FORTRAN, namely:

Some typical expressions, taken from the Input File Library, now follow:

Evidently, PLANT expressions can have considerable complexity; for this reason, as is illustrated by the final example, insertion of the $ sign is allowed, to signify "continuation" or "word wrap". More than one such sign is permissible in the same expression.


1.5.4 Statements which set the variables

Some typical PLANT statements, for the moment with tags but without qualifiers, are as follows:

  1. {PRPT01} VISL=:CONST1:*EXP(:CONST2:*(TEMP-:CONST3:))
  2. {SC0602} CP=4186.8*(0.616-.0040428*T1+1.8333e-5*T1**2-2.38e-08*T1**3)
  3. {INIT02} VAL=XG2D+YG2D
  4. {SORC01} CO=RG(1)*(RG(2)**2+H1**2)*(RG(2)+H1)
  5. {SC0601} EXCT=1./6*(EXP(TIM)+5.*EXP(-5.*TIM))

The tags are the quantities contained within the angular brackets, which precede the variable settings.
Their purpose is to define what kind of setting is being made, in order that the PLANT Fortran-writing subroutine knows where to place the corresponding coding.

The significances of the above statements are:

  1. Set the laminar viscosity of the fluid to be equal to:
      const1 * exp (const2 * (temperature - const3))

      where the three constants have previously been declared as reals, and given numerical values.

  2. Set the specific heat of the fluid to be the prescribed polynomial function of the temperature T1, which, because it is not a conventional PIL variable, must have been declared as a whole-field variable by a prior STORE statement.
    This is to be done at the point in the calculation indicated by the 06 following the SC (see below).

  3. Set the initial value of some whole-field variable (which will be selected by a following COVAL) to the sum of the local x and y coordinates.

  4. Set the source-defining COefficient in the following COVAL equal to the indicated algebraic function of the enthalpy H1, where the RGs are real variables recognised by PIL.

  5. Set the whole-field variable EXCT to the prescribed function of the current time, TIM.
    Probably this is being done in order that the numerical solution computed by PHOENICS can be compared with some exact solution.

As will be evident from the above explanations, PLANT statements do not stand on their own. Their significances depend on declarations and value ascriptions which have preceded them in the Q1 file, and on COVAL statements which immediately follow.

The connexion with COVALs will be explained in section 1.5.6. First, in section 1.5.5, a full account will be given of all the tags used by PLANT.


1.5.5 Tags, indicating for what the settings are to be used

The complete list of tags used by PLANT, with brief indications of what kinds of settings they denote, is as follows:

{INIT??}
for setting fields of initial values
{MXYZ??}
for setting body-fitted-grid cell-corner co-ordinates
{PRPT??}
for setting fields of material properties including those for interphase transport
{SCxx??}, where xx ranges from 01 to 10
for initiating actions in section xx of Group 19 of GROUND
{SCTS??}
for setting the value of the time step
{SCUF??}, {SCUS??}, {SCVF??}, {SCVS??}, {SCWF??}, and {SCWS??}
for setting additions to the velocities u, v and w, of the first and second phases, for use in convection-flux calculations
{SCXS??}, {SCYS??} and {SCZS??}
concerned with changing the x, y and z dimensions of the grid
{SORC??}
for setting sources

The first four characters after the { comprise the name of the tag.

The ?? which ends the tag is a two-digit number which must be inserted so at to distinguish two settings having the same name.

Further information about these tags, and where they are used is provided in the following table. The items are arranged in the order of the data-input groups which are conventional in the Q1 file.

Data-input group Tag name Setting GROUND group and section Call location
2 SCTS Time-step 2 At the start of each time step
3 SCXS x-grid ratio 3 start of slab
4 SCYS y-grid ratio 4 ditto
5 SCZS z-grid ratio 5 ditto
6 MXYZ BFC corner coordinates 19, sect 2 start of sweep
6 MXYZ BFC corner coordinates 19, sect 7 finish of sweep
7 PRPT radiation properties 9, sect 7 start of hydr. itrtn.
8 SCUF extra velocity 8, sect 1 convection-flux calculation
8 SCUS extra velocity 8, sect 2 convection-flux calculation
8 SCVF extra velocity 8, sect 3 convection-flux calculation
8 SCVS extra velocity 8, sect 4 convection-flux calculation
8 SCWF extra velocity 8, sect 5 convection-flux calculation
8 SCWS extra velocity 8, sect 6 convection-flux calculation
9 PRPT material properties 9, sect 1 start of hydr. itrtn.
10 PRPT inter-phase properties 10, sect 1 to 5 start of hydr. itrtn.
10 PRPT inter-phase properties 10, sect 1 to 5 start of hydr. irtn.
11 INIT initial fields 11 at PATCH evaluation time
13 SORC boundary conditions and sources 13, sect 1 and 12 at PATCH evaluation time
14 SORC down-stream pressure for parabolic 13, sect 1 and 12 at start of slab
15 to 23 SC01 various 19, sect 1 start of time step
15 to 23 SC02 various 19, sect 2 start of sweep
15 to 23 SC03 various 19, sect 3 start of IZ slab
15 to 23 SC04 various 19, sect 4 start of iteration
15 to 23 SC05 various 19, sect 5 end of iteration
15 to 23 SC06 various 19, sect 6 end of IZ slab
15 to 23 SC07 various 19, sect 7 end of sweep
15 to 23 SC08 various 19, sect 8 end of time step
15 to 23 SC09 various 19, sect 9 start of solution
15 to 23 SC10 various 19, sect 10 end of solution



1.5.8 Miscellaneous additional features

(a) Grid-free PATCH and COVAL qualifiers.

There are PLANT options which are aimed to provide the users with the means to plant the specific codings in a flow domain regions defined in terms of physical space coordinates rather than grid ones.

PLANT can use the grid free distribution of the marker, MARK, over the flow domain as a series of objects fitted in the arbitrarily specified cartesian grid.

The coding which is then PLANTed in GROUND contains logic for the mathematical expression to be tied up with the regions filled by the specific marker property.

The syntax of PATCH and COVAL qualifiers is as follows

         PATCH(SSmrkNAM,TYPE,1,NX,1,NY,1,NZ,1,LSTEP)
           {SORC01} CO  = { expression }
           {SORC01} VAL = { expression }
         COVAL(SSmrkNAM,V1,GRND,GRND)

Here SS ( Space Source ) stands for special PATCH name characters; mrk stands for the value of the MARK variable which is used to define the region over which expressions should be applied; and the last three characters, NAM, can be used arbitrarily.

Note that PATCH arguments are applied for the whole domain, not for a part of it.

Examples now follow.

Example 1, extracted from Case Y621 of the PLANT library, which should be examined if the full story is required.

 PATCH(SS111EAS,EAST,1,NX,1,NY,NZ,NZ,1,LSTEP)
   CO =SISBC(FIXFLU)
   VAL=SISBC(0.0/FIXFLU)
 COVAL(SS111EAS,U1,GRND,GRND)

This example shows how SISBC function is used to set automatically (guided by PRPS distribition ) zero-normal stress boundary conditions at the solid 111 -fluid interface as indicated by the PATCH name SS111??.

Example 2, extracted from Case Y619 of the PLANT library, which should be examined if the full story is required.

    ** 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 <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

The above example shows how the grid-free PATCH/COVAL qualifiers are used to introduce the number of settings together with interspersed comments of explanation and elaboration.

Many more examples can be found in sections 3 and 4 of this document.

(b) Reduced-format REGION and PLACE qualifiers.

It has been found that in many cases it is very convenient to use the REGION and PLACE qualifiers with reduced numbers of arguments. In what follows the reduced-format options will be described first for REGION and then for PLACE qualifiers.

REGION options are the variants of what follows:



PLACE options are the variants of what follows:

The above format options are widely used in PLANT library and many more examples can be found in sections 3 and 4 of this document.


Click here to return to start of section 1.5


Click here to return to start of section 1