A simple example is provided by library case 707, in which a sinusoidal temperature profile reduces in amplitude while retaining its shape.
The variation of temperature with time (plotted as the z-axis, increasing to the right) is shown by this contour plot.
In the just-shown In-Form statement, the formula for the initial profile was valid for the whole domain; there was therefore no need for an 'at' in the statement.
More often, however, different specifications of initial values are required for different parts of the domain. Localization by means of 'at' are therefore necessary.
Three distinct kinds of localization are possible:
PATCH(IINIT,INIVAL,1,NX,1,NY,1,NZ,1,1) (INITIAL of C1 at IINIT is XG+YG) (INITIAL of EXAC at IINIT is XG+YG+:TLAST:)for which no equivalent PIL statement exists. In this case, C1 is a solved-for variable; it is therefore given an initial distribution only for the first time step.
EXAC, by contrast, is an auxiliary variable which represents the exact solution of the problem; and, since its values vary with time, it has to be initialised at each time step, this being effected by the TLAST in the formula.
However, although 'at IINIT' does appear in the statement, examination of the arguments of the patch show that it extends over the whole domain; therefore, omitting all mention of IINIT would give the same result.
The fields correspond to:
As a consequence, the oil scarcely penetrates to the surface, as this contour plot shows.
The object is a sphere, the material of which is the domain fluid (i.e. unusually, not a solid) and it is given a non-uniform initial enthalpy distribution by means of a formula with a 'with if' condition. This produces an initial field which is printed in the RESULT file (for iy=5) as:
Field Values of H1 IX= 10 0.0 0.0 0.0 0.0 0.0 IX= 9 0.0 0.0 0.0 0.0 0.0 IX= 8 0.0 1.860E+01 0.0 0.0 0.0 IX= 7 0.0 1.740E+01 1.740E+01 0.0 0.0 IX= 6 0.0 1.580E+01 1.580E+01 1.580E+01 0.0 IX= 5 0.0 1.400E+01 1.400E+01 1.400E+01 0.0 IX= 4 0.0 1.240E+01 1.240E+01 0.0 0.0 IX= 3 0.0 1.120E+01 0.0 0.0 0.0 IX= 2 0.0 0.0 0.0 0.0 0.0 IX= 1 0.0 0.0 0.0 0.0 0.0 IZ= 6 7 8 9 10in which the specified variation with x and cut-off below iz=7 can be clearly seen.
It is not implied that anyone would desire such a bizarre initial enthalpy field, merely that, if anyone did, In-Form would make it possible, which PIL on its own, whether accessed via the VR-Editor or not, is unable to provide.
There is no need to present more examples of this capability of In-Form; for another of its capabilities, also connected with initial values deserves more attention.
Now In-Form allows the use of its own objects, the positions and shapes of which are marked by the cells which they occupy; and it provides formula-based means for defining those cells.
It should be recognised from the start that In-Form objects occupy cells either wholly or not at all; they cannot at present, as facet-described (i.e. 'VR') objects can, occupy only part of a cell. This limitation may be removed in the future.
For example, an initial value is attached to an In-Form object by way
of a statement such as:
(INITIAL of PRPS at PATCH1 is 0.0 with INFOB_1)
wherein it can be seen that In-Form objects, here INFOB_1, are always associated with patches.
All this will be explained below. What must first be described however is how In-Form objects are actually created,
(INFOB at PATCHNAME is Formula with INFOB_N)
The INFOB statement acts by 'tagging' the cells of which the centre lies within the object, recording at the same time which object is in question.
Additionally and optionally, if it is desired to indicate these cells via the RESULT file or PHOTON display, a 3D-stored variable (usually, but not necessarily, called 'MARK') is also given the infob index as its value.
To ensure this, the INFOB statement needs to be preceded by one such as:
(STORED of MARK at PATCH1 is 1.0 with INFOB_1)
which ensures that:
The patch associated with an In-Form object, however, is usually larger than would be the bounding box of the cells comprising the objects. It is the volume within which such cells may exist; but it is rare for any of these cells to touch the bounding surfaces of the patch.
In one sense the INFOB PATCH is unnecessary; for, if the PATCH were always defined as the whole domain, the effects of the object would be the same. However its existence acts as an economy measure; it tells PHOENICS where searching for parts of the object would be a waste of time.
That each In-Form object should have a distinct PATCHNAME is important; for it is this which is used, rather than INFOB_1, INFOB_2, etc when initial values and sources are ascribed.
These may create directly objects having the shapes suggested by their names; but, with appropriately devised arguments, they may also be used for the creation of objects of much more complex shape.
It should be noted that both these functions can be used with cylindrical-polar and body-fitted coordinate grids as well as cartesian ones.
In the last respect they are superior to Virtual-Reality objects; for the latter can not be used with BFCs.
This, in conjunction with the (STORED of MARK.... statement, uses BOX(arguments) to indicate which are the cells in question.
Also permissible is the statement:
(INFOB at PATCH1 is ALL - BOX(arguments) with INFOB_1)
This indicates that the said value of MARK is to be placed at all cells in the patch except those within the space defined by BOX.
'ALL' can here be regarded as a function which has no arguments.
The arguments in question are as follows:
x0 = X-coordinate of west south low corner of box, in meters
y0 = Y-coordinate of west south low corner of box, in meters
z0 = Z-coordinate of west south low corner of box, in meters
xsize = X-size of box side, in meters
ysize = Y-size of box side, in meters
zsize = Z-size of box side, in meters
alpha = angle rotating around x axis, in radians
beta = angle rotating around y axis, in radians
theta = angle rotating around z axis, in radians
Any one of the nine arguments can be expressed by way of a formula which
may itself contain functions and constants.
Library case 383 illustrates the use of the box function for the creation of a box in a cubical domain, with all its rotations equal to 0.25 radians. A photon plot is shown here, created by the sur mark x 0.99 and sur mark y 0.99 commands.
It has fewer arguments however, namely:
SPHERE(xc, yc, zc, radius)
xc = x coordinate of the centre, in meters
yc = y coordinate of the centre, in meters
zc = z coordinate of the centre, in meters
radius = radius of the sphere, in meters
because rotations about its centre cannot change its shape.
When the calculation is being carried out with a cartesian grid, the coordinate system of the sphere coincides with the coordinate system of the calculation domain.
When the calculation is being carried out with a polar-coordinate grid, the cartesian coordinate system of the sphere has its origin at the bottom left-hand corner of a square which circumscribes a circle of radius RINNER+YVLAST.
Therefore the cartesian coordinates xc and yc are related to the polar coordinates xp and yp by the relations:
xc=(yvlast+rinner) + (yp + rinner) * sin(xp)
yc=(yvlast+rinner) + (yp + rinner) * cos(xp)
The Z coordinates of the origins and the directions of Z axes of both coordinate systems coincide with one another.
'ALL - SPHERE' has the same significance as for 'BOX'.
creates an In-Form object,
namely a sphere with its centre on the axis of a polar grid, by means
(INFOB at PATCH1 is SPHERE(10, 10, 10, 5) with INFOB_1)
The PHOTON plot displayed here reveals the result.
The pyramid is made in four parts, each of which is rotated around the vertical edge which they share.
The following images show: the whole pyramid, then part 1, part 2, part 3 and part 4.
Inspection of the q1 file shows that each part of the pyramid is made by a different Infob statement, each of which however refers to the same PATCH1 and the same INFOB_1. The differences reside in their zangle arguments.
The pyramids have been created, as other examples will be, by making one or more arguments of the box function depend the grid-point coordinate.
The information is used at the time that each grid-point is visited at infob-scanning time; and it implies that the question "is this cell-centre in the box?" refers, in general, to a different box for each cell.
Library case 783 illustrates this, wherein PISTON1 is a patch which is active for the first time step only, while PISTON2 is used for describing the position of the same In-Form object at later times.
(INFOB at PATCH1 is SPHERE(10., 10., 10., 8.) with INFOB_1)
(INFOB at PATCH2 is SPHERE(XG, 16., 10., 2.) with INFOB_1)
(INFOB at PATCH3 is SPHERE(XG, 4., 10., 2.) with INFOB_1)
The first statement describes the central sphere, second - the top horizontal cylinder and third - the bottom cylinder.
The creation of complex duct by means drilling of In-Form object in BFC is shown in 787 library case. At first a wide bent channel is created by means of BFC. The narrow channel is created from it by blocking any cells. Then two In-Form objects are described as spheres inside a wide channel.
(INFOB at PATCH1 is SPHERE(:XPP1:,:YPP1:,:ZPP1:,:RADIUS:) with INFOB_1)
(INFOB at PATCH2 is SPHERE(:XPP2:,:YPP2:,:ZPP2:,:RADIUS:) with INFOB_2)
Further inside each sphere values of PRPS variable are filled in with zero
(INITIAL of PRPS at PATCH1 is 0. with INFOB_1)
(INITIAL of PRPS at PATCH2 is 0. with INFOB_2)
See also the description of spiral-shape creation in section 7.4b below.