Skip to content

Commit

Permalink
Initial commit with:
Browse files Browse the repository at this point in the history
 - Initial explicit dynamics action
 - Initial explicit dynamics node-face normal constraint

(idaholab#25666).
  • Loading branch information
recuero committed Nov 6, 2023
1 parent b280194 commit 7c6d34e
Show file tree
Hide file tree
Showing 10 changed files with 1,593 additions and 3 deletions.
7 changes: 4 additions & 3 deletions framework/src/systems/NonlinearSystemBase.C
Expand Up @@ -2779,7 +2779,7 @@ NonlinearSystemBase::computeJacobianInternal(const std::set<TagID> & tags)
PARALLEL_TRY
{
// Add in Jacobian contributions from other Constraints
if (_fe_problem._has_constraints)
if (_fe_problem._has_constraints && tags.count(systemMatrixTag()))
{
// Some constraints need values from the Jacobian
closeTaggedMatrices(tags);
Expand Down Expand Up @@ -3601,8 +3601,9 @@ NonlinearSystemBase::needInterfaceMaterialOnSide(BoundaryID bnd_id, THREAD_ID ti
return _interface_kernels.hasActiveBoundaryObjects(bnd_id, tid);
}

bool NonlinearSystemBase::needSubdomainMaterialOnSide(SubdomainID /*subdomain_id*/,
THREAD_ID /*tid*/) const
bool
NonlinearSystemBase::needSubdomainMaterialOnSide(SubdomainID /*subdomain_id*/,
THREAD_ID /*tid*/) const
{
return _doing_dg;
}
Expand Down
302 changes: 302 additions & 0 deletions modules/contact/explicit_dynamics/contact_stub.i
@@ -0,0 +1,302 @@
# One element test to test the central difference time integrator in 3D.
[GlobalParams]
displacements = 'disp_x disp_y disp_z'
[]

[Mesh]
[block_one]
type = GeneratedMeshGenerator
dim = 3
nx = 2
ny = 2
nz = 2
xmin = 4.5
xmax = 5.5
ymin = 4.5
ymax = 5.5
zmin = 0.001
zmax = 1.001
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'
[]
[]

[Variables]
[disp_x]
[]
[disp_y]
[]
[disp_z]
[]
[]

[AuxVariables]
[vel_x]
[]
[accel_x]
[]
[vel_y]
[]
[accel_y]
[]
[vel_z]
[]
[accel_z]
[]
[stress_zz]
[]
[strain_zz]
[]
[]

[AuxKernels]
[stress_zz]
type = RankTwoAux
rank_two_tensor = stress
index_i = 2
index_j = 2
variable = stress_zz
[]
[strain_zz]
type = RankTwoAux
rank_two_tensor = elastic_strain
index_i = 2
index_j = 2
variable = strain_zz
[]
[accel_x]
type = TestNewmarkTI
variable = accel_x
displacement = disp_x
first = false
[]
[vel_x]
type = TestNewmarkTI
variable = vel_x
displacement = disp_x
[]
[accel_y]
type = TestNewmarkTI
variable = accel_y
displacement = disp_y
first = false
[]
[vel_y]
type = TestNewmarkTI
variable = vel_y
displacement = disp_x
[]
[accel_z]
type = TestNewmarkTI
variable = accel_z
displacement = disp_z
first = false
[]
[vel_z]
type = TestNewmarkTI
variable = vel_z
displacement = disp_z
[]
[]

[Kernels]
[DynamicTensorMechanics]
displacements = 'disp_x disp_y disp_z'
volumetric_locking_correction = true
stiffness_damping_coefficient = 0.04
# generate_output = 'stress_zz strain_zz'
[]
[inertia_x]
type = InertialForce
variable = disp_x
[]
[inertia_y]
type = InertialForce
variable = disp_y
[]
[inertia_z]
type = InertialForce
variable = disp_z
[]
[]

[Functions]
[dispz]
type = ParsedFunction
expression = if(t<1.0e3,-0.01*t,0)
[]
[push]
type = ParsedFunction
expression = if(t<10.0,0.01*t,0.1)
[]
[]

[BCs]
[z_front]
type = FunctionDirichletBC
variable = disp_z
boundary = 'ball_front'
function = dispz
preset = false
[]
[x_front]
type = DirichletBC
variable = disp_x
boundary = 'ball_front'
preset = false
value = 0.0
[]
[y_front]
type = DirichletBC
variable = disp_y
boundary = 'ball_front'
preset = false
value = 0.0
[]
[x_fixed]
type = DirichletBC
variable = disp_x
boundary = 'base_back'
preset = false
value = 0.0
[]
[y_fixed]
type = DirichletBC
variable = disp_y
boundary = 'base_back'
preset = false
value = 0.0
[]
[z_fixed]
type = DirichletBC
variable = disp_z
boundary = 'base_back'
preset = false
value = 0.0
[]
[]

[ExplicitDynamicsContact]
[my_contact]
model = frictionless
# formulation = penalty
primary = base_front
secondary = ball_back
# penalty = 1e+05
# normalize_penalty = true
[]
[]

# [Controls]
# [mycontrol]
# type = TimePeriod
# disable_objects = 'BCs/z_bot'
# start_time = 1.0e-3
# end_time = 1.0e9
# execute_on = 'INITIAL TIMESTEP_END'
# []
# []

[Materials]
[elasticity_tensor_block_one]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e3
poissons_ratio = 0.0
block = 1
[]
[elasticity_tensor_block_two]
type = ComputeIsotropicElasticityTensor
youngs_modulus = 1e6
poissons_ratio = 0.0
block = 2
[]
[strain_block]
type = ComputeIncrementalSmallStrain
displacements = 'disp_x disp_y disp_z'
implicit = false
[]
[stress_block]
type = ComputeFiniteStrainElasticStress
[]
[density]
type = GenericConstantMaterial
prop_names = density
prop_values = 1e4
[]
[wave_speed]
type = WaveSpeed
[]
[]

[Executioner]
type = Transient
start_time = -0.01
end_time = 24.0
dt = 0.005
timestep_tolerance = 1e-6

[TimeIntegrator]
type = CentralDifference
[]
[]

[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
[]
[contact_pressure_max]
type = NodalExtremeValue
variable = contact_pressure
block = '1 2'
value_type = max
[]
[]

[Outputs]
# interval = 50
exodus = true
csv = true
[]

0 comments on commit 7c6d34e

Please sign in to comment.