MIGAL for PHOENICS


Contents

  1. Introduction
  2. Activation
  3. Parameters
  4. Implementation in PHOENICS
  5. Performance
  6. Library examples





1. Introduction

When computational fluid dynamics first engaged the attention of engineers, during the 1960s, only algorithms with small demands on computing power could survive. Computer memory was then extremely rare and expensive. In this context, use of the Patankar-Spalding SIMPLE algorithm and its descendants (SIMPLER, SIMPLEC, SIMPLEST, PISO...), based on the segregation of momentum and continuity equations was the best strategy to adopt.

But as the number of cells increases, the elliptic nature of the pressure field becomes a penalty and the global convergence of the method strongly slows down.

The present state of the technology opens doors to other ways of thinking. The mean amount of RAM on workstations is continually increasing and its price decreasing so that, in many case, refining a grid up to the computer storage capability leeds to some huge CPU times to convergence.

Therefore, as soon as the bottleneck becomes the required time for the solution (including the CPU time needed to optimise the solver parameters by trial and error), another velocity-pressure coupling strategy must be chosen.

This is precisely the point of MIGAL for PHOENICS: an algebraic multi-grid solver which solves simultaneously the hydrodynamic variables in a whole-field manner.

MIGAL for PHOENICS in an add-on for PHOENICS created and attached by mfrdc.com of Orvault, France.





2. Activation

To solve the hydrodynamic variables (velocity and pressure), MIGAL for PHOENICS can be activated simply by setting the following statement in the Q1 file:

SPEDAT(MIGAL, SOLVEDnn, C, HYDRO)

where nn is an arbitrary unique number between 1 and 50 that MIGAL uses to associate parameters to this solution.

To solve a scalar variable with MIGAL for PHOENICS, set the following statement :

SPEDAT(MIGAL, SOLVEDnn, C, name)

where name is the name of the variable to be solved (TEM1, C1, KE, EP...) and where nn is an arbitrary unique number between 1 and 50 that MIGAL uses to associate parameters to this solution.

When using the k-epsilon model with coupled hydrodynamics it is sometimes helpful to have the k and epsilon variables solved together with MIGAL rather than sequentially. For this, set the following statement :

SPEDAT(MIGAL, SOLVEDnn, C, KEMODL)

MIGAL can also be activated from the 'Numerics' panel of the Main Menu in the VR-Editor. All the control variables can be set from there. Any required SPEDAT settings will be written to the Q1 by the Editor.






3. Parameters

MIGAL is a linear solver which uses several internal parameters. The default value of these parameters can be overwritten for each nn solution by setting the corresponding spedat statement in the Q1 file.



3.1 RESFAC

RESFAC is the residual-reduction factor given to MIGAL to stop iterations. When this is set to a non-zero value, MIGAL will return as soon as the residuals become lower than RESFAC time the initial residuals. When set to zero, MIGAL runs until LITER is reached.

SPEDAT(MIGAL, RESFACnn, R, value)

where value is a positive real lower than 1 (default 0.1) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.2 LITER

LITER is the maximum number of iterations (cycles) that MIGAL is allowed to perform. This number is used only when the residuals are not reduced enough to fit the RESFAC statement.

SPEDAT(MIGAL, LITERnn, I, value)

where value is a positive integer (default 5) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.3 LINRLX

LINRLX is the under-relaxation factor that MIGAL applies to the correction fields before adding them to their corresponding variable fields. This parameter is usually used to damp oscillations that occur when the problem is highly non-linear. The default value is set to 0.5 in order to bring robustness for beginners but 1.0 is a usual value.

SPEDAT(MIGAL, LINRLXnn, R, value)

where value is a positive real (default 0.5) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.4 RELAX

RELAX is the relaxation factor for the MIGAL multi-grid smoother. The efficiency of MIGAL is rather sensitive to this parameter and therefore a fine tuning is recommended. Usual values should be larger than 0.8.

SPEDAT(MIGAL, RELAXnn, R, value)

where value is a strictly positive real (default 0.95) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.5 NBRELAX

NBRELAX is the number of relaxations (post-relaxations) to be done by the multi-grid smoother on each grid level.

SPEDAT(MIGAL, NBRELAXnn, I, value)

where value is a strictly positive integer (default 3) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.5 NBPRER

NBPRER is the number of relaxations (pre-relaxations) to be done by the multi-grid smoother before transferring the calculation to each coarser grid level.

SPEDAT(MIGAL, NBPRERnn, I, value)

where value is a positive integer (default 1) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.6 NBGRID

NBGRID is the number of grid levels that MIGAL must use for its multi-grid procedure. When set to zero MIGAL automatically define the number of grid levels to be used. When set to 1 MIGAL becomes a single-grid solver.

SPEDAT(MIGAL, NBGRIDnn, I, value)

where value is a positive integer (default 0) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.7 COEFF

COEFF is the scaling factor of the preconditionner that MIGAL use when starting with a strong initial continuity residual. When set to zero the preconditionner is switched off.

SPEDAT(MIGAL, COEFFnn, R, value)

where value is a positive real (default 1.0) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.5 IGMRES

IGMRES is the size of the Krylov subspace used by the GMRES implementation. When set to zero the GMRES acceleration capability is switched off.

SPEDAT(MIGAL, IGMRESnn, I, value)

where value is a positive integer (default 0) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.5 IPRECO

IPRECO fixes the number of multi-grid cycles that have to be done to precondition the GMRES process. This parameter is associated to non-zero values of IGMRES.

SPEDAT(MIGAL, IPRECOnn, I, value)

where value is a positive integer (default 1) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.5 IGMS

IGMS is the size of the Krylov subspace that MIGAL uses when the GMRES technique is also employed as a smoother. In that case the smoother is preconditioned by NBPRER and NBRELAX relaxations of the ILU(0) solver.

SPEDAT(MIGAL, IPRECOnn, I, value)

where value is a positive integer (default 0) and nn is the arbitrary unique number set by the SOLVEDnn statement.



3.8 PRINT

PRINT is a switch which turns on (true) or off (false) the internal residuals outputs from MIGAL. The outputs are the normalised residuals for each iteration (cycle) of MIGAL.

SPEDAT(MIGAL, PRINTnn, L, value)

where value is logical (default T) and nn is the arbitrary unique number set by the SOLVEDnn statement.





4. Implementation in PHOENICS

Considering the coupling between the momentum equations and the continuity, the first attempt to solve the momentum equation and the continuity simultaneously was the Carreto-Curr-Spalding 'SIVA' algorithm. Unfortunately, mainly because of the small available computer power in 1972, the coupling between variables was performed only in small subdomains and the coupling between subdomains remained a weak point.

For this reason, MIGAL is a whole-field linear solver which updates simultaneously the velocity and pressure fields in the entire domain and therefore enforces the whole-field switch of all the affected variables. In addition, the internal calling sequence of PHOENICS is also modified for solving the equations only when all the coefficients are built :


Strictly speaking, the coefficients of the correction equations are also modified to match the MIGAL requirements. For example, to take into account the velocity-pressure coupling, the dVELdP terms are rebuilt and used for both the momentum and the continuity equations.

Finally, because MIGAL is just a linear algebraic solver, it hands over the reins to PHOENICS after step 6 for the next non-linear iteration sweep.





5. Performance

Because of its strong coupling technique and its multi-grid approach MIGAL for PHOENICS can produce great robustness and large speed-up for many flows. For example, the following figure illustrates the speed-up for the 2D square lid-driven cavity flow (library case E001) and how this speed-up increases with the number of cells.





Of course this speed-up has a cost. The storage of the coefficients of the coupled equations and the additional storage for the multi-grid procedure increase the minimum size of the F array. This enlargement of the memory requirement is not an obstacle for 2D flows. As shown by the figure below (library case E001), MIGAL for PHOENICS still use a reasonable amount of RAM for a much better convergence when the number of cells increases.





In order to estimate the additional memory required for MIGAL, one should use the following rules :






5. Library examples

For people not yet familiar with the new paradigm of algebraic coupled solvers, different ways of using MIGAL for PHOENICS are illustrated by several library examples. Nevertheless, one should keep in mind the following general advice: