Appendix: Linear Solvers

Linear solvers are used in the stream code to solve the linearized equations at each iteration in the solution process at a time step. Because the governing equations in both codes are solved in a sequential fashion (as opposed to a coupled fashion in most density-based methods), one can specify a different linear solver for each of the governing equations in the system of Navier-Stokes equations (momentum, pressure, energy, etc.) The five linear solvers which are currently available are shown in the table below. To select a linear solver for a given equation, one must use the linearSolver option in the corresponding equation options run control file variable. In order to facilitate the selection of linear solver parameters for all governing equations, three global run control file variables can be specified as follows (with default values shown):

Global Linear Solver Options
linearSolverTolerance: 1.0e-02
petscSolverName: GMRES
hypreSolverName: AMG

These global values are used as defaults for all governing equations, but they can be overridden. Below is an example of overriding the global default for the momentum equation.

Overriding the Global Linear Solver Options for the Momentum Equation
momentumEquationOptions: <linearSolver=SGS, relaxationFactor=0.5, maxIterations=5,
                        linearSolverTolerance=1.0e-03, petscSolverName=CG>

Local equation override is not currently supported for the hypreSolverName variable. As shown in the table below, only the LSGS, PETSC and HYPRE linear solvers use the specified linear solver tolerance to assess convergence. For these three solvers, the parameter maxIterations (specified for each governing equation) indicates the maximum number of iterations that will be performed before the solver kicks out. In general, the specified linear solver tolerance may be met before the maximum number of iterations is taken, in which case the solver terminates, declaring convergence. By contrast, the SGS and FSGS linear solvers will always perform the maximum number of iterations specified because the linear solver tolerance is not used.

Available Linear Solvers

Solver

Description

Solver Names Supported

Solver Tolerance Used

SGS

Gauss-Seidel

N/A

No

FSGS

Cache-Optimized Gauss-Seidel

N/A

No

LSGS

Line Gauss-Seidel

N/A

Yes

PETSC

PETSc Library

GMRES, CG, BICG, CGS, BCGS

Yes

HYPRE

HYPRE Library

GMRES, AM

Yes

When using the HYPRE solver, the variable hypreStrongThreshold is used as follows (default value shown):

hypreStrongThreshold: 0.5

to set the value of the neighbor strong threshold, which has an important effect on the generation of the coarse multi-grid levels. One should generally use the highest value possible for this variable (range 0.25- 0.95) while still maintaining solution stability to substantially reduce CPU time. A starting value of 0.9 is recommended.