- variableThe name of the variable that this residual object operates on
C++ Type:NonlinearVariableName
Controllable:No
Description:The name of the variable that this residual object operates on
ADTimeDerivative
Description
The ADTimeDerivative
kernel implements a simple time derivative for the domain given by
where the second term on the left hand side corresponds to the strong forms of other kernels. The corresponding ADTimeDerivative
weak form using inner-product notation is
where is the approximate solution and is a finite element test function.
The Jacobian is computed through automatic differentiation. More information about time kernels can be found on the Kernels description page.
Example Syntax
Time derivative terms are ubiquitous in any transient simulation. The kernel block for a transient diffusion problem that demonstrates the ADTimeDerivative
syntax is shown below:
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = ADTimeDerivative
variable = u
[../]
[]
(test/tests/kernels/ad_transient_diffusion/ad_transient_diffusion.i)Input Parameters
- blockThe list of blocks (ids or names) that this object will be applied
C++ Type:std::vector<SubdomainName>
Controllable:No
Description:The list of blocks (ids or names) that this object will be applied
- displacementsThe displacements
C++ Type:std::vector<VariableName>
Controllable:No
Description:The displacements
- prop_getter_suffixAn optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
C++ Type:MaterialPropertyName
Controllable:No
Description:An optional suffix parameter that can be appended to any attempt to retrieve/get material properties. The suffix will be prepended with a '_' character.
- use_interpolated_stateFalseFor the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Default:False
C++ Type:bool
Controllable:No
Description:For the old and older state use projected material properties interpolated at the quadrature points. To set up projection use the ProjectedStatefulMaterialStorageAction.
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_tagssystem timeThe tag for the matrices this Kernel should fill
Default:system time
C++ Type:MultiMooseEnum
Options:nontime, system, time
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagstimeThe tag for the vectors this Kernel should fill
Default:time
C++ Type:MultiMooseEnum
Options:nontime, time
Controllable:No
Description:The tag for the vectors this Kernel should fill
Tagging 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.
- diag_save_inThe name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this Kernel's diagonal Jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- enableTrueSet the enabled status of the MooseObject.
Default:True
C++ Type:bool
Controllable:Yes
Description:Set the enabled status of the MooseObject.
- implicitTrueDetermines whether this object is calculated using an implicit or explicit form
Default:True
C++ Type:bool
Controllable:No
Description:Determines whether this object is calculated using an implicit or explicit form
- save_inThe name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
C++ Type:std::vector<AuxVariableName>
Controllable:No
Description:The name of auxiliary variables to save this Kernel's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/phase_field/test/tests/anisotropic_interfaces/adkobayashi.i)
- (modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_convection/plate.parent.i)
- (test/tests/nodalkernels/constraint_enforcement/ad-upper-and-lower-bound.i)
- (test/tests/problems/reference_residual_problem/ad_abs_ref.i)
- (modules/phase_field/examples/multiphase/GrandPotential3Phase_AD.i)
- (test/tests/materials/derivative_sum_material/ad_random_ic.i)
- (modules/phase_field/examples/anisotropic_interfaces/ad_snow.i)
- (modules/phase_field/test/tests/phase_field_kernels/ADnonuniform_barrier_coefficient.i)
- (modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/lps_dual.i)
- (modules/stochastic_tools/test/tests/transfers/batch_sampler_transfer/sub.i)
- (test/tests/materials/derivative_material_interface/ad_construction_order.i)
- (modules/phase_field/test/tests/phase_field_kernels/ADAllenCahnVariableL.i)
- (modules/stochastic_tools/examples/sobol/diffusion.i)
- (modules/heat_transfer/test/tests/radiative_bcs/ad_function_radiative_bc.i)
- (modules/level_set/test/tests/functions/olsson_bubble/olsson_bubble_adjac.i)
- (modules/xfem/test/tests/moving_interface/moving_ad_diffusion.i)
- (test/tests/time_integrators/newmark-beta/ad_newmark_beta_dotdot.i)
- (test/tests/materials/coupled_value_function/adjac.i)
- (modules/stochastic_tools/examples/batch/sub.i)
- (modules/heat_transfer/test/tests/ad_convective_heat_flux/coupled.i)
- (test/tests/kernels/ad_transient_diffusion/ad_transient_diffusion.i)
- (modules/phase_field/test/tests/ADCHSoretDiffusion/simple_transient_diffusion_with_soret.i)
- (test/tests/misc/ad_robustness/ad_two_nl_var_transient_diffusion.i)
- (modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_temperature/phy.parent.i)
- (test/tests/outputs/xml/xml_iterations.i)
- (modules/phase_field/test/tests/phase_field_kernels/ADAllenCahn.i)
- (modules/stochastic_tools/test/tests/multiapps/batch_full_solve_multiapp/sub.i)
- (test/tests/coord_type/coord_type_rz_general.i)
- (modules/optimization/test/tests/reporter/TransientSyntheticDataCreator/transient_synthetic_data.i)
- (modules/optimization/examples/diffusion_reaction/forward_exact.i)
- (modules/phase_field/test/tests/GrandPotentialPFM/GrandPotentialMultiphase_AD.i)
- (modules/stochastic_tools/examples/parameter_study/diffusion_vector.i)
- (test/tests/kernels/ad_jacobians/adfunction.i)
- (test/tests/multiapps/full_solve_multiapp_reset/sub.i)
- (test/tests/kernels/ad_jacobians/test.i)
- (modules/optimization/examples/simpleTransient/nonlinear_forward_and_adjoint.i)
- (modules/phase_field/test/tests/ADCHSplitChemicalPotential/simple_transient_diffusion.i)
- (modules/optimization/examples/diffusion_reaction/forward_and_adjoint.i)
- (modules/phase_field/test/tests/anisotropic_mobility/ad_diffusion.i)
- (modules/xfem/test/tests/moving_interface/ad_phase_transition_2d.i)
- (test/tests/time_integrators/central-difference/ad_central_difference_dotdot.i)
- (test/tests/bcs/mat_neumann_bc/ad_mat_neumann.i)
- (modules/stochastic_tools/examples/parameter_study/diffusion_time.i)
- (python/mms/test/mms_temporal.i)
- (modules/phase_field/test/tests/ad_coupled_gradient_dot/diffusion_rate.i)
- (modules/stochastic_tools/examples/parameter_study/diffusion.i)
- (modules/heat_transfer/test/tests/ad_convective_heat_flux/equilibrium.i)
- (test/tests/reporters/iteration_info/iteration_info.i)
- (test/tests/misc/ad_robustness/ad_two_var_transient_diffusion.i)
- (test/tests/misc/ad_robustness/ad_two_nl_var_transient_diffusion_jac.i)
Child Objects
(test/tests/kernels/ad_transient_diffusion/ad_transient_diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = ADTimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 20
dt = 0.1
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/anisotropic_interfaces/adkobayashi.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 32
ny = 32
xmax = 0.7
ymax = 0.7
[]
[Variables]
[w]
[]
[T]
[]
[]
[ICs]
[wIC]
type = SmoothCircleIC
variable = w
int_width = 0.1
x1 = 0.35
y1 = 0.35
radius = 0.08
outvalue = 0
invalue = 1
[]
[]
[Kernels]
[w_dot]
type = TimeDerivative
variable = w
[]
[anisoACinterface1]
type = ADACInterfaceKobayashi1
variable = w
mob_name = M
[]
[anisoACinterface2]
type = ADACInterfaceKobayashi2
variable = w
mob_name = M
[]
[AllenCahn]
type = ADAllenCahn
variable = w
mob_name = M
f_name = fbulk
[]
[T_dot]
type = ADTimeDerivative
variable = T
[]
[CoefDiffusion]
type = ADDiffusion
variable = T
[]
[w_dot_T]
type = ADCoefCoupledTimeDerivative
variable = T
v = w
coef = -1.8 #This is -K from kobayashi's paper
[]
[]
[Materials]
[free_energy]
type = ADDerivativeParsedMaterial
property_name = fbulk
coupled_variables = 'w T'
constant_names = 'alpha gamma T_e pi'
constant_expressions = '0.9 10 1 4*atan(1)'
expression = 'm:=alpha/pi * atan(gamma * (T_e - T)); 1/4*w^4 - (1/2 - m/3) * w^3 + (1/4 - m/2) * '
'w^2'
derivative_order = 1
outputs = exodus
[]
[material]
type = ADInterfaceOrientationMaterial
op = w
[]
[consts]
type = ADGenericConstantMaterial
prop_names = 'M'
prop_values = '3333.333'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
scheme = bdf2
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu '
nl_rel_tol = 1e-08
l_tol = 1e-4
l_max_its = 30
dt = 0.001
num_steps = 6
[]
[Outputs]
exodus = true
perf_graph = true
execute_on = 'INITIAL FINAL'
[]
(modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_convection/plate.parent.i)
# This tests a temperature and heat transfer coefficient using the MultiApp system.
# Simple heat conduction problem with heat source is solved,
# to obtain an analytical solution:
# T(x,t) = 300 + 20t(x-1)^2
# The temperature is picked up by the child
# side of the solve, to use as ambiant temperature in a convective BC.
htc = 100
[Mesh]
type = GeneratedMesh
dim = 1
xmax = 1
nx = 10
[]
[Functions]
[left_bc_fn]
type = PiecewiseLinear
x = '0 10'
y = '300 500'
[]
[]
[Variables]
[T]
[]
[]
[AuxVariables]
[htc_ext]
initial_condition = ${htc}
[]
[]
[Functions]
[source_term]
type = ParsedFunction
expression = '20 * x * x - 40 * x + 20 - 40 * t'
[]
[]
[ICs]
[T_ic]
type = ConstantIC
variable = T
value = 300
[]
[]
[Kernels]
[td]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADDiffusion
variable = T
[]
[source]
type = BodyForce
function = 'source_term'
variable = T
[]
[]
[BCs]
[left]
type = FunctionDirichletBC
variable = T
boundary = left
function = left_bc_fn
[]
[right]
type = NeumannBC
variable = T
boundary = right
value = 0
[]
[]
[Executioner]
type = Transient
dt = 0.5
end_time = 10
nl_abs_tol = 1e-10
abort_on_solve_fail = true
[]
[MultiApps]
[thm]
type = TransientMultiApp
app_type = ThermalHydraulicsApp
input_files = plate.i
execute_on = TIMESTEP_END
[]
[]
[Transfers]
[T_to_child]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = thm
source_variable = T
variable = T_ext
[]
[htc_to_child]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = thm
source_variable = htc_ext
variable = htc_ext
[]
[]
[Outputs]
exodus = true
[]
(test/tests/nodalkernels/constraint_enforcement/ad-upper-and-lower-bound.i)
l=10
nx=100
num_steps=10
[Mesh]
type = GeneratedMesh
dim = 1
xmax = ${l}
nx = ${nx}
[]
[Variables]
[u]
[]
[lm_upper]
[]
[lm_lower]
[]
[]
[ICs]
[u]
type = FunctionIC
variable = u
function = 'x'
[]
[]
[Kernels]
[time]
type = ADTimeDerivative
variable = u
[]
[diff]
type = ADDiffusion
variable = u
[]
[ffn]
type = ADBodyForce
variable = u
function = 'if(x<5,-1,1)'
[]
[]
[NodalKernels]
[upper_bound]
type = ADUpperBoundNodalKernel
variable = lm_upper
v = u
exclude_boundaries = 'left right'
upper_bound = 10
[]
[forces_from_upper]
type = ADCoupledForceNodalKernel
variable = u
v = lm_upper
coef = -1
[]
[lower_bound]
type = ADLowerBoundNodalKernel
variable = lm_lower
v = u
exclude_boundaries = 'left right'
lower_bound = 0
[]
[forces_from_lower]
type = ADCoupledForceNodalKernel
variable = u
v = lm_lower
coef = 1
[]
[]
[BCs]
[left]
type = ADDirichletBC
boundary = left
value = 0
variable = u
[]
[right]
type = ADDirichletBC
boundary = right
value = ${l}
variable = u
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
num_steps = ${num_steps}
solve_type = NEWTON
dtmin = 1
petsc_options_iname = '-snes_max_linear_solve_fail -ksp_max_it -pc_type -sub_pc_factor_levels -snes_linesearch_type'
petsc_options_value = '0 30 asm 16 basic'
[]
[Outputs]
exodus = true
[csv]
type = CSV
execute_on = 'nonlinear timestep_end'
[]
[dof]
type = DOFMap
execute_on = 'initial'
[]
[]
[Debug]
show_var_residual_norms = true
[]
[Postprocessors]
[active_upper_lm]
type = GreaterThanLessThanPostprocessor
variable = lm_upper
execute_on = 'nonlinear timestep_end'
value = 1e-8
comparator = 'greater'
[]
[upper_violations]
type = GreaterThanLessThanPostprocessor
variable = u
execute_on = 'nonlinear timestep_end'
value = ${fparse 10+1e-8}
comparator = 'greater'
[]
[active_lower_lm]
type = GreaterThanLessThanPostprocessor
variable = lm_lower
execute_on = 'nonlinear timestep_end'
value = 1e-8
comparator = 'greater'
[]
[lower_violations]
type = GreaterThanLessThanPostprocessor
variable = u
execute_on = 'nonlinear timestep_end'
value = -1e-8
comparator = 'less'
[]
[nls]
type = NumNonlinearIterations
[]
[cum_nls]
type = CumulativeValuePostprocessor
postprocessor = nls
[]
[]
(test/tests/problems/reference_residual_problem/ad_abs_ref.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
[]
[GlobalParams]
absolute_value_vector_tags = 'absref'
[]
[Problem]
type = ReferenceResidualProblem
reference_vector = 'absref'
extra_tag_vectors = 'absref'
[]
[Variables]
[u][]
[v]
scaling = 1e-6
[]
[]
[Functions]
[ramp]
type = ParsedFunction
expression = 'if(t < 5, t - 5, 0) * x'
[]
[]
[Kernels]
[u_dt]
type = ADTimeDerivative
variable = u
[]
[u_coupled_rx]
type = ADCoupledForce
variable = u
v = v
coef = 1
[]
[v_dt]
type = ADTimeDerivative
variable = v
[]
[v_neg_force]
type = ADBodyForce
variable = v
value = ${fparse -1 / 2}
function = ramp
[]
[v_force]
type = ADBodyForce
variable = v
value = 1
function = ramp
[]
[]
[Postprocessors]
[u_avg]
type = ElementAverageValue
variable = u
execute_on = 'TIMESTEP_END INITIAL'
[]
[v_avg]
type = ElementAverageValue
variable = v
execute_on = 'TIMESTEP_END INITIAL'
[]
[timestep]
type = TimePostprocessor
outputs = 'none'
[]
[v_old]
type = ElementAverageValue
variable = v
execute_on = TIMESTEP_BEGIN
outputs = none
[]
[u_old]
type = ElementAverageValue
variable = u
execute_on = TIMESTEP_BEGIN
outputs = none
[]
[v_exact]
type = ParsedPostprocessor
pp_names = 'timestep v_old'
expression = 't := if(timestep > 5, 5, timestep); (t^2 - 9 * t) / 8'
[]
[u_exact]
type = ParsedPostprocessor
pp_names = 'u_old v_exact'
expression = 'u_old + v_exact'
[]
[]
[Executioner]
type = Transient
petsc_options = '-snes_converged_reason'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = none
num_steps = 10
nl_rel_tol = 1e-06
verbose = true
[]
[Outputs]
csv = true
[]
(modules/phase_field/examples/multiphase/GrandPotential3Phase_AD.i)
# This is an example of implementation of the multi-phase, multi-order parameter
# grand potential based phase-field model described in Phys. Rev. E, 98, 023309
# (2018). It includes 3 phases with 1 grain of each phase. This example was used
# to generate the results shown in Fig. 3 of the paper.
[Mesh]
type = GeneratedMesh
dim = 1
nx = 60
xmin = -15
xmax = 15
[]
[Variables]
[w]
[]
[etaa0]
[]
[etab0]
[]
[etad0]
[]
[]
[ICs]
[IC_etaa0]
type = FunctionIC
variable = etaa0
function = ic_func_etaa0
[]
[IC_etab0]
type = FunctionIC
variable = etab0
function = ic_func_etab0
[]
[IC_etad0]
type = ConstantIC
variable = etad0
value = 0.1
[]
[IC_w]
type = FunctionIC
variable = w
function = ic_func_w
[]
[]
[Functions]
[ic_func_etaa0]
type = ADParsedFunction
value = '0.9*0.5*(1.0-tanh((x)/sqrt(2.0)))'
[]
[ic_func_etab0]
type = ADParsedFunction
value = '0.9*0.5*(1.0+tanh((x)/sqrt(2.0)))'
[]
[ic_func_w]
type = ADParsedFunction
value = 0
[]
[]
[Kernels]
# Order parameter eta_alpha0
[ACa0_bulk]
type = ADACGrGrMulti
variable = etaa0
v = 'etab0 etad0'
gamma_names = 'gab gad'
[]
[ACa0_sw]
type = ADACSwitching
variable = etaa0
Fj_names = 'omegaa omegab omegad'
hj_names = 'ha hb hd'
[]
[ACa0_int]
type = ADACInterface
variable = etaa0
kappa_name = kappa
variable_L = false
[]
[ea0_dot]
type = ADTimeDerivative
variable = etaa0
[]
# Order parameter eta_beta0
[ACb0_bulk]
type = ADACGrGrMulti
variable = etab0
v = 'etaa0 etad0'
gamma_names = 'gab gbd'
[]
[ACb0_sw]
type = ADACSwitching
variable = etab0
Fj_names = 'omegaa omegab omegad'
hj_names = 'ha hb hd'
[]
[ACb0_int]
type = ADACInterface
variable = etab0
kappa_name = kappa
variable_L = false
[]
[eb0_dot]
type = ADTimeDerivative
variable = etab0
[]
# Order parameter eta_delta0
[ACd0_bulk]
type = ADACGrGrMulti
variable = etad0
v = 'etaa0 etab0'
gamma_names = 'gad gbd'
[]
[ACd0_sw]
type = ADACSwitching
variable = etad0
Fj_names = 'omegaa omegab omegad'
hj_names = 'ha hb hd'
[]
[ACd0_int]
type = ADACInterface
variable = etad0
kappa_name = kappa
variable_L = false
[]
[ed0_dot]
type = ADTimeDerivative
variable = etad0
[]
#Chemical potential
[w_dot]
type = ADSusceptibilityTimeDerivative
variable = w
f_name = chi
[]
[Diffusion]
type = ADMatDiffusion
variable = w
diffusivity = Dchi
[]
[coupled_etaa0dot]
type = ADCoupledSwitchingTimeDerivative
variable = w
v = etaa0
Fj_names = 'rhoa rhob rhod'
hj_names = 'ha hb hd'
args = 'etaa0 etab0 etad0'
[]
[coupled_etab0dot]
type = ADCoupledSwitchingTimeDerivative
variable = w
v = etab0
Fj_names = 'rhoa rhob rhod'
hj_names = 'ha hb hd'
args = 'etaa0 etab0 etad0'
[]
[coupled_etad0dot]
type = ADCoupledSwitchingTimeDerivative
variable = w
v = etad0
Fj_names = 'rhoa rhob rhod'
hj_names = 'ha hb hd'
args = 'etaa0 etab0 etad0'
[]
[]
[Materials]
[ha_test]
type = ADSwitchingFunctionMultiPhaseMaterial
h_name = ha
all_etas = 'etaa0 etab0 etad0'
phase_etas = 'etaa0'
[]
[hb_test]
type = ADSwitchingFunctionMultiPhaseMaterial
h_name = hb
all_etas = 'etaa0 etab0 etad0'
phase_etas = 'etab0'
[]
[hd_test]
type = ADSwitchingFunctionMultiPhaseMaterial
h_name = hd
all_etas = 'etaa0 etab0 etad0'
phase_etas = 'etad0'
[]
[omegaa]
type = ADDerivativeParsedMaterial
args = 'w'
f_name = omegaa
material_property_names = 'Vm ka caeq'
function = '-0.5*w^2/Vm^2/ka-w/Vm*caeq'
derivative_order = 2
[]
[omegab]
type = ADDerivativeParsedMaterial
args = 'w'
f_name = omegab
material_property_names = 'Vm kb cbeq'
function = '-0.5*w^2/Vm^2/kb-w/Vm*cbeq'
derivative_order = 2
[]
[omegad]
type = ADDerivativeParsedMaterial
args = 'w'
f_name = omegad
material_property_names = 'Vm kd cdeq'
function = '-0.5*w^2/Vm^2/kd-w/Vm*cdeq'
derivative_order = 2
[]
[rhoa]
type = ADDerivativeParsedMaterial
args = 'w'
f_name = rhoa
material_property_names = 'Vm ka caeq'
function = 'w/Vm^2/ka + caeq/Vm'
derivative_order = 2
[]
[rhob]
type = ADDerivativeParsedMaterial
args = 'w'
f_name = rhob
material_property_names = 'Vm kb cbeq'
function = 'w/Vm^2/kb + cbeq/Vm'
derivative_order = 2
[]
[rhod]
type = ADDerivativeParsedMaterial
args = 'w'
f_name = rhod
material_property_names = 'Vm kd cdeq'
function = 'w/Vm^2/kd + cdeq/Vm'
derivative_order = 2
[]
[c]
type = ADParsedMaterial
material_property_names = 'Vm rhoa rhob rhod ha hb hd'
function = 'Vm * (ha * rhoa + hb * rhob + hd * rhod)'
f_name = c
[]
[const]
type = ADGenericConstantMaterial
prop_names = 'kappa_c kappa L D Vm ka caeq kb cbeq kd cdeq gab gad gbd mu tgrad_corr_mult'
prop_values = '0 1 1.0 1.0 1.0 10.0 0.1 10.0 0.9 10.0 0.5 1.5 1.5 1.5 1.0 0.0'
[]
[Mobility]
type = ADDerivativeParsedMaterial
f_name = Dchi
material_property_names = 'D chi'
function = 'D*chi'
derivative_order = 2
[]
[chi]
type = ADDerivativeParsedMaterial
f_name = chi
material_property_names = 'Vm ha(etaa0,etab0,etad0) ka hb(etaa0,etab0,etad0) kb hd(etaa0,etab0,etad0) kd'
function = '(ha/ka + hb/kb + hd/kd) / Vm^2'
args = 'etaa0 etab0 etad0'
derivative_order = 2
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[VectorPostprocessors]
[etaa0]
type = LineValueSampler
variable = etaa0
start_point = '-15 0 0'
end_point = '15 0 0'
num_points = 61
sort_by = x
execute_on = 'initial timestep_end final'
[]
[etab0]
type = LineValueSampler
variable = etab0
start_point = '-15 0 0'
end_point = '15 0 0'
num_points = 61
sort_by = x
execute_on = 'initial timestep_end final'
[]
[etad0]
type = LineValueSampler
variable = etad0
start_point = '-15 0 0'
end_point = '15 0 0'
num_points = 61
sort_by = x
execute_on = 'initial timestep_end final'
[]
[]
[Executioner]
type = Transient
nl_max_its = 15
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = -pc_type
petsc_options_value = lu
l_max_its = 15
l_tol = 1.0e-3
nl_rel_tol = 1.0e-8
start_time = 0.0
num_steps = 20
nl_abs_tol = 1e-10
dt = 1.0
[]
[Outputs]
[exodus]
type = Exodus
execute_on = 'initial timestep_end final'
interval = 1
[]
[csv]
type = CSV
execute_on = 'initial timestep_end final'
interval = 1
[]
[]
(test/tests/materials/derivative_sum_material/ad_random_ic.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 250
ymax = 250
elem_type = QUAD4
[]
[Variables]
[./c]
[./InitialCondition]
type = RandomIC
[../]
[../]
[]
[Kernels]
[./w_res]
type = ADDiffusion
variable = c
[../]
[./time]
type = ADTimeDerivative
variable = c
[../]
[]
[Materials]
[./free_energy1]
type = ADDerivativeParsedMaterial
property_name = Fa
coupled_variables = 'c'
expression = (c-0.1)^4*(1-0.1-c)^4
[../]
[./free_energy2]
type = ADDerivativeParsedMaterial
property_name = Fb
coupled_variables = 'c'
expression = -0.25*(c-0.1)^4*(1-0.1-c)^4
[../]
# Fa+Fb+Fb == Fc
[./free_energy3]
type = ADDerivativeParsedMaterial
property_name = Fc
coupled_variables = 'c'
expression = 0.5*(c-0.1)^4*(1-0.1-c)^4
outputs = all
[../]
[./dfree_energy3]
type = ADDerivativeParsedMaterial
property_name = dFc
coupled_variables = 'c'
material_property_names = 'F:=D[Fc,c]'
expression = F
outputs = all
[../]
[./d2free_energy3]
type = ADDerivativeParsedMaterial
property_name = d2Fc
coupled_variables = 'c'
material_property_names = 'F:=D[Fc,c,c]'
expression = F
outputs = all
[../]
[./free_energy]
type = ADDerivativeSumMaterial
property_name = F_sum
sum_materials = 'Fa Fb Fb'
coupled_variables = 'c'
outputs = all
[../]
[./dfree_energy]
type = ADDerivativeParsedMaterial
property_name = dF_sum
material_property_names = 'F:=D[F_sum,c]'
expression = F
coupled_variables = 'c'
outputs = all
[../]
[./d2free_energy]
type = ADDerivativeParsedMaterial
property_name = d2F_sum
material_property_names = 'F:=D[F_sum,c,c]'
expression = F
coupled_variables = 'c'
outputs = all
[../]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Postprocessors]
[./F_sum]
type = ElementAverageValue
variable = F_sum
[../]
[./F_check]
type = ElementAverageValue
variable = Fc
[../]
[./dF_sum]
type = ElementAverageValue
variable = dF_sum
[../]
[./dF_check]
type = ElementAverageValue
variable = dFc
[../]
[./d2F_sum]
type = ElementAverageValue
variable = d2F_sum
[../]
[./d2F_check]
type = ElementAverageValue
variable = d2Fc
[../]
[]
[Outputs]
exodus = true
[]
(modules/phase_field/examples/anisotropic_interfaces/ad_snow.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 14
ny = 14
xmax = 9
ymax = 9
uniform_refine = 3
[]
[Variables]
[./w]
[../]
[./T]
[../]
[]
[ICs]
[./wIC]
type = SmoothCircleIC
variable = w
int_width = 0.1
x1 = 4.5
y1 = 4.5
radius = 0.07
outvalue = 0
invalue = 1
[../]
[]
[Kernels]
[./w_dot]
type = ADTimeDerivative
variable = w
[../]
[./anisoACinterface1]
type = ADACInterfaceKobayashi1
variable = w
mob_name = adM
[../]
[./anisoACinterface2]
type = ADACInterfaceKobayashi2
variable = w
mob_name = adM
[../]
[./AllenCahn]
type = AllenCahn
variable = w
mob_name = M
f_name = fbulk
coupled_variables = T
[../]
[./T_dot]
type = ADTimeDerivative
variable = T
[../]
[./CoefDiffusion]
type = ADDiffusion
variable = T
[../]
[./w_dot_T]
type = ADCoefCoupledTimeDerivative
variable = T
v = w
coef = -1.8
[../]
[]
[Materials]
[./free_energy]
type = DerivativeParsedMaterial
property_name = fbulk
coupled_variables = 'w T'
constant_names = pi
constant_expressions = 4*atan(1)
expression = 'm:=0.9 * atan(10 * (1 - T)) / pi; 1/4*w^4 - (1/2 - m/3) * w^3 + (1/4 - m/2) * w^2'
derivative_order = 2
outputs = exodus
[../]
[./material]
type = ADInterfaceOrientationMaterial
op = w
[../]
[./consts1]
type = ADGenericConstantMaterial
prop_names = 'adM'
prop_values = '3333.333'
[../]
[./consts2]
type = GenericConstantMaterial
prop_names = 'M'
prop_values = '3333.333'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu '
nl_abs_tol = 1e-10
nl_rel_tol = 1e-08
l_max_its = 30
end_time = 1
[./TimeStepper]
type = IterationAdaptiveDT
optimal_iterations = 6
iteration_window = 2
dt = 0.0005
growth_factor = 1.1
cutback_factor = 0.75
[../]
[./Adaptivity]
initial_adaptivity = 3 # Number of times mesh is adapted to initial condition
refine_fraction = 0.7 # Fraction of high error that will be refined
coarsen_fraction = 0.1 # Fraction of low error that will coarsened
max_h_level = 5 # Max number of refinements used, starting from initial mesh (before uniform refinement)
weight_names = 'w T'
weight_values = '1 0.5'
[../]
[]
[Outputs]
time_step_interval = 5
exodus = true
[]
(modules/phase_field/test/tests/phase_field_kernels/ADnonuniform_barrier_coefficient.i)
# This material tests the kernels ACBarrierFunction and ACKappaFunction for a
# multiphase system.
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
xmin = -200
xmax = 200
ymin = -200
ymax = 200
uniform_refine = 0
[]
[Variables]
[./gr0]
[../]
[./gr1]
[../]
[]
[ICs]
[./gr0_IC]
type = BoundingBoxIC
variable = gr0
x1 = -80
y1 = -80
x2 = 80
y2 = 80
inside = 0
outside = 1
[../]
[./gr1_IC]
type = BoundingBoxIC
variable = gr1
x1 = -80
y1 = -80
x2 = 80
y2 = 80
inside = 1
outside = 0
[../]
[]
[Materials]
[./constants]
type = ADGenericConstantMaterial
prop_names = 'L gamma E0 E1'
prop_values = '0.1 1.5 3 1'
[../]
[./h0]
type = ADDerivativeParsedMaterial
f_name = h0
args = 'gr0 gr1'
function = 'gr0^2 / (gr0^2 + gr1^2)'
derivative_order = 2
[../]
[./h1]
type = ADDerivativeParsedMaterial
f_name = h1
args = 'gr0 gr1'
function = 'gr1^2 / (gr0^2 + gr1^2)'
derivative_order = 2
[../]
[./mu]
type = ADDerivativeParsedMaterial
f_name = mu
args = 'gr0 gr1'
constant_names = 'mag'
constant_expressions = '16'
function = 'mag * (gr0^2 * gr1^2 + 0.1)'
derivative_order = 2
[../]
[./kappa]
type = ADDerivativeParsedMaterial
f_name = kappa
args = 'gr0 gr1'
material_property_names = 'h0(gr0,gr1) h1(gr0,gr1)'
constant_names = 'mag0 mag1'
constant_expressions = '200 100'
function = 'h0*mag0 + h1*mag1'
derivative_order = 2
[../]
[]
[Kernels]
[./gr0_time]
type = ADTimeDerivative
variable = gr0
[../]
[./gr0_interface]
type = ADACInterface
variable = gr0
args = 'gr1'
mob_name = L
kappa_name = 'kappa'
variable_L = false
[../]
[./gr0_switching]
type = ADACSwitching
variable = gr0
hj_names = 'h0 h1'
Fj_names = 'E0 E1'
mob_name = L
[../]
[./gr0_multi]
type = ADACGrGrMulti
variable = gr0
v = 'gr1'
mob_name = L
gamma_names = 'gamma'
[../]
[./gr0_barrier]
type = ADACBarrierFunction
variable = gr0
mob_name = L
gamma = gamma
v = 'gr1'
[../]
[./gr0_kappa]
type = ADACKappaFunction
variable = gr0
mob_name = L
kappa_name = kappa
v = 'gr1'
[../]
[./gr1_time]
type = ADTimeDerivative
variable = gr1
[../]
[./gr1_interface]
type = ADACInterface
variable = gr1
args = 'gr0'
mob_name = L
kappa_name = 'kappa'
variable_L = false
[../]
[./gr1_switching]
type = ADACSwitching
variable = gr1
hj_names = 'h0 h1'
Fj_names = 'E0 E1'
mob_name = L
[../]
[./gr1_multi]
type = ADACGrGrMulti
variable = gr1
v = 'gr0'
mob_name = L
gamma_names = 'gamma'
[../]
[./gr1_barrier]
type = ADACBarrierFunction
variable = gr1
mob_name = L
gamma = gamma
v = 'gr0'
[../]
[./gr1_kappa]
type = ADACKappaFunction
variable = gr1
mob_name = L
kappa_name = kappa
v = 'gr0'
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type '
petsc_options_value = ' lu '
nl_max_its = 20
l_max_its = 30
l_tol = 1e-4
nl_rel_tol = 1e-12
nl_abs_tol = 1e-12
start_time = 0
num_steps = 3
dt = 1
[]
[Outputs]
exodus = true
file_base = nonuniform_barrier_coefficient_out
[]
(modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/lps_dual.i)
# This test provides an example of combining two LPS viscoplasticity models with different stress
# exponents.
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 1
xmax = 0.002
ymax = 0.002
[]
[Variables]
[./temp]
initial_condition = 1000
[../]
[]
[Kernels]
[./dt]
type = ADTimeDerivative
variable = temp
[../]
[./diff]
type = ADDiffusion
variable = temp
[../]
[]
[Physics/SolidMechanics/QuasiStatic/All]
strain = FINITE
add_variables = true
generate_output = 'strain_xx strain_yy strain_xy hydrostatic_stress vonmises_stress'
use_automatic_differentiation = true
[]
[Functions]
[./pull]
type = PiecewiseLinear
x = '0 0.1'
y = '0 1e-5'
[../]
[./tot_effective_viscoplasticity]
type = ParsedFunction
symbol_values = 'lps_1_eff_creep_strain lps_3_eff_creep_strain'
symbol_names = 'lps_1_eff_creep_strain lps_3_eff_creep_strain'
expression = 'lps_1_eff_creep_strain+lps_3_eff_creep_strain'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.3
[../]
[./stress]
type = ADComputeMultipleInelasticStress
inelastic_models = 'one two'
outputs = all
[../]
[./porosity]
type = ADPorosityFromStrain
initial_porosity = 0.1
inelastic_strain = 'combined_inelastic_strain'
outputs = 'all'
[../]
[./one]
type = ADViscoplasticityStressUpdate
coefficient = 'coef_3'
power = 3
base_name = 'lps_1'
outputs = all
relative_tolerance = 1e-11
[../]
[./two]
type = ADViscoplasticityStressUpdate
coefficient = 1e-10
power = 1
base_name = 'lps_3'
outputs = all
relative_tolerance = 1e-11
[../]
[./coef]
type = ADParsedMaterial
property_name = coef_3
# Example of creep power law
coupled_variables = temp
expression = '0.5e-18 * exp(-4e4 / 1.987 / temp)'
[../]
[]
[BCs]
[./no_disp_x]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[../]
[./no_disp_y]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[./pull_disp_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = top
function = pull
[../]
[./temp_ramp]
type = ADFunctionDirichletBC
boundary = right
function = '1000 + 400 * t / 0.12'
variable = temp
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 0.01
end_time = 0.12
[]
[Postprocessors]
[./disp_x]
type = SideAverageValue
variable = disp_x
boundary = right
[../]
[./disp_y]
type = SideAverageValue
variable = disp_y
boundary = top
[../]
[./avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[../]
[./avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
[../]
[./dt]
type = TimestepSize
[../]
[./num_lin]
type = NumLinearIterations
outputs = console
[../]
[./num_nonlin]
type = NumNonlinearIterations
outputs = console
[../]
[./lps_1_eff_creep_strain]
type = ElementAverageValue
variable = lps_1_effective_viscoplasticity
[../]
[./lps_3_eff_creep_strain]
type = ElementAverageValue
variable = lps_3_effective_viscoplasticity
[../]
[./lps_1_gauge_stress]
type = ElementAverageValue
variable = lps_1_gauge_stress
[../]
[./lps_3_gauge_stress]
type = ElementAverageValue
variable = lps_3_gauge_stress
[../]
[./eff_creep_strain_tot]
type = FunctionValuePostprocessor
function = tot_effective_viscoplasticity
[../]
[./porosity]
type = ElementAverageValue
variable = porosity
[../]
[]
[Outputs]
csv = true
[]
(modules/stochastic_tools/test/tests/transfers/batch_sampler_transfer/sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[time]
type = ADTimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[average]
type = AverageNodalVariableValue
variable = u
[]
[]
[Executioner]
type = Transient
num_steps = 1
dt = 0.25
solve_type = NEWTON
[]
[Controls]
[stochastic]
type = SamplerReceiver
[]
[]
(test/tests/materials/derivative_material_interface/ad_construction_order.i)
#
# Test the the getDefaultMaterialProperty in DerivativeMaterialInterface.
# This test should only pass, if the construction order of the Materials
# using this interface does not influence the outcome.
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 1
xmin = 0
xmax = 1
ymin = 0
ymax = 0.1
elem_type = QUAD4
[]
[GlobalParams]
derivative_order = 2
[]
[Variables]
[./c]
[./InitialCondition]
type = FunctionIC
function = x
[../]
[../]
[]
[Kernels]
[./dummy1]
type = ADDiffusion
variable = c
[../]
[./dummy2]
type = ADTimeDerivative
variable = c
[../]
[]
[Materials]
# derivatives used both before and after being declared
[./sum_a_1]
type = ADDerivativeSumMaterial
property_name = Fa1
sum_materials = 'Fa'
coupled_variables = 'c'
outputs = exodus
[../]
[./free_energy_a]
type = ADDerivativeParsedMaterial
property_name = Fa
coupled_variables = 'c'
expression = 'c^4'
[../]
[./sum_a_2]
type = ADDerivativeSumMaterial
property_name = Fa2
sum_materials = 'Fa'
coupled_variables = 'c'
outputs = exodus
[../]
# derivatives declared after being used
[./sum_b_1]
type = ADDerivativeSumMaterial
property_name = Fb1
sum_materials = 'Fb'
coupled_variables = 'c'
outputs = exodus
[../]
[./free_energy_b]
type = ADDerivativeParsedMaterial
property_name = Fb
coupled_variables = 'c'
expression = 'c^4'
[../]
# derivatives declared before being used
[./free_energy_c]
type = ADDerivativeParsedMaterial
property_name = Fc
coupled_variables = 'c'
expression = 'c^4'
[../]
[./sum_c_2]
type = ADDerivativeSumMaterial
property_name = Fc2
sum_materials = 'Fc'
coupled_variables = 'c'
outputs = exodus
[../]
# non-existing derivatives
[./free_energy_d]
type = ADParsedMaterial
property_name = Fd
coupled_variables = 'c'
expression = 'c^4'
[../]
[./sum_d_1]
type = ADDerivativeSumMaterial
property_name = Fd1
sum_materials = 'Fd'
coupled_variables = 'c'
outputs = exodus
[../]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = 'NEWTON'
num_steps = 1
dt = 1e-5
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/phase_field/test/tests/phase_field_kernels/ADAllenCahnVariableL.i)
#
# Test the forward automatic differentiation Allen-Cahn Bulk kernel with a
# spatially varying mobility
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 12
ymax = 12
elem_type = QUAD4
[]
[AuxVariables]
[./chi]
[./InitialCondition]
type = FunctionIC
function = 'x/24+0.5'
[../]
[../]
[]
[Variables]
[./eta]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 0.0
y1 = 0.0
radius = 6.0
invalue = 0.9
outvalue = 0.1
int_width = 3.0
[../]
[../]
[]
[Kernels]
[./detadt]
type = ADTimeDerivative
variable = eta
[../]
[./ACBulk]
type = ADAllenCahn
variable = eta
f_name = F
[../]
[./ACInterface]
type = ADACInterface
variable = eta
kappa_name = 1
variable_L = true
coupled_variables = chi
[../]
[]
[Materials]
[./L]
type = ADTestDerivativeFunction
function = F2
f_name = L
op = 'eta chi'
[../]
[./free_energy]
type = ADTestDerivativeFunction
function = F1
f_name = F
op = 'eta'
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
num_steps = 2
dt = 1
[]
[Outputs]
exodus = true
[]
(modules/stochastic_tools/examples/sobol/diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables/T]
initial_condition = 300
[]
[Kernels]
[time]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADMatDiffusion
variable = T
diffusivity = diffusivity
[]
[source]
type = ADBodyForce
variable = T
value = 100
function = 1
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = T
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = T
boundary = right
value = -100
[]
[]
[Materials/constant]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
[]
[Executioner]
type = Transient
solve_type = NEWTON
num_steps = 4
dt = 0.25
[]
[Postprocessors]
[T_avg]
type = ElementAverageValue
variable = T
execute_on = 'initial timestep_end'
[]
[q_left]
type = ADSideDiffusiveFluxAverage
variable = T
boundary = left
diffusivity = diffusivity
execute_on = 'initial timestep_end'
[]
[]
[Controls/stochastic]
type = SamplerReceiver
[]
[Outputs]
[]
(modules/heat_transfer/test/tests/radiative_bcs/ad_function_radiative_bc.i)
#
# If we assume that epsilon*sigma*(T_inf^4-T_s^4) is approximately equal to
# epsilon*sigma*4*T_inf^3*(T_inf-T_s), that form is equivalent to
# h*(T_inf-T_s), the convective flux bc. So, the radiative and convective
# flux bcs should give nearly the same answer if the leading terms are equal.
#
[Mesh]
[top]
type = GeneratedMeshGenerator
dim = 3
nx = 10
bias_x = 0.8
ymin = 1.2
ymax = 2.2
boundary_name_prefix = top
[]
[bottom]
type = GeneratedMeshGenerator
dim = 3
nx = 10
bias_x = 0.8
boundary_name_prefix = bot
boundary_id_offset = 6
[]
[two_blocks]
type = MeshCollectionGenerator
inputs = 'top bottom'
[]
[]
[Variables]
[temp]
initial_condition = 600.0
[]
[]
[Kernels]
[heat_dt]
type = ADTimeDerivative
variable = temp
[]
[heat_conduction]
type = ADHeatConduction
variable = temp
[]
[]
[BCs]
[top_right]
type = ADConvectiveHeatFluxBC
variable = temp
boundary = top_right
T_infinity = 300.0
heat_transfer_coefficient = 3.0
[]
[bot_right]
type = ADFunctionRadiativeBC
variable = temp
boundary = bot_right
# htc/(stefan-boltzmann*4*T_inf^3)
emissivity_function = '3/(5.670367e-8*4*300*300*300)'
[]
[]
[Materials]
[thermal]
type = ADGenericConstantMaterial
prop_names = 'density thermal_conductivity specific_heat'
prop_values = '1 10 100'
[]
[]
[Postprocessors]
[top_left_temp]
type = SideAverageValue
variable = temp
boundary = top_left
execute_on = 'TIMESTEP_END initial'
[]
[bot_left_temp]
type = SideAverageValue
variable = temp
boundary = bot_left
execute_on = 'TIMESTEP_END initial'
[]
[top_right_temp]
type = SideAverageValue
variable = temp
boundary = top_right
[]
[bot_right_temp]
type = SideAverageValue
variable = temp
boundary = bot_right
[]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 1e1
nl_abs_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(modules/level_set/test/tests/functions/olsson_bubble/olsson_bubble_adjac.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
displacements = 'disp_x disp_y'
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[bubble]
[]
[disp_x]
[]
[disp_y]
[]
[]
[Kernels]
[bubble]
type = ADBodyForce
variable = bubble
function = bubble_func
use_displaced_mesh = true
[]
[dt]
type = ADTimeDerivative
variable = bubble
[]
[]
[Functions]
[bubble_func]
type = LevelSetOlssonBubble
center = '0.5 0.5 0'
radius = 0.4
epsilon = 0.05
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 1
[]
[Outputs]
exodus = true
[]
(modules/xfem/test/tests/moving_interface/moving_ad_diffusion.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 3
xmin = 0.0
xmax = 1
ymin = 0.0
ymax = 1
elem_type = QUAD4
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Variables]
[./u]
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'x-0.76+0.21*t'
[../]
[]
[Kernels]
[./diff]
type = ADMatDiffusion
variable = u
diffusivity = diffusion_coefficient
[../]
[./time_deriv]
type = ADTimeDerivative
variable = u
[../]
[]
[Constraints]
[./u_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = u
jump = 0
use_penalty = true
alpha = 1e5
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./right_u]
type = ADDirichletBC
variable = u
boundary = left
value = 0
[../]
[./left_u]
type = ADDirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Materials]
[./diffusivity_A]
type = ADGenericConstantMaterial
prop_names = A_diffusion_coefficient
prop_values = 5
[../]
[./diffusivity_B]
type = ADGenericConstantMaterial
prop_names = B_diffusion_coefficient
prop_values = 0.5
[../]
[./diff_combined]
type = ADLevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = diffusion_coefficient
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
l_max_its = 20
l_tol = 1e-8
nl_max_its = 15
nl_rel_tol = 2e-12
nl_abs_tol = 1e-50
start_time = 0.0
dt = 1
end_time = 2
max_xfem_update = 1
[]
[Outputs]
exodus = true
execute_on = timestep_end
file_base = moving_diffusion_out
perf_graph = true
[./console]
type = Console
output_linear = true
[../]
[]
(test/tests/time_integrators/newmark-beta/ad_newmark_beta_dotdot.i)
###########################################################
# This is a simple test with a time-dependent problem
# demonstrating the use of the TimeIntegrator system.
#
# Testing that the second time derivative is calculated
# correctly using the Newmark-Beta method for an AD variable
#
###########################################################
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 1
ny = 1
[]
[Variables]
[./u]
[../]
[]
[Functions]
[./forcing_fn]
type = PiecewiseLinear
x = '0.0 0.1 0.2 0.3 0.4 0.5 0.6'
y = '0.0 0.0 0.0025 0.01 0.0175 0.02 0.02'
[../]
[]
[Kernels]
[./ie]
type = ADTimeDerivative
variable = u
[../]
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
[./left]
type = ADFunctionDirichletBC
variable = u
preset = false
boundary = 'left'
function = forcing_fn
[../]
[./right]
type = ADFunctionDirichletBC
variable = u
preset = false
boundary = 'right'
function = forcing_fn
[../]
[]
[Executioner]
type = Transient
# Time integrator scheme
scheme = "newmark-beta"
start_time = 0.0
num_steps = 6
dt = 0.1
[]
[Postprocessors]
[./udotdot]
type = ADElementAverageSecondTimeDerivative
variable = u
[../]
[]
[Outputs]
csv = true
[]
(test/tests/materials/coupled_value_function/adjac.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
[]
[]
[Variables]
[u]
initial_condition = 0.1
[]
[v]
initial_condition = 0.1
[]
[]
[Materials]
[Du]
type = ADCoupledValueFunctionMaterial
function = x
v = v
prop_name = Du
[]
[Dv]
type = ADCoupledValueFunctionMaterial
function = x^2
v = u
prop_name = Dv
[]
[]
[Kernels]
[diff_u]
type = ADMatDiffusion
diffusivity = Du
variable = u
[]
[dudt]
type = ADTimeDerivative
variable = u
[]
[diff_v]
type = ADMatDiffusion
diffusivity = Dv
variable = v
[]
[dvdt]
type = ADTimeDerivative
variable = v
[]
[]
[BCs]
[u_left]
type = DirichletBC
boundary = left
variable = u
value = 1
[]
[u_right]
type = DirichletBC
boundary = right
variable = u
value = 0.1
[]
[v_top]
type = DirichletBC
boundary = top
variable = v
value = 1
[]
[v_bottom]
type = DirichletBC
boundary = bottom
variable = v
value = 0.1
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
dt = 0.1
num_steps = 4
[]
[Outputs]
exodus = true
[]
(modules/stochastic_tools/examples/batch/sub.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
ny = 10
nz = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[time]
type = ADTimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[average]
type = AverageNodalVariableValue
variable = u
[]
[]
[Executioner]
type = Transient
num_steps = 1
dt = 0.25
solve_type = NEWTON
[]
[Controls]
[receiver]
type = SamplerReceiver
[]
[]
[Outputs]
[]
(modules/heat_transfer/test/tests/ad_convective_heat_flux/coupled.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
[]
[Variables]
[./temp]
initial_condition = 200.0
[../]
[]
[Kernels]
[./heat_dt]
type = ADTimeDerivative
variable = temp
[../]
[./heat_conduction]
type = Diffusion
variable = temp
[../]
[./heat]
type = ADBodyForce
variable = temp
value = 0
[../]
[]
[BCs]
[./right]
type = ADConvectiveHeatFluxBC
variable = temp
boundary = 'right'
T_infinity = T_inf
heat_transfer_coefficient = htc
[../]
[]
[Materials]
[chf_mat]
type = ADConvectiveHeatFluxTest
temperature = temp
boundary = 'right'
[]
[]
[Postprocessors]
[./left_temp]
type = SideAverageValue
variable = temp
boundary = left
execute_on = 'TIMESTEP_END initial'
[../]
[./right_temp]
type = SideAverageValue
variable = temp
boundary = right
[../]
[./right_flux]
type = SideDiffusiveFluxAverage
variable = temp
boundary = right
diffusivity = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 1
nl_abs_tol = 1e-12
[]
[Outputs]
[./out]
type = CSV
time_step_interval = 10
[../]
[]
(test/tests/kernels/ad_transient_diffusion/ad_transient_diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = ADTimeDerivative
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 20
dt = 0.1
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(modules/phase_field/test/tests/ADCHSoretDiffusion/simple_transient_diffusion_with_soret.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
[]
[Variables]
[./c]
[../]
[./mu]
[../]
[]
[AuxVariables]
[./T]
[./InitialCondition]
type = RampIC
value_left = 900
value_right = 1000
[../]
[../]
[]
[Kernels]
[./conc]
type = ADCHSplitConcentration
variable = c
chemical_potential_var = mu
mobility = chemical_mobility_prop
[../]
[./chempot]
type = ADCHSplitChemicalPotential
variable = mu
chemical_potential = mu_prop
[../]
[./soret]
type = ADCHSoretMobility
variable = c
T = T
mobility = thermal_mobility_prop
[../]
[./time]
type = ADTimeDerivative
variable = c
[../]
[]
[Materials]
[./chemical_potential]
type = ADPiecewiseLinearInterpolationMaterial
property = mu_prop
variable = c
x = '0 1'
y = '0 1'
[../]
[./chemical_mobility_prop]
type = ADGenericConstantMaterial
prop_names = chemical_mobility_prop
prop_values = 0.1
[../]
[./thermal_mobility_prop]
type = ADGenericConstantMaterial
prop_names = thermal_mobility_prop
prop_values = -20
[../]
[]
[BCs]
[./leftc]
type = DirichletBC
variable = c
boundary = left
value = 0
[../]
[./rightc]
type = DirichletBC
variable = c
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_grmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 2'
dt = 0.1
num_steps = 20
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/misc/ad_robustness/ad_two_nl_var_transient_diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[v][]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = ADTimeDerivative
variable = u
[../]
[coupled]
type = ADCoupledValueTest
variable = u
v = v
[]
[v_diff]
type = Diffusion
variable = v
[]
[]
[DGKernels]
[dummy]
type = ADDGCoupledTest
variable = u
v = v
[]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[./left_v]
type = DirichletBC
variable = v
boundary = left
value = 0
[../]
[./right_v]
type = DirichletBC
variable = v
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 0.1
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[dof_map]
type = DOFMap
execute_on = 'initial'
[]
[]
(modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_temperature/phy.parent.i)
# This tests a transfer of temperature values computed by master app and used by a child app
# as a heat structure boundary condition
[Mesh]
type = GeneratedMesh
dim = 1
xmax = 1
nx = 10
[]
[Functions]
[T_bc_fn]
type = ParsedFunction
expression = '300+t*x*10'
[]
[T_ffn]
type = ParsedFunction
expression = 'x*10'
[]
[]
[Variables]
[T]
[]
[]
[ICs]
[T_ic]
type = ConstantIC
variable = T
value = 300
[]
[]
[Kernels]
[td]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADDiffusion
variable = T
[]
[ffn]
type = BodyForce
variable = T
function = T_ffn
[]
[]
[BCs]
[left]
type = FunctionDirichletBC
variable = T
boundary = 'left right'
function = T_bc_fn
[]
[]
[Executioner]
type = Transient
dt = 0.1
num_steps = 2
nl_abs_tol = 1e-10
abort_on_solve_fail = true
solve_type = NEWTON
[]
[MultiApps]
[thm]
type = TransientMultiApp
app_type = ThermalHydraulicsApp
input_files = phy.child.i
execute_on = 'initial timestep_end'
[]
[]
[Transfers]
[T_to_thm]
type = MultiAppGeneralFieldNearestLocationTransfer
to_multi_app = thm
source_variable = T
variable = T_ext
to_boundaries = 'hs:outer'
[]
[]
[Outputs]
exodus = true
show = 'T'
[]
(test/tests/outputs/xml/xml_iterations.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
[]
[Variables/u]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[time]
type = ADTimeDerivative
variable = u
[]
[]
[Functions/function]
type = ParsedFunction
expression = 2*x
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 2
[]
[]
[Executioner]
type = Transient
num_steps = 2
solve_type = NEWTON
[]
[VectorPostprocessors]
[line]
type = LineFunctionSampler
functions = function
start_point = '0 0 0'
end_point = '1 0 0'
num_points = 5
sort_by = x
execute_on = 'LINEAR'
[]
[]
[Outputs]
[out]
type = XMLOutput
execute_on = 'LINEAR NONLINEAR'
[]
[]
(modules/phase_field/test/tests/phase_field_kernels/ADAllenCahn.i)
#
# Test the forward automatic differentiation Allen-Cahn Bulk kernel
#
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 12
ymax = 12
elem_type = QUAD4
[]
[Variables]
[./eta]
order = FIRST
family = LAGRANGE
[./InitialCondition]
type = SmoothCircleIC
x1 = 0.0
y1 = 0.0
radius = 6.0
invalue = 0.9
outvalue = 0.1
int_width = 3.0
[../]
[../]
[]
[Kernels]
[./detadt]
type = ADTimeDerivative
variable = eta
[../]
[./ACBulk]
type = ADAllenCahn
variable = eta
f_name = F
[../]
[./ACInterface]
type = ADACInterface
variable = eta
kappa_name = 1
variable_L = false
[../]
[]
[Materials]
[./consts]
type = ADGenericConstantMaterial
prop_names = 'L'
prop_values = '1'
[../]
[./free_energy]
type = ADTestDerivativeFunction
function = F1
f_name = F
op = 'eta'
[../]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
solve_type = 'NEWTON'
num_steps = 2
dt = 0.5
[]
[Outputs]
exodus = true
[]
(modules/stochastic_tools/test/tests/multiapps/batch_full_solve_multiapp/sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[time]
type = ADTimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[average]
type = AverageNodalVariableValue
variable = u
[]
[]
[Executioner]
type = Transient
num_steps = 1
dt = 0.25
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(test/tests/coord_type/coord_type_rz_general.i)
# Tests using different coordinate systems in different blocks:
# block1: XYZ translated by (0,-1,0)
# block2: RZ with origin=(0,0,0) and direction=(0,1,0)
# block3: RZ with origin=(0,0,1) and direction=(1,0,0)
# block4: RZ with origin=(-1,-2,-3) and direction=(1,1,0)
#
# A transient heat conduction equation is solved with uniform properties.
# The same power is applied to each block via a uniform heat flux boundary
# condition on the outer cylindrical surface (top surface for block1).
# Conservation is checked for each via post-processors.
# Blocks block2, block3, and block4 should have identical solutions.
rho = 1000.0
cp = 500.0
k = 15.0
length = 1.5
radius = 0.5
perimeter = ${fparse 2 * pi * radius}
nz = 10
nr = 5
power = 1e3
heat_flux = ${fparse power / (perimeter * length)}
[Mesh]
# block1
[genmesh1]
type = GeneratedMeshGenerator
dim = 2
nx = ${nz}
ny = ${nr}
xmin = 0.0
xmax = ${length}
ymin = -1.0
ymax = ${fparse -1.0 + radius}
boundary_id_offset = 10
[]
[renumberblock1]
type = RenameBlockGenerator
input = genmesh1
old_block = 0
new_block = 1
[]
[renameblock1]
type = RenameBlockGenerator
input = renumberblock1
old_block = 1
new_block = block1
[]
[renameboundary1]
type = RenameBoundaryGenerator
input = renameblock1
old_boundary = '10 11 12 13'
new_boundary = 'bottom1 right1 top1 left1'
[]
# block2
[genmesh2]
type = GeneratedMeshGenerator
dim = 2
nx = ${nr}
ny = ${nz}
xmin = 0.0
xmax = ${radius}
ymin = 0
ymax = ${length}
boundary_id_offset = 20
[]
[renumberblock2]
type = RenameBlockGenerator
input = genmesh2
old_block = 0
new_block = 2
[]
[renameblock2]
type = RenameBlockGenerator
input = renumberblock2
old_block = 2
new_block = block2
[]
[renameboundary2]
type = RenameBoundaryGenerator
input = renameblock2
old_boundary = '20 21 22 23'
new_boundary = 'bottom2 right2 top2 left2'
[]
# block3
[genmesh3]
type = GeneratedMeshGenerator
dim = 2
nx = ${nz}
ny = ${nr}
xmin = 0.0
xmax = ${length}
ymin = 0
ymax = ${radius}
boundary_id_offset = 30
[]
[translate3]
type = TransformGenerator
input = genmesh3
transform = TRANSLATE
vector_value = '0 0 1'
[]
[renumberblock3]
type = RenameBlockGenerator
input = translate3
old_block = 0
new_block = 3
[]
[renameblock3]
type = RenameBlockGenerator
input = renumberblock3
old_block = 3
new_block = block3
[]
[renameboundary3]
type = RenameBoundaryGenerator
input = renameblock3
old_boundary = '30 31 32 33'
new_boundary = 'bottom3 right3 top3 left3'
[]
# block4
[genmesh4]
type = GeneratedMeshGenerator
dim = 2
nx = ${nz}
ny = ${nr}
xmin = 0.0
xmax = ${length}
ymin = 0
ymax = ${radius}
boundary_id_offset = 40
[]
[rotate4]
type = TransformGenerator
input = genmesh4
transform = ROTATE
vector_value = '45 0 0'
[]
[translate4]
type = TransformGenerator
input = rotate4
transform = TRANSLATE
vector_value = '-1 -2 -3'
[]
[renumberblock4]
type = RenameBlockGenerator
input = translate4
old_block = 0
new_block = 4
[]
[renameblock4]
type = RenameBlockGenerator
input = renumberblock4
old_block = 4
new_block = block4
[]
[renameboundary4]
type = RenameBoundaryGenerator
input = renameblock4
old_boundary = '40 41 42 43'
new_boundary = 'bottom4 right4 top4 left4'
[]
[combiner]
type = CombinerGenerator
inputs = 'renameboundary1 renameboundary2 renameboundary3 renameboundary4'
[]
coord_block = 'block1 block2 block3 block4'
coord_type = 'XYZ RZ RZ RZ'
rz_coord_blocks = 'block2 block3 block4'
rz_coord_origins = '0 0 0
0 0 1
-1 -2 -3'
rz_coord_directions = '0 1 0
1 0 0
1 1 0'
[]
[Variables]
[T]
family = LAGRANGE
order = FIRST
[]
[]
[Functions]
[T_ic_fn]
type = ParsedFunction
expression = 'x'
[]
[theoretical_energy_added_fn]
type = ParsedFunction
expression = '${power} * t'
[]
[]
[ICs]
[T_ic]
type = FunctionIC
variable = T
function = T_ic_fn
[]
[]
[Kernels]
[time_derivative]
type = ADTimeDerivative
variable = T
[]
[heat_conduction]
type = CoefDiffusion
variable = T
coef = ${fparse k / (rho * cp)}
[]
[]
[BCs]
[heat_flux_bc]
type = ADFunctionNeumannBC
variable = T
boundary = 'top1 right2 top3 top4'
# The heat conduction equation has been divided by rho*cp
function = '${fparse heat_flux / (rho * cp)}'
[]
[]
[Postprocessors]
[theoretical_energy_change]
type = FunctionValuePostprocessor
function = theoretical_energy_added_fn
execute_on = 'INITIAL TIMESTEP_END'
[]
# block1 conservation
[T_integral1]
type = ElementIntegralVariablePostprocessor
variable = T
block = 'block1'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy1]
type = ParsedPostprocessor
pp_names = 'T_integral1'
expression = 'T_integral1 * ${rho} * ${cp} * ${perimeter}'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change1]
type = ChangeOverTimePostprocessor
postprocessor = energy1
change_with_respect_to_initial = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change_error1]
type = RelativeDifferencePostprocessor
value1 = energy_change1
value2 = theoretical_energy_change
execute_on = 'INITIAL TIMESTEP_END'
[]
# block2 conservation
[T_integral2]
type = ElementIntegralVariablePostprocessor
variable = T
block = 'block2'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy2]
type = ParsedPostprocessor
pp_names = 'T_integral2'
expression = 'T_integral2 * ${rho} * ${cp}'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change2]
type = ChangeOverTimePostprocessor
postprocessor = energy2
change_with_respect_to_initial = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change_error2]
type = RelativeDifferencePostprocessor
value1 = energy_change2
value2 = theoretical_energy_change
execute_on = 'INITIAL TIMESTEP_END'
[]
# block3 conservation
[T_integral3]
type = ElementIntegralVariablePostprocessor
variable = T
block = 'block3'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy3]
type = ParsedPostprocessor
pp_names = 'T_integral3'
expression = 'T_integral3 * ${rho} * ${cp}'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change3]
type = ChangeOverTimePostprocessor
postprocessor = energy3
change_with_respect_to_initial = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change_error3]
type = RelativeDifferencePostprocessor
value1 = energy_change3
value2 = theoretical_energy_change
execute_on = 'INITIAL TIMESTEP_END'
[]
# block4 conservation
[T_integral4]
type = ElementIntegralVariablePostprocessor
variable = T
block = 'block4'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy4]
type = ParsedPostprocessor
pp_names = 'T_integral4'
expression = 'T_integral4 * ${rho} * ${cp}'
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change4]
type = ChangeOverTimePostprocessor
postprocessor = energy4
change_with_respect_to_initial = true
execute_on = 'INITIAL TIMESTEP_END'
[]
[energy_change_error4]
type = RelativeDifferencePostprocessor
value1 = energy_change4
value2 = theoretical_energy_change
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
dt = 1.0
num_steps = 10
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-10
[]
[Outputs]
file_base = 'coord_type_rz_general'
[console]
type = Console
show = 'energy_change_error1 energy_change_error2 energy_change_error3 energy_change_error4'
[]
[exodus]
type = Exodus
show = 'T energy_change_error1 energy_change_error2 energy_change_error3 energy_change_error4'
[]
[]
(modules/optimization/test/tests/reporter/TransientSyntheticDataCreator/transient_synthetic_data.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
dim = 2
nx = 16
ny = 16
xmin = 0
xmax = 1
ymin = 0
ymax = 1
[]
[]
[Variables/u]
[]
[Functions]
[rxn_func]
type = ParsedFunction
expression = 'exp(x * y) - 1'
[]
[]
[Materials]
[ad_dc_prop]
type = ADParsedMaterial
expression = '1 + u'
coupled_variables = 'u'
property_name = dc_prop
[]
[ad_rxn_prop]
type = ADGenericFunctionMaterial
prop_values = 'rxn_func'
prop_names = rxn_prop
[]
[ad_neg_rxn_prop]
type = ADParsedMaterial
expression = '-rxn_prop'
material_property_names = 'rxn_prop'
property_name = 'neg_rxn_prop'
[]
[]
[Kernels]
[udot]
type = ADTimeDerivative
variable = u
[]
[diff]
type = ADMatDiffusion
variable = u
diffusivity = dc_prop
[]
[reaction]
type = ADMatReaction
variable = u
reaction_rate = neg_rxn_prop
[]
[src]
type = ADBodyForce
variable = u
value = 1
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'left bottom'
value = 0
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
dt = 0.1
end_time = 1
[]
[Reporters]
[sample]
type = TransientSyntheticDataCreator
variable = u
single_set_of_measurement_points = '
0.75 0.75 0
0.9375 0.9375 0
1 0.9375 0
1 1 0'
measurement_times_for_all_points = '0.1 0.2 0.3'
[]
[]
[AuxVariables]
[reaction_rate]
[]
[]
[AuxKernels]
[reaction_rate_aux]
type = FunctionAux
variable = reaction_rate
function = rxn_func
execute_on = TIMESTEP_END
[]
[]
[Outputs]
[csv]
type = CSV
execute_on = 'FINAL'
[]
[]
(modules/optimization/examples/diffusion_reaction/forward_exact.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
dim = 2
nx = 16
ny = 16
xmin = 0
xmax = 1
ymin = 0
ymax = 1
[]
[]
[Variables/u]
[]
[Functions]
[rxn_func]
type = ParsedFunction
expression = 'exp(x * y) - 1'
[]
[]
[Materials]
[ad_dc_prop]
type = ADParsedMaterial
expression = '1 + u'
coupled_variables = 'u'
property_name = dc_prop
[]
[ad_rxn_prop]
type = ADGenericFunctionMaterial
prop_values = 'rxn_func'
prop_names = rxn_prop
outputs = exodus
[]
#ADMatReaction includes a negative sign in residual evaluation, so we need to
#reverse this with a negative reaction rate. However, we wanted the parameter
#to remain positive in the optimization problem so we do the same thing here,
#which is why there is one object to evaluate function and another to flip
#it's sign for the kernel
[ad_neg_rxn_prop]
type = ADParsedMaterial
expression = '-rxn_prop'
material_property_names = 'rxn_prop'
property_name = 'neg_rxn_prop'
[]
[]
[Kernels]
[udot]
type = ADTimeDerivative
variable = u
[]
[diff]
type = ADMatDiffusion
variable = u
diffusivity = dc_prop
[]
[reaction]
type = ADMatReaction
variable = u
reaction_rate = neg_rxn_prop
[]
[src]
type = ADBodyForce
variable = u
value = 1
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'left bottom'
value = 0
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
dt = 0.1
end_time = 1
[]
[Reporters]
[sample]
type = TransientSyntheticDataCreator
variable = u
single_set_of_measurement_points = '0.625 0.625 0 0.5 0.5 0 0.25 0.25 0
0.875 0.625 0 0.625 0.875 0 0.75 0.25 0 0.25 0.75 0 0.8125 0.9375 0
0.75 0.75 0
0.8125 0.75 0
0.875 0.75 0
0.9375 0.75 0
1 0.75 0
0.8125 0.8125 0
0.875 0.8125 0
0.9375 0.8125 0
1 0.8125 0
0.875 0.875 0
0.9375 0.875 0
1 0.875 0
0.9375 0.9375 0
1 0.9375 0
1 1 0'
measurement_times_for_all_points = '0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0'
outputs = csv_final
[]
[]
[AuxVariables]
[reaction_rate]
[]
[]
[AuxKernels]
[reaction_rate_aux]
type = FunctionAux
variable = reaction_rate
function = rxn_func
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[u1]
type = PointValue
variable = u
point = '0.25 0.25 0'
[]
[u2]
type = PointValue
variable = u
point = '0.75 0.75 0'
[]
[u3]
type = PointValue
variable = u
point = '1 1 0'
[]
[]
[Outputs]
exodus = true
csv = true
[csv_final]
type = CSV
execute_on = 'FINAL'
file_base = forward_exact_csv
[]
[]
(modules/phase_field/test/tests/GrandPotentialPFM/GrandPotentialMultiphase_AD.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
xmin = -20
xmax = 20
ymin = -20
ymax = 20
[]
[GlobalParams]
op_num = 2
var_name_base = etab
[]
[Variables]
[w]
[]
[etaa0]
[]
[etab0]
[]
[etab1]
[]
[]
[AuxVariables]
[bnds]
order = FIRST
family = LAGRANGE
[]
[]
[ICs]
[IC_etaa0]
type = FunctionIC
variable = etaa0
function = ic_func_etaa0
[]
[IC_etab0]
type = FunctionIC
variable = etab0
function = ic_func_etab0
[]
[IC_etab1]
type = FunctionIC
variable = etab1
function = ic_func_etab1
[]
[IC_w]
type = ConstantIC
value = -0.05
variable = w
[]
[]
[Functions]
[ic_func_etaa0]
type = ADParsedFunction
value = 'r:=sqrt(x^2+y^2);0.5*(1.0-tanh((r-10.0)/sqrt(2.0)))'
[]
[ic_func_etab0]
type = ADParsedFunction
value = 'r:=sqrt(x^2+y^2);0.5*(1.0+tanh((r-10)/sqrt(2.0)))*0.5*(1.0+tanh((y)/sqrt(2.0)))'
[]
[ic_func_etab1]
type = ADParsedFunction
value = 'r:=sqrt(x^2+y^2);0.5*(1.0+tanh((r-10)/sqrt(2.0)))*0.5*(1.0-tanh((y)/sqrt(2.0)))'
[]
[]
[BCs]
[]
[Kernels]
# Order parameter eta_alpha0
[ACa0_bulk]
type = ADACGrGrMulti
variable = etaa0
v = 'etab0 etab1'
gamma_names = 'gab gab'
[]
[ACa0_sw]
type = ADACSwitching
variable = etaa0
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
[]
[ACa0_int]
type = ADACInterface
variable = etaa0
kappa_name = kappa
variable_L = false
[]
[ea0_dot]
type = ADTimeDerivative
variable = etaa0
[]
# Order parameter eta_beta0
[ACb0_bulk]
type = ADACGrGrMulti
variable = etab0
v = 'etaa0 etab1'
gamma_names = 'gab gbb'
[]
[ACb0_sw]
type = ADACSwitching
variable = etab0
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
[]
[ACb0_int]
type = ADACInterface
variable = etab0
kappa_name = kappa
variable_L = false
[]
[eb0_dot]
type = ADTimeDerivative
variable = etab0
[]
# Order parameter eta_beta1
[ACb1_bulk]
type = ADACGrGrMulti
variable = etab1
v = 'etaa0 etab0'
gamma_names = 'gab gbb'
[]
[ACb1_sw]
type = ADACSwitching
variable = etab1
Fj_names = 'omegaa omegab'
hj_names = 'ha hb'
[]
[ACb1_int]
type = ADACInterface
variable = etab1
kappa_name = kappa
variable_L = false
[]
[eb1_dot]
type = ADTimeDerivative
variable = etab1
[]
#Chemical potential
[w_dot]
type = ADSusceptibilityTimeDerivative
variable = w
f_name = chi
[]
[Diffusion]
type = ADMatDiffusion
variable = w
diffusivity = Dchi
[]
[coupled_etaa0dot]
type = ADCoupledSwitchingTimeDerivative
variable = w
v = etaa0
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
args = 'etaa0 etab0 etab1'
[]
[coupled_etab0dot]
type = ADCoupledSwitchingTimeDerivative
variable = w
v = etab0
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
args = 'etaa0 etab0 etab1'
[]
[coupled_etab1dot]
type = ADCoupledSwitchingTimeDerivative
variable = w
v = etab1
Fj_names = 'rhoa rhob'
hj_names = 'ha hb'
args = 'etaa0 etab0 etab1'
[]
[]
[AuxKernels]
[BndsCalc]
type = BndsCalcAux
variable = bnds
execute_on = timestep_end
[]
[]
# enable_jit set to false in many materials to make this test start up faster.
# It is recommended to set enable_jit = true or just remove these lines for
# production runs with this model
[Materials]
[ha]
type = ADSwitchingFunctionMultiPhaseMaterial
h_name = ha
all_etas = 'etaa0 etab0 etab1'
phase_etas = 'etaa0'
[]
[hb]
type = ADSwitchingFunctionMultiPhaseMaterial
h_name = hb
all_etas = 'etaa0 etab0 etab1'
phase_etas = 'etab0 etab1'
[]
[omegaa]
type = ADDerivativeParsedMaterial
args = 'w'
f_name = omegaa
material_property_names = 'Vm ka caeq'
expression = '-0.5*w^2/Vm^2/ka-w/Vm*caeq'
derivative_order = 2
[]
[omegab]
type = ADDerivativeParsedMaterial
args = 'w'
f_name = omegab
material_property_names = 'Vm kb cbeq'
expression = '-0.5*w^2/Vm^2/kb-w/Vm*cbeq'
derivative_order = 2
[]
[rhoa]
type = ADDerivativeParsedMaterial
args = 'w'
f_name = rhoa
material_property_names = 'Vm ka caeq'
expression = 'w/Vm^2/ka + caeq/Vm'
derivative_order = 2
[]
[rhob]
type = ADDerivativeParsedMaterial
args = 'w'
f_name = rhob
material_property_names = 'Vm kb cbeq'
expression = 'w/Vm^2/kb + cbeq/Vm'
derivative_order = 2
[]
[const]
type = ADGenericConstantMaterial
prop_names = 'kappa_c kappa L D chi Vm ka caeq kb cbeq gab gbb mu'
prop_values = '0 1 1.0 1.0 1.0 1.0 10.0 0.1 10.0 0.9 4.5 1.5 1.0'
[]
[Mobility]
type = ADDerivativeParsedMaterial
f_name = Dchi
material_property_names = 'D chi'
expression = 'D*chi'
derivative_order = 2
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = bdf2
solve_type = NEWTON
petsc_options_iname = '-pc_type '
petsc_options_value = 'lu '
l_tol = 1.0e-3
nl_rel_tol = 1.0e-8
nl_abs_tol = 1e-8
num_steps = 2
[TimeStepper]
type = SolutionTimeAdaptiveDT
dt = 0.1
[]
[]
[Outputs]
exodus = true
file_base = GrandPotentialMultiphase_out
[]
(modules/stochastic_tools/examples/parameter_study/diffusion_vector.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables/T]
initial_condition = 300
[]
[Kernels]
[time]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADMatDiffusion
variable = T
diffusivity = diffusivity
[]
[source]
type = ADBodyForce
variable = T
value = 100
function = 1
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = T
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = T
boundary = right
value = -100
[]
[]
[Materials/constant]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.25
[]
[Postprocessors]
[T_avg]
type = ElementAverageValue
variable = T
execute_on = 'initial timestep_end'
[]
[q_left]
type = ADSideDiffusiveFluxAverage
variable = T
boundary = left
diffusivity = diffusivity
execute_on = 'initial timestep_end'
[]
[]
[Reporters]
[acc]
type = AccumulateReporter
reporters = 'T_avg/value q_left/value'
[]
[]
[Controls/stochastic]
type = SamplerReceiver
[]
[Outputs]
[]
(test/tests/kernels/ad_jacobians/adfunction.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
displacements = 'disp_x disp_y'
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[c]
[]
[disp_x]
[]
[disp_y]
[]
[]
[Kernels]
[source]
type = ADBodyForce
variable = c
function = source_func
use_displaced_mesh = true
displacements = ''
#displacements = 'disp_x disp_y'
[]
[dt]
type = ADTimeDerivative
variable = c
[]
[]
[Functions]
[source_func]
type = ParsedFunction
expression = 'x + y^2'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
num_steps = 1
[]
(test/tests/multiapps/full_solve_multiapp_reset/sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[../]
[td]
type = ADTimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.25
solve_type = 'NEWTON'
[]
(test/tests/kernels/ad_jacobians/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./damage_dt]
type = ADTimeDerivative
variable = u
[../]
[./damage]
type = ADBodyForce
value = 1
variable = u
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
num_steps = 1
[]
(modules/optimization/examples/simpleTransient/nonlinear_forward_and_adjoint.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = -1
xmax = 1
ymin = -1
ymax = 1
[]
[]
[Variables]
[u]
[]
[]
[VectorPostprocessors]
[src_values]
type = CSVReader
csv_file = source_params.csv
header = true
outputs = none
[]
[]
[ICs]
[initial]
type = FunctionIC
variable = u
function = exact
[]
[]
[Kernels]
[dt]
type = ADTimeDerivative
variable = u
[]
[diff]
type = ADMatDiffusion
variable = u
diffusivity = D
[]
[src]
type = ADBodyForce
variable = u
function = source
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'left right top bottom'
value = 0
[]
[]
[Materials]
[diffc]
type = ADParsedMaterial
property_name = D
expression = '1 + u'
coupled_variables = u
[]
[]
[Functions]
[exact]
type = ParsedFunction
value = '2*exp(-2.0*(x - sin(2*pi*t))^2)*exp(-2.0*(y - cos(2*pi*t))^2)*cos((1/2)*x*pi)*cos((1/2)*y*pi)/pi'
[]
[source]
type = NearestReporterCoordinatesFunction
x_coord_name = src_values/coordx
y_coord_name = src_values/coordy
time_name = src_values/time
value_name = src_values/values
[]
[]
[Executioner]
type = TransientAndAdjoint
forward_system = nl0
adjoint_system = adjoint
num_steps = 100
end_time = 1
nl_rel_tol = 1e-12
l_tol = 1e-12
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
[Reporters]
[measured_data]
type = OptimizationData
measurement_file = mms_data.csv
file_xcoord = x
file_ycoord = y
file_zcoord = z
file_time = t
file_value = u
variable = u
execute_on = timestep_end
outputs = none
[]
[]
[Postprocessors]
[topRight_pp]
type = PointValue
point = '0.5 0.5 0'
variable = u
execute_on = TIMESTEP_END
[]
[bottomRight_pp]
type = PointValue
point = '-0.5 0.5 0'
variable = u
execute_on = TIMESTEP_END
[]
[bottomLeft_pp]
type = PointValue
point = '-0.5 -0.5 0'
variable = u
execute_on = TIMESTEP_END
[]
[topLeft_pp]
type = PointValue
point = '0.5 -0.5 0'
variable = u
execute_on = TIMESTEP_END
[]
[]
[Outputs]
csv = true
console = false
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
[]
[Variables]
[u_adjoint]
solver_sys = adjoint
outputs = none
[]
[]
[DiracKernels]
[misfit]
type = ReporterTimePointSource
variable = u_adjoint
value_name = measured_data/misfit_values
x_coord_name = measured_data/measurement_xcoord
y_coord_name = measured_data/measurement_ycoord
z_coord_name = measured_data/measurement_zcoord
time_name = measured_data/measurement_time
[]
[]
[VectorPostprocessors]
[adjoint]
type = ElementOptimizationSourceFunctionInnerProduct
variable = u_adjoint
function = source
execute_on = ADJOINT_TIMESTEP_END
outputs = none
[]
[]
(modules/phase_field/test/tests/ADCHSplitChemicalPotential/simple_transient_diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 10
[]
[Variables]
[./c]
[../]
[./mu]
[../]
[]
[Kernels]
[./conc]
type = ADCHSplitConcentration
variable = c
chemical_potential_var = mu
mobility = mobility_prop
[../]
[./chempot]
type = ADCHSplitChemicalPotential
variable = mu
chemical_potential = mu_prop
[../]
[./time]
type = ADTimeDerivative
variable = c
[../]
[]
[Materials]
[./chemical_potential]
type = ADPiecewiseLinearInterpolationMaterial
property = mu_prop
variable = c
x = '0 1'
y = '0 1'
[../]
[./mobility_prop]
type = ADGenericConstantMaterial
prop_names = mobility_prop
prop_values = 0.1
[../]
[]
[BCs]
[./leftc]
type = DirichletBC
variable = c
boundary = left
value = 0
[../]
[./rightc]
type = DirichletBC
variable = c
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type -ksp_grmres_restart -sub_ksp_type -sub_pc_type -pc_asm_overlap'
petsc_options_value = 'asm 31 preonly lu 2'
dt = 0.1
num_steps = 20
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Outputs]
exodus = true
[]
(modules/optimization/examples/diffusion_reaction/forward_and_adjoint.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
dim = 2
nx = 16
ny = 16
xmin = 0
xmax = 1
ymin = 0
ymax = 1
[]
[]
[Variables/u]
[]
[Reporters]
[params]
type = ConstantReporter
real_vector_names = 'reaction_rate'
real_vector_values = '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0' # Dummy
outputs = none
[]
[data]
type = OptimizationData
variable = u
measurement_file = forward_exact_csv_sample_0011.csv
file_xcoord = measurement_xcoord
file_ycoord = measurement_ycoord
file_zcoord = measurement_zcoord
file_time = measurement_time
file_value = simulation_values
outputs = none
[]
[]
[Functions]
[rxn_func]
type = ParameterMeshFunction
exodus_mesh = parameter_mesh_out.e
parameter_name = params/reaction_rate
[]
[]
[Materials]
[ad_dc_prop]
type = ADParsedMaterial
expression = '1 + u'
coupled_variables = 'u'
property_name = dc_prop
[]
[ad_rxn_prop]
type = ADGenericFunctionMaterial
prop_values = 'rxn_func'
prop_names = rxn_prop
[]
#ADMatReaction includes a negative sign in residual evaluation, so we need to
#reverse this with a negative reaction rate. However, we wanted the parameter
#to remain positive, which is why there is one object to evaluate function
#and another to flip it's sign for the kernel
[ad_neg_rxn_prop]
type = ADParsedMaterial
expression = '-rxn_prop'
material_property_names = 'rxn_prop'
property_name = 'neg_rxn_prop'
[]
[]
[Kernels]
[udot]
type = ADTimeDerivative
variable = u
[]
[diff]
type = ADMatDiffusion
variable = u
diffusivity = dc_prop
[]
[reaction]
type = ADMatReaction
variable = u
reaction_rate = neg_rxn_prop
[]
[src]
type = ADBodyForce
variable = u
value = 1
[]
[]
[BCs]
[dirichlet]
type = DirichletBC
variable = u
boundary = 'left bottom'
value = 0
[]
[]
[Executioner]
type = TransientAndAdjoint
forward_system = nl0
adjoint_system = adjoint
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
dt = 0.1
end_time = 1
nl_rel_tol = 1e-12
[]
[Problem]
nl_sys_names = 'nl0 adjoint'
kernel_coverage_check = false
skip_nl_system_check = true
[]
[Variables]
[u_adjoint]
initial_condition = 0
solver_sys = adjoint
outputs = none
[]
[]
[DiracKernels]
[misfit]
type = ReporterTimePointSource
variable = u_adjoint
value_name = data/misfit_values
x_coord_name = data/measurement_xcoord
y_coord_name = data/measurement_ycoord
z_coord_name = data/measurement_zcoord
time_name = data/measurement_time
[]
[]
[VectorPostprocessors]
[adjoint]
type = ElementOptimizationReactionFunctionInnerProduct
variable = u_adjoint
forward_variable = u
function = rxn_func
execute_on = ADJOINT_TIMESTEP_END
outputs = none
[]
[]
[AuxVariables]
[reaction_rate]
[]
[]
[AuxKernels]
[reaction_rate_aux]
type = FunctionAux
variable = reaction_rate
function = rxn_func
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[u1]
type = PointValue
variable = u
point = '0.25 0.25 0'
[]
[u2]
type = PointValue
variable = u
point = '0.75 0.75 0'
[]
[u3]
type = PointValue
variable = u
point = '1 1 0'
[]
[]
[Outputs]
exodus = true
console = false
csv = true
[]
(modules/phase_field/test/tests/anisotropic_mobility/ad_diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 15
ny = 15
xmax = 15.0
ymax = 15.0
[]
[Variables]
[./c]
[./InitialCondition]
type = CrossIC
x1 = 0.0
x2 = 30.0
y1 = 0.0
y2 = 30.0
[../]
[../]
[]
[Kernels]
[./cres]
type = ADMatAnisoDiffusion
diffusivity = D
variable = c
[../]
[./time]
type = ADTimeDerivative
variable = c
[../]
[]
[Materials]
[./D]
type = ADConstantAnisotropicMobility
tensor = '0.1 0 0
0 1 0
0 0 0'
M_name = D
[../]
[]
[Executioner]
type = Transient
scheme = 'BDF2'
solve_type = 'NEWTON'
l_max_its = 30
l_tol = 1.0e-4
nl_max_its = 50
nl_rel_tol = 1.0e-10
dt = 10.0
num_steps = 2
[]
[Outputs]
exodus = true
print_linear_residuals = true
perf_graph = true
[]
(modules/xfem/test/tests/moving_interface/ad_phase_transition_2d.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 11
ny = 1
xmin = 0.0
xmax = 20.0
ymin = 0.0
ymax = 5.0
elem_type = QUAD4
[]
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[velocity]
type = XFEMPhaseTransitionMovingInterfaceVelocity
diffusivity_at_positive_level_set = 5
diffusivity_at_negative_level_set = 1
equilibrium_concentration_jump = 1
value_at_interface_uo = value_uo
[]
[value_uo]
type = NodeValueAtXFEMInterface
variable = 'u'
interface_mesh_cut_userobject = 'cut_mesh'
execute_on = TIMESTEP_END
level_set_var = ls
[]
[cut_mesh]
type = InterfaceMeshCut2DUserObject
mesh_file = flat_interface_1d.e
interface_velocity_uo = velocity
heal_always = true
[]
[]
[Variables]
[u]
[]
[]
[ICs]
[ic_u]
type = FunctionIC
variable = u
function = 'if(x<5.01, 2, 1)'
[]
[]
[AuxVariables]
[ls]
order = FIRST
family = LAGRANGE
[]
[]
[Constraints]
[u_constraint]
type = XFEMEqualValueAtInterface
geometric_cut_userobject = 'cut_mesh'
use_displaced_mesh = false
variable = u
value = 2
alpha = 1e6
[]
[]
[Kernels]
[diff]
type = ADMatDiffusion
variable = u
diffusivity = diffusion_coefficient
[]
[time]
type = ADTimeDerivative
variable = u
[]
[]
[AuxKernels]
[ls]
type = MeshCutLevelSetAux
mesh_cut_user_object = cut_mesh
variable = ls
execute_on = 'TIMESTEP_BEGIN'
[]
[]
[Materials]
[diffusivity_A]
type = ADGenericConstantMaterial
prop_names = A_diffusion_coefficient
prop_values = 5
[]
[diffusivity_B]
type = ADGenericConstantMaterial
prop_names = B_diffusion_coefficient
prop_values = 1
[]
[diff_combined]
type = ADLevelSetBiMaterialReal
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = diffusion_coefficient
[]
[]
[BCs]
# Define boundary conditions
[left_u]
type = ADDirichletBC
variable = u
value = 2
boundary = left
[]
[right_u]
type = ADNeumannBC
variable = u
boundary = right
value = 0
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
l_tol = 1e-3
nl_max_its = 15
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
start_time = 0.0
dt = 1
num_steps = 5
max_xfem_update = 1
[]
[Outputs]
file_base = phase_transition_2d_out
execute_on = timestep_end
exodus = true
perf_graph = true
[]
(test/tests/time_integrators/central-difference/ad_central_difference_dotdot.i)
###########################################################
# This is a simple test with a time-dependent problem
# demonstrating the use of the TimeIntegrator system.
#
# Testing that the second time derivative is calculated
# correctly using the Central Difference method for an AD
# variable.
#
###########################################################
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 1
ny = 1
[]
[Variables]
[./u]
[../]
[]
[Functions]
[./forcing_fn]
type = PiecewiseLinear
x = '0.0 0.1 0.2 0.3 0.4 0.5 0.6'
y = '0.0 0.0 0.0025 0.01 0.0175 0.02 0.02'
[../]
[]
[Kernels]
[./ie]
type = ADTimeDerivative
variable = u
[../]
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
[./left]
type = ADFunctionDirichletBC
variable = u
boundary = 'left'
function = forcing_fn
preset = false
[../]
[./right]
type = ADFunctionDirichletBC
variable = u
boundary = 'right'
function = forcing_fn
preset = false
[../]
[]
[Executioner]
type = Transient
[./TimeIntegrator]
type = CentralDifference
[]
start_time = 0.0
num_steps = 6
dt = 0.1
[]
[Postprocessors]
[./udotdot]
type = ElementAverageSecondTimeDerivative
variable = u
[../]
[]
[Outputs]
csv = true
[]
(test/tests/bcs/mat_neumann_bc/ad_mat_neumann.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmax = 10
ymax = 10
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[AuxVariables]
[./phi]
[../]
[]
[ICs]
[./phi_IC]
type = FunctionIC
variable = phi
function = ic_func_phi
[../]
[]
[Functions]
[./ic_func_phi]
type = ParsedFunction
expression = '0.5 * (1 - tanh((x - 5) / 0.8))'
[../]
[]
[BCs]
[./top]
type = ADMatNeumannBC
variable = u
boundary = top
value = 2
boundary_material = hm
[../]
[]
[Kernels]
[./dudt]
type = ADTimeDerivative
variable = u
[../]
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[Materials]
[./hm]
type = ADParsedMaterial
property_name = hm
coupled_variables = 'phi'
expression = '3*phi^2 - 2*phi^3'
outputs = exodus
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
end_time = 10
[]
[Outputs]
exodus = true
[]
(modules/stochastic_tools/examples/parameter_study/diffusion_time.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables/T]
initial_condition = 300
[]
[Kernels]
[time]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADMatDiffusion
variable = T
diffusivity = diffusivity
[]
[source]
type = ADBodyForce
variable = T
value = 100
function = 1
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = T
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = T
boundary = right
value = -100
[]
[]
[Materials/constant]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.25
[]
[Postprocessors]
[T_avg]
type = ElementAverageValue
variable = T
execute_on = 'initial timestep_end'
[]
[q_left]
type = ADSideDiffusiveFluxAverage
variable = T
boundary = left
diffusivity = diffusivity
execute_on = 'initial timestep_end'
[]
[]
[VectorPostprocessors]
[T_vec]
type = LineValueSampler
variable = T
start_point = '0 0.5 0'
end_point = '1 0.5 0'
num_points = 11
sort_by = x
execute_on = 'initial timestep_end'
[]
[]
[Controls/stochastic]
type = SamplerReceiver
[]
[Outputs]
[]
(python/mms/test/mms_temporal.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 8
ny = 8
[]
[Variables]
[u][]
[]
[Kernels]
[time]
type = ADTimeDerivative
variable = u
[]
[diff]
type = ADDiffusion
variable = u
[]
[force]
type = BodyForce
variable = u
function = force
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 't^3*x*y'
[]
[force]
type = ParsedFunction
expression = '3*x*y*t^2'
[]
[]
[BCs]
[all]
type = FunctionDirichletBC
variable = u
function = exact
boundary = 'left right top bottom'
[]
[]
[Postprocessors]
[error]
type = ElementL2Error
function = exact
variable = u
[]
[h]
type = AverageElementSize
[]
[]
[Executioner]
type = Transient
dt = 1
end_time = 3
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
csv = true
[]
(modules/phase_field/test/tests/ad_coupled_gradient_dot/diffusion_rate.i)
# Solves the problem
# -mu * Lap(u_dot) + u_dot = alpha * Lap(u) - 2*u*(1-3*u+2*u^2)
# for mu = 1 and alpha = 0.01
# (see appendix B of A. Guevel et al. "Viscous phase-field modeling for chemo-mechanical microstructural evolution: application to geomaterials and pressure solution." In print.)
n_elem = 100
alpha = 0.01
mu = 1
[Mesh]
type = GeneratedMesh
dim = 1
xmin = 0
xmax = 1
nx = '${n_elem}'
elem_type = EDGE2
[]
[Variables]
[u]
[InitialCondition]
type = ConstantIC
value = 0.51
[]
[]
[]
[Kernels]
[Lap]
type = ADMatDiffusion
variable = u
diffusivity = '${alpha}'
[]
[LapDot]
type = ADDiffusionRate
variable = u
mu = '${mu}'
[]
[Reac]
type = ADMatReaction
variable = u
reaction_rate = L
[]
[Visc]
type = ADTimeDerivative
variable = u
[]
[]
[Materials]
[parsed]
type = ADParsedMaterial
expression = '-2*(1-3*u+2*u*u)'
coupled_variables = 'u'
property_name = 'L'
[]
[]
[BCs]
[both]
type = ADDirichletBC
variable = u
value = 0.51
boundary = 'left right'
[]
[]
[Postprocessors]
[mid_u]
type = PointValue
variable = u
point = '0.5 0 0'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
num_steps = 1000
dt = 0.1
nl_abs_tol = 1e-9
[]
[Outputs]
print_linear_residuals = false
[csv]
type = CSV
file_base = 'diffusion_rate'
[]
[]
(modules/stochastic_tools/examples/parameter_study/diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables/T]
initial_condition = 300
[]
[Kernels]
[time]
type = ADTimeDerivative
variable = T
[]
[diff]
type = ADMatDiffusion
variable = T
diffusivity = diffusivity
[]
[source]
type = ADBodyForce
variable = T
value = 100
function = 1
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = T
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = T
boundary = right
value = -100
[]
[]
[Materials/constant]
type = ADGenericConstantMaterial
prop_names = 'diffusivity'
prop_values = 1
[]
[Executioner]
type = Transient
num_steps = 4
dt = 0.25
[]
[Postprocessors]
[T_avg]
type = ElementAverageValue
variable = T
execute_on = 'initial timestep_end'
[]
[q_left]
type = ADSideDiffusiveFluxAverage
variable = T
boundary = left
diffusivity = diffusivity
execute_on = 'initial timestep_end'
[]
[]
[Controls/stochastic]
type = SamplerReceiver
[]
[Outputs]
[]
(modules/heat_transfer/test/tests/ad_convective_heat_flux/equilibrium.i)
[Mesh]
type = GeneratedMesh
dim = 3
nx = 10
[]
[Variables]
[./temp]
initial_condition = 200.0
[../]
[]
[Kernels]
[./heat_dt]
type = ADTimeDerivative
variable = temp
[../]
[./heat_conduction]
type = ADDiffusion
variable = temp
[../]
[]
[BCs]
[./right]
type = ADConvectiveHeatFluxBC
variable = temp
boundary = 'right'
T_infinity = 100.0
heat_transfer_coefficient = 1
[../]
[]
[Postprocessors]
[./left_temp]
type = SideAverageValue
variable = temp
boundary = left
execute_on = 'TIMESTEP_END initial'
[../]
[./right_temp]
type = SideAverageValue
variable = temp
boundary = right
[../]
[./right_flux]
type = SideDiffusiveFluxAverage
variable = temp
boundary = right
diffusivity = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 10
dt = 1e1
nl_abs_tol = 1e-12
[]
[Outputs]
[./out]
type = CSV
time_step_interval = 10
[../]
[]
(test/tests/reporters/iteration_info/iteration_info.i)
[Mesh]
[generate]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Variables/u][]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[time]
type = ADTimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 10
[]
[]
[Executioner]
type = Transient
num_steps = 3
dt = 1
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Reporters/iteration_info]
type = IterationInfo
[]
[Outputs]
[out]
type = JSON
[]
[]
(test/tests/misc/ad_robustness/ad_two_var_transient_diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[AuxVariables]
[v][]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = ADTimeDerivative
variable = u
[../]
[coupled]
type = ADCoupledValueTest
variable = u
v = v
[]
[]
[DGKernels]
[dummy]
type = ADDGCoupledTest
variable = u
v = v
[]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 0.1
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(test/tests/misc/ad_robustness/ad_two_nl_var_transient_diffusion_jac.i)
penalty=1
[Mesh]
type = GeneratedMesh
dim = 1
nx = 2
[]
[Variables]
[./u]
family = MONOMIAL
order = FIRST
[../]
[v]
family = MONOMIAL
order = FIRST
[]
[]
[Kernels]
[./diff]
type = CoefDiffusion
variable = u
coef = 0.1
[../]
[./time]
type = ADTimeDerivative
variable = u
[../]
[coupled]
type = ADCoupledValueTest
variable = u
v = v
[]
[v_diff]
type = Diffusion
variable = v
[]
[]
[DGKernels]
[dummy]
type = ADDGCoupledTest
variable = u
v = v
[]
[]
[BCs]
[./left]
type = PenaltyDirichletBC
variable = u
boundary = left
value = 0
penalty = ${penalty}
[../]
[./right]
type = PenaltyDirichletBC
variable = u
boundary = right
value = 1
penalty = ${penalty}
[../]
[./left_v]
type = PenaltyDirichletBC
variable = v
boundary = left
value = 0
penalty = ${penalty}
[../]
[./right_v]
type = PenaltyDirichletBC
variable = v
boundary = right
value = 1
penalty = ${penalty}
[../]
[]
[Executioner]
type = Transient
num_steps = 2
dt = 0.1
dtmin = 0.1
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[dof_map]
type = DOFMap
execute_on = 'initial'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
(modules/heat_transfer/include/kernels/ADHeatConductionTimeDerivative.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "ADTimeDerivative.h"
class ADHeatConductionTimeDerivative : public ADTimeDerivative
{
public:
static InputParameters validParams();
ADHeatConductionTimeDerivative(const InputParameters & parameters);
protected:
virtual ADReal precomputeQpResidual() override;
/// Specific heat material property
const ADMaterialProperty<Real> & _specific_heat;
/// Density material property
const ADMaterialProperty<Real> & _density;
};
(modules/navier_stokes/include/kernels/INSADHeatConductionTimeDerivative.h)
// This file is part of the MOOSE framework
// https://www.mooseframework.org
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "ADTimeDerivative.h"
class INSADHeatConductionTimeDerivative : public ADTimeDerivative
{
public:
static InputParameters validParams();
INSADHeatConductionTimeDerivative(const InputParameters & parameters);
protected:
ADReal precomputeQpResidual() override;
const ADMaterialProperty<Real> & _temperature_td_strong_residual;
};