PHOENICS Frequently-Asked Questions; a selection

CHAM Technical Report TR/010

Document last revised 21/08/02

Contents

1. Introduction

2. Installation

3. Boundary Conditions and Sources

4. Physical modelling

4.1 Turbulence

4.2 Multi-phase

4.3 Combustion

4.4 Melting and Solidification

4.5 Chemical Vapour Deposition (CVD)

4.6 Fire and Smoke Modelling

5. Choice of Numerical Methods

5.1 Convergence

1. Introduction

CHAM's User-Support team provides assistance to PHOENICS users world-wide, both by responding to individual enquiries and by publishing, by way of CHAM's website, a Frequently-Asked-Questions (FAQs) page.

Partly in order to draw attention to its existence, and partly because of the direct usefulness of its contents, a selection of questions and answers is now included in the hard-copy documentation of PHOENICS.

A full set of frequently asked questions and answers is available on the Internet on a special website, for maintained customers. In addition, the answers to many questions can often be found in the PHOENICS Encyclopaedia. This can be accessed from within PHOENICS-VR via the HELP and POLIS options. Alternatively, it can be accessed directly via CHAM's website at

2. Installation

Q1. Question: - When I click on 'compile' from the VR Environment I encounter the error message 'Bad command'. How do I cure the problem?

Answer:

This problem is usually because the path name to the script dfvars.bat is incorrect in the file /phoenics/d_utils/phoepath.bat. The relevant part of the phoepath.bat ( or phoepath.bat) file looks like:

set DFDir="c:\Program Files\Microsoft Visual Studio\DF98"

rem

echo Adding DIGITAL PHOENICS to path

path=\phoenics\d_utils\d_windf;\phoenics\d_utils;%path%

call %DFDir%\bin\dfvars.bat

When the Compaq Visual Fortran compiler was installed in the user's computer, it may not have been placed in the default directory, but in some other directory or even on a different drive.

The 'set DFDir' line should be modified to reflect the actual location of the compiler. Note that the " " marks around the path name are vital if the directory names contain spaces.

The default location for V6.0 onwards is:

c:\Program Files\Microsoft Visual Studio\DF98.

For V5.0 of the compiler, the default location is:

c:\Program Files\Devstudio\DF\bin\dfvars.bat.

In summary, the solution to the 'Bad Command' problem is to determine the location of the dfvars.bat file on your computer and then correct the path name in the phoepath.bat file.

Q2. Question: - When I click on 'compile' from the VR Environment I encounter the error message 'Out of environment space'. How do I cure the problem?

Answer:

This problem may be cured by inserting the following line in your c:config.sys file:

shell=c:\command.com c:\ /P /E:4096.

If this doesn't work, then try the following. When you click on 'compile' and then on 'GROUND', you can try increasing the environment memory for the window in which the compilation is taking place, i.e. click on the 'properties' of the window, then click on 'memory' and then under 'Initial Environment' change 'Auto' to say '4096'. This should be equivalent to the 'config-file' suggestion made above.

Q3. Question: - When I click on 'compile' from the VR Environment I encounter the error message 'Too many parameters'. How do I cure the problem?

Answer:

This error message may be cured by modifying the file /phoenics/d_utils/phoepath.bat so that the path statement:

echo Adding DIGITAL PHOENICS to path

path = \phoenics\d_utils\d_windf;\phoenics\d_utils;%path%

is replaced by

echo Adding DIGITAL PHOENICS to path

path = \phoenics\d_utils\d_windf;\phoenics\d_utils;c:\dos;c:\windows\command

This means the path is set explicitly, rather than adding to an existing path by the use of %path%. The path statement above is the bare minimum required for Windows - it should replicate the actual path on the users system.

Q4. Question: - I get black holes in my contours in the VR-Viewer. How do I cure the problem?

Answer:

Some customers have experienced some problems with some graphics cards before, including...

  • some very small black holes in contours; just the size of a pixel
  • large black holes in contours.

In each case, the problems were solved by downloading the latest upgrade of the graphics card driver software from the graphics card manufacturer's website.

Previously reported problems due to graphics cards were...

  • MATROX G450 AGP Card. A bug in their driver software caused big black holes in contours. The customer, in Venice, solved the problem by downloading their latest driver software from their website at
  • ATI 128 Pro GL Graphics Card, with 16MB. The customer was only able to use Phoenics on 256 colour mode, and not with other options like 'true colours', for which it gave an error message, related to the ati .dll driver software.

Whatever Graphics Card/Video Board you have, it will often pay to ensure that you have the latest upgrades/service packs for their driver software installed, especially if you are experiencing problems. Sometimes their software may have bugs. You can usually download for FREE, their latest driver software from the manufacturer's website. Note that care is needed to download the software for the particular operating system being used.

Q5. Question: - The VR-Viewer sometimes draws the contours in white.

Answer:

On some machines, probably faster machines, in VR-Viewer, when plotting contours, it sometimes plots the 'slice' all in white,i.e. no colour contours can be seen. In the meantime, users can solve the problem only by exiting and restarting VR. Then, when the user next presses the contour button, he/she should not release the button quickly, but rather he/she should hold the button down that little bit longer - say a second or two. This practice seems to avoid the problem. However,once the white contour does appear, the user must exit VR and restart to clear the problem.

Q6. Question: - I have problems selecting objects with the mouse in the VR-Editor.

Answer:

We found that the picking problem, found by one user, was cured by lowering the Hardware Acceleration of the Graphics Card, from the default of Full, via the Display advanced troubleshooting settings.

3. Boundary Conditions and Sources

Q1. Question: - How do I set resistance terms, such as the Ergun Equation?

Answer:

Introduction

The ERGUN equation represents the pressure drop associated with flow through a packed bed, or more generally, a porous medium.

In PHOENICS, pressure drops are applied as sinks in the momentum equation. The units of the momentum equation are those of force, so the pressure drop must also be turned into a force.

The ERGUN equation can be written as:

dp/dx = a*U1 + b*U12

where a=µ/K and b is an empirical constant. Here, µ is the dynamic viscosity of the fluid flowing through the porous media and K is an empirical constant called the permeability.

The pressure drop can be turned into a force, as follows:

Fx = Area * dp

 = Area * dp/dx * dx

Now Area = dy * dz;

so dx * Area = Volume

Hence:

Fx = Volume * (a*U1 + b*U12)

Implementation

The velocities used in the equation are superficial velocities, so

This can be introduced as two patches:

 PATCH(ERGUN1, VOLUME, ......

 COVAL(ERGUN1, U1, a, 0.0)

 PATCH(ERGUN2, VOLUME, ......

 COVAL(ERGUN2, U1, -b, 0.0)

Note that the -ve COefficient in patch ERGUN2 is activating a quadratic source - as stated in POLIS.

In the VR-Editor, the above can be achieved by giving an object the type User-Defined, and setting two patches with the Attributes as described above.

Q2. Question: - How do I set a Stagnation Pressure boundary condition?

Answer:

For incompressible flows, the stagnation pressure is:

Pt = P + 0.5 . . vel**2

This can be manipulated to give the mass flux:

 . vel =  ( 2 . . (Pt - P) )

For P1 (and also P2), a negative coefficient flags a mass source of the form:

Sm = T .  ( abs ( Cm . (Vm - Pp)))

where Cm and Vm are the coefficient and value for mass (P1).

The desired stagnation source can thus be set by putting:

coefficient = - 2 * 

value = Pt

type = appropriate area

These settings must be supplemented by a COVAL for the velocity component normal to the boundary, with coefficient set to ONLYMS, and value set to SAME.

PIL example:

PATCH (PSTAG, LOW, 1,N,1,NY, 1,1, 1,LSTEP)

COVAL (PSTAG, P1, -2*RHO1, PSTAG)

COVAL (PSTAG, W1, ONLYMS, SAME)

Note that for compressible flows, it is still possible to set stagnation conditions, though not in such an easy fashion.

In the VR-Editor, the above can be achieved by giving an object the type User-Defined, and setting the Attributes as described above

4. Physical Modelling

4.1 Turbulence

Q1. Question: - How do I obtain the wall shear stresses from my PHOENICS simulation?

Answer:

If you put STORE(STRS,SKIN,YPLS) in Group 7 of the Q1 file, PHOENICS will write to the PHI and RESULT files the wall shear stress (tau/rho), the local skin friction coefficient (tau/(rho*urel**2)), and the dimensionless wall-to-node distance (y+=ustar*dist/enul).

If the energy equation is solved, then STORE(HTCO) will cause PHOENICS to write the heat transfer coefficients to the PHI and RESULT files.

Q2. Question: - How do I introduce a log-law inlet profile without recourse to GROUND coding?

Answer:

Library case N110 provides an example of PIL Q1 coding for use with high-Reynolds number turbulence models.

Library case T207 provides an example for low-Reynolds turbulence models, but in the form of INIVAL PATCH rather than on INLET PATCH.

4.2 Multi-phase

Q1. Question: - What are the free surface capabilities in PHOENICS?

Answer:

PHOENICS has at least six features which have been used for the simulation of flows with free surfaces, namely:

(1) Height-of-liquid (HOL) method;
(2) Scalar-equation method (SEM);
(3) IPSA, with high interphase friction and an interface sharpening device;
(4) Moving porosities, with a blocked region adapting to the shape of a liquid surface;
(5) Moving body-fitted coordinates; and
(6) Surface tracking by means of moving particles.

Which method should be chosen depends on the type of application area. CHAM can offer advice if comprehensive information is supplied by the user about the kinds of free-surface problems for which he is seeking solutions. This information should include answers to at least the following questions:
(a) Is the flow steady or unsteady?
(b) Is the flow 1D, 2D or 3D?
(c) Are the fluids gases, liquids or both?
(d) Does mass cross the interface, and, if so, in accordance with what law?
(e) Does the interface remain approximately horizontal or approximately vertical?
(f) Are there any other known limitations, for example - no overturning?
(g) Is gravity (or some other body force) active?
(h) Is one, or are both, fluids, in thermal contact with a solid obstruction to the flow?
(i) Is either fluid compressible?
(j) Is the user interested in a single example or in a class of problems?
(k) If the user is interested in a class, what is the extreme range conditions contained in the class?
Some technical comments on the various methods are:

  • SEM is likely to be expensive in computer time as it needs to be run as a transient, and requires small time steps to combat numerical smearing of the interface (free surface), and to maintain numerical stability.
  • HOL is more economical than SEM, but may have to be run as a transient in order to obtain convergence. In addition, this method does not allow any overturning of the interface.
  • IPSA involves solving twice as many equations as the other methods unless run in equal-velocity mode, i.e. one set for the liquid phase and one for the gas. The methods will need to be run as a transient if the interface-sharpening device DONACC is used to avoid numerical smearing of the interface.

4.3 Combustion

Q1. Question: - How can I best use PHOENICS for simulating the propagation of flame, and of the associated pressure waves, in a closed cavity, initially filled with a combustible gaseous mixture, when ignition occurs at more than one point? The dimensions and times are small enough for the process to be presumed laminar. The mixture consists of hydrogen, oxygen and nitrogen; and detailed chemical kinetics must be taken into account.

Answer:

Because the thickness of the flame front will be very small compared with the dimensions of the apparatus, an accurate simulation will require the grid to be very fine.

Since the whole phenomenon is three dimensional and transient. Computing times will be so long as (probably) to be regarded as impractical. Therefore some simplifications will need to be made, as follows:

  1. The influence of the initial composition, temperature and pressure, and of the chemical-kinetic constants, can best be explored by use of a one-dimensional model; for this will allow the grid to be fine enough for the reaction-diffusion interactions within the thin flame front to be computed accurately.
  2. In this case it will be advisable to make use of the stretching-coordinate system exemplified in library case 109; for this eliminates numerical diffusion.
  3. The CHEMKIN add-on should be used for the correct representation of the thermodynamic and chemical-kinetic properties of the gases; and if the highest realism is required, the multi-component diffusion module of PHOENICS-CVD can be activated.
  4. Such a one-dimensional study will reveal under what conditions detonation (i.e. significant chemical reaction, ahead of the flame, brought about by adiabatic compression) will occur. It will also enable a flame-speed-versus-pressure-and-temperature database to be created for each initial condition.
  5. The behaviour of the gas with multiple ignition points can thereafter be computed by treating the flame as a thin discontinuity of temperature and composition which propagates through space at the speed given by the data-base created in the one-dimensional study. Such a multi-dimensional thin-flame study is exemplified by the PhD work of J.Z.Wu.
  6. The onset of detonation will be detected, in this multi-dimensional thin-flame study, by accurate computation of the reaction in the ahead-of-flame gas. These reactions, being rather uniform in space, do not require a fine grid.

4.4 Melting and Solidification

Q1. Question: - Should the H1 or TEM1 formulation of the energy equation be used to simulate the melting of a metallic charge in a furnace together with conductive heat transfer through the bounding refractory walls?

Answer:

The use of H1 is not recommended for composite-media problems in Versions earlier than 3.5, because the conductive heat flux was represented by qi =-(k/Cp)*dH/dxi.

The TEM1 equation is recommended because the heat flux is represented correctly as qi =-k*dT/dxi, and it is solved as an energy equation with temperature as dependent variable. Consequently, the convection and transient terms are represented in terms of enthalpy.

The latent heat effects can be introduced into the TEM1 equation by one of two methods:

(a) the use of an effective specific heat.
(b) the use of an enthalpy source term to represent the evolution of latent heat.

Method (a) is simpler to implement than Method (b), but can suffer convergence difficulties around limits of the phase-change region due to the discontinuous nature of the effective specific-heat curve at the solidus and liquidus temperatures. This leads to over-corrections in the energy equation which could be corrected by appropriate modifications to the central-coefficient term Ap in the TEM1 equation. This balance equation, like all others in PHOENICS, is solved in correction form.

The use of method (b) with the TEM1 equation presents no formulation difficulties because, as was mentioned already, the transient and convection terms are represented in terms of the enthalpy. The treatment of the latent-heat source term requires special attention to ensure convergent behaviour, as discussed by Voller and Prakash [Int.J.Heat Mass Transfer, Vol.30, No.8, p1709, (1987)].

Further information on how to implement either of the two melting methods is not covered by free user support, but simple Q1 examples and GROUND subroutines can be purchased from CHAM's Consultancy Team.

4.5 Chemical Vapour Deposition (CVD)

Q1. Question: - How do I store thermal diffusion coefficients within CVD PHOENICS?

Answer:

The thermal diffusion coefficients can be stored by use of:

STORE(TD01,TD02,...... ,TDNN)

Q2. Question: - In CVD PHOENICS what are the units of the polynomial coefficients in the THERM.DAT data file?

Answer:

The polynomial coefficients for the calculation of the thermodynamic properties are dimensionless as is evident from the equations below:

cp/R = a1 + a2*T + a3*T^2 + a4*T^3 + a5*T^4

H0/RT = a1 + a2/2*T + a3/3*T^2 + a4/4*T^3 + a5/5*T^4 + a6/T

S0/R = a1*ln(T) + a2*T + a3/2*T^2 + a4/3*T^3 + a5/4*T^4 + a6/5*T^5 + a7

Q3. Question: - How can I use species that contain more than 4 elements, when only 4 can be included in the THERMDAT data file?

Answer:

The format of the THERMDAT file was based on that used by CHEMKIN, which only provided room for 4 elements. To overcome this limitation, PHOENICS-CVD makes use of other spaces in the THERMDAT entry to enable a further 4 elements to be included.

The first 4 elements occupy columns 25-44 on line 1 of an entry: 5 columns per element - 2 for the symbol, 3 for the number of atoms of the element in each species molecule. The additional elements should be positioned as follows:

Element 5 - line 1, columns 74-78

Element 6 - line 4, columns 61-65

Element 7 - line 4, columns 66-70

Element 8 - line 4, columns 71-75

The following fictional entry provides an example:

A1B2C3D4E5F6G7H8 70590A 1B 2C 3D 4G 0300.00 4000.00 1500.00E5 1

0.01913678E+03 0.08578044E-01-0.08882060E-05-0.03574819E-08 0.06605142E-12 2

-0.06560876E+06-0.08432507E+03-0.04662286E+02 0.06091547E+00-0.04710536E-03 3

0.01968843E-06-0.03563271E-10-0.05665403E+06 0.04525264E+03F 6G 7H 8 4

4.6 Fire and Smoke Modelling.

Q1. Question: - How do I model smoke movement?

Answer:

The PHOENICS scalar variable C1 (or alternatively SMOK in FLAIR) is solved to represent the smoke concentration.

The obvious ways to introduce a fire are:

  1. to have a blockage of the fluid material, usually air, with a heat release and associated source of smoke
  2. to have an inlet of fluid, carrying with it a smoke concentration and an appropriate temperature (or having a fixed flux of heat instead for any combustion release).

In either case, the units for the C1 variable are to some extent up to the user. The conserved quantity is C1*density, so a natural choice is C1 = mass fraction of smoke, with units of kg/kg, but this is not essential: 'anything'/kg will do, provided that all sources are consistently treated.