- boundaryThe list of boundary IDs from the mesh where this object applies
C++ Type:std::vector<BoundaryName>
Controllable:No
Description:The list of boundary IDs from the mesh where this object applies
- 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
ADFunctionDirichletBC
Imposes the essential boundary condition , where is calculated by a function.
Description
ADFunctionDirichletBC
is a generalization of DirichletBC
which imposes a possibly temporally- and spatially-dependent value defined by a MOOSE Function
object on a particular set of degrees of freedom (DOFs) defined by the boundary
parameter. That is, for a PDE of the form
where is the domain, and is its boundary, a ADFunctionDirichletBC
object can be used to impose the condition (2) if the function is well-defined for . In this case, the function
parameter corresponds to a MOOSE Function
object which represents the mathematical function , and the user must define one or more sidesets corresponding to the boundary subset via the boundary
parameter.
Note that ADFunctionDirichletBC
computes its Jacobian using automatic differentiation.
Preset boundary conditions
With the parameter preset = true
, the value of the boundary condition is applied before the solve begins. With preset = false
, the boundary condition is only enforced as the solve progresses. In most situations, presetting the boundary condition is better.
Example Input Syntax
[BCs]
[left]
type = ADFunctionDirichletBC
variable = u
boundary = left
function = '1'
[]
[right]
type = ADRobinBC
variable = u
boundary = right
coefficient = 2.0
[]
[]
(test/tests/bcs/ad_bcs/ad_bc.i)Input Parameters
- diag_save_inThe name of auxiliary variables to save this BC'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 BC's diagonal jacobian contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
- displacementsThe displacements
C++ Type:std::vector<VariableName>
Controllable:No
Description:The displacements
- function0The function describing the Dirichlet condition
Default:0
C++ Type:FunctionName
Controllable:No
Description:The function describing the Dirichlet condition
- presetTrueWhether or not to preset the BC (apply the value before the solve begins).
Default:True
C++ Type:bool
Controllable:No
Description:Whether or not to preset the BC (apply the value before the solve begins).
- save_inThe name of auxiliary variables to save this BC'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 BC's residual contributions to. Everything about that variable must match everything about this variable (the type, what blocks it's on, etc.)
Optional Parameters
- absolute_value_vector_tagsThe tags for the vectors this residual object should fill with the absolute value of the residual contribution
C++ Type:std::vector<TagName>
Controllable:No
Description:The tags for the vectors this residual object should fill with the absolute value of the residual contribution
- extra_matrix_tagsThe extra tags for the matrices this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the matrices this Kernel should fill
- extra_vector_tagsThe extra tags for the vectors this Kernel should fill
C++ Type:std::vector<TagName>
Controllable:No
Description:The extra tags for the vectors this Kernel should fill
- matrix_tagssystem timeThe tag for the matrices this Kernel should fill
Default:system time
C++ Type:MultiMooseEnum
Options:nontime, system, time
Controllable:No
Description:The tag for the matrices this Kernel should fill
- vector_tagsresidualThe tag for the vectors this Kernel should fill
Default:residual
C++ Type:MultiMooseEnum
Options:nontime, time, residual
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.
- 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
- seed0The seed for the master random number generator
Default:0
C++ Type:unsigned int
Controllable:No
Description:The seed for the master random number generator
- use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Default:False
C++ Type:bool
Controllable:No
Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.
Advanced Parameters
Input Files
- (modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/lps_single.i)
- (modules/combined/test/tests/thermo_mech/ad-youngs_modulus_function_temp.i)
- (modules/solid_mechanics/test/tests/ad_2D_geometries/2D-RZ_centerline_VLC.i)
- (modules/contact/test/tests/mortar_tm/2d/ad_frictionless_fir/small.i)
- (modules/xfem/test/tests/moving_interface/moving_ad_bimaterial.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite_action.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite.i)
- (modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/negative_porosity.i)
- (modules/contact/test/tests/mortar_tm/2d/ad_frictional/finite_rr.i)
- (modules/solid_mechanics/test/tests/substepping/ad_power_law_creep.i)
- (test/tests/bcs/ad_function_dirichlet_bc/test.i)
- (modules/contact/test/tests/3d-mortar-contact/half_sphere_nodal_geometry.i)
- (modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/creep.i)
- (modules/solid_mechanics/test/tests/ad_return_mapping/ad_return_mapping_derivative.i)
- (modules/solid_mechanics/test/tests/ad_plastic/power_law_creep.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/small-2d/small.i)
- (modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_exponential.i)
- (test/tests/controls/time_periods/bcs/adbcs.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d-rz/finite_action.i)
- (modules/contact/test/tests/mortar_restart/frictional_bouncing_block_action_restart_2.i)
- (modules/solid_mechanics/test/tests/ad_thermal_expansion_function/mean_complex.i)
- (modules/xfem/test/tests/bimaterials/glued_ad_bimaterials_2d.i)
- (modules/combined/test/tests/power_law_hardening/ADPowerLawHardening.i)
- (modules/contact/test/tests/mortar_tm/2d/ad_frictionless_sec/small.i)
- (test/tests/kernels/ad_mat_diffusion/ad_2d_steady_state.i)
- (modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_xyz.i)
- (modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_second/finite_rr.i)
- (modules/solid_mechanics/test/tests/ad_2D_geometries/2D-RZ_finiteStrain_resid.i)
- (modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_first/small.i)
- (test/tests/bcs/ad_bc_preset_nodal/bc_function_preset.i)
- (test/tests/kernels/ad_vector_couple/ad_grad_vector_couple.i)
- (modules/solid_mechanics/test/tests/ad_finite_strain_jacobian/3d_bar.i)
- (modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_second/finite.i)
- (modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_first/finite_rr.i)
- (modules/contact/test/tests/mortar_tm/2d/ad_frictional/finite.i)
- (modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_rz.i)
- (test/tests/bcs/ad_bcs/ad_bc.i)
- (modules/solid_mechanics/test/tests/ad_anisotropic_creep/anis_mech_hill_tensor_creep.i)
- (modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_multiple_softening.i)
- (modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_rz_exponential.i)
- (modules/combined/test/tests/ad_cavity_pressure/negative_volume.i)
- (modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_rotation.i)
- (modules/contact/test/tests/mortar_tm/2d/ad_frictionless_fir/finite.i)
- (modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_second/small.i)
- (modules/combined/test/tests/ad_cavity_pressure/multiple_postprocessors.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite_action_rr.i)
- (modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/lps_dual.i)
- (modules/optimization/test/tests/executioners/constrained/shape_optimization/forward.i)
- (modules/solid_mechanics/test/tests/ad_thermal_expansion_function/instantaneous_complex.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/closed_gap_thermomechanical_mortar_contact.i)
- (modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking.i)
- (modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/gtn_single.i)
- (modules/xfem/test/tests/bimaterials/inclusion_ad_bimaterials_2d.i)
- (modules/thermal_hydraulics/test/tests/components/file_mesh_component/file_mesh_component.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d-rz/finite_action_al.i)
- (modules/solid_mechanics/test/tests/multi_power_law/power_law_creep.i)
- (modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_function.i)
- (modules/combined/test/tests/ad_cavity_pressure/3d.i)
- (test/tests/kernels/ad_vector_couple/ad_vector_couple_default.i)
- (modules/contact/test/tests/verification/patch_tests/automatic_patch_update/iteration_adaptivity_parallel.i)
- (modules/combined/test/tests/ad_cavity_pressure/initial_temperature.i)
- (test/tests/time_integrators/central-difference/ad_central_difference_dotdot.i)
- (modules/heat_transfer/test/tests/verify_against_analytical/ad_2d_steady_state.i)
- (modules/combined/test/tests/thermal_elastic/ad-thermal_elastic.i)
- (modules/contact/test/tests/mortar_tm/2d/ad_frictionless_fir/finite_rr.i)
- (modules/contact/test/tests/mortar_tm/2d/ad_frictionless_sec/finite.i)
- (modules/solid_mechanics/test/tests/temperature_dependent_hardening/ADtemp_dep_hardening.i)
- (modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/lps_single_split.i)
- (modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_first/finite.i)
- (modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_power.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite_rr.i)
- (test/tests/time_integrators/newmark-beta/ad_newmark_beta_dotdot.i)
- (modules/solid_mechanics/test/tests/substepping/power_law_creep.i)
- (modules/contact/test/tests/mortar_restart/frictional_bouncing_block_action_restart_1.i)
- (modules/contact/test/tests/pdass_problems/frictional_bouncing_block.i)
- (modules/contact/test/tests/verification/patch_tests/automatic_patch_update/iteration_adaptivity_parallel_node_face.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/small-2d-rz/small.i)
- (modules/combined/test/tests/ad_cavity_pressure/additional_volume.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/small-2d/multi_component_mortar_thermal_conduction.i)
- (modules/contact/test/tests/mortar_tm/2d/ad_frictional/finite_stiff.i)
- (test/tests/kernels/ad_vector_couple/ad_vector_couple.i)
- (modules/contact/test/tests/pdass_problems/frictional_bouncing_block_action.i)
- (modules/combined/test/tests/additive_manufacturing/check_element_addition_by_variable.i)
- (modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d-rz/finite.i)
- (modules/combined/test/tests/ad_cavity_pressure/rz.i)
- (modules/contact/test/tests/mortar_tm/2d/ad_frictionless_sec/finite_rr.i)
- (modules/solid_mechanics/test/tests/ad_finite_strain_jacobian/bending_jacobian.i)
- (modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_plane_stress.i)
(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
[]
(modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/lps_single.i)
# This test provides an example of an individual LPS viscoplasticity model
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 1
xmax = 0.002
ymax = 0.002
[]
[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'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.3
[../]
[./stress]
type = ADComputeMultipleInelasticStress
inelastic_models = lps
outputs = all
[../]
[./porosity]
type = ADPorosityFromStrain
initial_porosity = 0.1
inelastic_strain = 'combined_inelastic_strain'
outputs = 'all'
[../]
[./lps]
type = ADViscoplasticityStressUpdate
coefficient = 'coef'
power = 3
outputs = all
relative_tolerance = 1e-11
[../]
[./coef]
type = ADParsedMaterial
property_name = coef
# Example of creep power law
expression = '1e-18 * exp(-4e4 / 1.987 / 1200)'
[../]
[]
[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
[../]
[]
[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
[../]
[./eff_creep_strain]
type = ElementAverageValue
variable = effective_viscoplasticity
[../]
[./porosity]
type = ElementAverageValue
variable = porosity
[../]
[]
[Outputs]
csv = 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
[]
(modules/solid_mechanics/test/tests/ad_2D_geometries/2D-RZ_centerline_VLC.i)
# Simple test to check for use of AxisymmetricCenterlineAverageValue with
# volumetric_locking_correction activated in a tensor mechanics simulation
[Mesh]
type = GeneratedMesh
dim = 2
[]
[GlobalParams]
displacements = 'disp_r disp_z'
volumetric_locking_correction = true
[]
[Problem]
coord_type = RZ
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
use_automatic_differentiation = true
[../]
[]
[AuxVariables]
[./temperature]
initial_condition = 298.0
[../]
[]
[BCs]
[./symmetry_x]
type = ADDirichletBC
variable = disp_r
value = 0
boundary = left
[../]
[./roller_z]
type = ADDirichletBC
variable = disp_z
value = 0
boundary = bottom
[../]
[./top_load]
type = ADFunctionDirichletBC
variable = disp_z
function = -0.01*t
boundary = top
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.3
[../]
[./_elastic_strain]
type = ADComputeFiniteStrainElasticStress
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
line_search = 'none'
nl_rel_tol = 1e-8
nl_abs_tol = 1e-10
nl_max_its = 15
l_tol = 1e-6
l_max_its = 50
start_time = 0.0
end_time = 0.3
dt = 0.1
[]
[Postprocessors]
[./center_temperature]
type = AxisymmetricCenterlineAverageValue
variable = temperature
boundary = left
[../]
[]
[Outputs]
csv = true
perf_graph = true
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictionless_fir/small.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'small'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeLinearElasticStress
block = 'plank block'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/xfem/test/tests/moving_interface/moving_ad_bimaterial.i)
# This test is for two layer materials with different youngs modulus with AD
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
# This case is also meant to test for a bug in moving interfaces on displaced meshes
# It should fail during the healing step of the 2nd timestep if the bug is present.
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
heal_always = true
[../]
[]
[Mesh]
displacements = 'disp_x disp_y'
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 5.
ymin = 0.0
ymax = 5.
elem_type = QUAD4
[]
[./left_bottom]
type = ExtraNodesetGenerator
new_boundary = 'left_bottom'
coord = '0.0 0.0'
input = generated_mesh
[../]
[./left_top]
type = ExtraNodesetGenerator
new_boundary = 'left_top'
coord = '0.0 5.'
input = left_bottom
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'y-3.153 + t'
[../]
[]
[AuxVariables]
[./a_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = SMALL
use_automatic_differentiation = true
add_variables = true
generate_output = 'stress_xx stress_yy stress_xy'
[../]
[]
[AuxKernels]
[./a_strain_xx]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
variable = a_strain_xx
[../]
[./a_strain_yy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
variable = a_strain_yy
[../]
[./a_strain_xy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
variable = a_strain_xy
[../]
[./b_strain_xx]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
variable = b_strain_xx
[../]
[./b_strain_yy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
variable = b_strain_yy
[../]
[./b_strain_xy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
variable = b_strain_xy
[../]
[]
[Constraints]
[./dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[./dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./bottomx]
type = ADDirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = ADDirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = ADFunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[../]
[./topy]
type = ADFunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[../]
[]
[Materials]
[./elasticity_tensor_A]
type = ADComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[../]
[./strain_A]
type = ADComputeSmallStrain
base_name = A
displacements = 'disp_x disp_y'
[../]
[./stress_A]
type = ADComputeLinearElasticStress
base_name = A
[../]
[./elasticity_tensor_B]
type = ADComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e7
poissons_ratio = 0.3
[../]
[./strain_B]
type = ADComputeSmallStrain
base_name = B
displacements = 'disp_x disp_y'
[../]
[./stress_B]
type = ADComputeLinearElasticStress
base_name = B
[../]
[./combined_stress]
type = ADLevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[../]
[./combined_elasticity_tensor]
type = ADLevelSetBiMaterialRankFour
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = elasticity_tensor
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
line_search = 'bt'
# controls for linear iterations
l_max_its = 20
l_tol = 1e-8
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-14
nl_abs_tol = 1e-50
# time control
start_time = 0.0
dt = 0.15
num_steps = 3
max_xfem_update = 1
[]
[Outputs]
exodus = true
execute_on = timestep_end
file_base = moving_bimaterial_out
perf_graph = true
[./console]
type = Console
output_linear = true
[../]
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite_action.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[temp]
order = ${order}
block = 'plank block'
scaling = 1e-1
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
strain = FINITE
[]
[]
[Kernels]
[hc]
type = ADHeatConduction
variable = temp
use_displaced_mesh = true
block = 'plank block'
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e6
[]
[]
[MortarGapHeatTransfer]
[mortar_heat_transfer]
temperature = temp
use_displaced_mesh = true
gap_flux_options = conduction
gap_conductivity = 1
boundary = plank_right
primary_boundary = plank_right
primary_subdomain = frictionless_primary_subdomain
secondary_boundary = block_left
secondary_subdomain = frictionless_secondary_subdomain
thermal_lm_scaling = 1e-7
gap_geometry_type = PLATE
[]
[]
[BCs]
[left_temp]
type = ADDirichletBC
variable = temp
boundary = 'plank_left'
value = 400
[]
[right_temp]
type = ADDirichletBC
variable = temp
boundary = 'block_right'
value = 300
[]
[left_x]
type = ADDirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = ADDirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[heat_plank]
type = ADHeatConductionMaterial
block = plank
thermal_conductivity = 2
specific_heat = 1
[]
[heat_block]
type = ADHeatConductionMaterial
block = block
thermal_conductivity = 1
specific_heat = 1
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -snes_max_it'
petsc_options_value = 'lu NONZERO 1e-15 20'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'none'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[avg_temp]
type = ElementAverageValue
variable = temp
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact avg_temp'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[dof]
type = DOFMap
execute_on = 'initial'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[secondary]
input = block_rename
type = LowerDBlockFromSidesetGenerator
sidesets = 'block_left'
new_block_id = '30'
new_block_name = 'frictionless_secondary_subdomain'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
sidesets = 'plank_right'
new_block_id = '20'
new_block_name = 'frictionless_primary_subdomain'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[temp]
order = ${order}
block = 'plank block'
scaling = 1e-1
[]
[thermal_lm]
order = ${order}
block = 'frictionless_secondary_subdomain'
scaling = 1e-7
[]
[frictionless_normal_lm]
order = ${order}
block = 'frictionless_secondary_subdomain'
use_dual = true
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
strain = FINITE
[]
[]
[Kernels]
[hc]
type = ADHeatConduction
variable = temp
use_displaced_mesh = true
block = 'plank block'
[]
[]
[UserObjects]
[weighted_gap_uo]
type = LMWeightedGapUserObject
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
lm_variable = frictionless_normal_lm
disp_x = disp_x
disp_y = disp_y
[]
[]
[Constraints]
[weighted_gap_lm]
type = ComputeWeightedGapLMMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
disp_x = disp_x
disp_y = disp_y
use_displaced_mesh = true
weighted_gap_uo = weighted_gap_uo
[]
[normal_x]
type = NormalMortarMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_gap_uo
[]
[normal_y]
type = NormalMortarMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_gap_uo
[]
[thermal_contact]
type = GapConductanceConstraint
variable = thermal_lm
secondary_variable = temp
k = 1
use_displaced_mesh = true
primary_boundary = plank_right
primary_subdomain = frictionless_primary_subdomain
secondary_boundary = block_left
secondary_subdomain = frictionless_secondary_subdomain
displacements = 'disp_x disp_y'
[]
[]
[BCs]
[left_temp]
type = ADDirichletBC
variable = temp
boundary = 'plank_left'
value = 400
[]
[right_temp]
type = ADDirichletBC
variable = temp
boundary = 'block_right'
value = 300
[]
[left_x]
type = ADDirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = ADDirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[heat_plank]
type = ADHeatConductionMaterial
block = plank
thermal_conductivity = 2
specific_heat = 1
[]
[heat_block]
type = ADHeatConductionMaterial
block = block
thermal_conductivity = 1
specific_heat = 1
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -snes_max_it'
petsc_options_value = 'lu NONZERO 1e-15 20'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'none'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[avg_temp]
type = ElementAverageValue
variable = temp
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact avg_temp'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[dof]
type = DOFMap
execute_on = 'initial'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/negative_porosity.i)
# This test provides an example of an individual LPS viscoplasticity model
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 1
xmax = 0.002
ymax = 0.002
[]
[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'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.3
[../]
[./stress]
type = ADComputeMultipleInelasticStress
inelastic_models = lps
outputs = all
[../]
[./porosity]
type = ADGenericConstantMaterial
prop_names = 'porosity'
prop_values = '-0.1'
outputs = 'all'
[../]
[./lps]
type = ADViscoplasticityStressUpdate
coefficient = 'coef'
power = 3
outputs = all
relative_tolerance = 1e-11
initial_porosity = 0.1
negative_behavior = ZERO
[../]
[./coef]
type = ADParsedMaterial
property_name = coef
# Example of creep power law
expression = '1e-18 * exp(-4e4 / 1.987 / 1200)'
[../]
[]
[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
[../]
[]
[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
[../]
[./eff_creep_strain]
type = ElementAverageValue
variable = effective_viscoplasticity
[../]
[./porosity]
type = ElementAverageValue
variable = porosity
[../]
[]
[Outputs]
csv = true
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictional/finite_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite_rr'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
type = ReferenceResidualProblem
extra_tag_vectors = 'ref'
reference_vector = 'ref'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[action]
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
extra_vector_tags = 'ref'
[]
[]
[Contact]
[frictional]
primary = plank_right
secondary = block_left
formulation = mortar
model = coulomb
c_normal = 1e3
c_tangential = 1e-6
friction_coefficient = 0.1
tangential_lm_scaling = 1.0e-10
[]
[]
[BCs]
[left_x]
type = ADDirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
preset = false
[]
[left_y]
type = ADDirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
preset = false
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-15'
end_time = 5.3
dt = 0.12
dtmin = 0.12
timestep_tolerance = 1e-6
line_search = 'contact'
nl_div_tol = 1e100
nl_abs_tol = 1e-7
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictional_normal_lm
subdomain = frictional_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/substepping/ad_power_law_creep.i)
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
[]
[]
[AuxVariables]
[temp]
initial_condition = 1000.0
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
add_variables = true
generate_output = 'stress_zz elastic_strain_zz creep_strain_zz'
use_automatic_differentiation = true
[]
[]
[Functions]
[front_pull]
type = PiecewiseLinear
x = '0 1'
y = '0 1'
scale_factor = 0.5
[]
[]
[BCs]
[u_front_pull]
type = ADFunctionDirichletBC
variable = disp_z
boundary = front
function = front_pull
[]
[uz_back_fix]
type = ADDirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[u_yz_fix]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[u_xz_fix]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 2e11
poissons_ratio = 0.3
[]
[radial_return_stress]
type = ADComputeMultipleInelasticStress
inelastic_models = 'power_law_creep'
[]
[power_law_creep]
type = ADPowerLawCreepStressUpdate
coefficient = 1.0e-15
n_exponent = 4
activation_energy = 0.0
temperature = temp
# options for using substepping
substep_strain_tolerance = 0.1
max_inelastic_increment = 0.01
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type '
petsc_options_value = 'lu '
line_search = 'none'
nl_max_its = 10
nl_rel_tol = 1e-6
nl_abs_tol = 1e-10
end_time = 0.1
dt = 0.1
[]
[Outputs]
exodus = true
[]
(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
[]
(modules/contact/test/tests/3d-mortar-contact/half_sphere_nodal_geometry.i)
[Mesh]
[generated_mesh]
type = FileMeshGenerator
file = half_sphere.e
[]
[secondary]
type = LowerDBlockFromSidesetGenerator
new_block_id = 2002
new_block_name = 'secondary_lower'
sidesets = '202'
input = generated_mesh
[]
[primary]
type = LowerDBlockFromSidesetGenerator
new_block_id = 1002
sidesets = '102'
new_block_name = 'primary_lower'
input = secondary
[]
patch_size = 20
patch_update_strategy = always
uniform_refine = 0
[]
[Problem]
kernel_coverage_check = false
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
order = FIRST
family = LAGRANGE
[]
[Variables]
[frictional_normal_lm]
block = 'secondary_lower'
use_dual = true
[]
[frictional_tangential_lm]
block = 'secondary_lower'
use_dual = true
[]
[frictional_tangential_dir_lm]
block = 'secondary_lower'
use_dual = true
[]
[]
[AuxVariables]
[saved_x]
[]
[saved_y]
[]
[saved_z]
[]
[tangent_x]
family = LAGRANGE
order = FIRST
[]
[tangent_y]
family = LAGRANGE
order = FIRST
[]
[tangent_z]
family = LAGRANGE
order = FIRST
[]
[]
[AuxKernels]
[friction_x_component]
type = MortarFrictionalPressureVectorAux
primary_boundary = 102
secondary_boundary = 202
tangent_one = frictional_tangential_lm
tangent_two = frictional_tangential_dir_lm
variable = tangent_x
component = 0
boundary = 202
[]
[friction_y_component]
type = MortarFrictionalPressureVectorAux
primary_boundary = 102
secondary_boundary = 202
tangent_one = frictional_tangential_lm
tangent_two = frictional_tangential_dir_lm
variable = tangent_y
component = 1
boundary = 202
[]
[friction_z_component]
type = MortarFrictionalPressureVectorAux
primary_boundary = 102
secondary_boundary = 202
tangent_one = frictional_tangential_lm
tangent_two = frictional_tangential_dir_lm
variable = tangent_z
component = 2
boundary = 202
[]
[]
[Functions]
[push_down]
type = ParsedFunction
expression = 'if(t < 1.5, -t, t-3.0)'
[]
[force_z]
type = ParsedFunction
expression = 'if(t < 0.008, 0.0, (-t)*2.0e2 -t*t*100.0)' # 4.0e5
[]
[]
[Modules/TensorMechanics/Master]
[all]
add_variables = true
strain = FINITE
block = '1 2'
use_automatic_differentiation = true
generate_output = 'stress_xx stress_xy stress_xz stress_yy stress_zz'
save_in = 'saved_x saved_y saved_z'
use_finite_deform_jacobian = true
[]
[]
[BCs]
[botz]
type = ADDirichletBC
variable = disp_z
boundary = 101
value = 0.0
[]
[boty]
type = ADDirichletBC
variable = disp_y
boundary = 101
value = 0.0
[]
[botx]
type = ADDirichletBC
variable = disp_x
boundary = 101
value = 0.0
[]
[topz]
type = ADFunctionDirichletBC
variable = disp_z
boundary = '201'
function = push_down
[]
[topy]
type = ADDirichletBC
variable = disp_y
boundary = '201 202'
value = 0.0
[]
[topx]
type = ADDirichletBC
variable = disp_x
boundary = '201 202'
value = 0.0
[]
[]
[Materials]
[tensor]
type = ADComputeIsotropicElasticityTensor
block = '1'
youngs_modulus = 1.40625e7
poissons_ratio = 0.25
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = '1'
[]
[tensor_1000]
type = ADComputeIsotropicElasticityTensor
block = '2'
youngs_modulus = 1e5
poissons_ratio = 0.0
[]
[stress_1000]
type = ADComputeFiniteStrainElasticStress
block = '2'
[]
[]
[Postprocessors]
[stress_zz]
type = ElementAverageValue
variable = stress_zz
block = 1
[]
[resid_z]
type = NodalSum
variable = saved_z
boundary = 201
[]
[disp_z]
type = NodalExtremeValue
variable = disp_z
boundary = 201
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_package -pc_factor_shift_type '
'-pc_factor_shift_amount -mat_mffd_err'
petsc_options_value = 'lu superlu_dist nonzero 1e-14 1e-5'
line_search = 'none'
l_max_its = 60
nl_max_its = 50
dt = 0.004
dtmin = 0.00001
# end_time = 1.8
end_time = 0.000
nl_rel_tol = 1.0e-6 #1e-7 # -8, -6 to avoid many iterations. Switch it March 2021
nl_abs_tol = 1e-6 # 6 if no friction
l_tol = 1e-4
[]
[Outputs]
exodus = true
csv = true
print_linear_residuals = true
perf_graph = true
[console]
type = Console
max_rows = 5
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[UserObjects]
[weighted_vel_uo]
type = LMWeightedVelocitiesUserObject
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
lm_variable_normal = frictional_normal_lm
lm_variable_tangential_one = frictional_tangential_lm
lm_variable_tangential_two = frictional_tangential_dir_lm
secondary_variable = disp_x
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
debug_mesh = true
[]
[]
[Constraints]
[weighted_gap_lm]
type = ComputeFrictionalForceLMMechanicalContact
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
variable = frictional_normal_lm
disp_x = disp_x
disp_y = disp_y
disp_z = disp_z
use_displaced_mesh = true
friction_lm = frictional_tangential_lm
friction_lm_dir = frictional_tangential_dir_lm
c = 7.0e4
c_t = 7.0e4
mu = 0.4
debug_mesh = true
weighted_gap_uo = weighted_vel_uo
weighted_velocities_uo = weighted_vel_uo
[]
[normal_x]
type = NormalMortarMechanicalContact
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
variable = frictional_normal_lm
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
debug_mesh = true
weighted_gap_uo = weighted_vel_uo
[]
[normal_y]
type = NormalMortarMechanicalContact
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
variable = frictional_normal_lm
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
debug_mesh = true
weighted_gap_uo = weighted_vel_uo
[]
[normal_z]
type = NormalMortarMechanicalContact
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
variable = frictional_normal_lm
secondary_variable = disp_z
component = z
use_displaced_mesh = true
compute_lm_residuals = false
debug_mesh = true
weighted_gap_uo = weighted_vel_uo
[]
[tangential_x]
type = TangentialMortarMechanicalContact
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
variable = frictional_tangential_lm
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
debug_mesh = true
weighted_velocities_uo = weighted_vel_uo
[]
[tangential_y]
type = TangentialMortarMechanicalContact
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
variable = frictional_tangential_lm
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
debug_mesh = true
weighted_velocities_uo = weighted_vel_uo
[]
[tangential_z]
type = TangentialMortarMechanicalContact
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
variable = frictional_tangential_lm
secondary_variable = disp_z
component = z
use_displaced_mesh = true
compute_lm_residuals = false
debug_mesh = true
weighted_velocities_uo = weighted_vel_uo
[]
[tangential_x_dir]
type = TangentialMortarMechanicalContact
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
variable = frictional_tangential_dir_lm
secondary_variable = disp_x
component = x
direction = direction_2
use_displaced_mesh = true
compute_lm_residuals = false
debug_mesh = true
weighted_velocities_uo = weighted_vel_uo
[]
[tangential_y_dir]
type = TangentialMortarMechanicalContact
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
variable = frictional_tangential_dir_lm
secondary_variable = disp_y
component = y
direction = direction_2
use_displaced_mesh = true
compute_lm_residuals = false
debug_mesh = true
weighted_velocities_uo = weighted_vel_uo
[]
[tangential_z_dir]
type = TangentialMortarMechanicalContact
primary_boundary = 102
secondary_boundary = 202
primary_subdomain = 1002
secondary_subdomain = 2002
variable = frictional_tangential_dir_lm
secondary_variable = disp_z
component = z
direction = direction_2
use_displaced_mesh = true
compute_lm_residuals = false
debug_mesh = true
weighted_velocities_uo = weighted_vel_uo
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/creep.i)
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
xmax = 0.002
ymax = 0.002
[]
[Physics/SolidMechanics/QuasiStatic/All]
strain = FINITE
add_variables = true
base_name = 'total'
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'
[../]
[]
[Materials]
active='elasticity_tensor porous_stress porosity creep'
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.3
base_name = 'total'
[../]
[./porous_stress]
type = ADComputeMultipleInelasticStress
inelastic_models = creep
outputs = all
base_name = 'total'
[../]
[./regular_stress]
type = ADComputeMultipleInelasticStress
inelastic_models = creep
outputs = all
base_name = 'total'
[../]
[./porosity]
type = ADGenericConstantMaterial
prop_names = porosity
prop_values = 0.1
outputs = all
[../]
[./creep]
type = ADPowerLawCreepStressUpdate
activation_energy = 4e4
temperature = 1200
coefficient = 1e-18
gas_constant = 1.987
n_exponent = 3
base_name = 'creep'
outputs = all
[../]
[]
[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
[../]
[]
[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 = total_hydrostatic_stress
[../]
[./avg_vonmises]
type = ElementAverageValue
variable = total_vonmises_stress
[../]
[./dt]
type = TimestepSize
[../]
[./num_lin]
type = NumLinearIterations
outputs = console
[../]
[./num_nonlin]
type = NumNonlinearIterations
outputs = console
[../]
[./eff_creep_strain]
type = ElementAverageValue
variable = creep_effective_creep_strain
[../]
[./porosity]
type = ElementAverageValue
variable = porosity
[../]
[]
[Outputs]
csv = true
[]
(modules/solid_mechanics/test/tests/ad_return_mapping/ad_return_mapping_derivative.i)
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
[]
[]
[AuxVariables]
[temp]
initial_condition = 1000.0
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
add_variables = true
generate_output = 'stress_zz elastic_strain_zz creep_strain_zz'
use_automatic_differentiation = true
scaling = 1.06364e-11
[]
[]
[Functions]
[front_pull]
type = PiecewiseLinear
x = '0 1'
y = '0 1'
scale_factor = 0.5
[]
[]
[BCs]
[u_front_pull]
type = ADFunctionDirichletBC
variable = disp_z
boundary = front
function = front_pull
[]
[uz_back_fix]
type = ADDirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[u_yz_fix]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[u_xz_fix]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 2e11
poissons_ratio = 0.3
[]
[radial_return_stress]
type = ADComputeMultipleInelasticStress
inelastic_models = 'power_law_creep'
[]
[power_law_creep]
type = ADPowerLawCreepStressUpdate
coefficient = 1.0e-15
n_exponent = 4
activation_energy = 0.0
temperature = temp
# options for using substepping
use_substepping = INCREMENT_BASED
substep_strain_tolerance = 0.1
max_inelastic_increment = 0.01
automatic_differentiation_return_mapping = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type '
petsc_options_value = 'lu '
line_search = 'none'
nl_max_its = 10
nl_rel_tol = 1e-10
nl_abs_tol = 1e-10
end_time = 0.1
dt = 0.1
[]
[Outputs]
exodus = true
file_base = reference
[]
(modules/solid_mechanics/test/tests/ad_plastic/power_law_creep.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
second_order = true
[]
[GlobalParams]
displacements = 'disp_x disp_y'
volumetric_locking_correction = false
[]
[AuxVariables]
[./hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[../]
[]
[Variables]
[./disp_x]
order = SECOND
scaling = 1e-10
[../]
[./disp_y]
order = SECOND
scaling = 1e-10
[../]
[]
[Functions]
[./pull]
type = PiecewiseLinear
x = '0 10'
y = '0 1e-3'
[../]
[]
[Kernels]
[./stress_x]
type = ADStressDivergenceTensors
component = 0
variable = disp_x
[../]
[./stress_y]
type = ADStressDivergenceTensors
component = 1
variable = disp_y
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.3
[../]
[./strain]
type = ADComputeIncrementalSmallStrain
[../]
[./elastic_strain]
type = ADComputeMultipleInelasticStress
[../]
[./creep_ten]
type = ADPowerLawCreepStressUpdate
coefficient = 10e-24
n_exponent = 4
activation_energy = 0
base_name = creep_ten
[../]
[./creep_ten2]
type = ADPowerLawCreepStressUpdate
coefficient = 10e-24
n_exponent = 4
activation_energy = 0
base_name = creep_ten2
[../]
[./creep_one]
type = ADPowerLawCreepStressUpdate
coefficient = 1e-24
n_exponent = 4
activation_energy = 0
base_name = creep_one
[../]
[./creep_nine]
type = ADPowerLawCreepStressUpdate
coefficient = 9e-24
n_exponent = 4
activation_energy = 0
base_name = creep_nine
[../]
[./creep_zero]
type = ADPowerLawCreepStressUpdate
coefficient = 0e-24
n_exponent = 4
activation_energy = 0
base_name = creep_zero
[../]
[]
[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
[../]
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
petsc_options_iname = -pc_hypre_type
petsc_options_value = boomeramg
line_search = 'none'
nl_rel_tol = 1e-5
num_steps = 5
dt = 1e-1
[]
[Postprocessors]
[./max_disp_x]
type = ElementExtremeValue
variable = disp_x
[../]
[./max_disp_y]
type = ElementExtremeValue
variable = disp_y
[../]
[./max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[../]
[./dt]
type = TimestepSize
[../]
[./num_lin]
type = NumLinearIterations
outputs = console
[../]
[./num_nonlin]
type = NumNonlinearIterations
outputs = console
[../]
[]
[Outputs]
csv = true
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/small-2d/small.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'small'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[secondary]
input = block_rename
type = LowerDBlockFromSidesetGenerator
sidesets = 'block_left'
new_block_id = '30'
new_block_name = 'frictionless_secondary_subdomain'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
sidesets = 'plank_right'
new_block_id = '20'
new_block_name = 'frictionless_primary_subdomain'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[temp]
order = ${order}
block = 'plank block'
scaling = 1e-1
[]
[thermal_lm]
order = ${order}
block = 'frictionless_secondary_subdomain'
scaling = 1e-7
[]
[frictionless_normal_lm]
order = ${order}
block = 'frictionless_secondary_subdomain'
use_dual = true
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
[]
[]
[Kernels]
[hc]
type = ADHeatConduction
variable = temp
use_displaced_mesh = true
block = 'plank block'
[]
[]
[UserObjects]
[weighted_gap_uo]
type = LMWeightedGapUserObject
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
lm_variable = frictionless_normal_lm
disp_x = disp_x
disp_y = disp_y
[]
[]
[Constraints]
[weighted_gap_lm]
type = ComputeWeightedGapLMMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
disp_x = disp_x
disp_y = disp_y
use_displaced_mesh = true
weighted_gap_uo = weighted_gap_uo
[]
[normal_x]
type = NormalMortarMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_gap_uo
[]
[normal_y]
type = NormalMortarMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_gap_uo
[]
[thermal_contact]
type = GapConductanceConstraint
variable = thermal_lm
secondary_variable = temp
k = 1
use_displaced_mesh = true
primary_boundary = plank_right
primary_subdomain = frictionless_primary_subdomain
secondary_boundary = block_left
secondary_subdomain = frictionless_secondary_subdomain
displacements = 'disp_x disp_y'
[]
[]
[BCs]
[left_temp]
type = DirichletBC
variable = temp
boundary = 'plank_left'
value = 400
[]
[right_temp]
type = DirichletBC
variable = temp
boundary = 'block_right'
value = 300
[]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeLinearElasticStress
block = 'plank block'
[]
[heat_plank]
type = ADHeatConductionMaterial
block = plank
thermal_conductivity = 2
specific_heat = 1
[]
[heat_block]
type = ADHeatConductionMaterial
block = block
thermal_conductivity = 1
specific_heat = 1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -snes_max_it'
petsc_options_value = 'lu NONZERO 1e-15 20'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'none'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[avg_temp]
type = ElementAverageValue
variable = temp
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact avg_temp'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_exponential.i)
#
# Test to exercise the exponential stress release
#
# Stress vs. strain should show a linear relationship until cracking,
# an exponential stress release, a linear relationship back to zero
# strain, a linear relationship with the original stiffness in
# compression and then back to zero strain, a linear relationship
# back to the exponential curve, and finally further exponential
# stress release.
#
[Mesh]
file = cracking_test.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Functions]
[./displx]
type = PiecewiseLinear
x = '0 1 2 3 4 5 6'
y = '0 0.00175 0 -0.0001 0 0.00175 0.0035'
[../]
[./disply]
type = PiecewiseLinear
x = '0 5 6'
y = '0 0 .00175'
[../]
[./displz]
type = PiecewiseLinear
x = '0 2 3'
y = '0 0 .0035'
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[../]
[]
[BCs]
[./pullx]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 4
function = displx
[../]
[./left]
type = ADDirichletBC
variable = disp_x
boundary = 1
value = 0.0
[../]
[./fix_y]
type = ADDirichletBC
variable = disp_y
boundary = '11 12'
value = 0.0
[../]
[./move_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = '15 16'
function = disply
[../]
[./back]
type = ADDirichletBC
variable = disp_z
boundary = '3'
value = 0.0
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 186.5e9
poissons_ratio = .316
[../]
[./elastic_stress]
type = ADComputeSmearedCrackingStress
cracking_stress = 119.3e6
cracked_elasticity_type = FULL
softening_models = exponential_softening
[../]
[./exponential_softening]
type = ADExponentialSoftening
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart -pc_type'
petsc_options_value = '101 lu'
line_search = 'none'
l_max_its = 100
l_tol = 1e-6
nl_max_its = 10
nl_rel_tol = 1e-12
nl_abs_tol = 1.e-4
start_time = 0.0
dt = 0.02
dtmin = 0.02
num_steps = 300
[]
[Outputs]
exodus = true
[]
(test/tests/controls/time_periods/bcs/adbcs.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 10
ny = 10
[]
[Variables]
[u]
[]
[]
[Kernels]
[diff]
type = CoefDiffusion
variable = u
coef = 0.1
[]
[time]
type = TimeDerivative
variable = u
[]
[]
[BCs]
[left]
type = DirichletBC
variable = u
boundary = left
value = 0
[]
[right]
type = ADDirichletBC
variable = u
boundary = right
value = 1
[]
[right2]
type = ADFunctionDirichletBC
variable = u
boundary = right
function = (y*(t-1))+1
[]
[]
[Executioner]
type = Transient
num_steps = 20
dt = 0.1
solve_type = PJFNK
petsc_options_iname = '-pc_type -pc_hypre_type'
petsc_options_value = 'hypre boomeramg'
[]
[Outputs]
exodus = true
[]
[Controls]
[period0]
type = TimePeriod
disable_objects = 'BoundaryCondition::right2'
start_time = '0'
end_time = '0.95'
execute_on = 'initial timestep_begin'
[]
[period2]
type = TimePeriod
disable_objects = 'BCs/right'
start_time = '1'
execute_on = 'initial timestep_begin'
[]
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d-rz/finite_action.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
patch_size = 80
patch_update_strategy = auto
coord_type = RZ
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 0.6
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.61
xmax = 1.21
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[temp]
order = ${order}
block = 'plank block'
scaling = 1e-1
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
strain = FINITE
[]
[]
[Kernels]
[hc]
type = ADHeatConduction
variable = temp
use_displaced_mesh = true
block = 'plank block'
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e6
[]
[]
[MortarGapHeatTransfer]
[mortar_heat_transfer]
temperature = temp
use_displaced_mesh = true
gap_flux_options = conduction
gap_conductivity = 1
boundary = plank_right
primary_boundary = plank_right
primary_subdomain = frictionless_primary_subdomain
secondary_boundary = block_left
secondary_subdomain = frictionless_secondary_subdomain
thermal_lm_scaling = 1e-7
gap_geometry_type = PLATE
[]
[]
[BCs]
[left_temp]
type = DirichletBC
variable = temp
boundary = 'plank_left'
value = 400
[]
[right_temp]
type = DirichletBC
variable = temp
boundary = 'block_right'
value = 300
[]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[heat_plank]
type = ADHeatConductionMaterial
block = plank
thermal_conductivity = 2
specific_heat = 1
[]
[heat_block]
type = ADHeatConductionMaterial
block = block
thermal_conductivity = 1
specific_heat = 1
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -snes_max_it'
petsc_options_value = 'lu NONZERO 1e-15 20'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'none'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[avg_temp]
type = ElementAverageValue
variable = temp
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact avg_temp'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/contact/test/tests/mortar_restart/frictional_bouncing_block_action_restart_2.i)
starting_point = 2e-1
offset = 1e-2
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[file]
type = FileMeshGenerator
file = frictional_bouncing_block_action_restart_1_checkpoint_cp/0021-mesh.cpr
skip_partitioning = true
allow_renumbering = false
[]
uniform_refine = 0 # 1,2
patch_update_strategy = always
[]
[Problem]
#Note that the suffix is left off in the parameter below.
restart_file_base = frictional_bouncing_block_action_restart_1_checkpoint_cp/LATEST # You may also use a specific number here
kernel_coverage_check = false
material_coverage_check = false
# disp_y has an initial condition despite the checkpoint restart
allow_initial_conditions_with_restart = true
[]
[Variables]
[disp_x]
block = '1 2'
[]
[disp_y]
block = '1 2'
[]
[]
[ICs]
[disp_y]
block = 2
variable = disp_y
value = '${fparse starting_point + offset}'
type = ConstantIC
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = FINITE
generate_output = 'stress_xx stress_yy'
block = '1 2'
[]
[]
[Materials]
[elasticity_2]
type = ComputeIsotropicElasticityTensor
block = '2'
youngs_modulus = 1e3
poissons_ratio = 0.3
[]
[elasticity_1]
type = ComputeIsotropicElasticityTensor
block = '1'
youngs_modulus = 1e6
poissons_ratio = 0.3
[]
[stress]
type = ComputeFiniteStrainElasticStress
block = '1 2'
[]
[]
[Contact]
[frictional]
primary = 20
secondary = 10
formulation = mortar
model = coulomb
friction_coefficient = 0.4
c_normal = 1.0e1
c_tangential = 1.0e6
generate_mortar_mesh = false
[]
[]
[BCs]
[botx]
type = DirichletBC
variable = disp_x
boundary = '40'
value = 0.0
[]
[boty]
type = DirichletBC
variable = disp_y
boundary = '40'
value = 0.0
[]
[topy]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 30
function = '${starting_point} * cos(2 * pi / 20 * t) + ${offset}'
preset = false
[]
[leftx]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 30
function = '2e-2 * t'
# function = '0'
preset = false
[]
[]
[Executioner]
type = Transient
end_time = 6 # 70
start_time = 5.25
dt = 0.25 # 0.1 for finer meshes (uniform_refine)
dtmin = .01
solve_type = 'PJFNK'
petsc_options = '-snes_converged_reason -ksp_converged_reason -pc_svd_monitor -snes_linesearch_monitor -snes_ksp_ew'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type -pc_factor_shift_type -pc_factor_shift_amount -mat_mffd_err'
petsc_options_value = 'lu superlu_dist NONZERO 1e-13 1e-5'
l_max_its = 30
nl_max_its = 40
line_search = 'basic'
snesmf_reuse_base = false
nl_abs_tol = 1e-9
nl_rel_tol = 1e-9
l_tol = 1e-07 # Tightening l_tol can help with friction
[]
[Debug]
show_var_residual_norms = true
[]
[VectorPostprocessors]
[cont_press]
type = NodalValueSampler
variable = frictional_normal_lm
boundary = '10'
sort_by = x
execute_on = FINAL
[]
[friction]
type = NodalValueSampler
variable = frictional_tangential_lm
boundary = '10'
sort_by = x
execute_on = FINAL
[]
[]
[Outputs]
exodus = true
[checkfile]
type = CSV
show = 'cont_press friction'
start_time = 0.0
execute_vector_postprocessors_on = FINAL
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Postprocessors]
active = 'num_nl cumulative_nli contact cumulative_li num_l'
[num_nl]
type = NumNonlinearIterations
[]
[num_l]
type = NumLinearIterations
[]
[cumulative_nli]
type = CumulativeValuePostprocessor
postprocessor = num_nl
[]
[cumulative_li]
type = CumulativeValuePostprocessor
postprocessor = num_l
[]
[contact]
type = ContactDOFSetSize
variable = frictional_normal_lm
subdomain = 'frictional_secondary_subdomain'
execute_on = 'nonlinear timestep_end'
[]
[]
(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
[]
(modules/xfem/test/tests/bimaterials/glued_ad_bimaterials_2d.i)
# This test is for two layer materials with different youngs modulus using AD
# The global stress is determined by switching the stress based on level set values
# The material interface is marked by a level set function
# The two layer materials are glued together
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y'
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
[../]
[]
[Mesh]
displacements = 'disp_x disp_y'
[gen]
type = GeneratedMeshGenerator
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 5.
ymin = 0.0
ymax = 5.
elem_type = QUAD4
[]
[./left_bottom]
type = ExtraNodesetGenerator
new_boundary = 'left_bottom'
coord = '0.0 0.0'
input = gen
[../]
[./left_top]
type = ExtraNodesetGenerator
new_boundary = 'left_top'
coord = '0.0 5.'
input = left_bottom
[../]
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Variables]
[./disp_x]
[../]
[./disp_y]
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'y-2.5'
[../]
[]
[AuxVariables]
[./a_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = SMALL
use_automatic_differentiation = true
add_variables = true
generate_output = 'stress_xx stress_yy stress_xy'
[../]
[]
[AuxKernels]
[./a_strain_xx]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
variable = a_strain_xx
[../]
[./a_strain_yy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
variable = a_strain_yy
[../]
[./a_strain_xy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
variable = a_strain_xy
[../]
[./b_strain_xx]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
variable = b_strain_xx
[../]
[./b_strain_yy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
variable = b_strain_yy
[../]
[./b_strain_xy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
variable = b_strain_xy
[../]
[]
[Constraints]
[./dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[./dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./bottomx]
type = ADDirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = ADDirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = ADFunctionDirichletBC
boundary = top
variable = disp_x
function = 0.03*t
[../]
[./topy]
type = ADFunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[../]
[]
[Materials]
[./elasticity_tensor_A]
type = ADComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[../]
[./strain_A]
type = ADComputeSmallStrain
base_name = A
[../]
[./stress_A]
type = ADComputeLinearElasticStress
base_name = A
[../]
[./elasticity_tensor_B]
type = ADComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e5
poissons_ratio = 0.3
[../]
[./strain_B]
type = ADComputeSmallStrain
base_name = B
[../]
[./stress_B]
type = ADComputeLinearElasticStress
base_name = B
[../]
[./combined_stress]
type = ADLevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[../]
[./combined_elasticity_tensor]
type = ADLevelSetBiMaterialRankFour
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = elasticity_tensor
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
line_search = 'bt'
# controls for linear iterations
l_max_its = 20
l_tol = 1e-8
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-14
nl_abs_tol = 1e-50
# time control
start_time = 0.0
dt = 0.1
num_steps = 2
max_xfem_update = 1
[]
[Outputs]
exodus = true
file_base = glued_bimaterials_2d_out
execute_on = timestep_end
[./console]
type = Console
output_linear = true
[../]
[]
(modules/combined/test/tests/power_law_hardening/ADPowerLawHardening.i)
# This is a test of the isotropic power law hardening constitutive model.
# In this problem, a single Hex 8 element is fixed at the bottom and pulled at the top
# at a constant rate of 0.1.
# Before yield, stress = strain (=0.1*t) as youngs modulus is 1.0.
# The yield stress for this problem is 0.25 ( as strength coefficient is 0.5 and strain rate exponent is 0.5).
# Therefore, the material should start yielding at t = 2.5 seconds and then follow stress = K *pow(strain,n) or
# stress ~ 0.5*pow(0.1*t,0.5).
#
# This tensor mechanics version of the power law hardening plasticity model matches
# the solid mechanics version for this toy problem under exodiff limits
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[Mesh]
type = GeneratedMesh
dim = 3
[]
[AuxVariables]
[total_strain_yy]
order = CONSTANT
family = MONOMIAL
[]
[]
[Functions]
[top_pull]
type = ParsedFunction
expression = t*(0.1)
[]
[]
[Modules/TensorMechanics/Master]
[all]
add_variables = true
strain = SMALL
incremental = true
generate_output = 'stress_yy'
use_automatic_differentiation = true
[]
[]
[AuxKernels]
[total_strain_yy]
type = ADRankTwoAux
rank_two_tensor = total_strain
variable = total_strain_yy
index_i = 1
index_j = 1
[]
[]
[BCs]
[y_pull_function]
type = ADFunctionDirichletBC
variable = disp_y
boundary = top
function = top_pull
[]
[x_bot]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[y_bot]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[z_bot]
type = ADDirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1.0
poissons_ratio = 0.3
[]
[power_law_hardening]
type = ADIsotropicPowerLawHardeningStressUpdate
strength_coefficient = 0.5 #K
strain_hardening_exponent = 0.5 #n
[]
[radial_return_stress]
type = ADComputeMultipleInelasticStress
inelastic_models = 'power_law_hardening'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-ksp_snes_ew'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 4'
line_search = 'none'
l_max_its = 100
nl_max_its = 100
nl_rel_tol = 1e-12
nl_abs_tol = 1e-10
l_tol = 1e-9
start_time = 0.0
end_time = 5.0
dt = 0.25
[]
[Postprocessors]
[stress_yy]
type = ElementAverageValue
variable = stress_yy
[]
[strain_yy]
type = ElementAverageValue
variable = total_strain_yy
[]
[]
[Outputs]
[out]
type = Exodus
elemental_as_nodal = true
file_base = PowerLawHardening_out
[]
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictionless_sec/small.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'small'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeLinearElasticStress
block = 'plank block'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 5.0
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(test/tests/kernels/ad_mat_diffusion/ad_2d_steady_state.i)
# This test solves a 2D steady state heat equation
# The error is found by comparing to the analytical solution
# Note that the thermal conductivity, specific heat, and density in this problem
# Are set to 1, and need to be changed to the constants of the material being
# Analyzed
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 30
xmax = 2
ymax = 2
[]
[Variables]
[./T]
[../]
[]
[Kernels]
[./HeatDiff]
type = ADMatDiffusion
variable = T
diffusivity = diffusivity
[../]
[]
[BCs]
[./zero]
type = DirichletBC
variable = T
boundary = 'left right bottom'
value = 0
[../]
[./top]
type = ADFunctionDirichletBC
variable = T
boundary = top
function = '10*sin(pi*x*0.5)'
[../]
[]
[Materials]
[./k]
type = ADGenericConstantMaterial
prop_names = diffusivity
prop_values = 1
[../]
[]
[Postprocessors]
[./nodal_error]
type = NodalL2Error
function = '10/(sinh(pi))*sin(pi*x*0.5)*sinh(pi*y*0.5)'
variable = T
outputs = console
[../]
[./elemental_error]
type = ElementL2Error
function = '10/(sinh(pi))*sin(pi*x*0.5)*sinh(pi*y*0.5)'
variable = T
outputs = console
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_xyz.i)
#
[Mesh]
file = cracking_test.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Functions]
[./displx]
type = PiecewiseLinear
x = '0 1'
y = '0 0.00175'
[../]
[./velocity_y]
type = ParsedFunction
expression = 'if(t < 2, 0.00175, 0)'
[../]
[./velocity_z]
type = ParsedFunction
expression = 0.00175
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[../]
[]
[BCs]
[./fix_x]
type = ADDirichletBC
variable = disp_x
boundary = 1
value = 0.0
[../]
[./move_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 4
function = displx
[../]
[./fix_y]
type = ADDirichletBC
variable = disp_y
boundary = 2
value = 0.0
[../]
[./move_y]
type = PresetVelocity
variable = disp_y
boundary = 5
function = velocity_y
# time_periods = 'p2 p3'
[../]
[./fix_z]
type = ADDirichletBC
variable = disp_z
boundary = 3
value = 0.0
[../]
[./move_z]
type = PresetVelocity
variable = disp_z
boundary = 6
function = velocity_z
# time_periods = 'p3'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 186.5e9
poissons_ratio = .316
[../]
[./elastic_stress]
type = ADComputeSmearedCrackingStress
cracking_stress = 119.3e6
cracked_elasticity_type = FULL
softening_models = exponential_softening
[../]
[./exponential_softening]
type = ADExponentialSoftening
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart -pc_type'
petsc_options_value = '101 lu'
line_search = 'none'
l_max_its = 100
l_tol = 1e-5
nl_max_its = 100
nl_abs_tol = 1e-6
#nl_rel_tol = 1e-4
nl_rel_tol = 1e-8
start_time = 0.0
end_time = 3.0
dt = 0.01
[]
[Controls]
[./p1]
type = TimePeriod
start_time = 0.0
end_time = 1.0
disable_objects = 'BCs/move_y BCs/move_z'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[./p2]
type = TimePeriod
start_time = 1.0
end_time = 2.0
disable_objects = 'BCs/move_z'
enable_objects = 'BCs/move_y'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[./p3]
type = TimePeriod
start_time = 2.0
end_time = 3.0
enable_objects = 'BCs/move_y BCs/move_z'
reverse_on_false = false
execute_on = 'initial timestep_begin'
set_sync_times = true
[../]
[]
[Outputs]
exodus = true
[]
(modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_second/finite_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'finite_rr'
[Problem]
coord_type = RZ
[]
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 0.6
ymin = 0
ymax = 10
nx = 2
ny = 33
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.61
xmax = 1.21
ymin = 9.2
ymax = 10.0
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
type = ReferenceResidualProblem
extra_tag_vectors = 'ref'
reference_vector = 'ref'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[block]
use_automatic_differentiation = true
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'block'
extra_vector_tags = 'ref'
[]
[plank]
use_automatic_differentiation = true
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank'
eigenstrain_names = 'swell'
extra_vector_tags = 'ref'
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
preset = false
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
preset = false
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = DirichletBC
variable = disp_x
preset = false
boundary = block_right
value = 0
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
preset = false
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[swell]
type = ADComputeEigenstrain
block = 'plank'
eigenstrain_name = swell
eigen_base = '1 0 0 0 0 0 0 0 0'
prefactor = swell_mat
[]
[swell_mat]
type = ADGenericFunctionMaterial
prop_names = 'swell_mat'
prop_values = '7e-2*(1-cos(4*t))'
block = 'plank'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 3
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
nl_abs_tol = 1e-12
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/ad_2D_geometries/2D-RZ_finiteStrain_resid.i)
# This tests the save_in_disp residual aux-variables for
# ComputeAxisymmetricRZFiniteStrain, which is generated through the use of the
# SolidMechanics QuasiStatic Physics. The GeneratedMesh is 1x1, rotated via axisym to
# create a cylinder of height 1, radius 1.
#
# PostProcessor force_z plots the force on the top surface of the cylinder.
#
# Displacement of 0.1 is applied to top of cylinder while other surfaces are
# constrained. Plotting force_z vs stress_z will show a slope of 3.14159 (pi),
# consistent with formula for normal stress:
#
# Stress = force / area
#
# where area is A = pi * r^2 for a circle.
[Mesh]
type = GeneratedMesh
dim = 2
nx = 5
ny = 5
xmin = 0.0
xmax = 1.0
ymin = 0.0
ymax = 1.0
[]
[GlobalParams]
displacements = 'disp_r disp_z'
[]
[Problem]
coord_type = RZ
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
save_in = 'force_r force_z'
use_automatic_differentiation = true
[../]
[]
[AuxVariables]
[./stress_r]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_r]
order = CONSTANT
family = MONOMIAL
[../]
[./stress_z]
order = CONSTANT
family = MONOMIAL
[../]
[./strain_z]
order = CONSTANT
family = MONOMIAL
[../]
[./force_r]
order = FIRST
family = LAGRANGE
[../]
[./force_z]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./stress_r]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 0
index_j = 0
variable = stress_r
execute_on = timestep_end
[../]
[./strain_r]
type = ADRankTwoAux
rank_two_tensor = total_strain
index_i = 0
index_j = 0
variable = strain_r
execute_on = timestep_end
[../]
[./stress_z]
type = ADRankTwoAux
rank_two_tensor = stress
index_i = 1
index_j = 1
variable = stress_z
execute_on = timestep_end
[../]
[./strain_z]
type = ADRankTwoAux
rank_two_tensor = total_strain
index_i = 1
index_j = 1
variable = strain_z
execute_on = timestep_end
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
[../]
[./_elastic_strain]
type = ADComputeFiniteStrainElasticStress
[../]
[]
[BCs]
[./no_disp_r_left]
type = ADDirichletBC
variable = disp_r
boundary = left
value = 0.0
[../]
[./no_disp_r_right]
type = ADDirichletBC
variable = disp_r
boundary = right
value = 0.0
[../]
[./no_disp_z_bottom]
type = ADDirichletBC
variable = disp_z
boundary = bottom
value = 0.0
[../]
[./top]
type = ADFunctionDirichletBC
variable = disp_z
boundary = top
function = 't'
[../]
[]
[Debug]
show_var_residual_norms = true
[]
[Preconditioning]
[./smp]
type = SMP
full = true
[../]
[]
[Executioner]
type = Transient
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = ' 201 hypre boomeramg 10'
line_search = 'none'
#Preconditioned JFNK (default)
solve_type = 'PJFNK'
nl_rel_tol = 5e-9
nl_abs_tol = 1e-10
nl_max_its = 15
l_tol = 1e-3
l_max_its = 50
start_time = 0.0
end_time = 0.1
dt = 0.01
[]
[Postprocessors]
[./strainR]
type = ElementAverageValue
variable = strain_r
[../]
[./stressR]
type = ElementAverageValue
variable = stress_r
[../]
[./strainZ]
type = ElementAverageValue
variable = strain_z
[../]
[./stressZ]
type = ElementAverageValue
variable = stress_z
[../]
[./force_r]
type = NodalSum
variable = force_r
boundary = top
[../]
[./force_z]
type = NodalSum
variable = force_z
boundary = top
[../]
[]
[Outputs]
exodus = true
print_linear_residuals = false
perf_graph = true
[]
(modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_first/small.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'small'
[Problem]
coord_type = RZ
[]
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 0.6
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.61
xmax = 1.21
ymin = 9.2
ymax = 10.0
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[block]
use_automatic_differentiation = true
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'block'
[]
[plank]
use_automatic_differentiation = true
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank'
eigenstrain_names = 'swell'
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = DirichletBC
variable = disp_x
boundary = block_right
value = 0
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeLinearElasticStress
block = 'plank block'
[]
[swell]
type = ADComputeEigenstrain
block = 'plank'
eigenstrain_name = swell
eigen_base = '1 0 0 0 0 0 0 0 0'
prefactor = swell_mat
[]
[swell_mat]
type = ADGenericFunctionMaterial
prop_names = 'swell_mat'
prop_values = '7e-2*(1-cos(4*t))'
block = 'plank'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 10
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = 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/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
[]
(modules/solid_mechanics/test/tests/ad_finite_strain_jacobian/3d_bar.i)
[Mesh]
[generated_mesh]
type = GeneratedMeshGenerator
dim = 3
xmin = 0
xmax = 2
ymin = 0
ymax = 2
zmin = 0
zmax = 10
nx = 10
ny = 2
nz = 2
elem_type = HEX8
[]
[corner]
type = ExtraNodesetGenerator
new_boundary = 101
coord = '0 0 0'
input = generated_mesh
[]
[side]
type = ExtraNodesetGenerator
new_boundary = 102
coord = '2 0 0'
input = corner
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
add_variables = true
use_finite_deform_jacobian = true
volumetric_locking_correction = false
use_automatic_differentiation = true
[]
[]
[Materials]
[stress]
type = ADComputeFiniteStrainElasticStress
[]
[elasticity_tensor]
type = ADComputeElasticityTensor
fill_method = symmetric9
C_ijkl = '1.684e5 0.176e5 0.176e5 1.684e5 0.176e5 1.684e5 0.754e5 0.754e5 0.754e5'
[]
[]
[BCs]
[fix_corner_x]
type = ADDirichletBC
variable = disp_x
boundary = 101
value = 0
[]
[fix_corner_y]
type = ADDirichletBC
variable = disp_y
boundary = 101
value = 0
[]
[fix_side_y]
type = ADDirichletBC
variable = disp_y
boundary = 102
value = 0
[]
[fix_z]
type = ADDirichletBC
variable = disp_z
boundary = back
value = 0
[]
[move_z]
type = ADFunctionDirichletBC
variable = disp_z
boundary = front
function = 't'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-10
nl_max_its = 10
l_tol = 1e-4
l_max_its = 50
dt = 0.2
dtmin = 0.2
num_steps = 2
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Outputs]
exodus = true
[]
(modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_second/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'finite'
[Problem]
coord_type = RZ
[]
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 0.6
ymin = 0
ymax = 10
nx = 2
ny = 33
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.61
xmax = 1.21
ymin = 9.2
ymax = 10.0
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[block]
use_automatic_differentiation = true
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'block'
[]
[plank]
use_automatic_differentiation = true
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank'
eigenstrain_names = 'swell'
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
preset = false
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
preset = false
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = DirichletBC
variable = disp_x
preset = false
boundary = block_right
value = 0
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
preset = false
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[swell]
type = ADComputeEigenstrain
block = 'plank'
eigenstrain_name = swell
eigen_base = '1 0 0 0 0 0 0 0 0'
prefactor = swell_mat
[]
[swell_mat]
type = ADGenericFunctionMaterial
prop_names = 'swell_mat'
prop_values = '7e-2*(1-cos(4*t))'
block = 'plank'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 3
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_first/finite_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite_rr'
[Problem]
coord_type = RZ
[]
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 0.6
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.61
xmax = 1.21
ymin = 9.2
ymax = 10.0
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
type = ReferenceResidualProblem
extra_tag_vectors = 'ref'
reference_vector = 'ref'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[block]
use_automatic_differentiation = true
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'block'
extra_vector_tags = 'ref'
[]
[plank]
use_automatic_differentiation = true
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank'
eigenstrain_names = 'swell'
extra_vector_tags = 'ref'
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = DirichletBC
variable = disp_x
boundary = block_right
value = 0
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[swell]
type = ADComputeEigenstrain
block = 'plank'
eigenstrain_name = swell
eigen_base = '1 0 0 0 0 0 0 0 0'
prefactor = swell_mat
[]
[swell_mat]
type = ADGenericFunctionMaterial
prop_names = 'swell_mat'
prop_values = '7e-2*(1-cos(4*t))'
block = 'plank'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
nl_abs_tol = 1e-12
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictional/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[action]
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
[]
[]
[Contact]
[frictional]
primary = plank_right
secondary = block_left
formulation = mortar
model = coulomb
c_normal = 1e0
c_tangential = 1e-6
friction_coefficient = 0.1
tangential_lm_scaling = 1.0e-15
[]
[]
[BCs]
[left_x]
type = ADDirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
preset = false
[]
[left_y]
type = ADDirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
preset = false
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-15'
end_time = 5.3
dt = 0.12
dtmin = 0.12
timestep_tolerance = 1e-6
line_search = 'contact'
nl_div_tol = 1e100
nl_abs_tol = 1e-7
automatic_scaling = true
compute_scaling_once = false
ignore_variables_for_autoscaling = 'frictional_normal_lm frictional_tangential_lm'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictional_normal_lm
subdomain = frictional_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_rz.i)
#
[Mesh]
file = cracking_rz_test.e
[]
[Problem]
coord_type = RZ
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Functions]
[./displ]
type = PiecewiseLinear
x = '0 1 2 3 4'
y = '0 1 0 -1 0'
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[../]
[]
[BCs]
[./pull]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 2
function = displ
[../]
[./left]
type = ADDirichletBC
variable = disp_x
boundary = 1
value = 0.0
[../]
[./bottom]
type = ADDirichletBC
variable = disp_y
boundary = 3
value = 0.0
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 4.0e7
poissons_ratio = 0.0
[../]
[./elastic_stress]
type = ADComputeSmearedCrackingStress
cracking_stress = 1.68e6
cracked_elasticity_type = FULL
softening_models = abrupt_softening
[../]
[./abrupt_softening]
type = ADAbruptSoftening
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart'
petsc_options_value = '101 '
line_search = 'none'
l_max_its = 100
nl_max_its = 100
nl_rel_tol = 1e-8
nl_abs_tol = 1e-2
l_tol = 1e-5
start_time = 0.0
end_time = 0.1
dt = 0.025
[]
[Outputs]
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
[]
(modules/solid_mechanics/test/tests/ad_anisotropic_creep/anis_mech_hill_tensor_creep.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 128
ny = 128
second_order = true
[]
[GlobalParams]
displacements = 'disp_x disp_y'
volumetric_locking_correction = false
[]
[AuxVariables]
[hydrostatic_stress]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[hydrostatic_stress]
type = ADRankTwoScalarAux
variable = hydrostatic_stress
rank_two_tensor = stress
scalar_type = Hydrostatic
[]
[]
[Variables]
[disp_x]
order = SECOND
scaling = 1e-10
[]
[disp_y]
order = SECOND
scaling = 1e-10
[]
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 10e3'
y = '0 1e-4'
[]
[]
[Kernels]
[stress_x]
type = ADStressDivergenceTensors
component = 0
variable = disp_x
[]
[stress_y]
type = ADStressDivergenceTensors
component = 1
variable = disp_y
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
add_variables = true
generate_output = 'elastic_strain_xx elastic_strain_yy elastic_strain_xy'
use_automatic_differentiation = true
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeElasticityTensor
fill_method = orthotropic
C_ijkl = '2.0e3 2.0e5 2.0e3 0.71428571e3 0.71428571e3 0.71428571e3 0.4 0.2 0.004 0.004 0.2 0.4'
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "trial_creep"
max_iterations = 300
[]
[hill_tensor]
type = HillConstants
# F G H L M N
hill_constants = "0.5 0.5 0.3866 1.6413 1.6413 1.2731"
base_name = trial_creep
[]
[trial_creep]
type = ADHillCreepStressUpdate
coefficient = 1e-24
n_exponent = 4
m_exponent = 0
activation_energy = 0
# internal_solve_output_on = always
base_name = trial_creep
[]
[creep_one]
type = ADPowerLawCreepStressUpdate
coefficient = 1e-24
n_exponent = 4
activation_energy = 0
base_name = creep_one
[]
[creep_nine]
type = ADPowerLawCreepStressUpdate
coefficient = 9e-24
n_exponent = 4
activation_energy = 0
base_name = creep_nine
[]
[]
[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
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart -pc_type -sub_pc_type'
petsc_options_value = '101 asm lu'
line_search = 'none'
nl_rel_tol = 1e-5
nl_abs_tol = 1.0e-13
num_steps = 200
dt = 1.0e2
automatic_scaling = true
[]
[Postprocessors]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_disp_y]
type = ElementExtremeValue
variable = disp_y
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[num_lin]
type = NumLinearIterations
outputs = console
[]
[num_nonlin]
type = NumNonlinearIterations
outputs = console
[]
[]
[Outputs]
csv = true
exodus = true
[]
(modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_multiple_softening.i)
# Test of cracking with direction-specific release models in 3
# directions. Block is first pulled in one direction, and then
# held while it is sequentially pulled in the other two
# directions. Poisson's ratio is zero so that the cracking in one
# direction doesn't affect the others.
# Softening in the three directions should follow the laws for the
# prescribed models in the three directions, which are power law (x),
# exponential (y), and abrupt (z).
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Functions]
[./displx]
type = PiecewiseLinear
x = '0 1 2 3'
y = '0 1 1 1'
[../]
[./disply]
type = PiecewiseLinear
x = '0 1 2 3'
y = '0 0 1 1'
[../]
[./displz]
type = PiecewiseLinear
x = '0 1 2 3'
y = '0 0 0 1'
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[../]
[]
[BCs]
[./pullx]
type = ADFunctionDirichletBC
variable = disp_x
boundary = right
function = displx
[../]
[./pully]
type = ADFunctionDirichletBC
variable = disp_y
boundary = top
function = disply
[../]
[./pullz]
type = ADFunctionDirichletBC
variable = disp_z
boundary = front
function = displz
[../]
[./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
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 2.8e7
poissons_ratio = 0
[../]
[./elastic_stress]
type = ADComputeSmearedCrackingStress
cracking_stress = 1.68e6
cracked_elasticity_type = FULL
softening_models = 'power_law_softening exponential_softening abrupt_softening'
prescribed_crack_directions = 'x y z'
[../]
[./power_law_softening]
type = ADPowerLawSoftening
stiffness_reduction = 0.3333
[../]
[./exponential_softening]
type = ADExponentialSoftening
[../]
[./abrupt_softening]
type = ADAbruptSoftening
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart -pc_type -sub_pc_type'
petsc_options_value = '101 asm lu'
line_search = 'none'
l_max_its = 100
nl_max_its = 100
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
l_tol = 1e-5
start_time = 0.0
end_time = 3.0
dt = 0.01
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_rz_exponential.i)
#
# Test to exercise the exponential stress release
#
# Stress vs. strain should show a linear relationship until cracking,
# an exponential stress release, a linear relationship back to zero
# strain, a linear relationship with the original stiffness in
# compression and then back to zero strain, a linear relationship
# back to the exponential curve, and finally further exponential
# stress release.
[Mesh]
file = cracking_rz_test.e
[]
[Problem]
coord_type = RZ
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Functions]
[./disply]
type = PiecewiseLinear
x = '0 1 2 3 4 5 6'
y = '0 0.00175 0 -0.0001 0 0.00175 0.0035'
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[../]
[]
[BCs]
[./pully]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 4
function = disply
[../]
[./bottom]
type = ADDirichletBC
variable = disp_y
boundary = 3
value = 0.0
[../]
[./sides]
type = ADDirichletBC
variable = disp_x
boundary = 1
value = 0.0
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 186.5e9
poissons_ratio = 0.316
[../]
[./elastic_stress]
type = ADComputeSmearedCrackingStress
cracking_stress = 119.3e6
cracked_elasticity_type = FULL
softening_models = exponential_softening
[../]
[./exponential_softening]
type = ADExponentialSoftening
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart -pc_type'
petsc_options_value = '101 lu'
line_search = 'none'
l_max_its = 100
l_tol = 1e-5
nl_max_its = 10
nl_rel_tol = 1e-8
nl_abs_tol = 1e-3
start_time = 0.0
end_time = 6.0
dt = 0.005
dtmin = 0.005
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/ad_cavity_pressure/negative_volume.i)
#
# Cavity Pressure Test
#
# This test is designed to compute a negative number of moles
# to trigger an error check in the CavityPressureUserObject.
# The negative number of moles is achieved by supplying an
# open volume to the InternalVolume postprocessor, which
# calculates a negative volume.
[Problem]
coord_type = RZ
[]
[GlobalParams]
displacements = 'disp_r disp_z'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 2
[]
[Functions]
[./temperature]
type = PiecewiseLinear
x = '0 1'
y = '1 2'
scale_factor = 100
[../]
[]
[Variables]
[./temperature]
initial_condition = 100
[../]
[]
[Modules/TensorMechanics/Master]
[./block]
strain = FINITE
add_variables = true
use_automatic_differentiation = true
[../]
[]
[Kernels]
[./heat]
type = Diffusion
variable = temperature
use_displaced_mesh = true
[../]
[]
[BCs]
[./no_x]
type = ADDirichletBC
variable = disp_r
boundary = left
value = 0.0
[../]
[./no_y]
type = ADDirichletBC
variable = disp_z
boundary = bottom
value = 0.0
[../]
[./temperatureInterior]
type = ADFunctionDirichletBC
boundary = 2
function = temperature
variable = temperature
[../]
[./CavityPressure]
[./pressure]
boundary = 'top bottom right'
initial_pressure = 10e5
R = 8.3143
output_initial_moles = initial_moles
temperature = aveTempInterior
volume = internalVolume
startup_time = 0.5
output = ppress
use_automatic_differentiation = true
[../]
[../]
[]
[Materials]
[./elastic_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.3
[../]
[./stress1]
type = ADComputeFiniteStrainElasticStress
[../]
[]
[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
[]
[Postprocessors]
[./internalVolume]
type = InternalVolume
boundary = 'top bottom right'
execute_on = 'initial linear'
[../]
[./aveTempInterior]
type = AxisymmetricCenterlineAverageValue
boundary = left
variable = temperature
execute_on = 'initial linear'
[../]
[]
[Outputs]
exodus = false
[]
(modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_rotation.i)
# This test is to ensure that the smeared cracking model correctly handles finite
# rotation of cracked elements.
# This consists of a single element that is first subjected to tensile loading
# in the y-direction via a prescribed displacement. This loading is sufficiently
# high to crack the material in that direction, but not completely unload. The
# prescribed displacement is then reversed so that the element is returned to its
# original configuration.
# In the next phase of the analysis, this element is then rotated 90 degrees by
# prescribing the displacement of the bottom of the element. The prescribed
# displacement BC used to crack the element in the first phase is deactivated.
# Once the element is fully rotated, a new BC is activated on what was originally
# the top surface (but is now the surface on the right hand side) to pull in
# the x-direction.
# If everything is working correctly, the model should re-load on the original
# crack (which should be rotated along with the elemnent) up to the peak stress
# in the first phase of the analysis, and then continue the unloading process
# as the crack strains continue to increase. Throughout this analysis, there should
# only be a single crack, as manifested in the crack_flags variables.
[Mesh]
file = cracking_test.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[../]
[]
[AuxVariables]
[./crack_flags1]
order = CONSTANT
family = MONOMIAL
[../]
[./crack_flags2]
order = CONSTANT
family = MONOMIAL
[../]
[./crack_flags3]
order = CONSTANT
family = MONOMIAL
[../]
[]
[AuxKernels]
[./crack_flags1]
type = ADMaterialRealVectorValueAux
property = crack_flags
variable = crack_flags1
component = 0
[../]
[./crack_flags2]
type = ADMaterialRealVectorValueAux
property = crack_flags
variable = crack_flags2
component = 1
[../]
[./crack_flags3]
type = ADMaterialRealVectorValueAux
property = crack_flags
variable = crack_flags3
component = 2
[../]
[]
[BCs]
[./x_pin]
type = ADDirichletBC
variable = disp_x
boundary = '15 16'
value = 0.0
[../]
[./y_pin]
type = ADDirichletBC
variable = disp_y
boundary = '15 16'
value = 0.0
[../]
[./z_all]
type = ADDirichletBC
variable = disp_z
boundary = '11 12 13 14 15 16 17 18'
value = 0.0
[../]
[./x_lb]
type = ADFunctionDirichletBC
variable = disp_x
boundary = '11 12'
function = 'if(t<10,0,if(t>=100,1,1-cos((t-10)*pi/180)))'
[../]
[./y_lb]
type = ADFunctionDirichletBC
variable = disp_y
boundary = '11 12'
function = 'if(t<10,0,if(t>=100,1,sin((t-10)*pi/180)))'
[../]
[./x_lt]
type = ADFunctionDirichletBC
variable = disp_x
boundary = '13 14'
function = '2+(t-100)*0.01'
[../]
[./x_rt]
type = ADFunctionDirichletBC
variable = disp_x
boundary = '17 18'
function = '1+(t-100)*0.01'
[../]
[./top_pull]
type = ADFunctionDirichletBC
variable = disp_y
boundary = '13 14 17 18'
function = 'if(t<5,t*0.01,0.05-(t-5)*0.01)'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 100.e9
poissons_ratio = 0.
[../]
[./cracking_stress]
type = ADComputeSmearedCrackingStress
shear_retention_factor = 0.1
cracking_stress = 3.e9
cracked_elasticity_type = FULL
softening_models = exponential_softening
[../]
[./exponential_softening]
type = ADExponentialSoftening
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart -pc_type'
petsc_options_value = '101 lu'
line_search = 'none'
l_max_its = 100
l_tol = 1e-5
nl_max_its = 100
nl_abs_tol = 1e-5
nl_rel_tol = 1e-12
start_time = 0
end_time = 110
dt = 1
[]
[Controls]
[./p1]
type = TimePeriod
start_time = 0.0
end_time = 10.0
disable_objects = 'BCs/x_lt BCs/x_rt'
enable_objects = 'BCs/top_pull'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[./p2]
type = TimePeriod
start_time = 10.0
end_time = 101.0
disable_objects = 'BCs/x_lt BCs/x_rt BCs/top_pull'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[./p3]
type = TimePeriod
start_time = 101.0
end_time = 110.0
enable_objects = 'BCs/x_lt BCs/x_rt'
disable_objects = 'BCs/top_pull'
reverse_on_false = false
execute_on = 'initial timestep_begin'
[../]
[]
[Outputs]
exodus = true
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictionless_fir/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[action]
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_second/small.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'small'
[Problem]
coord_type = RZ
[]
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 0.6
ymin = 0
ymax = 10
nx = 2
ny = 33
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.61
xmax = 1.21
ymin = 9.2
ymax = 10.0
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[block]
use_automatic_differentiation = true
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'block'
[]
[plank]
use_automatic_differentiation = true
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank'
eigenstrain_names = 'swell'
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = DirichletBC
variable = disp_x
boundary = block_right
value = 0
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeLinearElasticStress
block = 'plank block'
[]
[swell]
type = ADComputeEigenstrain
block = 'plank'
eigenstrain_name = swell
eigen_base = '1 0 0 0 0 0 0 0 0'
prefactor = swell_mat
[]
[swell_mat]
type = ADGenericFunctionMaterial
prop_names = 'swell_mat'
prop_values = '7e-2*(1-cos(4*t))'
block = 'plank'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 3
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(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
[]
[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/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite_action_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
type = ReferenceResidualProblem
reference_vector = 'ref'
extra_tag_vectors = 'ref'
converge_on = 'disp_x disp_y temp'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[temp]
order = ${order}
block = 'plank block'
scaling = 1e-1
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
strain = FINITE
extra_vector_tags = 'ref'
[]
[]
[Kernels]
[hc]
type = ADHeatConduction
variable = temp
use_displaced_mesh = true
block = 'plank block'
extra_vector_tags = 'ref'
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e6
[]
[]
[MortarGapHeatTransfer]
[mortar_heat_transfer]
temperature = temp
use_displaced_mesh = true
gap_flux_options = conduction
gap_conductivity = 1
boundary = plank_right
primary_boundary = plank_right
primary_subdomain = frictionless_primary_subdomain
secondary_boundary = block_left
secondary_subdomain = frictionless_secondary_subdomain
thermal_lm_scaling = 1e-7
gap_geometry_type = PLATE
[]
[]
[BCs]
[left_temp]
type = ADDirichletBC
variable = temp
boundary = 'plank_left'
value = 400
[]
[right_temp]
type = ADDirichletBC
variable = temp
boundary = 'block_right'
value = 300
[]
[left_x]
type = ADDirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = ADDirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[heat_plank]
type = ADHeatConductionMaterial
block = plank
thermal_conductivity = 2
specific_heat = 1
[]
[heat_block]
type = ADHeatConductionMaterial
block = block
thermal_conductivity = 1
specific_heat = 1
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -snes_max_it'
petsc_options_value = 'lu NONZERO 1e-15 20'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'none'
nl_abs_tol = 1e-13
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[avg_temp]
type = ElementAverageValue
variable = temp
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact avg_temp'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[dof]
type = DOFMap
execute_on = 'initial'
[]
[]
[Debug]
show_var_residual_norms = 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/optimization/test/tests/executioners/constrained/shape_optimization/forward.i)
# This test is documented as an example for ConstrainedShapeOptimization. This
# test should not be changed without updating the documentation.
inner_radius = 6
outer_radius = 10
volume_constraint = 200
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[mesh]
type = ConcentricCircleMeshGenerator
has_outer_square = no
num_sectors = 16
radii = '${inner_radius} ${outer_radius}'
rings = '16 16'
preserve_volumes = false
[]
[inner_radius]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
new_boundary = inner
primary_block = 2
paired_block = 1
[]
[delete]
type = BlockDeletionGenerator
input = inner_radius
block = 1
[]
[gather_all]
type = BoundingBoxNodeSetGenerator
input = delete
bottom_left = '-100 -100 -100'
top_right = '100 100 100'
new_boundary = total
[]
[combine]
type = SideSetsFromBoundingBoxGenerator
input = gather_all
bottom_left = '-100 -100 -100'
top_right = '100 100 100'
boundaries_old = 'inner outer'
boundary_new = moving
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[T]
[]
[]
[AuxVariables]
[dist_between]
[AuxKernel]
type = NearestNodeDistanceAux
variable = dist_between
paired_boundary = moving
boundary = total
block = 2
use_displaced_mesh = false
execute_on = "INITIAL"
[]
[]
[]
[Kernels]
[disp_x]
type = MatDiffusion
variable = disp_x
use_displaced_mesh = false
diffusivity = diff_coef
[]
[disp_y]
type = MatDiffusion
variable = disp_y
use_displaced_mesh = false
diffusivity = diff_coef
[]
# run physics of interest on deformed mesh
[Diffusion]
type = FunctionDiffusion
variable = T
use_displaced_mesh = true
[]
[Source]
type = BodyForce
variable = T
value = 1
use_displaced_mesh = true
[]
[]
[Materials]
# perserve elements near the boundary
[diff_coef]
type = ParsedMaterial
coupled_variables = 'dist_between'
expression = '1/(dist_between+0.5)'
property_name = 'diff_coef'
[]
[h]
type = ADGenericFunctionMaterial
prop_names = h
prop_values = h
[]
# convection type boundary condition
[convection_bc]
type = ADParsedMaterial
coupled_variables = "T"
expression = "h*(100-T)"
material_property_names = "h"
property_name = convection
[]
[]
[Functions]
[r1_x]
type = ParsedOptimizationFunction
expression = 'r1 * cos((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[r1_y]
type = ParsedOptimizationFunction
expression = 'r1 * sin((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[r0_x]
type = ParsedOptimizationFunction
expression = 'r0 * cos((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[r0_y]
type = ParsedOptimizationFunction
expression = 'r0 * sin((atan(y/x)))'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[h]
type = ParsedOptimizationFunction
# r0+${inner_radius} is the true current inner radius
expression = '10 /(pi * (r0+${inner_radius})^3)'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[eq_grad_r0]
type = ParsedOptimizationFunction
expression = '-2 * pi * (r0 + ${inner_radius})'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[eq_grad_r1]
type = ParsedOptimizationFunction
# r1+${outer_radius} is the true current outer radius
expression = '2 * pi * (r1+${outer_radius})'
param_symbol_names = 'r0 r1'
param_vector_name = 'params/radii'
[]
[]
[BCs]
[diffuse_r1_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 'outer'
function = r1_x
preset = false
[]
[diffuse_r1_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 'outer'
function = r1_y
preset = false
[]
[diffuse_r0_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 'inner'
function = r0_x
preset = false
[]
[diffuse_r0_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 'inner'
function = r0_y
preset = false
[]
# run physics on deformed mesh
[convection]
type = ADMatNeumannBC
variable = T
boundary = inner
boundary_material = convection
use_displaced_mesh = true
value = 1
[]
[]
[Preconditioning]
[SMP]
type = SMP
full = true
[]
[]
[Reporters]
[params]
type = ConstantReporter
real_vector_names = 'radii'
real_vector_values = '0 0'
dof_id_type_vector_names = 'num_params'
dof_id_type_vector_values = '2'
[]
[]
[Postprocessors]
[current_volume]
type = VolumePostprocessor
use_displaced_mesh = true
[]
# objective function
[objective]
type = NodalExtremeValue
variable = T
[]
[eq_constraint]
type = ParsedPostprocessor
pp_names = current_volume
function = 'current_volume - ${volume_constraint}'
[]
[func_r0]
type = FunctionValuePostprocessor
function = eq_grad_r0
[]
[func_r1]
type = FunctionValuePostprocessor
function = eq_grad_r1
[]
[]
[VectorPostprocessors]
# convert "Real" postprocessors to vectors
[vol_constraint]
type = VectorOfPostprocessors
postprocessors = 'eq_constraint'
force_postaux = true
[]
[eq_grad]
type = VectorOfPostprocessors
postprocessors = 'func_r0 func_r1'
force_postaux = true
[]
[]
[Executioner]
type = Steady
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_shift_type'
petsc_options_value = 'lu NONZERO'
line_search = none
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
[]
[Outputs]
console = false
[]
(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/combined/test/tests/gap_heat_transfer_mortar/finite-2d/closed_gap_thermomechanical_mortar_contact.i)
## Units in the input file: m-Pa-s-K
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[left_rectangle]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 10
xmax = 1
ymin = 0
ymax = 0.5
boundary_name_prefix = moving_block
[]
[left_block]
type = SubdomainIDGenerator
input = left_rectangle
subdomain_id = 1
[]
[right_rectangle]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 10
xmin = 1
xmax = 2
ymin = 0
ymax = 0.5
boundary_name_prefix = fixed_block
boundary_id_offset = 4
[]
[right_block]
type = SubdomainIDGenerator
input = right_rectangle
subdomain_id = 2
[]
[two_blocks]
type = MeshCollectionGenerator
inputs = 'left_block right_block'
[]
[block_rename]
type = RenameBlockGenerator
input = two_blocks
old_block = '1 2'
new_block = 'left_block right_block'
[]
patch_update_strategy = iteration
[]
[Variables]
[disp_x]
block = 'left_block right_block'
[]
[disp_y]
block = 'left_block right_block'
[]
[temperature]
initial_condition = 300.0
[]
[temperature_interface_lm]
block = 'interface_secondary_subdomain'
[]
[]
[Modules]
[TensorMechanics/Master]
[steel]
strain = FINITE
add_variables = false
use_automatic_differentiation = true
generate_output = 'strain_xx strain_xy strain_yy stress_xx stress_xy stress_yy'
additional_generate_output = 'vonmises_stress'
additional_material_output_family = 'MONOMIAL'
additional_material_output_order = 'FIRST'
eigenstrain_names = steel_thermal_expansion
block = 'left_block'
[]
[aluminum]
strain = FINITE
add_variables = false
use_automatic_differentiation = true
generate_output = 'strain_xx strain_xy strain_yy stress_xx stress_xy stress_yy'
additional_generate_output = 'vonmises_stress'
additional_material_output_family = 'MONOMIAL'
additional_material_output_order = 'FIRST'
eigenstrain_names = aluminum_thermal_expansion
block = 'right_block'
[]
[]
[]
[Kernels]
[HeatDiff_steel]
type = ADHeatConduction
variable = temperature
thermal_conductivity = steel_thermal_conductivity
block = 'left_block'
[]
[HeatTdot_steel]
type = ADHeatConductionTimeDerivative
variable = temperature
specific_heat = steel_heat_capacity
density_name = steel_density
block = 'left_block'
[]
[HeatDiff_aluminum]
type = ADHeatConduction
variable = temperature
thermal_conductivity = aluminum_thermal_conductivity
block = 'right_block'
[]
[HeatTdot_aluminum]
type = ADHeatConductionTimeDerivative
variable = temperature
specific_heat = aluminum_heat_capacity
density_name = aluminum_density
block = 'right_block'
[]
[]
[BCs]
[fixed_bottom_edge]
type = ADDirichletBC
variable = disp_y
value = 0
boundary = 'moving_block_bottom fixed_block_bottom'
[]
[fixed_outer_edge]
type = ADDirichletBC
variable = disp_x
value = 0
boundary = 'fixed_block_right'
[]
[displacement_left_block]
type = ADFunctionDirichletBC
variable = disp_x
function = '2.0e-7*t'
boundary = 'moving_block_left'
[]
[temperature_left]
type = ADDirichletBC
variable = temperature
value = 300
boundary = 'moving_block_left'
[]
[temperature_right]
type = ADDirichletBC
variable = temperature
value = 800
boundary = 'fixed_block_right'
[]
[]
[Contact]
[interface]
primary = moving_block_right
secondary = fixed_block_left
model = frictionless
formulation = mortar
correct_edge_dropping = true
[]
[]
[Constraints]
[thermal_contact]
type = ModularGapConductanceConstraint
variable = temperature_interface_lm
secondary_variable = temperature
primary_boundary = moving_block_right
primary_subdomain = interface_primary_subdomain
secondary_boundary = fixed_block_left
secondary_subdomain = interface_secondary_subdomain
gap_flux_models = 'closed'
use_displaced_mesh = true
[]
[]
[Materials]
[steel_elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1.93e11 #in Pa, 193 GPa, stainless steel 304
poissons_ratio = 0.29
block = 'left_block'
[]
[steel_stress]
type = ADComputeFiniteStrainElasticStress
block = 'left_block'
[]
[steel_thermal_expansion]
type = ADComputeThermalExpansionEigenstrain
thermal_expansion_coeff = 17.3e-6 # stainless steel 304
stress_free_temperature = 300.0
temperature = temperature
eigenstrain_name = 'steel_thermal_expansion'
block = 'left_block'
[]
[steel_thermal_properties]
type = ADGenericConstantMaterial
prop_names = 'steel_density steel_thermal_conductivity steel_heat_capacity steel_hardness'
prop_values = ' 8e3 16.2 0.5 129' ## for stainless steel 304
block = 'left_block'
[]
[aluminum_elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 6.8e10 #in Pa, 68 GPa, aluminum
poissons_ratio = 0.36
block = 'right_block'
[]
[aluminum_stress]
type = ADComputeFiniteStrainElasticStress
block = 'right_block'
[]
[aluminum_thermal_expansion]
type = ADComputeThermalExpansionEigenstrain
thermal_expansion_coeff = 24.0e-6 # aluminum
stress_free_temperature = 300.0
temperature = temperature
eigenstrain_name = 'aluminum_thermal_expansion'
block = 'right_block'
[]
[aluminum_thermal_properties]
type = ADGenericConstantMaterial
prop_names = 'aluminum_density aluminum_thermal_conductivity aluminum_heat_capacity aluminum_hardness'
prop_values = ' 2.7e3 210 0.9 15' #for 99% pure Al
block = 'right_block'
[]
[]
[UserObjects]
[closed]
type = GapFluxModelPressureDependentConduction
primary_conductivity = steel_thermal_conductivity
secondary_conductivity = aluminum_thermal_conductivity
temperature = temperature
contact_pressure = interface_normal_lm
primary_hardness = steel_hardness
secondary_hardness = aluminum_hardness
boundary = moving_block_right
[]
[]
[Postprocessors]
[steel_pt_interface_temperature]
type = NodalVariableValue
nodeid = 245
variable = temperature
[]
[aluminum_pt_interface_temperature]
type = NodalVariableValue
nodeid = 657
variable = temperature
[]
[steel_element_interface_stress]
type = ElementalVariableValue
variable = vonmises_stress
elementid = 199
[]
[aluminum_element_interface_stress]
type = ElementalVariableValue
variable = vonmises_stress
elementid = 560
[]
[interface_heat_flux_steel]
type = ADSideDiffusiveFluxAverage
variable = temperature
boundary = moving_block_right
diffusivity = steel_thermal_conductivity
[]
[interface_heat_flux_aluminum]
type = ADSideDiffusiveFluxAverage
variable = temperature
boundary = fixed_block_left
diffusivity = aluminum_thermal_conductivity
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
automatic_scaling = false
line_search = 'none'
# mortar contact solver options
petsc_options = '-snes_converged_reason -pc_svd_monitor'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = ' lu superlu_dist'
snesmf_reuse_base = false
nl_rel_tol = 1e-8
nl_max_its = 20
l_max_its = 50
dt = 2
end_time = 10
[]
[Outputs]
csv = true
perf_graph = true
[]
(modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking.i)
#
# Simple pull test for cracking.
# The stress increases for two steps and then drops to zero.
[Mesh]
file = cracking_test.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Functions]
[./displ]
type = PiecewiseLinear
x = '0 1 2 3 4'
y = '0 1 0 -1 0'
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[../]
[]
[BCs]
[./pull]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 4
function = displ
[../]
[./left]
type = ADDirichletBC
variable = disp_x
boundary = 1
value = 0.0
[../]
[./bottom]
type = ADDirichletBC
variable = disp_y
boundary = 2
value = 0.0
[../]
[./back]
type = ADDirichletBC
variable = disp_z
boundary = 3
value = 0.0
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 2.8e7
poissons_ratio = 0
[../]
[./elastic_stress]
type = ADComputeSmearedCrackingStress
cracking_stress = 1.68e6
softening_models = abrupt_softening
[../]
[./abrupt_softening]
type = ADAbruptSoftening
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart -pc_type -sub_pc_type'
petsc_options_value = '101 asm lu'
line_search = 'none'
l_max_its = 100
nl_max_its = 100
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
l_tol = 1e-5
start_time = 0.0
end_time = 0.1
dt = 0.025
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/gtn_single.i)
# This test provides an example of an individual GTN viscoplasticity model
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 1
xmax = 0.002
ymax = 0.002
[]
[Physics/SolidMechanics/QuasiStatic/All]
strain = FINITE
add_variables = true
base_name = 'total'
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'
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.3
base_name = 'total'
[../]
[./stress]
type = ADComputeMultipleInelasticStress
inelastic_models = gtn
outputs = all
base_name = 'total'
[../]
[./porosity]
type = ADPorosityFromStrain
initial_porosity = 0.1
inelastic_strain = 'total_combined_inelastic_strain'
outputs = 'all'
[../]
[./gtn]
type = ADViscoplasticityStressUpdate
total_strain_base_name = 'total'
coefficient = 'coef'
power = 3
viscoplasticity_model = GTN
outputs = all
relative_tolerance = 1e-11
[../]
[./coef]
type = ADParsedMaterial
property_name = coef
# Example of creep power law
expression = '1e-18 * exp(-4e4 / 1.987 / 1200)'
[../]
[]
[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
[../]
[]
[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 = total_hydrostatic_stress
[../]
[./avg_vonmises]
type = ElementAverageValue
variable = total_vonmises_stress
[../]
[./dt]
type = TimestepSize
[../]
[./num_lin]
type = NumLinearIterations
outputs = console
[../]
[./num_nonlin]
type = NumNonlinearIterations
outputs = console
[../]
[./eff_creep_strain]
type = ElementAverageValue
variable = effective_viscoplasticity
[../]
[./porosity]
type = ElementAverageValue
variable = porosity
[../]
[]
[Outputs]
csv = true
[]
(modules/xfem/test/tests/bimaterials/inclusion_ad_bimaterials_2d.i)
# This test is for a matrix-inclusion composite materials using AD
# The global stress is determined by switching the stress based on level set values
# The inclusion geometry is marked by a level set function
# The matrix and inclusion are glued together
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[XFEM]
qrule = volfrac
output_cut_plane = true
[]
[UserObjects]
[./level_set_cut_uo]
type = LevelSetCutUserObject
level_set_var = ls
[../]
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 11
ny = 11
xmin = 0.0
xmax = 5.
ymin = 0.0
ymax = 5.
elem_type = QUAD4
displacements = 'disp_x disp_y'
[]
[AuxVariables]
[./ls]
order = FIRST
family = LAGRANGE
[../]
[]
[AuxKernels]
[./ls_function]
type = FunctionAux
variable = ls
function = ls_func
[../]
[]
[Functions]
[./ls_func]
type = ParsedFunction
expression = 'sqrt((y-2.5)*(y-2.5) + (x-2.5)*(x-2.5)) - 1.5'
[../]
[]
[AuxVariables]
[./a_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./a_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xx]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_yy]
order = CONSTANT
family = MONOMIAL
[../]
[./b_strain_xy]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Modules/TensorMechanics/Master]
[./all]
strain = SMALL
use_automatic_differentiation = true
add_variables = true
generate_output = 'stress_xx stress_yy stress_xy'
[../]
[]
[AuxKernels]
[./a_strain_xx]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 0
variable = a_strain_xx
[../]
[./a_strain_yy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 1
index_j = 1
variable = a_strain_yy
[../]
[./a_strain_xy]
type = ADRankTwoAux
rank_two_tensor = A_total_strain
index_i = 0
index_j = 1
variable = a_strain_xy
[../]
[./b_strain_xx]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 0
variable = b_strain_xx
[../]
[./b_strain_yy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 1
index_j = 1
variable = b_strain_yy
[../]
[./b_strain_xy]
type = ADRankTwoAux
rank_two_tensor = B_total_strain
index_i = 0
index_j = 1
variable = b_strain_xy
[../]
[]
[Constraints]
[./dispx_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_x
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[./dispy_constraint]
type = XFEMSingleVariableConstraint
use_displaced_mesh = false
variable = disp_y
alpha = 1e8
geometric_cut_userobject = 'level_set_cut_uo'
[../]
[]
[BCs]
[./bottomx]
type = ADDirichletBC
boundary = bottom
variable = disp_x
value = 0.0
[../]
[./bottomy]
type = ADDirichletBC
boundary = bottom
variable = disp_y
value = 0.0
[../]
[./topx]
type = ADFunctionDirichletBC
boundary = top
variable = disp_x
function = '0.03*t'
[../]
[./topy]
type = ADFunctionDirichletBC
boundary = top
variable = disp_y
function = '0.03*t'
[../]
[]
[Materials]
[./elasticity_tensor_A]
type = ADComputeIsotropicElasticityTensor
base_name = A
youngs_modulus = 1e9
poissons_ratio = 0.3
[../]
[./strain_A]
type = ADComputeSmallStrain
base_name = A
[../]
[./stress_A]
type = ADComputeLinearElasticStress
base_name = A
[../]
[./elasticity_tensor_B]
type = ADComputeIsotropicElasticityTensor
base_name = B
youngs_modulus = 1e5
poissons_ratio = 0.3
[../]
[./strain_B]
type = ADComputeSmallStrain
base_name = B
[../]
[./stress_B]
type = ADComputeLinearElasticStress
base_name = B
[../]
[./combined_stress]
type = ADLevelSetBiMaterialRankTwo
levelset_positive_base = 'A'
levelset_negative_base = 'B'
level_set_var = ls
prop_name = stress
[../]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 8'
# controls for linear iterations
l_max_its = 20
l_tol = 1e-8
# controls for nonlinear iterations
nl_max_its = 15
nl_rel_tol = 1e-14
nl_abs_tol = 1e-50 #1e-7
# time control
start_time = 0.0
dt = 0.5
end_time = 1.0
num_steps = 2
max_xfem_update = 1
[]
[Outputs]
exodus = true
file_base = inclusion_bimaterials_2d_out
execute_on = timestep_end
[./console]
type = Console
output_linear = true
[../]
[]
(modules/thermal_hydraulics/test/tests/components/file_mesh_component/file_mesh_component.i)
# This test solves two identical heat conduction problems, one created with THM
# components, and one with the constituent lower-level objects and FileMeshComponent.
rho = 8000
cp = 500
k = 15
initial_T = 1000
T_left = 1005
T_right = 300
htc_right = 1000
[Variables]
[T_moose]
block = 'hs_external:block_a'
initial_condition = ${initial_T}
[]
[]
[Kernels]
[time_derivative]
type = ADHeatConductionTimeDerivative
variable = T_moose
block = 'hs_external:block_a'
density_name = density
specific_heat = specific_heat
[]
[heat_conduction]
type = ADHeatConduction
variable = T_moose
block = 'hs_external:block_a'
thermal_conductivity = thermal_conductivity
[]
[]
[BCs]
[dirichlet_bc]
type = ADFunctionDirichletBC
variable = T_moose
boundary = 'hs_external:left'
function = ${T_left}
[]
[convection_bc]
type = ADConvectionHeatTransferBC
variable = T_moose
boundary = 'hs_external:right'
T_ambient = ${T_right}
htc_ambient = ${htc_right}
[]
[]
[Materials]
[prop_mat]
type = ADGenericConstantMaterial
prop_names = 'density specific_heat thermal_conductivity'
prop_values = '${rho} ${cp} ${k}'
[]
[]
[Components]
[hs_external]
type = FileMeshComponent
file = 'mesh_in.e'
position = '0 0 0'
[]
[hs]
type = HeatStructurePlate
position = '0 0 0'
orientation = '1 0 0'
length = 5.0
n_elems = 10
names = 'blk'
widths = '1.0'
n_part_elems = '2'
depth = 1.0
initial_T = ${initial_T}
[]
[start]
type = HSBoundarySpecifiedTemperature
hs = hs
boundary = 'hs:start'
T = ${T_left}
[]
[end]
type = HSBoundaryAmbientConvection
hs = hs
boundary = 'hs:end'
T_ambient = ${T_right}
htc_ambient = ${htc_right}
[]
[]
# Currently, there is no way to have a variable of the same name created in THM
# as one in MOOSE, even though they are on different blocks. Thus, we create a
# common variable name here and copy both variables into it for output.
[AuxVariables]
[T]
[]
[]
[AuxKernels]
[T_moose_ak]
type = CopyValueAux
variable = T
block = 'hs_external:block_a'
source = T_moose
execute_on = 'INITIAL TIMESTEP_END'
[]
[T_thm_ak]
type = CopyValueAux
variable = T
block = 'hs:blk'
source = T_solid
execute_on = 'INITIAL TIMESTEP_END'
[]
[]
[Preconditioning]
[pc]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
scheme = 'bdf2'
start_time = 0
dt = 1.0
num_steps = 5
abort_on_solve_fail = true
solve_type = 'NEWTON'
[]
[Outputs]
[exodus]
type = Exodus
file_base = 'file_mesh_component'
show = 'T'
[]
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d-rz/finite_action_al.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite_al'
[Mesh]
patch_size = 80
patch_update_strategy = auto
coord_type = RZ
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 0.6
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.61
xmax = 1.21
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
type = AugmentedLagrangianContactFEProblem
maximum_lagrangian_update_iterations = 20
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[temp]
order = ${order}
block = 'plank block'
scaling = 1e-1
[]
[]
[AuxVariables]
[penalty_normal_pressure]
[]
[]
[AuxKernels]
[penalty_normal_pressure]
type = PenaltyMortarUserObjectAux
variable = penalty_normal_pressure
user_object = penalty_weightedgap_object_al_frictionless
contact_quantity = normal_pressure
boundary = 'block_left'
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
strain = FINITE
[]
[]
[Kernels]
[hc]
type = ADHeatConduction
variable = temp
use_displaced_mesh = true
block = 'plank block'
[]
[]
[Contact]
[al_frictionless]
formulation = mortar_penalty
model = frictionless
primary = plank_right
secondary = block_left
penalty = 5e6
al_penetration_tolerance = 1e-7
penalty_multiplier = 50
[]
[]
[MortarGapHeatTransfer]
[mortar_heat_transfer]
temperature = temp
use_displaced_mesh = true
gap_flux_options = conduction
gap_conductivity = 1
boundary = plank_right
primary_boundary = plank_right
primary_subdomain = al_frictionless_primary_subdomain
secondary_boundary = block_left
secondary_subdomain = al_frictionless_secondary_subdomain
thermal_lm_scaling = 1e-7
gap_geometry_type = PLATE
[]
[]
[BCs]
[left_temp]
type = DirichletBC
variable = temp
boundary = 'plank_left'
value = 400
[]
[right_temp]
type = DirichletBC
variable = temp
boundary = 'block_right'
value = 300
[]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[heat_plank]
type = ADHeatConductionMaterial
block = plank
thermal_conductivity = 2
specific_heat = 1
[]
[heat_block]
type = ADHeatConductionMaterial
block = block
thermal_conductivity = 1
specific_heat = 1
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
end_time = 7.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'none'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[avg_temp]
type = ElementAverageValue
variable = temp
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
exodus = true
[comp]
type = CSV
show = 'avg_temp'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/multi_power_law/power_law_creep.i)
[Mesh]
type = GeneratedMesh
dim = 2
nx = 2
ny = 2
second_order = true
[]
[GlobalParams]
displacements = 'disp_x disp_y'
volumetric_locking_correction = false
[]
[Functions]
[pull]
type = PiecewiseLinear
x = '0 10'
y = '0 1e-3'
[]
[]
[AuxVariables]
[strain_energy_rate_density]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[strain_energy_rate_density]
type = MaterialRealAux
variable = strain_energy_rate_density
property = strain_energy_rate_density
execute_on = timestep_end
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = SMALL
incremental = true
add_variables = true
use_automatic_differentiation = true
generate_output = 'hydrostatic_stress vonmises_stress'
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.3
[]
[elastic_strain]
type = ADComputeMultipleInelasticStress
inelastic_models = "creep_nine creep_one"
[]
[creep_one]
type = ADPowerLawCreepStressUpdate
coefficient = 1e-24
n_exponent = 4
m_exponent = 0
activation_energy = 0
base_name = creep_one
[]
[creep_nine]
type = ADPowerLawCreepStressUpdate
coefficient = 9e-24
n_exponent = 4
m_exponent = 0
activation_energy = 0
base_name = creep_nine
[]
[strain_energy_rate_density]
type = ADStrainEnergyRateDensity
inelastic_models = 'creep_nine'
[]
[]
[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
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
petsc_options_iname = -pc_hypre_type
petsc_options_value = boomeramg
line_search = 'none'
nl_rel_tol = 1e-11
nl_abs_tol = 1e-11
num_steps = 5
dt = 1e-1
[]
[Postprocessors]
[max_disp_x]
type = ElementExtremeValue
variable = disp_x
[]
[max_disp_y]
type = ElementExtremeValue
variable = disp_y
[]
[max_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
[]
[dt]
type = TimestepSize
[]
[num_lin]
type = NumLinearIterations
outputs = console
[]
[num_nonlin]
type = NumNonlinearIterations
outputs = console
[]
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_function.i)
#
# Simple pull test for cracking. This tests the option to prescribe the
# cracking strength using an AuxVariable. In this case, an elemental
# AuxVariable is used, and a function is used to prescribe its value.
# One of the elements is weaker than the others, so the crack localizes
# in that element.
#
[Mesh]
file = plate.e
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[AuxVariables]
[./cracking_stress_fn]
order = CONSTANT
family = MONOMIAL
[../]
[./crack_flags2]
order = CONSTANT
family = MONOMIAL
[../]
[]
[Functions]
[./displ]
type = PiecewiseLinear
x = '0 0.1 0.2 0.3 0.4'
y = '0 0.001 0 -0.001 0'
[../]
[./fstress]
type = ParsedFunction
expression = 'if(x > 0.667, 1.1e6, 1.2e6)'
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx strain_xx strain_yy strain_xy strain_yz'
use_automatic_differentiation = true
[../]
[]
[AuxKernels]
[./cracking_stress_fn]
type = FunctionAux
variable = cracking_stress_fn
function = fstress
execute_on = initial
[../]
[./crack_flags2]
type = ADMaterialRealVectorValueAux
property = crack_flags
variable = crack_flags2
component = 2
[../]
[]
[BCs]
[./pull]
type = ADFunctionDirichletBC
variable = disp_x
boundary = '3 4'
function = displ
[../]
[./pin_x]
type = ADDirichletBC
variable = disp_x
boundary = '1 2'
value = 0
[../]
[./pin_y]
type = ADDirichletBC
variable = disp_y
boundary = '1 4'
value = 0.0
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 200.0e7
poissons_ratio = 0.0
[../]
[./elastic_stress]
type = ADComputeSmearedCrackingStress
cracking_stress = cracking_stress_fn
cracked_elasticity_type = FULL
softening_models = abrupt_softening
[../]
[./abrupt_softening]
type = ADAbruptSoftening
residual_stress = 0.0
[../]
[]
[Postprocessors]
[./elem_stress_xx]
type = ElementalVariableValue
variable = stress_xx
elementid = 2
[../]
[./elem_strain_xx]
type = ElementalVariableValue
variable = strain_xx
elementid = 2
[../]
[./elem_crack_flags_x]
type = ElementalVariableValue
variable = crack_flags2
elementid = 2
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart'
petsc_options_value = '101 '
line_search = 'none'
l_max_its = 100
nl_max_its = 100
nl_rel_tol = 1e-8
nl_abs_tol = 1e-6
l_tol = 1e-5
start_time = 0.0
end_time = 0.2
dt = 0.0025
[]
[Outputs]
exodus = true
[]
(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
[]
[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
[]
(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
[]
(modules/contact/test/tests/verification/patch_tests/automatic_patch_update/iteration_adaptivity_parallel.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y'
volumetric_locking_correction = true
[]
[Mesh]
coord_type = XYZ
patch_update_strategy = iteration
patch_size = 8
ghosting_patch_size = 20
[cube1]
type = GeneratedMeshGenerator
dim = 2
boundary_name_prefix = cube1
xmax = 1
ymax = 1
nx = 2
ny = 2
[]
[cube2]
type = GeneratedMeshGenerator
dim = 2
boundary_name_prefix = cube2
boundary_id_offset = 5
xmax = 1
ymax = 1
nx = 2
ny = 2
[]
[block_id]
type = SubdomainIDGenerator
input = cube2
subdomain_id = 2
[]
[combine]
inputs = 'cube1 block_id'
type = CombinerGenerator
positions = '0 0 0
0 1 0'
[]
[rename2]
type = RenameBlockGenerator
input = combine
old_block = '0 2'
new_block = 'cube1 cube2'
[]
[]
[Adaptivity]
initial_marker = box
initial_steps = 1
max_h_level = 1
[Markers]
[box]
type = BoxMarker
bottom_left = '0 0 0'
top_right = '0.5 0.5 0'
inside = refine
outside = do_nothing
[]
[]
[]
[Variables]
[disp_x]
block = 'cube1 cube2'
[]
[disp_y]
block = 'cube1 cube2'
[]
[]
[Modules/TensorMechanics/Master]
[cube1_mechanics]
strain = FINITE
block = 'cube1 cube2'
[]
[]
[BCs]
[cube1_x]
type = ADDirichletBC
variable = disp_x
boundary = 'cube1_bottom '
value = 0.0
[]
[cube1_y]
type = ADDirichletBC
variable = disp_y
boundary = 'cube1_bottom '
value = 0.0
[]
[cube2_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 'cube2_top'
function = '-t'
preset = false
[]
[cube2_x]
type = ADDirichletBC
variable = disp_x
boundary = 'cube2_top'
value = 0
[]
[]
[Materials]
[cube1_elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 68.9e9
poissons_ratio = 0.3
block = 'cube1'
[]
[stress]
type = ComputeFiniteStrainElasticStress
block = 'cube1 cube2'
[]
[cube2_elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 140e9
poissons_ratio = 0.3
block = 'cube2'
[]
[]
[Contact]
[contactswell]
secondary = cube1_top
primary = cube2_bottom
model = frictionless
formulation = mortar_penalty
penalty = 1.0e12
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu superlu_dist'
line_search = 'none'
nl_rel_tol = 1e-9
nl_abs_tol = 1e-9
nl_max_its = 50
l_tol = 1e-4
l_max_its = 50
start_time = 0.0
end_time = 0.02e-3
dtmax = 4
dtmin = 0.001e-3
dt = 0.01e-3
automatic_scaling = true
off_diagonals_in_auto_scaling = true
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
print_linear_residuals = true
[]
(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
[]
[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
[]
(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
[]
(modules/heat_transfer/test/tests/verify_against_analytical/ad_2d_steady_state.i)
# This test solves a 2D steady state heat equation
# The error is found by comparing to the analytical solution
# Note that the thermal conductivity, specific heat, and density in this problem
# Are set to 1, and need to be changed to the constants of the material being
# Analyzed
[Mesh]
type = GeneratedMesh
dim = 2
nx = 30
ny = 30
xmax = 2
ymax = 2
[]
[Variables]
[./T]
[../]
[]
[Kernels]
[./HeatDiff]
type = ADHeatConduction
variable = T
[../]
[]
[BCs]
[./zero]
type = DirichletBC
variable = T
boundary = 'right bottom left'
value = 0
[../]
[./top]
type = ADFunctionDirichletBC
variable = T
boundary = top
function = '10*sin(pi*x*0.5)'
[../]
[]
[Materials]
[./properties]
type = ADGenericConstantMaterial
prop_names = 'thermal_conductivity specific_heat density'
prop_values = '1 1 1'
[../]
[]
[Postprocessors]
[./nodal_error]
type = NodalL2Error
function = '10/(sinh(pi))*sin(pi*x*0.5)*sinh(pi*y*0.5)'
variable = T
[../]
[./elemental_error]
type = ElementL2Error
function = '10/(sinh(pi))*sin(pi*x*0.5)*sinh(pi*y*0.5)'
variable = T
[../]
[]
[Executioner]
type = Steady
[]
[Outputs]
exodus = true
[]
(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
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictionless_fir/finite_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite_rr'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
type = ReferenceResidualProblem
extra_tag_vectors = 'ref'
reference_vector = 'ref'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[action]
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank block'
extra_vector_tags = 'ref'
use_automatic_differentiation = true
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
nl_abs_tol = 1e-7
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictionless_sec/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'finite'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[action]
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
preset = false
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
preset = false
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
preset = false
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
preset = false
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 5.0
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/temperature_dependent_hardening/ADtemp_dep_hardening.i)
#
# This is a test of the piece-wise linear strain hardening model using the
# small strain formulation. This test exercises the temperature-dependent
# hardening curve capability.
#
# Test procedure:
# 1. The element is pulled to and then beyond the yield stress for a given
# temperature.
# 2. The displacement is then constant while the temperature increases and
# the yield stress decreases. This results in a lower stress with more
# plastic strain.
# 3. The temperature decreases beyond its original value giving a higher
# yield stress. The displacement increases, causing increases stress to
# the new yield stress.
# 4. The temperature and yield stress are constant with increasing
# displacement giving a constant stress and more plastic strain.
#
# Plotting total_strain_yy on the x axis and stress_yy on the y axis shows
# the stress history in a clear way.
#
# s |
# t | *****
# r | *
# e | ***** *
# s | * * *
# s | * *
# |*
# +------------------
# total strain
#
# The exact same problem was run in Abaqus with exactly the same result.
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
# This test uses ElementalVariableValue postprocessors on specific
# elements, so element numbering needs to stay unchanged
allow_renumbering = false
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[AuxVariables]
[temp]
order = FIRST
family = LAGRANGE
initial_condition = 500.0
[]
[]
[AuxKernels]
[temp_aux]
type = FunctionAux
variable = temp
function = temp_hist
[]
[]
[Functions]
[top_pull]
type = PiecewiseLinear
x = '0 1 2 4 5 6'
y = '0 0.025 0.05 0.05 0.06 0.085'
[]
[hf1]
type = PiecewiseLinear
x = '0.0 0.01 0.02 0.03 0.1'
y = '5000 5030 5060 5090 5300'
[]
[hf2]
type = PiecewiseLinear
x = '0.0 0.01 0.02 0.03 0.1'
y = '4000 4020 4040 4060 4200'
[]
[temp_hist]
type = PiecewiseLinear
x = '0 1 2 3 4'
y = '500 500 500 600 400'
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = SMALL
incremental = true
add_variables = true
generate_output = 'stress_yy strain_yy plastic_strain_xx plastic_strain_yy plastic_strain_zz'
use_automatic_differentiation = true
[]
[]
[BCs]
[y_pull_function]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 3
function = top_pull
[]
[x_bot]
type = ADDirichletBC
variable = disp_x
boundary = 4
value = 0.0
[]
[y_bot]
type = ADDirichletBC
variable = disp_y
boundary = 1
value = 0.0
[]
[z_bot]
type = ADDirichletBC
variable = disp_z
boundary = 0
value = 0.0
[]
[]
[Postprocessors]
[stress_yy_el]
type = ElementalVariableValue
variable = stress_yy
elementid = 0
[]
[]
[Materials]
[elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 2e5
poissons_ratio = 0.3
[]
[temp_dep_hardening]
type = ADTemperatureDependentHardeningStressUpdate
hardening_functions = 'hf1 hf2'
temperatures = '300.0 800.0'
relative_tolerance = 1e-25
absolute_tolerance = 1e-5
temperature = temp
[]
[radial_return_stress]
type = ADComputeMultipleInelasticStress
inelastic_models = 'temp_dep_hardening'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_ksp_ew'
petsc_options_iname = '-ksp_gmres_restart -pc_type -pc_hypre_type -pc_hypre_boomeramg_max_iter'
petsc_options_value = '201 hypre boomeramg 4'
line_search = 'none'
l_max_its = 100
nl_max_its = 100
nl_rel_tol = 1e-12
nl_abs_tol = 1e-10
l_tol = 1e-9
start_time = 0.0
end_time = 6
dt = 0.1
[]
[Outputs]
[out]
file_base = temp_dep_hardening_out
type = Exodus
[]
[]
(modules/solid_mechanics/test/tests/ad_viscoplasticity_stress_update/lps_single_split.i)
# This test provides an example of combining two LPS viscoplasticity model.
# The answer should be close, but not exactly the same, as lps_single.i
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
type = GeneratedMesh
dim = 2
nx = 1
ny = 1
xmax = 0.002
ymax = 0.002
[]
[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_2_eff_creep_strain'
symbol_names = 'lps_1_eff_creep_strain lps_2_eff_creep_strain'
expression = 'lps_1_eff_creep_strain+lps_2_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'
power = 3
base_name = 'lps_first'
outputs = all
relative_tolerance = 1e-11
[../]
[./two]
type = ADViscoplasticityStressUpdate
coefficient = 'coef'
power = 3
base_name = 'lps_second'
outputs = all
relative_tolerance = 1e-11
[../]
[./coef]
type = ADParsedMaterial
property_name = coef
# Example of creep power law
expression = '0.5e-18 * exp(-4e4 / 1.987 / 1200)'
[../]
[]
[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
[../]
[]
[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_first_effective_viscoplasticity
outputs = none
[../]
[./lps_2_eff_creep_strain]
type = ElementAverageValue
variable = lps_second_effective_viscoplasticity
outputs = none
[../]
[./eff_creep_strain_tot]
type = FunctionValuePostprocessor
function = tot_effective_viscoplasticity
[../]
[./porosity]
type = ElementAverageValue
variable = porosity
[../]
[]
[Outputs]
csv = true
[]
(modules/contact/test/tests/mortar_tm/2drz/ad_frictionless_first/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Problem]
coord_type = RZ
[]
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 0.6
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.61
xmax = 1.21
ymin = 9.2
ymax = 10.0
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[block]
use_automatic_differentiation = true
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'block'
[]
[plank]
use_automatic_differentiation = true
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank'
eigenstrain_names = 'swell'
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = DirichletBC
variable = disp_x
boundary = block_right
value = 0
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
preset = false
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[swell]
type = ADComputeEigenstrain
block = 'plank'
eigenstrain_name = swell
eigen_base = '1 0 0 0 0 0 0 0 0'
prefactor = swell_mat
[]
[swell_mat]
type = ADGenericFunctionMaterial
prop_names = 'swell_mat'
prop_values = '7e-2*(1-cos(4*t))'
block = 'plank'
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'PJFNK'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_power.i)
#
# Simple test of power law softening law for smeared cracking.
# Upon reaching the failure stress in the x direction, the
# softening model abruptly reduces the stress to a fraction
# of its original value, and re-loading occurs at a reduced
# stiffness. This is repeated multiple times.
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Functions]
[./displ]
type = PiecewiseLinear
x = '0 1 2 3 4'
y = '0 1 0 -1 0'
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[../]
[]
[BCs]
[./pull]
type = ADFunctionDirichletBC
variable = disp_x
boundary = right
function = displ
[../]
[./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
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 2.8e7
poissons_ratio = 0
[../]
[./elastic_stress]
type = ADComputeSmearedCrackingStress
cracking_stress = 1.68e6
cracked_elasticity_type = FULL
softening_models = power_law_softening
[../]
[./power_law_softening]
type = ADPowerLawSoftening
stiffness_reduction = 0.3333
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart -pc_type -sub_pc_type'
petsc_options_value = '101 asm lu'
line_search = 'none'
l_max_its = 100
nl_max_its = 100
nl_rel_tol = 1e-8
nl_abs_tol = 1e-8
l_tol = 1e-5
start_time = 0.0
end_time = 1.0
dt = 0.01
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d/finite_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[secondary]
input = block_rename
type = LowerDBlockFromSidesetGenerator
sidesets = 'block_left'
new_block_id = '30'
new_block_name = 'frictionless_secondary_subdomain'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
sidesets = 'plank_right'
new_block_id = '20'
new_block_name = 'frictionless_primary_subdomain'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
type = ReferenceResidualProblem
reference_vector = 'ref'
extra_tag_vectors = 'ref'
converge_on = 'disp_x disp_y temp'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[temp]
order = ${order}
block = 'plank block'
scaling = 1e-1
[]
[thermal_lm]
order = ${order}
block = 'frictionless_secondary_subdomain'
scaling = 1e-7
[]
[frictionless_normal_lm]
order = ${order}
block = 'frictionless_secondary_subdomain'
use_dual = true
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
strain = FINITE
extra_vector_tags = 'ref'
[]
[]
[Kernels]
[hc]
type = ADHeatConduction
variable = temp
use_displaced_mesh = true
block = 'plank block'
extra_vector_tags = 'ref'
[]
[]
[UserObjects]
[weighted_gap_uo]
type = LMWeightedGapUserObject
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
lm_variable = frictionless_normal_lm
disp_x = disp_x
disp_y = disp_y
[]
[]
[Constraints]
[weighted_gap_lm]
type = ComputeWeightedGapLMMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
disp_x = disp_x
disp_y = disp_y
use_displaced_mesh = true
weighted_gap_uo = weighted_gap_uo
[]
[normal_x]
type = NormalMortarMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_gap_uo
[]
[normal_y]
type = NormalMortarMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_gap_uo
[]
[thermal_contact]
type = GapConductanceConstraint
variable = thermal_lm
secondary_variable = temp
k = 1
use_displaced_mesh = true
primary_boundary = plank_right
primary_subdomain = frictionless_primary_subdomain
secondary_boundary = block_left
secondary_subdomain = frictionless_secondary_subdomain
displacements = 'disp_x disp_y'
[]
[]
[BCs]
[left_temp]
type = ADDirichletBC
variable = temp
boundary = 'plank_left'
value = 400
[]
[right_temp]
type = ADDirichletBC
variable = temp
boundary = 'block_right'
value = 300
[]
[left_x]
type = ADDirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = ADDirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[heat_plank]
type = ADHeatConductionMaterial
block = plank
thermal_conductivity = 2
specific_heat = 1
[]
[heat_block]
type = ADHeatConductionMaterial
block = block
thermal_conductivity = 1
specific_heat = 1
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -snes_max_it'
petsc_options_value = 'lu NONZERO 1e-15 20'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'none'
nl_abs_tol = 1e-13
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[avg_temp]
type = ElementAverageValue
variable = temp
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact avg_temp'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[dof]
type = DOFMap
execute_on = 'initial'
[]
[]
[Debug]
show_var_residual_norms = 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
[]
(modules/solid_mechanics/test/tests/substepping/power_law_creep.i)
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
[]
[]
[AuxVariables]
[temp]
initial_condition = 1000.0
[]
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
add_variables = true
generate_output = 'stress_zz elastic_strain_zz creep_strain_zz'
use_automatic_differentiation = false
[]
[]
[Functions]
[front_pull]
type = PiecewiseLinear
x = '0 1'
y = '0 1'
scale_factor = 0.5
[]
[]
[BCs]
[u_front_pull]
type = ADFunctionDirichletBC
variable = disp_z
boundary = front
function = front_pull
[]
[uz_back_fix]
type = ADDirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[u_yz_fix]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[u_xz_fix]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[]
[Materials]
[elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 2e11
poissons_ratio = 0.3
[]
[radial_return_stress]
type = ComputeMultipleInelasticStress
inelastic_models = 'power_law_creep'
[]
[power_law_creep]
type = PowerLawCreepStressUpdate
coefficient = 1.0e-15
n_exponent = 4
activation_energy = 0.0
temperature = temp
# options for using substepping
substep_strain_tolerance = 0.1
max_inelastic_increment = 0.01
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type '
petsc_options_value = 'lu '
line_search = 'none'
nl_max_its = 10
nl_rel_tol = 1e-6
nl_abs_tol = 1e-10
end_time = 0.1
dt = 0.1
[]
[Outputs]
exodus = true
[]
(modules/contact/test/tests/mortar_restart/frictional_bouncing_block_action_restart_1.i)
starting_point = 2e-1
offset = 1e-2
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[file]
type = FileMeshGenerator
file = long-bottom-block-no-lower-d.e
[]
allow_renumbering = false
uniform_refine = 0 # 1,2
patch_update_strategy = always
[]
[Variables]
[disp_x]
block = '1 2'
[]
[disp_y]
block = '1 2'
[]
[]
[ICs]
[disp_y]
block = 2
variable = disp_y
value = '${fparse starting_point + offset}'
type = ConstantIC
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = FINITE
generate_output = 'stress_xx stress_yy'
block = '1 2'
[]
[]
[Materials]
[elasticity_2]
type = ComputeIsotropicElasticityTensor
block = '2'
youngs_modulus = 1e3
poissons_ratio = 0.3
[]
[elasticity_1]
type = ComputeIsotropicElasticityTensor
block = '1'
youngs_modulus = 1e6
poissons_ratio = 0.3
[]
[stress]
type = ComputeFiniteStrainElasticStress
block = '1 2'
[]
[]
[Contact]
[frictional]
primary = 20
secondary = 10
formulation = mortar
model = coulomb
friction_coefficient = 0.4
c_normal = 1.0e1
c_tangential = 1.0e6
[]
[]
[BCs]
[botx]
type = DirichletBC
variable = disp_x
boundary = '40'
value = 0.0
[]
[boty]
type = DirichletBC
variable = disp_y
boundary = '40'
value = 0.0
[]
[topy]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 30
function = '${starting_point} * cos(2 * pi / 20 * t) + ${offset}'
preset = false
[]
[leftx]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 30
function = '2e-2 * t'
# function = '0'
preset = false
[]
[]
[Executioner]
type = Transient
end_time = 5.25 # 70
dt = 0.25 # 0.1 for finer meshes (uniform_refine)
dtmin = .01
solve_type = 'PJFNK'
petsc_options = '-snes_converged_reason -ksp_converged_reason -pc_svd_monitor '
'-snes_linesearch_monitor'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type -pc_factor_shift_type '
'-pc_factor_shift_amount -mat_mffd_err'
petsc_options_value = 'lu superlu_dist NONZERO 1e-15 '
' 1e-5'
l_max_its = 30
nl_max_its = 40
line_search = 'basic'
snesmf_reuse_base = false
nl_abs_tol = 1e-9
nl_rel_tol = 1e-9
l_tol = 1e-07 # Tightening l_tol can help with friction
[]
[Debug]
show_var_residual_norms = true
[]
[VectorPostprocessors]
[cont_press]
type = NodalValueSampler
variable = frictional_normal_lm
boundary = '10'
sort_by = x
execute_on = FINAL
[]
[friction]
type = NodalValueSampler
variable = frictional_tangential_lm
boundary = '10'
sort_by = x
execute_on = FINAL
[]
[]
[Outputs]
exodus = true
[checkfile]
type = CSV
show = 'cont_press friction'
start_time = 0.0
execute_vector_postprocessors_on = FINAL
[]
[checkpoint]
type = Checkpoint
num_files = 2
time_step_interval = 1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Postprocessors]
active = 'num_nl cumulative_nli contact cumulative_li num_l'
[num_nl]
type = NumNonlinearIterations
[]
[num_l]
type = NumLinearIterations
[]
[cumulative_nli]
type = CumulativeValuePostprocessor
postprocessor = num_nl
[]
[cumulative_li]
type = CumulativeValuePostprocessor
postprocessor = num_l
[]
[contact]
type = ContactDOFSetSize
variable = frictional_normal_lm
subdomain = 'frictional_secondary_subdomain'
execute_on = 'nonlinear timestep_end'
[]
[]
(modules/contact/test/tests/pdass_problems/frictional_bouncing_block.i)
starting_point = 2e-1
offset = 1e-2
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
file = long-bottom-block-1elem-blocks.e
uniform_refine = 0 # 1,2
patch_update_strategy = always
allow_renumbering = false
[]
[Variables]
[disp_x]
block = '1 2'
[]
[disp_y]
block = '1 2'
[]
[frictional_normal_lm]
block = 3
use_dual = true
[]
[frictional_tangential_lm]
block = 3
use_dual = true
[]
[]
[ICs]
[disp_y]
block = 2
variable = disp_y
value = '${fparse starting_point + offset}'
type = ConstantIC
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = FINITE
generate_output = 'stress_xx stress_yy'
block = '1 2'
[]
[]
[Materials]
[elasticity_2]
type = ComputeIsotropicElasticityTensor
block = '2'
youngs_modulus = 1e3
poissons_ratio = 0.3
[]
[elasticity_1]
type = ComputeIsotropicElasticityTensor
block = '1'
youngs_modulus = 1e6
poissons_ratio = 0.3
[]
[stress]
type = ComputeFiniteStrainElasticStress
block = '1 2'
[]
[]
[UserObjects]
[weighted_vel_uo]
type = LMWeightedVelocitiesUserObject
primary_boundary = 20
secondary_boundary = 10
primary_subdomain = 4
secondary_subdomain = 3
lm_variable_normal = frictional_normal_lm
lm_variable_tangential_one = frictional_tangential_lm
secondary_variable = disp_x
disp_x = disp_x
disp_y = disp_y
[]
[]
[Constraints]
[weighted_gap_lm]
type = ComputeFrictionalForceLMMechanicalContact
primary_boundary = 20
secondary_boundary = 10
primary_subdomain = 4
secondary_subdomain = 3
variable = frictional_normal_lm
disp_x = disp_x
disp_y = disp_y
use_displaced_mesh = true
friction_lm = frictional_tangential_lm
mu = 0.4
c = 1.0e1
c_t = 1.0e1
weighted_gap_uo = weighted_vel_uo
weighted_velocities_uo = weighted_vel_uo
[]
[normal_x]
type = NormalMortarMechanicalContact
primary_boundary = 20
secondary_boundary = 10
primary_subdomain = 4
secondary_subdomain = 3
variable = frictional_normal_lm
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_vel_uo
[]
[normal_y]
type = NormalMortarMechanicalContact
primary_boundary = 20
secondary_boundary = 10
primary_subdomain = 4
secondary_subdomain = 3
variable = frictional_normal_lm
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_vel_uo
[]
[tangential_x]
type = TangentialMortarMechanicalContact
primary_boundary = 20
secondary_boundary = 10
primary_subdomain = 4
secondary_subdomain = 3
variable = frictional_tangential_lm
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
weighted_velocities_uo = weighted_vel_uo
[]
[tangential_y]
type = TangentialMortarMechanicalContact
primary_boundary = 20
secondary_boundary = 10
primary_subdomain = 4
secondary_subdomain = 3
variable = frictional_tangential_lm
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
weighted_velocities_uo = weighted_vel_uo
[]
[]
[BCs]
[botx]
type = DirichletBC
variable = disp_x
boundary = '40'
value = 0.0
[]
[boty]
type = DirichletBC
variable = disp_y
boundary = '40'
value = 0.0
[]
[topy]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 30
function = '${starting_point} * cos(2 * pi / 20 * t) + ${offset}'
preset = false
[]
[leftx]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 30
function = '2e-2 * t'
# function = '0'
preset = false
[]
[]
[Executioner]
type = Transient
end_time = 7 # 70
dt = 0.25 # 0.1 for finer meshes (uniform_refine)
dtmin = .01
solve_type = 'PJFNK'
petsc_options = '-snes_converged_reason -ksp_converged_reason -pc_svd_monitor '
'-snes_linesearch_monitor'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type -pc_factor_shift_type -pc_factor_shift_amount -mat_mffd_err'
petsc_options_value = 'lu superlu_dist NONZERO 1e-15 1e-5'
l_max_its = 30
nl_max_its = 40
line_search = 'none'
snesmf_reuse_base = false
nl_abs_tol = 1e-9
nl_rel_tol = 1e-9
l_tol = 1e-07 # Tightening l_tol can help with friction
[]
[Debug]
show_var_residual_norms = true
[]
[VectorPostprocessors]
[cont_press]
type = NodalValueSampler
variable = frictional_normal_lm
boundary = '10'
sort_by = x
execute_on = FINAL
[]
[friction]
type = NodalValueSampler
variable = frictional_tangential_lm
boundary = '10'
sort_by = x
execute_on = FINAL
[]
[]
[Outputs]
exodus = false
[checkfile]
type = CSV
show = 'cont_press friction'
start_time = 0.0
execute_vector_postprocessors_on = FINAL
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Postprocessors]
active = 'num_nl cumulative_nli contact cumulative_li num_l'
[num_nl]
type = NumNonlinearIterations
[]
[num_l]
type = NumLinearIterations
[]
[cumulative_nli]
type = CumulativeValuePostprocessor
postprocessor = num_nl
[]
[cumulative_li]
type = CumulativeValuePostprocessor
postprocessor = num_l
[]
[contact]
type = ContactDOFSetSize
variable = frictional_normal_lm
subdomain = '3'
execute_on = 'nonlinear timestep_end'
[]
[]
(modules/contact/test/tests/verification/patch_tests/automatic_patch_update/iteration_adaptivity_parallel_node_face.i)
[GlobalParams]
order = FIRST
family = LAGRANGE
displacements = 'disp_x disp_y'
volumetric_locking_correction = true
[]
[Mesh]
coord_type = XYZ
patch_update_strategy = iteration
patch_size = 8
ghosting_patch_size = 20
[cube1]
type = GeneratedMeshGenerator
dim = 2
boundary_name_prefix = cube1
xmax = 1
ymax = 1
nx = 2
ny = 2
[]
[cube2]
type = GeneratedMeshGenerator
dim = 2
boundary_name_prefix = cube2
boundary_id_offset = 5
xmax = 1
ymax = 1
nx = 2
ny = 2
[]
[block_id]
type = SubdomainIDGenerator
input = cube2
subdomain_id = 2
[]
[combine]
inputs = 'cube1 block_id'
type = CombinerGenerator
positions = '0 0 0
0 1 0'
[]
[rename2]
type = RenameBlockGenerator
input = combine
old_block = '0 2'
new_block = 'cube1 cube2'
[]
[]
[Adaptivity]
initial_marker = box
initial_steps = 1
max_h_level = 1
[Markers]
[box]
type = BoxMarker
bottom_left = '0 0 0'
top_right = '0.5 0.5 0'
inside = refine
outside = do_nothing
[]
[]
[]
[Variables]
[disp_x]
block = 'cube1 cube2'
[]
[disp_y]
block = 'cube1 cube2'
[]
[]
[Modules/TensorMechanics/Master]
[cube1_mechanics]
strain = FINITE
block = 'cube1 cube2'
[]
[]
[BCs]
[cube1_x]
type = ADDirichletBC
variable = disp_x
boundary = 'cube1_bottom '
value = 0.0
[]
[cube1_y]
type = ADDirichletBC
variable = disp_y
boundary = 'cube1_bottom '
value = 0.0
[]
[cube2_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 'cube2_top'
function = '-t'
preset = false
[]
[cube2_x]
type = ADDirichletBC
variable = disp_x
boundary = 'cube2_top'
value = 0
[]
[]
[Materials]
[cube1_elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 68.9e9
poissons_ratio = 0.3
block = 'cube1'
[]
[stress]
type = ComputeFiniteStrainElasticStress
block = 'cube1 cube2'
[]
[cube2_elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 140e9
poissons_ratio = 0.3
block = 'cube2'
[]
[]
[Contact]
[contactswell]
secondary = cube1_top
primary = cube2_bottom
model = frictionless
formulation = kinematic
penalty = 1.0e6
normalize_penalty = true
tangential_tolerance = 0.1
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = 'lu superlu_dist'
line_search = 'none'
nl_rel_tol = 1e-16
nl_abs_tol = 1e-16
nl_max_its = 50
l_tol = 1e-4
l_max_its = 50
start_time = 0.0
end_time = 0.02e-3
dtmax = 4
dtmin = 0.001e-3
dt = 0.01e-3
automatic_scaling = true
off_diagonals_in_auto_scaling = true
[]
[Debug]
show_var_residual_norms = true
[]
[Outputs]
exodus = true
execute_on = 'FINAL'
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/small-2d-rz/small.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'small'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 0.6
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.61
xmax = 1.21
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[secondary]
input = block_rename
type = LowerDBlockFromSidesetGenerator
sidesets = 'block_left'
new_block_id = '30'
new_block_name = 'frictionless_secondary_subdomain'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
sidesets = 'plank_right'
new_block_id = '20'
new_block_name = 'frictionless_primary_subdomain'
[]
[]
[Problem]
coord_type = RZ
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[temp]
order = ${order}
block = 'plank block'
scaling = 1e-1
[]
[thermal_lm]
order = ${order}
block = 'frictionless_secondary_subdomain'
scaling = 1e-7
[]
[frictionless_normal_lm]
order = ${order}
block = 'frictionless_secondary_subdomain'
use_dual = true
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
[]
[]
[Kernels]
[hc]
type = ADHeatConduction
variable = temp
use_displaced_mesh = true
block = 'plank block'
[]
[]
[UserObjects]
[weighted_gap_uo]
type = LMWeightedGapUserObject
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
lm_variable = frictionless_normal_lm
disp_x = disp_x
disp_y = disp_y
[]
[]
[Constraints]
[weighted_gap_lm]
type = ComputeWeightedGapLMMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
disp_x = disp_x
disp_y = disp_y
use_displaced_mesh = true
weighted_gap_uo = weighted_gap_uo
[]
[normal_x]
type = NormalMortarMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_gap_uo
[]
[normal_y]
type = NormalMortarMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_gap_uo
[]
[thermal_contact]
type = GapConductanceConstraint
variable = thermal_lm
secondary_variable = temp
k = 1
use_displaced_mesh = true
primary_boundary = plank_right
primary_subdomain = frictionless_primary_subdomain
secondary_boundary = block_left
secondary_subdomain = frictionless_secondary_subdomain
displacements = 'disp_x disp_y'
[]
[]
[BCs]
[left_temp]
type = DirichletBC
variable = temp
boundary = 'plank_left'
value = 400
[]
[right_temp]
type = DirichletBC
variable = temp
boundary = 'block_right'
value = 300
[]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeLinearElasticStress
block = 'plank block'
[]
[heat_plank]
type = ADHeatConductionMaterial
block = plank
thermal_conductivity = 2
specific_heat = 1
[]
[heat_block]
type = ADHeatConductionMaterial
block = block
thermal_conductivity = 1
specific_heat = 1
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -snes_max_it'
petsc_options_value = 'lu NONZERO 1e-15 20'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'none'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[avg_temp]
type = ElementAverageValue
variable = temp
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact avg_temp'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = 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
[]
[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
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/small-2d/multi_component_mortar_thermal_conduction.i)
## Units in the input file: m-Pa-s-K
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[left_rectangle]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 10
xmax = 1
ymin = 0
ymax = 0.5
boundary_name_prefix = moving_block
[]
[left_block]
type = SubdomainIDGenerator
input = left_rectangle
subdomain_id = 1
[]
[right_rectangle]
type = GeneratedMeshGenerator
dim = 2
nx = 40
ny = 10
xmin = 1.
xmax = 2.
ymin = 0
ymax = 0.5
boundary_name_prefix = fixed_block
boundary_id_offset = 4
[]
[right_block]
type = SubdomainIDGenerator
input = right_rectangle
subdomain_id = 2
[]
[two_blocks]
type = MeshCollectionGenerator
inputs = 'left_block right_block'
[]
[block_rename]
type = RenameBlockGenerator
input = two_blocks
old_block = '1 2'
new_block = 'left_block right_block'
[]
patch_update_strategy = iteration
[]
[Variables]
[disp_x]
block = 'left_block right_block'
[]
[disp_y]
block = 'left_block right_block'
[]
[temperature]
initial_condition = 525.0
[]
[temperature_interface_lm]
block = 'interface_secondary_subdomain'
[]
[]
[Modules]
[TensorMechanics/Master]
[steel]
strain = SMALL
add_variables = false
use_automatic_differentiation = true
additional_generate_output = 'vonmises_stress'
additional_material_output_family = 'MONOMIAL'
additional_material_output_order = 'FIRST'
block = 'left_block'
[]
[aluminum]
strain = SMALL
add_variables = false
use_automatic_differentiation = true
additional_generate_output = 'vonmises_stress'
additional_material_output_family = 'MONOMIAL'
additional_material_output_order = 'FIRST'
block = 'right_block'
[]
[]
[]
[Kernels]
[HeatDiff_steel]
type = ADHeatConduction
variable = temperature
thermal_conductivity = steel_thermal_conductivity
block = 'left_block'
[]
[HeatTdot_steel]
type = ADHeatConductionTimeDerivative
variable = temperature
specific_heat = steel_heat_capacity
density_name = steel_density
block = 'left_block'
[]
[HeatDiff_aluminum]
type = ADHeatConduction
variable = temperature
thermal_conductivity = aluminum_thermal_conductivity
block = 'right_block'
[]
[HeatTdot_aluminum]
type = ADHeatConductionTimeDerivative
variable = temperature
specific_heat = aluminum_heat_capacity
density_name = aluminum_density
block = 'right_block'
[]
[]
[BCs]
[fixed_bottom_edge]
type = ADDirichletBC
variable = disp_y
value = 0
boundary = 'moving_block_bottom fixed_block_bottom'
[]
[fixed_outer_edge]
type = ADDirichletBC
variable = disp_x
value = 0
boundary = 'fixed_block_right'
[]
[displacement_left_block]
type = ADFunctionDirichletBC
variable = disp_x
function = 'if(t<61, 2.0e-7, -2.0e-8*(t-60))'
boundary = 'moving_block_left'
[]
[temperature_left]
type = ADDirichletBC
variable = temperature
value = 800
boundary = 'moving_block_left'
[]
[temperature_right]
type = ADDirichletBC
variable = temperature
value = 250
boundary = 'fixed_block_right'
[]
[]
[Contact]
[interface]
primary = moving_block_right
secondary = fixed_block_left
model = frictionless
formulation = mortar
correct_edge_dropping = true
[]
[]
[Constraints]
[thermal_contact]
type = ModularGapConductanceConstraint
variable = temperature_interface_lm
secondary_variable = temperature
primary_boundary = moving_block_right
primary_subdomain = interface_primary_subdomain
secondary_boundary = fixed_block_left
secondary_subdomain = interface_secondary_subdomain
gap_flux_models = 'radiation closed'
use_displaced_mesh = true
[]
[]
[Materials]
[steel_elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 1.93e11 #in Pa, 193 GPa, stainless steel 304
poissons_ratio = 0.29
block = 'left_block'
[]
[steel_stress]
type = ADComputeLinearElasticStress
block = 'left_block'
[]
[steel_thermal_properties]
type = ADGenericConstantMaterial
prop_names = 'steel_density steel_thermal_conductivity steel_heat_capacity'
prop_values = ' 8e3 16.2 0.5' ## for stainless steel 304
block = 'left_block'
[]
[aluminum_elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 6.8e10 #in Pa, 68 GPa, aluminum
poissons_ratio = 0.36
block = 'right_block'
[]
[aluminum_stress]
type = ADComputeLinearElasticStress
block = 'right_block'
[]
[aluminum_thermal_properties]
type = ADGenericConstantMaterial
prop_names = 'aluminum_density aluminum_thermal_conductivity aluminum_heat_capacity'
prop_values = ' 2.7e3 210 0.9'
block = 'right_block'
[]
[]
[UserObjects]
[radiation]
type = GapFluxModelRadiation
secondary_emissivity = 0.25
primary_emissivity = 0.6
temperature = temperature
boundary = moving_block_right
[]
[closed]
type = GapFluxModelPressureDependentConduction
primary_conductivity = steel_thermal_conductivity
secondary_conductivity = aluminum_thermal_conductivity
temperature = temperature
contact_pressure = interface_normal_lm
primary_hardness = 1.0
secondary_hardness = 1.0
boundary = moving_block_right
[]
[]
[Postprocessors]
[steel_pt_interface_temperature]
type = NodalVariableValue
nodeid = 245
variable = temperature
[]
[aluminum_pt_interface_temperature]
type = NodalVariableValue
nodeid = 657
variable = temperature
[]
[aluminum_element_interface_stress]
type = ElementalVariableValue
variable = vonmises_stress
elementid = 560
[]
[interface_heat_flux_steel]
type = ADSideDiffusiveFluxAverage
variable = temperature
boundary = moving_block_right
diffusivity = steel_thermal_conductivity
[]
[interface_heat_flux_aluminum]
type = ADSideDiffusiveFluxAverage
variable = temperature
boundary = fixed_block_left
diffusivity = aluminum_thermal_conductivity
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
automatic_scaling = false
line_search = 'none'
# mortar contact solver options
petsc_options = '-snes_converged_reason -pc_svd_monitor'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type'
petsc_options_value = ' lu superlu_dist'
snesmf_reuse_base = false
nl_rel_tol = 1e-10
nl_max_its = 20
l_max_its = 50
dt = 60
end_time = 120
[]
[Outputs]
csv = true
perf_graph = true
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictional/finite_stiff.i)
E_block = 1e7
E_plank = 1e9
elem = QUAD8
order = SECOND
name = 'finite_stiff'
[Mesh]
patch_size = 200
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[action]
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
[]
[]
[Contact]
[frictional]
primary = plank_right
secondary = block_left
formulation = mortar
model = coulomb
c_normal = 1e0
c_tangential = 1e-6
friction_coefficient = 0.2
tangential_lm_scaling = 1.0e-10
[]
[]
[BCs]
[left_x]
type = ADDirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
preset = false
[]
[left_y]
type = ADDirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
preset = false
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason -snes_ksp_ew'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu NONZERO 1e-12'
end_time = 5.3
dt = 0.12
dtmin = 0.12
line_search = 'none'
nl_div_tol = 1e100
timestep_tolerance = 1e-6
l_abs_tol = 1e-13
nl_abs_tol = 1e-9
nl_rel_tol = 1e-14
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictional_normal_lm
subdomain = frictional_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[]
[Debug]
show_var_residual_norms = 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
[]
(modules/contact/test/tests/pdass_problems/frictional_bouncing_block_action.i)
starting_point = 2e-1
offset = 1e-2
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Mesh]
[file]
type = FileMeshGenerator
file = long-bottom-block-1elem-blocks.e
[]
allow_renumbering = false
uniform_refine = 0 # 1,2
patch_update_strategy = always
[]
[Problem]
kernel_coverage_check = false
material_coverage_check = false
[]
[Variables]
[disp_x]
block = '1 2'
[]
[disp_y]
block = '1 2'
[]
[]
[ICs]
[disp_y]
block = 2
variable = disp_y
value = '${fparse starting_point + offset}'
type = ConstantIC
[]
[]
[Modules/TensorMechanics/Master]
[all]
strain = FINITE
generate_output = 'stress_xx stress_yy'
block = '1 2'
[]
[]
[Materials]
[elasticity_2]
type = ComputeIsotropicElasticityTensor
block = '2'
youngs_modulus = 1e3
poissons_ratio = 0.3
[]
[elasticity_1]
type = ComputeIsotropicElasticityTensor
block = '1'
youngs_modulus = 1e6
poissons_ratio = 0.3
[]
[stress]
type = ComputeFiniteStrainElasticStress
block = '1 2'
[]
[]
[Contact]
[frictional]
primary = 20
secondary = 10
formulation = mortar
model = coulomb
friction_coefficient = 0.4
c_normal = 1.0e1
c_tangential = 1.0e1
[]
[]
[BCs]
[botx]
type = DirichletBC
variable = disp_x
boundary = '40'
value = 0.0
[]
[boty]
type = DirichletBC
variable = disp_y
boundary = '40'
value = 0.0
[]
[topy]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 30
function = '${starting_point} * cos(2 * pi / 20 * t) + ${offset}'
preset = false
[]
[leftx]
type = ADFunctionDirichletBC
variable = disp_x
boundary = 30
function = '2e-2 * t'
# function = '0'
preset = false
[]
[]
[Executioner]
type = Transient
end_time = 7 # 70
dt = 0.25 # 0.1 for finer meshes (uniform_refine)
dtmin = .01
solve_type = 'PJFNK'
petsc_options = '-snes_converged_reason -ksp_converged_reason -pc_svd_monitor '
'-snes_linesearch_monitor'
petsc_options_iname = '-pc_type -pc_factor_mat_solver_type -pc_factor_shift_type -pc_factor_shift_amount -mat_mffd_err'
petsc_options_value = 'lu superlu_dist NONZERO 1e-15 1e-5'
l_max_its = 30
nl_max_its = 40
line_search = 'basic'
snesmf_reuse_base = false
nl_abs_tol = 1e-9
nl_rel_tol = 1e-9
l_tol = 1e-07 # Tightening l_tol can help with friction
[]
[Debug]
show_var_residual_norms = true
[]
[VectorPostprocessors]
[cont_press]
type = NodalValueSampler
variable = frictional_normal_lm
boundary = '10'
sort_by = x
execute_on = FINAL
[]
[friction]
type = NodalValueSampler
variable = frictional_tangential_lm
boundary = '10'
sort_by = x
execute_on = FINAL
[]
[]
[Outputs]
[checkfile]
type = CSV
show = 'cont_press friction'
start_time = 0.0
execute_vector_postprocessors_on = FINAL
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Postprocessors]
active = 'num_nl cumulative_nli contact cumulative_li num_l'
[num_nl]
type = NumNonlinearIterations
[]
[num_l]
type = NumLinearIterations
[]
[cumulative_nli]
type = CumulativeValuePostprocessor
postprocessor = num_nl
[]
[cumulative_li]
type = CumulativeValuePostprocessor
postprocessor = num_l
[]
[contact]
type = ContactDOFSetSize
variable = frictional_normal_lm
subdomain = 'frictional_secondary_subdomain'
execute_on = 'nonlinear timestep_end'
[]
[]
(modules/combined/test/tests/additive_manufacturing/check_element_addition_by_variable.i)
[Problem]
kernel_coverage_check = false
[]
[Mesh]
[gen]
type = GeneratedMeshGenerator
dim = 3
xmin = 0
xmax = 2.0
ymin = 0
ymax = 2.0
zmin = 0
zmax = 2.0
nx = 10
ny = 10
nz = 10
[]
[left_domain]
input = gen
type = SubdomainBoundingBoxGenerator
bottom_left = '0 0 0'
top_right = '2 2 1'
block_id = 1
[]
[right_domain]
input = left_domain
type = SubdomainBoundingBoxGenerator
bottom_left = '0 0 1'
top_right = '2 2 2'
block_id = 2
[]
[sidesets]
input = right_domain
type = SideSetsAroundSubdomainGenerator
normal = '0 0 1'
block = 1
new_boundary = 'moving_interface'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
block = '1 2'
[]
[Modules/TensorMechanics/Master]
[all]
# strain = FINITE
add_variables = true
generate_output = 'stress_zz strain_zz'
block = '1 2'
use_automatic_differentiation = true
[]
[]
[Materials]
[elasticity]
type = ADComputeVariableIsotropicElasticityTensor
poissons_ratio = 0.3
youngs_modulus = 1e3
block = '1 2'
[]
[stress]
type = ADComputeLinearElasticStress
block = '1 2'
[]
[]
[Functions]
[front_pull]
type = PiecewiseLinear
x = '0 1'
y = '0 1'
scale_factor = 0.5
[]
[]
[BCs]
[disp_front_pull]
type = ADFunctionDirichletBC
variable = disp_z
boundary = front
function = front_pull
[]
[uz_back_fix]
type = ADDirichletBC
variable = disp_z
boundary = back
value = 0.0
[]
[u_yz_fix]
type = ADDirichletBC
variable = disp_x
boundary = left
value = 0.0
[]
[u_xz_fix]
type = ADDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
[]
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Executioner]
type = Transient
automatic_scaling = true
solve_type = 'NEWTON'
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
line_search = 'none'
l_max_its = 10
nl_max_its = 20
nl_rel_tol = 1e-4
start_time = 0.0
end_time = 1.0
dt = 1e-1
dtmin = 1e-4
[]
[UserObjects]
[activated_elem_uo]
type = ActivateElementsCoupled
execute_on = timestep_begin
coupled_var = strain_zz
activate_value = 0.05
active_subdomain_id = 1
expand_boundary_name = 'moving_interface'
[]
[]
[Outputs]
exodus = true
[]
(modules/combined/test/tests/gap_heat_transfer_mortar/finite-2d-rz/finite.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD4
order = FIRST
name = 'finite'
[Mesh]
patch_size = 80
patch_update_strategy = auto
coord_type = RZ
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 0.6
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.61
xmax = 1.21
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[secondary]
input = block_rename
type = LowerDBlockFromSidesetGenerator
sidesets = 'block_left'
new_block_id = '30'
new_block_name = 'frictionless_secondary_subdomain'
[]
[primary]
input = secondary
type = LowerDBlockFromSidesetGenerator
sidesets = 'plank_right'
new_block_id = '20'
new_block_name = 'frictionless_primary_subdomain'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = ${fparse 2.0 / (E_plank + E_block)}
[]
[temp]
order = ${order}
block = 'plank block'
scaling = 1e-1
[]
[thermal_lm]
order = ${order}
block = 'frictionless_secondary_subdomain'
scaling = 1e-7
[]
[frictionless_normal_lm]
order = ${order}
block = 'frictionless_secondary_subdomain'
use_dual = true
[]
[]
[Modules/TensorMechanics/Master]
[action]
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx strain_yy strain_zz'
block = 'plank block'
use_automatic_differentiation = true
strain = FINITE
[]
[]
[Kernels]
[hc]
type = ADHeatConduction
variable = temp
use_displaced_mesh = true
block = 'plank block'
[]
[]
[UserObjects]
[weighted_gap_uo]
type = LMWeightedGapUserObject
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
lm_variable = frictionless_normal_lm
disp_x = disp_x
disp_y = disp_y
[]
[]
[Constraints]
[weighted_gap_lm]
type = ComputeWeightedGapLMMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
disp_x = disp_x
disp_y = disp_y
use_displaced_mesh = true
weighted_gap_uo = weighted_gap_uo
[]
[normal_x]
type = NormalMortarMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
secondary_variable = disp_x
component = x
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_gap_uo
[]
[normal_y]
type = NormalMortarMechanicalContact
primary_boundary = plank_right
secondary_boundary = block_left
primary_subdomain = frictionless_primary_subdomain
secondary_subdomain = frictionless_secondary_subdomain
variable = frictionless_normal_lm
secondary_variable = disp_y
component = y
use_displaced_mesh = true
compute_lm_residuals = false
weighted_gap_uo = weighted_gap_uo
[]
[thermal_contact]
type = GapConductanceConstraint
variable = thermal_lm
secondary_variable = temp
k = 1
use_displaced_mesh = true
primary_boundary = plank_right
primary_subdomain = frictionless_primary_subdomain
secondary_boundary = block_left
secondary_subdomain = frictionless_secondary_subdomain
displacements = 'disp_x disp_y'
[]
[]
[BCs]
[left_temp]
type = DirichletBC
variable = temp
boundary = 'plank_left'
value = 400
[]
[right_temp]
type = DirichletBC
variable = temp
boundary = 'block_right'
value = 300
[]
[left_x]
type = DirichletBC
variable = disp_x
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
preset = false
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = block_right
function = '-t'
preset = false
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[heat_plank]
type = ADHeatConductionMaterial
block = plank
thermal_conductivity = 2
specific_heat = 1
[]
[heat_block]
type = ADHeatConductionMaterial
block = block
thermal_conductivity = 1
specific_heat = 1
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -pc_factor_shift_type -pc_factor_shift_amount -snes_max_it'
petsc_options_value = 'lu NONZERO 1e-15 20'
end_time = 13.5
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'none'
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[avg_temp]
type = ElementAverageValue
variable = temp
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact avg_temp'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(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
[]
[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
[../]
[]
(modules/contact/test/tests/mortar_tm/2d/ad_frictionless_sec/finite_rr.i)
E_block = 1e7
E_plank = 1e7
elem = QUAD9
order = SECOND
name = 'finite_rr'
[Mesh]
patch_size = 80
patch_update_strategy = auto
[plank]
type = GeneratedMeshGenerator
dim = 2
xmin = -0.3
xmax = 0.3
ymin = -10
ymax = 10
nx = 2
ny = 67
elem_type = ${elem}
boundary_name_prefix = plank
[]
[plank_id]
type = SubdomainIDGenerator
input = plank
subdomain_id = 1
[]
[block]
type = GeneratedMeshGenerator
dim = 2
xmin = 0.31
xmax = 0.91
ymin = 7.7
ymax = 8.5
nx = 3
ny = 4
elem_type = ${elem}
boundary_name_prefix = block
boundary_id_offset = 10
[]
[block_id]
type = SubdomainIDGenerator
input = block
subdomain_id = 2
[]
[combined]
type = MeshCollectionGenerator
inputs = 'plank_id block_id'
[]
[block_rename]
type = RenameBlockGenerator
input = combined
old_block = '1 2'
new_block = 'plank block'
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
type = ReferenceResidualProblem
extra_tag_vectors = 'ref'
reference_vector = 'ref'
[]
[Variables]
[disp_x]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[disp_y]
order = ${order}
block = 'plank block'
scaling = '${fparse 2.0 / (E_plank + E_block)}'
[]
[]
[Modules/TensorMechanics/Master]
[action]
strain = FINITE
generate_output = 'stress_xx stress_yy stress_zz vonmises_stress hydrostatic_stress strain_xx '
'strain_yy strain_zz'
block = 'plank block'
extra_vector_tags = 'ref'
use_automatic_differentiation = true
[]
[]
[Contact]
[frictionless]
primary = plank_right
secondary = block_left
formulation = mortar
c_normal = 1e0
[]
[]
[BCs]
[left_x]
type = DirichletBC
variable = disp_x
preset = false
boundary = plank_left
value = 0.0
[]
[left_y]
type = DirichletBC
variable = disp_y
preset = false
boundary = plank_bottom
value = 0.0
[]
[right_x]
type = ADFunctionDirichletBC
variable = disp_x
preset = false
boundary = block_right
function = '-0.04*sin(4*(t+1.5))+0.02'
[]
[right_y]
type = ADFunctionDirichletBC
variable = disp_y
preset = false
boundary = block_right
function = '-t'
[]
[]
[Materials]
[plank]
type = ADComputeIsotropicElasticityTensor
block = 'plank'
poissons_ratio = 0.3
youngs_modulus = ${E_plank}
[]
[block]
type = ADComputeIsotropicElasticityTensor
block = 'block'
poissons_ratio = 0.3
youngs_modulus = ${E_block}
[]
[stress]
type = ADComputeFiniteStrainElasticStress
block = 'plank block'
[]
[]
[Executioner]
type = Transient
solve_type = 'NEWTON'
petsc_options = '-snes_converged_reason -ksp_converged_reason'
petsc_options_iname = '-pc_type -mat_mffd_err -pc_factor_shift_type -pc_factor_shift_amount'
petsc_options_value = 'lu 1e-5 NONZERO 1e-15'
end_time = 5.0
dt = 0.1
dtmin = 0.1
timestep_tolerance = 1e-6
line_search = 'contact'
nl_abs_tol = 1e-7
[]
[Postprocessors]
[nl_its]
type = NumNonlinearIterations
[]
[total_nl_its]
type = CumulativeValuePostprocessor
postprocessor = nl_its
[]
[l_its]
type = NumLinearIterations
[]
[total_l_its]
type = CumulativeValuePostprocessor
postprocessor = l_its
[]
[contact]
type = ContactDOFSetSize
variable = frictionless_normal_lm
subdomain = frictionless_secondary_subdomain
[]
[avg_hydro]
type = ElementAverageValue
variable = hydrostatic_stress
block = 'block'
[]
[max_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
[]
[min_hydro]
type = ElementExtremeValue
variable = hydrostatic_stress
block = 'block'
value_type = min
[]
[avg_vonmises]
type = ElementAverageValue
variable = vonmises_stress
block = 'block'
[]
[max_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
[]
[min_vonmises]
type = ElementExtremeValue
variable = vonmises_stress
block = 'block'
value_type = min
[]
[]
[Outputs]
file_base = ${name}
[comp]
type = CSV
show = 'contact'
[]
[out]
type = CSV
file_base = '${name}_out'
[]
[]
[Debug]
show_var_residual_norms = true
[]
(modules/solid_mechanics/test/tests/ad_finite_strain_jacobian/bending_jacobian.i)
[Mesh]
[generated_mesh]
type = GeneratedMeshGenerator
dim = 2
xmin = 0
xmax = 10
ymin = 0
ymax = 2
nx = 10
ny = 2
elem_type = QUAD4
[]
[corner]
type = ExtraNodesetGenerator
new_boundary = 101
coord = '0 0'
input = generated_mesh
[]
[side]
type = ExtraNodesetGenerator
new_boundary = 102
coord = '10 0'
input = corner
[]
[mid]
type = ExtraNodesetGenerator
new_boundary = 103
coord = '5 2'
input = side
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Physics/SolidMechanics/QuasiStatic]
[all]
strain = FINITE
add_variables = true
use_finite_deform_jacobian = true
volumetric_locking_correction = false
use_automatic_differentiation = true
[]
[]
[Materials]
[stress]
type = ADComputeFiniteStrainElasticStress
[]
[elasticity_tensor]
type = ADComputeElasticityTensor
fill_method = symmetric9
C_ijkl = '1.684e5 0.176e5 0.176e5 1.684e5 0.176e5 1.684e5 0.754e5 0.754e5 0.754e5'
[]
[]
[BCs]
[fix_corner_x]
type = ADDirichletBC
variable = disp_x
boundary = 101
value = 0
[]
[fix_corner_y]
type = ADDirichletBC
variable = disp_y
boundary = 101
value = 0
[]
[fix_y]
type = ADDirichletBC
variable = disp_y
boundary = 102
value = 0
[]
[move_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 103
function = '-t'
[]
[]
[Executioner]
type = Transient
solve_type = NEWTON
petsc_options_iname = '-pc_type'
petsc_options_value = 'lu'
nl_rel_tol = 1e-10
nl_max_its = 10
l_tol = 1e-4
l_max_its = 50
dt = 0.1
dtmin = 0.1
num_steps = 2
[]
[Preconditioning]
[smp]
type = SMP
full = true
[]
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/ad_smeared_cracking/cracking_plane_stress.i)
################################################################################
#
# 1x1x1 cube, single element
# simulate plane stress
# pull in +y direction on right surface to produce shear strain
#
#
#
# ____________
# /| /|
# / | 5 / | -X Left 1
# /__________ / | +X Right 4
# | | 3 | | +Y Top 5
# | 1 | | 4 | -Y Bottom 2
# | |_6_____|___| y +Z Front 6
# | / | / ^ -Z Back 3
# | / 2 | / |
# |/__________|/ |
# ----> x
# /
# /
# z
#
#
#
#################################################################################
[Mesh]
file = cube.e
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Functions]
[./displ]
type = PiecewiseLinear
x = '0 0.1 0.2 0.3 0.4'
y = '0 0.0026 0 -0.0026 0'
[../]
[./pressure]
type = PiecewiseLinear
x = '0 0.1 0.2 0.3 0.4'
y = '0 0 0 0 0'
[../]
[]
[Physics/SolidMechanics/QuasiStatic]
[./all]
strain = FINITE
add_variables = true
generate_output = 'stress_xx stress_yy stress_zz stress_xy stress_yz stress_zx'
use_automatic_differentiation = true
[../]
[]
[BCs]
[./pull_y]
type = ADFunctionDirichletBC
variable = disp_y
boundary = 4
function = displ
[../]
[./pin_x]
type = ADDirichletBC
variable = disp_x
boundary = '1 4'
value = 0.0
[../]
[./pin_y]
type = ADDirichletBC
variable = disp_y
boundary = 1
value = 0.0
[../]
[./back]
type = ADDirichletBC
variable = disp_z
boundary = '3'
value = 0.0
[../]
[./front]
type = ADPressure
variable = disp_z
boundary = 6
function = pressure
[../]
[]
[Materials]
[./elasticity_tensor]
type = ADComputeIsotropicElasticityTensor
youngs_modulus = 200.0e3
poissons_ratio = .3
[../]
[./elastic_stress]
type = ADComputeSmearedCrackingStress
cracking_stress = 120
cracked_elasticity_type = DIAGONAL
shear_retention_factor = 0.1
softening_models = exponential_softening
[../]
[./exponential_softening]
type = ADExponentialSoftening
residual_stress = 0.1
beta = 0.1
[../]
[]
[Executioner]
type = Transient
solve_type = Newton
petsc_options_iname = '-ksp_gmres_restart -pc_type -sub_pc_type'
petsc_options_value = '101 asm lu'
line_search = 'none'
l_max_its = 100
nl_max_its = 100
nl_rel_tol = 1e-12
nl_abs_tol = 1e-8
l_tol = 1e-5
start_time = 0.0
end_time = 0.4
dt = 0.04
[]
[Outputs]
exodus = true
[]