3.1 Introduction
The user tells PLANT what and how to do by typing in Q1 file the statements and commands. They instruct PLANT. These instructions and their usage will be described and explained in this Chapter in basic details.
Throughout this document the number of terms and definitions will be used. They are described as glossary in Section 3.2.
An elementary description of how to use PLANT has already been provided in Section 2.4. It is desirable, but not necessary, that the latter should be read before the present Chapter.
In Sections 3.3 through 3.5 the rules of how to use the commands and statements are revisited. The aim is to provide the user with further in-depth details. Section 3.3 describes how a PLANT block should be composed. The explanations followed by necessary exemplifications of all statement elements are given in Section 3.4. Section 3.5 do the same with commands.
The Chapter ends with Section 3.6. It discusses how to apply the PLANT blocks for some typical problems.
___________________________________________________________________ ARGUMENTS ___________________________________________________________________
Information that is needed to be provided for command.
___________________________________________________________________ BLOCKS of instructions ___________________________________________________________________
The PLANT blocks are sets of instructions when placed in Q1 provide the relevant FORTRAN codings to be planted in certain places of GROUND.
A PLANT block is composed of elements, namely, statements, commands, pointers, PATCH/COVAL combinations and comments.
Click here to see how the PLANT blocks are built.
___________________________________________________________________ COMMANDS ___________________________________________________________________
Commands tell that user wants to use some special actions to be performed in PLANTed codings. A command is composed of the name, arguments, parameters and switches.
The following commands are recognised by PLANT:
They form the command sub-block of PLANT block of instructions.
Click here to see how to use commands. ___________________________________________________________________ COMMENTS ___________________________________________________________________
The useful comments can be a part of the PLANT blocks. As all PIL comments they must begin in the third column.
Click here for details of how to use them.
___________________________________________________________________ EXPRESSIONS ___________________________________________________________________
An expression is a mathematical expression of algebraic nature for computing a value of VARiable. Expressions consist of operands and operators.
___________________________________________________________________ FUNCTIONS ___________________________________________________________________
A sub-set of the functions is provided to be used in the expressions.
The following list defines the available functions:
BOX , DISPLC, DISPLS, ELLPSD, SISBC, SPHERE, SUM, XYBOX, XYCIRC,
XYELLP, XYWEDG, YZBOX .
Click here for details of how to use them.
___________________________________________________________________ HEADINGS ___________________________________________________________________
A statement's heading plays the important role of special label. It enables PLANT to make the decision of where is the appropriate place in GROUND for FORTRAN to be written-in.
A set of the headings with their current names is as follows:
{INIT??}, {MXYZ??}, {PRPT??}, {SC01??}, {SC02??}, {SC03??}, {SC04??}, {SC05??}, {SC06??}, {SC07??}, {SC08??}, {SC09??}, {SCTS??}, {SCUF??}, {SCUS??}, {SCVF??}, {SCVS??}, {SCWF??}, {SCWS??}, {SCXS??}, {SCYS??}, {SCZS??}, {SORC??}.
Click here for more information.
___________________________________________________________________ OPERANDS ___________________________________________________________________
The operands can be function references, stored or solved variables, standard GROUND variables and declared constants.
Click here for more information.
___________________________________________________________________ OPERATORS ___________________________________________________________________
The operators specify the actions to be performed on the operands.
Click here for more information.
___________________________________________________________________ PARAMETERS ___________________________________________________________________
Information that is needed to be provided before PLANT takes care of its commands.
Click here for more information.
___________________________________________________________________ PHI ___________________________________________________________________
It is a term used in documentation to denote, generically, the conserved quantities for which PHOENICS solves.
___________________________________________________________________ PIL Commands ___________________________________________________________________
The PHOENICS Input Language commands which are used in PLANT blocks are PATCH, COVAL and INIT.
___________________________________________________________________ POINTER ___________________________________________________________________
POINTERS are those PIL statements which assign the values of integer flags to be equal to real flags of particular significance to PLANT.
One of the flags, named GRND, is of special importance for PLANT.
It has the numerical value -10110.0. To set a quantity to GRND is a pointer that the EARTH program is to look in the appropriate place in subroutine GROUND for user-provided and PLANT-coded information.
For example,
RHO1=GRND
means that a sequence in Group 9 of GROUND is to sought, in which coding is planted for the settings of first phase density.
Coefficients and values must also be set to GRND, for the non-linear sources to be calculated by planted formulae.
Once used, the pointers must be followed by PLANT instruction block.
___________________________________________________________________ RELATIONSHIPS ___________________________________________________________________
A relationship is a formula to compute the VARiable value in the form of:
VAR = { EXPRESSION }
See VARIABLES and EXPRESSIONS for further reference.
Click here to see how the relationships are built.
___________________________________________________________________ STATEMENTS ___________________________________________________________________
The statements tell PLANT what to do by way of identification headings and relationships.
A statement is composed of lines; and lines are composed of the characters and symbols representing the statement's headings and relationships.
The statements are composed in sub-blocks of certain structure.
See RELATIONSHIPS for further reference.
___________________________________________________________________ SWITCHES ___________________________________________________________________
A parameter that alters the action of a command. A switch is represented by a forward slash, /, followed by logical expression in FORTRAN format.
___________________________________________________________________ TYPE of VARIABLE ___________________________________________________________________
User of PLANT should distinguish between the following variables:
FFV's = Full-Field Variables which have a stored value for each cell of the grid;
RNV's = Real-Number single-value Variables which have but one distinct value;
The following RNV's are recognised by PLANT:
DT, DTFALS(PHI), DZ, RG's, RESREF(PHI), VARMAX(PHI), VARMIN(PHI), XRAT, YRAT.
See PHENC for their meanings.
RFV's = Real-Function full-field Variables which have the value for each cell of the grid computed in EARTH by its real function subroutines;
The following RFV's are recognised by PLANT:
XC, YC, ZC, XCO, YCO, ZCO.
CDV's = Command-Declared Variables which have but one distinct value and are automatically declared to be used by PLANT command of global summation feature.
There is a table which summarizes the information to give a basic description of variable types used in relationships.
___________________________________________________________________ VARIABLES ___________________________________________________________________
A VARiable name, the value of which is to be computed .
___________________________________________________________________
PLANT blocks describe and specify the elements of the codings "planted" in GROUND, as well as the actions the resulting program will take.
The PLANT block is a fragment of Q1 file - it contains block elements: statements and commands, placed in certain order. The latter establishes the format of the block.
The PLANT block format can be summarized as follows:
1. Comment
2. Statement sub-block
3. PIL command
4. PLANT command sub-block
=> Examples:
(1)
PATCH(NAME,VOLUME,1,NX,1,NY,1,NZ,1,LSTEP) >>The beginning of the source block<< | -> Comment. {SORC01> CO = RG(1)*SQRT(U1**2+V1**2) | -> Statement {SORC02> VAL= U2 | block. COVAL(NAME,VAR,GRND,GRND) | -> PIL command. REGION(5,10,6,NY,5,NZ,1,2) | -> PLANT command IF(ISWEEP.GT.10) | block. >>The end of the block for source<< | -> Comment.(2)
** Secondary inlet mass flux coefficient * Cartesian area/correct area: {SC0302> SECNF=SUM(AEAST/(:PI:*(:RAD2:**2-:RAD1:**2))) TEXT( Secondary inlet mass flux coefficient) REGION(1,NX,1,NY,1,NZ) 2(3)
** Density of the first stream RHO1=GRND {PRPT01> DEN1=:COEF:/H1 REGION() /LG(1) ** Viscosity of the first stream ENUL=GRND {PRPT02> VISL=RG(1)*SQRT(TEM) IF(LG(1)) PRNDTL(H1)=GRND ** Prandtl number in 2nd domain {PRPT03> LAMPR(H1)=VISL*DEN1*RG(2)/RG(3) REGION() 2
The description of the block elements will now follow.
Comments, as well as blank lines, should not affect PLANT execution in any way. They can be placed freely anywhere in Q1 file but there must be neither comments no blank lines both inside and between the block elements. The following PLANT blocks are therefore invalid:
PATCH(SS111B,TYPE,1,NX,1,NY,1,NZ,1,TLAST) {SORC77> CO = { expression } Invalid comment: Above are the formula for COefficient {SORC77> VAL = { expression } Invalid comment: Above are the formula for VALue COVAL(SS111B,U1,GRND,GRND)< {SC0808> HEAT= { expression } Invalid comment: This is how ... REGION(1,NX-1,5,NY-2,NZ-3,NZ) 185
The statement sub-block is a PLANT block element - it is composed from up to three statements placed in certain order, as follows:
(1) Single statement for all Groups except Group 6 and Group 13.
(2) Up to two statements in fixed order for Group 13:
- Statement to calculate the source coefficient, CO, and/or
- Statement to calculate the source value, VAL.
(3) Up to three statements for body-fitted-coordinate arrays of Group 6:
- Statement to calculate a value of an element, XC, of the X-coordinate array;
- Statement to calculate a value of an element, YC, of the Y-coordinate array;
- Statement to calculate a value of an element, ZC, of the Z-coordinate array;
All statements for calculations of the COefficients and/or VALues of the sources in Group 13 and initial VALues in Group 11 must be immediately followed by the PIL commands either COVAL or INIT correspondingly.
The following rules summarize the structure of PLANT command sub-block:
- The TEXT commands, if present, must immediately follow the statements headed by {SCnn??}, and must precede the REGION or PLACE command.
- The REGION or PLACE commands, if present, must immediately follow the {SC????} statements and COVAL command. If there is a TEXT command it must be located before REGION/PLACE commands.
- The IF commands, if used, must close the PLANT block following immediately the REGION or PLACE commands.
In other words, the PLANT command sub-block format is as follows:
1. TEXT
2. REGION/PLACE
3. IF
All PLANT statements should always be expanded as in-line relationships. PLANT line begins with headings and should have blanks in columns one and two and statements should be written in columns 3 through 68.
The PLANT statement syntax can be summarized as follows:
{Heading> RELATIONSHIP,
where RELATIONSHIP represents a formula to compute the value.
The following is PLANT block comprising the statement lines for the components of linearised source term::
** Source term for g PATCH(SORG,VOLUME,1,NX,1,NY,1,NZ,1,1) * The next two lines are PLANT statements {SORC77> CO = 2.0*:RHO1:*EPKE {SORC77> VAL = GENG/(2.0*:RHO1:*EPKE+TINY) COVAL(SORG,G , GRND ,GRND )
Where, {SORC77> stand for headings, COefficient and VALue take the place of VARiable. The corresponding { expression }s comprise two times first phase density times epsilon divided by kinetic turbulence energy for the former and stored variable GENG divided by sum of CO and small number, TINY for the latter. The statement comment line begins with asterisks (*).
A continuation lines increase the room available to write the statements. The number of continuation lines in PLANT 3.1 is limited only by the 500 character length limit for statements. Dollar sign ($) as the last character on a line is treated as a continuation symbol as following block illustrates:
** PLANT statement with continuation sign, $ {SC0603> GAV=ABS(CAV-16./16)*F1 + ABS(CAV-15./16.)*F2 +$ ABS(CAV-14./16)*F3 + ABS(CAV-13./16.)*F4 +$ ABS(CAV- 0./16)*F17
In order to identify a statement, user must identify both its definitions and numbers. The statement definition is identified by its name. The combination of name and number that identifies the statement is called heading.
The heading is both an adress - it indicates the certain place in the GROUND file into where PLANT must write the FORTRAN equivalent of the PLANT block, and a formula-distinguishing label.
A heading is represented in PLANT statement as string of four meaningful characters, heading name, ending with two wildcards, inside greater-than and less-than signs. eg
{SCTS??},
where SCTS stands for the name and ?? are wildcards.
The headings currently available are shown in the following table.
Data- Heading Definition Group and Section Call input name of GROUND to find group planted codings 2 SCTS Time-step 2 At the start of each time step. 3 SCXS X-grid 3 At the start of ratio the current z-slab when the geometry is being calculated. 4 SCYS Y-grid 4 As for Group 3 ratio 5 SCZS Z-grid 5 As for Group 4 step 6 MXYZ BFC- 19, Section 2 At the start of coordinates sweep. 19, Section 7 At the finish of sweep. 7 PRPT Radiation 9, Section 7 At the start of properties the hydrodynamic iteration at the current IZ slab. 8 SCUF Extra 8, Section 1 At the stage in the SCUS velocities Section 2 computations at SCVF U, V and W Section 3 which the SCVS for First Section 4 convection fluxes SCWF and Second Section 5 are SCWS phases. Section 6 assembled. 9 PRPT Properties 9, Section 1 At the start of of the to 15 the hydrodynamic medium iteration at the (or media) current IZ slab. 10 PRPT Inter- 10, Section 1 At the start of phase- to 5 the hydrodynamic transfer iteration at the processes current IZ slab and and when the properties interphase terms are being assembled for variable PHI. 11 INIT Non- 11 For the values of uniform variable over the initial current patch. conditions 13 SORC Boundary 13, Section 1 For each slab IZ " " conditions " Section 12 four times in and special the range of sources arguments taken from the PATCH. 14 SORC Downstream 13, Section 1 As for Group 13 " " pressure " Section 12 for parabolic flows. 15 SC01 Inter- 19, Section 1 Start of time step. .. SC02 ventions Section 2 Start of sweep. .. SC03 in Section 3 Start of iz slab. .. SC04 calculation Section 4 Start of iteration. to SC05 and Section 5 End of iteration. .. SC06 special Section 6 Finish of iz slab. .. SC07 output Section 7 Finish of sweep. .. SC08 preparation Section 8 Finish of time step. .. SC09 Section 9 Start of solution. 23 SC10 Section 10 Finish of solution.
Each PLANT statement of the same nature should have a unique number, ??, in the range of 01 to 99. These numbers can be regarded as formula-distinguishing labels, local to the specific relationship.
That is, the number assigned to any headings must be different from the number assigned to any other heading of the same name. However, the headings labelling the statements of different names may have the same number.
The
PATCH(NAME,CELL,1,NX,1,NY,1,NZ,1,LSTEP) {SORC01> CO = { COexpression } {SORC01> VAL = { VALexpression } COVAL(NAME,PHI,GRND,GRND)
Even though two statements have got the same heading , each will be uniquelly identified by its VARiable (CO or VAL) of the planted relationship.
The following block is also valid:
PATCH(NAME,CELL,1,NX,1,NY,1,NZ,1,LSTEP) {SORC01> CO = { COexpression } {SORC10> VAL = { VALexpression } COVAL(NAME,PHI,GRND,GRND)
The former practice is recommended because it makes explicit distinction between the components of the same, SSN=01, source.
When user refers to a heading number, PLANT uses it as a unique labels in the FORTRAN blocks it creates. That is why, the care is needed to avoid the appearance of the same heading numbers within different blocks, eg. within different PATCH/COVAL combinations.
(d) How to build relationships
PLANT relationship comprises the VARiable names as left hand side and algebraic expression at the right hand side of the formula to produce value of variable, ie its format is as follows
VAR = { EXPRESSION } .
In what follows the variable names permissible in relationships will be considered first. Then the basic operands and operators of expressions will be listed.
The table which follows contains the list of variables names which are recognised by PLANT and permitted for use as VAR.
Data-input VARiable Specific VARiable type group name meaning Group 2 DT Time-step. RNV RG Real array. RNV Command- Summation CDV Declared. function. Group 3 XRAT Multiplier. RNV RG Real array. RNV Command- Summation CDV Declared. function. Group 4 YRAT Multiplier. RNV RG Real array. RNV Command- Summation CDV Declared. function. Group 5 DZ Z-step size. RNV RG Real array. RNV Command- Summation CDV Declared. function. Group 6 XC Corner RFV YC cartesian RFV ZC coordinates. RFV Group 7 LAMPR(RADX) Radiation FFV LAMPR(RADY) flux FFV LAMPR(RADZ) diffusivities. FFV Group 8 VELAD Extra velocity FFV RG Real array. FFV Command- Summation CDV Declared. function. Group 9 D1DP , D2DP , Properties FFV LEN1 , LEN2 , of FFV VISL , VIST , the medium FFV DEN1 , DEN2 , (or media). FFV TEMP1, TEMP2, FFV FII1 , FII2 , FFV ISPH1, ISPH2, FFV LAMPR(PHI). FFV Group 10. COI1(PHI), Interphase- FFV COI2(PHI), transfer FFV INTFRC, properties. FFV INTMDT, FFV LD12. FFV Group 11. VAL Initial FFV value. Group 13. CO Coefficient. FFV VAL Value. FFV Group 14. CO Downstream FFV VAL pressure. FFV Group 15. RESREF(PHI) Reference RNV residual. RG Real array. RNV Command- Summation CDV Declared. function. Group 17. DTFALS(PHI) False-time RNV step. RG Real array. RNV Command- Summation CDV Declared. function. Group 18. VARMAX(PHI) Maxlimit. RNV VARMIN(PHI) Minlimit. RNV RG Real array. RNV Command- Summation CDV Declared. function. Group 19. Any STOREd, User FFV SOLVEd and declared. FFV Command- Summation CDV Declared. function. Group 23. Any STOREd, User FFV SOLVEd declared. FFV Command- Summation CDV Declared. function.
The basic operands used in expressions are as follows:
- Arithmetic constants;
- User-data transfered via RG and IG;
- Symbolic names for constants declared in Q1 file and placed between the colons;
- Stored, solved or/and permitted for use in GROUND variable names;
- F-array-element references and
- Function references.
The algebraic expressions are built from the basic operands in the preceding list, using parentheses and the conventional arithmetic operators provided by FORTRAN +, -, *, / and **.
(e) How to use indicial operands
PLANT allows for mathematical expressions to be planted into the GROUND to operate straightforwardly with either in-cell or its nearest neighbours, i.e. " old", "high", "north" and "east" field variables referenced by their names, OLD(PHI), HIGH(PHI) etc. as the example below shows
{SC0601> NU=RG(1)*ABS(TEM-NORTH(TEM))/YG2D REGION(1,1,1,NY,1,NZ,1,1)
PLANT is also taught to work not only with fixed elements of PHOENICS global F-array. PLANT can manipulate whole segments of array which contain variables of defined class. The latter feature greatly facilitates the building up sophisticated indicial expressions which otherwise would require in-depth knowledge of GROUND-EARTH-SATELLITE interior connections and number of special rules and techniques.
The built-in technique employs efficient procedural operators to build indexed expressions right in Q1. This is done by way of straightforward using of cell-location-coordinate indeces in three coordinate directions instead of their linear functions as for conventional GROUND coding.
Some examples of how to handle indeces now folllow.
(i) Fixed indeces in PLANT expressions
- The operand PHI[1,2,3] in PLANT expression stands for the value
of dependent variable at the cell IX = 1; IY = 2 and IZ = 3.
- PHI[1,,] stands for the value of dependent variable at the
cells of IX = 1; IY = IY and IZ = IZ.
- PHI[,NY,] stands for the value of dependent variable at the
cell of IX = IX; IY = NY and IZ = IZ.
(ii) Expressions with indeces relative to the current cell location
Index PHOENICS PLANT required integer function operand P - PHI or PHI[,,] E EAST(PHI) PHI[+1,,] N NORTH(PHI) PHI[,+1,] H HIGH(PHI) PHI[,,+1] NN HH W - PHI[-1,,] | / S - PHI[,-1,] NW N H L - PHI[,,-1] / | / EE - PHI[+2,,] WW--W--P--E--EE NN - PHI[,+2,] / | / HH - PHI[,,+2] L S SE WW - PHI[-2,,] / | SS - PHI[,-2,] LL SS LL - PHI[,,-2] NW - PHI[-1,+1,] SE - PHI[+1,-1,] and so on...
(iii) Further example
The following PLANT block placed in Q1 file provides the calculations of pressure field at each IZ-slab relative to the pressure at the cell of IX=1, IY=1 and IZ=1.
STORE(PNEW) {SC0601> PNEW=P1-P1[1,1,1]
(f) How to use utility functions
A set of the function provided by FORTRAN can be freely used in the expressions. The Appendix 3 contains an alphabetical list of the intrinsic function names most frequently used in the applications. Their definitions, types, arguments and usage are the same as in FORTRAN. The corresponding manuals should be consulted for comprehensive function list and more details.
While the above functions generally perform relatively small task, the actions of PLANT utility functions are designed to have larger effects.
A library of utility functions is available for calculation of marker distributions in the flow domain. The latters are used to represent the inserts of complex shapes, moving objects, solid shape distortions, region identifications etc.
The specific function named SUM is provided. It plants the GROUND coding in GROUP 19 to calculate the single value or the number of single values as a result of execution of the summation over the whole domain ( or over the specified part of flow domain ) for the expression specified as an argument.
All relationships using utility functions have got the generic format as folllows
VAR = FUNCTION NAME ( Arguments )
The table which follows give the full description of each function provided by PLANT.
Definitions Data-input Function VARiable Type of No. of and notes group name name arguments arguments 3D box 8, 11, BOX MARK Real 17 marker 13-23. expression Distortion 6 DISPLC XC Real 1 of solids YC expression Distortion 19 DISPLS PRPS Real 3 of solids expression Ellipsoid 8, 11, ELLPSD MARK Real 17 marker 13-23. expression Displace- 13 SISBC CO Real 1 ment VAL expression boundary conditions Sphere 8, 11, SPHERE MARK Real 5 marker 13-23 expression Global 2-5, 8, SUM Real Real 1 summation 15-23 CDV expression XY-plane 8, 11, XYBOX MARK Real 7 box marker 13-23. expression XY-plane 8, 11, XYCIRC MARK Real 4 circle 13-23. expression marker XY-plane 8, 11, XYELLP MARK Real 7 ellips 13-23. expression marker XY-plane 8, 11, XYWEDG MARK Real 7 wedge 13-23. expression marker YZ-plane 8, 11, YZBOX MARK Real 7 box 13-23. expression marker
(g) How are the statements applied
If the statements are used as only instructions, PLANT would assume, since it was not told it differently, that the user wanted to consider the whole flow domain, in space and in time, as a place to apply the typed-in-Q1 relationships.
Although in Group 13, the PATCH command can be used to define spatial and temporal extent of planted sources in the domain of integrations, PLANT is provided with its own means of statement handling.
User can tell PLANT how to handle the statements by language of the commands it understands.
3.5 Using commands
All PLANT commands should always be expanded as in-one-line character string. Command line should have blanks in columns one and two and command should be written in columns 3 through 68. No continuation is allowed.
PLANT commands trigger a number of small internal programs. Each program performs a single, specific task. When the user typed-in the name of a command and it is read, PLANT call that program from its library.
The PLANT command syntax can be summarized as follows:
Command NAME ( arguments) {parameter} /{switch}
Parameters and switches must be separated from the command name and from each other by one or more spaces. One parameter and one switch are allowed only.
The table which follows summarizes a description of each command structure provided by PLANT.
Command Definition Type of No. of Type of Type of name of argument arguments arguments parameter switch IF Valid 1 None None logical Logical expression PLACE Spatial and 8 Real Valid temporal Real value of logical extent in variable expression physical MARK coordinates REGION Spatial and 8 Real Valid temporal Integer value of logical extent in variable expression grid MARK coordinates TEXT Characters 1 None None string upto Character 30 characters
(b) How to use parameters and switches
PLANT commands can make use of additional information about what the user wants to do. This information may be included by typing-in the parameter after typed command. Usually, the command will have a default - it will automatically perform its function in certain way if there is not typed-in parameter.
=> Example:
If PLANT is used to provide the different interphase laws for the different parts of solution domain occupied by two-phase mixture , REGION command may be used. Using the REGION command, PLANT may be told what marker value distinguishes one part of flow field from another. The marker value is a parameter.
If no parameters are used, PLANT assumes, that it is desired to consider the whole flow domain, in space and in time, as a place to apply the typed-in-Q1 interphase law.
Most of the PLANT commands can perform their functions in more than one way. The user specifies which way by typing short logical expression, in correct FORTRAN, after the command name. A logical expression is called a switch. A switch is preceded by slash (/) and may occupied the rest of the command line. No continuation is allowed. Switches are not required - one can use one switch, or no switches.
=> Example:
If PLANT is used to make the first-phase density being reciprocal to the first-phase enthalpy for the whole domain up to third time moment inclusively, but only when LG(1)=T in Q1, the following block of instructions should be typed-in:
RHO1=GRND {PRPT01> DEN1=1./H1 REGION(1,NX,1,NY,1,NZ,1,3) /LG(1)
The /LG(1) switch specifies that the relationship, DEN1=1./H1, will be used if LG(1)=T appears somewhere in Q1.
Simple logical expressions can be combined with the logical operators .AND.,.OR. and .NOT. to create arbitrary complex logical switches:
REGION(1,NX,1,NY,1,NZ,1,3) /LG(1).AND.ISWEEP.EQ.LSWEEP-10 REGION(1,NX,1,NY,1,NZ,1,3) /IX.GT.NX-10.AND..NOT.BFC
The switches allows the compact way to introduce short relational and logical conditions in PLANTed coding.
However, it is, sometimes, more convenient to use special command for introduction of IF ... THEN construct. The IF command ensures that the longer valid logical expression used as command argument conforms the correct FORTRAN planted in the right place.
=> Example:
The command with switch
REGION(1,NX,1,NY,1,NZ,1,3) /IX.GT.NX-10.AND..NOT.BFC
is equivalent to:
REGION(1,NX,1,NY,1,NZ,1,3) IF(IX.GT.NX-10.AND..NOT.BFC )
(d) How to make grid-free planting
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.
The following three ways to make grid-free planting are permitted:
(1) Using PLACE command
It is the most straightforward way because command PLACE is nothing more than conditional grid-free variant of PATCH.
(2) Using marker distribution
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 PLANT instructions for PATCH, COVAL and REGION commands is as follows
(i) For PATCH/COVAL combinations
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 MARK variable 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.
(ii) To cause PLANT to perform grid free codings in Group 19 the REGION command should be with parameter
REGION(1,NX,1,NY,1,NZ,1,LSTEP ) {mrk}
where mrk stands for marker, MARK, value.
=> Example:
The following lines
{SC0608> HEAT= { expression } REGION(1,NX,1,NY,1,NZ,1,LSTEP) 100
provide the application of expression for variable HEAT at the end of the iz-slab for the part of the flow domain marked by MARK=100.
(3) Over-writing PATCH arguments by parameterized REGION command
=> Example:
The following block initializes PRPS field to 100 over the extent of the PATCH where MARK is equal to unity
PATCH(SS001IN,INIVAL,1,5,2,3,8,20,1,LSTEP) {INIT32> VAL=100 INIT (SS001IN,PRPS,0.,GRND)
is equivalent to
PATCH(IN,INIVAL,1,NX,1,NY,1,NZ,1,LSTEP) {INIT32> VAL=100. INIT (IN,PRPS,0.,GRND) REGION(1,5,2,3,8,20,1,LSTEP) 1
where whole field extent of the PATCH named IN is brought in conformity with SS001IN PATCH extents by way of REGION command with unity parameter.
(e) How to affect the extents of the PATCHes
The foregoing example shows that the combination of PIL and PLANT commands can be used to change the extents of the PATCH. The example below shows how to replace the PATCH limits by extents in physical space.
=> Example.
If it is desired to replace the grid arguments of PATCHed source by grid-free limits, one can use the combination of PATCH, COVAL and PLACE commands as the following block shows:
SOLVE(P1,U1,V1) STORE(DUMMY) REAL(ANYVALUE);ANYVALUE=1234. PATCH(ZZZ,CELL,1,NX,1,NY,1,NZ,1,LSTEP) COVAL(ZZZ,U1,GRND3,GRND3) {SORC01> CO = ANYVALUE COVAL(ZZZ,DUMMY,GRND,ANYVALUE) PLACE(0.,1.,2.,5.6,0.45,3.0,1.,2.)
The result will be that source for U1 calculated as GRDm option of COefficient and GRNDn option for VALue will be applied over the extent of 0.0 to 1.0m in X-direction, 2.0 to 5.6m in Y-direction, 0.45 to 3.0m in Z-direction and 1.0 to 2.0s of time.
3.6 Commonly-used statements and commands
There are many combinations of PLANT and PIL commands and statements. Many of these constructs will never be used for they only apply to special situations or they are relics included for compatability with older versions. And some of the other constructs are used very occasionally. This section describes the handful of blocks that one may find to use most frequently.
(a) How to make the grid by parametric analitics
The temporal and spatial grids may be specified by way of parameterized analitical expressions. The following examples illustrate what the PLANT blocks may look like to set time-step sizes, the multipliers to change, slabwisely, the extents of the integration domain in X- and Y-directions, Z-direction step sizes and BFC grid coordinates.
=> Example: Time-step size
The PIL settings below followed the PLANT block
TFRAC(1)=-25.0; TFRAC(2)=1.0 TLAST=GRND {SCTS01> UAV = SUM (SQRT(U1**2+V1**2+W1**2)/(NX*NY*NZ)) TEXT(Arithmetic mean velocity) {SCTS02> DT=AMIN1(XULAST,YVLAST,ZWLAST)/UAV
will plant the coding to perform 25 time steps, the size of which being determined by smallest of the domain sizes divided by arithmetic mean of velocity magnitude. The latter will be dumped in GLOBCALC file of the working directory highlighted by character string TEXT command.
=> Example: X,Y ratios
It might be desired to set YRAT, the multiplier of the previous XULAST which gives the current YVLAST, to vary with Z so as to accommodate a boundary layer in parabolic calculations (PARAB=T), which would necessitate local determination of the width of the layer in order that edge velocities should be sufficiently close to the free-stream values.
The specification of the pointer followed by the statement
AZYV=GRND {SCYS01> YRAT=1.+0.5*DZ/(RG(1)+ZW)
gives the dependence similar to laminar boundary layer near the flat plate, where The RG is PIL-set parameter.
If the problem is stated in the X-Y plane, user should perform an exactly corresponding actions for the X-direction domain width, XULAST, so that performed above for XULAST using AZYV=GRND as a pointer, <SCXS??} as a heading and XRAT as variable name of the statement.
=> Example: Z-steps
The following statements may be used to make the step size DZ a fixed fraction, RG(1), of the calculation domain width XULAST in parabolic calculations for all IZ-slabs greater or equal to 5 when the number of cells in X-direction is greater than unity.
AZDZ=GRND {SCZS01> DZ=RG(1)*XULAST REGION(1,NX,1,NY,5,NZ,1,1) IF(PARAB.AND.NX.GT.1)
=> Example: BFC grid coordinates
When BFC equals T in Q1 file, user can introduce the formulae to calculate the corner coordinates of a body-fitted grid to create the geometry and corresponding grids by way of parametric analitics. PLANT therefore provides the possibility of amending these geometrical entities, say with time.
PLANT will place the corresponding codings in Section 2 of Group 19 of GROUND.FOR so that the geometry can be changed in accordance with time at first sweep for all time steps.
The format of PLANT statements in Q1 is as follows
{MXYZ01> XC= { expression } {MXYZ01> YC= { expression } {MXYZ01> ZC= { expression }
where the headings <MXYZ??} tell PLANT that the corresponding expressions should be coded to calculate the cartesian coordinates, XC, YC and ZC, of the corners of continuity cells.
For example, the settings
BFC=T REAL(LITTLER,TWOPI) LITTLER=1.0;TWOPI=2.0*3.14157 NX=8;NY=6;NZ=1 {MXYZ01> XC=:LITTLER:*FLOAT(J-1)/FLOAT(NY)* $ COS(:TWOPI:*FLOAT(I-1)/FLOAT(NX)) {MXYZ01> YC=:LITTLER:*FLOAT(J-1)/FLOAT(NY)* $ SIN(:TWOPI:*FLOAT(I-1)/FLOAT(NX)) {MXYZ01> ZC=FLOAT(K-1)/FLOAT(NZ) CSG1=PHI;CSG2=XYZ
set the BFC grid for a circle of unity radius in XY plane. The corner coordinates will dumped to X1 file and calculation results to P1 file for examination via PHOTON.
to calculate the grid described in terms of Fourier series dependending on time:
{MXYZ01> XC=RG(1)/FLOAT(NX)*FLOAT(I-1) {MXYZ01> YC=1/3.14157+$ RG(2)*((TIM-600)/4200)*SIN(XC-RG(3))-$ 2/3.14157*($ ((TIM-600)/4200)*COS(2*(XC-RG(3)))/3+$ ((TIM-600)/4200)*COS(4*(XC-RG(3)))/15+$ ((TIM-600)/4200)*COS(6*(XC-RG(3)))/35+$ ((TIM-600)/4200)*COS(8*(XC-RG(3)))/63+$ ((TIM-600)/4200)*COS(10*(XC-RG(3)))/99+$ ((TIM-600)/4200)*COS(12*(XC-RG(3)))/143)+$ RG(4)*FLOAT(J-1)/FLOAT(NY) {MXYZ01> ZC=RG(5)*FLOAT(K-1)/FLOAT(NZ)
It should be noted that RG(1), RG(2), RG(3), RG(4) and RG(5) are PIL which can be conviniently used to specify the parameterised analytical formulae.
(b) How to affect the material properties
Three options wil be exemplified: first one is for the whole domain settings, the next one illustrates how to set the properties over user specified space and time regions and the final will show how to set the properties in grid-free manner following the distribution of marker variable.
=> Example: Whole domain settings.
The following statements in Group 9 of Q1 file effect the reciprocate density dependence on enthalpy for the whole domain of integration:
RHO1=GRND {PRPT01> DEN1=1./H1
If, at the same time, the laminar viscosity equal to a constant times square root of temperature, TEM, and Prandtl number temperature dependence should be taken into account, the addition of following Q1 statements effect these features:
ENUL=GRND {PRPT02> VISL=RG(1)*SQRT(TEM) PRNDTL(H1)=GRND {PRPT03> LAMPR(H1)=VISL*DEN1*RG(2)/RG(3)
Here RG(1), RG(2) and RG(3) are used to transfer in GROUND the values of constant used in property expressions.
=> Example: How to set the properties over space and time regions.
to change the density over certain region in space and time. There are three ways to define the regions namely: the use of REGION command; the use of PLACE command and the use of IF command. These methods are detailed below.
When the statement is followed by REGION command the extents of the region over which the properties will be expressed by specified relationship are defined by the eight command arguments in terms of grid coordinates, numbers of cells, and numbers of the time moments. Thus, if the properties are applied over the extents of first IX (fstIX) to last IX (lstIX), first IY (fstIY) to last IY (lstIY), first IZ (fstIZ) to last IZ (lstIZ) and first time step (fSTEP) last time step (lSTEP), the followings are set after the the pointer:
RHO1=GRND {PRPT01> DEN1=1./H1 REGION(fstIX, lstIX, fstIY, lstIY, fstIZ, lstIZ, fSTEP, lSTEP) ENUL=GRND REGION(fstIX, lstIX, fstIY, lstIY, fstIZ, lstIZ, fSTEP, lSTEP) PRNDTL(H1)=GRND {PRPT03> LAMPR(H1)=VISL*DEN1*RG(2)/RG(3) REGION(fstIX, lstIX, fstIY, lstIY, fstIZ, lstIZ, fSTEP, lSTEP)
The REGION command has one switch. The switch /{...} sets the construct IF ... THEN ... ENDIF in planted codings. The logical conditions to specify the extents is a switch. Thus, the block
{PRPT01> DEN1=1./H1 REGION(1,NX,1,NY,1,NZ-5,1,LSTEP)
is equivalent to
{PRPT01> DEN1=1./H1 REGION(1,NX,1,NY,1,NZ,1,LSTEP) /IZ.LE.NZ-5
Note, that the extents in X and Y directions can not be changed by the switch.
(ii) The PLACE command
But suppose that the extents of the region are most conviniently defined in terms of physical, say, cartesian coordinates rather than by grid coordinates. The command PLACE is designed for this case. Its real number arguments instruct PLANT to convert them into the cell numbers for specified grid. The latters will be used as the limits of DO loops in planted codings.
Thus, if the problem is to apply, say, density law over the extents of the region west boundary location, CXF, to the region east boundary location, CXL; region south boundary location, CYF, to the region north boundary location, CYL; region low boundary location, CZF, to the region east boundary location, CZL and start time, FT, to end time, LT, the followings are set after the pointer:
RHO1=GRND {PRPT01> DEN1=1./H1 PLACE(CXF, CXL, CYF, CYL, CZF, CZL, FT, FL)
(iii) The IF command
To limit the extents of the region for properties applications, the use of command IF represents, sometimes, convenient way to do so as following blocks illustrate.
{PRPT02> VISL=RG(1)*SQRT(TEM) REGION(1, NX, 1, NY, 1, NZ, LSTEP-15, LSTEP)
is equivalent to
{PRPT02> VISL=RG(1)*SQRT(TEM) IF(ISTEP.GE.LSTEP-15)
By this way, just the extents in the time and Z-directions may be affected.
=> Example: How to set the properties in marked sub-domains
Continuing the previous examples, if the property correlations should be applied for the regions marked with the distribution of stored MARK variable, it may be done by specifying the parameter of REGION or PLACE commands as values of MARK dictate. It is shown below:
{PRPT03> LAMPR(H1)=VISL*DEN1*RG(2)/RG(3) REGION(fstIX, lstIX, fstIY, lstIY, fstIZ, lstIZ, fSTEP, lSTEP) 100
The number at the end of the command is the parameter. It instructs PLANT to do the codings which applies the formula specified by statement over all cells of the domain for which the MARK value is equal to 100.
(c) How to set the interphase-transport
All what have been said above of how to affect the material properties may be employed directly to to set the interphase- transport properties and processes.
=> Example:
Consider an inter-phase friction coefficient equal to a constant (CFIP1) times the in-cell mass of the first phase times the in-cell volume fraction of the second phase. It should be switched on for the regions marked with MARK=1 after the first five sweeps.
The following Q1 statements inserted in Group 10 effect this dependence:
RG(1)=CFIP1 CFIPS=GRND {PRPT01> INTFRC=RG(1)*MASS1*R2 REGION() 1 /ISWEEP.GT.5
PLANT supplies similar options for CMDOT=GRND, CINT(PHI)=GRND and CVM=GRND as shown in Chapter 4.
(d) How to make specific initialisation
First the question of how the initial values can be supplied in the form of analitical expressions will be exemplified. Then some commands, specific to region identifications, will be shown followed by the description of what and how can be done to place the inserts of complex shapes into the integration domain.
=> Example: Analitical Initialisation
Suppose that it is desired to initialise the w-velocity field to a parabolic profile over the last half ( in Z-direction ) of the domain:
the PIL commands
PATCH(LASTHALF,INIVAL,1,NX,1,NY,NZ/2+1,NZ,1,1) INIT(LASTHALF,W1,0.0,GRND)
instruct EARTH to visit group 11 of GROUND for an array of values for the field W1 at each slab within the sub-domain indicated by arguments 3 to 8 of PATCH.
The following statement inserted just above the INIT command does what is needed for PLANT to code group 11 of the GROUND:
{INIT01> VAL=RG(1)+RG(2)*YG2D+RG(3)*YG2D**2
It should be noted that RG(1), RG(2) and RG(3) are PIL parameters.
=> Example: How to identify the regions
The conventional PATCH command of PIL is the most frequently used device to define regions over which the initial values fields are to be set.
However, the PLANT commands REGION and IF may bring some usefull features to be beneficially exploited as will be shown in what follows.
If it is required to initialise the w-velocity field to a parabolic profile for Cartesian coordinate only, the PLANT block is appended by IF command as shown below:
PATCH(LASTHALF,INIVAL,1,NX,1,NY,NZ/2+1,NZ,1,1) {INIT01> VAL=RG(1)+RG(2)*YG2D+RG(3)*YG2D**2 INIT(LASTHALF,W1,0.0,GRND) IF(CARTES)
The alternative of the above is to use the IF arguments as a switch of dummy REGION command:
PATCH(LASTHALF,INIVAL,1,NX,1,NY,NZ/2+1,NZ,1,1) {INIT01> VAL=RG(1)+RG(2)*YG2D+RG(3)*YG2D**2 INIT(LASTHALF,W1,0.0,GRND) REGION() /CARTES
The block
PATCH(SS001INI,INIVAL,1,5,2,12,8,20,1,LSTEP) {INIT01> VAL=RG(1)+RG(2)*YG2D+RG(3)*YG2D**2 INIT (SS001INI,W1,0.,GRND)
will result in initialising W1 by analitical formula over extents of the domain governed by the last eight arguments, for the cells marked with MARK=1. The latter is indicated by PATCH name containing special characters, SS, and number 001.
The PATCH name SS001??? in the previous example may be avoided by the use of REGION command with switch being set to unity:
PATCH(001INI,INIVAL,1,NX,1,NY,1,NZ,1,LSTEP) {INIT01> VAL=RG(1)+RG(2)*YG2D+RG(3)*YG2D**2 INIT (001INI,W1,0.0,GRND) REGION(1,5,2,12,8,20,1,LSTEP) 1
PLACE command overwrites the PATCH limits by the grid-free extents in terms of the distances as follows :
PATCH(INI,INIVAL,1,NX,1,NY,1,NZ,1,LSTEP) {INIT01> VAL=RG(1)+RG(2)*YG2D+RG(3)*YG2D**2 INIT (INI,W1,0.0,GRND) PLACE(0.,1.,2.,5.6,3.,3.45,1.,2.)
IF command may be used to narrow the extents of the PATCHes inside its limits. The following block exemplifying it
PATCH(INI,INIVAL,IXF,IXL,IYF,IYL,IZF,IZL,ITF,ITL) {INIT01> VAL=RG(1)+RG(2)*YG2D+RG(3)*YG2D**2 INIT (INI,W1,0.0,GRND) IF(IZ.GE.IZF+1.AND.IZ.LE.IZL-1)
is equivalent to
PATCH(INI,INIVAL,IXF,IXL,IYF,IYL,IZF+1,IZL-1,ITF,ITL) {INIT01> VAL=RG(1)+RG(2)*YG2D+RG(3)*YG2D**2 INIT (INI,W1,0.0,GRND)
To have a more flexibility in overwriting extents of PATCH by way of IF commands, the REGION commands may be used first to enlarge the PATCH limits to the extents of the whole domain:
PATCH(INI,INIVAL,IXF,IXL,IYF,IYL,IZF,IZL,ITF,ITL) {INIT01> VAL=RG(1)+RG(2)*YG2D+RG(3)*YG2D**2 INIT (INI,W1,0.0,GRND) REGION(1,NX,1,NY,1,NZ,1,LSTEP) IF(IZ.GE.IZF+1.AND.IZ.LE.IZL-1)
The above block is identical to
PATCH(INI,INIVAL,1,NX,1,NY,2,NZ-1,1,LSTEP) {INIT01> VAL=RG(1)+RG(2)*YG2D+RG(3)*YG2D**2 INIT (INI,W1,0.0,GRND)
=> Example: Fitting markers into a prescribed grid
PLANT permits properties, sources and solid objects to be placed within pre-defined grids, their presence being signalled by the attachment of the corresponding fluxes and material-property values to the appropriate cells.
The grid can be cartesian, polar or BFC one, the fineness of which the user can control; but he concerns himself only with the construction of the marker distributions which constitute the shapes of the marked regions.
He is helped in the performance of this task by sufficiently varied set of special function, the selection, sizing and location of which are the user's main tasks.
For example, the next settings
FIINIT(MARK)=1.0 PATCH(INI1,INIVAL,1,NX,1,NY,1,NZ,1,1) {INIT01> VAL=SPHERE(0.,XG2D,XG2D,XG2D,2.5) INIT (INI1,MARK,0.,GRND)
will drill the circular tube from one corner of the cube to the opposite one.
In above settings the coordinate arguments of SPHERE function vary with X direction coordinate. For uniform grid it makes the SPHERE function to "drill" the circular diagonal pipe of 2.5 diameter in a cube the cells of which are marked by MARK=1. Each cell of the pipe has the marker MARK=0.0.
By this technique, the regions of various shapes can be marked and use for introduction of material properties, sources, intervention in the calculations and processing the results.
(e) How to introduce special sources
=> Examples: non-linear sources/sinks
The first example is one in which a known internal heat source per unit volume is present over a restricted portion of the domain, namely at IX=3 to 7, IY=2 to 20 and IZ=3 to 6. Suppose that this heat source per unit volume, q, is known to vary with position as follows:
q = ax + by + cz
The following PIL commands instruct PLANT to make necessary codings and EARTH to look for an array of values of the PATCH.
PATCH(HEAT,VOLUME,3,7,2,20,3,6,1,1) {SORC01> VAL=RG(1)*XG2D+RG(2)*YG2D+RG(3)*ZGNZ COVAL(HEAT,H1,FIXFLU,GRND)
The second example concerns the representation of a parabolic profile, in the y-direction, of W1 at the inlet plane IZ=1 by means of sources in group 13. The PIL statements required are:
PATCH(INLET,LOW,1,NX,1,NY,1,1,1,1) {SORC01> VAL=RG(1)*(RG(2)+RG(3)*YG2D+RG(4)*YG2D**2) COVAL(INLET,P1,FIXFLU,GRND) {SORC02> VAL=RG(2)+RG(3)*YG2D+RG(4)*YG2D**2 COVAL(INLET,W1,ONLYMS,GRND)
It should be noted that RG(1), RG(2), RG(3) and RG(4) are PIL parameters standing for density and three profile coefficients correspondingly.
The third example concerns the representation by a sink of momentum of a resistive force on the U1 velocity (due for example to the presence of stationary baffles). The momentum form of the force is:
-a*u**b
In linearised form, this source can be represented by a coefficient of a*u1**(b-1) and a value of zero. Thus the PIL statements are:
PATCH(BAFFLE,PHASEM,1,NX,1,NY,1,NZ,1,1) {SORC01> CO=RG(1)*U1**(RG(2)-1.) COVAL(BAFFLE,U1,GRND,0.0)
An equivalent can be effected by:
PATCH(BAFFLE,PHASEM,1,NX,1,NY,1,NZ,1,1) {SORC01> CO=RG(1)*U1**(RG(2)-1.) {SORC01> VAL=0.0 COVAL(BAFFLE,U1,GRND,GRND)
The latter should be used when the mathematical expressions are required to code both for COefficients and VALues.
Examples from PLANT library and Chapter 5 of this document contain many cases of this and more complex kinds.
(f) How to process the results
If user wants to manipulate with field variables for print-out or other purposes this can be achieved in more than one way.
The straightforward one is to declare the printed variable,say, Nusselt number, NU, as SOLVed and to TERM it to kill all transports and then provide its FIXVALing in accordance with required mathematical expression by means of PLANT.
This approach would result in unnecessary extra time to calculate Nu on all stages of solution procedure though only final values of dependent variables are required to assemble Nu.
More economical alternative is to ask PLANT to provide the codings in appropriate section of GROUND Group19 which are called by EARTH at the certain stages of the solution sequence.
The following PIL statements do what is needed to calculate Nu at the south wall for the uniform grid at the finish of IZ-slab:
{SC0601> NU=RG(1)*ABS(TEM-NORTH(TEM))/YG2D REGION(1,1,1,NY,1,NZ,1,1)
It should be noted that NORTH(TEM) denotes the north value of TEMperature and instruct PLANT to make the codings with acces to the north neighbours of the specified REGION.
The statements SOUTH(PHI), EAST(PHI), WEST(PHI), HIGH(PHI), LOW(HIGH) and OLD(PHI) perform the corresponding functions which are obviously indicated by their names.
In most cases, the mathematical formulae are represented in PLANT expressions almost in their "real-live" format. But, the appropriate substitutes should be invented if the relational logical expressions govern the composite nature of the formula in question. The examples below exemplify what has to be done.
=> Example: Step-wise formulae.
Relational logical limiters which otherwise are hard to introduce by way PLANT can be replaced by step-wise formulae using the intrinsic function, AMAX1 and/or AMIN1, as exemplified in extract from the problem of free-surface location calculation:
** Efective pressure gradient sources PATCH(DPDZ,CELL,1,NX,1,NY,1,NZ-1,1,lstep) {SORC01> VAL=(1.-1./(1000.*AMAX1((S1-0.05)/ABS(S1-0.05),0.)$ +1.*AMAX1((0.05-S1)/ABS(0.05-S1),0.)))$ *AHIGH*(HIGH(P1)-P1) COVAL(DPDZ,W1,FIXFLU,GRND) ** the flow density {SC0701> DENS=1000.*AMAX1((S1-0.05)/ABS(S1-0.05),0.)$ +1.*AMAX1((0.05-S1)/ABS(0.05-S1),0.)
=> Example: Piece-wise formulae
In order to plant GROUND coding for piece-wise algebraic formulae one has to convert them into single mathematical expression. The following PLANT statements exemplify the typical form of resulting expression.
{MXYZ01> XC=:LITTLER:*FLOAT(J-1)/FLOAT(NY)* $ COS(:TWOPI:*FLOAT(I-1)/FLOAT(NX)) {MXYZ01> YC=-:LITTLER:*FLOAT(J-1)/FLOAT(NY)* $ SIN(:TWOPI:*FLOAT(I-1)/FLOAT(NX)) {MXYZ01> ZC= 2.*FLOAT(K-1)/FLOAT(NZ)+ $ FLOAT(K-1)/FLOAT(NZ)*0.75*YC* $ AMAX1(0.,FLOAT(7-K)/ABS(FLOAT(7-K)+TINY))+ $ (1-FLOAT(11-K)/FLOAT(NZ))*0.5*YC* $ AMAX1(0.,FLOAT(K-6)/ABS(FLOAT(K-6)+TINY))- $ (1-FLOAT(11-K)/FLOAT(NZ))*0.5*YC* $ AMAX1(0.,FLOAT(K-11)/ABS(FLOAT(K-11)+TINY))+ $ (1-FLOAT(K-1)/FLOAT(NZ))*1.5*YC* $ AMAX1(0.,FLOAT(K-11)/ABS(FLOAT(K-11)+TINY))
=> Example: Using Fourier Series
This example of the statements is concerned with the use of Fourier Series to calculate complex 2D shape of the channel and related BFC grid as alternative to the previous example:
{MXYZ01> XC=12*1.5714/FLOAT(NX)*FLOAT(I-1) {MXYZ01> YC=8/:TWOPI:*RG(1)/RG(2)* $ (SIN(RG(2))*SIN(XC)+ $ SIN(3*RG(2))*SIN(3*XC)/9+ $ SIN(5*RG(2))*SIN(5*XC)/25+ $ SIN(7*RG(2))*SIN(7*XC)/49+ $ SIN(9*RG(2))*SIN(9*XC)/81+ $ SIN(11*RG(2))*SIN(11*XC)/121+ $ SIN(13*RG(2))*SIN(13*XC)/169+ $ SIN(15*RG(2))*SIN(15*XC)/225+ $ SIN(17*RG(2))*SIN(17*XC)/289+ $ SIN(19*RG(2))*SIN(19*XC)/361)+$ 2.*FLOAT(J-1)/FLOAT(NY) {MXYZ01> ZC=1.*FLOAT(K-1)/FLOAT(NZ)
- How to Make the selective activation
Some of the statements instruct PLANT to do the things which are more important and should be used more frequently than others. PLANT will need to refer to some FORTRAN fragment regularly and must be able to provide the user with buttons to find and to use them quickly without the need of recompiling and relinking.
The logical switches of those fragments will be specified by typing a special command or special switch in the command line as has been exemplified in Sub-section 3.5-b.
- How to do the Global Summation
The utility function SUM plants the GROUND coding in GROUP 19 to calculate the single value or the number of single values as a result of execution of the summation over the whole domain ( or over the specified part of flow domain ) for the expression specified as an argument.
This utility is followed by the mean to dump the resulting value(s) in special file called globcalc with the facility for labelling them.
=> Example:
{SC0601> R=sum(SQRT(U1**2+V1**2)) TEXT( Variable R ) REGION(1,NX-1,1,NY-1,1,1)
Here the line marked as {SC0601> contains the value to be computed, R, and the mathematical expression to be summed over the extent of the flow domain specified by REGION command. For the particular case shown, R will be the sum of velocity magnitudes at XY plane.
TEXT is a command to transmit up to 30 characters of text which will be printed in globcalc file as follows
Global calculations:
Variable R = 4.70132