Appendix: Equation Options

The run control file has variables that govern the solution of each governing equation that is to be solved in a simulation; these are the equation options variables. These variables are composed of an options list that generally contains parameters that give the user control over the way that each governing equation is solved. These sections below discuss the equation options for each governing equation in the base Stream code.

Momentum Equation

Options for controlling the solution of the momentum equations are specified using the momentumEquationOptions variable in the run control file.

Specified Momentum Equation Options
 momentumEquationOptions: <linearSolver=SGS, relaxationFactor=0.5, maxIterations=5>

If one wishes to use the default values, this line could alternately be specified as follows:

Default Momentum Equation Options
 momentumEquationOptions: <>

It is generally best to explicitly specify the governing parameters in the options list as shown in the first form so that one is actively aware of parameters involved in the simulation rather than having to remember the default values. This is generally true of the other governing equations as well. The momentum equation options variable must be specified for all simulations. The parameter linearSolver specifies the solver for the linearized momentum equation. All linear solvers are supported except for HYPRE. The parameter relaxationFactor governs how much of the solution is kept from the updated values after the solution of the linearized momentum equation at the current iteration. Valid values are any number between zero (solution stays at previous iteration value) and one (solution set to values from the linear solve). Using the parameter maxIterations, one can specify the maximum number of iterations that are performed in the linear solver.

Pressure Correction Equation

Options for the pressure correction equation are set with the pressureCorrectionEquationOptions variable in the run control file.

Specified Pressure Correction Equation Options (default values shown)
 pressureCorrectionEquationOptions: <linearSolver=HYPRE, relaxationFactor=0.1, maxIterations=5>

The pressure correction equation options variable must be specified for all simulations. The parameter linearSolver specifies the solver for the pressure-correction equation. All linear solvers described in the previous section are supported. For simulations involving anything other than idealized model problems on high-quality 2-D meshes, one will generally want to use either the PETSC solver or the HYPRE solver. The parameter relaxationFactor governs how much of the solution is kept from the updated values after the solution of the pressure-correction equation at the current iteration. Valid values are any number between zero (pressure field not updated) and one (full pressure-correction value update to pressure field). Using the parameter maxIterations, one can specify the maximum number of iterations that are performed in the linear solver.

Important warning on time step and relaxation factors: In some simulations, reducing both the physical time step and the relaxation factors can make the solution less stable, rather than more stable. If this behavior is observed, do not assume that lowering relaxation factors further will help. Instead, retune the momentum and pressure-correction relaxation factors together for the smaller time step, and consider increasing one or both values. See Time-Step and Relaxation-Factor Interaction for details and practical guidance.

Two primary methods of solving the pressure correction equation are supported by Stream. The SIMPLE (Semi-Implicit Method for Pressure-Linked Equations) and the SIMPLEC (Semi-Implicit Method for Pressure-Linked Equations-Consistent) algorithms are available. These methods can be selected by specifying either SIMPLE or SIMPLEC in the run control file using the pressureBasedMethod variable as shown below (default value shown):

pressureBasedMethod: SIMPLE

The pressure-correction value used in velocity and face volumetric-flux corrections is controlled by pPrimeCorrectionMode:

Pressure-Correction Mode
 pPrimeCorrectionMode: raw

Valid values are:

  • raw: Use the linear-solver pressure correction directly. - clipRelaxed: Compute the relaxed pressure update, clip that update using PclipMin and PclipMax, then back-compute a limited pressure correction for use in velocity and face-flux correction rules.

The default is:

pPrimeCorrectionMode: raw

When clipRelaxed is used, clipping is based on the same pressure bounds used elsewhere in the pressure update:

Pressure Clipping Bounds
 PclipMin: -1.0e+30
 PclipMax:  1.0e+30

The default bounds above are effectively unbounded; practical clipping requires case-specific values. The clipRelaxed mode is currently supported only with pressureBasedMethod: SIMPLE or pressureBasedMethod: SIMPLEC.

Pressure Equation

When using the SIMPLER method in the iterative solver stream one must also specify options for the pressure equation using the variable pressureEquationOptions in the run control file in a manner like the following (default values shown):

Specified Pressure Equation Options
 pressureEquationOptions: <linearSolver=HYPRE, relaxationFactor=0.1, maxIterations=5>

Options for the pressure equation are identical to those for the pressure-correction equation detailed above.

Energy Equation

Options for the energy equation are specified using the variable energyEquationOptions in the run control file in a manner like the following (default values shown):

Specified Energy Equation Options
 energyEquationOptions: <linearSolver=SGS, relaxationFactor=0.5, maxIterations=5, form=totalEnthalpy>

This variable need be specified only when running a compressible flow simulation. The linearSolver parameter specifies the solver for the energy equation. All linear solvers described in the previous section are supported. The next two options shown above are used in the same manner as described above for the momentum equation. The fourth option shown above specifies the form of the energy equation to use. In Stream, one may specify either totalEnthalpy for the total enthalpy form of the energy equation, totalEnergy for the total energy form of the energy equation, or temperature for the temperature form of the energy equation. For the stream-piso solver, the temperature form of the energy equation is not available.

Species Equation

For simulations involving multi-species mixtures, one must specify options for the species equations using the variable speciesEquationOptions in the run control file in a manner like the following (default values shown):

Specified Species Equation Options
 speciesEquationOptions: <linearSolver=SGS, relaxationFactor=0.5, maxIterations=5>

The linearSolver parameter specifies the solver for the species equation. All linear solvers described in the previous section are supported. The remaining options shown above are used in the same manner as described above for the momentum equation.

Turbulence Equations

For turbulent simulations, one must specify options for the turbulence equations using the run control file variable turbulenceEquationOptions in a manner like the following (default values shown):

Specified Turbulence Equation Options
 turbulenceEquationOptions: <linearSolver=SGS, relaxationFactor=0.5, maxIterations=5, model=menterSST>

The linearSolver parameter specifies the solver for the turbulence equations. All linear solvers described in the previous section are supported. The next two options shown above are used in the same manner as described above for the momentum equation. Several different turbulence models can be chosen from using the model option. The section on turbulence covers all the valid options that can be selected for the model option.

During the non-linear solution process at any time step, it is possible for the turbulence equations to return non-physical values of the dependent variables k, the turbulent kinetic energy, and \(\omega\), the specific dissipation rate. Should these non-physical values not be limited, the simulation will immediately terminate due to floating-point exception. To prevent this from occurring one must specify physical fallback values that can be assigned for cells with non-physical values after the linear solve. The most robust way of continuing the simulation without causing un-necessary shock to the flow field has been found to simply assign free-stream values in place of the non-physical values that occur. This can be done using the run control file variables kFreestream and omegaFreestream as shown below (default values shown):

Freestream Values for Turbulence Equations
 kFreestream: 1.0e-08
 omegaFreestream: 10.0

While one may choose to accept the default values by not including these lines in the run control file, the preferred approach is to set these values to those used in the initial conditions, because free-stream values are commonly used in the initial condition for the variables k and \(\omega\) and the location of the non-physical values of k and omega is sometimes in the vicinity of the edge of the boundary layer where the flow is transitioning back to free-stream.

The variable eddyViscosityLimit sets an upper bound on turbulent viscosity. In k-epsilon and k-omega models, the solver limits eddy viscosity so that \(\mu_t \le \texttt{eddyViscosityLimit}\,\mu\), where \(\mu_t\) is turbulent viscosity and \(\mu\) is laminar viscosity. The default value is 5.0e+05.