TransientAndAdjoint

Executioner for evaluating transient simulations and their adjoint.

Overview

Similar to SteadyAndAdjoint, this executioner can be used to solve a transient forward problem and it's adjoint. Like it's steady-state counterpart, this executioner has a two-step procedure, whereby performing the full forward transient solve (as in Transient) then stepping backward through the forward timesteps to solve the adjoint problem. To give context on what a transient adjoint looks like, let's start with the general time-dependent partial differential equation (PDE):

where is a nonlinear coefficient on the time derivative, is the parts of the PDE that do not contain a time-derivative, and is some time-space-dependent source. The first step in formulating an adjoint for this system is to linearize it around . Generally, this can be given in operator notation as:

Using ImplicitEuler time integration, a given time step's () solve resembles:

This system can be represented by a large system for all time steps:

where,

The adjoint equation is then the transpose of this operator, with its own source ():

To solve this system, the adjoint problem is solved backward in time:

with .

Executioner Algorithm

Algorithm 1: Transient and adjoint executioner algorithm

1:  Set forward initial condition:
2:  Execute user-objects, auxiliary kernels, and multi-apps on INITIAL
3:  Cache forward solution and time: ,
4:  for do
5:       Execute user-objects, auxiliary kernels, and multi-apps on TIMESTEP_BEGIN
6:       Solve forward time step:
7:       Execute user-objects, auxiliary kernels, and multi-apps on TIMESTEP_END
8:       Cache forward solution and time: ,
9:  end for
10:  Execute user-objects, auxiliary kernels, and multi-apps on FINAL
11:  Set previous time residual:
12:  for do
13:       Set forward solution:
14:       Execute user-objects, auxiliary kernels, and multi-apps on ADJOINT_TIMESTEP_BEGIN
15:       Compute forward Jacobian:
16:       Compute adjoint source:
17:       Solve adjoint system:
18:       Execute user-objects, auxiliary kernels, and multi-apps on ADJOINT_TIMESTEP_END
19:       Evaluate time residual:
20:  end for

Limitations of Adjoint Solve

  1. The adjoint solver only supports a consistent adjoint with ImplicitEuler time integration.

  2. Saving the forward solution at every time step can be extremely memory intensive, so there may be limitations on the number of timesteps of the forward problem based on system memory.

  3. Exodus cannot output the resulting adjoint solution. CSV and JSON work as expected.

Example Input File Syntax

The input syntax for this executioner is identical to SteadyAndAdjoint. One key difference is the way the adjoint solution is outputted. Currently, Exodus does not support the backward time-stepping of the adjoint solve, but CSV can be outputted with two separate output objects. Furthermore, in order to see a table of postprocessors during the adjoint solve, the "execute_on" parameter must be modified in the Console output:

[Outputs]
  [forward]
    type = CSV
  []
  [adjoint]
    type = CSV
    execute_on = 'INITIAL ADJOINT_TIMESTEP_END'
  []
  [console]
    type = Console
    execute_postprocessors_on = 'INITIAL TIMESTEP_END ADJOINT_TIMESTEP_END'
  []
[]
(modules/optimization/test/tests/executioners/transient_and_adjoint/self_adjoint.i)

Input Parameters

  • adjoint_systemName of the system representing the adjoint problem.

    C++ Type:NonlinearSystemName

    Controllable:No

    Description:Name of the system representing the adjoint problem.

  • forward_systemName of the system representing the forward problem.

    C++ Type:NonlinearSystemName

    Controllable:No

    Description:Name of the system representing the forward problem.

Required Parameters

  • dt1The timestep size between solves

    Default:1

    C++ Type:double

    Controllable:No

    Description:The timestep size between solves

  • end_time1e+30The end time of the simulation

    Default:1e+30

    C++ Type:double

    Controllable:No

    Description:The end time of the simulation

  • error_on_dtminTrueThrow error when timestep is less than dtmin instead of just aborting solve.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Throw error when timestep is less than dtmin instead of just aborting solve.

  • normalize_solution_diff_norm_by_dtTrueWhether to divide the solution difference norm by dt. If taking 'small' time steps you probably want this to be true. If taking very 'large' timesteps in an attempt to *reach* a steady-state, you probably want this parameter to be false.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Whether to divide the solution difference norm by dt. If taking 'small' time steps you probably want this to be true. If taking very 'large' timesteps in an attempt to *reach* a steady-state, you probably want this parameter to be false.

  • num_steps4294967295The number of timesteps in a transient run

    Default:4294967295

    C++ Type:unsigned int

    Controllable:No

    Description:The number of timesteps in a transient run

  • reset_dtFalseUse when restarting a calculation to force a change in dt.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Use when restarting a calculation to force a change in dt.

  • schemeimplicit-eulerTime integration scheme used.

    Default:implicit-euler

    C++ Type:MooseEnum

    Options:implicit-euler, explicit-euler, crank-nicolson, bdf2, explicit-midpoint, dirk, explicit-tvd-rk-2, newmark-beta

    Controllable:No

    Description:Time integration scheme used.

  • splittingTop-level splitting defining a hierarchical decomposition into subsystems to help the solver.

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

    Controllable:No

    Description:Top-level splitting defining a hierarchical decomposition into subsystems to help the solver.

  • verboseFalseSet to true to print additional information

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Set to true to print additional information

Optional Parameters

  • abort_on_solve_failFalseabort if solve not converged rather than cut timestep

    Default:False

    C++ Type:bool

    Controllable:No

    Description:abort if solve not converged rather than cut timestep

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

  • dtmax1e+30The maximum timestep size in an adaptive run

    Default:1e+30

    C++ Type:double

    Controllable:No

    Description:The maximum timestep size in an adaptive run

  • dtmin1e-12The minimum timestep size in an adaptive run

    Default:1e-12

    C++ Type:double

    Controllable:No

    Description:The minimum timestep size in an adaptive run

  • enableTrueSet the enabled status of the MooseObject.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Set the enabled status of the MooseObject.

  • n_startup_steps0The number of timesteps during startup

    Default:0

    C++ Type:int

    Controllable:No

    Description:The number of timesteps during startup

  • outputsVector of output names where you would like to restrict the output of variables(s) associated with this object

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

    Controllable:No

    Description:Vector of output names where you would like to restrict the output of variables(s) associated with this object

  • skip_exception_checkFalseSpecifies whether or not to skip exception check

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Specifies whether or not to skip exception check

  • start_time0The start time of the simulation

    Default:0

    C++ Type:double

    Controllable:No

    Description:The start time of the simulation

  • timestep_tolerance1e-12the tolerance setting for final timestep size and sync times

    Default:1e-12

    C++ Type:double

    Controllable:No

    Description:the tolerance setting for final timestep size and sync times

  • use_multiapp_dtFalseIf true then the dt for the simulation will be chosen by the MultiApps. If false (the default) then the minimum over the master dt and the MultiApps is used

    Default:False

    C++ Type:bool

    Controllable:No

    Description:If true then the dt for the simulation will be chosen by the MultiApps. If false (the default) then the minimum over the master dt and the MultiApps is used

Advanced Parameters

  • accept_on_max_fixed_point_iterationFalseTrue to treat reaching the maximum number of fixed point iterations as converged.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:True to treat reaching the maximum number of fixed point iterations as converged.

  • auto_advanceFalseWhether to automatically advance sub-applications regardless of whether their solve converges, for transient executioners only.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether to automatically advance sub-applications regardless of whether their solve converges, for transient executioners only.

  • custom_abs_tol1e-50The absolute nonlinear residual to shoot for during fixed point iterations. This check is performed based on postprocessor defined by the custom_pp residual.

    Default:1e-50

    C++ Type:double

    Controllable:No

    Description:The absolute nonlinear residual to shoot for during fixed point iterations. This check is performed based on postprocessor defined by the custom_pp residual.

  • custom_ppPostprocessor for custom fixed point convergence check.

    C++ Type:PostprocessorName

    Controllable:No

    Description:Postprocessor for custom fixed point convergence check.

  • custom_rel_tol1e-08The relative nonlinear residual drop to shoot for during fixed point iterations. This check is performed based on the postprocessor defined by custom_pp residual.

    Default:1e-08

    C++ Type:double

    Controllable:No

    Description:The relative nonlinear residual drop to shoot for during fixed point iterations. This check is performed based on the postprocessor defined by custom_pp residual.

  • direct_pp_valueFalseTrue to use direct postprocessor value (scaled by value on first iteration). False (default) to use difference in postprocessor value between fixed point iterations.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:True to use direct postprocessor value (scaled by value on first iteration). False (default) to use difference in postprocessor value between fixed point iterations.

  • disable_fixed_point_residual_norm_checkFalseDisable the residual norm evaluation thus the three parameters fixed_point_rel_tol, fixed_point_abs_tol and fixed_point_force_norms.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Disable the residual norm evaluation thus the three parameters fixed_point_rel_tol, fixed_point_abs_tol and fixed_point_force_norms.

  • fixed_point_abs_tol1e-50The absolute nonlinear residual to shoot for during fixed point iterations. This check is performed based on the main app's nonlinear residual.

    Default:1e-50

    C++ Type:double

    Controllable:No

    Description:The absolute nonlinear residual to shoot for during fixed point iterations. This check is performed based on the main app's nonlinear residual.

  • fixed_point_algorithmpicardThe fixed point algorithm to converge the sequence of problems.

    Default:picard

    C++ Type:MooseEnum

    Options:picard, secant, steffensen

    Controllable:No

    Description:The fixed point algorithm to converge the sequence of problems.

  • fixed_point_force_normsFalseForce the evaluation of both the TIMESTEP_BEGIN and TIMESTEP_END norms regardless of the existence of active MultiApps with those execute_on flags, default: false.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Force the evaluation of both the TIMESTEP_BEGIN and TIMESTEP_END norms regardless of the existence of active MultiApps with those execute_on flags, default: false.

  • fixed_point_max_its1Specifies the maximum number of fixed point iterations.

    Default:1

    C++ Type:unsigned int

    Controllable:No

    Description:Specifies the maximum number of fixed point iterations.

  • fixed_point_min_its1Specifies the minimum number of fixed point iterations.

    Default:1

    C++ Type:unsigned int

    Controllable:No

    Description:Specifies the minimum number of fixed point iterations.

  • fixed_point_rel_tol1e-08The relative nonlinear residual drop to shoot for during fixed point iterations. This check is performed based on the main app's nonlinear residual.

    Default:1e-08

    C++ Type:double

    Controllable:No

    Description:The relative nonlinear residual drop to shoot for during fixed point iterations. This check is performed based on the main app's nonlinear residual.

  • relaxation_factor1Fraction of newly computed value to keep.Set between 0 and 2.

    Default:1

    C++ Type:double

    Controllable:No

    Description:Fraction of newly computed value to keep.Set between 0 and 2.

  • transformed_postprocessorsList of main app postprocessors to transform during fixed point iterations

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

    Controllable:No

    Description:List of main app postprocessors to transform during fixed point iterations

  • transformed_variablesList of main app variables to transform during fixed point iterations

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

    Controllable:No

    Description:List of main app variables to transform during fixed point iterations

Fixed Point Iterations Parameters

  • automatic_scalingFalseWhether to use automatic scaling for the variables.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether to use automatic scaling for the variables.

  • compute_scaling_onceTrueWhether the scaling factors should only be computed once at the beginning of the simulation through an extra Jacobian evaluation. If this is set to false, then the scaling factors will be computed during an extra Jacobian evaluation at the beginning of every time step.

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Whether the scaling factors should only be computed once at the beginning of the simulation through an extra Jacobian evaluation. If this is set to false, then the scaling factors will be computed during an extra Jacobian evaluation at the beginning of every time step.

  • ignore_variables_for_autoscalingList of variables that do not participate in autoscaling.

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

    Controllable:No

    Description:List of variables that do not participate in autoscaling.

  • off_diagonals_in_auto_scalingFalseWhether to consider off-diagonals when determining automatic scaling factors.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether to consider off-diagonals when determining automatic scaling factors.

  • resid_vs_jac_scaling_param0A parameter that indicates the weighting of the residual vs the Jacobian in determining variable scaling parameters. A value of 1 indicates pure residual-based scaling. A value of 0 indicates pure Jacobian-based scaling

    Default:0

    C++ Type:double

    Controllable:No

    Description:A parameter that indicates the weighting of the residual vs the Jacobian in determining variable scaling parameters. A value of 1 indicates pure residual-based scaling. A value of 0 indicates pure Jacobian-based scaling

  • scaling_group_variablesName of variables that are grouped together for determining scale factors. (Multiple groups can be provided, separated by semicolon)

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

    Controllable:No

    Description:Name of variables that are grouped together for determining scale factors. (Multiple groups can be provided, separated by semicolon)

Solver Variable Scaling Parameters

  • check_auxFalseWhether to check the auxiliary system for convergence to steady-state. If false, then the nonlinear system is used.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether to check the auxiliary system for convergence to steady-state. If false, then the nonlinear system is used.

  • steady_state_detectionFalseWhether or not to check for steady state conditions

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether or not to check for steady state conditions

  • steady_state_start_time0Minimum amount of time to run before checking for steady state conditions.

    Default:0

    C++ Type:double

    Controllable:No

    Description:Minimum amount of time to run before checking for steady state conditions.

  • steady_state_tolerance1e-08Whenever the relative residual changes by less than this the solution will be considered to be at steady state.

    Default:1e-08

    C++ Type:double

    Controllable:No

    Description:Whenever the relative residual changes by less than this the solution will be considered to be at steady state.

Steady State Detection Parameters

  • compute_initial_residual_before_preset_bcsFalseUse the residual norm computed *before* preset BCs are imposed in relative convergence check

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Use the residual norm computed *before* preset BCs are imposed in relative convergence check

  • n_max_nonlinear_pingpong100The maximum number of times the nonlinear residual can ping pong before requesting halting the current evaluation and requesting timestep cut

    Default:100

    C++ Type:unsigned int

    Controllable:No

    Description:The maximum number of times the nonlinear residual can ping pong before requesting halting the current evaluation and requesting timestep cut

  • nl_abs_div_tol1e+50Nonlinear Absolute Divergence Tolerance. A negative value disables this check.

    Default:1e+50

    C++ Type:double

    Controllable:No

    Description:Nonlinear Absolute Divergence Tolerance. A negative value disables this check.

  • nl_abs_step_tol0Nonlinear Absolute step Tolerance

    Default:0

    C++ Type:double

    Controllable:No

    Description:Nonlinear Absolute step Tolerance

  • nl_abs_tol1e-50Nonlinear Absolute Tolerance

    Default:1e-50

    C++ Type:double

    Controllable:No

    Description:Nonlinear Absolute Tolerance

  • nl_div_tol1e+10Nonlinear Relative Divergence Tolerance. A negative value disables this check.

    Default:1e+10

    C++ Type:double

    Controllable:No

    Description:Nonlinear Relative Divergence Tolerance. A negative value disables this check.

  • nl_forced_its0The Number of Forced Nonlinear Iterations

    Default:0

    C++ Type:unsigned int

    Controllable:No

    Description:The Number of Forced Nonlinear Iterations

  • nl_max_funcs10000Max Nonlinear solver function evaluations

    Default:10000

    C++ Type:unsigned int

    Controllable:No

    Description:Max Nonlinear solver function evaluations

  • nl_max_its50Max Nonlinear Iterations

    Default:50

    C++ Type:unsigned int

    Controllable:No

    Description:Max Nonlinear Iterations

  • nl_rel_step_tol0Nonlinear Relative step Tolerance

    Default:0

    C++ Type:double

    Controllable:No

    Description:Nonlinear Relative step Tolerance

  • nl_rel_tol1e-08Nonlinear Relative Tolerance

    Default:1e-08

    C++ Type:double

    Controllable:No

    Description:Nonlinear Relative Tolerance

  • num_grids1The number of grids to use for a grid sequencing algorithm. This includes the final grid, so num_grids = 1 indicates just one solve in a time-step

    Default:1

    C++ Type:unsigned int

    Controllable:No

    Description:The number of grids to use for a grid sequencing algorithm. This includes the final grid, so num_grids = 1 indicates just one solve in a time-step

  • residual_and_jacobian_togetherFalseWhether to compute the residual and Jacobian together.

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Whether to compute the residual and Jacobian together.

  • snesmf_reuse_baseTrueSpecifies whether or not to reuse the base vector for matrix-free calculation

    Default:True

    C++ Type:bool

    Controllable:No

    Description:Specifies whether or not to reuse the base vector for matrix-free calculation

Nonlinear Solver Parameters

  • contact_line_search_allowed_lambda_cuts2The number of times lambda is allowed to be cut in half in the contact line search. We recommend this number be roughly bounded by 0 <= allowed_lambda_cuts <= 3

    Default:2

    C++ Type:unsigned int

    Controllable:No

    Description:The number of times lambda is allowed to be cut in half in the contact line search. We recommend this number be roughly bounded by 0 <= allowed_lambda_cuts <= 3

  • contact_line_search_ltolThe linear relative tolerance to be used while the contact state is changing between non-linear iterations. We recommend that this tolerance be looser than the standard linear tolerance

    C++ Type:double

    Controllable:No

    Description:The linear relative tolerance to be used while the contact state is changing between non-linear iterations. We recommend that this tolerance be looser than the standard linear tolerance

  • line_searchdefaultSpecifies the line search type (Note: none = basic)

    Default:default

    C++ Type:MooseEnum

    Options:basic, bt, contact, cp, default, l2, none, project, shell

    Controllable:No

    Description:Specifies the line search type (Note: none = basic)

  • line_search_packagepetscThe solver package to use to conduct the line-search

    Default:petsc

    C++ Type:MooseEnum

    Options:petsc, moose

    Controllable:No

    Description:The solver package to use to conduct the line-search

Solver Line Search Parameters

  • l_abs_tol1e-50Linear Absolute Tolerance

    Default:1e-50

    C++ Type:double

    Controllable:No

    Description:Linear Absolute Tolerance

  • l_max_its10000Max Linear Iterations

    Default:10000

    C++ Type:unsigned int

    Controllable:No

    Description:Max Linear Iterations

  • l_tol1e-05Linear Relative Tolerance

    Default:1e-05

    C++ Type:double

    Controllable:No

    Description:Linear Relative Tolerance

  • reuse_preconditionerFalseIf true reuse the previously calculated preconditioner for the linearized system across multiple solves spanning nonlinear iterations and time steps. The preconditioner resets as controlled by reuse_preconditioner_max_linear_its

    Default:False

    C++ Type:bool

    Controllable:No

    Description:If true reuse the previously calculated preconditioner for the linearized system across multiple solves spanning nonlinear iterations and time steps. The preconditioner resets as controlled by reuse_preconditioner_max_linear_its

  • reuse_preconditioner_max_linear_its25Reuse the previously calculated preconditioner for the linear system until the number of linear iterations exceeds this number

    Default:25

    C++ Type:unsigned int

    Controllable:No

    Description:Reuse the previously calculated preconditioner for the linear system until the number of linear iterations exceeds this number

Linear Solver Parameters

  • max_xfem_update4294967295Maximum number of times to update XFEM crack topology in a step due to evolving cracks

    Default:4294967295

    C++ Type:unsigned int

    Controllable:No

    Description:Maximum number of times to update XFEM crack topology in a step due to evolving cracks

  • update_xfem_at_timestep_beginFalseShould XFEM update the mesh at the beginning of the timestep

    Default:False

    C++ Type:bool

    Controllable:No

    Description:Should XFEM update the mesh at the beginning of the timestep

Xfem Fixed Point Iterations Parameters

  • mffd_typewpSpecifies the finite differencing type for Jacobian-free solve types. Note that the default is wp (for Walker and Pernice).

    Default:wp

    C++ Type:MooseEnum

    Options:wp, ds

    Controllable:No

    Description:Specifies the finite differencing type for Jacobian-free solve types. Note that the default is wp (for Walker and Pernice).

  • petsc_optionsSingleton PETSc options

    C++ Type:MultiMooseEnum

    Options:-dm_moose_print_embedding, -dm_view, -ksp_converged_reason, -ksp_gmres_modifiedgramschmidt, -ksp_monitor, -ksp_monitor_snes_lg-snes_ksp_ew, -ksp_snes_ew, -snes_converged_reason, -snes_ksp, -snes_ksp_ew, -snes_linesearch_monitor, -snes_mf, -snes_mf_operator, -snes_monitor, -snes_test_display, -snes_view

    Controllable:No

    Description:Singleton PETSc options

  • petsc_options_inameNames of PETSc name/value pairs

    C++ Type:MultiMooseEnum

    Options:-ksp_atol, -ksp_gmres_restart, -ksp_max_it, -ksp_pc_side, -ksp_rtol, -ksp_type, -mat_fd_coloring_err, -mat_fd_type, -mat_mffd_type, -pc_asm_overlap, -pc_factor_levels, -pc_factor_mat_ordering_type, -pc_hypre_boomeramg_grid_sweeps_all, -pc_hypre_boomeramg_max_iter, -pc_hypre_boomeramg_strong_threshold, -pc_hypre_type, -pc_type, -snes_atol, -snes_linesearch_type, -snes_ls, -snes_max_it, -snes_rtol, -snes_divergence_tolerance, -snes_type, -sub_ksp_type, -sub_pc_type

    Controllable:No

    Description:Names of PETSc name/value pairs

  • petsc_options_valueValues of PETSc name/value pairs (must correspond with "petsc_options_iname"

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

    Controllable:No

    Description:Values of PETSc name/value pairs (must correspond with "petsc_options_iname"

Petsc Parameters

    Restart Parameters

    • time_period_endsThe end times of time periods

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

      Controllable:No

      Description:The end times of time periods

    • time_period_startsThe start times of time periods

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

      Controllable:No

      Description:The start times of time periods

    • time_periodsThe names of periods

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

      Controllable:No

      Description:The names of periods

    Time Periods Parameters

    Input Files