166 APPENDIX 3 CFD CODE - PHOENICS 3.1 INTRODUCTION PHOENICS is a general-purpose software code which predicts quantitatively the flow of fluids in and around engines, process equipment, buildings, human beings, lakes, river and oceans and so on. It also calculates the associated changes of chemical and physical composition and the associated stresses in the immersed solids. Its name is an acronym for Parabolic Hyperbolic Or Elliptic Numerical Integration Code Series. 3.2 FUNCTIONS OF PHOENICS PHOENICS performs three main functions: 1) Problem definition (i.e. pre-processing), in which the user prescribes the situation to be simulated and the questions, which are to be answered. 2) Simulation (i.e. data-processing), by means of computation, of what the laws of science imply in the prescribed circumstances.
167 3) Presentation (i.e. post-processing of the results of the computation, by way of graphical displays, tables of numbers, and other means. 3.3 MODULES OF PHOENICS PHOENICS has a distinct set of modules, for each of the above three functions. The three (sets of) modules of PHOENICS are called : 1) SATELLITE (which incorporates also the Virtual-Reality Editor and Viewer) 2) EARTH (the solver module; and, 3) PHOTON (which incorporates the graph-plotter, AUTO-PLOT). Their interrelationships are shown in Figure 3.1 albeit with the VR- Viewer displayed on the post-processing side, even though it is part of the SATELLITE module. 3.4 THE INTER COMMUNICATION FILES The four names in white rectangular boxes in the above diagram refer to files, which are used for communication between modules, as follows: Ql, the user-readable input-data file, which is written in PIL, the PHOENICS Input Language, and is the main expression of what the user wishes to achieve.
168 EARDAT, an ASCII file, which expresses in EARTH-understandable form what, the user has prescribed by way of Ql. PHI, is written by EARTH in accordance with a format enables PHOTON, AUTOPLOT and the Viewer to display the results of the computation graphically.
RESULT, is an ASCII file expressing the results in tabular and line-printer- plot form. It is the Q1 file with which the user has most to do, whether it is: taken from the extensive Input-File library which forms part of the PHOENICS installation; or created by way of a text editor, perhaps as a modification of a library file; or created as part of an interactive SATELLITE session in which the user enters PIL statements at the keyboard, and is assisted to do so correctly by acceptance and nonacceptance responses; or created without the user's needing knowledge of PIL, by way of the VR-Editor, with its associated menu system. However it is written, the content of the Q1 file is what dictates how the flow-simulating calculation will proceed. 3.5 MATHEMATICAL CONTENT OF PHOENICS The equations solved by PHOENICS are those which express the balances of mass, momentum, energy, material (i.e. chemical species) and other conserved entities (e.g. electrical charge) over discrete elements of space and time, i.e. 'finite volumes' known as 'cells'. The cells are arranged in an orderly (i.e. "structured") manner in a grid which may be Cartesian, cylindrical-polar, or body-fitted, i.e. curvi-linear, and which may be segmented into distinct "blocks". These equations express the influences of diffusion (including viscous action and heat conduction), convection, and variation with time, sources and sinks.
170 In order to reduce the numerical errors, which may result from the unsymmetrical nature of the convection terms, PHOENICS can make use of a large variety of 'higher-order schemes', including QUICK, SMART, Van Leer, and many others. The dependent variables of these equations are thus: mass or volume fraction, velocity and pressure, temperature or enthalpy, concentration, electrical charge or other conserved property. The mass and momentum equations are solved in a semi-coupled manner by a variant of the well-known SIMPLE algorithm. Because the whole equation system is non-linear, the solution procedure is iterative, consisting of the steps of: computing the imbalances of each of the above entities for each cell. computing the coefficients of laniaries equations which represent how the imbalances will change as a consequence of (small) changes to the solved-for variables. solving the linear equations. correcting the values of solved-for variables, and of auxiliary ones, such as fluid properties, which depend upon them. repeating the cycle of operations until the changes made to the variables are sufficiently small. Various techniques are used for solving the linear equations, including tri-diagonal matrix algorithm, (a variant of) Stone's 'Strongly Implicit Algorithm', conjugate-gradient and conjugate-residual solvers. PHOENICS also possesses a multi-grid coupled-variable solver, called MIGAL.