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" parameter to the computing objects that you want to add into the reference vector. An explicit example is given in Example Input Syntax below. Alternatively, the "absolute_value_vector_tags"` parameter can be used in the kernels to assemble the absolute value of the contribution to each degree of freedom affected by the kernel.

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.

Alternatively, the "absolute_value_vector_tags" parameter can be used in the kernels or the action that sets them up. This option does not rely on the use of Dirichlet BCs to compute a meaningful reference vector, and can typically remedy this issue.

Example Input Syntax

[Problem]
  type = ReferenceResidualProblem
  extra_tag_vectors = 'ref'
  reference_vector = 'ref'
[]
(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 reference vector, which is defined in the "reference_vector" parameter. 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 specify the name of that reference vector with the "extra_vector_tags" parameter 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'
  []
[]
(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'
[]
(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

  • 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

  • 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)

  • identify_variable_groups_in_nlTrueWhether to identify variable groups in nonlinear systems. This affects dof ordering

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Whether to identify variable groups in nonlinear systems. This affects dof ordering

  • normalization_typeglobal_L2The normalization type used to compare the reference and actual residuals.

    Default:global_L2

    C++ Type:MooseEnum

    Options:global_L2, local_L2, global_Linf, local_Linf

    Controllable:No

    Description:The normalization type used to compare the reference and actual residuals.

  • 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.

  • regard_general_exceptions_as_errorsFalseIf we catch an exception during residual/Jacobian evaluaton for which we don't have specific handling, immediately error instead of allowing the time step to be cut

    Default:False

    C++ Type:bool

    Controllable:No

    Description:If we catch an exception during residual/Jacobian evaluaton for which we don't have specific handling, immediately error instead of allowing the time step to be cut

  • 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

  • zero_reference_residual_treatmentrelative_toleranceDetermine behavior if a reference residual value of zero is present for a particular variable.

    Default:relative_tolerance

    C++ Type:MooseEnum

    Options:zero_tolerance, relative_tolerance

    Controllable:No

    Description:Determine behavior if a reference residual value of zero is present for a particular variable.

Optional Parameters

  • allow_initial_conditions_with_restartFalseTrue to allow the user to specify initial conditions when restarting. Initial conditions can override any restarted field

    Default:False

    C++ Type:bool

    Controllable:No

    Description:True to allow the user to specify initial conditions when restarting. Initial conditions can override any restarted field

  • 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

  • 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)

Restart Parameters

  • allow_invalid_solutionFalseSet to true to allow convergence even though the solution has been marked as 'invalid'

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Set to true to allow convergence even though the solution has been marked as 'invalid'

  • immediately_print_invalid_solutionFalseWhether or not to report invalid solution warnings at the time the warning is produced instead of after the calculation

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not to report invalid solution warnings at the time the warning is produced instead of after the calculation

Solution Validity Control Parameters

  • 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?

  • check_uo_aux_stateFalseTrue to turn on a check that no state presents during the evaluation of user objects and aux kernels

    Default:False

    C++ Type:bool

    Controllable:No

    Description:True to turn on a check that no state presents during the evaluation of user objects and aux kernels

  • 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

  • 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

  • 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

  • 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).

Simulation Checks 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

  • 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. The outer index is for which nonlinear system the extra tag vectors should be added for

    C++ Type:std::vector<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. The outer index is for which nonlinear system the extra tag vectors should be added for

  • 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. The outer index is for which nonlinear system the extra tag vectors should be added for

    C++ Type:std::vector<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. The outer index is for which nonlinear system the extra tag vectors should be added for

Tagging Parameters

  • 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

  • nl_sys_namesnl0 The nonlinear system names

    Default:nl0

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

    Controllable:No

    Description:The nonlinear system names

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

    Default:False

    C++ Type:bool

    Controllable:No

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

  • 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)

Nonlinear System(S) Parameters

  • 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

  • transpose_null_space_dimension0The dimension of the transpose nullspace

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:The dimension of the transpose nullspace

Null Space Removal Parameters

  • 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)

  • 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

  • verbose_setupFalseSet to True to have the problem report on any object created

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Set to True to have the problem report on any object created

Verbosity Parameters

Input Files