[Fluent Inc. Logo] return to home search
next up previous contents index

25.18.1 Monitoring Residuals

At the end of each solver iteration, the residual sum for each of the conserved variables is computed and stored, thus recording the convergence history. This history is also saved in the data file. The residual sum is defined below.

On a computer with infinite precision, these residuals will go to zero as the solution converges. On an actual computer, the residuals decay to some small value ("round-off'') and then stop changing ("level out''). For single-precision computations (the default for workstations and most computers), residuals can drop as many as six orders of magnitude before hitting round-off. Double-precision residuals can drop up to twelve orders of magnitude. Guidelines for judging convergence can be found in Section  25.22.1.



Definition of Residuals for the Pressure-Based Solver


After discretization, the conservation equation for a general variable $\phi$ at a cell $P$ can be written as


 a_P \phi_P = \sum_{\rm nb}a_{\rm nb} \phi_{\rm nb} + b (25.18-1)

Here $a_P$ is the center coefficient, $a_{\rm nb}$ are the influence coefficients for the neighboring cells, and $b$ is the contribution of the constant part of the source term $S_c$ in $S = S_c + S_P \phi$ and of the boundary conditions. In Equation  25.18-1,


 a_P = \sum_{\rm nb}a_{\rm nb} - S_P (25.18-2)

The residual $R^\phi$ computed by FLUENT's pressure-based solver is the imbalance in Equation  25.18-1 summed over all the computational cells $P$. This is referred to as the "unscaled'' residual. It may be written as


 R^\phi = \sum_{{\rm cells}\ P}{\vert\sum_{\rm nb}a_{\rm nb} \phi_{\rm nb} + b - a_P \phi_P\vert} (25.18-3)

In general, it is difficult to judge convergence by examining the residuals defined by Equation  25.18-3 since no scaling is employed. This is especially true in enclosed flows such as natural convection in a room where there is no inlet flow rate of $\phi$ with which to compare the residual. FLUENT scales the residual using a scaling factor representative of the flow rate of $\phi$ through the domain. This "scaled'' residual is defined as


 R^\phi = {\sum_{{\rm cells}\ P}{\vert\sum_{\rm nb}a_{\rm nb... ...phi_P\vert} \over \sum_{{\rm cells}\ P}\vert a_P \phi_P\vert} (25.18-4)

For the momentum equations the denominator term $a_P \phi_P$ is replaced by $a_P v_P$, where $v_P$ is the magnitude of the velocity at cell $P$.

The scaled residual is a more appropriate indicator of convergence for most problems, as discussed in Section  25.22.1. This residual is the default displayed by FLUENT. Note that this definition of residual is also used by Fluent Inc.'s structured grid solver FLUENT 4.

For the continuity equation, the unscaled residual for the pressure-based solver is defined as


 R^{c} = \sum_{{\rm cells}\ P}{\vert{\rm rate\ of\ mass\ creation\ in\ cell\ P}\vert} (25.18-5)

The pressure-based solver's scaled residual for the continuity equation is defined as


 \frac{R^{c}_{{\rm iteration}\ N}}{R^{c}_{{\rm iteration}\ 5}} (25.18-6)

The denominator is the largest absolute value of the continuity residual in the first five iterations.

The scaled residuals described above are useful indicators of solution convergence. Guidelines for their use are given in Section  25.22.1. It is sometimes useful to determine how much a residual has decreased during calculations as an additional measure of convergence. For this purpose, FLUENT allows you to normalize the residual (either scaled or unscaled) by dividing by the maximum residual value after $M$ iterations, where $M$ is set by you in the Residual Monitors panel in the Iterations field under Normalization.


 \bar R^\phi = \frac{R^\phi_{{\rm iteration}\ N}}{R^\phi_{{\rm iteration}\ M}} (25.18-7)

Normalization in this manner ensures that the initial residuals for all equations are of $O(1)$ and is sometimes useful in judging overall convergence.

By default, $M = 5$. You can also specify the normalization factor (the denominator in Equation  25.18-7) manually in the Residual Monitors panel.



Definition of Residuals for the Density-Based Solver


A residual for the density-based solver is simply the time rate of change of the conserved variable ( ${\mbox{\boldmath$W$}}$). The RMS residual is the square root of the average of the squares of the residuals in each cell of the domain:


 R({\mbox{\boldmath$W$}}) = \sqrt{\sum {\left(\frac{\partial{{\mbox{\boldmath$W$}}}}{\partial{t}}\right)^2}} (25.18-8)

Equation  25.18-8 is the unscaled residual sum reported for all the coupled equations solved by FLUENT's density-based solver.

figure   

The residuals for the equations that are solved sequentially by the density-based solver (turbulence and other scalars, as discussed in Section  25.1.2) are the same as those described above for the pressure-based solver.

In general, it is difficult to judge convergence by examining the residuals defined by Equation  25.18-8 since no scaling is employed. This is especially true in enclosed flows such as natural convection in a room where there is no inlet flow rate of $\phi$ with which to compare the residual. FLUENT scales the residual using a scaling factor representative of the flow rate of $\phi$ through the domain. This "scaled'' residual is defined as


 \frac{R({\mbox{\boldmath$W$}})_{{\rm iteration}\ N}}{R({\mbox{\boldmath$W$}})_{{\rm iteration}\ 5}} (25.18-9)

The denominator is the largest absolute value of the residual in the first five iterations.

The scaled residuals described above are useful indicators of solution convergence. Guidelines for their use are given in Section  25.22.1. It is sometimes useful to determine how much a residual has decreased during calculations as an additional measure of convergence. For this purpose, FLUENT allows you to normalize the residual (either scaled or unscaled) by dividing by the maximum residual value after $M$ iterations, where $M$ is set by you in the Residual Monitors panel in the Iterations field under Normalization.

Normalization of the residual sum is accomplished by dividing by the maximum residual value after $M$ iterations, where $M$ is set by you in the Residual Monitors panel in the Iterations field under Normalization:


 \bar R({\mbox{\boldmath$W$}}) = \frac{R({\mbox{\boldmath$W$}... ...iteration}\ N}}{R({\mbox{\boldmath$W$}})_{{\rm iteration}\ M}} (25.18-10)

Normalization in this manner ensures that the initial residuals for all equations are of $O(1)$ and is sometimes useful in judging overall convergence.

By default, $M = 5$, making the normalized residual equivalent to the scaled residual. You can also specify the normalization factor (the denominator in Equation  25.18-10) manually in the Residual Monitors panel.



Overview of Using the Residual Monitors Panel


All inputs controlling the monitoring of residuals are entered using the Residual Monitors panel (Figure  25.18.1).

Solve $\rightarrow$ Monitors $\rightarrow$ Residual...

or

Plot $\rightarrow$ Residuals...

Figure 25.18.1: The Residual Monitors Panel
figure

In general, you will only need to enable residual plotting and modify the convergence criteria using this panel. Additional controls are available for disabling monitoring of particular residuals, and modifying normalization and plot parameters.



Printing and Plotting Residuals


By default, residual values for all relevant variables are printed in the text (console) window after each iteration. If you wish to disable this printout, turn off Print under Options. To enable the plotting of residuals after each iteration, turn on Plot under Options. Residuals will be plotted in the graphics window (with the window ID set in the Window field) during the calculation.

If you wish to display a plot of the current residual history, simply click the Plot push button.



Storing Residual History Points


Residual histories for each variable are automatically saved in the data file, regardless of whether they are being monitored. You can control the number of history points to be stored by changing the Iterations entry under Storage. By default, up to 1000 points will be stored. If more than 1000 iterations are performed (i.e., the limit is reached), every other point will be discarded--leaving 500 history points--and the next 500 points will be stored. When the total hits 1000 again, every other point will again be discarded, etc. If you are performing a large number of iterations, you will lose a great deal of residual history information about the beginning of the calculation. In such cases, you should increase the Iterations value to a more appropriate value. Of course, the larger this number is, the more memory you will need, the longer the plotting will take, and the more disk space you will need to store the data file.



Controlling Normalization


By default, scaling of residuals (see Equations  25.18-4 and 25.18-9) is enabled and the default convergence criterion is $10^{-6}$ for energy and P-1 equations and $10^{-3}$ for all other equations. Residual normalization (i.e., dividing the residuals by the largest value during the first few iterations) is also available but disabled by default.

Normalization can be used with both scaled and unscaled residuals. Note that if normalization is enabled, the convergence criterion may need to be adjusted appropriately. See Section  25.22.1 for information about judging convergence based on the different types of residual reports. (Both the raw residuals and scaling factors are stored in the data file, so you can switch between scaled and unscaled residuals.) To report unscaled residuals, simply turn off the Scale option under Normalization.

figure   

If you switch from scaled to unscaled residuals (or vice versa) and you are normalizing the residuals (as described below), you must click the Renorm button to recompute the normalization factors.

If you wish to normalize the residuals (see Equation  25.18-7 or 25.18-10), turn on the Normalize option under Normalization. The Normalization Factor column will be added to the panel at this time. FLUENT will normalize the printed or plotted residual for each variable by the value indicated as the Normalization Factor for that variable. The default Normalization Factor is the maximum residual value after the first 5 iterations. To use the maximum residual value after a different number of iterations (i.e., specify a different value for $M$ in Equation  25.18-7 or 25.18-10), you can modify the Iterations entry under Normalization.

In some cases, the maximum residual may occur sometime after the iteration specified in the Iterations field. If this should occur, you can click the Renorm button to set the normalization factors for all variables to the maximum values in the residual histories. Subsequent plots and printed reports will use the new normalization factor.

You can also specify the normalization factor (the denominator in Equation  25.18-7 or 25.18-10) explicitly. To modify the normalization factor for a particular variable, enter a new value in the corresponding Normalization Factor field in the Residual Monitors panel.

If you wish to report unnormalized, unscaled residuals (Equation  25.18-3 or 25.18-8), disable the Normalize and Scale options under Normalization in the Residual Monitors panel. Note that unnormalized, unscaled residuals are stored in the data file regardless of whether the reported residuals are normalized or scaled.



Choosing a Convergence Criterion


The ability to choose certain convergence criteria provides the user with alternative ways to check convergence when using the iterative transient solver. The various convergence criteria can be selected in the Residual Monitors panel from the Convergence Criterion drop-down list.

Solve $\rightarrow$ Monitors $\rightarrow$ Residual...

Figure 25.18.2: The Residual Monitors Panel Displaying relative or absolute Convergence
figure

Four options are available for checking an equation for convergence:

absolute   This is the default. For steady-state cases, absolute and none are the only options available for selection. The residual (scaled and/or normalized) of an equation at an iteration is compared with a user-specified value. If the residual is less than the user-specified value, that equation is deemed to have converged for a timestep.

relative   The residual of an equation at an iteration of a timestep is compared with the residual at the start of the timestep. If the ratio of the two residuals is less than a user-specified value, that equation is deemed to have converged for a timestep.

relative or absolute   If either the absolute convergence criterion or the relative convergence criterion is met, the equation is considered converged.

The Relative Criteria can be set when relative or relative or absolute is selected.

none   Convergence checking is disabled.

In many situations, the absolute convergence criterion could be too stringent for transient flows causing a large number of iterations per timestep. For example, the scaling of the continuity equation is based on the value of the continuity residual in the first five iterations. The scaling factor could be low if the initial continuity residual is small and thus the scaled residual could fail to meet the absolute convergence criterion. With the relative convergence criterion, convergence is checked by comparing the residual at an iteration of a timestep with the residual at the beginning of the timestep and hence this problem is alleviated. The relative or absolute convergence criterion is useful in situations where the residuals of some of the equations are already very low at the start of a timestep (for example, when a particular variable has reached steady state), and the order of magnitude reduction in residuals is not possible. The none option allows you to disable convergence checking by selecting the option in the Convergence Criterion drop-down list.

figure   

relative and relative or absolute convergence criteria are available only with the unsteady pressure-based solver and unsteady density-based solver.

The text command used to access the convergence criterion is

solve $\rightarrow$ monitors $\rightarrow$ residual $\rightarrow$ criterion-type

When criterion-type is entered, you will have the following choices:


Criterion Type
0 absolute
1 relative
2 relative or absolute
3 none

For criterion-type 1 or 2, the text command relative-conv-criteria will appear under the residual text menu, where the various relative-conv-criteria can be set.

figure   

If the NITA solver is enabled, no convergence criteria are available for selection.



Modifying Convergence Criteria


Depending on the Convergence Criterion you choose, FLUENT will check for convergence. If convergence is being monitored, the solution will stop automatically when each variable meets its specified convergence criterion. Convergence checks can be performed only for variables for which you are monitoring residuals (i.e., variables for which the Monitor option is enabled).

You can choose whether or not you want to check the convergence for each variable by enabling or disabling the Check Convergence option for it in the Residual Monitors panel. To modify the convergence criterion for a particular variable, enter a new value in the corresponding convergence criterion field.



Disabling Monitoring


If your problem requires the solution of many equations (e.g., turbulence quantities and multiple species), a plot that includes all residuals may be difficult to read. In such cases, you may choose to monitor only a subset of the residuals, perhaps those that affect convergence the most. You can indicate whether or not you want to monitor residuals for each variable by enabling or disabling the relevant check box in the Monitor list of the Residual Monitors panel.



Plot Parameters


If you choose to plot the residual values (either interactively during the solution or using the Plot button after calculations are complete), there are several display parameters you can modify.

In the Window field under Plotting, you can specify the ID of the graphics window in which the plot will be drawn. When FLUENT is iterating, the active graphics window is temporarily set to this window to update the residual plot, and then returned to its previous value. Thus, the residual plot can be maintained in a separate window that does not interfere with other graphical postprocessing.

You can modify the number of residual history points to be displayed in the plot by changing the Iterations entry under Plotting. If you specify $n$ points, FLUENT will display the last $n$ history points. Since the $y$ axis is scaled by the minimum and maximum values of all points in the plot, you can zoom in on the end of the residual history by setting Iterations to a value smaller than the number of iterations performed. If, for example, the residuals jumped early in the calculation when you turned on turbulence, that peak broadens the overall range in residual values, making the smaller fluctuations later on almost indistinguishable. By setting the value of Iterations so that the plot does not include that early peak, your $y$-axis range is better suited to the values that you are interested in seeing. For more information on residual history points, please refer to the discussion of storing residual history points, described earlier in this section.

You can also modify the attributes of the plot axes and the residual curves. Click the Axes... or Curves... button to open the Axes panel or Curves panel. See Sections  28.8.8 and 28.8.9 for details.

figure   

Note that entering a value for Iterations under Plotting does not necessarily mean solved iterations but rather stored (or sampled) data points. Note also that the frequency of the data storage will diminish towards the start of the solution as the number of solved iterations increases. Due to this, whenever the stored iterations is greater than the solved iterations, if you plot n iterations, you actually see a history that goes back further than n solved iterations.



Postprocessing Residual Values


If you are having solution convergence difficulties, it is often useful to plot the residual value fields (e.g., using contour plots) to determine where the high residual values are located. When you use one of the density-based solver, the residual values for all solution variables are available in the Residuals... category in the postprocessing panels. (If you read case and data files into FLUENT, you will need to perform at least one iteration before the residual values are available for postprocessing.) For the pressure-based solver, however, only the mass imbalance in each cell is available by default.

If you want to plot residual value fields for a pressure-based solver calculation, you will need to do the following:

1.   Read in the case and data files of interest (if they are not already in the current session).

2.   Use the expert command in the solve/set/ text menu to enable the saving of residual values.

solve $\rightarrow$ set $\rightarrow$ expert

Among other questions, FLUENT will ask if you want to save cell residuals for postprocessing. Enter yes or y, and keep the default settings for all of the other questions (by pressing the <RETURN> key).

3.   Perform at least one iteration.

The solution variables for which residual values are available will appear in the Residuals... category in the postprocessing panels. Note that residual values are not available for the radiative transport equations solved by the discrete ordinates radiation model.


next up previous contents index Previous: 25.18 Monitoring Solution Convergence
Up: 25.18 Monitoring Solution Convergence
Next: 25.18.2 Monitoring Statistics
© Fluent Inc. 2006-09-20