ReferenceResidualProblem

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 there are some scenarios that are problematic for convergence:

  1. There is a large scaling difference between the solution variables, so taking the norm of the combined vector skews the convergence check so that it becomes increasingly dominated by the variable with larger absolute values in the residual vector as the scaling difference increases.

  2. The model conditions have changed very little from the previous step, so the initial residual is very low because the solution is essentially converged before any nonlinear iterations have been performed. The standard convergence check that uses the initial residual as a reference quantity eventually fails after a few steps because the solution is forced to converge to tighter limits with each time step, until numerical roundoff error prevents the solution from converging more tightly.

  3. The state of the problem is such that the values of the residual at all degrees of freedom where Dirichlet boundary conditions are applied are zero in the converged solution. An example of this is a mechanics model that has Dirichlet boundary conditions to prevent rigid body motion, but the model only experiences free thermal expansion, so there are no reaction loads at those points. Another example is if there is a time step when no loading is applied.

ReferenceResidualProblem checks for convergence by comparing the residual to a different reference quantity (instead of the initial residual). The user specifies a reference vector 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.

By checking the convergence of individual variables and comparing to reference quantities that are meaningful even when the solution is not changing, ReferenceResidualProblem addresses the first two issues listed above. The third issue is potentially more of a problem with ReferenceResidualProblem than the standard MOOSE convergence check, and dealing with it is discussed in Dealing with Residuals that are Zero at Boundaries.

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 make these reference quantities, simply add the extra_vector_tags = <reference_vector_name> param/value pair to the computing objects that you want to add into the reference vector. An explicit example is given in Example Input Syntax below.

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.

Dealing with Residuals that are Zero at Boundaries

As mentioned in the third case above where relative convergence checks can fail, the converged solutions for some problems are zero on all boundaries with Dirichlet boundary condition (BC) because of the nature of the loading conditions. This would make the ReferenceResidualProblem convergence checks fail because the norm of the reference vector would be zero in this case. This is manifested when the reference values decrease at the same rate as the residuals, so relative convergence is never achieved.

In some mechanics problems, such as those with symmetry planes, this might happen only in one direction. This situation can be remedied by grouping together the residuals for all components of the displacement variables rather than checking them individually. If the reference vector for one of the variables in the group is zero (because there are no Dirichlet BCs that restrict the solution in that direction), but it is nonzero for the others, the residual for the set of variables will be checked together, and the variable with a zero value will not prevent convergence as it normally would. Grouping variables is accomplished by using the group_variables option, which is used to provide one or more lists of names of variables to group together.

In some cases, however, there may be no degrees of freedom with nonzero residuals at Dirichlet BCs for even a group of variables. This could happen in mechanics problems that only have free expansion, in which the Dirichlet BCs are important for preventing rigid body motion, but do not restrain the deformation of the body. This could also happen if there is simply no loading on a model during a time step.

It is necessary in such cases to also specify an absolute tolerance using nl_abs_tol, which is a problem-specific value that must be higher than the residual below which the solution can no longer converge tighter due to numeric roundoff errors, but sufficiently low to ensure that the solution is converged when that limit is reached.

Example Input Syntax

[Problem]
  type = ReferenceResidualProblem
  extra_tag_vectors = 'ref'
  reference_vector = 'ref'
[]
(../../../SoftwareDownloads/moose/test/tests/problems/reference_residual_problem/reference_residual.i)

where the extra_tag_vectors parameter indicates the additional vectors that should be added to the nonlinear system. This parameter must contain the name of the vector to be used for the reference_vector. In this example we only create one extra vector, the ref vector, that will be used for holding the reference residuals. To have computing objects add into the reference vector, simply add the extra_vector_tags = <reference_vector_name> param/value pair as illustrated below:

[BCs]
  [u]
    type = RobinBC
    boundary = 'left right'
    coef = ${coef}
    variable = u
    extra_vector_tags = 'ref'
  []
  [v]
    type = RobinBC
    boundary = 'left right'
    coef = 1
    variable = v
    extra_vector_tags = 'ref'
  []
[]
(../../../SoftwareDownloads/moose/test/tests/problems/reference_residual_problem/reference_residual.i)

In this example we are using the integrated fluxes as the reference quantities that we will compare the individual variable residuals to.

Grouping Variables

[Problem]
  type = ReferenceResidualProblem
  extra_tag_vectors = 'ref'
  reference_vector = 'ref'
  group_variables = 'disp_x disp_y;
                     scalar_strain_zz1 scalar_strain_zz2'
[]
(../../../SoftwareDownloads/moose/modules/combined/test/tests/reference_residual/group_variables.i)

Multiple groupings of variables can be provided in group_variables by separating them by semicolon. Convergence for those variables that are not given in group_variables is checked individually. A given variable can only be included in one group.

Input Parameters

  • acceptable_iterations0Iterations after which convergence to acceptable limits is accepted

    Default:0

    C++ Type:int

    Controllable:No

    Description:Iterations after which convergence to acceptable limits is accepted

  • acceptable_multiplier1Multiplier applied to relative tolerance for acceptable limit

    Default:1

    C++ Type:double

    Controllable:No

    Description:Multiplier applied to relative tolerance for acceptable limit

  • boundary_restricted_elem_integrity_checkTrueSet to false to disable checking of boundary restricted elemental object variable dependencies, e.g. are the variable dependencies defined on the selected boundaries?

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set to false to disable checking of boundary restricted elemental object variable dependencies, e.g. are the variable dependencies defined on the selected boundaries?

  • boundary_restricted_node_integrity_checkTrueSet to false to disable checking of boundary restricted nodal object variable dependencies, e.g. are the variable dependencies defined on the selected boundaries?

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set to false to disable checking of boundary restricted nodal object variable dependencies, e.g. are the variable dependencies defined on the selected boundaries?

  • converge_onIf supplied, use only these variables in the individual variable convergence check

    C++ Type:std::vector<NonlinearVariableName>

    Controllable:No

    Description:If supplied, use only these variables in the individual variable convergence check

  • 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

    Controllable:No

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

  • extra_tag_matricesExtra matrices to add to the system that can be filled by objects which compute residuals and Jacobians (Kernels, BCs, etc.) by setting tags on them.

    C++ Type:std::vector<TagName>

    Controllable:No

    Description:Extra matrices to add to the system that can be filled by objects which compute residuals and Jacobians (Kernels, BCs, etc.) by setting tags on them.

  • extra_tag_solutionsExtra solution vectors to add to the system that can be used by objects for coupling variable values stored in them.

    C++ Type:std::vector<TagName>

    Controllable:No

    Description:Extra solution vectors to add to the system that can be used by objects for coupling variable values stored in them.

  • extra_tag_vectorsExtra vectors to add to the system that can be filled by objects which compute residuals and Jacobians (Kernels, BCs, etc.) by setting tags on them.

    C++ Type:std::vector<TagName>

    Controllable:No

    Description:Extra vectors to add to the system that can be filled by objects which compute residuals and Jacobians (Kernels, BCs, etc.) by setting tags on them.

  • 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

    Controllable:No

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

  • fv_bcs_integrity_checkTrueSet to false to disable checking of overlapping Dirichlet and Flux BCs and/or multiple DirichletBCs per sideset

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set to false to disable checking of overlapping Dirichlet and Flux BCs and/or multiple DirichletBCs per sideset

  • group_variablesName of variables that are grouped together to check convergence. (Multiple groups can be provided, separated by semicolon)

    C++ Type:std::vector<std::vector<NonlinearVariableName>>

    Controllable:No

    Description:Name of variables that are grouped together to check convergence. (Multiple groups can be provided, separated by semicolon)

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

    Default:False

    C++ Type:bool

    Controllable:No

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

  • kernel_coverage_checkTrueSet to false to disable kernel->subdomain coverage check

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set to false to disable kernel->subdomain coverage check

  • material_coverage_checkTrueSet to false to disable material->subdomain coverage check

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set to false to disable material->subdomain coverage check

  • material_dependency_checkTrueSet to false to disable material dependency check

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set to false to disable material dependency check

  • near_null_space_dimension0The dimension of the near nullspace

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:The dimension of the near nullspace

  • null_space_dimension0The dimension of the nullspace

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:The dimension of the nullspace

  • parallel_barrier_messagingFalseDisplays messaging from parallel barrier notifications when executing or transferring to/from Multiapps (default: false)

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Displays messaging from parallel barrier notifications when executing or transferring to/from Multiapps (default: false)

  • previous_nl_solution_requiredFalseTrue to indicate that this calculation requires a solution vector for storing the prvious nonlinear iteration.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:True to indicate that this calculation requires a solution vector for storing the prvious nonlinear iteration.

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

    C++ Type:std::vector<AuxVariableName>

    Controllable:No

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

  • reference_vectorThe tag name of the reference residual vector.

    C++ Type:TagName

    Controllable:No

    Description:The tag name of the reference residual vector.

  • restart_file_baseFile base name used for restart (e.g. / or /LATEST to grab the latest file available)

    C++ Type:FileNameNoExtension

    Controllable:No

    Description:File base name used for restart (e.g. / or /LATEST to grab the latest file available)

  • 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

    Controllable:No

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

  • skip_nl_system_checkFalseTrue to skip the NonlinearSystem check for work to do (e.g. Make sure that there are variables to solve for).

    Default:False

    C++ Type:bool

    Controllable:No

    Description:True to skip the NonlinearSystem check for work to do (e.g. Make sure that there are variables to solve for).

  • solution_variablesSet of solution variables to be checked for relative convergence

    C++ Type:std::vector<NonlinearVariableName>

    Controllable:No

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

  • 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

    Controllable:Yes

    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

    Controllable:No

    Description:The dimension of the transpose nullspace

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

    Default:True

    C++ Type:bool

    Controllable:No

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

  • verbose_multiappsFalseSet to True to enable verbose screen printing related to MultiApps

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Set to True to enable verbose screen printing related to MultiApps

Optional Parameters

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

    C++ Type:std::vector<std::string>

    Controllable:No

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

  • default_ghostingFalseWhether or not to use libMesh's default amount of algebraic and geometric ghosting

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not to use libMesh's default amount of algebraic and geometric ghosting

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set the enabled status of the MooseObject.

Advanced Parameters