- first_order_varsA subset of variables that require first-order integration (velocity only) to be applied by this time integrator.
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:A subset of variables that require first-order integration (velocity only) to be applied by this time integrator.
- mass_matrix_tagmassThe tag for the mass matrix
Default:mass
C++ Type:TagName
Controllable:No
Description:The tag for the mass matrix
- recompute_mass_matrix_after_mesh_changeFalseIf set to true, the mass matrix will be recomputed when the mesh changes (e.g. through adaptivity). If use_constant_mass is set to true, adadaptivity is used, and this parameter is not set to true, the simulation will error out when the mesh changes.
Default:False
C++ Type:bool
Controllable:No
Description:If set to true, the mass matrix will be recomputed when the mesh changes (e.g. through adaptivity). If use_constant_mass is set to true, adadaptivity is used, and this parameter is not set to true, the simulation will error out when the mesh changes.
- second_order_varsA subset of variables that require second-order integration (velocity and acceleration) to be applied by this time integrator.
C++ Type:std::vector<VariableName>
Unit:(no unit assumed)
Controllable:No
Description:A subset of variables that require second-order integration (velocity and acceleration) to be applied by this time integrator.
- use_constant_massFalseIf set to true, will only compute the mass matrix in the first time step, and keep using it throughout the simulation.
Default:False
C++ Type:bool
Controllable:No
Description:If set to true, will only compute the mass matrix in the first time step, and keep using it throughout the simulation.
ExplicitMixedOrder
Implementation of explicit time integration without invoking any of the nonlinear solver.
Overview
ExplicitMixedOrder applies a time integrator for central difference in which the acceleration used for the solution update is calculated directly from the residual forces.
The formulation assumes a constant acceleration between midpoints. An average between the old and current time step is used to increment midpoint velocity to account for changing time steps, which is the same method used in Abaqus.
For example if, then,
When using Dirichlet BCs, one must use the (ExplicitDirichletBC,ExplicitFunctionDirichletBC) variations to enforce Dirichlet BC's properly.
Additionally, the time integrator must be used with MassMatrix, with a properly tagged mass matrix.
Example Input File Syntax
An example input file is shown below:
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Kernels]
[DynamicSolidMechanics]
displacements = 'disp_x disp_y'
[]
[massmatrix]
type = MassMatrix
density = 1
matrix_tags = 'system'
variable = disp_x
[]
[massmatrix_y]
type = MassMatrix
density = 1
matrix_tags = 'system'
variable = disp_y
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = CentralDifferenceDirect
mass_matrix_tag = 'system'
[]
[]
Input 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:No
Description:Set the enabled status of the MooseObject.
Advanced Parameters
Input Files
- (modules/solid_mechanics/test/tests/dynamics/time_integration/direct_central_difference_varied_dt.i)
- (modules/contact/test/tests/explicit_dynamics/test_balance_optimized.i)
- (modules/solid_mechanics/test/tests/dynamics/explicit_mms/mms_direct_combined.i)
- (modules/solid_mechanics/test/tests/dynamics/rayleigh_damping/explicit.i)
- (modules/contact/test/tests/explicit_dynamics/deep_impact.i)
- (modules/contact/test/tests/explicit_dynamics/settlement.i)
- (modules/contact/test/tests/explicit_dynamics/highvel.i)
- (modules/solid_mechanics/test/tests/dynamics/explicit_mms/mms_direct_second_order_with_ic.i)
- (modules/solid_mechanics/test/tests/dynamics/time_integration/direct_central_difference_multiVarBC.i)
- (modules/contact/test/tests/explicit_dynamics/block_restricted.i)
- (modules/contact/test/tests/explicit_dynamics/test_balance.i)
- (modules/solid_mechanics/test/tests/neml2/explicit_dynamics/moose.i)
- (modules/solid_mechanics/test/tests/neml2/explicit_dynamics/moose_adaptivity.i)
- (modules/solid_mechanics/test/tests/dynamics/time_integration/mass_scaling.i)
- (modules/solid_mechanics/test/tests/dynamics/time_integration/direct_central_difference.i)
Child Objects
(modules/solid_mechanics/test/tests/dynamics/time_integration/direct_central_difference_varied_dt.i)
###########################################################
# This is a simple test with a time-dependent problem
# demonstrating the use of a central difference with a
# direct calculation of acceleration.
#
# Testing that the first and second time derivatives
# are calculated correctly using the Direct Central Difference
# method
# Testing the accuracy of the timestep averaging method within
# the Direct Central Difference method
###########################################################
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 1
ny = 1
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Functions]
#Mid-step velocities
#0 0.00625 0.015 0.0075 0.25 0
#Accelerations
#0.025 0.01944 -0.01 0.48 -2.17
[forcing_fn]
type = PiecewiseLinear
x = '0.0 0.1 0.5 1.0 2.0 2.01 2.23'
y = '0.0 0.0 0.0025 0.01 0.0175 0.02 0.02'
[]
[]
[Kernels]
[DynamicSolidMechanics]
displacements = 'disp_x disp_y'
[]
[massmatrix]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_x
[]
[massmatrix_y]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_y
[]
[]
[Materials]
[elasticity_tensor_block_one]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e1
poissons_ratio = 0.0
[]
[strain_block]
type = ComputeFiniteStrain
displacements = 'disp_x disp_y'
implicit = false
[]
[stress_block]
type = ComputeFiniteStrainElasticStress
implicit = false
[]
[density]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = 5
[]
[]
[BCs]
[left_x]
type = ExplicitFunctionDirichletBC
variable = disp_x
boundary = 'left'
function = forcing_fn
[]
[right_x]
type = ExplicitFunctionDirichletBC
variable = disp_x
boundary = 'right'
function = forcing_fn
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
second_order_vars = 'disp_x disp_y'
[]
[TimeStepper]
type = TimeSequenceStepper
time_sequence = '0.0 0.1 0.5 1.0 2.0 2.01 2.23'
[]
start_time = 0.0
num_steps = 6
dt = 0.1
[]
[Postprocessors]
[udot]
type = ElementAverageTimeDerivative
variable = disp_x
[]
[udotdot]
type = ElementAverageSecondTimeDerivative
variable = disp_x
[]
[u]
type = ElementAverageValue
variable = disp_x
[]
[]
[Outputs]
exodus = true
[]
(modules/contact/test/tests/explicit_dynamics/test_balance_optimized.i)
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Mesh]
[block_one]
type = GeneratedMeshGenerator
dim = 3
nx = 3
ny = 3
nz = 3
xmin = 4.5
xmax = 5.5
ymin = 4.5
ymax = 5.5
zmin = 0.0001
zmax = 1.0001
boundary_name_prefix = 'ball'
[]
[block_two]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
xmin = 0.0
xmax = 10
ymin = 0.0
ymax = 10
zmin = -2
zmax = 0
boundary_name_prefix = 'base'
boundary_id_offset = 10
[]
[block_one_id]
type = SubdomainIDGenerator
input = block_one
subdomain_id = 1
[]
[block_two_id]
type = SubdomainIDGenerator
input = block_two
subdomain_id = 2
[]
[combine]
type = MeshCollectionGenerator
inputs = ' block_one_id block_two_id'
[]
allow_renumbering = false
patch_update_strategy = auto
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[AuxVariables]
[gap_rate]
[]
[vel_x]
[]
[accel_x]
[]
[vel_y]
[]
[accel_y]
[]
[vel_z]
[]
[accel_z]
[]
[]
[AuxKernels]
[accel_x]
type = TestNewmarkTI
variable = accel_x
displacement = disp_x
first = false
execute_on = 'TIMESTEP_END'
[]
[vel_x]
type = TestNewmarkTI
variable = vel_x
displacement = disp_x
execute_on = 'TIMESTEP_END'
[]
[accel_y]
type = TestNewmarkTI
variable = accel_y
displacement = disp_y
first = false
execute_on = 'TIMESTEP_END'
[]
[vel_y]
type = TestNewmarkTI
variable = vel_y
displacement = disp_x
execute_on = 'TIMESTEP_END'
[]
[accel_z]
type = TestNewmarkTI
variable = accel_z
displacement = disp_z
first = false
execute_on = 'TIMESTEP_END'
[]
[vel_z]
type = TestNewmarkTI
variable = vel_z
displacement = disp_z
execute_on = 'TIMESTEP_END'
[]
[]
[Kernels]
[DynamicTensorMechanics]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
stiffness_damping_coefficient = 0.001
decomposition_method = EigenSolution
[]
[Mass_x]
type = MassMatrix
variable = disp_x
density = density
matrix_tags = 'mass'
[]
[Mass_y]
type = MassMatrix
variable = disp_y
density = density
matrix_tags = 'mass'
[]
[Mass_z]
type = MassMatrix
variable = disp_z
density = density
matrix_tags = 'mass'
[]
[]
[Kernels]
[gravity]
type = Gravity
variable = disp_z
value = -981.0
[]
[]
[BCs]
[x_front]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'ball_front'
value = 0.0
[]
[y_front]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'ball_front'
value = 0.0
[]
[x_fixed]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'base_back'
value = 0.0
[]
[y_fixed]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'base_back'
value = 0.0
[]
[z_fixed]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'base_back'
value = 0.0
[]
[z_fixed_front]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'base_front'
value = 0.0
[]
[]
[ExplicitDynamicsContact]
[my_contact]
model = frictionless_balance
primary = base_front
secondary = ball_back
vel_x = 'vel_x'
vel_y = 'vel_y'
vel_z = 'vel_z'
[]
[]
[Materials]
[elasticity_tensor_block_one]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.0
block = 1
constant_on = SUBDOMAIN
[]
[elasticity_tensor_block_two]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.0
block = 2
constant_on = SUBDOMAIN
[]
[strain_block]
type = ComputeFiniteStrain
displacements = 'disp_x disp_y disp_z'
implicit = false
[]
[stress_block]
type = ComputeFiniteStrainElasticStress
[]
[density_one]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e1
output_properties = 'density'
block = '1'
[]
[density_two]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e6
output_properties = 'density'
block = '2'
[]
[wave_speed]
type = WaveSpeed
outputs = 'exodus'
output_properties = 'wave_speed'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 0.0025
dt = 0.00001
timestep_tolerance = 1e-6
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
use_constant_mass = true
second_order_vars = 'disp_x disp_y disp_z'
[]
[]
[Outputs]
time_step_interval = 10
exodus = true
csv = true
file_base = test_balance_out
[]
(modules/solid_mechanics/test/tests/dynamics/explicit_mms/mms_direct_combined.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD4
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Variables]
[u_first]
[]
[u_second]
[]
[]
[AuxVariables]
[dot_u_second]
[]
[]
[AuxKernels]
[dot_u_second]
type = TestNewmarkTI
variable = dot_u_second
displacement = u_second
first = true
execute_on = 'TIMESTEP_END'
[]
[]
[Functions]
[ic]
type = ParsedFunction
expression = 0
[]
[forcing_fn_first]
type = ParsedFunction
expression = (x+y)
[]
[exact_fn_first]
type = ParsedFunction
expression = t*(x+y)
[]
[exact_fn_second]
type = ParsedFunction
expression = '0.5*t^2'
[]
[exact_dot_fn_second]
type = ParsedFunction
expression = 't'
[]
[]
[Kernels]
[Mass_x_second]
type = MassMatrix
variable = u_second
density = 1
matrix_tags = 'mass'
[]
[ffn_second]
type = BodyForce
variable = u_second
function = 1
[]
[Mass_x_first]
type = MassMatrix
variable = u_first
density = 1
matrix_tags = 'mass'
[]
[diff]
type = Diffusion
variable = u_first
[]
[ffn]
type = BodyForce
variable = u_first
function = forcing_fn_first
[]
[]
[BCs]
[all]
type = ExplicitFunctionDirichletBC
variable = u_first
boundary = '0 1 2 3'
function = exact_fn_first
[]
[]
[Postprocessors]
[l2_err_second]
type = ElementL2Error
variable = u_second
function = exact_fn_second
[]
[l2_dot_err_second]
type = ElementL2Error
variable = dot_u_second
function = exact_dot_fn_second
[]
[l2_err_first]
type = ElementL2Error
variable = u_first
function = exact_fn_first
[]
[]
[Executioner]
type = Transient
start_time = 0.0
num_steps = 20
dt = 0.00005
l_tol = 1e-12
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
use_constant_mass = true
second_order_vars = 'u_second'
first_order_vars = 'u_first'
[]
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 10
[]
[]
# Tests stateful material properties below
[Materials]
[u_sqrd]
type = ParsedMaterial
expression = 'u_first^2'
property_name = u_sqrd
coupled_variables = 'u_first'
[]
[]
[AuxVariables]
[diff_t_begin]
family = MONOMIAL
order = CONSTANT
[]
[diff_t_end]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[diff_t_begin]
type = MaterialRateRealAux
property = u_sqrd
variable = diff_t_begin
execute_on = LINEAR
[]
[diff_t_end]
type = MaterialRateRealAux
property = u_sqrd
variable = diff_t_end
execute_on = TIMESTEP_END
[]
[]
[Postprocessors]
[l2_norm_begin]
type = ElementL2Norm
variable = diff_t_begin
[]
[l2_norm_end]
type = ElementL2Norm
variable = diff_t_end
[]
[]
(modules/solid_mechanics/test/tests/dynamics/rayleigh_damping/explicit.i)
# Test for Rayleigh mass damping implemented using ExplicitMixedOrder time integration
# The test is for an 1D bar element of unit length fixed on one end
# with a ramped pressure boundary condition applied to the other end.
# The equation of motion in terms of matrices is:
#
# M*accel + eta*M*vel + zeta*K*vel + K*disp = P*Area
#
# Here M is the mass matrix, K is the stiffness matrix, P is the applied pressure.
# zeta and eta correspond to the stiffness and mass proportional Rayleigh damping,
# and in this test zeta = 0
#
zeta = 0
eta = 1
young = 8
poisson = 0
density = 2
pressure = -1
dt = 0.1
############
# By-hand calculation of solution
# The single cubical element of side length 2 has
# area of node = 1, so P*area = -1
# K * disp = force on node due to disp = stress*area = (young*disp/2)*1 = 4*disp
# M = nodal mass = density * 2^3 / 8 = 2
# time step 1:
# residual = P*area - K*disp - eta*M*vel = -1
# accel = residual/mass = -0.5
# vel += accel * dt = -0.05
# disp += vel * dt = -0.005
# time step 2:
# residual = P*area - K*disp - eta*M*vel = -1 - 4*(-0.005) - 1*2*(-0.05)= -0.88
# accel = residual/mass = -0.44
# vel += accel * dt = -0.094
# disp += vel * dt = -0.0144
############
# Setting implicit = false in an object means:
# - Jacobian terms will not be calculated
# - old values will be used (for instance, old displacement,
# not displacement that is being calculated at current time step)
# So, implicit = false is the standard in most objects in ExplicitMixedOrder
# Exceptions:
# - MassMatrix (because MOOSE treats the mass matrix as a Jacobian)
# - AuxKernels and Postprocessors (want to use most recent variables)
# It is irrelevant for some things, such as ComputeIsotropicElasticityTensor
[Mesh]
type = GeneratedMesh
dim = 3
nx = 1
ny = 1
nz = 1
xmin = 0
xmax = 2
ymin = 0
ymax = 2
zmin = 0
zmax = 2
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[Kernels]
[TM_DynamicSolidMechanics0]
type = DynamicStressDivergenceTensors
alpha = 0
component = 0
use_displaced_mesh = false
variable = disp_x
zeta = ${zeta}
implicit = false
[]
[TM_DynamicSolidMechanics1]
type = DynamicStressDivergenceTensors
alpha = 0
component = 1
use_displaced_mesh = false
variable = disp_y
zeta = ${zeta}
implicit = false
[]
[TM_DynamicSolidMechanics2]
type = DynamicStressDivergenceTensors
alpha = 0
component = 2
use_displaced_mesh = false
variable = disp_z
zeta = ${zeta}
implicit = false
[]
[massmatrix_x]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_x
[]
[massmatrix_y]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_y
[]
[massmatrix_z]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_z
[]
[]
[NodalKernels]
[damping_x]
type = ExplicitMassDamping
variable = disp_x
eta = ${eta}
implicit = false
[]
[damping_y]
type = ExplicitMassDamping
variable = disp_y
eta = ${eta}
implicit = false
[]
[damping_z]
type = ExplicitMassDamping
variable = disp_z
eta = ${eta}
implicit = false
[]
[]
[BCs]
[Pressure]
[Side1]
boundary = bottom
postprocessor = ${pressure}
displacements = 'disp_x disp_y disp_z'
[]
[]
[top_y]
type = ExplicitDirichletBC
variable = disp_y
boundary = top
value = 0.0
implicit = false
[]
[zero_x]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'top bottom'
value = 0.0
implicit = false
[]
[zero_z]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'top bottom'
value = 0.0
implicit = false
[]
[]
[Materials]
[Elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = ${young}
poissons_ratio = ${poisson}
implicit = false
[]
[strain]
type = ComputeSmallStrain
implicit = false
[]
[stress]
type = ComputeLinearElasticStress
implicit = false
[]
[density]
type = GenericConstantMaterial
prop_names = density
prop_values = ${density}
implicit = false
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
second_order_vars = 'disp_x disp_y disp_z'
use_constant_mass = true
[]
start_time = 0
end_time = 0.2
dt = ${dt}
[]
[Postprocessors]
[disp]
type = NodalExtremeValue
variable = disp_y
boundary = bottom
[]
[]
[Outputs]
csv = true
[]
(modules/contact/test/tests/explicit_dynamics/deep_impact.i)
# This test demonstrates explicit contact with MOOSE and includes optimizations
# to enhance performance.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Mesh]
[block_one]
type = GeneratedMeshGenerator
dim = 3
nx = 4
ny = 4
nz = 4
xmin = 4.5
xmax = 5.5
ymin = 4.5
ymax = 5.5
zmin = 0.0001
zmax = 1.0001
boundary_name_prefix = 'ball'
[]
[block_two]
type = GeneratedMeshGenerator
dim = 3
nx = 9
ny = 9
nz = 4
xmin = 3
xmax = 7
ymin = 3
ymax = 7
zmin = -2
zmax = 0
boundary_name_prefix = 'base'
boundary_id_offset = 10
[]
[block_one_id]
type = SubdomainIDGenerator
input = block_one
subdomain_id = 1
[]
[block_two_id]
type = SubdomainIDGenerator
input = block_two
subdomain_id = 2
[]
[combine]
type = MeshCollectionGenerator
inputs = ' block_one_id block_two_id'
[]
allow_renumbering = false
# patch_update_strategy = always
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[AuxVariables]
[gap_rate]
[]
[vel_x]
[]
[accel_x]
[]
[vel_y]
[]
[accel_y]
[]
[vel_z]
[]
[accel_z]
[]
[]
[AuxKernels]
[accel_x]
type = TestNewmarkTI
variable = accel_x
displacement = disp_x
first = false
execute_on = 'TIMESTEP_END'
[]
[vel_x]
type = TestNewmarkTI
variable = vel_x
displacement = disp_x
execute_on = 'TIMESTEP_END'
[]
[accel_y]
type = TestNewmarkTI
variable = accel_y
displacement = disp_y
first = false
execute_on = 'TIMESTEP_END'
[]
[vel_y]
type = TestNewmarkTI
variable = vel_y
displacement = disp_x
execute_on = 'TIMESTEP_END'
[]
[accel_z]
type = TestNewmarkTI
variable = accel_z
displacement = disp_z
first = false
execute_on = 'TIMESTEP_END'
[]
[vel_z]
type = TestNewmarkTI
variable = vel_z
displacement = disp_z
execute_on = 'TIMESTEP_END'
[]
[]
[Kernels]
[DynamicTensorMechanics]
displacements = 'disp_x disp_y disp_z'
[]
[Mass_x]
type = MassMatrix
variable = disp_x
density = density
matrix_tags = 'mass'
[]
[Mass_y]
type = MassMatrix
variable = disp_y
density = density
matrix_tags = 'mass'
[]
[Mass_z]
type = MassMatrix
variable = disp_z
density = density
matrix_tags = 'mass'
[]
[]
[Kernels]
[gravity]
type = Gravity
variable = disp_z
value = -981.0
block = 1
[]
[]
[BCs]
[x_front]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'ball_front'
value = 0.0
[]
[y_front]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'ball_front'
value = 0.0
[]
[x_fixed]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'base_back'
value = 0.0
[]
[y_fixed]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'base_back'
value = 0.0
[]
[z_fixed]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'base_back'
value = 0.0
[]
[]
[ExplicitDynamicsContact]
[my_contact]
model = frictionless_balance
primary = 'base_front ball_back'
secondary = 'ball_back base_front'
vel_x = 'vel_x'
vel_y = 'vel_y'
vel_z = 'vel_z'
[]
[]
[Materials]
[elasticity_tensor_block_one]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e1
poissons_ratio = 0.3
block = 1
constant_on = SUBDOMAIN
[]
[elasticity_tensor_block_two]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e7
poissons_ratio = 0.3
block = 2
constant_on = SUBDOMAIN
[]
[strain_block]
type = ComputeFiniteStrain
displacements = 'disp_x disp_y disp_z'
implicit = false
[]
[stress_block]
type = ComputeFiniteStrainElasticStress
[]
[density_one]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e7
output_properties = 'density'
block = '1'
[]
[density_two]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e3
output_properties = 'density'
block = '2'
[]
[wave_speed]
type = WaveSpeed
outputs = 'exodus'
output_properties = 'wave_speed'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 0.04
dt = 0.0001
timestep_tolerance = 1e-6
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
use_constant_mass = true
second_order_vars = 'disp_x disp_y disp_z'
[]
skip_exception_check = true
[]
[Outputs]
time_step_interval = 100
exodus = true
[]
(modules/contact/test/tests/explicit_dynamics/settlement.i)
# One element test to test the central difference time integrator in 3D.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Mesh]
[block_one]
type = GeneratedMeshGenerator
dim = 3
nx = 3
ny = 3
nz = 3
xmin = 4.5
xmax = 5.5
ymin = 4.5
ymax = 5.5
zmin = 0.0001
zmax = 1.0001
boundary_name_prefix = 'ball'
[]
[block_two]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
xmin = 0.0
xmax = 10
ymin = 0.0
ymax = 10
zmin = -2
zmax = 0
boundary_name_prefix = 'base'
boundary_id_offset = 10
[]
[block_one_id]
type = SubdomainIDGenerator
input = block_one
subdomain_id = 1
[]
[block_two_id]
type = SubdomainIDGenerator
input = block_two
subdomain_id = 2
[]
[combine]
type = MeshCollectionGenerator
inputs = ' block_one_id block_two_id'
[]
[]
[AuxVariables]
[penetration]
[]
[]
[AuxKernels]
[penetration]
type = PenetrationAux
variable = penetration
boundary = ball_back
paired_boundary = base_front
quantity = distance
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[AuxVariables]
[gap_rate]
[]
[vel_x]
[]
[accel_x]
[]
[vel_y]
[]
[accel_y]
[]
[vel_z]
[]
[accel_z]
[]
[stress_zz]
family = MONOMIAL
order = CONSTANT
[]
[strain_zz]
family = MONOMIAL
order = CONSTANT
[]
[kinetic_energy_one]
order = CONSTANT
family = MONOMIAL
[]
[elastic_energy_one]
order = CONSTANT
family = MONOMIAL
[]
[kinetic_energy_two]
order = CONSTANT
family = MONOMIAL
[]
[elastic_energy_two]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_zz]
type = RankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = stress_zz
execute_on = 'TIMESTEP_END'
[]
[strain_zz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
index_i = 2
index_j = 2
variable = strain_zz
[]
[accel_x]
type = TestNewmarkTI
variable = accel_x
displacement = disp_x
first = false
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[vel_x]
type = TestNewmarkTI
variable = vel_x
displacement = disp_x
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[accel_y]
type = TestNewmarkTI
variable = accel_y
displacement = disp_y
first = false
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[vel_y]
type = TestNewmarkTI
variable = vel_y
displacement = disp_x
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[accel_z]
type = TestNewmarkTI
variable = accel_z
displacement = disp_z
first = false
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[vel_z]
type = TestNewmarkTI
variable = vel_z
displacement = disp_z
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[kinetic_energy_one]
type = KineticEnergyAux
block = '1'
variable = kinetic_energy_one
newmark_velocity_x = vel_x
newmark_velocity_y = vel_y
newmark_velocity_z = vel_z
density = density
[]
[elastic_energy_one]
type = ElasticEnergyAux
variable = elastic_energy_one
block = '1'
[]
[kinetic_energy_two]
type = KineticEnergyAux
block = '2'
variable = kinetic_energy_two
newmark_velocity_x = vel_x
newmark_velocity_y = vel_y
newmark_velocity_z = vel_z
density = density
[]
[elastic_energy_two]
type = ElasticEnergyAux
variable = elastic_energy_two
block = '2'
[]
[]
[Kernels]
[DynamicTensorMechanics]
displacements = 'disp_x disp_y disp_z'
stiffness_damping_coefficient = 9.5e-4
generate_output = 'stress_zz strain_zz'
[]
[Mass_x]
type = MassMatrix
variable = disp_x
density = density
matrix_tags = 'mass'
[]
[Mass_y]
type = MassMatrix
variable = disp_y
density = density
matrix_tags = 'mass'
[]
[Mass_z]
type = MassMatrix
variable = disp_z
density = density
matrix_tags = 'mass'
[]
[gravity]
type = Gravity
variable = disp_z
value = -98.10
block = 1
[]
[]
[BCs]
[x_front]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'ball_front'
value = 0.0
[]
[y_front]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'ball_front'
value = 0.0
[]
[x_fixed]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'base_back'
value = 0.0
[]
[y_fixed]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'base_back'
value = 0.0
[]
[z_fixed]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'base_back'
value = 0.0
[]
[z_fixed_front]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'base_front'
value = 0.0
[]
[]
[ExplicitDynamicsContact]
[my_contact]
model = frictionless_balance
primary = base_front
secondary = ball_back
vel_x = 'vel_x'
vel_y = 'vel_y'
vel_z = 'vel_z'
verbose = true
[]
[]
[Materials]
[elasticity_tensor_block_one]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.0
block = 1
outputs = 'exodus'
output_properties = __all__
[]
[elasticity_tensor_block_two]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.0
block = 2
outputs = 'exodus'
output_properties = __all__
[]
[strain_block]
type = ComputeFiniteStrain # ComputeIncrementalStrain
displacements = 'disp_x disp_y disp_z'
implicit = false
[]
[stress_block]
type = ComputeFiniteStrainElasticStress
[]
[density_one]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e1
outputs = 'exodus'
output_properties = 'density'
block = '1'
[]
[density_two]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e6
outputs = 'exodus'
output_properties = 'density'
block = '2'
[]
[wave_speed]
type = WaveSpeed
outputs = 'exodus'
output_properties = 'wave_speed'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 0.05
dt = 1.0e-4
timestep_tolerance = 1e-6
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
second_order_vars = 'disp_x disp_y disp_z'
[]
[]
[Outputs]
time_step_interval = 1
exodus = true
csv = true
execute_on = 'TIMESTEP_END'
[]
[Postprocessors]
[accel_58z]
type = NodalVariableValue
nodeid = 1
variable = accel_z
[]
[vel_58z]
type = NodalVariableValue
nodeid = 1
variable = vel_z
[]
[critical_time_step]
type = CriticalTimeStep
density = density
[]
[contact_pressure_max]
type = NodalExtremeValue
variable = contact_pressure
block = '1 2'
value_type = max
[]
[penetration_max]
type = NodalExtremeValue
variable = penetration
block = '1 2'
value_type = max
[]
[total_kinetic_energy_one]
type = ElementIntegralVariablePostprocessor
variable = kinetic_energy_one
block = '1'
[]
[total_elastic_energy_one]
type = ElementIntegralVariablePostprocessor
variable = elastic_energy_one
block = '1'
[]
[total_kinetic_energy_two]
type = ElementIntegralVariablePostprocessor
variable = kinetic_energy_two
block = '2'
[]
[total_elastic_energy_two]
type = ElementIntegralVariablePostprocessor
variable = elastic_energy_two
block = '2'
[]
[]
(modules/contact/test/tests/explicit_dynamics/highvel.i)
# One element test to test the central difference time integrator in 3D.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Mesh]
[block_one]
type = GeneratedMeshGenerator
dim = 3
nx = 3
ny = 3
nz = 3
xmin = 4.5
xmax = 5.5
ymin = 4.5
ymax = 5.5
zmin = 0.06
zmax = 1.06
boundary_name_prefix = 'ball'
[]
[block_two]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
xmin = 0.0
xmax = 10
ymin = 0.0
ymax = 10
zmin = -2
zmax = 0
boundary_name_prefix = 'base'
boundary_id_offset = 10
[]
[block_one_id]
type = SubdomainIDGenerator
input = block_one
subdomain_id = 1
[]
[block_two_id]
type = SubdomainIDGenerator
input = block_two
subdomain_id = 2
[]
[combine]
type = MeshCollectionGenerator
inputs = ' block_one_id block_two_id'
[]
[]
[AuxVariables]
[penetration]
[]
[]
[AuxKernels]
[penetration]
type = PenetrationAux
variable = penetration
boundary = ball_back
paired_boundary = base_front
quantity = distance
[]
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[AuxVariables]
[gap_rate]
[]
[vel_x]
[]
[accel_x]
[]
[vel_y]
[]
[accel_y]
[]
[vel_z]
[]
[accel_z]
[]
[stress_zz]
family = MONOMIAL
order = CONSTANT
[]
[strain_zz]
family = MONOMIAL
order = CONSTANT
[]
[kinetic_energy_one]
order = CONSTANT
family = MONOMIAL
[]
[elastic_energy_one]
order = CONSTANT
family = MONOMIAL
[]
[kinetic_energy_two]
order = CONSTANT
family = MONOMIAL
[]
[elastic_energy_two]
order = CONSTANT
family = MONOMIAL
[]
[]
[AuxKernels]
[stress_zz]
type = RankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = stress_zz
execute_on = 'TIMESTEP_END'
[]
[strain_zz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
index_i = 2
index_j = 2
variable = strain_zz
[]
[accel_x]
type = TestNewmarkTI
variable = accel_x
displacement = disp_x
first = false
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[vel_x]
type = TestNewmarkTI
variable = vel_x
displacement = disp_x
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[accel_y]
type = TestNewmarkTI
variable = accel_y
displacement = disp_y
first = false
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[vel_y]
type = TestNewmarkTI
variable = vel_y
displacement = disp_x
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[accel_z]
type = TestNewmarkTI
variable = accel_z
displacement = disp_z
first = false
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[vel_z]
type = TestNewmarkTI
variable = vel_z
displacement = disp_z
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[kinetic_energy_one]
type = KineticEnergyAux
block = '1'
variable = kinetic_energy_one
newmark_velocity_x = vel_x
newmark_velocity_y = vel_y
newmark_velocity_z = vel_z
density = density
[]
[elastic_energy_one]
type = ElasticEnergyAux
variable = elastic_energy_one
block = '1'
[]
[kinetic_energy_two]
type = KineticEnergyAux
block = '2'
variable = kinetic_energy_two
newmark_velocity_x = vel_x
newmark_velocity_y = vel_y
newmark_velocity_z = vel_z
density = density
[]
[elastic_energy_two]
type = ElasticEnergyAux
variable = elastic_energy_two
block = '2'
[]
[]
[Kernels]
[DynamicTensorMechanics]
displacements = 'disp_x disp_y disp_z'
stiffness_damping_coefficient = 1.0e-3
generate_output = 'stress_zz strain_zz'
[]
[Mass_x]
type = MassMatrix
variable = disp_x
density = density
matrix_tags = 'mass'
[]
[Mass_y]
type = MassMatrix
variable = disp_y
density = density
matrix_tags = 'mass'
[]
[Mass_z]
type = MassMatrix
variable = disp_z
density = density
matrix_tags = 'mass'
[]
[gravity]
type = Gravity
variable = disp_z
value = -981
block = 1
[]
[]
[BCs]
[x_front]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'ball_front'
value = 0.0
[]
[y_front]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'ball_front'
value = 0.0
[]
[x_fixed]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'base_back'
value = 0.0
[]
[y_fixed]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'base_back'
value = 0.0
[]
[z_fixed]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'base_back'
value = 0.0
[]
[z_fixed_front]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'base_front'
value = 0.0
[]
[]
[ExplicitDynamicsContact]
[my_contact]
model = frictionless_balance
primary = base_front
secondary = ball_back
vel_x = 'vel_x'
vel_y = 'vel_y'
vel_z = 'vel_z'
verbose = true
[]
[]
[Materials]
[elasticity_tensor_block_one]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.0
block = 1
outputs = 'exodus'
output_properties = __all__
[]
[elasticity_tensor_block_two]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.0
block = 2
outputs = 'exodus'
output_properties = __all__
[]
[strain_block]
type = ComputeFiniteStrain # ComputeIncrementalSmallStrain
displacements = 'disp_x disp_y disp_z'
implicit = false
[]
[stress_block]
type = ComputeFiniteStrainElasticStress
[]
[density_one]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e1
outputs = 'exodus'
output_properties = 'density'
block = '1'
[]
[density_two]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e6
outputs = 'exodus'
output_properties = 'density'
block = '2'
[]
[wave_speed]
type = WaveSpeed
outputs = 'exodus'
output_properties = 'wave_speed'
[]
[]
[Executioner]
type = Transient
end_time = 0.03
dt = 2e-4
timestep_tolerance = 1e-6
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = mass
second_order_vars = 'disp_x disp_y disp_z'
[]
[]
[Outputs]
time_step_interval = 2
exodus = true
csv = true
execute_on = 'TIMESTEP_END'
file_base = highvel_out
[]
[Postprocessors]
[accel_58z]
type = NodalVariableValue
nodeid = 1
variable = accel_z
[]
[vel_58z]
type = NodalVariableValue
nodeid = 1
variable = vel_z
[]
[critical_time_step]
type = CriticalTimeStep
density = density
[]
[contact_pressure_max]
type = NodalExtremeValue
variable = contact_pressure
block = '1 2'
value_type = max
[]
[penetration_max]
type = NodalExtremeValue
variable = penetration
block = '1 2'
value_type = max
[]
[total_kinetic_energy_one]
type = ElementIntegralVariablePostprocessor
variable = kinetic_energy_one
block = '1'
[]
[total_elastic_energy_one]
type = ElementIntegralVariablePostprocessor
variable = elastic_energy_one
block = '1'
[]
[total_kinetic_energy_two]
type = ElementIntegralVariablePostprocessor
variable = kinetic_energy_two
block = '2'
[]
[total_elastic_energy_two]
type = ElementIntegralVariablePostprocessor
variable = elastic_energy_two
block = '2'
[]
[]
(modules/solid_mechanics/test/tests/dynamics/explicit_mms/mms_direct_second_order_with_ic.i)
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 10
ny = 10
elem_type = QUAD4
[]
dt_and_v0 = 0.00005
[Problem]
extra_tag_matrices = 'mass'
[]
[Variables]
[u]
[]
[]
[AuxVariables]
[dot_u]
[]
[]
[ICs]
[u_old]
type = ConstantIC
variable = u
state = OLD
# set's v_0 to 1
value = -${dt_and_v0}
[]
[]
[AuxKernels]
[dot_u]
type = TestNewmarkTI
variable = dot_u
displacement = u
first = true
execute_on = 'TIMESTEP_END'
[]
[]
[Functions]
[exact_fn]
type = ParsedFunction
expression = 't + 0.5*t^2'
[]
[exact_dot_fn]
type = ParsedFunction
expression = '1 + t'
[]
[]
[Kernels]
[Mass_x]
type = MassMatrix
variable = u
density = 1
matrix_tags = 'mass'
[]
[ffn]
type = BodyForce
variable = u
function = 1
[]
[]
[Postprocessors]
[l2_err]
type = ElementL2Error
variable = u
function = exact_fn
[]
[l2_dot_err]
type = ElementL2Error
variable = dot_u
function = exact_dot_fn
[]
[]
[Executioner]
type = Transient
start_time = 0.0
num_steps = 20
dt = ${dt_and_v0}
l_tol = 1e-12
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
use_constant_mass = true
second_order_vars = 'u'
[]
[]
[Outputs]
exodus = true
[console]
type = Console
max_rows = 10
[]
[]
(modules/solid_mechanics/test/tests/dynamics/time_integration/direct_central_difference_multiVarBC.i)
###########################################################
# This is a simple test with a time-dependent problem
# demonstrating the use of a central difference with a
# direct calculation of acceleration.
#
# Testing that the first and second time derivatives
# are calculated correctly using the Central Difference Direct
# method
###########################################################
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 4
ny = 4
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[Functions]
[forcing_fn]
type = ParsedFunction
expression = 't'
[]
[]
[Kernels]
[DynamicSolidMechanics]
displacements = 'disp_x disp_y'
[]
[massmatrix]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_x
[]
[massmatrix_y]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_y
[]
[]
[Materials]
[elasticity_tensor_block_one]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e1
poissons_ratio = 0.33
[]
[strain_block]
type = ComputeFiniteStrain
displacements = 'disp_x disp_y'
implicit = false
[]
[stress_block]
type = ComputeFiniteStrainElasticStress
implicit = false
[]
[density]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = 1
[]
[]
[BCs]
[left_x]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'left'
value = 0
[]
[left_y]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'left'
value = 0
[]
[right_x]
type = ExplicitFunctionDirichletBC
variable = disp_x
boundary = 'right'
function = forcing_fn
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
second_order_vars = 'disp_x disp_y'
[]
start_time = 0.0
num_steps = 6
dt = 0.1
[]
[Postprocessors]
[left_x]
type = AverageNodalVariableValue
variable = disp_x
boundary = left
[]
[right_y]
type = AverageNodalVariableValue
variable = disp_x
boundary = left
[]
[]
[Outputs]
exodus = true
[]
(modules/contact/test/tests/explicit_dynamics/block_restricted.i)
# This input file does not solve any interesting physics, such as contact.
# Its sole purpose is to check that block-restricting the ExplicitDynamicsContact Action
# produces AuxVariables that are appropriately block restricted.
# It illustrates that if your mesh contains blocks that are not involved in the
# contact (block = 3 in the case below) you can restrict the Contact parts
# of your input file (such as the ExplicitDynamicsContact Action, the
# velocity AuxVariable, the WaveSpeed Material) to exist only on the
# parts of mesh involved in contact (blocks 1 and 2 in the case below)
[Mesh]
[mesh]
type = CartesianMeshGenerator
dim = 2
dx = '1 1 1'
ix = '1 1 1'
dy = 1
iy = 1
subdomain_id = '1 2 3'
[]
[inner_bdy]
type = SideSetsBetweenSubdomainsGenerator
input = mesh
new_boundary = inner
primary_block = 2
paired_block = 1
[]
[]
[ExplicitDynamicsContact]
[roof_floor]
model = frictionless
block = '1 2'
primary = inner
secondary = left
vel_x = vel_x
vel_y = vel_y
penalty = 1
verbose = true
[]
[]
[AuxVariables]
[vel_x]
block = '1 2'
[]
[vel_y]
block = '1 2'
[]
[]
[AuxKernels]
[vel_x]
type = TestNewmarkTI
variable = vel_x
displacement = disp_x
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[vel_y]
type = TestNewmarkTI
variable = vel_y
displacement = disp_y
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[]
[Materials]
[wave_speed]
type = WaveSpeed
implicit = false
block = '1 2'
[]
[]
# From here on, nothing is particularly interesting!
# I have included block = '1 2 3' explicitly, to distinguish from the above
[Problem]
extra_tag_matrices = mass
solve = false
[]
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Variables]
[disp_x]
block = '1 2 3'
[]
[disp_y]
block = '1 2 3'
[]
[]
[Kernels]
[solid_x]
type = DynamicStressDivergenceTensors
component = 0
variable = disp_x
implicit = false
block = '1 2 3'
[]
[solid_y]
type = DynamicStressDivergenceTensors
component = 1
variable = disp_y
implicit = false
block = '1 2 3'
[]
[massmatrix_x]
type = MassMatrix
density = density
matrix_tags = mass
variable = disp_x
block = '1 2 3'
[]
[massmatrix_y]
type = MassMatrix
density = density
matrix_tags = mass
variable = disp_y
block = '1 2 3'
[]
[]
[BCs]
[no_x]
type = ExplicitDirichletBC
variable = disp_x
boundary = left
value = 0.0
implicit = false
[]
[no_y]
type = ExplicitDirichletBC
variable = disp_y
boundary = bottom
value = 0.0
implicit = false
[]
[]
[Materials]
[elasticity]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1
poissons_ratio = 0
implicit = false
block = '1 2 3'
[]
[strain]
type = ComputeSmallStrain
implicit = false
block = '1 2 3'
[]
[stress]
type = ComputeLinearElasticStress
implicit = false
block = '1 2 3'
[]
[density]
type = GenericConstantMaterial
prop_names = density
prop_values = 1
implicit = false
block = '1 2 3'
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = mass
second_order_vars = 'disp_x disp_y'
[]
dt = 1
end_time = 1
[]
[Outputs]
exodus = true
console = true
[]
(modules/contact/test/tests/explicit_dynamics/test_balance.i)
# One element test to test the central difference time integrator in 3D.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Mesh]
[block_one]
type = GeneratedMeshGenerator
dim = 3
nx = 3
ny = 3
nz = 3
xmin = 4.5
xmax = 5.5
ymin = 4.5
ymax = 5.5
zmin = 0.0001
zmax = 1.0001
boundary_name_prefix = 'ball'
[]
[block_two]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
xmin = 0.0
xmax = 10
ymin = 0.0
ymax = 10
zmin = -2
zmax = 0
boundary_name_prefix = 'base'
boundary_id_offset = 10
[]
[block_one_id]
type = SubdomainIDGenerator
input = block_one
subdomain_id = 1
[]
[block_two_id]
type = SubdomainIDGenerator
input = block_two
subdomain_id = 2
[]
[combine]
type = MeshCollectionGenerator
inputs = ' block_one_id block_two_id'
[]
allow_renumbering = false
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[AuxVariables]
[gap_rate]
[]
[vel_x]
[]
[accel_x]
[]
[vel_y]
[]
[accel_y]
[]
[vel_z]
[]
[accel_z]
[]
[stress_zz]
family = MONOMIAL
order = CONSTANT
[]
[strain_zz]
family = MONOMIAL
order = CONSTANT
[]
[]
[AuxKernels]
[stress_zz]
type = RankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = stress_zz
execute_on = 'TIMESTEP_END'
[]
[strain_zz]
type = RankTwoAux
rank_two_tensor = mechanical_strain
index_i = 2
index_j = 2
variable = strain_zz
[]
[accel_x]
type = TestNewmarkTI
variable = accel_x
displacement = disp_x
first = false
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[vel_x]
type = TestNewmarkTI
variable = vel_x
displacement = disp_x
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[accel_y]
type = TestNewmarkTI
variable = accel_y
displacement = disp_y
first = false
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[vel_y]
type = TestNewmarkTI
variable = vel_y
displacement = disp_x
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[accel_z]
type = TestNewmarkTI
variable = accel_z
displacement = disp_z
first = false
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[vel_z]
type = TestNewmarkTI
variable = vel_z
displacement = disp_z
execute_on = 'LINEAR TIMESTEP_BEGIN TIMESTEP_END'
[]
[]
[AuxVariables]
[penetration]
[]
[]
[AuxKernels]
[penetration]
type = PenetrationAux
variable = penetration
boundary = ball_back
paired_boundary = base_front
quantity = distance
[]
[]
[Kernels]
[DynamicTensorMechanics]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
stiffness_damping_coefficient = 0.001
generate_output = 'stress_zz strain_zz'
[]
[Mass_x]
type = MassMatrix
variable = disp_x
density = density
matrix_tags = 'mass'
[]
[Mass_y]
type = MassMatrix
variable = disp_y
density = density
matrix_tags = 'mass'
[]
[Mass_z]
type = MassMatrix
variable = disp_z
density = density
matrix_tags = 'mass'
[]
[]
[Kernels]
[gravity]
type = Gravity
variable = disp_z
value = -981.0
[]
[]
[BCs]
[x_front]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'ball_front'
value = 0.0
[]
[y_front]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'ball_front'
value = 0.0
[]
[x_fixed]
type = ExplicitDirichletBC
variable = disp_x
boundary = 'base_back'
value = 0.0
[]
[y_fixed]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'base_back'
value = 0.0
[]
[z_fixed]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'base_back'
value = 0.0
[]
[z_fixed_front]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'base_front'
value = 0.0
[]
[]
[ExplicitDynamicsContact]
[my_contact]
model = frictionless_balance
primary = base_front
secondary = ball_back
vel_x = 'vel_x'
vel_y = 'vel_y'
vel_z = 'vel_z'
verbose = true
[]
[]
[Materials]
[elasticity_tensor_block_one]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.0
block = 1
outputs = 'exodus'
output_properties = __all__
[]
[elasticity_tensor_block_two]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e10
poissons_ratio = 0.0
block = 2
outputs = 'exodus'
output_properties = __all__
[]
[strain_block]
type = ComputeFiniteStrain
displacements = 'disp_x disp_y disp_z'
implicit = false
[]
[stress_block]
type = ComputeFiniteStrainElasticStress
[]
[density_one]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e1
outputs = 'exodus'
output_properties = 'density'
block = '1'
[]
[density_two]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e6
outputs = 'exodus'
output_properties = 'density'
block = '2'
[]
[wave_speed]
type = WaveSpeed
outputs = 'exodus'
output_properties = 'wave_speed'
[]
[]
[Executioner]
type = Transient
start_time = 0
end_time = 0.0025
dt = 0.00001
timestep_tolerance = 1e-6
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
second_order_vars = 'disp_x disp_y disp_z'
[]
[]
[Outputs]
time_step_interval = 10
exodus = true
csv = true
[]
[Postprocessors]
[accel_58z]
type = NodalVariableValue
nodeid = 1
variable = accel_z
[]
[vel_58z]
type = NodalVariableValue
nodeid = 1
variable = vel_z
[]
[disp_58z]
type = NodalVariableValue
nodeid = 1
variable = disp_z
[]
[critical_time_step]
type = CriticalTimeStep
density = density
[]
[contact_pressure_max]
type = NodalExtremeValue
variable = contact_pressure
block = '1 2'
value_type = max
[]
[]
(modules/solid_mechanics/test/tests/neml2/explicit_dynamics/moose.i)
!include 'expdyn.i'
[Kernels]
[sdx]
type = StressDivergenceTensors
variable = disp_x
component = 0
[]
[sdy]
type = StressDivergenceTensors
variable = disp_y
component = 1
[]
[sdz]
type = StressDivergenceTensors
variable = disp_z
component = 2
[]
[]
[Materials]
[C]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1
poissons_ratio = 0.3
[]
[strain]
type = ComputeSmallStrain
implicit = false
[]
[stress]
type = ComputeLinearElasticStress
implicit = false
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
use_constant_mass = true
second_order_vars = 'disp_x disp_y disp_z'
[]
start_time = 0.0
num_steps = 30
dt = 0.02
[]
(modules/solid_mechanics/test/tests/neml2/explicit_dynamics/moose_adaptivity.i)
!include 'expdyn.i'
[Kernels]
[sdx]
type = StressDivergenceTensors
variable = disp_x
component = 0
[]
[sdy]
type = StressDivergenceTensors
variable = disp_y
component = 1
[]
[sdz]
type = StressDivergenceTensors
variable = disp_z
component = 2
[]
[]
[Materials]
[C]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1
poissons_ratio = 0.3
[]
[strain]
type = ComputeSmallStrain
implicit = false
[]
[stress]
type = ComputeLinearElasticStress
implicit = false
[]
[]
[Adaptivity]
[Markers]
[uniform]
type = UniformMarker
mark = REFINE
[]
[]
marker = uniform
max_h_level = 2
interval = 13
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
use_constant_mass = true
recompute_mass_matrix_after_mesh_change = true
second_order_vars = 'disp_x disp_y disp_z'
[]
start_time = 0.0
num_steps = 30
dt = 0.02
[]
(modules/solid_mechanics/test/tests/dynamics/time_integration/mass_scaling.i)
# Illustrating inertial mass scaling to enable a large critical time step in explicit time stepping
young = 3.6
poisson = 0.2
density_true = 16 # the true inertial density of the material
# The Courant condition is: critical timestep = l_min * sqrt(density) / sqrt(effective_stiffness)
# sqrt(effective_stiffness) = sqrt(3.6 * (1 - 0.2) / (1 + 0.2) / (1 - 2 * 0.2)) = 2
# sqrt(density) = 4
# Therefore, for the mesh below
# element1: critical timestep = 2
# element1: critical timestep = 4
# element1: critical timestep = 6
# element1: critical timestep = 8
# element1: critical timestep = 10
#
# Hence, with dt = 4, the explicit dynamics is unstable
#
# If we want to run with dt = 4, then mass must be scaled in the left-most elements.
# A new density, called density_scaled, must be set in the left-most elements.
# (It is actually set for all elements, and in the right-most elements it equals density_true.)
# Its numerical value is chosen so that the critical time step in those elements
# is 5, so using dt = 4 is safe. Setting dt a little less than the critical
# time step is best-practice in explicit solid-mechanics simulations, eg, LS-DYNA
# scales mass so critical time-step is 1/0.7 times the time-step used.
#
# For the critical timestep to be 5 or greater in each element,
# sqrt(density_scaled) = 5 * sqrt(effective_stiffness) / l_min
# element1: density_scaled = (10 / 1)^2 = 100
# element2: density_scaled = (10 / 2)^2 = 50
# element3: density_scaled = (10 / 3)^2 = 11, but this is less than density_true, so set density_scaled = 16
# element4: density_scaled = 16
# element5: density_scaled = 16
#
# The input file achieves this in 2 small steps:
# (1) Use a DensityScaling Material with desired_time_step=4 and safety_factor = 0.8
# (so a dt = 4 / 0.8 = 5 is theoretically stable)
# (2) Ensure the MassMatrix uses the scaled density
[Mesh]
[3D]
type = CartesianMeshGenerator
dim = 3
dx = '1 2 3 4 5'
dy = 5
dz = 5
ix = '1 1 1 1 1'
iy = 1
iz = 1
[]
[]
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]
[Problem]
extra_tag_matrices = mass
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]
[Kernels]
[TM_DynamicSolidMechanics0]
type = DynamicStressDivergenceTensors
component = 0
use_displaced_mesh = false
variable = disp_x
implicit = false
[]
[TM_DynamicSolidMechanics1]
type = DynamicStressDivergenceTensors
component = 1
use_displaced_mesh = false
variable = disp_y
implicit = false
[]
[TM_DynamicSolidMechanics2]
type = DynamicStressDivergenceTensors
component = 2
use_displaced_mesh = false
variable = disp_z
implicit = false
[]
[massmatrix_x]
type = MassMatrix
density = density_scaled
matrix_tags = mass
variable = disp_x
[]
[massmatrix_y]
type = MassMatrix
density = density_scaled
matrix_tags = mass
variable = disp_y
[]
[massmatrix_z]
type = MassMatrix
density = density_scaled
matrix_tags = mass
variable = disp_z
[]
[]
[BCs]
[Pressure]
[left]
boundary = left
postprocessor = -1
displacements = 'disp_x disp_y disp_z'
[]
[]
[right_fixed]
type = ExplicitDirichletBC
variable = disp_x
boundary = right
value = 0.0
implicit = false
[]
[zero_y]
type = ExplicitDirichletBC
variable = disp_y
boundary = 'top bottom'
value = 0.0
implicit = false
[]
[zero_z]
type = ExplicitDirichletBC
variable = disp_z
boundary = 'back front'
value = 0.0
implicit = false
[]
[]
[Materials]
[density_true]
type = GenericConstantMaterial
prop_names = density_true
prop_values = ${density_true}
implicit = false
[]
[density_scaled]
type = DensityScaling
true_density = density_true
scaled_density = density_scaled
desired_time_step = 4
safety_factor = 0.8
output_properties = 'density_scaled additional_density'
outputs = exodus
implicit = false
[]
[Elasticity_tensor]
type = ComputeIsotropicElasticityTensor
youngs_modulus = ${young}
poissons_ratio = ${poisson}
implicit = false
[]
[strain]
type = ComputeSmallStrain
implicit = false
[]
[stress]
type = ComputeLinearElasticStress
implicit = false
[]
[]
[Postprocessors]
[crit_dt_original]
type = CriticalTimeStep
density = density_true
execute_on = INITIAL
[]
[dt_possible]
type = CriticalTimeStep
density = density_scaled
execute_on = INITIAL
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = mass
second_order_vars = 'disp_x disp_y disp_z'
use_constant_mass = true
[]
dt = 4
dtmin = 4
end_time = 12
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/test/tests/dynamics/time_integration/direct_central_difference.i)
###########################################################
# This is a simple test with a time-dependent problem
# demonstrating the use of a central difference with a
# direct calculation of acceleration.
#
# Testing that the first and second time derivatives
# are calculated correctly using the Central Difference Direct
# method
###########################################################
[GlobalParams]
displacements = 'disp_x disp_y'
[]
[Problem]
extra_tag_matrices = 'mass'
[]
[Mesh]
type = GeneratedMesh
dim = 2
xmin = -1
xmax = 1
ymin = -1
ymax = 1
nx = 1
ny = 1
[]
[Variables]
[disp_x]
[]
[disp_y]
[]
[]
[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]
[DynamicSolidMechanics]
displacements = 'disp_x disp_y'
[]
[massmatrix]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_x
[]
[massmatrix_y]
type = MassMatrix
density = density
matrix_tags = 'mass'
variable = disp_y
[]
[]
[Materials]
[elasticity_tensor_block_one]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e1
poissons_ratio = 0.0
[]
[strain_block]
type = ComputeFiniteStrain
displacements = 'disp_x disp_y'
implicit = false
[]
[stress_block]
type = ComputeFiniteStrainElasticStress
implicit = false
[]
[density]
type = GenericConstantMaterial
prop_names = 'density'
prop_values = 1
[]
[]
[BCs]
[left_x]
type = ExplicitFunctionDirichletBC
variable = disp_x
boundary = 'left'
function = forcing_fn
[]
[right_x]
type = ExplicitFunctionDirichletBC
variable = disp_x
boundary = 'right'
function = forcing_fn
[]
[]
[Executioner]
type = Transient
[TimeIntegrator]
type = ExplicitMixedOrder
mass_matrix_tag = 'mass'
second_order_vars = 'disp_x disp_y'
[]
start_time = 0.0
num_steps = 6
dt = 0.1
[]
[Postprocessors]
[udot]
type = ElementAverageTimeDerivative
variable = disp_x
[]
[udotdot]
type = ElementAverageSecondTimeDerivative
variable = disp_x
[]
[u]
type = ElementAverageValue
variable = disp_x
[]
[]
[Outputs]
exodus = true
[]
(modules/solid_mechanics/include/timeintegrators/NEML2CentralDifference.h)
// This file is part of the MOOSE framework
// https://mooseframework.inl.gov
//
// All rights reserved, see COPYRIGHT for full restrictions
// https://github.com/idaholab/moose/blob/master/COPYRIGHT
//
// Licensed under LGPL 2.1, please see LICENSE for details
// https://www.gnu.org/licenses/lgpl-2.1.html
#ifdef NEML2_ENABLED
#pragma once
#include "ExplicitMixedOrder.h"
#include "NEML2Assembly.h"
#include "NEML2FEInterpolation.h"
class NEML2CentralDifference : public ExplicitMixedOrder
{
public:
static InputParameters validParams();
NEML2CentralDifference(const InputParameters & parameters);
void initialSetup() override;
void meshChanged() override;
void postSolve() override;
protected:
void evaluateRHSResidual() override;
void rebuildBoundaryElementList();
/// The assembly object with cached assembly information
NEML2Assembly * _neml2_assembly = nullptr;
/// The FE interface for getting variable values/gradients interpolated onto the finite element space
NEML2FEInterpolation * _fe = nullptr;
private:
/// Empty element vector to help zero out the algebraic range
std::vector<const Elem *> _boundary_elems = {};
/// Empty node vector to help zero out the algebraic range
std::vector<const Node *> _no_node = {};
/// Whether the cached boundary element list needs rebuilding
bool _boundary_elems_dirty = true;
};
#endif // NEML2_ENABLED