2.15 In-Form objects

Contents
  1. Overview
  2. The BOX function
  3. The sphere function
  4. More-complex shapes
  5. 'Drilling' and 'milling'
  6. A pyramid example
  7. A duct example
  8. A spiral example
  9. Moving spheres
  10. Moving blades
  11. Moving valve
  12. Football trajectory, 2D
  13. Football trajectory, 3D

(a) Overview

PHOENICS can be regarded as an 'object-oriented program'; for, when setting up a flow-simulation calculation, the user can introduced most of the features which he needs by importing 'objects' from a library or by creating new ones.

PHOENICS objects fall into two categories, namely:

  1. VR objects, and
  2. In-Form objects.

The present encyclopaedia entry is concerned with the latter.

In-Form can create up 8 In-Form objects by means of statements of the following format:

(INFOB at PATCHNAME is Formula with INFOB_N)

Here:

The INFOB statement acts by indicating the distribution throughout the grid, or more precisely within the patch, of a 3D-stored variable which is usually given the name 'MARK'. It therefore acts in a manner not unlike that of INITIAL or PROPERTY.

Therefore 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:

  1. the variable MARK is indeed stored; and
  2. that the value 1.0 is assigned to it in cells which are to be regarded as part of INFOB object number 1.

Two special functions, namely 'BOX' and 'SPHERE', are used in these formulae.

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 more complex shape.


(b) The BOX function

The format governing the use of BOX in INFOB statements is indicated by the following example:
   (INFOB at PATCH1 is BOX(arguments) with INFOB_1)

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 BOX arguments in question are as follows:
    BOX(x0,y0,z0,xsize,ysize,zsize,alpha,beta,theta)
where:
x0 = X-coordinate of west south low corner of box, meters
y0 = Y-coordinate of west south low corner of box, meters
z0 = Z-coordinate of west south low corner of box, meters
xsize = X-size of box side, meters
ysize = Y-size of box side, meters
zsize = Z-size of box side, meters
alpha = angle rotating around x axis, radians
beta = angle rotating around y axis, radians
theta = angle rotating around z axis, radians

Any one of the nine arguments can be expressed by way of a formula which may itself contain and constants.

Examples of the use of BOX will be presented below.


(c) The SPHERE function

The format governing the use of SPHERE in INFOB statements is similar to that of BOX, namely:
   (INFOB at PATCH1 is SPHERE(arguments) with INFOB_1)

It has fewer arguments however, namely:
    BOX(xc, yc, zc, radius)
where:
    xc = x coordinate of the centre, meters
    yc = x coordinate of the centre, meters
    zc = x coordinate of the centre, meters
    radius = radius of the sphere, meters

'ALL - SPHERE' has the same significance as for 'BOX'.

The use of the SPHERE function is illustrated by library case 772 which concerns a non-moving In-Form object, namely a sphere with its centre on the axis of a polar grid.

The In-Form statements are placed in Group 11 of the Q1 file, because they concern initial valuesof the variable MARK.

It will be noticed that the often-convenient device is adopted of defining xce, yce, etc as character variables, and setting their values in statements which precede (INFOB ... .

In this case, the values are constants, which would not be difficult to read if inserted directly as BOX(10,10,10,0.5); but, were they long formulae, their appearance following BOX( would make the line tiresomely long.

The resulting sphere, displayed by PHOTON by way of the commands:
surf mark 0.99 x
surf mark 0.99 y
surf mark 0.99 z
may be seen here


(d) More-complex shapes

The object can have the more complex shape if it is described by the several '(INFOB' statements. So in 783 library case two '(INFOB' statements are used for the description one In-Form object:

(INFOB at PISTON1 is BOX(0.,0.,0.,.1,.1,:Z1:,0.,0.,0.) with INFOB_1)

(INFOB at PISTON2 is BOX(0.,0.,0.,.1,.1,ZWN,0.,0.,0.) with INFOB_1)

First describes object on the first time step and second on following ones. Inside object the W1 values is fixed also for the first step

(SOURCE of W1 at PISTON1 is :Z1: with INFOB_1!FIXVAL)

and on following time steps

(SOURCE of W1 at PISTON2 is (ZWN-ZWO)/DT with$

Also creation the more complex shape is possible in one '(INFOB' statement to use several described above special functions. For example in 785 library case the hole of outer diameter of secondary inlet is discribed in cartesian coordinates system as

(INFOB at PATCH1 is SPHERE(0,:YIC:,:ZIC:,:RAD2:)-SPHERE(0,:YIC:,:ZIC:,:RAD1:) with INFOB_2)

In other case the object shape the filling all domain except for a sphere can be set as

(INFOB at PATCH1 is ALL-SPHERE(.5,.5,.5,.5) with INFOB_1)

The even more complex shape of objects can be received by means of the 'drilling and milling' techniques of which was illustrated earlier in Z601, Z602, Z603 library cases. If the coordinates of a position of In-Form object will be defined of current coordinates of each cell in this case object like as 'drill bit' will be moved inside the domain.

The 769 library case shows how it is possible by means of BOX function to create In-Form object with the pyramid shape.

(INFOB at PATCH1 is BOX(10,10,0,.5*(-ZG+20),.5*(-ZG+20),16*(-ZG+20.),0,0,0) with INFOB_1)

(INFOB at PATCH1 is BOX(10,10,0,.5*(-ZG+20),.5*(-ZG+20),16*(-ZG+20.),0,0,.5*:PI:) with INFOB_1)

(INFOB at PATCH1 is BOX(10,10,0,.5*(-ZG+20),.5*(-ZG+20),16*(-ZG+20.),0,0,:PI:) with INFOB_1)

(INFOB at PATCH1 is BOX(10,10,0,.5*(-ZG+20),.5*(-ZG+20),16*(-ZG+20.),0,0,1.5*:PI:) with INFOB_1)

Each '(INFOB' statement describes only quarter of all figure and turns it on 90 degrees around of Z axis.

Next 771 library case illustrates the drilling of Pump Chamber.

(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)

The 768 library case illustrates a method creation of a heating up spiral in a polar coordinate system. At first is set In-Form object with spiral shape. (INFOB at PATCH1 is SPHERE(1+.5*sin(xg),1+.5*cos(xg),1+.5*xg,.2) +SPHERE(1+.5*sin(xg),1+.5*cos(xg),4.14+.5*xg,.2) with INFOB_1)

NOTE: One (INFOB statement describes two links of a spiral simultaneously.

Then the heat source and resistance are set inside spiral.

(SOURCE of TEM1 at PATCH1 is 2000. with INFOB_1)

(SOURCE of U1 at PATCH1 is -1000.*(U1^2+V1^2+W1^2)^0.5*VOL*U1 with INFOB_1)

(SOURCE of V1 at PATCH1 is -1000.*(U1^2+V1^2+W1^2)^0.5*VOL*V1 with INFOB_1)

(SOURCE of W1 at PATCH1 is -1000.*(U1^2+V1^2+W1^2)^0.5*VOL*W1 with INFOB_1)

Now for modeling of motion of VR objects the PHOENICS uses a powerful means as MOFOR option. However before more In-Form permitted to simulate motion of In-Form objects in usteady cases. So if the coordinates of a In-Form object position depend on TIM variable the In-Form object will be moved in a time.

So the 765 library case sets the linear motion of two hot spherical bodies to follow a horizontal path as

char(xce,yce,zce,radius; xce=.5+.5*(tim/100.-1); yce=0.1 + 01*(tim/100.-1); zce=.05; radius= .25

(INFOB at FIRST is SPHERE(:xce:,:yce:,:zce:,:radius:) with INFOB_1)

xce=.5+.25*(tim/100.-1); yce=1.5; zce=.05; radius= .25

(INFOB at SECOND is SPHERE(:xce:,:yce:,:zce:,:radius:) with INFOB_2)

It should notice that the '(INFOB' statement can contain several long formulas. However the maximum length of a Q1 line is 68 symbols. In addition a PIL command can consist of two parts connected by the '$' symbol. As a result the maximum length of a PIL command is 136 symbols. The possible maximum length of a formula in any In-Form statement given by default is 1000 symbols. In such cases for the setting of the long formulas it should use intermediate symbolical variables as was shown above.

Inside objects are present a heat sources.

(SOURCE of TEM1 at FIRST is 100. with INFOB_1)

(SOURCE of TEM1 at SECOND is 100. with INFOB_2)

The inclined linear motion of rectangular object is submitted in 784 library case. Here four immobile In-Form objects (1, 2, 3 and 4) describe the geometry of blading sections of the chamber.

(INFOB at WHOLE is BOX(0.,.07,0.,.04,.03,1.,0.,0.,0.) with INFOB_1)

(INFOB at WHOLE is BOX(.07,0.,0.,.03,.04,1.,0.,0.,0.) with INFOB_2)

(INFOB at WHOLE is BOX(.04,.07,0.,.05,.03,1.,0.,0.,:-PI/4:) with INFOB_3)

(INFOB at WHOLE is BOX(.07,.04,0.,.03,.05,1.,0.,0.,:PI/4:) with INFOB_4)

Each of them is a solid body with appropriate installations inside objects

(STORED of VPOR at WHOLE is 0. with INFOB_1)

(SOURCE of U1 at WHOLE is 0. with INFOB_1!FIXV)

(SOURCE of V1 at WHOLE is 0. with INFOB_1!FIXV)

(STORED of VPOR at WHOLE is 0 with INFOB_2)

(SOURCE of U1 at WHOLE is 0. with INFOB_2!FIXV)

(SOURCE of V1 at WHOLE is 0. with INFOB_2!FIXV)

(STORED of VPOR at WHOLE is 0. with INFOB_3)

(SOURCE of U1 at WHOLE is 0. with INFOB_3!FIXV)

(SOURCE of V1 at WHOLE is 0. with INFOB_3!FIXV)

(STORED of VPOR at WHOLE is 0. with INFOB_4)

(SOURCE of U1 at WHOLE is 0. with INFOB_4!FIXV)

(SOURCE of V1 at WHOLE is 0. with INFOB_4!FIXV)

Two next In-Form objects (5 and 6) describe the geometry of a valve.

Description of a geometry of a valve

X and Y coordinates of a valve in the first time step

REAL(XVAL,YVAL); XVAL=0.065; YVAL=0.035

Moving of a valve during one time step

REAL(DMOV); DMOV=THROW/LSTEP; DMOV=DMOV/1.414

INTEGER(HLS,HLS1,HLS2); HLS=LSTEP/2; HLS1=HLS+1; HLS2=HLS+2

CHAR(CXP,CYP); CXP=:XVAL:-:DMOV:*(:HLS:-ABS(ISTEP-:HLS1:)); CYP=:YVAL:-:DMOV:*(:HLS:-ABS(ISTEP-:HLS1:))

(INFOB at WHOLE is BOX(:CXP:,:CYP:,0.,.01,.042,1.,0.,0.,:-PI/4:) with INFOB_5)

Description of a geometry of the valve holder

X and Y coordinates of the valve holder in the first time step

REAL(DXH,DYH); DXH=0.0113; DYH=0.0252

(INFOB at WHOLE is BOX(:CXP:-:DXH:,:CYP:+:DYH:,0.,.01,.11,1.,0.,0.,:PI/4:) with INFOB_6)

Fixation of the valve velocities into valve

(SOURCE of U1 at WHOLE is :UP: with INFOB_5!FIXV)

(SOURCE of V1 at WHOLE is :VP: with INFOB_5!FIXV)

Fixation of the valve velocities into valve holder

(SOURCE of U1 at WHOLE is :UP: with INFOB_6!FIXV)

(SOURCE of V1 at WHOLE is :VP: with INFOB_6!FIXV)

The 766 library case illustrates the use of the In-Form 'SPHERE' function to simulate the effect on the motion of the air of a football following a prescribed parabolic trajectory. The In-Form object is presented as

char(xce,yce,zce,radius,gravt,vel,times); gravt=9.81;vel=14.14; times=tim; xce=0.5+:times:*:vel:/1.414; yce=0.5+:times:*:vel:/1.414-0.5*:gravt:*:times:^2; zce=.05; radius=.5

(INFOB at PATCH1 is SPHERE(:xce:,:yce:,:zce:,:radius:) with INFOB_1)

Where xce,yce and zce are the x,z and z coordinates.They are character variables which are evaluated in the In-Form statements because they are enclosed within colons.

Setting of U1 values into SPHERE is

char(usour,vsour); usour=:vel:/1.414; vsour=:vel:/1.414-:gravt:*:times:

(SOURCE of U1 at PATCH1 is :usour: with INFOB_1!FIXV)

(SOURCE of V1 at PATCH1 is :vsour: with INFOB_1!FIXV)

The modeling of motion of spherical object in 3D space is submitted in 767 library case.

The 770 library case set steady rotated In-Form object for simulation two paddle-stirred reactor. The rotated paddle is describes by In-Form:

REAL(ANGVL); ANGVL=4.*PI/1. ! Number of revolutions, 1/s.

REAL(X0,Y0); X0=0.5; Y0=0.5 ! X & Y coordinate of centre of impellor

char(ang,dx1,dx2,dy1,dy2); ang=:ANGVL:*TIM; dx1=:hsid2:*SIN(:ang:); dx2=:hsid1:*COS(:ang:) dy1=:hsid2:*COS(:ang:); dy2=:hsid1:*SIN(:ang:)

(INFOB at PATCH1 is BOX(:x0:-:dx1:-:dx2:,:y0:-:dy1:+:dy2:,0,0.1,0.7,10,0,0,:ang:) with INFOB_1)

The cartesian components of paddle velocity are set

(SOURCE of U1 at PATCH1 is :ANGVL:*(YG-:Y0:) with INFOB_1!FIXV)

(SOURCE of V1 at PATCH1 is :ANGVL:*(:X0:-XG) with INFOB_1!FIXV)