- 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
ADDiffusion
Description
The steady-state diffusion equation on a domain is defined as
The weak form of this equation, in inner-product notation, is given by:
where are the test functions and is the finite element solution of the weak formulation.
The Jacobian in ADDiffusion
is computed using forward automatic differentiation.
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_tagssystemThe tag for the matrices this Kernel should fill
Default:system
C++ Type:MultiMooseEnum
Options:nontime, system
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsnontimeThe tag for the vectors this Kernel should fill
Default:nontime
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
- (test/tests/kernels/ad_coupled_value/ad_aux_coupled_time_value.i)
- (test/tests/kernels/ad_mat_coupled_force/aux_test.i)
- (modules/heat_transfer/test/tests/ad_heat_conduction/test.i)
- (test/tests/kernels/ad_vector_couple/ad_vector_couple_default.i)
- (test/tests/materials/derivative_material_interface/ad_construction_order.i)
- (test/tests/multiapps/auto_diff_auto_scaling/main.i)
- (test/tests/kernels/ad_2d_diffusion/2d_diffusion_test.i)
- (test/tests/bcs/ad_bcs/ad_bc.i)
- (test/tests/outputs/xml/xml_iterations.i)
- (test/tests/bcs/ad_function_dirichlet_bc/test.i)
- (test/tests/kernels/ad_scalar_kernel_constraint/scalar_constraint_together.i)
- (test/tests/bcs/ad_matched_value_bc/test.i)
- (modules/thermal_hydraulics/test/tests/materials/ad_average_wall_temperature_3eqn/ad_average_wall_temperature_3eqn.i)
- (test/tests/kernels/jxw_grad_test_dep_on_displacements/not-handling-jxw.i)
- (test/tests/time_integrators/central-difference/ad_central_difference_dotdot.i)
- (test/tests/bcs/ad_bc_preset_nodal/bc_preset_nodal.i)
- (test/tests/kernels/jxw_grad_test_dep_on_displacements/jxw-spherical.i)
- (test/tests/kernels/ad_mat_reaction/ad_mat_reaction.i)
- (modules/heat_transfer/test/tests/ad_convective_heat_flux/equilibrium.i)
- (test/tests/kernels/ad_mat_coupled_force/fe_test.i)
- (modules/combined/test/tests/ad_cavity_pressure/additional_volume.i)
- (test/tests/kernels/diffusion_with_hanging_node/ad_simple_diffusion.i)
- (modules/combined/test/tests/ad_cavity_pressure/multiple_postprocessors.i)
- (modules/phase_field/test/tests/anisotropic_interfaces/adkobayashi.i)
- (modules/stochastic_tools/test/tests/actions/parameter_study_action/sub_not_controllable.i)
- (test/tests/misc/multiple-nl-systems/ad-test.i)
- (test/tests/tag/tag_ad_kernels.i)
- (test/tests/mortar/ad_periodic_segmental_constraint/penalty_periodic_simple2d.i)
- (test/tests/bcs/coupled_var_neumann/ad_coupled_var_neumann_nl.i)
- (modules/combined/test/tests/ad_cavity_pressure/3d.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/kernels/kernel_precompute/adkernel_precompute_test.i)
- (examples/ex14_pps/ex14.i)
- (modules/stochastic_tools/test/tests/multiapps/transient_with_full_solve/sub.i)
- (modules/stochastic_tools/examples/batch/sub.i)
- (test/tests/mortar/ad_periodic_segmental_constraint/testperiodicsole.i)
- (tutorials/darcy_thermo_mech/step01_diffusion/problems/step1.i)
- (test/tests/bcs/ad_coupled_lower_value/together.i)
- (test/tests/fvkernels/fv_simple_diffusion/dirichlet.i)
- (test/tests/mortar/ad_periodic_segmental_constraint/penalty_periodic_simple3d.i)
- (test/tests/kernels/ad_vector_couple/ad_grad_vector_couple.i)
- (test/tests/bcs/ad_bc_preset_nodal/bc_function_preset.i)
- (test/tests/mortar/displaced-gap-conductance-2d-non-conforming/gap-conductance.i)
- (test/tests/kernels/ad_coupled_force/aux_test.i)
- (modules/solid_mechanics/test/tests/ad_thermal_expansion_function/mean_complex.i)
- (test/tests/bcs/mat_neumann_bc/ad_mat_neumann.i)
- (test/tests/kernels/body_force/ad_mat_forcing_function_test.i)
- (modules/solid_mechanics/test/tests/ad_linear_elasticity/tensor.i)
- (test/tests/kernels/jxw_grad_test_dep_on_displacements/jxw-cylindrical.i)
- (modules/stochastic_tools/test/tests/actions/parameter_study_action/sub.i)
- (python/mms/test/mms_temporal.i)
- (test/tests/reporters/iteration_info/iteration_info.i)
- (modules/solid_mechanics/test/tests/ad_thermal_expansion_function/instantaneous_complex.i)
- (modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_convection/plate.parent.i)
- (test/tests/kernels/ad_simple_diffusion/ad_simple_diffusion.i)
- (test/tests/nodalkernels/constraint_enforcement/ad-upper-and-lower-bound.i)
- (modules/thermal_hydraulics/test/tests/materials/ad_wall_heat_transfer_coefficient_3eqn_dittus_boelter/test.i)
- (test/tests/kernels/ad_2d_diffusion/2d_diffusion_bodyforce_test.i)
- (modules/solid_mechanics/test/tests/ad_linear_elasticity/linear_elastic_material.i)
- (test/tests/kernels/ad_coupled_convection/ad_coupled_convection.i)
- (test/tests/kernels/ad_scalar_kernel_constraint/scalar_constraint_kernel_RJ.i)
- (test/tests/materials/derivative_sum_material/ad_random_ic.i)
- (test/tests/misc/displaced_mesh_coupling/ad.i)
- (modules/combined/test/tests/thermo_mech/ad-youngs_modulus_function_temp.i)
- (test/tests/fvkernels/fv_simple_diffusion/dirichlet-constrained-average-value.i)
- (modules/stochastic_tools/test/tests/multiapps/conditional_run/sub.i)
- (modules/combined/test/tests/ad_cavity_pressure/rz.i)
- (test/tests/transfers/multiapp_nearest_node_transfer/cached_multiple_apps/child.i)
- (test/tests/misc/max_var_n_dofs_per_elem/max_var_n_dofs_per_elem.i)
- (python/pyhit/tests/input.i)
- (test/tests/reporters/iteration_info/iteration_info_steady.i)
- (test/tests/multiapps/auto_diff_auto_scaling/sub.i)
- (test/tests/parser/map_param/test.i)
- (test/tests/fvkernels/fv_simple_diffusion/neumann.i)
- (test/tests/transfers/multiapp_nearest_node_transfer/cached_multiple_apps/main.i)
- (modules/combined/test/tests/thermal_elastic/ad-thermal_elastic.i)
- (test/tests/kernels/ad_coupled_force/fe_test.i)
- (test/tests/bcs/ad_penalty_dirichlet_bc/function_penalty_dirichlet_bc_test.i)
- (modules/misc/test/tests/kernels/thermo_diffusion/ad_thermo_diffusion.i)
- (modules/misc/test/tests/ad_arrhenius_material_property/exact.i)
- (test/tests/mortar/ad_periodic_segmental_constraint/penalty_periodic_checker2d.i)
- (modules/phase_field/examples/anisotropic_interfaces/ad_snow.i)
- (test/tests/kernels/ad_vector_couple/ad_vector_couple.i)
- (test/tests/geomsearch/quadrature_nearest_node_locator/qnnl_ad.i)
- (test/tests/kernels/ad_reaction/ad_reaction.i)
- (python/mms/test/mms_spatial.i)
- (test/tests/time_integrators/newmark-beta/ad_newmark_beta_dotdot.i)
- (test/tests/kernels/ad_2d_diffusion/2d_diffusion_neumannbc_test.i)
- (modules/thermal_hydraulics/test/tests/components/hs_boundary_external_app_temperature/phy.parent.i)
- (test/tests/bcs/ad_penalty_dirichlet_bc/penalty_dirichlet_bc_test.i)
- (test/tests/materials/ad_piecewise_linear_interpolation_material/piecewise_linear_interpolation_material.i)
- (modules/stochastic_tools/test/tests/multiapps/batch_full_solve_multiapp/sub.i)
- (test/tests/multiapps/full_solve_multiapp_reset/sub.i)
- (modules/combined/test/tests/ad_cavity_pressure/initial_temperature.i)
- (python/pyhit/tests/input_modified.i)
- (tutorials/tutorial01_app_development/step02_input_file/problems/pressure_diffusion.i)
- (test/tests/preconditioners/auto_smp/ad_coupled_convection.i)
Child Objects
(test/tests/kernels/ad_coupled_value/ad_aux_coupled_time_value.i)
###########################################################
# This is a simple test of coupling an aux variable into the
# ADCoupledTimeDerivative kernel.
# The expected solution for the variable v is
# v(x) = 1/2 * (x^2 + x)
###########################################################
[Mesh]
type = GeneratedMesh
nx = 5
ny = 5
dim = 2
[]
[Variables]
[./v]
[../]
[]
[AuxVariables]
[./u]
[../]
[]
[Functions]
[./u]
type = ParsedFunction
expression = 't'
[../]
[]
[AuxKernels]
[./u]
type = FunctionAux
variable = u
function = u
[../]
[]
[Kernels]
[./time_v]
type = ADCoupledTimeDerivative
variable = v
v = u
[../]
[./diff_v]
type = ADDiffusion
variable = v
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = v
boundary = 'left'
value = 0
[../]
[./right]
type = DirichletBC
variable = v
boundary = 'right'
value = 1
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[]
[]
[Postprocessors]
[./l2]
type = ElementL2Error
variable = v
function = '1/2 * (x^2 + x)'
[../]
[]
[Executioner]
type = Transient
num_steps = 1
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/ad_mat_coupled_force/aux_test.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 4
ny = 4
dim = 2
[]
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[a]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[force]
type = ADMatCoupledForce
variable = u
v = a
mat_prop_coef = test_prop
[]
[]
[AuxKernels]
[a]
variable = a
type = ConstantAux
value = 10
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = ADDirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Functions]
[test_func]
type = ParsedFunction
expression = 'x'
[]
[]
[Materials]
[test_prop]
type = ADGenericFunctionMaterial
prop_names = test_prop
prop_values = test_func
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
(modules/heat_transfer/test/tests/ad_heat_conduction/test.i)
# This test solves a 1D transient heat equation with a complicated thermal
# conductivity in order to verify jacobian calculation via AD
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmax = 0.001
ymax = 0.001
[]
[Variables]
[./T]
initial_condition = 1.5
[../]
[./c]
initial_condition = 1.5
[../]
[]
[Kernels]
[./HeatDiff]
type = ADHeatConduction
variable = T
thermal_conductivity = thermal_conductivity
[../]
[./heat_dt]
type = ADHeatConductionTimeDerivative
variable = T
specific_heat = thermal_conductivity
density_name = thermal_conductivity
[../]
[./c]
type = ADDiffusion
variable = c
[../]
[]
[Kernels]
[./c_dt]
type = TimeDerivative
variable = c
[../]
[]
[BCs]
[./left_c]
type = DirichletBC
variable = c
boundary = left
value = 2
[../]
[./right_c]
type = DirichletBC
variable = c
boundary = right
value = 1
[../]
[./left_T]
type = DirichletBC
variable = T
boundary = top
value = 1
[../]
[./right_T]
type = DirichletBC
variable = T
boundary = bottom
value = 2
[../]
[]
[Materials]
[./k]
type = ADThermalConductivityTest
c = c
temperature = T
[../]
[]
[Preconditioning]
[./full]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
num_steps = 1
[]
(test/tests/kernels/ad_vector_couple/ad_vector_couple_default.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
[]
[Variables]
[u]
family = LAGRANGE
order = FIRST
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
[]
[diff]
type = ADDiffusion
variable = u
[]
[convection]
type = ADCoupledVectorConvection
variable = u
velocity_vector = '0 1'
[]
[]
[BCs]
[left]
type = ADFunctionDirichletBC
variable = u
function = 1
boundary = 'left'
[]
[right]
type = ADFunctionDirichletBC
variable = u
function = 2
boundary = 'bottom'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
num_steps = 10
dt = 0.1
[]
[Outputs]
execute_on = TIMESTEP_END
exodus = true
[]
(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
[]
(test/tests/multiapps/auto_diff_auto_scaling/main.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = FunctionDirichletBC
variable = u
boundary = right
function = 't'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
num_steps = 2
solve_type = 'Newton'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
automatic_scaling = true
verbose = true
[]
[Outputs]
exodus = true
[]
[MultiApps]
[sub_app]
type = TransientMultiApp
app_type = MooseTestApp
input_files = 'sub.i'
positions = '0 0 0'
[]
[]
(test/tests/kernels/ad_2d_diffusion/2d_diffusion_test.i)
###########################################################
# This is a simple test of the Kernel System.
# It solves the Laplacian equation on a small 2x2 grid.
# The "Diffusion" kernel is used to calculate the
# residuals of the weak form of this operator.
#
# @Requirement F3.30
###########################################################
[Mesh]
[./square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[../]
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
active = 'diff'
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
active = 'left right'
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 1
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
file_base = out
exodus = true
[]
(test/tests/bcs/ad_bcs/ad_bc.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = ADFunctionDirichletBC
variable = u
boundary = left
function = '1'
[]
[right]
type = ADRobinBC
variable = u
boundary = right
coefficient = 2.0
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(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'
[]
[]
(test/tests/bcs/ad_function_dirichlet_bc/test.i)
###########################################################
# This is a test of Boundary Condition System. The
# FunctionDirichletBC is used to contribute the residuals
# to the boundary term operators in the weak form.
#
# @Requirement F3.40
###########################################################
[Mesh]
[./square]
type = GeneratedMeshGenerator
dim = 2
nx = 32
ny = 32
[../]
[]
[Variables]
[./u]
[../]
[]
[Functions]
[./ff_1]
type = ParsedFunction
expression = alpha*alpha*pi
symbol_names = 'alpha'
symbol_values = '16'
[../]
[./ff_2]
type = ParsedFunction
expression = pi*sin(alpha*pi*x)
symbol_names = 'alpha'
symbol_values = '16'
[../]
[./forcing_func]
type = CompositeFunction
functions = 'ff_1 ff_2'
[../]
[./bc_func]
type = ParsedFunction
expression = sin(alpha*pi*x)
symbol_names = 'alpha'
symbol_values = '16'
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
[../]
[./forcing]
type = ADBodyForce
variable = u
function = forcing_func
[../]
[]
[BCs]
[./all]
type = ADFunctionDirichletBC
variable = u
boundary = 'left right'
function = bc_func
[../]
[]
[Executioner]
type = Steady
nl_rel_tol = 1e-12
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/kernels/ad_scalar_kernel_constraint/scalar_constraint_together.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = QUAD9
[]
[Functions]
[exact_fn]
type = ParsedFunction
value = 'x*x+y*y'
[]
[ffn]
type = ParsedFunction
value = -4
[]
[bottom_bc_fn]
type = ParsedFunction
value = -2*y
[]
[right_bc_fn]
type = ParsedFunction
value = 2*x
[]
[top_bc_fn]
type = ParsedFunction
value = 2*y
[]
[left_bc_fn]
type = ParsedFunction
value = -2*x
[]
[]
[Variables]
[u]
family = LAGRANGE
order = SECOND
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[ffnk]
type = ADBodyForce
variable = u
function = ffn
[]
[sk_lm]
type = ADScalarLMKernel
variable = u
kappa = lambda
pp_name = pp
value = 2.666666666666666
[]
[]
[Problem]
kernel_coverage_check = false
error_on_jacobian_nonzero_reallocation = true
[]
[BCs]
[bottom]
type = ADFunctionNeumannBC
variable = u
boundary = 'bottom'
function = bottom_bc_fn
[]
[right]
type = ADFunctionNeumannBC
variable = u
boundary = 'right'
function = right_bc_fn
[]
[top]
type = ADFunctionNeumannBC
variable = u
boundary = 'top'
function = top_bc_fn
[]
[left]
type = ADFunctionNeumannBC
variable = u
boundary = 'left'
function = left_bc_fn
[]
[]
[Postprocessors]
# integrate the volume of domain since original objects set
# int(phi)=V0, rather than int(phi-V0)=0
[pp]
type = FunctionElementIntegral
function = 1
execute_on = initial
[]
[l2_err]
type = ElementL2Error
variable = u
function = exact_fn
execute_on = 'initial timestep_end'
[]
[]
[Executioner]
type = Steady
residual_and_jacobian_together = true
nl_rel_tol = 1e-9
l_tol = 1.e-10
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
solve_type = NEWTON
[]
[Outputs]
# exodus = true
csv = true
hide = lambda
[]
(test/tests/bcs/ad_matched_value_bc/test.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[]
# Solves a pair of coupled diffusion equations where u=v on the boundary
[Variables]
[u]
order = FIRST
family = LAGRANGE
initial_condition = 3
[]
[v]
order = FIRST
family = LAGRANGE
initial_condition = 2
[]
[]
[Kernels]
[diff_u]
type = ADDiffusion
variable = u
[]
[diff_v]
type = ADDiffusion
variable = v
[]
[]
[BCs]
[right_v]
type = ADDirichletBC
variable = v
boundary = 1
value = 3
[]
[left_u]
type = ADMatchedValueBC
variable = u
boundary = 3
v = v
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_rel_tol = 1e-10
l_tol = 1e-12
[]
[Outputs]
file_base = out
exodus = true
[]
(modules/thermal_hydraulics/test/tests/materials/ad_average_wall_temperature_3eqn/ad_average_wall_temperature_3eqn.i)
# Tests the average wall temperature aux for 1-phase flow. With the following
# inputs, the value should be equal to 1.25:
#
# i h_wall T_wall P_hf
# --------------------------
# 1 10 26/10 1
# 2 6 1/2 3
#
# T_fluid = 1/4
#
# With these values,
# P_tot = 1 + 3 = 4
# h_wall_avg = (1 * 10 + 3 * 6) / 4 = 28 / 4 = 7
# denominator = P_tot * h_wall_avg = 4 * 7 = 28
# numerator = 10 * (26/10 - 1/4) * 1 + 6 * (1/2 - 1/4) * 3 = 28
# T_wall_avg = T_fluid + numerator / denominator = 1/4 + 1
#
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
allow_renumbering = false
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[AuxVariables]
[Hw_avg]
family = MONOMIAL
order = CONSTANT
[]
[T_wall_avg]
family = MONOMIAL
order = CONSTANT
[]
[T_wall1]
family = MONOMIAL
order = CONSTANT
[]
[T_wall2]
family = MONOMIAL
order = CONSTANT
[]
[P_hf1]
family = MONOMIAL
order = CONSTANT
[]
[P_hf2]
family = MONOMIAL
order = CONSTANT
[]
[P_hf_total]
family = MONOMIAL
order = CONSTANT
[]
[T_fluid]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[T_wall_avg_auxkernel]
type = ADMaterialRealAux
variable = T_wall_avg
property = T_wall
[]
[T_wall1_auxkernel]
type = ConstantAux
variable = T_wall1
value = 2.6
[]
[T_wall2_auxkernel]
type = ConstantAux
variable = T_wall2
value = 0.5
[]
[P_hf_total_auxkernel]
type = SumAux
variable = P_hf_total
values = 'P_hf1 P_hf2'
[]
[P_hf1_auxkernel]
type = ConstantAux
variable = P_hf1
value = 1
[]
[P_hf2_auxkernel]
type = ConstantAux
variable = P_hf2
value = 3
[]
[T_fluid_auxkernel]
type = ConstantAux
variable = T_fluid
value = 0.25
[]
[]
[Materials]
[const_materials]
type = ADGenericConstantMaterial
prop_names = 'Hw1 Hw2'
prop_values = '10 6'
[]
[Hw_avg_material]
type = ADWeightedAverageMaterial
prop_name = Hw_avg
values = 'Hw1 Hw2'
weights = 'P_hf1 P_hf2'
[]
[T_wall_avg_material]
type = ADAverageWallTemperature3EqnMaterial
T_wall_sources = 'T_wall1 T_wall2'
Hw_sources = 'Hw1 Hw2'
P_hf_sources = 'P_hf1 P_hf2'
T_fluid = T_fluid
Hw_average = Hw_avg
P_hf_total = P_hf_total
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[T_wall_avg_pp]
type = ElementalVariableValue
elementid = 0
variable = T_wall_avg
[]
[]
[Outputs]
csv = true
execute_on = timestep_end
[]
(test/tests/kernels/jxw_grad_test_dep_on_displacements/not-handling-jxw.i)
[GlobalParams]
displacements = 'disp_x disp_y'
order = SECOND
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
elem_type = QUAD9
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./u]
order = FIRST
[../]
[./v]
[../]
[]
[Kernels]
[./disp_x]
type = Diffusion
variable = disp_x
[../]
[./disp_y]
type = Diffusion
variable = disp_y
[../]
[./u]
type = ADDiffusion
variable = u
use_displaced_mesh = true
[../]
[./v]
type = ADDiffusion
variable = v
use_displaced_mesh = true
[../]
[]
[BCs]
# BCs cannot be preset due to Jacobian test
[./u_left]
type = DirichletBC
preset = false
value = 0
boundary = 'left'
variable = u
[../]
[./u_right]
type = DirichletBC
preset = false
value = 1
boundary = 'right'
variable = u
[../]
[./v_left]
type = DirichletBC
preset = false
value = 0
boundary = 'left'
variable = v
[../]
[./v_right]
type = DirichletBC
preset = false
value = 1
boundary = 'right'
variable = v
[../]
[./disp_x_left]
type = DirichletBC
preset = false
value = 0
boundary = 'left'
variable = disp_x
[../]
[./disp_x_right]
type = DirichletBC
preset = false
value = 1
boundary = 'right'
variable = disp_x
[../]
[./disp_y_left]
type = DirichletBC
preset = false
value = 0
boundary = 'bottom'
variable = disp_y
[../]
[./disp_y_right]
type = DirichletBC
preset = false
value = 1
boundary = 'top'
variable = disp_y
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
[./dofmap]
type = DOFMap
execute_on = 'initial'
[../]
[]
[ICs]
[./disp_x]
type = RandomIC
variable = disp_x
min = 0.01
max = 0.09
[../]
[./disp_y]
type = RandomIC
variable = disp_y
min = 0.01
max = 0.09
[../]
[./u]
type = RandomIC
variable = u
min = 0.1
max = 0.9
[../]
[./v]
type = RandomIC
variable = v
min = 0.1
max = 0.9
[../]
[]
(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/ad_bc_preset_nodal/bc_preset_nodal.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
nz = 0
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
active = 'diff'
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
active = 'left right'
# We will use preset BCs
[./left]
type = ADDirichletBC
variable = u
boundary = 3
value = 0
[../]
[./right]
type = ADDirichletBC
variable = u
boundary = 1
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
file_base = bc_preset_out
exodus = true
[]
(test/tests/kernels/jxw_grad_test_dep_on_displacements/jxw-spherical.i)
[GlobalParams]
displacements = 'disp_r'
order = SECOND
[]
[Mesh]
type = GeneratedMesh
dim = 1
nx = 3
elem_type = EDGE3
[]
[Problem]
coord_type = RSPHERICAL
[]
[Variables]
[./disp_r]
[../]
[./u]
order = FIRST
[../]
[]
[Kernels]
[./disp_r]
type = Diffusion
variable = disp_r
[../]
[./u]
type = ADDiffusion
variable = u
use_displaced_mesh = true
[../]
[]
[BCs]
# BCs cannot be preset due to Jacobian tests
[./u_left]
type = DirichletBC
preset = false
value = 0
boundary = 'left'
variable = u
[../]
[./u_right]
type = DirichletBC
preset = false
value = 1
boundary = 'right'
variable = u
[../]
[./disp_r_left]
type = DirichletBC
preset = false
value = 0
boundary = 'left'
variable = disp_r
[../]
[./disp_r_right]
type = DirichletBC
preset = false
value = 1
boundary = 'right'
variable = disp_r
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
[./dofmap]
type = DOFMap
execute_on = 'initial'
[../]
[]
[ICs]
[./disp_r]
type = RandomIC
variable = disp_r
min = 0.01
max = 0.09
[../]
[./u]
type = RandomIC
variable = u
min = 0.1
max = 0.9
[../]
[]
(test/tests/kernels/ad_mat_reaction/ad_mat_reaction.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
xmin = 0
xmax = 1
ymin = 0
ymax = 1
[]
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[]
[Materials]
[ad_prop]
type = ADParsedMaterial
expression = '-log(3)*log(3)'
property_name = rxn_prop
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[reaction]
type = ADMatReaction
variable = u
reaction_rate = rxn_prop
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 1
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 3
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(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/kernels/ad_mat_coupled_force/fe_test.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 4
ny = 4
dim = 2
[]
[]
[Variables]
[u]
[]
[v]
[]
[]
[Kernels]
[diff_u]
type = ADDiffusion
variable = u
[]
[force_u]
type = ADMatCoupledForce
variable = u
v = v
mat_prop_coef = test_prop
[]
[diff_v]
type = ADDiffusion
variable = v
[]
[]
[BCs]
[left_u]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right_u]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[left_v]
type = DirichletBC
variable = v
boundary = left
value = 5
[]
[right_v]
type = DirichletBC
variable = v
boundary = right
value = 3
[]
[]
[Functions]
[test_func]
type = ParsedFunction
expression = 'x'
[]
[]
[Materials]
[test_prop]
type = ADGenericFunctionMaterial
prop_names = test_prop
prop_values = test_func
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/ad_cavity_pressure/additional_volume.i)
#
# Cavity Pressure Test using using automatic differentiation
#
# This test is designed to compute an internal pressure based on
# p = n * R * / (V_cavity / T_cavity + V_add / T_add)
# where
# p is the pressure
# n is the amount of material in the volume (moles)
# R is the universal gas constant
# T_cavity is the temperature in the cavity
# T_add is the temperature of the additional volume
#
# The mesh is composed of one block (1) with an interior cavity of volume 8.
# Block 2 sits in the cavity and has a volume of 1. Thus, the total
# initial volume is 7. An additional volume of 2 is added.
#
# The test adjusts n, T, and V in the following way:
# n => n0 + alpha * t
# T => T0 + beta * t
# V => V_cavity0 + gamma * t + V_add
# with
# alpha = n0
# beta = T0 / 2
# gamma = -(0.003322259...) * V0
# T0 = 240.54443866068704
# V_cavity0 = 7
# V_add = 2
# T_add = 100
# n0 = f(p0)
# p0 = 100
# R = 8.314472 J * K^(-1) * mol^(-1)
#
# An additional volume of 2 with a temperature of 100.0 is included.
#
# So, n0 = p0 * (V_cavity / T_cavity + V_add / T_add) / R
# = 100 * (7 / 240.544439 + 2 / 100) / 8.314472
# = 0.59054
#
# The parameters combined at t = 1 gives p = 249.647.
#
# This test sets the initial temperature to 500, but the CavityPressure
# is told that that initial temperature is T0. Thus, the final solution
# is unchanged.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
file = 3d.e
[]
[GlobalParams]
volumetric_locking_correction = true
[]
[Functions]
[displ_positive]
type = PiecewiseLinear
x = '0 1'
y = '0 0.0029069767441859684'
[]
[displ_negative]
type = PiecewiseLinear
x = '0 1'
y = '0 -0.0029069767441859684'
[]
[temp1]
type = PiecewiseLinear
x = '0 1'
y = '1 1.5'
scale_factor = 240.54443866068704
[]
[material_input_function]
type = PiecewiseLinear
x = '0 1'
y = '0 0.59054'
[]
[additional_volume]
type = ConstantFunction
value = 2
[]
[temperature_of_additional_volume]
type = ConstantFunction
value = 100
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[temp]
initial_condition = 500
[]
[material_input]
[]
[]
[AuxVariables]
[pressure_residual_x]
[]
[pressure_residual_y]
[]
[pressure_residual_z]
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_xy]
order = CONSTANT
family = MONOMIAL
[]
[stress_yz]
order = CONSTANT
family = MONOMIAL
[]
[stress_zx]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[TensorMechanics]
use_displaced_mesh = true
use_automatic_differentiation = true
[]
[heat]
type = ADDiffusion
variable = temp
use_displaced_mesh = true
[]
[material_input_dummy]
type = ADDiffusion
variable = material_input
use_displaced_mesh = true
[]
[]
[AuxKernels]
[stress_xx]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = stress_xx
[]
[stress_yy]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = stress_yy
[]
[stress_zz]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = stress_zz
[]
[stress_xy]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 1
variable = stress_xy
[]
[stress_yz]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 2
variable = stress_yz
[]
[stress_zx]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 0
variable = stress_zx
[]
[]
[BCs]
[no_x_exterior]
type = DirichletBC
variable = disp_x
boundary = '7 8'
value = 0.0
[]
[no_y_exterior]
type = DirichletBC
variable = disp_y
boundary = '9 10'
value = 0.0
[]
[no_z_exterior]
type = DirichletBC
variable = disp_z
boundary = '11 12'
value = 0.0
[]
[prescribed_left]
type = FunctionDirichletBC
variable = disp_x
boundary = 13
function = displ_positive
[]
[prescribed_right]
type = FunctionDirichletBC
variable = disp_x
boundary = 14
function = displ_negative
[]
[no_y]
type = DirichletBC
variable = disp_y
boundary = '15 16'
value = 0.0
[]
[no_z]
type = DirichletBC
variable = disp_z
boundary = '17 18'
value = 0.0
[]
[no_x_interior]
type = DirichletBC
variable = disp_x
boundary = '1 2'
value = 0.0
[]
[no_y_interior]
type = DirichletBC
variable = disp_y
boundary = '3 4'
value = 0.0
[]
[no_z_interior]
type = DirichletBC
variable = disp_z
boundary = '5 6'
value = 0.0
[]
[temperatureInterior]
type = ADFunctionDirichletBC
boundary = 100
function = temp1
variable = temp
[]
[MaterialInput]
type = ADFunctionDirichletBC
boundary = '100 13 14 15 16'
function = material_input_function
variable = material_input
[]
[CavityPressure]
[1]
boundary = 100
initial_pressure = 100
material_input = materialInput
R = 8.314472
temperature = aveTempInterior
initial_temperature = 240.54443866068704
volume = internalVolume
startup_time = 0.5
output = ppress
save_in = 'pressure_residual_x pressure_residual_y pressure_residual_z'
additional_volumes = volume1
temperature_of_additional_volumes = temperature1
use_automatic_differentiation = true
[]
[]
[]
[Materials]
[elast_tensor1]
type = ADComputeElasticityTensor
C_ijkl = '0 5'
fill_method = symmetric_isotropic
block = 1
[]
[strain1]
type = ADComputeFiniteStrain
block = 1
[]
[stress1]
type = ADComputeFiniteStrainElasticStress
block = 1
[]
[elast_tensor2]
type = ADComputeElasticityTensor
C_ijkl = '0 5'
fill_method = symmetric_isotropic
block = 2
[]
[strain2]
type = ADComputeFiniteStrain
block = 2
[]
[stress2]
type = ADComputeFiniteStrainElasticStress
block = 2
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu'
nl_rel_tol = 1e-12
l_tol = 1e-12
l_max_its = 20
dt = 0.5
end_time = 1.0
use_pre_SMO_residual = true
[]
[Postprocessors]
[internalVolume]
type = InternalVolume
boundary = 100
execute_on = 'initial linear'
[]
[aveTempInterior]
type = SideAverageValue
boundary = 100
variable = temp
execute_on = 'initial linear'
[]
[materialInput]
type = SideAverageValue
boundary = '7 8 9 10 11 12'
variable = material_input
execute_on = linear
[]
[volume1]
type = FunctionValuePostprocessor
function = additional_volume
execute_on = 'initial linear'
[]
[temperature1]
type = FunctionValuePostprocessor
function = temperature_of_additional_volume
execute_on = 'initial linear'
[]
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/diffusion_with_hanging_node/ad_simple_diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 1
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
[../]
[force]
type = ADBodyForce
variable = u
function = '0'
[]
[]
[BCs]
# BCs cannot be preset due to Jacobian test
[./left]
type = DirichletBC
preset = false
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
preset = false
variable = u
boundary = right
value = 1
[../]
[]
[Preconditioning]
[./pre]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options = '-pc_svd_monitor'
petsc_options_iname = '-pc_type'
petsc_options_value = 'svd'
[]
[Outputs]
exodus = true
[]
[Adaptivity]
marker = box
max_h_level = 1
initial_steps = 1
[./Markers]
[./box]
type = BoxMarker
bottom_left = '0.5 0 0'
top_right = '1 1 0'
inside = 'refine'
outside = 'do_nothing'
[../]
[../]
[]
(modules/combined/test/tests/ad_cavity_pressure/multiple_postprocessors.i)
#
# Cavity Pressure Test (Volume input as a vector of postprocessors)
#
# This test is designed to compute an internal pressure based on
# p = n * R * T / V
# where
# p is the pressure
# n is the amount of material in the volume (moles)
# R is the universal gas constant
# T is the temperature
# V is the volume
#
# The mesh is composed of one block (1) with an interior cavity of volume 8.
# Block 2 sits in the cavity and has a volume of 1. Thus, the total
# initial volume is 7.
# The test adjusts n, T, and V in the following way:
# n => n0 + alpha * t
# T => T0 + beta * t
# V => V0 + gamma * t
# with
# alpha = n0
# beta = T0 / 2
# gamma = - (0.003322259...) * V0
# T0 = 240.54443866068704
# V0 = 7
# n0 = f(p0)
# p0 = 100
# R = 8.314472 J * K^(-1) * mol^(-1)
#
# So, n0 = p0 * V0 / R / T0 = 100 * 7 / 8.314472 / 240.544439
# = 0.35
#
# In this test the internal volume is calculated as the sum of two Postprocessors
# internalVolumeInterior and internalVolumeExterior. This sum equals the value
# reported by the internalVolume postprocessor.
#
# The parameters combined at t = 1 gives p = 301.
#
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[Mesh]
file = 3d.e
[]
[Functions]
[displ_positive]
type = PiecewiseLinear
x = '0 1'
y = '0 0.0029069767441859684'
[]
[displ_negative]
type = PiecewiseLinear
x = '0 1'
y = '0 -0.0029069767441859684'
[]
[temp1]
type = PiecewiseLinear
x = '0 1'
y = '1 1.5'
scale_factor = 240.54443866068704
[]
[material_input_function]
type = PiecewiseLinear
x = '0 1'
y = '0 0.35'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[temp]
initial_condition = 240.54443866068704
[]
[material_input]
[]
[]
[AuxVariables]
[pressure_residual_x]
[]
[pressure_residual_y]
[]
[pressure_residual_z]
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_xy]
order = CONSTANT
family = MONOMIAL
[]
[stress_yz]
order = CONSTANT
family = MONOMIAL
[]
[stress_zx]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[TensorMechanics]
use_displaced_mesh = true
use_automatic_differentiation = true
[]
[heat]
type = ADDiffusion
variable = temp
use_displaced_mesh = true
[]
[material_input_dummy]
type = ADDiffusion
variable = material_input
use_displaced_mesh = true
[]
[]
[AuxKernels]
[stress_xx]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = stress_xx
[]
[stress_yy]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = stress_yy
[]
[stress_zz]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = stress_zz
[]
[stress_xy]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 1
variable = stress_xy
[]
[stress_yz]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 2
variable = stress_yz
[]
[stress_zx]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 0
variable = stress_zx
[]
[]
[BCs]
[no_x_exterior]
type = DirichletBC
variable = disp_x
boundary = '7 8'
value = 0.0
[]
[no_y_exterior]
type = DirichletBC
variable = disp_y
boundary = '9 10'
value = 0.0
[]
[no_z_exterior]
type = DirichletBC
variable = disp_z
boundary = '11 12'
value = 0.0
[]
[prescribed_left]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 13
function = displ_positive
[]
[prescribed_right]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 14
function = displ_negative
[]
[no_y]
type = DirichletBC
variable = disp_y
boundary = '15 16'
value = 0.0
[]
[no_z]
type = DirichletBC
variable = disp_z
boundary = '17 18'
value = 0.0
[]
[no_x_interior]
type = DirichletBC
variable = disp_x
boundary = '1 2'
value = 0.0
[]
[no_y_interior]
type = DirichletBC
variable = disp_y
boundary = '3 4'
value = 0.0
[]
[no_z_interior]
type = DirichletBC
variable = disp_z
boundary = '5 6'
value = 0.0
[]
[temperatureInterior]
type = ADFunctionDirichletBC
boundary = 100
function = temp1
variable = temp
[]
[MaterialInput]
type = ADFunctionDirichletBC
boundary = '100 13 14 15 16'
function = material_input_function
variable = material_input
[]
[CavityPressure]
[1]
boundary = 100
initial_pressure = 100
material_input = materialInput
R = 8.314472
temperature = aveTempInterior
volume = 'internalVolumeInterior internalVolumeExterior'
startup_time = 0.5
output = ppress
save_in = 'pressure_residual_x pressure_residual_y pressure_residual_z'
use_automatic_differentiation = true
[]
[]
[]
[Materials]
[elast_tensor1]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e1
poissons_ratio = 0
block = 1
[]
[strain1]
type = ADComputeFiniteStrain
block = 1
[]
[stress1]
type = ADComputeFiniteStrainElasticStress
block = 1
[]
[elast_tensor2]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0
block = 2
[]
[strain2]
type = ADComputeFiniteStrain
block = 2
[]
[stress2]
type = ADComputeFiniteStrainElasticStress
block = 2
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu'
nl_rel_tol = 1e-12
l_tol = 1e-12
l_max_its = 20
dt = 0.5
end_time = 1.0
use_pre_SMO_residual = true
[]
[Postprocessors]
[internalVolume]
type = InternalVolume
boundary = 100
execute_on = 'initial linear'
[]
[aveTempInterior]
type = SideAverageValue
boundary = 100
variable = temp
execute_on = 'initial linear'
[]
[internalVolumeInterior]
type = InternalVolume
boundary = '1 2 3 4 5 6'
execute_on = 'initial linear'
[]
[internalVolumeExterior]
type = InternalVolume
boundary = '13 14 15 16 17 18'
execute_on = 'initial linear'
[]
[materialInput]
type = SideAverageValue
boundary = '7 8 9 10 11 12'
variable = material_input
execute_on = linear
[]
[]
[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/stochastic_tools/test/tests/actions/parameter_study_action/sub_not_controllable.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = FunctionDirichletBC
variable = u
boundary = left
function = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Postprocessors]
[average]
type = AverageNodalVariableValue
variable = u
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
# This is for testing distributions
p0 = 0
p1 = 0
p2 = 0
p3 = 0
p4 = 0
p5 = 0
p6 = 0
[Reporters]
[const]
type = ConstantReporter
real_names = 'p0 p1 p2 p3 p4 p5 p6'
real_values = '${p0} ${p1} ${p2} ${p3} ${p4} ${p5} ${p6}'
[]
[]
(test/tests/misc/multiple-nl-systems/ad-test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
[]
[Problem]
nl_sys_names = 'u v'
[]
[Variables]
[u]
solver_sys = 'u'
[]
[v]
solver_sys = 'v'
[]
[]
[Kernels]
[diff_u]
type = ADDiffusion
variable = u
[]
[diff_v]
type = ADDiffusion
variable = v
[]
[force]
type = ADCoupledForce
variable = v
v = u
[]
[]
[BCs]
[left_u]
type = ADDirichletBC
variable = u
boundary = left
value = 0
[]
[right_u]
type = ADDirichletBC
variable = u
boundary = right
value = 1
[]
[left_v]
type = ADDirichletBC
variable = v
boundary = left
value = 0
[]
[right_v]
type = ADDirichletBC
variable = v
boundary = right
value = 1
[]
[]
[Executioner]
type = SteadySolve2
solve_type = 'NEWTON'
petsc_options = '-snes_monitor'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
first_nl_sys_to_solve = 'u'
second_nl_sys_to_solve = 'v'
[]
[Outputs]
print_nonlinear_residuals = false
print_linear_residuals = false
exodus = true
[]
(test/tests/tag/tag_ad_kernels.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
extra_matrix_tags = 'mat_tag1 mat_tag2'
extra_vector_tags = 'vec_tag1 vec_tag2'
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
extra_matrix_tags = 'mat_tag1 mat_tag2'
extra_vector_tags = 'vec_tag1'
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
extra_matrix_tags = 'mat_tag1 mat_tag2'
extra_vector_tags = 'vec_tag1'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Problem]
type = TagTestProblem
test_tag_vectors = 'nontime residual vec_tag1 vec_tag2'
test_tag_matrices = 'mat_tag1 mat_tag2'
extra_tag_matrices = 'mat_tag1 mat_tag2'
extra_tag_vectors = 'vec_tag1 vec_tag2'
[]
[Executioner]
type = Steady
solve_type = 'Newton'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_tol = 1e-10
nl_rel_tol = 1e-9
nl_max_its = 1
[]
[Outputs]
exodus = true
[]
(test/tests/mortar/ad_periodic_segmental_constraint/penalty_periodic_simple2d.i)
[Mesh]
[left_block]
type = GeneratedMeshGenerator
dim = 2
xmin = -1.0
xmax = 1.0
ymin = -1.0
ymax = 1.0
nx = 2
ny = 2
elem_type = QUAD4
[]
[left_block_sidesets]
type = RenameBoundaryGenerator
input = left_block
old_boundary = '0 1 2 3'
new_boundary = '10 11 12 13'
[]
[left_block_id]
type = SubdomainIDGenerator
input = left_block_sidesets
subdomain_id = 1
[]
[left]
type = LowerDBlockFromSidesetGenerator
input = left_block_id
sidesets = '13'
new_block_id = '10003'
new_block_name = 'secondary_left'
[]
[right]
type = LowerDBlockFromSidesetGenerator
input = left
sidesets = '11'
new_block_id = '10001'
new_block_name = 'primary_right'
[]
[bottom]
type = LowerDBlockFromSidesetGenerator
input = right
sidesets = '10'
new_block_id = '10000'
new_block_name = 'secondary_bottom'
[]
[top]
type = LowerDBlockFromSidesetGenerator
input = bottom
sidesets = '12'
new_block_id = '10002'
new_block_name = 'primary_top'
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = top
[]
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[epsilon]
order = SECOND
family = SCALAR
[]
[]
[AuxVariables]
[sigma]
order = SECOND
family = SCALAR
[]
[]
[AuxScalarKernels]
[sigma]
type = FunctionScalarAux
variable = sigma
function = '1 2'
execute_on = initial #timestep_end
[]
[]
[Kernels]
[diff1]
type = ADDiffusion
variable = u
block = 1
[]
[]
[Problem]
kernel_coverage_check = false
error_on_jacobian_nonzero_reallocation = true
[]
[BCs]
[fix_right]
type = DirichletBC
variable = u
boundary = pinned_node
value = 0
[]
[]
[Constraints]
[mortarlr]
type = ADPenaltyEqualValueConstraint
primary_boundary = '11'
secondary_boundary = '13'
primary_subdomain = 'primary_right'
secondary_subdomain = 'secondary_left'
secondary_variable = u
correct_edge_dropping = true
penalty_value = 1.e2
[]
[periodiclr]
type = ADPenaltyPeriodicSegmentalConstraint
primary_boundary = '11'
secondary_boundary = '13'
primary_subdomain = 'primary_right'
secondary_subdomain = 'secondary_left'
secondary_variable = u
epsilon = epsilon
sigma = sigma
correct_edge_dropping = true
penalty_value = 1.e2
[]
[mortarbt]
type = ADPenaltyEqualValueConstraint
primary_boundary = '12'
secondary_boundary = '10'
primary_subdomain = 'primary_top'
secondary_subdomain = 'secondary_bottom'
secondary_variable = u
correct_edge_dropping = true
penalty_value = 1.e2
[]
[periodicbt]
type = ADPenaltyPeriodicSegmentalConstraint
primary_boundary = '12'
secondary_boundary = '10'
primary_subdomain = 'primary_top'
secondary_subdomain = 'secondary_bottom'
secondary_variable = u
epsilon = epsilon
sigma = sigma
correct_edge_dropping = true
penalty_value = 1.e2
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
# exodus = true
csv = true
[]
(test/tests/bcs/coupled_var_neumann/ad_coupled_var_neumann_nl.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 20
[]
[Variables]
[u][]
[v][]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[diff_v]
type = ADDiffusion
variable = v
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = 'left'
value = 0
[]
[right]
type = ADCoupledVarNeumannBC
variable = u
boundary = 'right'
v = v
[]
[v_left]
type = ADDirichletBC
variable = v
boundary = 'left'
value = 0
[]
[v_right]
type = ADDirichletBC
variable = v
boundary = 'right'
value = 1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
file_base = coupled_var_neumann_nl_out
[]
(modules/combined/test/tests/ad_cavity_pressure/3d.i)
#
# Cavity Pressure Test
#
# This test is designed to compute an internal pressure based on
# p = n * R * T / V
# where
# p is the pressure
# n is the amount of material in the volume (moles)
# R is the universal gas constant
# T is the temperature
# V is the volume
#
# The mesh is composed of one block (1) with an interior cavity of volume 8.
# Block 2 sits in the cavity and has a volume of 1. Thus, the total
# initial volume is 7.
# The test adjusts n, T, and V in the following way:
# n => n0 + alpha * t
# T => T0 + beta * t
# V => V0 + gamma * t
# with
# alpha = n0
# beta = T0 / 2
# gamma = - (0.003322259...) * V0
# T0 = 240.54443866068704
# V0 = 7
# n0 = f(p0)
# p0 = 100
# R = 8.314472 J * K^(-1) * mol^(-1)
#
# So, n0 = p0 * V0 / R / T0 = 100 * 7 / 8.314472 / 240.544439
# = 0.35
#
# The parameters combined at t = 1 gives p = 301.
#
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[Mesh]
file = 3d.e
[]
[Functions]
[displ_positive]
type = PiecewiseLinear
x = '0 1'
y = '0 0.0029069767441859684'
[]
[displ_negative]
type = PiecewiseLinear
x = '0 1'
y = '0 -0.0029069767441859684'
[]
[temp1]
type = PiecewiseLinear
x = '0 1'
y = '1 1.5'
scale_factor = 240.54443866068704
[]
[material_input_function]
type = PiecewiseLinear
x = '0 1'
y = '0 0.35'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[temp]
initial_condition = 240.54443866068704
[]
[material_input]
[]
[]
[AuxVariables]
[pressure_residual_x]
[]
[pressure_residual_y]
[]
[pressure_residual_z]
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_xy]
order = CONSTANT
family = MONOMIAL
[]
[stress_yz]
order = CONSTANT
family = MONOMIAL
[]
[stress_zx]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[TensorMechanics]
use_displaced_mesh = true
use_automatic_differentiation = true
[]
[heat]
type = ADDiffusion
variable = temp
use_displaced_mesh = true
[]
[material_input_dummy]
type = ADDiffusion
variable = material_input
use_displaced_mesh = true
[]
[]
[AuxKernels]
[stress_xx]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = stress_xx
[]
[stress_yy]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = stress_yy
[]
[stress_zz]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = stress_zz
[]
[stress_xy]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 1
variable = stress_xy
[]
[stress_yz]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 2
variable = stress_yz
[]
[stress_zx]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 0
variable = stress_zx
[]
[]
[BCs]
[no_x_exterior]
type = DirichletBC
variable = disp_x
boundary = '7 8'
value = 0.0
[]
[no_y_exterior]
type = DirichletBC
variable = disp_y
boundary = '9 10'
value = 0.0
[]
[no_z_exterior]
type = DirichletBC
variable = disp_z
boundary = '11 12'
value = 0.0
[]
[prescribed_left]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 13
function = displ_positive
[]
[prescribed_right]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 14
function = displ_negative
[]
[no_y]
type = DirichletBC
variable = disp_y
boundary = '15 16'
value = 0.0
[]
[no_z]
type = DirichletBC
variable = disp_z
boundary = '17 18'
value = 0.0
[]
[no_x_interior]
type = DirichletBC
variable = disp_x
boundary = '1 2'
value = 0.0
[]
[no_y_interior]
type = DirichletBC
variable = disp_y
boundary = '3 4'
value = 0.0
[]
[no_z_interior]
type = DirichletBC
variable = disp_z
boundary = '5 6'
value = 0.0
[]
[temperatureInterior]
type = ADFunctionDirichletBC
boundary = 100
function = temp1
variable = temp
[]
[MaterialInput]
type = ADFunctionDirichletBC
boundary = '100 13 14 15 16'
function = material_input_function
variable = material_input
[]
[CavityPressure]
[1]
boundary = 100
initial_pressure = 100
material_input = materialInput
R = 8.314472
temperature = aveTempInterior
volume = internalVolume
startup_time = 0.5
output = ppress
save_in = 'pressure_residual_x pressure_residual_y pressure_residual_z'
use_automatic_differentiation = true
[]
[]
[]
[Materials]
[elast_tensor1]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e1
poissons_ratio = 0
block = 1
[]
[strain1]
type = ADComputeFiniteStrain
block = 1
[]
[stress1]
type = ADComputeFiniteStrainElasticStress
block = 1
[]
[elast_tensor2]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0
block = 2
[]
[strain2]
type = ADComputeFiniteStrain
block = 2
[]
[stress2]
type = ADComputeFiniteStrainElasticStress
block = 2
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu'
nl_rel_tol = 1e-12
l_tol = 1e-12
l_max_its = 20
dt = 0.5
end_time = 1.0
use_pre_SMO_residual = true
[]
[Postprocessors]
[internalVolume]
type = InternalVolume
boundary = 100
execute_on = 'initial linear'
[]
[aveTempInterior]
type = SideAverageValue
boundary = 100
variable = temp
execute_on = 'initial linear'
[]
[materialInput]
type = SideAverageValue
boundary = '7 8 9 10 11 12'
variable = material_input
execute_on = linear
[]
[]
[Outputs]
exodus = true
[]
(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/kernels/kernel_precompute/adkernel_precompute_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
nz = 0
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[Variables]
[./convected]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = convected
[../]
[./conv]
type = ADConvectionPrecompute
variable = convected
velocity = '1.0 0.0 0.0'
[../]
[]
[BCs]
[./bottom]
type = DirichletBC
variable = convected
preset = false
boundary = 'left'
value = 0
[../]
[./top]
type = DirichletBC
variable = convected
preset = false
boundary = 'right'
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
execute_on = 'timestep_end'
file_base = out
exodus = true
[]
(examples/ex14_pps/ex14.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 32
ny = 32
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
[]
[Variables]
[forced]
order = FIRST
family = LAGRANGE
[]
[]
[Functions]
# A ParsedFunction allows us to supply analytic expressions directly in the input file
[exact]
type = ParsedFunction
expression = sin(alpha*pi*x)
symbol_names = alpha
symbol_values = 16
[]
# This function is an actual compiled function
[force]
type = ExampleFunction
alpha = 16
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = forced
[]
# This Kernel can take a function name to use
[forcing]
type = ADBodyForce
variable = forced
function = force
[]
[]
[BCs]
# The BC can take a function name to use
[all]
type = FunctionDirichletBC
variable = forced
boundary = 'bottom right top left'
function = exact
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
[h]
type = AverageElementSize
[]
[error]
type = ElementL2Error
variable = forced
function = exact
[]
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
csv = true
[]
(modules/stochastic_tools/test/tests/multiapps/transient_with_full_solve/sub.i)
[Mesh/gen]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[Variables/u]
[]
[Kernels/diff]
type = ADDiffusion
variable = u
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = ADDirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors/center]
type = PointValue
point = '0.5 0 0'
variable = u
[]
[Controls/stochastic]
type = SamplerReceiver
[]
(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]
[]
(test/tests/mortar/ad_periodic_segmental_constraint/testperiodicsole.i)
[Mesh]
[left_block]
type = GeneratedMeshGenerator
dim = 2
xmin = -1.0
xmax = 1.0
ymin = -1.0
ymax = 1.0
nx = 2
ny = 2
elem_type = QUAD4
[]
[left_block_sidesets]
type = RenameBoundaryGenerator
input = left_block
old_boundary = '0 1 2 3'
new_boundary = '10 11 12 13'
[]
[left_block_id]
type = SubdomainIDGenerator
input = left_block_sidesets
subdomain_id = 1
[]
[left]
type = LowerDBlockFromSidesetGenerator
input = left_block_id
sidesets = '13'
new_block_id = '10003'
new_block_name = 'secondary_left'
[]
[right]
type = LowerDBlockFromSidesetGenerator
input = left
sidesets = '11'
new_block_id = '10001'
new_block_name = 'primary_right'
[]
[bottom]
type = LowerDBlockFromSidesetGenerator
input = right
sidesets = '10'
new_block_id = '10000'
new_block_name = 'secondary_bottom'
[]
[top]
type = LowerDBlockFromSidesetGenerator
input = bottom
sidesets = '12'
new_block_id = '10002'
new_block_name = 'primary_top'
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = top
[]
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[kappa_x]
order = FIRST
family = SCALAR
[]
[kappa_y]
order = FIRST
family = SCALAR
[]
[]
[AuxVariables]
[kappa_aux]
order = SECOND
family = SCALAR
[]
[./flux_x]
order = FIRST
family = MONOMIAL
[../]
[./flux_y]
order = FIRST
family = MONOMIAL
[../]
[]
[AuxScalarKernels]
[kappa]
type = FunctionScalarAux
variable = kappa_aux
function = '1 3'
execute_on = initial #timestep_end
[]
[]
[AuxKernels]
[./flux_x]
type = DiffusionFluxAux
diffusivity = 'conductivity'
variable = flux_x
diffusion_variable = u
component = x
block = 1
[../]
[./flux_y]
type = DiffusionFluxAux
diffusivity = 'conductivity'
variable = flux_y
diffusion_variable = u
component = y
block = 1
[../]
[]
[Kernels]
[diff1]
type = ADDiffusion
variable = u
block = 1
[]
[]
[Materials]
[k1]
type = GenericConstantMaterial
prop_names = 'conductivity'
prop_values = 1.0
block = 1
[]
[]
[Problem]
kernel_coverage_check = false
error_on_jacobian_nonzero_reallocation = true
[]
[BCs]
[fix_right]
type = DirichletBC
variable = u
boundary = pinned_node
value = 0
[]
[]
[Constraints]
[mortarlr]
type = ADPenaltyEqualValueConstraint
primary_boundary = '11'
secondary_boundary = '13'
primary_subdomain = 'primary_right'
secondary_subdomain = 'secondary_left'
secondary_variable = u
correct_edge_dropping = true
penalty_value = 1.e3
[]
[periodiclrx]
type = ADTestPeriodicSole
primary_boundary = '11'
secondary_boundary = '13'
primary_subdomain = 'primary_right'
secondary_subdomain = 'secondary_left'
secondary_variable = u
kappa = kappa_x
kappa_aux = kappa_aux
component = 0
kappa_other = kappa_y
correct_edge_dropping = true
pen_scale = 1.e3
[]
[periodiclry]
type = ADTestPeriodicSole
primary_boundary = '11'
secondary_boundary = '13'
primary_subdomain = 'primary_right'
secondary_subdomain = 'secondary_left'
secondary_variable = u
kappa = kappa_y
kappa_aux = kappa_aux
component = 1
kappa_other = kappa_x
correct_edge_dropping = true
pen_scale = 1.e3
[]
[mortarbt]
type = ADPenaltyEqualValueConstraint
primary_boundary = '12'
secondary_boundary = '10'
primary_subdomain = 'primary_top'
secondary_subdomain = 'secondary_bottom'
secondary_variable = u
correct_edge_dropping = true
penalty_value = 1.e3
[]
[periodicbtx]
type = ADTestPeriodicSole
primary_boundary = '12'
secondary_boundary = '10'
primary_subdomain = 'primary_top'
secondary_subdomain = 'secondary_bottom'
secondary_variable = u
kappa = kappa_x
kappa_aux = kappa_aux
component = 0
kappa_other = kappa_y
correct_edge_dropping = true
pen_scale = 1.e3
[]
[periodicbty]
type = ADTestPeriodicSole
primary_boundary = '12'
secondary_boundary = '10'
primary_subdomain = 'primary_top'
secondary_subdomain = 'secondary_bottom'
secondary_variable = u
kappa = kappa_y
kappa_aux = kappa_aux
component = 1
kappa_other = kappa_x
correct_edge_dropping = true
compute_scalar_residuals = true
pen_scale = 1.e3
[]
[]
[Preconditioning]
[smp]
full = true
type = SMP
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
solve_type = NEWTON
[]
[Postprocessors]
[max]
type = ElementExtremeValue
variable = 'flux_x'
[]
[]
[Outputs]
csv = true
[]
(tutorials/darcy_thermo_mech/step01_diffusion/problems/step1.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator # Can generate simple lines, rectangles and rectangular prisms
dim = 2 # Dimension of the mesh
nx = 100 # Number of elements in the x direction
ny = 10 # Number of elements in the y direction
xmax = 0.304 # Length of test chamber
ymax = 0.0257 # Test chamber radius
[]
coord_type = RZ # Axisymmetric RZ
rz_coord_axis = X # Which axis the symmetry is around
[]
[Variables]
[pressure]
# Adds a Linear Lagrange variable by default
[]
[]
[Kernels]
[diffusion]
type = ADDiffusion # Laplacian operator using automatic differentiation
variable = pressure # Operate on the "pressure" variable from above
[]
[]
[BCs]
[inlet]
type = DirichletBC # Simple u=value BC
variable = pressure # Variable to be set
boundary = left # Name of a sideset in the mesh
value = 4000 # (Pa) From Figure 2 from paper. First data point for 1mm spheres.
[]
[outlet]
type = DirichletBC
variable = pressure
boundary = right
value = 0 # (Pa) Gives the correct pressure drop from Figure 2 for 1mm spheres
[]
[]
[Problem]
type = FEProblem # This is the "normal" type of Finite Element Problem in MOOSE
[]
[Executioner]
type = Steady # Steady state problem
solve_type = NEWTON # Perform a Newton solve, uses AD to compute Jacobian terms
petsc_options_iname = '-pc_type -pc_hypre_type' # PETSc option pairs with values below
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true # Output Exodus format
[]
(test/tests/bcs/ad_coupled_lower_value/together.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[lower_d]
type = LowerDBlockFromSidesetGenerator
input = square
new_block_name = 'lower'
sidesets = 'top right'
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[u]
block = 0
[]
[]
[AuxVariables]
[lower]
block = 'lower'
initial_condition = 10
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
block = 0
[]
[]
[BCs]
[dirichlet]
type = ADDirichletBC
variable = u
boundary = 'left'
value = 0
[]
[neumann]
type = ADCoupledLowerValue
variable = u
boundary = 'right'
lower_d_var = lower
[]
[]
[Executioner]
type = Steady
residual_and_jacobian_together = true
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/fv_simple_diffusion/dirichlet.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 7
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 42
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = left
value = 7
[]
[right]
type = ADDirichletBC
variable = u
boundary = right
value = 42
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
residual_and_jacobian_together = true
[]
[Outputs]
exodus = true
[]
(test/tests/mortar/ad_periodic_segmental_constraint/penalty_periodic_simple3d.i)
[Mesh]
[left_block]
type = GeneratedMeshGenerator
dim = 3
xmin = -3.0
xmax = 3.0
ymin = -3.0
ymax = 3.0
zmin = -3.0
zmax = 3.0
nx = 3
ny = 3
nz = 3
elem_type = HEX8
[]
[left_block_sidesets]
type = RenameBoundaryGenerator
input = left_block
old_boundary = '0 1 2 3 4 5'
new_boundary = '10 11 12 13 14 15'
[]
[left_block_id]
type = SubdomainIDGenerator
input = left_block_sidesets
subdomain_id = 1
[]
[left]
type = LowerDBlockFromSidesetGenerator
input = left_block_id
sidesets = '14'
new_block_id = '10004'
new_block_name = 'secondary_left'
[]
[right]
type = LowerDBlockFromSidesetGenerator
input = left
sidesets = '12'
new_block_id = '10002'
new_block_name = 'primary_right'
[]
[bottom]
type = LowerDBlockFromSidesetGenerator
input = right
sidesets = '10'
new_block_id = '10000'
new_block_name = 'secondary_bottom'
[]
[top]
type = LowerDBlockFromSidesetGenerator
input = bottom
sidesets = '15'
new_block_id = '10005'
new_block_name = 'primary_top'
[]
[back]
type = LowerDBlockFromSidesetGenerator
input = top
sidesets = '11'
new_block_id = '10001'
new_block_name = 'secondary_back'
[]
[front]
type = LowerDBlockFromSidesetGenerator
input = back
sidesets = '13'
new_block_id = '10003'
new_block_name = 'primary_front'
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = front
[]
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[epsilon]
order = THIRD
family = SCALAR
[]
[]
[AuxVariables]
[sigma]
order = THIRD
family = SCALAR
[]
[]
[AuxScalarKernels]
[sigma]
type = FunctionScalarAux
variable = sigma
function = '1 2 3'
execute_on = initial #timestep_end
[]
[]
[Kernels]
[diff1]
type = ADDiffusion
variable = u
block = 1
[]
[]
[Problem]
kernel_coverage_check = false
error_on_jacobian_nonzero_reallocation = true
[]
[BCs]
[fix_right]
type = DirichletBC
variable = u
boundary = pinned_node
value = 0
[]
[]
[Constraints]
[mortarlr]
type = ADPenaltyEqualValueConstraint
primary_boundary = '12'
secondary_boundary = '14'
primary_subdomain = 'primary_right'
secondary_subdomain = 'secondary_left'
secondary_variable = u
correct_edge_dropping = true
penalty_value = 1.e2
[]
[periodiclr]
type = ADPenaltyPeriodicSegmentalConstraint
primary_boundary = '12'
secondary_boundary = '14'
primary_subdomain = 'primary_right'
secondary_subdomain = 'secondary_left'
secondary_variable = u
epsilon = epsilon
sigma = sigma
correct_edge_dropping = true
penalty_value = 1.e2
[]
[mortarbt]
type = ADPenaltyEqualValueConstraint
primary_boundary = '15'
secondary_boundary = '10'
primary_subdomain = 'primary_top'
secondary_subdomain = 'secondary_bottom'
secondary_variable = u
correct_edge_dropping = true
penalty_value = 1.e2
[]
[periodicbt]
type = ADPenaltyPeriodicSegmentalConstraint
primary_boundary = '15'
secondary_boundary = '10'
primary_subdomain = 'primary_top'
secondary_subdomain = 'secondary_bottom'
secondary_variable = u
epsilon = epsilon
sigma = sigma
correct_edge_dropping = true
penalty_value = 1.e2
[]
[mortarbf]
type = ADPenaltyEqualValueConstraint
primary_boundary = '13'
secondary_boundary = '11'
primary_subdomain = 'primary_front'
secondary_subdomain = 'secondary_back'
secondary_variable = u
correct_edge_dropping = true
penalty_value = 1.e2
[]
[periodicbf]
type = ADPenaltyPeriodicSegmentalConstraint
primary_boundary = '13'
secondary_boundary = '11'
primary_subdomain = 'primary_front'
secondary_subdomain = 'secondary_back'
secondary_variable = u
epsilon = epsilon
sigma = sigma
correct_edge_dropping = true
penalty_value = 1.e2
[]
[]
[Preconditioning]
[smp]
full = true
type = SMP
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
solve_type = NEWTON
[]
[Outputs]
# exodus = true
csv = true
[]
(test/tests/kernels/ad_vector_couple/ad_grad_vector_couple.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
[]
[Variables]
[u]
family = LAGRANGE
order = FIRST
[]
[v]
family = LAGRANGE_VEC
order = FIRST
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
[]
[diff]
type = ADDiffusion
variable = u
[]
[convection]
type = ADCoupledVectorConvection
variable = u
velocity_vector = v
use_grad_row = true
[]
[diff_v]
type = ADVectorDiffusion
variable = v
[]
[]
[BCs]
[left]
type = ADFunctionDirichletBC
variable = u
function = 1
boundary = 'left'
[]
[right]
type = ADFunctionDirichletBC
variable = u
function = 2
boundary = 'bottom'
[]
[left_v]
type = ADVectorFunctionDirichletBC
variable = v
function_x = 1
function_y = 2
boundary = 'left'
[]
[right_v]
type = ADVectorFunctionDirichletBC
variable = v
function_x = 4
function_y = 8
boundary = 'top'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
num_steps = 10
dt = 0.05
[]
[Outputs]
execute_on = TIMESTEP_END
exodus = true
[]
(test/tests/bcs/ad_bc_preset_nodal/bc_function_preset.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
nz = 0
zmin = 0
zmax = 0
elem_type = QUAD4
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Functions]
[./left]
type = ParsedFunction
expression = 'y'
[../]
[./right]
type = ParsedFunction
expression = '1+y'
[../]
[]
[Kernels]
active = 'diff'
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
active = 'left right'
[./left]
type = ADFunctionDirichletBC
variable = u
boundary = 3
function = left
[../]
[./right]
type = ADFunctionDirichletBC
variable = u
boundary = 1
function = right
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
file_base = bc_func_out
exodus = true
[]
(test/tests/mortar/displaced-gap-conductance-2d-non-conforming/gap-conductance.i)
[Mesh]
displacements = 'disp_x disp_y'
[file]
type = FileMeshGenerator
file = nodal_normals_test_offset_nonmatching_gap.e
# block 1: left
# block 2: right
[]
[primary]
input = file
type = LowerDBlockFromSidesetGenerator
sidesets = '2'
new_block_id = '20'
[]
[secondary]
input = primary
type = LowerDBlockFromSidesetGenerator
sidesets = '1'
new_block_id = '10'
[]
[]
[AuxVariables]
[disp_x]
block = '1 2'
[]
[disp_y]
block = '1 2'
[]
[]
[AuxKernels]
[function_x]
type = FunctionAux
function = '.05 * t'
variable = 'disp_x'
block = '2'
execute_on = 'LINEAR TIMESTEP_BEGIN'
[]
[function_y]
type = FunctionAux
function = '.05 * t'
variable = 'disp_y'
block = '2'
execute_on = 'LINEAR TIMESTEP_BEGIN'
[]
[]
[Problem]
kernel_coverage_check = false
[]
[Variables]
[T]
block = '1 2'
[]
[lambda]
block = '10'
family = MONOMIAL
order = CONSTANT
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = T
boundary = '5'
value = 0
[]
[right]
type = ADDirichletBC
variable = T
boundary = '8'
value = 1
[]
[]
[Kernels]
[conduction]
type = ADDiffusion
variable = T
block = '1 2'
[]
[]
[Debug]
show_var_residual_norms = 1
[]
[Constraints]
[mortar]
type = GapHeatConductanceTest
primary_boundary = 2
secondary_boundary = 1
primary_subdomain = 20
secondary_subdomain = 10
variable = lambda
secondary_variable = T
use_displaced_mesh = true
correct_edge_dropping = true
[]
[]
[Materials]
[constant]
type = ADGenericConstantMaterial
prop_names = 'gap_conductance'
prop_values = '.03'
block = '1 2'
use_displaced_mesh = true
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
solve_type = NEWTON
type = Transient
num_steps = 5
petsc_options_iname = '-pc_type -snes_linesearch_type'
petsc_options_value = 'lu basic'
[]
[Outputs]
exodus = true
[dofmap]
type = DOFMap
execute_on = 'initial'
[]
[]
(test/tests/kernels/ad_coupled_force/aux_test.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[a]
order = FIRST
family = LAGRANGE
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[force]
type = ADCoupledForce
variable = u
v = a
[]
[]
[AuxKernels]
[a]
variable = a
type = ConstantAux
value = 10
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = ADDirichletBC
variable = u
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
(modules/solid_mechanics/test/tests/ad_thermal_expansion_function/mean_complex.i)
# This test checks the thermal expansion calculated via a mean thermal expansion coefficient.
# The coefficient is selected so as to result in a 1e-4 strain in the x-axis, and to cross over
# from positive to negative strain.
[Mesh]
[./gen]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 4
nz = 4
[../]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Variables]
[./temp]
[../]
[]
[Kernels]
[./temp_diff]
type = ADDiffusion
variable = temp
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = SMALL
add_variables = true
eigenstrain_names = eigenstrain
generate_output = 'strain_xx strain_yy strain_zz'
use_automatic_differentiation = true
[../]
[]
[BCs]
[./left]
type = ADDirichletBC
variable = disp_x
boundary = 'left'
value = 0.0
[../]
[./bottom]
type = ADDirichletBC
variable = disp_y
boundary = 'bottom'
value = 0.0
[../]
[./back]
type = ADDirichletBC
variable = disp_z
boundary = 'back'
value = 0.0
[../]
[./temp]
type = ADFunctionDirichletBC
variable = temp
boundary = 'front back top bottom left right'
function = '1 + t'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1
poissons_ratio = 0.3
[../]
[./stress]
type = ADComputeLinearElasticStress
[../]
[./thermal_expansion_strain]
type = ADComputeMeanThermalExpansionFunctionEigenstrain
thermal_expansion_function = cte_func_mean
thermal_expansion_function_reference_temperature = 1
stress_free_temperature = 1
temperature = temp
eigenstrain_name = eigenstrain
[../]
[]
[Functions]
[./cte_func_mean]
type = ParsedFunction
expression = '1e-6 + 1e-8 * t + 1e-8 * t^2 + exp(t) * 1e-2'
[../]
[]
[Postprocessors]
[./disp_x_max]
type = SideAverageValue
variable = disp_x
boundary = right
[../]
[./temp_avg]
type = ElementAverageValue
variable = temp
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
num_steps = 1
[]
[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
[]
(test/tests/kernels/body_force/ad_mat_forcing_function_test.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
uniform_refine = 4
[]
[Variables]
[u]
[]
[alphapi]
initial_condition = ${fparse 16 * 3.14159265359}
[]
[]
[Materials]
[forcing_material]
type = ADDerivativeParsedMaterial
property_name = forcing_material
extra_symbols = x
coupled_variables = alphapi
expression = 'alphapi*alphapi*sin(alphapi*x)'
[]
[]
[Kernels]
[alphapi]
type = ADDiffusion
variable = alphapi
[]
[diff]
type = ADDiffusion
variable = u
[]
[forcing]
type = ADMatBodyForce
variable = u
material_property = forcing_material
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = right
value = 0
[]
[right]
type = ADDirichletBC
variable = u
boundary = left
value = 0
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
nl_rel_tol = 1e-12
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
hide = alphapi
[]
(modules/solid_mechanics/test/tests/ad_linear_elasticity/tensor.i)
# This input file is designed to test the RankTwoAux and RankFourAux
# auxkernels, which report values out of the Tensors used in materials
# properties.
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmax = 2
ymax = 2
[]
[Variables]
[./diffused]
[./InitialCondition]
type = RandomIC
[../]
[../]
[]
[AuxVariables]
[./C11]
order = CONSTANT
family = MONOMIAL
[../]
[./C12]
order = CONSTANT
family = MONOMIAL
[../]
[./C13]
order = CONSTANT
family = MONOMIAL
[../]
[./C14]
order = CONSTANT
family = MONOMIAL
[../]
[./C15]
order = CONSTANT
family = MONOMIAL
[../]
[./C16]
order = CONSTANT
family = MONOMIAL
[../]
[./C22]
order = CONSTANT
family = MONOMIAL
[../]
[./C23]
order = CONSTANT
family = MONOMIAL
[../]
[./C24]
order = CONSTANT
family = MONOMIAL
[../]
[./C25]
order = CONSTANT
family = MONOMIAL
[../]
[./C26]
order = CONSTANT
family = MONOMIAL
[../]
[./C33]
order = CONSTANT
family = MONOMIAL
[../]
[./C34]
order = CONSTANT
family = MONOMIAL
[../]
[./C35]
order = CONSTANT
family = MONOMIAL
[../]
[./C36]
order = CONSTANT
family = MONOMIAL
[../]
[./C44]
order = CONSTANT
family = MONOMIAL
[../]
[./C45]
order = CONSTANT
family = MONOMIAL
[../]
[./C46]
order = CONSTANT
family = MONOMIAL
[../]
[./C55]
order = CONSTANT
family = MONOMIAL
[../]
[./C56]
order = CONSTANT
family = MONOMIAL
[../]
[./C66]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Physics/SolidMechanics/QuasiStatic/All]
strain = SMALL
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = diffused
[../]
[]
[AuxKernels]
[./matl_C11]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 0
index_j = 0
index_k = 0
index_l = 0
variable = C11
[../]
[./matl_C12]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 0
index_j = 0
index_k = 1
index_l = 1
variable = C12
[../]
[./matl_C13]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 0
index_j = 0
index_k = 2
index_l = 2
variable = C13
[../]
[./matl_C14]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 0
index_j = 0
index_k = 1
index_l = 2
variable = C14
[../]
[./matl_C15]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 0
index_j = 0
index_k = 0
index_l = 2
variable = C15
[../]
[./matl_C16]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 0
index_j = 0
index_k = 0
index_l = 1
variable = C16
[../]
[./matl_C22]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 1
index_j = 1
index_k = 1
index_l = 1
variable = C22
[../]
[./matl_C23]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 1
index_j = 1
index_k = 2
index_l = 2
variable = C23
[../]
[./matl_C24]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 1
index_j = 1
index_k = 1
index_l = 2
variable = C24
[../]
[./matl_C25]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 1
index_j = 1
index_k = 0
index_l = 2
variable = C25
[../]
[./matl_C26]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 1
index_j = 1
index_k = 0
index_l = 1
variable = C26
[../]
[./matl_C33]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 2
index_j = 2
index_k = 2
index_l = 2
variable = C33
[../]
[./matl_C34]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 2
index_j = 2
index_k = 1
index_l = 2
variable = C34
[../]
[./matl_C35]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 2
index_j = 2
index_k = 0
index_l = 2
variable = C35
[../]
[./matl_C36]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 2
index_j = 2
index_k = 0
index_l = 1
variable = C36
[../]
[./matl_C44]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 1
index_j = 2
index_k = 1
index_l = 2
variable = C44
[../]
[./matl_C45]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 1
index_j = 2
index_k = 0
index_l = 2
variable = C45
[../]
[./matl_C46]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 1
index_j = 2
index_k = 0
index_l = 1
variable = C46
[../]
[./matl_C55]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 0
index_j = 2
index_k = 0
index_l = 2
variable = C55
[../]
[./matl_C56]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 0
index_j = 2
index_k = 0
index_l = 1
variable = C56
[../]
[./matl_C66]
type = ADRankFourAux
rank_four_tensor = elasticity_tensor
index_i = 0
index_j = 1
index_k = 0
index_l = 1
variable = C66
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeElasticityTensor
fill_method = symmetric21
C_ijkl ='1111 1122 1133 1123 1113 1112 2222 2233 2223 2213 2212 3333 3323 3313 3312 2323 2313 2312 1313 1312 1212'
[../]
[./stress]
type = ADComputeLinearElasticStress
[../]
[]
[BCs]
[./bottom]
type = DirichletBC
variable = diffused
boundary = 'right'
value = 1
[../]
[./top]
type = DirichletBC
variable = diffused
boundary = 'top'
value = 0
[../]
[./disp_x_BC]
type = DirichletBC
variable = disp_x
boundary = 'bottom top'
value = 0.5
[../]
[./disp_x_BC2]
type = DirichletBC
variable = disp_x
boundary = 'left right'
value = 0.01
[../]
[./disp_y_BC]
type = DirichletBC
variable = disp_y
boundary = 'bottom top'
value = 0.8
[../]
[./disp_y_BC2]
type = DirichletBC
variable = disp_y
boundary = 'left right'
value = 0.02
[../]
[]
[Preconditioning]
[./full]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/jxw_grad_test_dep_on_displacements/jxw-cylindrical.i)
[GlobalParams]
displacements = 'disp_r disp_z'
order = SECOND
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 3
ny = 3
elem_type = QUAD9
[]
[Problem]
coord_type = RZ
[]
[Variables]
[./disp_r]
[../]
[./disp_z]
[../]
[./u]
order = FIRST
[../]
[./v]
[../]
[]
[Kernels]
[./disp_r]
type = Diffusion
variable = disp_r
[../]
[./disp_z]
type = Diffusion
variable = disp_z
[../]
[./u]
type = ADDiffusion
variable = u
use_displaced_mesh = true
[../]
[./v]
type = ADDiffusion
variable = v
use_displaced_mesh = true
[../]
[]
[BCs]
# BCs cannot be preset due to Jacobian tests
[./u_left]
type = DirichletBC
preset = false
value = 0
boundary = 'left'
variable = u
[../]
[./u_right]
type = DirichletBC
preset = false
value = 1
boundary = 'right'
variable = u
[../]
[./v_left]
type = DirichletBC
preset = false
value = 0
boundary = 'left'
variable = v
[../]
[./v_right]
type = DirichletBC
preset = false
value = 1
boundary = 'right'
variable = v
[../]
[./disp_r_left]
type = DirichletBC
preset = false
value = 0
boundary = 'left'
variable = disp_r
[../]
[./disp_r_right]
type = DirichletBC
preset = false
value = 1
boundary = 'right'
variable = disp_r
[../]
[./disp_z_left]
type = DirichletBC
preset = false
value = 0
boundary = 'bottom'
variable = disp_z
[../]
[./disp_z_right]
type = DirichletBC
preset = false
value = 1
boundary = 'top'
variable = disp_z
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
[./dofmap]
type = DOFMap
execute_on = 'initial'
[../]
[]
[ICs]
[./disp_r]
type = RandomIC
variable = disp_r
min = 0.01
max = 0.09
[../]
[./disp_z]
type = RandomIC
variable = disp_z
min = 0.01
max = 0.09
[../]
[./u]
type = RandomIC
variable = u
min = 0.1
max = 0.9
[../]
[./v]
type = RandomIC
variable = v
min = 0.1
max = 0.9
[../]
[]
(modules/stochastic_tools/test/tests/actions/parameter_study_action/sub.i)
[Mesh]
[gmg]
type = GeneratedMeshGenerator
dim = 2
nx = 10
ny = 10
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
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 = Steady
solve_type = NEWTON
[]
# This is for testing distributions
p0 = 0
p1 = 0
p2 = 0
p3 = 0
p4 = 0
p5 = 0
p6 = 0
[Reporters]
[const]
type = ConstantReporter
real_names = 'p0 p1 p2 p3 p4 p5 p6'
real_values = '${p0} ${p1} ${p2} ${p3} ${p4} ${p5} ${p6}'
[]
[]
(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
[]
(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
[]
[]
(modules/solid_mechanics/test/tests/ad_thermal_expansion_function/instantaneous_complex.i)
# This test checks the thermal expansion calculated via a mean thermal expansion coefficient.
# The coefficient is selected so as to result in a 1e-4 strain in the x-axis, and to cross over
# from positive to negative strain.
[Mesh]
[./gen]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 4
nz = 4
[../]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Variables]
[./temp]
[../]
[]
[Kernels]
[./temp_diff]
type = ADDiffusion
variable = temp
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = SMALL
add_variables = true
eigenstrain_names = eigenstrain
generate_output = 'strain_xx strain_yy strain_zz'
use_automatic_differentiation = true
[../]
[]
[BCs]
[./left]
type = ADDirichletBC
variable = disp_x
boundary = 'left'
value = 0.0
[../]
[./bottom]
type = ADDirichletBC
variable = disp_y
boundary = 'bottom'
value = 0.0
[../]
[./back]
type = ADDirichletBC
variable = disp_z
boundary = 'back'
value = 0.0
[../]
[./temp]
type = ADFunctionDirichletBC
variable = temp
boundary = 'front back top bottom left right'
function = '1 + t'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1
poissons_ratio = 0.3
[../]
[./stress]
type = ADComputeLinearElasticStress
[../]
[./thermal_expansion_strain]
type = ADComputeInstantaneousThermalExpansionFunctionEigenstrain
thermal_expansion_function = cte_func_mean
stress_free_temperature = 1
temperature = temp
eigenstrain_name = eigenstrain
[../]
[]
[Functions]
[./cte_func_mean]
type = ParsedFunction
expression = '1e-6 + 1e-8 * t + 1e-8 * t^2 + exp(t) * 1e-2'
[../]
[]
[Postprocessors]
[./disp_x_max]
type = SideAverageValue
variable = disp_x
boundary = right
[../]
[./temp_avg]
type = ElementAverageValue
variable = temp
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
num_steps = 1
[]
[Outputs]
csv = true
[]
(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/kernels/ad_simple_diffusion/ad_simple_diffusion.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
# Preconditioned JFNK (default)
solve_type = 'Newton'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_tol = 1e-10
nl_rel_tol = 1e-9
nl_max_its = 1
[]
[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
[]
[]
(modules/thermal_hydraulics/test/tests/materials/ad_wall_heat_transfer_coefficient_3eqn_dittus_boelter/test.i)
[Mesh]
type = GeneratedMesh
dim = 1
nx = 1
allow_renumbering = false
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[]
[AuxVariables]
[Hw]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[Hw_ak]
type = ADMaterialRealAux
variable = Hw
property = Hw
[]
[]
[Materials]
[props]
type = ADGenericConstantMaterial
prop_names = 'rho vel k mu cp T T_wall D_h'
prop_values = '1000 0.1 0.001 0.1 12 300 310 0.1'
[]
[Hw_material]
type = ADWallHeatTransferCoefficient3EqnDittusBoelterMaterial
rho = rho
vel = vel
D_h = D_h
k = k
mu = mu
cp = cp
T = T
T_wall = T_wall
[]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[Hw]
type = ElementalVariableValue
elementid = 0
variable = Hw
[]
[]
[Outputs]
csv = true
execute_on = timestep_end
[]
(test/tests/kernels/ad_2d_diffusion/2d_diffusion_bodyforce_test.i)
###########################################################
# This is a simple test of the Kernel System.
# It solves the Laplacian equation on a small 2x2 grid.
# The "Diffusion" kernel is used to calculate the
# residuals of the weak form of this operator. The
# "BodyForce" kernel is used to apply a time-dependent
# volumetric source.
###########################################################
[Mesh]
[./square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[../]
[]
[Variables]
active = 'u'
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
[../]
[./bf]
type = ADBodyForce
variable = u
postprocessor = ramp
[../]
[]
[Functions]
[./ramp]
type = ParsedFunction
expression = 't'
[../]
[]
[Postprocessors]
[./ramp]
type = FunctionValuePostprocessor
function = ramp
execute_on = linear
[../]
[]
[BCs]
active = 'left right'
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[]
[Executioner]
type = Transient
dt = 1.0
end_time = 1.0
solve_type = 'NEWTON'
[]
[Outputs]
file_base = bodyforce_out
exodus = true
[]
(modules/solid_mechanics/test/tests/ad_linear_elasticity/linear_elastic_material.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
xmax = 50
ymax = 50
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[./diffused]
[./InitialCondition]
type = RandomIC
[../]
[../]
[]
[Physics/SolidMechanics/QuasiStatic/All]
strain = SMALL
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = diffused
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0
[../]
[./stress]
type = ADComputeLinearElasticStress
[../]
[]
[BCs]
[./bottom]
type = ADDirichletBC
variable = diffused
boundary = 'right'
value = 1
[../]
[./top]
type = ADDirichletBC
variable = diffused
boundary = 'top'
value = 0
[../]
[./disp_x_BC]
type = ADDirichletBC
variable = disp_x
boundary = 'bottom top'
value = 0.5
[../]
[./disp_x_BC2]
type = ADDirichletBC
variable = disp_x
boundary = 'left right'
value = 0.01
[../]
[./disp_y_BC]
type = ADDirichletBC
variable = disp_y
boundary = 'bottom top'
value = 0.8
[../]
[./disp_y_BC2]
type = ADDirichletBC
variable = disp_y
boundary = 'left right'
value = 0.02
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_rel_tol = 1e-12
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/ad_coupled_convection/ad_coupled_convection.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[Variables]
[./u]
[../]
[./v]
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
[../]
[./convection]
type = ADCoupledConvection
variable = u
velocity_vector = v
[../]
[./diff_v]
type = ADDiffusion
variable = 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
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
solve_type = 'Newton'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
l_tol = 1e-10
nl_rel_tol = 1e-9
nl_max_its = 2
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/ad_scalar_kernel_constraint/scalar_constraint_kernel_RJ.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 2
ny = 2
elem_type = QUAD9
[]
[Variables]
[u]
family = LAGRANGE
order = SECOND
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[sk_lm]
type = ADScalarLMKernel
variable = u
kappa = lambda
pp_name = pp
value = 2.666666666666666
[]
[]
[Problem]
kernel_coverage_check = false
error_on_jacobian_nonzero_reallocation = true
[]
[BCs]
[bottom]
type = ADDirichletBC
variable = u
boundary = 'bottom'
value = 0
[]
[right]
type = ADDirichletBC
variable = u
boundary = 'right'
value = 0
[]
[top]
type = ADDirichletBC
variable = u
boundary = 'top'
value = 0
[]
[left]
type = ADDirichletBC
variable = u
boundary = 'left'
value = 0
[]
[]
[Postprocessors]
# integrate the volume of domain since original objects set
# int(phi)=V0, rather than int(phi-V0)=0
[pp]
type = FunctionElementIntegral
function = 1
execute_on = initial
[]
[]
# Force LU decomposition, nonlinear iterations, to check Jacobian terms with single factorization
[Executioner]
type = Steady
residual_and_jacobian_together = true
nl_rel_tol = 1e-9
l_tol = 1.e-10
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package'
petsc_options_value = 'lu superlu_dist'
solve_type = NEWTON
[]
[Outputs]
exodus = true
hide = lambda
[]
(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
[]
(test/tests/misc/displaced_mesh_coupling/ad.i)
[GlobalParams]
displacements = 'u'
[]
[Mesh]
type = GeneratedMesh
dim = 1
[]
[Variables]
[./u]
[../]
[./v]
[../]
[]
[Kernels]
[./u]
type = ADDiffusion
use_displaced_mesh = true
variable = u
[../]
[./v]
type = ADDiffusion
use_displaced_mesh = false
variable = v
[../]
[]
[BCs]
[./no_x]
type = ADNeumannBC
variable = u
boundary = left
value = 1.0e-3
use_displaced_mesh = true
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[./lright]
type = DirichletBC
variable = v
boundary = right
value = 1
[../]
[]
[Preconditioning]
[./SMP]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
num_steps = 1
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/thermo_mech/ad-youngs_modulus_function_temp.i)
# ---------------------------------------------------------------------------
# This test is designed to verify the variable elasticity tensor functionality in the
# ADComputeFiniteStrainElasticStress class with the elasticity_tensor_has_changed flag
# by varying the young's modulus with temperature. A constant strain is applied
# to the mesh in this case, and the stress varies with the changing elastic constants.
#
# Geometry: A single element cube in symmetry boundary conditions and pulled
# at a constant displacement to create a constant strain in the x-direction.
#
# Temperature: The temperature varies from 400K to 700K in this simulation by
# 100K each time step. The temperature is held constant in the last
# timestep to ensure that the elasticity tensor components are constant
# under constant temperature.
#
# Results: Because Poisson's ratio is set to zero, only the stress along the x
# axis is non-zero. The stress changes with temperature.
#
# Temperature(K) strain_{xx}(m/m) Young's Modulus(Pa) stress_{xx}(Pa)
# 400 0.001 10.0e6 1.0e4
# 500 0.001 10.0e6 1.0e4
# 600 0.001 9.94e6 9.94e3
# 700 0.001 9.93e6 9.93e3
#
# The tensor mechanics results align exactly with the analytical results above
# when this test is run with ComputeIncrementalSmallStrain. When the test is
# run with ComputeFiniteStrain, a 0.05% discrepancy between the analytical
# strains and the simulation strain results is observed, and this discrepancy
# is carried over into the calculation of the elastic stress.
#-------------------------------------------------------------------------
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[./disp_z]
[../]
[./temp]
initial_condition = 400
[../]
[]
[AuxVariables]
[./stress_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./elastic_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Functions]
[./temperature_function]
type = PiecewiseLinear
x = '1 4'
y = '400 700'
[../]
[]
[Kernels]
[./heat]
type = ADDiffusion
variable = temp
[../]
[./TensorMechanics]
use_displaced_mesh = true
use_automatic_differentiation = true
[../]
[]
[AuxKernels]
[./stress_xx]
type = ADRankTwoAux
rank_two_tensor = stress
variable = stress_xx
index_i = 0
index_j = 0
[../]
[./elastic_strain_xx]
type = ADRankTwoAux
rank_two_tensor = elastic_strain
variable = elastic_strain_xx
index_i = 0
index_j = 0
execute_on = timestep_end
[../]
[]
[BCs]
[./u_left_fix]
type = DirichletBC
variable = disp_x
boundary = left
value = 0.0
[../]
[./u_bottom_fix]
type = DirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[../]
[./u_back_fix]
type = DirichletBC
variable = disp_z
boundary = back
value = 0.0
[../]
[./u_pull_right]
type = DirichletBC
variable = disp_x
boundary = right
value = 0.001
[../]
[./temp_bc_1]
type = ADFunctionDirichletBC
variable = temp
preset = false
boundary = '1 2 3 4'
function = temperature_function
[../]
[]
[Materials]
[./youngs_modulus]
type = ADPiecewiseLinearInterpolationMaterial
xy_data = '0 10e+6
599.9999 10e+6
600 9.94e+6
99900 10e3'
property = youngs_modulus
variable = temp
[../]
[./elasticity_tensor]
type = ADComputeVariableIsotropicElasticityTensor
youngs_modulus = youngs_modulus
poissons_ratio = 0.0
[../]
[./strain]
type = ADComputeIncrementalSmallStrain
[../]
[./stress]
type = ADComputeFiniteStrainElasticStress
[../]
[]
[Preconditioning]
[./full]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
end_time = 5
[]
[Postprocessors]
[./elastic_strain_xx]
type = ElementAverageValue
variable = elastic_strain_xx
[../]
[./elastic_stress_xx]
type = ElementAverageValue
variable = stress_xx
[../]
[./temp]
type = AverageNodalVariableValue
variable = temp
[../]
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/fv_simple_diffusion/dirichlet-constrained-average-value.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[lambda]
family = SCALAR
order = FIRST
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[]
[FVBCs]
[left]
type = FVDirichletBC
variable = v
boundary = left
value = 7
[]
[right]
type = FVBoundaryIntegralValueConstraint
variable = v
boundary = right
phi0 = 42
lambda = lambda
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = left
value = 7
[]
[right]
type = ADDirichletBC
variable = u
boundary = right
value = 42
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
residual_and_jacobian_together = true
[]
[Outputs]
exodus = true
hide = lambda
[]
(modules/stochastic_tools/test/tests/multiapps/conditional_run/sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
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 = Steady
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
[]
(modules/combined/test/tests/ad_cavity_pressure/rz.i)
#
# Cavity Pressure Test
#
# This test is designed to compute an internal pressure based on
# p = n * R * T / V
# where
# p is the pressure
# n is the amount of material in the volume (moles)
# R is the universal gas constant
# T is the temperature
# V is the volume
#
# The mesh is composed of one block (2) with an interior cavity of volume 8.
# Block 1 sits in the cavity and has a volume of 1. Thus, the total
# initial volume is 7.
# The test adjusts T in the following way:
# T => T0 + beta * t
# with
# beta = T0
# T0 = 240.54443866068704
# V0 = 7
# n0 = f(p0)
# p0 = 100
# R = 8.314472 J * K^(-1) * mol^(-1)
#
# So, n0 = p0 * V0 / R / T0 = 100 * 7 / 8.314472 / 240.544439
# = 0.35
#
# At t = 1, p = 200.
[Problem]
coord_type = RZ
[]
[GlobalParams]
displacements = 'disp_r disp_z'
[]
[Mesh]
file = rz.e
[]
[Functions]
[temperature]
type = PiecewiseLinear
x = '0 1'
y = '1 2'
scale_factor = 240.54443866068704
[]
[]
[Variables]
[disp_r]
[]
[disp_z]
[]
[temp]
initial_condition = 240.54443866068704
[]
[]
[Kernels]
[TensorMechanics]
use_displaced_mesh = true
use_automatic_differentiation = true
[]
[heat]
type = ADDiffusion
variable = temp
use_displaced_mesh = true
[]
[]
[BCs]
[no_x]
type = DirichletBC
variable = disp_r
boundary = '1 2'
value = 0.0
[]
[no_y]
type = DirichletBC
variable = disp_z
boundary = '1 2'
value = 0.0
[]
[temperatureInterior]
type = ADFunctionDirichletBC
preset = false
boundary = 2
function = temperature
variable = temp
[]
[CavityPressure]
[1]
boundary = 2
initial_pressure = 100
R = 8.314472
temperature = aveTempInterior
volume = internalVolume
startup_time = 0.5
output = ppress
use_automatic_differentiation = true
[]
[]
[]
[Materials]
[elastic_tensor1]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
block = 1
[]
[strain1]
type = ADComputeAxisymmetricRZFiniteStrain
block = 1
[]
[stress1]
type = ADComputeFiniteStrainElasticStress
block = 1
[]
[elastic_tensor2]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
block = 2
[]
[strain2]
type = ADComputeAxisymmetricRZFiniteStrain
block = 2
[]
[stress2]
type = ADComputeFiniteStrainElasticStress
block = 2
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu'
nl_abs_tol = 1e-10
l_max_its = 20
dt = 0.5
end_time = 1.0
use_pre_SMO_residual = true
[]
[Postprocessors]
[internalVolume]
type = InternalVolume
boundary = 2
execute_on = 'initial linear'
[]
[aveTempInterior]
type = SideAverageValue
boundary = 2
variable = temp
execute_on = 'initial linear'
[]
[]
[Outputs]
exodus = true
[checkpoint]
type = Checkpoint
num_files = 1
[]
[]
(test/tests/transfers/multiapp_nearest_node_transfer/cached_multiple_apps/child.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 1
dx = '10'
ix = '10'
[]
[]
[Variables]
[dummy]
[]
[]
[AuxVariables]
[Temperature]
[]
[Temperature_elem]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[extra]
type = ADDiffusion
variable = dummy
[]
[]
[BCs]
[extra_dummy]
type = DirichletBC
variable = dummy
boundary = '1'
value = 0.0
[]
[]
[Problem]
solve = false
[]
[Executioner]
type = Transient
num_steps = 2
[]
[Outputs]
exodus = true
execute_on = 'timestep_end final'
[]
(test/tests/misc/max_var_n_dofs_per_elem/max_var_n_dofs_per_elem.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
nz = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Executioner]
type = Steady
# Preconditioned JFNK (default)
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Postprocessors]
[./max_dofs]
type = MaxVarNDofsPerElemPP
[../]
[]
[Outputs]
csv = true
[]
(python/pyhit/tests/input.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
xmax = 3
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = u
boundary = right
value = 100
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
csv = true
[]
(test/tests/reporters/iteration_info/iteration_info_steady.i)
[Mesh]
[generate]
type = GeneratedMeshGenerator
dim = 1
nx = 10
[]
[]
[Variables/u][]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
boundary = right
value = 10
[]
[]
[Executioner]
type = Steady
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/multiapps/auto_diff_auto_scaling/sub.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right]
type = FunctionDirichletBC
variable = u
boundary = right
function = 't'
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
num_steps = 2
solve_type = 'Newton'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
automatic_scaling = true
verbose = true
[]
[Outputs]
exodus = true
[]
(test/tests/parser/map_param/test.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[Variables]
[u]
[]
[v]
[]
[w]
[]
[]
[Kernels]
inactive = 'odd_entries bad_value'
[diff]
type = ADDiffusion
variable = u
[]
[diff_v]
type = ADDiffusion
variable = v
[]
[diff_w]
type = ADDiffusion
variable = w
[]
[map]
type = MapMultiplyCoupledVars
variable = u
v = v
w = w
coupled_var_multipliers = 'v 2 w 3'
dummy_string_to_string_map = 'a 1 b c'
dummy_ullong_to_uint_map = '5000000000 1 2 0'
dummy_uint_to_uint_map = '50 1 2 0'
dummy_ulong_to_uint_map = '50 1 2 0'
[]
[odd_entries]
type = MapMultiplyCoupledVars
variable = u
v = v
w = w
coupled_var_multipliers = 'v 2 w'
dummy_string_to_string_map = 'a 1 b c'
dummy_ullong_to_uint_map = '5000000000 1 2 0'
dummy_uint_to_uint_map = '50 1 2 0'
dummy_ulong_to_uint_map = '50 1 2 0'
[]
[bad_value]
type = MapMultiplyCoupledVars
variable = u
v = v
w = w
coupled_var_multipliers = 'v 2 w a'
dummy_string_to_string_map = 'a 1 b c'
dummy_ullong_to_uint_map = '5000000000 1 2 0'
dummy_uint_to_uint_map = '50 1 2 0'
dummy_ulong_to_uint_map = '50 1 2 0'
[]
[]
[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
[]
[left_w]
type = DirichletBC
variable = w
boundary = left
value = 0
[]
[right_w]
type = DirichletBC
variable = w
boundary = right
value = 1
[]
[]
[Executioner]
type = Steady
solve_type = 'Newton'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(test/tests/fvkernels/fv_simple_diffusion/neumann.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[v]
family = MONOMIAL
order = CONSTANT
fv = true
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[FVKernels]
[diff]
type = FVDiffusion
variable = v
coeff = coeff
[]
[]
[FVBCs]
[left]
type = FVNeumannBC
variable = v
boundary = left
value = 5
[]
[right]
type = FVDirichletBC
variable = v
boundary = right
value = 42
[]
[]
[Materials]
[diff]
type = ADGenericFunctorMaterial
prop_names = 'coeff'
prop_values = '1'
[]
[]
[BCs]
[left]
type = ADNeumannBC
variable = u
boundary = left
value = 5
[]
[right]
type = ADDirichletBC
variable = u
boundary = right
value = 42
[]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
(test/tests/transfers/multiapp_nearest_node_transfer/cached_multiple_apps/main.i)
[Mesh]
[cmg]
type = CartesianMeshGenerator
dim = 3
dx = 2
dy = 2
dz = 2
ix = 1
iy = 5
iz = 5
[]
[translate]
type = TransformGenerator
input = cmg
transform = TRANSLATE
vector_value = '-1 -1 -1'
[]
[]
[Variables]
[dummy]
[]
[]
[AuxVariables]
[Temperature]
[]
[Layered_Average]
[]
[Layered_Average_elem]
family = MONOMIAL
order = CONSTANT
[]
[Subapp_Temp]
[]
[Subapp_Temp_elem]
family = MONOMIAL
order = CONSTANT
[]
[]
[Kernels]
[extra]
type = ADDiffusion
variable = dummy
[]
[]
[AuxKernels]
[Location_Based]
type = ParsedAux
variable = Temperature
expression = 'x+y+z'
use_xyzt = true
[]
[Layered_Average_User_Object]
type = SpatialUserObjectAux
variable = Layered_Average
user_object = Tfuel_UO
[]
[Layered_Average_User_Object_elem]
type = SpatialUserObjectAux
variable = Layered_Average_elem
user_object = Tfuel_UO
[]
[]
[UserObjects]
[Tfuel_UO]
type = NearestPointLayeredAverage
variable = Temperature
direction = x
num_layers = 1
points_file = 'locations.txt'
execute_on = 'initial timestep_end'
[]
[]
[MultiApps]
[TF_sub]
type = FullSolveMultiApp
positions_file = 'locations.txt'
input_files = 'child.i'
execute_on = 'TIMESTEP_END'
[]
[]
[GlobalParams]
bbox_factor = 2
[]
[Transfers]
[to_sub_layers]
type = MultiAppNearestNodeTransfer
to_multi_app = TF_sub
source_variable = Layered_Average
variable = Temperature
fixed_meshes = True
[]
[to_sub_layers_elem]
type = MultiAppNearestNodeTransfer
to_multi_app = TF_sub
source_variable = Layered_Average_elem
variable = Temperature_elem
[]
[from_sub_recover_layers]
type = MultiAppNearestNodeTransfer
from_multi_app = TF_sub
source_variable = Temperature
variable = Subapp_Temp
[]
[from_sub_recover_layers_elem]
type = MultiAppNearestNodeTransfer
from_multi_app = TF_sub
source_variable = Temperature_elem
variable = Subapp_Temp_elem
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
# First step does not use Transfers caching
# Second step does
num_steps = 2
[]
[Outputs]
[out]
type = Exodus
hide = 'dummy Temperature Layered_Average Layered_Average_elem'
[]
[]
(modules/combined/test/tests/thermal_elastic/ad-thermal_elastic.i)
# Patch Test
# This test is designed to compute constant xx, yy, zz, xy, yz, and xz
# stress on a set of irregular hexes. The mesh is composed of one
# block with seven elements. The elements form a unit cube with one
# internal element. There is a nodeset for each exterior node.
# The cube is displaced by 1e-6 units in x, 2e-6 in y, and 3e-6 in z.
# The faces are sheared as well (1e-6, 2e-6, and 3e-6 for xy, yz, and
# zx). This gives a uniform strain/stress state for all six unique
# tensor components. This displacement is again applied in the second
# step.
# With Young's modulus at 1e6 and Poisson's ratio at 0, the shear
# modulus is 5e5 (G=E/2/(1+nu)). Therefore, for the mechanical strain,
#
# stress xx = 1e6 * 1e-6 = 1
# stress yy = 1e6 * 2e-6 = 2
# stress zz = 1e6 * 3e-6 = 3
# stress xy = 2 * 5e5 * 1e-6 / 2 = 0.5
# (2 * G * gamma_xy / 2 = 2 * G * epsilon_xy)
# stress yz = 2 * 5e5 * 2e-6 / 2 = 1
# stress zx = 2 * 5e5 * 3e-6 / 2 = 1.5
# Young's modulus is a function of temperature for this test. The
# temperature changes from 100 to 500. The Young's modulus drops
# due to that temperature change from 1e6 to 6e5.
# Poisson's ratio also is a function of temperature and changes from
# 0 to 0.25.
# At the end of the temperature ramp, E=6e5 and nu=0.25. This gives
# G=2.4e=5. lambda=E*nu/(1+nu)/(1-2*nu)=2.4E5. The final stress
# is therefore
# stress xx = 2.4e5 * 12e-6 + 2*2.4e5*2e-6 = 3.84
# stress yy = 2.4e5 * 12e-6 + 2*2.4e5*4e-6 = 4.80
# stress zz = 2.4e5 * 12e-6 + 2*2.4e5*6e-6 = 5.76
# stress xy = 2 * 2.4e5 * 2e-6 / 2 = 0.48
# (2 * G * gamma_xy / 2 = 2 * G * epsilon_xy)
# stress yz = 2 * 2.4e5 * 4e-6 / 2 = 0.96
# stress xz = 2 * 2.4e5 * 6e-6 / 2 = 1.44
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
file = thermal_elastic.e
[]
[Functions]
[./ramp1]
type = PiecewiseLinear
x = '0. 1. 2.'
y = '0. 1. 2.'
scale_factor = 1e-6
[../]
[./ramp2]
type = PiecewiseLinear
x = '0. 1. 2.'
y = '0. 1. 2.'
scale_factor = 2e-6
[../]
[./ramp3]
type = PiecewiseLinear
x = '0. 1. 2.'
y = '0. 1. 2.'
scale_factor = 3e-6
[../]
[./ramp4]
type = PiecewiseLinear
x = '0. 1. 2.'
y = '0. 1. 2.'
scale_factor = 4e-6
[../]
[./ramp6]
type = PiecewiseLinear
x = '0. 1. 2.'
y = '0. 1. 2.'
scale_factor = 6e-6
[../]
[./tempFunc]
type = PiecewiseLinear
x = '0 1 2'
y = '100.0 100.0 500.0'
[../]
[]
[Variables]
[./temp]
initial_condition = 100.0
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_xz stress_yz'
strain = FINITE
use_automatic_differentiation = true
[../]
[]
[Kernels]
[./heat]
type = ADDiffusion
variable = temp
[../]
[]
[BCs]
[./node1_x]
type = DirichletBC
variable = disp_x
boundary = 1
value = 0.0
[../]
[./node1_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 1
function = ramp2
[../]
[./node1_z]
type = ADFunctionDirichletBC
variable = disp_z
boundary = 1
function = ramp3
[../]
[./node2_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 2
function = ramp1
[../]
[./node2_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 2
function = ramp2
[../]
[./node2_z]
type = ADFunctionDirichletBC
variable = disp_z
boundary = 2
function = ramp6
[../]
[./node3_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 3
function = ramp1
[../]
[./node3_y]
type = DirichletBC
variable = disp_y
boundary = 3
value = 0.0
[../]
[./node3_z]
type = ADFunctionDirichletBC
variable = disp_z
boundary = 3
function = ramp3
[../]
[./node4_x]
type = DirichletBC
variable = disp_x
boundary = 4
value = 0.0
[../]
[./node4_y]
type = DirichletBC
variable = disp_y
boundary = 4
value = 0.0
[../]
[./node4_z]
type = DirichletBC
variable = disp_z
boundary = 4
value = 0.0
[../]
[./node5_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 5
function = ramp1
[../]
[./node5_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 5
function = ramp4
[../]
[./node5_z]
type = ADFunctionDirichletBC
variable = disp_z
boundary = 5
function = ramp3
[../]
[./node6_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 6
function = ramp2
[../]
[./node6_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 6
function = ramp4
[../]
[./node6_z]
type = ADFunctionDirichletBC
variable = disp_z
boundary = 6
function = ramp6
[../]
[./node7_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 7
function = ramp2
[../]
[./node7_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 7
function = ramp2
[../]
[./node7_z]
type = ADFunctionDirichletBC
variable = disp_z
boundary = 7
function = ramp3
[../]
[./node8_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 8
function = ramp1
[../]
[./node8_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 8
function = ramp2
[../]
[./node8_z]
type = DirichletBC
variable = disp_z
boundary = 8
value = 0.0
[../]
[./temp]
type = ADFunctionDirichletBC
variable = temp
boundary = '10 12'
function = tempFunc
[../]
[]
[Materials]
[./youngs_modulus]
type = ADPiecewiseLinearInterpolationMaterial
x = '100 500'
y = '1e6 6e5'
property = youngs_modulus
variable = temp
[../]
[./poissons_ratio]
type = ADPiecewiseLinearInterpolationMaterial
x = '100 500'
y = '0 0.25'
property = poissons_ratio
variable = temp
[../]
[./elasticity_tensor]
type = ADComputeVariableIsotropicElasticityTensor
youngs_modulus = youngs_modulus
poissons_ratio = poissons_ratio
[../]
[./stress]
type = ADComputeFiniteStrainElasticStress
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-9
l_max_its = 20
start_time = 0.0
dt = 1.0
end_time = 2.0
[]
[Outputs]
exodus = true
[]
(test/tests/kernels/ad_coupled_force/fe_test.i)
[Mesh]
[square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[]
[]
[Variables]
[u]
[]
[v]
[]
[]
[Kernels]
[diff_u]
type = ADDiffusion
variable = u
[]
[force_u]
type = ADCoupledForce
variable = u
v = v
[]
[diff_v]
type = ADDiffusion
variable = v
[]
[]
[BCs]
[left_u]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right_u]
type = DirichletBC
variable = u
boundary = right
value = 1
[]
[left_v]
type = DirichletBC
variable = v
boundary = left
value = 5
[]
[right_v]
type = DirichletBC
variable = v
boundary = right
value = 3
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
(test/tests/bcs/ad_penalty_dirichlet_bc/function_penalty_dirichlet_bc_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD9
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = -4+x*x+y*y
[../]
[./solution]
type = ParsedGradFunction
value = x*x+y*y
grad_x = 2*x
grad_y = 2*y
[../]
[]
[Variables]
[./u]
order = SECOND
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = ADDiffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = ADBodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
active = 'bc_all'
[./bc_all]
type = ADFunctionPenaltyDirichletBC
variable = u
function = solution
boundary = 'top left right bottom'
penalty = 1e6
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_rel_tol = 1e-14
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(modules/misc/test/tests/kernels/thermo_diffusion/ad_thermo_diffusion.i)
# Steady-state test for the ThermoDiffusion kernel.
#
# This test applies a constant temperature gradient to drive thermo-diffusion
# in the variable u. At steady state, the thermo-diffusion is balanced by
# diffusion due to Fick's Law, so the total flux is
#
# J = -D ( grad(u) - ( Qstar u / R ) grad(1/T) )
#
# If there are no fluxes at the boundaries, then there is no background flux and
# these two terms must balance each other everywhere:
#
# grad(u) = ( Qstar u / R ) grad(1/T)
#
# The dx can be eliminated to give
#
# d(ln u) / d(1/T) = Qstar / R
#
# This can be solved to give the profile for u as a function of temperature:
#
# u = A exp( Qstar / R T )
#
# Here, we are using simple heat conduction with Dirichlet boundaries on 0 <= x <= 1
# to give a linear profile for temperature: T = x + 1. We also need to apply one
# boundary condition on u, which is u(x=0) = 1. These conditions give:
#
# u = exp( -(Qstar/R) (x/(x+1)) )
#
# This analytical result is tracked by the aux variable "correct_u".
[Mesh]
type = GeneratedMesh
dim = 1
nx = 100
[]
[Variables]
[./u]
initial_condition = 1
[../]
[./temp]
initial_condition = 1
[../]
[]
[Kernels]
[./soret]
type = ADThermoDiffusion
variable = u
temperature = temp
[../]
[./diffC]
type = ADDiffusion
variable = u
[../]
# Heat diffusion gives a linear temperature profile to drive the Soret diffusion.
[./diffT]
type = ADDiffusion
variable = temp
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
preset = false
boundary = left
value = 1
[../]
[./leftt]
type = DirichletBC
variable = temp
preset = false
boundary = left
value = 1
[../]
[./rightt]
type = DirichletBC
variable = temp
preset = false
boundary = right
value = 2
[../]
[]
[Materials]
[./ad_soret_coefficient]
type = ADSoretCoeffTest
temperature = temp
coupled_var = u
[../]
[]
[Preconditioning]
[./full]
type = SMP
full = true
[../]
[]
[Executioner]
type = Steady
[]
[Postprocessors]
[./error]
type = NodalL2Error
variable = u
function = 'exp(-x/(x+1))'
[../]
[]
[Outputs]
execute_on = FINAL
exodus = true
[]
(modules/misc/test/tests/ad_arrhenius_material_property/exact.i)
[Mesh]
[mesh]
type = GeneratedMeshGenerator
dim = 1
[]
[]
[Variables]
[temp]
initial_condition = 1100
[]
[]
[Kernels]
[heat]
type = ADDiffusion
variable = temp
[]
[]
[BCs]
[temp]
type = ADFunctionDirichletBC
variable = temp
boundary = 'left right'
function = '100 * t + 100'
[]
[]
[Materials]
[D]
type = ADArrheniusMaterialProperty
temperature = temp
activation_energy = '0.5 0.1'
frequency_factor = '5 3e-3'
gas_constant = 8.617e-5
property_name = D
outputs = all
[]
[D_exact]
type = ParsedMaterial
property_name = D_exact
coupled_variables = temp
constant_names = 'Q1 D01 Q2 D02 R'
constant_expressions = '0.5 5 0.1 3e-3 8.617e-5'
expression = 'D01 * exp(-Q1 / R / temp) + D02 * exp(-Q2 / R / temp)'
outputs = all
[]
[]
[Executioner]
type = Transient
num_steps = 10
[]
[Postprocessors]
[D]
type = ElementAverageValue
variable = D
[]
[D_exact]
type = ElementAverageValue
variable = D_exact
[]
[diff_D]
type = DifferencePostprocessor
value1 = 'D'
value2 = 'D_exact'
outputs = console
[]
[]
[Outputs]
csv = true
[]
(test/tests/mortar/ad_periodic_segmental_constraint/penalty_periodic_checker2d.i)
[Mesh]
[left_block]
type = GeneratedMeshGenerator
dim = 2
xmin = -1.0
xmax = 1.0
ymin = -1.0
ymax = 1.0
nx = 16
ny = 16
elem_type = QUAD4
[]
[left_block_sidesets]
type = RenameBoundaryGenerator
input = left_block
old_boundary = '0 1 2 3'
new_boundary = '10 11 12 13'
[]
[left_block_id]
type = SubdomainIDGenerator
input = left_block_sidesets
subdomain_id = 1
[]
[./lowrig]
type = SubdomainBoundingBoxGenerator
input = 'left_block_id'
block_id = 2
bottom_left = '0 -1 0'
top_right = '1 0 0'
[../]
[./upplef]
type = SubdomainBoundingBoxGenerator
input = 'lowrig'
block_id = 3
bottom_left = '-1 0 0'
top_right = '0 1 0'
[../]
[./upprig]
type = SubdomainBoundingBoxGenerator
input = 'upplef'
block_id = 4
bottom_left = '0 0 0'
top_right = '1 1 0'
[../]
[left]
type = LowerDBlockFromSidesetGenerator
input = upprig
sidesets = '13'
new_block_id = '10003'
new_block_name = 'secondary_left'
[]
[right]
type = LowerDBlockFromSidesetGenerator
input = left
sidesets = '11'
new_block_id = '10001'
new_block_name = 'primary_right'
[]
[bottom]
type = LowerDBlockFromSidesetGenerator
input = right
sidesets = '10'
new_block_id = '10000'
new_block_name = 'secondary_bottom'
[]
[top]
type = LowerDBlockFromSidesetGenerator
input = bottom
sidesets = '12'
new_block_id = '10002'
new_block_name = 'primary_top'
[]
[corner_node]
type = ExtraNodesetGenerator
new_boundary = 'pinned_node'
nodes = '0'
input = top
[]
[]
[Variables]
[u]
order = FIRST
family = LAGRANGE
[]
[epsilon]
order = SECOND
family = SCALAR
[]
[]
[AuxVariables]
[sigma]
order = SECOND
family = SCALAR
[]
[./flux_x]
order = FIRST
family = MONOMIAL
[../]
[./flux_y]
order = FIRST
family = MONOMIAL
[../]
[]
[AuxScalarKernels]
[sigma]
type = FunctionScalarAux
variable = sigma
function = '1 3'
execute_on = initial #timestep_end
[]
[]
[AuxKernels]
[./flux_x]
type = DiffusionFluxAux
diffusivity = 'conductivity'
variable = flux_x
diffusion_variable = u
component = x
block = '1 2 3 4'
[../]
[./flux_y]
type = DiffusionFluxAux
diffusivity = 'conductivity'
variable = flux_y
diffusion_variable = u
component = y
block = '1 2 3 4'
[../]
[]
[Kernels]
[diff1]
type = ADDiffusion
variable = u
block = '1 4'
[]
[diff2]
type = ADMatDiffusion
variable = u
block = '2 3'
diffusivity = conductivity
[]
[]
[Materials]
[k1]
type = ADGenericConstantMaterial
prop_names = 'conductivity'
prop_values = 1.0
block = '1 4'
[]
[k2]
type = ADGenericConstantMaterial
prop_names = 'conductivity'
prop_values = 10.0
block = '2 3'
[]
[]
[Problem]
kernel_coverage_check = false
error_on_jacobian_nonzero_reallocation = true
[]
[BCs]
[fix_right]
type = DirichletBC
variable = u
boundary = pinned_node
value = 0
[]
[]
[Constraints]
[mortarlr]
type = ADPenaltyEqualValueConstraint
primary_boundary = '11'
secondary_boundary = '13'
primary_subdomain = 'primary_right'
secondary_subdomain = 'secondary_left'
secondary_variable = u
correct_edge_dropping = true
penalty_value = 1.e2
[]
[periodiclr]
type = ADPenaltyPeriodicSegmentalConstraint
primary_boundary = '11'
secondary_boundary = '13'
primary_subdomain = 'primary_right'
secondary_subdomain = 'secondary_left'
secondary_variable = u
epsilon = epsilon
sigma = sigma
correct_edge_dropping = true
penalty_value = 1.e2
[]
[mortarbt]
type = ADPenaltyEqualValueConstraint
primary_boundary = '12'
secondary_boundary = '10'
primary_subdomain = 'primary_top'
secondary_subdomain = 'secondary_bottom'
secondary_variable = u
correct_edge_dropping = true
penalty_value = 1.e2
[]
[periodicbt]
type = ADPenaltyPeriodicSegmentalConstraint
primary_boundary = '12'
secondary_boundary = '10'
primary_subdomain = 'primary_top'
secondary_subdomain = 'secondary_bottom'
secondary_variable = u
epsilon = epsilon
sigma = sigma
correct_edge_dropping = true
penalty_value = 1.e2
[]
[]
[Preconditioning]
[smp]
full = true
type = SMP
[]
[]
[Executioner]
type = Steady
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
solve_type = NEWTON
[]
[Postprocessors]
[max]
type = ElementExtremeValue
variable = 'flux_x'
[]
[]
[Outputs]
csv = 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
[]
(test/tests/kernels/ad_vector_couple/ad_vector_couple.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 20
ny = 20
[]
[Variables]
[u]
family = LAGRANGE
order = FIRST
[]
[v]
family = LAGRANGE_VEC
order = FIRST
[]
[]
[Kernels]
[time]
type = TimeDerivative
variable = u
[]
[diff]
type = ADDiffusion
variable = u
[]
[convection]
type = ADCoupledVectorConvection
variable = u
velocity_vector = v
[]
[diff_v]
type = ADVectorDiffusion
variable = v
[]
[]
[BCs]
[left]
type = ADFunctionDirichletBC
variable = u
function = 1
boundary = 'left'
[]
[right]
type = ADFunctionDirichletBC
variable = u
function = 2
boundary = 'bottom'
[]
[left_v]
type = ADVectorFunctionDirichletBC
variable = v
function_x = 1
function_y = 2
boundary = 'left'
[]
[right_v]
type = ADVectorFunctionDirichletBC
variable = v
function_x = 4
function_y = 8
boundary = 'top'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
num_steps = 10
dt = 0.05
[]
[Outputs]
execute_on = TIMESTEP_END
exodus = true
[]
(test/tests/geomsearch/quadrature_nearest_node_locator/qnnl_ad.i)
[Mesh]
file = 2dcontact_collide.e
displacements = 'disp_x disp_y'
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxVariables]
[./distance]
order = CONSTANT
family = MONOMIAL
[../]
[disp_x][]
[disp_y][]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
use_displaced_mesh = true
[../]
[]
[AuxKernels]
[./distance]
type = NearestNodeDistanceAux
variable = distance
boundary = 2
paired_boundary = 3
[../]
[]
[BCs]
[./block1_left]
type = DirichletBC
variable = u
boundary = 1
value = 0
[../]
[./block1_right]
type = DirichletBC
variable = u
boundary = 2
value = 1
[../]
[./block2_left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[./block2_right]
type = DirichletBC
variable = u
boundary = 4
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
exodus = true
file_base = qnnl_ad
[]
(test/tests/kernels/ad_reaction/ad_reaction.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
[]
[Variables]
[u]
[]
[]
[Kernels]
[diffusion]
type = ADDiffusion
variable = u
[]
[reaction]
type = ADReaction
variable = u
[]
[force]
type = ADBodyForce
variable = u
[]
[]
[BCs]
[left]
type = ADDirichletBC
boundary = left
variable = u
value = 0
[]
[]
[Executioner]
type = Steady
solve_type = NEWTON
[]
[Outputs]
exodus = true
[]
(python/mms/test/mms_spatial.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 8
ny = 8
[]
[Variables]
[u][]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[force]
type = BodyForce
variable = u
function = force
[]
[]
[Functions]
[exact]
type = ParsedFunction
expression = 'sin(2*pi*x)*sin(2*pi*y)'
[]
[force]
type = ParsedFunction
expression = '8*pi^2*sin(2*x*pi)*sin(2*y*pi)'
[]
[]
[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 = Steady
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
csv = 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/kernels/ad_2d_diffusion/2d_diffusion_neumannbc_test.i)
[Mesh]
[./square]
type = GeneratedMeshGenerator
nx = 2
ny = 2
dim = 2
[../]
[]
[Variables]
[./u]
[../]
[]
[Kernels]
[./diff]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
[./left]
type = DirichletBC
variable = u
boundary = 3
value = 0
[../]
[./right]
type = ADNeumannBC
variable = u
boundary = 1
value = 1
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[Outputs]
file_base = neumannbc_out
exodus = true
[]
(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/bcs/ad_penalty_dirichlet_bc/penalty_dirichlet_bc_test.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD9
[]
[Functions]
[./forcing_fn]
type = ParsedFunction
expression = -2*(x*x+y*y-2)+(1-x*x)*(1-y*y)
[../]
[./solution]
type = ParsedGradFunction
value = (1-x*x)*(1-y*y)
grad_x = 2*(x*y*y-x)
grad_y = 2*(x*x*y-y)
[../]
[]
[Variables]
[./u]
order = SECOND
family = HIERARCHIC
[../]
[]
[Kernels]
active = 'diff forcing reaction'
[./diff]
type = ADDiffusion
variable = u
[../]
[./reaction]
type = Reaction
variable = u
[../]
[./forcing]
type = ADBodyForce
variable = u
function = forcing_fn
[../]
[]
[BCs]
active = 'bc_all'
[./bc_all]
type = ADPenaltyDirichletBC
variable = u
value = 0
boundary = 'top left right bottom'
penalty = 1e5
[../]
[]
[Postprocessors]
[./dofs]
type = NumDOFs
[../]
[./h]
type = AverageElementSize
[../]
[./L2error]
type = ElementL2Error
variable = u
function = solution
[../]
[./H1error]
type = ElementH1Error
variable = u
function = solution
[../]
[./H1Semierror]
type = ElementH1SemiError
variable = u
function = solution
[../]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
nl_rel_tol = 1e-14
[]
[Outputs]
execute_on = 'timestep_end'
exodus = true
[]
(test/tests/materials/ad_piecewise_linear_interpolation_material/piecewise_linear_interpolation_material.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 3
ny = 3
nz = 0
elem_type = QUAD4
[]
[Variables]
[./u]
order = FIRST
family = LAGRANGE
[../]
[]
[Kernels]
[./diff1]
type = ADDiffusion
variable = u
[../]
[]
[BCs]
[./left_u]
type = DirichletBC
variable = u
boundary = left
value = 0
[../]
[./right_u]
type = DirichletBC
variable = u
boundary = right
value = 1
[../]
[]
[Materials]
[./m1]
type = ADPiecewiseLinearInterpolationMaterial
property = m1
variable = u
xy_data = '0 0
1 1'
block = 0
outputs = all
[../]
[./m2]
type = ADPiecewiseLinearInterpolationMaterial
property = m2
variable = u
x = '0 1'
y = '0 1'
block = 0
outputs = all
[../]
[]
[Executioner]
type = Steady
solve_type = 'PJFNK'
[]
[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/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'
[]
(modules/combined/test/tests/ad_cavity_pressure/initial_temperature.i)
#
# Cavity Pressure Test
#
# This test is designed to compute an internal pressure based on
# p = n * R * T / V
# where
# p is the pressure
# n is the amount of material in the volume (moles)
# R is the universal gas constant
# T is the temperature
# V is the volume
#
# The mesh is composed of one block (1) with an interior cavity of volume 8.
# Block 2 sits in the cavity and has a volume of 1. Thus, the total
# initial volume is 7.
# The test adjusts n, T, and V in the following way:
# n => n0 + alpha * t
# T => T0 + beta * t
# V => V0 + gamma * t
# with
# alpha = n0
# beta = T0 / 2
# gamma = -(0.003322259...) * V0
# T0 = 240.54443866068704
# V0 = 7
# n0 = f(p0)
# p0 = 100
# R = 8.314472 J * K^(-1) * mol^(-1)
#
# So, n0 = p0 * V0 / R / T0 = 100 * 7 / 8.314472 / 240.544439
# = 0.35
#
# The parameters combined at t = 1 gives p = 301.
#
# This test sets the initial temperature to 500, but the CavityPressure
# is told that that initial temperature is T0. Thus, the final solution
# is unchanged.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
file = 3d.e
[]
[GlobalParams]
volumetric_locking_correction = true
[]
[Functions]
[displ_positive]
type = PiecewiseLinear
x = '0 1'
y = '0 0.0029069767441859684'
[]
[displ_negative]
type = PiecewiseLinear
x = '0 1'
y = '0 -0.0029069767441859684'
[]
[temp1]
type = PiecewiseLinear
x = '0 1'
y = '1 1.5'
scale_factor = 240.54443866068704
[]
[material_input_function]
type = PiecewiseLinear
x = '0 1'
y = '0 0.35'
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[temp]
initial_condition = 500
[]
[material_input]
[]
[]
[AuxVariables]
[pressure_residual_x]
[]
[pressure_residual_y]
[]
[pressure_residual_z]
[]
[stress_xx]
order = CONSTANT
family = MONOMIAL
[]
[stress_yy]
order = CONSTANT
family = MONOMIAL
[]
[stress_zz]
order = CONSTANT
family = MONOMIAL
[]
[stress_xy]
order = CONSTANT
family = MONOMIAL
[]
[stress_yz]
order = CONSTANT
family = MONOMIAL
[]
[stress_zx]
order = CONSTANT
family = MONOMIAL
[]
[]
[Kernels]
[TensorMechanics]
use_displaced_mesh = true
use_automatic_differentiation = true
[]
[heat]
type = ADDiffusion
variable = temp
use_displaced_mesh = true
[]
[material_input_dummy]
type = ADDiffusion
variable = material_input
use_displaced_mesh = true
[]
[]
[AuxKernels]
[stress_xx]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = stress_xx
[]
[stress_yy]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = stress_yy
[]
[stress_zz]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = stress_zz
[]
[stress_xy]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 1
variable = stress_xy
[]
[stress_yz]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 2
variable = stress_yz
[]
[stress_zx]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 0
variable = stress_zx
[]
[]
[BCs]
[no_x_exterior]
type = DirichletBC
variable = disp_x
boundary = '7 8'
value = 0.0
[]
[no_y_exterior]
type = DirichletBC
variable = disp_y
boundary = '9 10'
value = 0.0
[]
[no_z_exterior]
type = DirichletBC
variable = disp_z
boundary = '11 12'
value = 0.0
[]
[prescribed_left]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 13
function = displ_positive
[]
[prescribed_right]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 14
function = displ_negative
[]
[no_y]
type = DirichletBC
variable = disp_y
boundary = '15 16'
value = 0.0
[]
[no_z]
type = DirichletBC
variable = disp_z
boundary = '17 18'
value = 0.0
[]
[no_x_interior]
type = DirichletBC
variable = disp_x
boundary = '1 2'
value = 0.0
[]
[no_y_interior]
type = DirichletBC
variable = disp_y
boundary = '3 4'
value = 0.0
[]
[no_z_interior]
type = DirichletBC
variable = disp_z
boundary = '5 6'
value = 0.0
[]
[temperatureInterior]
type = ADFunctionDirichletBC
boundary = 100
function = temp1
variable = temp
[]
[MaterialInput]
type = ADFunctionDirichletBC
boundary = '100 13 14 15 16'
function = material_input_function
variable = material_input
[]
[CavityPressure]
[1]
boundary = 100
initial_pressure = 100
material_input = materialInput
R = 8.314472
temperature = aveTempInterior
initial_temperature = 240.54443866068704
volume = internalVolume
startup_time = 0.5
output = ppress
save_in = 'pressure_residual_x pressure_residual_y pressure_residual_z'
use_automatic_differentiation = true
[]
[]
[]
[Materials]
[elast_tensor1]
type = ADComputeElasticityTensor
C_ijkl = '0 5'
fill_method = symmetric_isotropic
block = 1
[]
[strain1]
type = ADComputeFiniteStrain
block = 1
[]
[stress1]
type = ADComputeFiniteStrainElasticStress
block = 1
[]
[elast_tensor2]
type = ADComputeElasticityTensor
C_ijkl = '0 5'
fill_method = symmetric_isotropic
block = 2
[]
[strain2]
type = ADComputeFiniteStrain
block = 2
[]
[stress2]
type = ADComputeFiniteStrainElasticStress
block = 2
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -sub_pc_type'
petsc_options_value = 'asm lu'
nl_rel_tol = 1e-12
l_tol = 1e-12
l_max_its = 20
dt = 0.5
end_time = 1.0
use_pre_SMO_residual = true
[]
[Postprocessors]
[internalVolume]
type = InternalVolume
boundary = 100
execute_on = 'initial linear'
[]
[aveTempInterior]
type = SideAverageValue
boundary = 100
variable = temp
execute_on = 'initial linear'
[]
[materialInput]
type = SideAverageValue
boundary = '7 8 9 10 11 12'
variable = material_input
execute_on = linear
[]
[]
[Outputs]
exodus = true
[]
(python/pyhit/tests/input_modified.i)
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 1
xmax = 3
x_max = 4 # Changed from 3 to 4
[]
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[]
[BCs]
[left]
type = ADDirichletBC
variable = u
boundary = left
value = 300
[]
[right]
type = ADNeumannBC
variable = u
boundary = right
value = 100
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
[]
[Outputs]
csv = true
[]
(tutorials/tutorial01_app_development/step02_input_file/problems/pressure_diffusion.i)
[Mesh]
type = GeneratedMesh # Can generate simple lines, rectangles and rectangular prisms
dim = 2 # Dimension of the mesh
nx = 100 # Number of elements in the x direction
ny = 10 # Number of elements in the y direction
xmax = 0.304 # Length of test chamber
ymax = 0.0257 # Test chamber radius
[]
[Problem]
type = FEProblem # This is the "normal" type of Finite Element Problem in MOOSE
coord_type = RZ # Axisymmetric RZ
rz_coord_axis = X # Which axis the symmetry is around
[]
[Variables]
[pressure]
# Adds a Linear Lagrange variable by default
[]
[]
[Kernels]
[diffusion]
type = ADDiffusion # Laplacian operator
variable = pressure # Operate on the "pressure" variable from above
[]
[]
[BCs]
[inlet]
type = ADDirichletBC # Simple u=value BC
variable = pressure # Variable to be set
boundary = left # Name of a sideset in the mesh
value = 4000 # (Pa) From Figure 2 from paper. First data point for 1mm spheres.
[]
[outlet]
type = ADDirichletBC
variable = pressure
boundary = right
value = 0 # (Pa) Gives the correct pressure drop from Figure 2 for 1mm spheres
[]
[]
[Executioner]
type = Steady # Steady state problem
solve_type = NEWTON # Perform a Newton solve
# Set PETSc parameters to optimize solver efficiency
petsc_options_iname = '-pc_type -pc_hypre_type' # PETSc option pairs with values below
petsc_options_value = ' hypre boomeramg'
[]
[Outputs]
exodus = true # Output Exodus format
[]
(test/tests/preconditioners/auto_smp/ad_coupled_convection.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 4
ny = 4
[]
[Variables]
[u][]
[v][]
[]
[Kernels]
[diff]
type = ADDiffusion
variable = u
[]
[convection]
type = ADCoupledConvection
variable = u
velocity_vector = v
scale = 100
[]
[diff_v]
type = ADDiffusion
variable = v
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
preset = false
boundary = left
value = 0
[]
[right]
type = DirichletBC
variable = u
preset = false
boundary = right
value = 1
[]
[left_v]
type = DirichletBC
variable = v
preset = false
boundary = left
value = 0
[]
[right_v]
type = DirichletBC
variable = v
preset = false
boundary = right
value = 1
[]
[]
[Preconditioning/smp]
# this block is part of what is being tested, see "tests" file
type = SMP
full = true
[]
[Executioner]
type = Steady
solve_type = NEWTON
nl_abs_tol = 1e-10 # needed to get non-preconditioned version to fail
auto_preconditioning = false # this is part of what is being tested, see "tests" file
[]
[Outputs]
exodus = true
[]
(modules/heat_transfer/include/kernels/ADHeatConduction.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 "ADDiffusion.h"
class ADHeatConduction : public ADDiffusion
{
public:
static InputParameters validParams();
ADHeatConduction(const InputParameters & parameters);
protected:
virtual ADRealVectorValue precomputeQpResidual() override;
const ADMaterialProperty<Real> & _thermal_conductivity;
};