phoenics input language: pil the pil language was developed during the first stages of phoenics...
TRANSCRIPT
Phoenics Input Language: PIL• The PIL language was developed during the first stages of
PHOENICS development.• In that time there were no graphics interface and the user
had to communicate with the Main program by means of a Q1 file written in PIL.
• The PIL is quite similar to FORTRAN and is the Q1 input language.
• Despite of the graphics interface development, the PIL is still today largely used because it still can do tasks not possible in VR interface for instance.
• For experienced users it is faster to modify Q1 rather than go to VR interface.
• At last, it is the most powerfull tool to design your own development.
Q1 and RESULT Files
• The q1 is the input file. One may written a q1 using VR or typing from the key board the PIL statements.
• A balanced use of the two editors is very convenient.
• The result file is also written in PIL and echoes all the q1 statements.
• Most of the times the q1 statements are functions which, by their turn, became multiple arguments in RESULT file.
• We will see some examples in the following slides.
Schematic of the three main blocks of PHOENICS
PHOTON
AUTOPLOT
RESULTPHIXYZ
PÓS PROCESSAMENTO:
Apresentação Resultados
Satellite EARDAT
q1
Earth
GREX(ground examples)
GRND(user code)
ArquivosFORTRAN
PRÉ PROCESSAMENTO:Definição Problema MAIN: simulação
VR VIEWERVirtual Realityv 3.0
MENUv 2.0
NotePadPIL /
FORTRAN
Data input in PHOENICS is organized in 25 groups. GROUP 1 - Title & Preliminaries
GROUPS 2 thru 6 - Transience & grid specification
GROUPS 7 and 8 - Solver options and controls
GROUP 9 - Properties
GROUP 10 - Interphase transport coefficients
GROUP 11 - Initialization and porosities
GROUP 12 - Coefficients of convection and diffusion
GROUP 13 - Source and boundary conditions
GROUP 14 - Parabolic runs
GROUPS 15 thru 18 - Convergence controls
GROUP 19 - Calls to ground
GROUP 20 thru 25 - Print outs & monitoring controls
We are going to get
acquainted with the
PHOENICS Groups and PIL
Language by inspecting the
echoed groups in Q1 and
RESULT files from this case
study.
Z
Y
CASE STUDY : 1D TRANSIENT CONDUCTION IN A FIN(LE#3 ex. #1)
GROUP 1 Run titles and other preliminaries
PHOENICS is arranged so as to make it possible to
set up and execute a series of computer runs, a
facility that is often exploited when 'parametric
studies' are required. Each run then needs to be
identified by a number; and it is usually convenient
to give each run its own title. GROUP 1 is the place
for such labeling operations.
Declarations such as REAL(...), CHAR(....),
ARRAY(....,...), for variables which they user intends
to use, are also best made here. However, so long as
the declaration statement s appear in the Q1 file
ABOVE the point of their first use, they can appear in
any group.
GROUP 2 Transience: time-step specification
PHOENICS can simulate both steady-state and
transient phenomena.
For the former, no entry is required in GROUP 2;
otherwise, data items relating to time dependence must
be supplied here.
GROUPS 3, 4 and 5 x-, y- and z-direction grid specifications
PHOENICS can represent phenomena in 1, 2 or 3
space dimensions. Provision is therefore made for
setting up 'grids' in three directions, designated x, y
and z; and each is dealt with separately.
x, y and z are all distances in the standard settings,
measured in meters; however, x may be caused, by
setting XCYCLE=T, to represent an angular
coordinate; and similar changes can be effected, with
more difficulty, for y and z.
GROUP 6 Body-fitted coordinates or grid distortion
BFC=T, if body-fitted coordinates are required, is set
here. If it is, further commands such as GSET(....)
usually follow, for specifying the grid.
GROUP 7 Variables stored, solved and named
PHOENICS has been set up so that it can solve differential
equations for up to 50 dependent variables simultaneously
with especial ease; but more can also be dealt with.
What variables are to be solved is settled in GROUP 7; also,
to some extent, HOW they are to be solved.
If variables are to be given storage space but not actually
solved, as is often convenient for important auxiliary
variables, this information is also conveyed here.
GROUP 8 Terms (in differential equations) and devices
The typical differential equation which PHOENICS solves has terms
corresponding to transient, convection, diffusion and source-sink
effects; but not all the variables of a given problem exhibit all the
effects.
GROUP 8 allows distinctions to be made between the variables in these
respects. This facility can also be exploited as an economy measure,
when some effects which are present are so small as to be negligible;
for then they can be omitted entirely, with consequent saving of
computation time.
Should users wish to intervene, through GROUND, in the procedures
for setting up and solving the flow-simulating equations, they can do so
by setting certain 'switches' in GROUP 8 of SATELLITE, and then
providing corresponding coding sequences in GROUP 8 of GROUND.
GROUP 9 Properties of the medium (or media)
It is necessary to inform PHOENICS about the physical
properties of the medium in which the flow to be
simulated actually occurs; and, since the computer
code is equipped for the simulation of two-phase (ie
two-interpenetrating-media) phenomena, two sets of
property data may require to be specified. The
properties in question may be thermodynamic (eg
density), transport (eg viscosity), or inter-phase (eg
saturation enthalpy).
GROUP 9 is the place for such data items.
GROUP 10 Interphase-transfer processes and properties
A special group, number 10, has been set aside for
those property- data items which relate to the
interactions between phases which are both present in
the same location and at the same time. The
interactions may involve heat transfer, mass transfer
and momentum transfer; and information may also need
to be supplied about the thermodynamic-equilibrium
and chemical-kinetic natures of the interactions.
GROUP 11 Initialization of variable or porosity fields
When PHOENICS is solving a problem involving time-dependence, the
problem specification usually starts with a statement about what values
of all the dependent variables pertain, to all the points in the space in
question, at the first instant to be considered. These 'initial values' can be
supplied among the data items of GROUP 11.
Even in problems of steady-state character, because PHOENICS
proceeds in an iterative manner, initial values must be supplied. These
are the 'first guesses', rather than problem-specifying data; and their
values should not ordinarily influence the final solution. However, they
are supplied in precisely the same way as are the initial values of true
time-dependent phenomena.
Among the variables which may be initialized in this way are the so-called
'porosities', which indicate what fractions of the areas and volumes of the
computational cells are actually accessible to the fluid. These are not
ordinarily dependent variables of differential equations; but they may be
stored and handled within PHOENICS as though they were.
GROUP 12 Convection and diffusion adjustments
The above-mentioned 'porosities' limit the
magnitudes of the relevant fluxes of heat, mass and
momentum uniformly in respect of all dependent
variables. However, it may be useful sometimes to
distinguish one variable from another, as when, for
example, a membrane is introduced which is
permeable to heat and some constituents of a
mixture, but impermeable to other constituents.
GROUP 13 Boundary conditions and special sources
What makes one flow phenomenon differ from another is partly the properties of the medium, partly the initial conditions and partly the boundary conditions (which, despite their name, may be located inside the flow domain). PHOENICS is therefore supplied, in the sections appropriate to data-input GROUP 13, with an extensive set of procedures which permit the relevant information to be supplied.
All such boundary and internal conditions are treated, in PHOENICS, as sources and sinks; therefore the same data-input procedures are employed whenever any source/sink information is to be transmitted. GROUP 13 may thus also be used for representing generation terms in a turbulence-energy equation, or for introducing novel formulations for chemical-reaction rates.
GROUP 14 Downstream pressure for PARAB=T
PHOENICS can simulate fluid-flow phenomena of
the kind known as 'parabolic', for example the
development of a boundary layer on an airfoil.
Some of these phenomena require, for their
complete simulation, the specification of the way
in which the fluid pressure varies with
downstream (ie z-direction) distance. GROUP 14
has been provided as the repository of
information of this kind.
GROUP 15 Termination of sweeps
PHOENICS solves its equations by guess-and-correct
procedures, which, provided that they are indeed
converging, cause the imbalances in the finite-domain
equations to become smaller and smaller.
There is no limit to the number of cycles of successive
adjustments that PHOENICS can perform; but there is a
limit to how many are worth performing. It is for the user to
provide PHOENICS with information about the latter limit;
and GROUP 15 is the place where this provision should be
made.
GROUP 16 Termination of iterations
There are iterations of two main kinds in PHOENICS: the
'outer iterations' or 'sweeps' , which are the concern of
GROUP 15; and the 'inner iterations', for which the limiting
information is supplied in GROUP 16. The former are
concerned with eliminating imbalances deriving from the
non-linearities, while the latter are associated with the fact
that PHOENICS uses iterative procedures for solving even
the linear equations which arise (in large numbers) at
various points in the solution procedure.
GROUP 17 Under-relaxation devices
In order to ensure convergence, iterative solution
procedures for non-linear sets may require the judicious
introduction of 'under- relaxation' practices. For linear
equations, on the other hand, over-relaxation may cause
convergence to be attained more rapidly.
PHOENICS possesses several features which allow
under- and over- relaxation to be practised, and in a
rather discriminating way. GROUP 17 is the place at
which these devices are normally activated.
GROUP 18 Limits on variables or increments to them
During the course of a sequence of outer-iteration cycles, values of dependent variables may wander rather far from both their initial values and from the values which are finally found to satisfy all the equations, ie from the solution. At times, this 'wandering' may become excessive; and, if no limits are placed on it, the result may be that 'divergence' occurs; no solution of the equations is then arrived at.
The latter outcome can however often be prevented if PHOENICS is informed about the upper and lower limits, relevant to each dependent variable separately, which the said variables should not exceed. These limits may be set by the user, possibly on physical grounds (which preclude negative densities, for example), or perhaps to express other insights or desires which he possesses. GROUP 18 provides the necessary opportunities.
GROUP 19 Data communicated by SATELLITE to GROUND
PHOENICS users can, if they wish, modify or add to the GROUND sub- routines which are attached to the EARTH module; and spare variables such as RSG's (Reals connecting Satellite and Ground), LSG's (Logicals connecting Satellite and Ground), ISG's (Integers...) and CSG's (Characters ....) are provided to enable them to transmit information from the SATELLITE to the coding which they have introduced.
These are usually set in Group 19.
GROUPS 20 to 24
Preliminary-, variable-, spot-value- and field- print-out; plot control and dumps
for restarts
Quite apart from the ability to accept special print-out instructions via
arrangements made through GROUP 19, PHOENICS possesses extensive
controls for its already-built-in print-out procedures. The controls are
distributed between the last five data-input groups.
GROUP 20 controls the extent to which EARTH prints out data-input summaries
before execution begins. GROUP 21 accepts information about the extent and
frequency of the print-out of dependent- variable fields, while GROUP 22 does
the same for the print-out of the single-point values which are used for
monitoring the course of the solution process.
GROUP 23 is the repository of information about which types of print-out are
elicited for which stored variable; and, finally, GROUP 24 concerns that special
kind of information 'dump' which permits continuation of an EARTH
computation which has been paused, either with or without changed
arrangements for print-out.
RESIDUAL AND NET SOURCES IN RESULT FILE
Whole-field residuals before solution with resref values determined by EARTH & resfac= 1.000000E-02
variable resref (res sum)/resref (res sum) TEM1 4.625E-02 4.551E-05 2.105E-06 Nett source of TEM1 at patch named: OB1 (LOW ) = 3.272568E-01 Nett source of TEM1 at patch named: OC2 (NORTH ) =-2.624250E-01 pos. sum= 3.272568E-01 neg. sum=-2.624250E-01 nett sum= 6.483176E-02
CPU PERFORMANCE IN RESULT FILE
• ************************************************************• SATLIT RUN NUMBER = 1 ; LIBRARY REF.= 0
• Run completed at 20:34:06 on Tuesday, 12 April 2005 • • MACHINE-CLOCK TIME OF RUN = 3 SECONDS.
• TIME/(VARIABLES*CELLS*TSTEPS*SWEEPS*ITS) = 5.000E-04
************************************************************ Group 1. Run Title TEXT(LE#3 - EX#1 ) ************************************************************ Group 2. Transience STEADY=F * Set overall time and no. of steps RSET(U,0.000000E+00,1.000000E+03,100) * Modify regions ************************************************************ Groups 3, 4, 5 Grid Information NEXT * Overall number of cells, RSET(M,NX,NY,NZ,tolerance) RSET(M,1,1,20) * Set overall domain extent: * xulast yvlast zwlast name XSI= 6.283190E+00; YSI= 5.000000E-03; ZSI= 1.000000E-01 RSET(D,CHAM ) * Cylindrical-polar grid CARTES=F ************************************************************ Group 6. Body-Fitted coordinates ************************************************************
• Group 24. Dumps For Restarts NEXT
NOWIPE = T IDISPA = 10 ;IDISPB = 1 ;IDISPC = 100 CSG1 ='F' GVIEW(P,-8.114650E-01,-6.012347E-02,-5.813001E-01) GVIEW(UP,-5.798833E-01,-4.060527E-02,8.136870E-01) > DOM, SIZE, 6.283190E+00, 5.00E-03, 1.00E-01> DOM, MONIT, 3.141590E+00, 2.50E-03, 9.250E-02> DOM, SCALE, 1.00E+00, 1.00E+00, 1.00E+00> DOM, SNAPSIZE, 1.000E-02> DOM, RELAX, 5.000E-01•
************************************************************ Group 7. Variables: STOREd,SOLVEd,NAMEd NEXT ONEPHS = T * Non-default variable names NAME(148) =PRPS ; NAME(149) =SPH1 NAME(150) =TEM1 * Solved variables list SOLVE(TEM1) * Stored variables list STORE(SPH1,PRPS) * Additional solver options SOLUTN(TEM1,Y,Y,Y,N,N,Y) ************************************************************ Group 8. Terms & Devices NEXT TERMS (TEM1,Y,Y,Y,Y,Y,Y) ************************************************************
************************************************************ Group 9. Properties NEXT SETPRPS(1, 67) RHO1 = 9.982300E+02 PRESS0 = 1.000000E+05 TEMP0 = 2.730000E+02 CP1 = 4.181800E+03 ENUL = 1.006000E-06 ;ENUT = 0.000000E+00 DVO1DT = 1.180000E-04 PRNDTL(TEM1) = -5.970000E-01 ************************************************************ Group 10.Inter-Phase Transfer Processes ************************************************************ Group 11.Initialise Var/Porosity Fields NEXT FIINIT(PRPS) = 6.700000E+01 ;FIINIT(SPH1) = 4.730000E+02 FIINIT(TEM1) = 2.000000E+01 No PATCHes used for this Group INIADD = F ************************************************************ Group 12. Convection and diffusion adjustments No PATCHes used for this Group
************************************************************Group 13. Boundary & Special Sources NEXT No PATCHes used for this Group EGWF = T************************************************************ Group 14. Downstream Pressure For PARAB ************************************************************ Group 15. Terminate Sweeps NEXT LSWEEP = 1000 RESFAC = 1.000000E-02 ************************************************************ Group 16. Terminate Iterations NEXT ************************************************************ Group 17. Relaxation NEXT ************************************************************ Group 18. Limits NEXT ************************************************************ Group 19. EARTH Calls To GROUND Station NEXT USEGRD = T ;USEGRX = T ASAP = T IDISPB = 1 ;IDISPC = 100 CSG1 ='F' ************************************************************
Group 24. Dumps For Restarts NEXT > OBJ1, NAME, LOW> OBJ1, POSITION, 0.00E+00, 0.00E+00, 0.00E+00> OBJ1, SIZE, 6.283190E+00, 5.00E-03, 0.00E+00> OBJ1, CLIPART, polcu2> OBJ1, ROTATION24, 1> OBJ1, TYPE, PLATE> OBJ1, SURF_TEMP, 0.00E+00, 1.00E+02 > OBJ2, NAME, NORTH> OBJ2, POSITION, 0.00E+00, 5.00E-03, 0.00E+00> OBJ2, SIZE, 6.283185E+00, 0.00E+00, 1.00E-01> OBJ2, CLIPART, polcu2> OBJ2, ROTATION24, 1> OBJ2, TYPE, PLATE> OBJ2, LINR_HEAT, 1.075E+01, 2.00E+01STOP
ARQUIVO RESULT
• ‘ECOA’ TODOS OS COMANDOS EMITIDOS DO Q1
• ELE ESCREVE NUMA LINGUAGEM ‘PIL’ BÁSICA
• NOTE QUE OS COMANDOS DO Q1 SÃO ‘RE-
INTERPRETADOS’ PARA APARECER NO RESULT
• DEVE-SE DESTACAR QUE ELES SÃO TOTALMENTE
EQUIVALENTES.
• SE VOCÊ UTILIZASSE OS COMANDOS ECOADOS NO
RESULT NO Q1 O RESULTADO SERIA O MESMO
• MUITAS VEZES OS COMANDOS DO Q1 SÃO MAIS
CONVENIENTES POR SEREM MAIS ‘COMPACTOS’.
************************************************************ Group 2. Transience STEADY = F * Set overall time and no. of steps TFIRST = 0.000000E+00 ;TLAST = 1.000000E+03 LSTEP = 100 TFRAC ( 1) = 1.000000E-02 ;TFRAC ( 2) = 2.000000E-02 TFRAC ( 3) = 3.000000E-02 ;TFRAC ( 4) = 4.000000E-02 TFRAC ( 5) = 5.000000E-02 ;TFRAC ( 6) = 6.000000E-02 TFRAC ( 7) = 7.000000E-02 ;TFRAC ( 8) = 8.000001E-02 TFRAC ( 9) = 9.000000E-02 ;TFRAC ( 10) = 1.000000E-01
.
.
. TFRAC ( 93) = 9.300001E-01 ;TFRAC ( 94) = 9.400001E-01 TFRAC ( 95) = 9.500000E-01 ;TFRAC ( 96) = 9.600000E-01 TFRAC ( 97) = 9.700000E-01 ;TFRAC ( 98) = 9.800000E-01 TFRAC ( 99) = 9.900001E-01 ;TFRAC (100) = 1.000000E+00 ************************************************************
Group 3. X-Direction Grid Spacing BACK CARTES = F NX = 1 XULAST = 6.283190E+00 ************************************************************ Group 4. Y-Direction Grid Spacing NY = 1 YVLAST = 5.000000E-03 ************************************************************ Group 5. Z-Direction Grid Spacing PARAB = F NZ = 20 ZWLAST = 1.000000E-01 ZFRAC ( 1) = 5.000000E-02 ;ZFRAC ( 2) = 9.999999E-02 ZFRAC ( 3) = 1.500000E-01 ;ZFRAC ( 4) = 2.000000E-01
.
.
. ZFRAC (17) = 8.500000E-01 ;ZFRAC (18) = 9.000000E-01 ZFRAC (19) = 9.500000E-01 ;ZFRAC (20) = 1.000000E+00 ************************************************************
************************************************************ Group 7. Variables: STOREd,SOLVEd,NAMEd BACK ONEPHS = T NAME(148) =PRPS ;NAME(149) =SPH1 NAME(150) =TEM1 * Y in SOLUTN argument list denotes: * 1-stored 2-solved 3-whole-field * 4-point-by-point 5-explicit 6-harmonic averaging SOLUTN(PRPS,Y,N,N,N,N,Y) SOLUTN(SPH1,Y,N,N,N,N,N) SOLUTN(TEM1,Y,Y,Y,N,N,Y) PRPS = 148 ************************************************************ Group 8. Terms & Devices BACK * Y in TERMS argument list denotes: * 1-built-in source 2-convection 3-diffusion 4-transient * 5-first phase variable 6-interphase transport TERMS (TEM1,Y,N,Y,Y,Y,N) DIFCUT = 5.000000E-01 ;ZDIFAC = 1.000000E+00 GALA = F ;ADDDIF = F ISOLX = 0 ;ISOLY = 0 ;ISOLZ = 1 ************************************************************
************************************************************ Group 9. Properties BACK RHO1 = 9.982300E+02 ;TMP1 = 0.000000E+00 EL1 = 0.000000E+00 TSURR = 0.000000E+00 ;TEMP0 = 2.730000E+02 PRESS0 = 1.000000E+05 DVO1DT = 1.180000E-04 ENUL = 1.006000E-06 ;ENUT = 0.000000E+00 PRNDTL(TEM1) = -5.970000E-01 PRT (TEM1) = 1.000000E+00 CP1 = 4.181800E+03 ;CP2 = 4.181800E+03 ************************************************************ Group 10.Inter-Phase Transfer Processes ************************************************************
************************************************************ Group 11.Initialise Var/Porosity Fields BACK FIINIT(PRPS) = 6.700000E+01 ;FIINIT(SPH1) = 4.730000E+02 FIINIT(TEM1) = 2.000000E+01 No PATCHes yet used for this Group INIADD = F FSWEEP = 1 NAMFI =CHAM ************************************************************ Group 12. Patchwise adjustment of terms Patches for this group are printed with those for Group 13. Their names begin either with GP12 or &
************************************************************ Group 13. Boundary & Special Sources BACK Parent VR object for this patch is: LOW PATCH(OB1 ,LWALL , 1, 1, 1, 1, 1, 1, 1, 100) COVAL(OB1 ,TEM1, 1.000000E+00, 1.000000E+02) Parent VR object for this patch is: NORTH PATCH(OB2 ,NWALL , 1, 1, 1, 1, 1, 20, 1, 100) Parent VR object for this patch is: NORTH PATCH(OC2 ,NORTH , 1, 1, 1, 1, 1, 20, 1, 100) COVAL(OC2 ,TEM1, 1.075000E+01, 2.000000E+01) XCYCLE = F EGWF = F
************************************************************ Group 14. Downstream Pressure For PARAB ************************************************************ Group 15. Terminate Sweeps BACK LSWEEP = 1000 ;ISWC1 = 1 LITHYD = 1 ;LITFLX = 1 ;LITC = 1 ;ITHC1 = 1 SELREF = T RESFAC = 1.000000E-02 ************************************************************ Group 16. Terminate Iterations BACK LITER (TEM1) = 20 ENDIT (TEM1) = 1.000000E-03 ************************************************************ Group 17. Relaxation BACK RELAX(PRPS,LINRLX, 1.000000E+00) RELAX(SPH1,LINRLX, 1.000000E+00) RELAX(TEM1,FALSDT, 1.000000E+09) OVRRLX = 0.000000E+00 EXPERT = F ;NNORSL = F
************************************************************ Group 18. Limits BACK VARMAX(PRPS) = 1.000000E+10 ;VARMIN(PRPS) =-1.000000E+10 VARMAX(SPH1) = 1.000000E+10 ;VARMIN(SPH1) =-1.000000E+10 VARMAX(TEM1) = 1.000000E+10 ;VARMIN(TEM1) =-1.000000E+10 ************************************************************ Group 19. EARTH Calls To GROUND Station BACK USEGRD = T ;USEGRX = T ASAP = T IDISPB = 1 ;IDISPC = 100 CSG1 ='F' SPEDAT(SET,DOMAIN,PHASE_1_MAT,I,67) SPEDAT(SET,OBJNAM,^OB1,C,LOW) SPEDAT(SET,IGESTYPE,^OB1,C,PLATE) SPEDAT(SET,OBJNAM,^OB2,C,NORTH) SPEDAT(SET,IGESTYPE,^OB2,C,PLATE) SPEDAT(SET,OBJNAM,^OC2,C,NORTH) SPEDAT(SET,IGESTYPE,^OC2,C,USER_DEFINED) SPEDAT(SET,MATERIAL,67,L,T)
END