11 #include "SubProblem.h"
18 params.addRequiredParam<NonlinearVariableName>(
"slave_disp_y",
19 "The y displacement variable on the slave face");
20 params.addParam<NonlinearVariableName>(
"master_disp_y",
21 "The y displacement variable on the master face");
22 params.addRequiredParam<NonlinearVariableName>(
24 "The normal contact pressure; oftentimes this may be a separate lagrange multiplier "
26 params.addRequiredParam<Real>(
"friction_coefficient",
"The friction coefficient");
28 MooseEnum ncp_type(
"min fb",
"fb");
29 params.addParam<MooseEnum>(
"ncp_function_type",
31 "The type of the nonlinear complimentarity function; options are "
32 "min or fb where fb stands for Fischer-Burmeister");
33 params.addParam<Real>(
"c",
35 "Parameter for balancing the size of the velocity and the pressures");
36 params.set<
bool>(
"compute_primal_residuals") =
false;
37 params.addClassDescription(
"Ensures that the Karush-Kuhn-Tucker conditions of Coulomb "
38 "frictional contact are satisfied"););
40 template <ComputeStage compute_stage>
42 const InputParameters & parameters)
43 : ADMortarConstraint<compute_stage>(parameters),
45 this->_subproblem.getStandardVariable(_tid, parameters.getMooseType(
"slave_disp_y"))),
47 isParamValid(
"master_disp_y")
48 ? this->_subproblem.getStandardVariable(_tid, parameters.getMooseType(
"master_disp_y"))
49 : this->_subproblem.getStandardVariable(_tid, parameters.getMooseType(
"slave_disp_y"))),
50 _contact_pressure_var(
51 this->_subproblem.getStandardVariable(_tid, parameters.getMooseType(
"contact_pressure"))),
52 _contact_pressure(_contact_pressure_var.template adSlnLower<compute_stage>()),
53 _slave_x_dot(_slave_var.template adUDot<compute_stage>()),
54 _master_x_dot(_master_var.template adUDotNeighbor<compute_stage>()),
55 _slave_y_dot(_slave_disp_y.template adUDot<compute_stage>()),
56 _master_y_dot(_master_disp_y.template adUDotNeighbor<compute_stage>()),
57 _friction_coeff(getParam<Real>(
"friction_coefficient")),
58 _epsilon(std::numeric_limits<Real>::epsilon()),
59 _ncp_type(getParam<MooseEnum>(
"ncp_function_type")),
60 _c(getParam<Real>(
"c"))
64 template <ComputeStage compute_stage>
70 case Moose::MortarType::Lower:
76 if (_contact_pressure[_qp] > TOLERANCE * TOLERANCE)
79 ADRealVectorValue relative_velocity(
80 _slave_x_dot[_qp] - _master_x_dot[_qp], _slave_y_dot[_qp] - _master_y_dot[_qp], 0);
83 auto tangential_velocity = relative_velocity * _tangents[_qp][0];
88 if (tangential_velocity * _lambda[_qp] < 0)
89 a = -std::abs(tangential_velocity);
91 a = std::abs(tangential_velocity);
96 auto b = _friction_coeff * _contact_pressure[_qp] - std::abs(_lambda[_qp]);
99 if (_ncp_type ==
"fb")
102 fb_function = a + b - std::sqrt(a * a + b * b + _epsilon);
104 fb_function = std::min(a, b);
106 return _test[_i][_qp] * fb_function;
110 return _test[_i][_qp] * _lambda[_qp];
115 return _test[_i][_qp] * _lambda[_qp];