# Reference Residual Problem

Problem that checks for convergence relative to a user-supplied reference quantity rather than the initial residual

## Description

By default, MOOSE checks convergence using relative and absolute criteria. Once the residual drops below either an absolute tolerance, or the residual divided by the initial residual for the current time step drops below a relative tolerance, the solution is considered converged. This works well for many problems, but in cases where the solution changes minimally between time steps, the initial residual can be very small, making the relative convergence check much too stringent.

The ReferenceResidualProblem checks for convergence by comparing the residual to a different reference quantity (instead of the initial residual). The the user supplies a reference quantity in the form of a set of AuxVariables that contain physically meaningful quantities that can be used in a relative convergence check. Because the solution variables can have significantly different scaling, the convergence check performed in ReferenceResidualProblem checks convergence of the solution variables individually. When the norm of the residual for each solution variable is less than either the relative tolerance times the norm of the corresponding reference variable or the absolute tolerance, the solution is considered converged.

Use of this procedure requires that the user provide physically meaningful reference quantities. The vector of the reaction loads (in the case of mechanics) or integrated fluxes (in the case of diffusion problems) is typically suitable for this purpose, as it provides a measure of the loading applied to the system. To compute these, an AuxVariable must be set up corresponding to each solution variable, and the save_in option is used in each Kernel to assemble the residual into that vector. When the solution is converged, that AuxVariable will contain values that are close to zero everywhere except for where boundary conditions are applied.

Since relative convergence is computed differently with this approach, the nonlinear relative tolerance required to achieve the same error is typically different than with the default approach in MOOSE, and the differences will vary by the problem. The code user must evaluate the behavior of their model to ensure that appropriate tolerances are being used.

## Example Input syntax


[Problem]
type = ReferenceResidualProblem
solution_variables = 'disp_x disp_y disp_z temp'
reference_residual_variables = 'saved_x saved_y saved_z saved_t'
[]
(moose/modules/combined/test/tests/reference_residual/reference_residual.i)

where additional AuxVariables for the displacements (e.g. x, y, and z) and temperature must be created, as shown below


[AuxVariables]
[./saved_x]
[../]
[./saved_y]
[../]
[./saved_z]
[../]
[./saved_t]
[../]
[]
(moose/modules/combined/test/tests/reference_residual/reference_residual.i)

and then called in the respective kernels. For the displacement reference residual saved variables, the option save_in is set in the Tensor Mechanics Action

[Modules/TensorMechanics/Master]
[./all]
volumetric_locking_correction = true
incremental = true
save_in = 'saved_x saved_y saved_z'
eigenstrain_names = thermal_expansion
strain = FINITE
decomposition_method = EigenSolution
[../]
[]
(moose/modules/combined/test/tests/reference_residual/reference_residual.i)

and the temperature saved variable is applied in the heat conduction kernel

[Kernels]
[./heat]
type = HeatConduction
variable = temp
save_in = saved_t
[../]
[]
(moose/modules/combined/test/tests/reference_residual/reference_residual.i)

## Input Parameters

• solution_variablesSet of solution variables to be checked for relative convergence

C++ Type:std::vector

Description:Set of solution variables to be checked for relative convergence

• acceptable_iterations0Iterations after which convergence to acceptable limits is accepted

Default:0

C++ Type:int

Description:Iterations after which convergence to acceptable limits is accepted

• use_nonlinearTrueDetermines whether to use a Nonlinear vs a Eigenvalue system (Automatically determined based on executioner)

Default:True

C++ Type:bool

Description:Determines whether to use a Nonlinear vs a Eigenvalue system (Automatically determined based on executioner)

• error_on_jacobian_nonzero_reallocationFalseThis causes PETSc to error if it had to reallocate memory in the Jacobian matrix due to not having enough nonzeros

Default:False

C++ Type:bool

Description:This causes PETSc to error if it had to reallocate memory in the Jacobian matrix due to not having enough nonzeros

• force_restartFalseEXPERIMENTAL: If true, a sub_app may use a restart file instead of using of using the master backup file

Default:False

C++ Type:bool

Description:EXPERIMENTAL: If true, a sub_app may use a restart file instead of using of using the master backup file

• skip_additional_restart_dataFalseTrue to skip additional data in equation system for restart. It is useful for starting a transient calculation with a steady-state solution

Default:False

C++ Type:bool

Description:True to skip additional data in equation system for restart. It is useful for starting a transient calculation with a steady-state solution

• reference_residual_variablesSet of variables that provide reference residuals for relative convergence check

C++ Type:std::vector

Description:Set of variables that provide reference residuals for relative convergence check

• ignore_zeros_in_jacobianFalseDo not explicitly store zero values in the Jacobian matrix if true

Default:False

C++ Type:bool

Description:Do not explicitly store zero values in the Jacobian matrix if true

• null_space_dimension0The dimension of the nullspace

Default:0

C++ Type:unsigned int

Description:The dimension of the nullspace

• acceptable_multiplier1Multiplier applied to relative tolerance for acceptable limit

Default:1

C++ Type:double

Description:Multiplier applied to relative tolerance for acceptable limit

• solveTrueWhether or not to actually solve the Nonlinear system. This is handy in the case that all you want to do is execute AuxKernels, Transfers, etc. without actually solving anything

Default:True

C++ Type:bool

Description:Whether or not to actually solve the Nonlinear system. This is handy in the case that all you want to do is execute AuxKernels, Transfers, etc. without actually solving anything

• transpose_null_space_dimension0The dimension of the transpose nullspace

Default:0

C++ Type:unsigned int

Description:The dimension of the transpose nullspace

• near_null_space_dimension0The dimension of the near nullspace

Default:0

C++ Type:unsigned int

Description:The dimension of the near nullspace

### Optional Parameters

• control_tagsAdds user-defined labels for accessing object parameters via control logic.

C++ Type:std::vector

Description:Adds user-defined labels for accessing object parameters via control logic.

• enableTrueSet the enabled status of the MooseObject.

Default:True

C++ Type:bool

Description:Set the enabled status of the MooseObject.