Encyclopaedia Index

### (a) Sweeps (Group 15)

Prior to the introduction of the UWATCH and USTEER commands, of the graphical monitor (switched on by a negative TSTSWP setting), and of SELREF and RESFAC the following advice (which appeared in the Beginner's Guide) was appropriate. Even now it has some value.

"If you are watching over the progress of your calculation, and can have immediate and unimpeded access to your computer, it is useful to set LSWEEP to a small value (eg 20) and to proceed by way of a succession of restarts.

Even if this is not done, it is wise to ensure that LSWEEP is set to some not-excessive value, especially if the computation is to be performed without your being on call to abort a run which is evidently not converging. Probably 100 is as large as should ordinarily be allowed, unless experience has shown that, for the problem in question, satisfactory convergence requires more sweeps.

Preferably however, the sweeps should not be terminated by LSWEEP at all, but instead by the falling of all sums of absolute residuals to below the values pre-set in the array RESREF.

In this connexion it should be noted that RESREF is a quantity having the dimension of the dependent variable in question, multiplied by mass and divided by time (except in the case of variable P1, as explained below).

You need to consider, by reference to the flow rates involved in the phenomenon being simulated, what value of RESREF is appropriate to each of the variables for which you are solving.

In time-dependent problems, for example, the transient terms in the balance equations become larger the smaller is the time step, because the time interval appears as a divisor. It is therefore appropriate also to make RESREF larger as the time step is diminished. This is easily done by setting RESREF by way of an arithmetic expression involving FLOAT(LSTEP) in the numerator and TLAST in the denominator.

Extreme values of RESREF should be avoided. If RESREF is set too high, the solution sequences will terminate too early, at least for the relevant variable; and the solution will be correspondingly inaccurate.

Uneven values of RESREF should also be avoided. If the solution of one of the momentum equations terminates prior to the termination of the pressure-correction equation and the other momentum equations, it will continue to be adjusted by the pressure corrections without its momentum equation being solved. This can lead to a gradual drift away from convergence until its residual sum exceeds its RESREF, whereupon its momentum equation will be solved again. In extreme cases this behaviour can lead to divergence.

If, on the other hand, RESREF is set too low, calculations will continue long after the solution has been reached as nearly as the machine's round-off error will permit. It is of course hard to know with certainty, before the calculation begins, what values of LSWEEP, RESREF etc will be appropriate. It is therefore convenient that the restart facility of PHOENICS permits you to make a few sweeps, to pause in order to inspect the results, and then to continue the calculation, with different settings of relaxation parameters if this seems desirable.

It is important to understand the differing roles of RESREF(P1), RESREF(R1) and RESREF(R2), all of which are concerned with continuity balances.

RESREF(P1) is the reference value of the volumetric-flow imbalance; and, when two-phase flows are in question, it is compared with the sums of the volumetric imbalances for the two phases for each cell.

RESREF(R1) and RESREF(R2), by contrast, represent mass imbalances, and they relate to the individual phases. When they are all set to values other than zero, all contribute to the determination of whether sweeps should terminate prior to the performance of LSWEEP of them.

Since version 1.6, a self-selection mechanism has been provided. It is activated by setting SELREF=T in the Q1 file. Then the user has only to select a single value, namely RESFAC, which causes EARTH to set RESREF for each variable to RESFAC times a representative flow rate for that variable in that flow.

See PHENC entries: SELREF, RESFAC, TSTSWP, RESREF, UWATCH, USTEER.

### (b) Slabwise iterations (Group 16)

For parabolic problems, only one sweep is made through the integration domain, because storage is provided only for variables belonging to two slabs at a time, namely:

1. the slab for which variables are being calculated, and
2. its 'low' neighbour.

LSWEEP is therefore set equal to 1 by EARTH, whatever value happens to have been set by the SATELLITE.

The interconnectedness of the equations makes it necessary that, in parabolic problems, the whole cycle of variable adjustments should be repeated many times. This is achieved by setting the variable LITHYD to a sufficiently large number.

See the Encyclopaedia entry 'LITHYD'.

### (c) Iterations in the linear-equation solver

(Group 16)

The linear-equation solver of PHOENICS acts in an iterative manner, except when all but one of NX, NY and NZ are unity, or when NX or NY is unity and whole-field solution has been switched off. In other circumstances, the question arises: how many iterations should be performed?

In terms of data settings, the questions become: what values should be ascribed to LITER, to RESREF and to ENDIT for each of the solved- for variables?

These questions are of importance; for they often affect the speed with which the overall solution is arrived at; and, when the variable in question is P1, which is strongly connected with the satisfaction of mass continuity, they may affect whether it is attained at all. Especially because simulations with fine grids are often too expensive for comfort, means of reducing cost without loss of accuracy are worthy of consideration.

The expense itself will of course be smallest if LITER is small, or if both RESREF and ENDIT are large; for either will cause the iteration process to be swiftly terminated. Whether or not this is tolerable depends upon whether the variable in question is one of those of which the convergence limits the speed of approach to the overall solution.

In forced-convection heat-transfer problems, in which the fluid-flow pattern is of great importance, the pressure-correction sequence controls the satisfaction of mass continuity; it is therefore usually desirable to employ large values of LITER(P1) and small values of RESREF(P1) and ENDIT(P1). This entails that a large amount of computer time will be spent in solving for P1; but it is probably well-spent. Corresponding expenditure on the enthalpy equation is less likely to be worthwhile, because there is no point in having a highly accurate solution to the linear equations if their coefficients have not yet settled down.

Indeed, if the enthalpy (and other scalar fields) are only weakly coupled (or not coupled at all) to the velocity field, great economy can be achieved by settling the hydrodynamics first, without solving for enthalpy. In subsequent restarts, the enthalpy can be solved on a frozen velocity field by deactivating the solution of the hydrodynamic variables (ie the velocities and pressure).

In this connexion, it is always worth considering the use of the index ISWC1, which appears in Group 15, and is defaulted to 1. This controls the first sweep at which the dependent variables from number 12 (KE) onwards enter the solution cycle. If ISWC1 is set to 50, say, the velocity fields will have had 50 sweeps in which to attain their converged values before solution for variable C1 starts at all.

Free-convection heat-transfer problems, by contrast, would not be suitably treated in this way; for the velocity fields cannot be determined independently of the temperature field. In such cases equal importance should be ascribed to both the pressure- and the temperature-equation solvers.

Flow-simulation problems are so various that it is difficult to give any further generally applicable advice. However, it is possible to find out what time that is spent in the linear-equation solvers in any particular flow simulation, and about the work that they are doing, by setting LITER to the negative of the value required. This has the effect of transmitting to the VDU information about the course of the iterative process for each sweep for which ISWEEP is a multiple of TSTSWP. If inspection of this information shows that many iterations are performed in which there is almost no change to the values, ENDIT should be enlarged.

The convergence rate of the whole-field linear solver can be accelerated by means of the OVRRLX parameter.

Also of use to those users who wish to observe or control the convergence behaviour are the PIL variables UWATCH and USTEER. Setting these to T in the Q1 file permits intervention in the calculation as it proceeds.

Further, setting TSTSWP (q.v.) to a negative number activates the graphical convergence monitor."

wbs