30 "Computes the mortar frictional contact force via a penalty approach.");
31 params.
addParam<Real>(
"penalty_friction",
32 "The penalty factor for frictional interaction. If not provide, the normal "
33 "penalty factor is also used for the frictional problem.");
35 "The friction coefficient ruling Coulomb friction equations.");
39 "Acceptable slip distance at which augmented Lagrange iterations can be stopped");
40 MooseEnum adaptivity_penalty_friction(
"SIMPLE FRICTION_LIMIT",
"FRICTION_LIMIT");
41 adaptivity_penalty_friction.addDocumentation(
42 "SIMPLE",
"Keep multiplying by the frictional penalty multiplier between AL iterations");
43 adaptivity_penalty_friction.addDocumentation(
45 "This strategy will be guided by the Coulomb limit and be less reliant on the initial "
46 "penalty factor provided by the user.");
48 "adaptivity_penalty_friction",
49 adaptivity_penalty_friction,
50 "The augmented Lagrange update strategy used on the frictional penalty coefficient.");
52 "penalty_multiplier_friction",
54 "penalty_multiplier_friction > 0",
55 "The penalty growth factor between augmented Lagrange "
56 "iterations for penalizing relative slip distance if the node is under stick conditions.");
77 _penalty(getParam<Real>(
"penalty")),
78 _penalty_friction(isParamValid(
"penalty_friction") ? getParam<Real>(
"penalty_friction")
79 : getParam<Real>(
"penalty")),
80 _slip_tolerance(isParamValid(
"slip_tolerance") ? getParam<Real>(
"slip_tolerance") : 0.0),
81 _friction_coefficient(getParam<Real>(
"friction_coefficient")),
82 _penalty_multiplier_friction(getParam<Real>(
"penalty_multiplier_friction")),
85 _epsilon_tolerance(1.0e-40),
86 _t_step_old_friction(declareRestartableData<
int>(
"t_step_old_friction", 0))
91 "This parameter must be supplied if and only if an augmented Lagrange problem "
128 if (retried_timestep)
141 auto & [step_slip, old_step_slip] = map_pr.second;
142 old_step_slip = {0.0, 0.0};
143 step_slip = {0.0, 0.0};
149 auto & [accumulated_slip, old_accumulated_slip] = map_pr.second;
150 old_accumulated_slip = accumulated_slip;
159 auto & [tangential_traction, old_tangential_traction] = map_pr.second;
162 tangential_traction = {0.0, 0.0};
166 delta_tangential_lm.setZero();
188 const unsigned int component)
const
200 const unsigned int component)
const
212 const unsigned int component)
const
224 const unsigned int component)
const
237 const unsigned int direction)
const
239 mooseAssert(direction < 2,
"There are at most two tangent directions.");
263 for (
const auto i : make_range(
_test->size()))
283 if (normal_lm < -TOLERANCE && normal_pressure > TOLERANCE)
287 const auto & real_tangential_velocity =
289 const ADTwoVector slip_distance = {real_tangential_velocity[0] *
_dt,
290 real_tangential_velocity[1] *
_dt};
293 const auto & tangential_lm =
299 ADTwoVector inner_iteration_penalty_friction = penalty_friction * slip_distance;
304 penalty_friction * slip_distance.norm() >
307 inner_iteration_penalty_friction =
309 (penalty_friction * slip_distance.norm())) *
310 penalty_friction * slip_distance;
314 old_tangential_traction + tangential_lm + inner_iteration_penalty_friction;
317 ADReal tangential_trial_traction_norm = tangential_trial_traction.norm();
319 tangential_traction = tangential_trial_traction;
324 tangential_traction -=
325 phi_trial * tangential_trial_traction / tangential_trial_traction_norm;
337 accumulated_slip.setZero();
338 tangential_traction.setZero();
343 const auto & test_i = (*_test)[i];
366 auto & [step_slip, old_step_slip] = map_pr.second;
367 old_step_slip = step_slip;
370 std::pair<Real, dof_id_type> max_slip{0.0, 0};
374 const auto & tangential_traction = traction_pair.first;
386 const auto & real_tangential_velocity =
399 const auto new_slip =
400 std::make_pair<Real, dof_id_type>(slip_velocity.norm() *
_dt, dof_object->id());
401 if (new_slip > max_slip)
422 ", but slip tolerance is chosen to be ",
441 if (penalty_friction == 0.0)
448 const auto & real_tangential_velocity =
455 const TwoVector tangential_trial_traction =
456 old_tangential_traction + tangential_lm + penalty_friction * slip_velocity *
_dt;
457 const Real tangential_trial_traction_norm = tangential_trial_traction.norm();
462 tangential_lm += penalty_friction * slip_velocity *
_dt;
467 tangential_lm = tangential_trial_traction / tangential_trial_traction_norm *
469 old_tangential_traction;
486 if (step_slip.first.dot(step_slip.second) > 0.0 && abs(normal_lm) > TOLERANCE &&
494 else if (step_slip.first.dot(step_slip.second) < 0.0)
495 penalty_friction /= 2.0;
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseInfoRepeated(Args &&... args)
registerMooseObject("ContactApp", PenaltyFrictionUserObject)
void ErrorVector unsigned int
virtual int & timeStep() const
void paramError(const std::string ¶m, Args... args) const
bool isParamValid(const std::string &name) const
virtual const Node * nodePtr(const dof_id_type i) const
virtual const FieldVariablePhiValue & phiLower() const override
Elem const *const & _lower_secondary_elem
const libMesh::QBase *const & _qrule_msm
User object that computes tangential pressures due to friction using a penalty approach,...
virtual Real getDeltaTangentialLagrangeMultiplier(const Node *const node, const unsigned int component) const override
virtual void reinit() override
PenaltyFrictionUserObject(const InputParameters ¶meters)
std::unordered_map< const DofObject *, Real > _dof_to_local_penalty_friction_start
virtual void timestepSetup() override
virtual void updateAugmentedLagrangianMultipliers() override
virtual ADReal nodalTangentialPressure(const Node &node, unsigned int direction) const override
virtual const ADVariableValue & contactTangentialPressureDirTwo() const override
std::unordered_map< const DofObject *, std::pair< TwoVector, TwoVector > > _dof_to_step_slip
Map from degree of freedom to current and old step slip.
const Real _epsilon_tolerance
Tolerance to avoid NaN/Inf in automatic differentiation operations.
std::unordered_map< const DofObject *, TwoVector > _dof_to_frictional_lagrange_multipliers
Map from degree of freedom to augmented lagrange multiplier.
const Real _penalty_multiplier_friction
Penalty growth factor for augmented Lagrange.
ADVariableValue _frictional_contact_traction_one
The first frictional contact pressure on the mortar segment quadrature points.
std::unordered_map< const DofObject *, std::pair< TwoVector, TwoVector > > _dof_to_step_slip_start
Frictional state at the start of the current timestep, restored when it is retried.
std::unordered_map< const DofObject *, std::pair< TwoVector, TwoVector > > _dof_to_accumulated_slip_start
std::unordered_map< const DofObject *, Real > _dof_to_local_penalty_friction
Map from degree of freedom to local friction penalty value.
virtual void finalize() override
ADVariableValue _frictional_contact_traction_two
The second frictional contact pressure on the mortar segment quadrature points.
const Real _friction_coefficient
The friction coefficient.
enum PenaltyFrictionUserObject::AdaptivityFrictionalPenalty _adaptivity_friction
const Real _slip_tolerance
Acceptable slip distance for augmented Lagrange convergence.
virtual Real getFrictionalContactPressure(const Node *const node, const unsigned int component) const override
std::unordered_map< const DofObject *, std::pair< ADTwoVector, TwoVector > > _dof_to_tangential_traction_start
virtual Real getTangentialVelocity(const Node *const node, const unsigned int component) const override
const Real _penalty_friction
The penalty factor for the frictional constraints.
int & _t_step_old_friction
The timestep index at which the accumulated slip and tangential traction history were last advanced.
std::unordered_map< const DofObject *, std::pair< TwoVector, TwoVector > > _dof_to_accumulated_slip
Map from degree of freedom to current and old accumulated slip.
virtual void initialize() override
std::unordered_map< const DofObject *, std::pair< ADTwoVector, TwoVector > > _dof_to_tangential_traction
Map from degree of freedom to current and old tangential traction.
virtual const VariableTestValue & test() const override
virtual Real getAccumulatedSlip(const Node *const node, const unsigned int component) const override
std::unordered_map< const DofObject *, TwoVector > _dof_to_frictional_lagrange_multipliers_start
static InputParameters validParams()
AdaptivityFrictionalPenalty
The adaptivity method for the penalty factor at augmentations.
virtual bool isAugmentedLagrangianConverged() override
virtual const ADVariableValue & contactTangentialPressureDirOne() const override
User object for computing weighted gaps and contact pressure for penalty based mortar constraints.
virtual bool isAugmentedLagrangianConverged() override
virtual void reinit() override
std::unordered_map< const DofObject *, Real > _dof_to_lagrange_multiplier
Map from degree of freedom to augmented lagrange multiplier.
AugmentedLagrangianContactProblemInterface *const _augmented_lagrange_problem
augmented Lagrange problem and iteration number
const MooseVariable *const _aux_lm_var
The auxiliary Lagrange multiplier variable (used together whith the Petrov-Galerkin approach)
const Real & _dt
Current delta t... or timestep size.
std::unordered_map< const DofObject *, ADReal > _dof_to_normal_pressure
Map from degree of freedom to normal pressure for reporting.
virtual void updateAugmentedLagrangianMultipliers() override
const Real _max_penalty_multiplier
Maximum multiplier applied to the initial penalty factor in AL.
static InputParameters validParams()
virtual void timestepSetup()
virtual MooseMesh & mesh()=0
void max(const T &r, T &o, Request &req) const
processor_id_type rank() const
Creates dof object to weighted gap map.
V findValue(const std::unordered_map< K, V > &map, const K &key, const V &default_value=0) const
Find a value in a map or return a default if the key doesn't exist.
const MooseVariable *const _disp_x_var
The x displacement variable.
FEProblemBase & _fe_problem
The base finite element problem.
virtual void initialize() override
const VariableTestValue * _test
A pointer to the test function associated with the weighted gap.
Creates dof object to weighted tangential velocities map.
static InputParameters validParams()
virtual void finalize() override
std::unordered_map< const DofObject *, std::array< ADReal, 2 > > _dof_to_real_tangential_velocity
A map from node to two interpolated, physical tangential velocities.
const Parallel::Communicator & _communicator
unsigned int n_points() const
VariableShapeValue< true > VariableTestValue
VariableValueTempl< true > ADVariableValue