As already mentioned, the intrinsic functions of FORTRAN can be freely used in PLANT expressions.

In addition, PLANT possesses some special functions of its own.

All settings using these functions have the following generic form:

VAR = FUNCTION NAME ( Arguments )

The table which follows gives a full description of each function.

Definitions and notes | Data-input group | Function name | Variable name | Type of arguments | No. of arguments |

3D box marker | 8, 11, 13-23 | BOX | MARK | Real expression | 17 |

Ellipsoid marker | 8, 11, 13-23 | ELLPSD | MARK | Real expression | 17 |

Sphere marker | 8, 11, 13-23 | SPHERE | MARK | Real expression | 5 |

XY-plane box marker | 8, 11, 13-23 | XYBOX | MARK | Real expression | 7 |

XY-plane circle marker | 8, 11, 13-23 | XYCIRC | MARK | Real expression | 4 |

XY-plane ellipse marker | 8, 11, 13-23 | XYELLP | MARK | Real expression | 7 |

XY-plane wedge marker | 8, 11, 13-23 | XYWEDG | MARK | Real expression | 7 |

YZ-plane marker | 8, 11, 13-23 | YZBOX | MARK | Real expression | 7 |

Distortion of solids, BFC | 6 | DISPLC | XC, YC | Real expression | 1 |

Distortion of solids, CARTES | 19 | DISPLS | PRPS | Real expression | 3 |

Displacement boundary conditions | 13 | SISBC | CO, VAL | Real expression | 1 |

Global summation | 2-5, 8, 15-23 | SUM | Real CDV | Real expression | 1 |

Four examples now follow.

**Example 1**, extracted from Case Y612 of the PLANT library, which
concerns the setting of initial values by means of the SPHERE function.

In above settings the coordinates of SPHERE 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. Each cell of the pipe has the marker MARK=0.0.FIINIT(MARK)=1.0 PATCH(INI01,INIVAL,1,NX,1,NY,1,NZ,1,1) {INIT01> VAL=SPHERE(0.,XG2D,XG2D,XG2D,2.5) INIT (INI1,MARK,0.,GRND)

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

The flow in the 4th slab of rectangular flow domain is initialized by making use the different distributions over specifically MARKed regions so as to have better accord with imposed geometry. The latter is the circle chamber with two tangentiall passages.

FIINIT(MARK)=1.0 PATCH(INIT70,INIVAL,1,NX/2,1,NY,4,4,1,1) {INIT70} VAL=XYELLP(2.,10.,10.,8.,8.,0.,0.) INIT (INIT70,MARK,0.,GRND)

In above statement, XYELLP function is used to make the half-circle of 16 m diameter as follows:

a) In the west half of 4th slab,

b) place the ellipse marked by 2 (1st argument), with the centre at XC=10 m (2nd argument) and YC=10 m (3rd argument) and both half-axes equal to 8 m ( 4th and 5th arguments).

c) The 6th and 7th function arguments are insignificant for the circle shape and CARTES=T.

PATCH(INIT71,INIVAL,NX/2+1,NX,1,NY,4,4,1,1) {INIT71} VAL=XYELLP(3.,10.,10.,8.,8.,0.,0.) INIT (INIT71,MARK,0.,GRND)

In above statement, XYELLP function is used to make the half-circle of 16 m diameter in the east half of the domain. The cells inside ellipse are marked by 3.

PATCH(INIT08,INIVAL,1,NX/2,1,NY,4,4,1,1) {INIT08} VAL=XYELLP(4.,10.,17.,100.,1.,0.,0.) INIT (INIT08,MARK,0.,GRND)

In above statement, XYELLP function is used to make the rectangular of 2 m width and 10 m length, tangential to the circle, as follows:

a) In the west half of 4th slab,

b) place the ellipse marked by 4 (1st argument), with the centre at XC=10 m (2nd argument) and YC=17 m (3rd argument), large (100.m) X-direction half-axis (4th argument) and Y-direction half axis equals to 1.m (5th argument).

c) The 6th and 7th function arguments are insignificant for the circle shape and CARTES=T.

PATCH(INIT09,INIVAL,NX/2+1,NX,1,NY,4,4,1,1) {INIT09} VAL=XYELLP(5.,10.,3.,100.,1.,0.,0.) INIT (INIT09,MARK,0.,GRND)

In above statement, XYELLP function is used to make the rectangular of 2 m width and 10 m length, tangential to the circle, in the east half of the domain. The cells inside ellipse are marked by 5.

PATCH(INIT11,INIVAL,1,NX/2,1,NY,5,NZ,1,1) {INIT11} VAL=ELLPSD(6.,10.,16.,12.,100.,2.,2.,$ 0.,RG(2),RG(2),RG(2),0.,RG(2),RG(2),RG(2),0.,0.) INIT (INIT11,MARK,0.,GRND)

In above statement, ELLPSD function is used to make the cylinder of 2 m radius, tangentially joining the sphere, as follows:

a) In the east half of the section,

b) place the ellipsoid marked by 6 (1st argument), with the centre at XC=10 m (2nd argument), YC=16 m (3rd argument) and ZC=12 m (4th argument).

c) X-direction ellipsoid half-axis (5th argument) is set to large (100.m) value to ensure that the shape of ellipsoid is virtually cylindrical.

d) The Y- (6th argument) and Z- (7th argument) directions half-axis are set to be cylinder radia, 2 m.

e) The arguments 8.9 and 10 set zero angle between ellipsoid X-axis and corresponding cartesian frame direction, while the angles between the former and other frame directions are kept 90 degrees.

f) The arguments 11.12 and 13 set 90 degree angle between ellipsoid Y-axis and X-cartesian frame direction, the angle between the former and the Y-cartesian frame direction is nulified and angle between ellipsoid Y-axis and Z-frame direction is kept 90 degree.

g) The arguments 14.15 and 16 set 90 degree angles between ellipsoid Z-axis and X-, Y-cartesian frame directions, while the angle between the former and the Z-cartesian frame direction is nulified.

h) The 17th argument, set to zero, is insignificant for CARTES=T.

PATCH(INIT12,INIVAL,NX/2+1,NX,1,NY,5,NZ,1,1) {INIT12} VAL=ELLPSD(6.,10.,4.,12.,100.,2.,2.,$ 0.,RG(2),RG(2),RG(2),0.,RG(2),RG(2),RG(2),0.,0.) INIT (INIT12,MARK,0.,GRND)

In above statement, ELLPSD function is used to make the cylinder of 2 m radius, tangentially joining the sphere for the west half of the section as explained earlier.

**Example 3**, extracted from Case Y613 of the PLANT library, which
should be examined if the full story is required.

1. Drilling the sphere in cylinder

CARTES=F PATCH(INI1,INIVAL,1,NX,1,NY,1,NZ,1,1) {INIT01} VAL=SPHERE(1.,10.,10.,10.,5.) INIT (INI1,MARK,0.,GRND)

Ih the above settings the sphere is "drilled-out" in cylinder. Crucial feature of this example is the specification of center coordinates: unlike for cartesian cases, the line of X=0 and Y=0 in cylindrical polar coordinate system has got the coordinates Xr=RV2D and Yr=RV2D in reference frame. It is the latter in which the arguments of geometrical functions must be specified.

2. Drilling the cylinder

{SC0601} MARK=0. IF(ISTEP.EQ.2.AND.LSWEEP.EQ.1) {SC0602} MARK=SPHERE(1.,10.,10.,ZGNZ,5.) IF(ISTEP.EQ.2.AND.LSWEEP.EQ.1)

This example seems to be even simpler than foregoing one. It deals with the "drilling-out" the cylinder cavity of 5 m diameter in coaxial cylindrical domain by spherical "drill bit". The "drilling " effect is activated by using the distances from Z=0 plane as coordinates of sphere centre.

3. Drilling the bullet shape

{SC0603} MARK=0. IF(ISTEP.EQ.3.AND.LSWEEP.EQ.1) {SC0604} MARK=SPHERE(1.,10.,10.,10.,5.) IF(ISTEP.EQ.3.AND.LSWEEP.EQ.1) {SC0605} MARK=XYCIRC(1.,10.,10.,5.) REGION(1,NX,1,NY,5,20,3,3) /LSWEEP.EQ.1

Another variant of "drilling" technique is used for specification of bullet-shape cavity. The shape is combination of stationary sphere and 2D circle "drill-bit". The "drilling" is activated by extents of REGION commands over which XYCIRC function is applied. The command PLACE may also be used with advantage to employ physical rather than cell numbers extents.

4. Drilling the annulus

{SC0606} MARK=0. IF(ISTEP.EQ.4.AND.LSWEEP.EQ.1) {SC0607} MARK=SPHERE(1.,15.,10.,ZGNZ,4.) IF(ISTEP.EQ.4.AND.LSWEEP.EQ.1)

This example differs from "drilling" the cylinder case mainly in shifting the axis of "drill bit" of 5 meter away from domain centre line.

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

** Primary inlet mass flux coefficient {SC0301} PRIMF=SUM(AEAST/(:PI:*:RAD1:**2)) TEXT(Primary inlet mass flux coefficient) REGION() 1 /ISWEEP.LE.2

Above, 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.

** Secondary inlet mass flux coefficient {SC0302} 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.

**Remarks** concerning the use of auxiliary functions:

- The above examples have illustrated some typical aspects of the ways in which the PLANT functions may be used.
- Many more examples can be found in sections 3 and 4 of this document.