For such cases, In-Form provides the LONGNAME feature, which is activated only for print-out sweeps.
(LONGNAME of L3RH print as 3-Piece-Wise_Linear_Density)wherein:
(stored L3RH is WL3(:VN:,280.,1125.,320.,1096.,370.,1060.,420.,1019.))
Field Values of L3RH: 3-Piece-Wise_Linear_Density IY= 10 1.083E+03 1.038E+03 1.023E+03 1.022E+03 1.023E+03 Field Values of RHO1: The_Density_Actually_Used IY= 10 1.083E+03 1.037E+03 1.023E+03 1.022E+03 1.023E+03They show that the density actually used, which was computed from a cubic polynomial, differed very little from the piece-wise-linear alternative.
The format is:
(PRINT String_15 is Formula)
where
String_15 is a character variable with a length of no more than 15 characters, this limit being imposed by the format of SPEDAT.
It is printed in INFOROUT followed by the value of whatever appears in FORMULA.
Inclusion in the Q1 of the following three lines causes the difference of velocity at IX=75 to be computed and plotted:
(make of ud75 is 0)
(store1 of ud75 is 1u[75]-2u[75])
(print of veldiff ix=75 is ud75)
The corresponding INFOROUT file appears thus:
************************************************************ IRUN = 1 LIBREF = 979 ISTEP = 20 ISWEEP = 4 VELDIFFIX=75 = 4.692078E-04 ************************************************************ ISTEP = 40 ISWEEP = 4 VELDIFFIX=75 = 2.592363E-01 ************************************************************ ISTEP = 60 ISWEEP = 4 VELDIFFIX=75 = 1.895071E+01 ************************************************************ ISTEP = 80 ISWEEP = 4 VELDIFFIX=75 = 2.894094E+01 ************************************************************ ISTEP = 100 ISWEEP = 4 VELDIFFIX=75 = 2.895671E+01 ************************************************************whereby it will be noted that spaces between DIFF and IX have disappeared (so legibility would have been better had under-scores been used, thus:
It is possible to print more than one variable into the same file. Thus the pressure difference driving the velocities at IX=75 can be printed by inserting three more lines in the Q1 file as follows:
(make of pd75 is 0)
(store1 of pd75 is p1[75]-p1[76])
(print of p1_diff ix=75 is pd75)
The INFOROUT file becomes, correspondingly:
************************************************************ IRUN = 1 LIBREF = 979 ISTEP = 20 ISWEEP = 4 VELDIFFIX=75 = 4.692078E-04 P1_DIFFIX=75 = -4.105164E-02 ************************************************************ ISTEP = 40 ISWEEP = 4 VELDIFFIX=75 = 2.592363E-01 P1_DIFFIX=75 = -2.074691E+01 ************************************************************ ISTEP = 60 ISWEEP = 4 VELDIFFIX=75 = 1.895071E+01 P1_DIFFIX=75 = -3.733529E+02 ************************************************************ ISTEP = 80 ISWEEP = 4 VELDIFFIX=75 = 2.894094E+01 P1_DIFFIX=75 = -2.890381E+00 ************************************************************ ISTEP = 100 ISWEEP = 4 VELDIFFIX=75 = 2.895671E+01 P1_DIFFIX=75 = 1.977539E-02 ************************************************************
In case w979, a patch called TIMEPLOT is already in use for plotting some standard variables. It therefore suffices to add the following lines to the Q1:
(print of veldif at timeplot is ud75)
(print of p1_dif at timeplot is pd75)
There then appears in the RESULT file the following plot:
PATCH(TIMEPLOT,PROFIL, 100, 100, 1, 1, 1, 1, 1, 100) PLOT(TIMEPLOT,P1_D,-3.964E+02, 5.151E-02) Variable 1 = VELD 2 = P1_D Minval= 0.000E+00 -3.964E+02 Maxval= 2.896E+01 5.151E-02 Cellav= 1.255E+01 -7.122E+01 1.00 22222222222222222222+....+....+...11112222222222222 0.90 + 22 111 22 + 0.80 + 2 11 2 + 0.70 + 2 1 2 + 0.60 + 2 1 2 + 0.50 + 2 11 2 + 0.40 + 2 11 2 + 0.30 + 221 22 + 0.20 + 12 2 + 0.10 + 11 2 2 + 0.00 11111111111111111111111..+..22+....+....+....+....+ 0 .1 .2 .3 .4 .5 .6 .7 .8 .9 1.0 the abscissa is ISTP. min= 1.00E+00 max= 1.00E+02from which the trends are easily perceived.
It should be mentioned that what lies between the 'of' and the 'is' of the (PRINT statements has had to be shortened in order to keep 'veldif at timeplot' and 'p1_dif at timeplot' within the 15-character limit; for even one excessive letter cases EARTH to terminate with the message:
PATCH command with TIMEPLO name not found Invalid In-Form formula; run aborted.An alternative (partial) solution would have been to reduce the length of the name of the TIMEPLOT patch.
It should also be mentioned that the arguments of the printed PATCH command which represent IXF,IXL,ITF,IYL,IXF,IZL are without significance for the In-Form-elicited plot.
Where the PRINT statements are located in file w979.htm can be seen by clicking here.
(print of phead_1 at SINF is phd1) (print of phead_2 at SOUT is phd2)
The typical form these equations is seen by clicking here.
The terms which may be accessed are:
The In-Form statements which enable them to be accessed have the form:
(STORED of name is AXCO(varname))
where:
A complete set of examples can be found in input-library case 788
(STORED of name is RESI(varname))
Such statements are also to be seen in case 277.
To gain access to them, the appropriate statement is:
(STORED of name is CORR(varname))
Examples of accessing residuals and corrections are to be found in library cases: 249, concerned with 2D flow in a square cavity, and 768, concerned with 3D flow in a water heater.
If on-line, click here for the temperature field, the residual field, and the correction field for case 249.
Because the solution is well-converged, the values of both the residuals and the corrections are very small. This accounts for the irregularity of the residual field, of which the values have been reduced to the round-off error of the computer.
This method of displaying residuals and corrections is more convenient than the older-established method, which involved giving the variable of which residuals and corrections were required a special name, ending with the % sign. That method however is still available.
The cure is to set NPRINT to some value well below that of the number of sweeps at which solution terminated.
(STORED of name is GAMM(varname))
This feature is illustrated in case 788.
These possibilities give the user great power to intervene, if he or she wishes, in the solution process.
These facilities are activated by use of the "read Q1" facility. Specifically, the Q1 file is supplied with, starting in column 3 or greater:
where feature is one of the list given below
The full list of features is:
As is obvious, debug of a particular kind is activated when t follows the feature name, and deactivated by f.
An f following debug deactivates all debug features.
All debug features are f by default.
In-Form debug print-out is governed by the same indices as is the older-established debug from EARTH, i.e. that elicited by the PIL variable debug, namely izdb1,izdb2, etc.
Library case case 768 provides an example.
In-Form can produce tabular output in comma-separated-variable format to named files. A new line can be written at the end of each sweep, or at the end of each time step. The values written to the files can be the outcome of any In-Form formula. There is no limit to the number of files
Syntax
The command to produce a sweep-wise table file is:
(TABLE in file_name is GET(form1,form2,...,formn) with HEAD(head1,head2,...,headn)!SWEEP)
The command to produce a time-wise table file is:
(TABLE in file_name is GET(form1,form2,...,formn) with HEAD(head1,head2,...,headn)!TIME)
where
file_name is the name of the file to be created. If the filename is given the extension .csv, it will be directly recognised by Excel.
The GET function retrieves the values of form1 - formn and writes them to the table file. There is no limit on the number of variables that can be written. form1 -formn represent any valid In-Form construct. They can be single real values, elements of an array, the evaluation of a formula, whatever is required.
The HEAD function supplies the column headers to be written to the first line of the table.
For example, adding the line
(TABLE in monplt1.csv is GET(P1[1,3,3],P1[NX,3,3],P1[1,3,NZ-5]) with HEAD(P1_1,P1_2,P1_3)!SWEEP)
to library case 274 produces the file monplt1.csv, which contains:
ISWEEP, P1_1, P1_2, P1_3 1, 0.000000E+00, 0.000000E+00, 0.000000E+00 2, 7.819997E+01, 6.381281E+01, -1.904133E+01 3, 9.748657E+01, 7.934592E+01, 3.729689E+00 4, 9.297382E+01, 7.512841E+01, 2.528054E+01 5, 8.867683E+01, 7.146969E+01, 3.346389E+01 6, 8.672485E+01, 6.953475E+01, 4.156276E+01 7, 1.030840E+02, 8.589959E+01, 8.495282E+01 8, 1.524511E+02, 1.357139E+02, 1.641428E+02 . . 195, 4.161576E+02, 3.990614E+02, 3.937202E+02 196, 4.161576E+02, 3.990614E+02, 3.937201E+02 197, 4.161576E+02, 3.990614E+02, 3.937201E+02 198, 4.161576E+02, 3.990614E+02, 3.937201E+02 199, 4.161576E+02, 3.990614E+02, 3.937202E+02 200, 4.161576E+02, 3.990614E+02, 3.937202E+02
This can then be easily imported to Excel (Click on 'Insert', then 'Charts'.) The data can be plotted as a 'Scatter' chart to produce a convergence plot like this:
The files themselves are written at the end of each sweep or each timestep, so that should the run crash for any reason, the data up to that point will be available. It is also possible to look at the files during the run, to 'see how it is getting on'. If something looks out of order, the run can be stopped and investigated.
In-Form allows up to 20 variables to be transmitted in a single line (possibly with 'continuation' effected by the $ sign), by means of the REALREAD, INTREAD, and LOGREAD statements.
Their use is illustrated by the facility (introduced with PHOENICS-3.5) for changing turbulence-model constants, which is described here,
Suppose, for example, it were desired to employ the different constants:
CMU | =0.6 | CD | =0.2 | C1E | =1.5 |
C2E | =1.92 | AK | =0.4 | EWM | =9.0 |
This could be effected by inserting in the Q1 file the line:
((REALREAD turconst is 0.6 0.2 1.5 1.92 0.4 9.0)
When the satellite reads this line, it places in Q1EAR the line:
SPEDAT(SET,REALREAD,TURCONST,C,0.6&0.2&1.5&1.92&0.4&9.0)which is echoed in RESULT; and in EARDAT the line:
REALREAD TURCONST C0.6&0.2&1.5&1.92&0.4&9.0This is then acted upon by the sequence of coding starting with IF(GETREALS in the subroutine INIVST, which duly interprets what it finds and records its work by printing the following in the RESULT file:
CMU = 6.000000E-01 CD = 2.000000E-01 C1E = 1.500000E+00 C2E = 1.920000E+00 AK = 4.000000E-01 EWAL = 9.000000E+00This example has shown how real variables may be transmitted. Integer and logical variables are transmitted by use of INTREAD and LOGREAD statements in the corresponding manner.
The new technique is therefore mainly of use to those having access to re-compilable versions of PHOENICS.
Strictly speaking, since the 'protected mode' of satellite operation was introduced in 2007, the word 'inform' can be replaced by the word 'save'; but 'inform' still suffices.
One such button is shown here, for the top panel.
When that button is pressed, the Inform Editor appears.
Similar buttons appear on lower-level panels of the VR-Editor user-interface.
The existing Group 13 statements are viewed here
They are then changed by way of Notepad-like editing actions to this.
When they are what the user wants, they are saved.
This action places them in the phxx file which the VR Editor uses to store items which must be written to the final Q1, the relevant part of which is seen here:
Echo InForm settings for Group 13 inform13begin char(xce,yce,zce,radius,gravt) char(vel,times); ** Definition of the first moving In-Form Object SOME COMMENTS : Radius doubled; Gravity halved; That is all radius=.5*2; gravt=9.81/2 ! Changes made on this line only vel=10.;times=tim xce=0.5+:times:*:vel:
Now that the PHOENICS Commander, which also employs the Tcl/Tk package, has been adopted as the main introduction to and manager of PHOENICS, these additions to the In-Form Editor will swiftly be made.
In-Form can effect more extensive modifications of these terms; morever it does so without the use of special patch names.
The recalculation will be executed only at internal cell faces of the domain area; for updating at domain boundaries, the MODDIF and MODCON statements can not be used.
The complete format of the In-Form MODDIF and MODCON statements is:
It is also possible to modify the built-in diffusion and convection terms by multiplying their values by a formula, as in the following examples:
where:
The complete format of the In-Form (MODSOR statements is:
It is also possible to modify the built-in source terms by multiplying their values by a formula, as in the following example:
where:
dP = f*2*rho*vel^2, [N/m^2] f=0.33*Re^(-1/5) and Re=abs(vel)*diam/enulThe resistance at the pipe grid is simulated by updating the built-in source term of equation for v1 variable at iy=iysh cells by means following two lines
PATCH(MSOR1,CELL,1,NX,IYSH,IYSH,1,NZ,1,1) (MODSOR of V1 at MSOR1 is ANORTH*.33*REYN^(-0.2)*2*RHO1*VLSQ)