In-Form is a feature which enables users of PHOENICS greatly to extend its capabilities, without the introduction of new coding.
Users are enabled to express their requirements by way of formulae. These are read by the Input Module (Satellite), which transmits them to the Solver Module (EARTH); this then interprets them and performs the implied computations.
Unlike PLANT, its predecessor in functionality, In-Form does not require use of a re-compilable version of PHOENICS.
This document provides a brief overview of In-Form. The complete documentation can be found here.
The syntax of In-Form is relatively simple. A typical In-Form command will have some if not all of these elements:
(KEYWORD of VARIABLE at LOCATION is FORMULA with CONDITION)
It should be noted that:
The most commonly-used keywords include:
RHO1 DRH1DP RHO2 DRH2DP ENUT ENUL PRNDTL PHINT TMP1 TMP2 EL1 EL2 CP1 CP2 DVO1DT DVO2DT CFIPS CMDOT CVM
A full description of each of these is given here.
The FORMULA keyword defines the value of the property.
The LOCATION or CONDITION keywords can be used to limit the region of applicability of the FORMULA.
Such variables are of two main kinds, namely:
The VARIABLE keyword is any name of the user's choice, up to 4 characters long. A list of names already used by PHOENICS, and which should therefore be avoided, is given here.
The FORMULA keyword defines the value of the auxiliary variable.
The LOCATION or CONDITION keywords can be used to limit the region of applicability of the FORMULA.
The VARIABLE keyword specifies which variable is to have its initial value set.
The FORMULA keyword defines the initial value of the variable.
The LOCATION or CONDITION keywords can be used to limit the region of applicability of the FORMULA.
The VARIABLE keyword specifies which variable is to receive the source.
The FORMULA keyword defines the source.
The LOCATION or CONDITION keywords can be used to limit the region of applicability of the FORMULA. The CONDITION keyword also affects the type of source.
There are other less-commonly used keywords, which are listed in the full In-Form documentation
This keyword defines the variable the In-Form statement is to operate on. It can be any of the SOLVEd variables, or any of the auxiliary variables declared by STORE, or by the In-Form STORED command.
This keyword defines the location where the In-Form command will be applied. If it is absent, the command will apply to the whole domain.
LOCATION can be one of:
More details are given here.
If different formulae are required at different locations, a separate In-Form statement will be needed for each location.
This is the formula, long or short, simple or complex, which describes what the In-Form is trying to implement. A full description is given here.
The formulae employed by In-Form, whether for setting properties, initial values, sources or anything else, are arrangements of operators, functions and operands which conform to rules which are similar to those of algebra and/or Fortran.
No significance attaches to whether upper- or lower-case characters are used.
The operators which may be used are:
The functions, listed in alphabetical order here, include:
formula-name functions:
There are numerous post-formula options; but many of them apply only to particular keywords, as is shown here. If more than one 'with' condition is required, they must be separated by ! rather than 'with'.
There are two which apply to many keywords, these being:
Other variables than PRPS can be used in a similar way. Thus, it is possible to:
Another generally-applicable post-formula option is the "IF( condition)" construct, wherein condition can be a Fortran-like expression, as exemplified in many library cases.
Note that blank spaces must not be used inside the IF() condition.
'with IF(MARK.EQ.1)' is correct
'with IF(MARK .EQ. 1)' will produce errors.
Here are some simple examples of using In-Form:
Save7begin (stored of PTOT is P1+PRESS0 with imat<100) Save7end
Save9begin (property RHO1 is 1.0+0.1*TEM1+1.E-6*TEM1^2) Save9end
Save9begin (property RHO1 at B10 is 1.0+0.1*TEM1+1.E-6*TEM1^2) Save9end
Save9begin (property RHO1 is 1.0+0.1*TEM1+1.E-6*TEM1^2 with imat=123) Save9end
Q = min(10000*t, 3.0E6) for t < 720
Q = max(3.0e6-13000*(t-720), 5000) for t> 720
The heat source will thus increase linearly with time for the first 720 seconds, to a peak of 3MW which is reached after 300 seconds and maintained until 720 seconds. After 720 seconds, the heat source reduces linearly with time until it reaches a minimum value of 5kW at 950 seconds.
Save13begin (source of tem1 at fire1 is min(1e4*tim,3.e6) with if(tim.le.720)!WHOL) (source of tem1 at fire1 is max(3.e6-1.3e4*(tim-720),5e3) with if(tim.gt.720)!WHOL) Save13end
The condition !WHOL sets the source as a total source for the whole object. Without it, the source would be per unit volume.
Note that in the above examples the In-Form commands are enclosed in Save begin/end lines. These are crucial for the VR-Editor to locate the lines, present them for editing and write them back into the Q1 file.
There are many other examples to be found in the library. They can be found from the PHOENICS Commander by following 'Study special features', 'In-Form'.
Because In-Form statements often require more than one line, a special In-Form-Editor module has been attached to the Virtual-Reality Editor in order to facilitate their creation, recognition and modification. There are 'In-Form' buttons on the relevant pages of the Main Menu. Clicking on them starts the In-Form Editor:
This can be used in insert new commands and modify or delete existing ones. It will automatically insert the begin / end lines.