www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
TangentialNodalLMMechanicalContact Class Reference

#include <TangentialNodalLMMechanicalContact.h>

Inheritance diagram for TangentialNodalLMMechanicalContact:
[legend]

Public Member Functions

 TangentialNodalLMMechanicalContact (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpSlaveValue () override
 
virtual void computeResidual () override
 
virtual void computeJacobian () override
 
virtual void computeOffDiagJacobian (unsigned jvar) override
 
virtual Real computeQpResidual (Moose::ConstraintType type) override
 
virtual Real computeQpJacobian (Moose::ConstraintJacobianType type) override
 
virtual Real computeQpOffDiagJacobian (Moose::ConstraintJacobianType type, unsigned jvar) override
 

Protected Attributes

const Real & _contact_pressure
 
const unsigned _contact_pressure_id
 
const Real & _disp_x_dot
 
const Real & _disp_y_dot
 
const unsigned _disp_y_id
 
const VariableValue & _du_dot_du
 
const Real _mu
 
const Real _epsilon
 
const MooseEnum _ncp_type
 

Detailed Description

Definition at line 21 of file TangentialNodalLMMechanicalContact.h.

Constructor & Destructor Documentation

◆ TangentialNodalLMMechanicalContact()

TangentialNodalLMMechanicalContact::TangentialNodalLMMechanicalContact ( const InputParameters &  parameters)

Definition at line 52 of file TangentialNodalLMMechanicalContact.C.

54  : NodeFaceConstraint(parameters),
55  _contact_pressure(getVar("contact_pressure", 0)->nodalValue()),
56  _contact_pressure_id(coupled("contact_pressure")),
57  _disp_x_dot(_master_var.nodalValueDot()),
58  _disp_y_dot(getVar("disp_y", 0)->nodalValueDot()),
59  _disp_y_id(coupled("disp_y")),
60  _du_dot_du(_master_var.dofValuesDuDotDu()),
61 
62  _mu(getParam<Real>("mu")),
63  _epsilon(std::numeric_limits<Real>::epsilon()),
64  _ncp_type(getParam<MooseEnum>("ncp_function_type"))
65 {
66  _overwrite_slave_residual = false;
67 }

Member Function Documentation

◆ computeJacobian()

void TangentialNodalLMMechanicalContact::computeJacobian ( )
overrideprotectedvirtual

Definition at line 86 of file TangentialNodalLMMechanicalContact.C.

87 {
88  _Kee.resize(1, 1);
89  _connected_dof_indices.clear();
90  _connected_dof_indices.push_back(_var.nodalDofIndex());
91 
92  _qp = 0;
93 
94  _Kee(0, 0) += computeQpJacobian(Moose::SlaveSlave);
95 }

Referenced by computeOffDiagJacobian().

◆ computeOffDiagJacobian()

void TangentialNodalLMMechanicalContact::computeOffDiagJacobian ( unsigned  jvar)
overrideprotectedvirtual

Definition at line 98 of file TangentialNodalLMMechanicalContact.C.

99 {
100  if (jvar == _var.number())
101  {
102  computeJacobian();
103  return;
104  }
105 
106  MooseVariableFEBase & var = _sys.getVariable(0, jvar);
107  _connected_dof_indices.clear();
108  _connected_dof_indices.push_back(var.nodalDofIndex());
109 
110  _qp = 0;
111 
112  _Kee.resize(1, 1);
113  _Kee(0, 0) += computeQpOffDiagJacobian(Moose::SlaveSlave, jvar);
114 }

◆ computeQpJacobian()

Real TangentialNodalLMMechanicalContact::computeQpJacobian ( Moose::ConstraintJacobianType  type)
overrideprotectedvirtual

Definition at line 154 of file TangentialNodalLMMechanicalContact.C.

155 {
156  std::map<dof_id_type, PenetrationInfo *>::iterator found =
157  _penetration_locator._penetration_info.find(_current_node->id());
158  if (found != _penetration_locator._penetration_info.end())
159  {
160  PenetrationInfo * pinfo = found->second;
161  if (pinfo != NULL)
162  {
164  return 1.;
165  else
166  {
167  RealVectorValue tangent_vec(pinfo->_normal(1), -pinfo->_normal(0), 0);
168  Real v_dot_tan = RealVectorValue(_disp_x_dot, _disp_y_dot, 0) * tangent_vec;
169 
170  // NCP part 1: requirement that either there is no slip **or** slip velocity and
171  // frictional force exerted **by** the slave side are in the same direction
172  Real a;
173  if (v_dot_tan * _u_slave[_qp] < 0)
174  a = -std::abs(v_dot_tan);
175  else
176  a = std::abs(v_dot_tan);
177 
178  // NCP part 2: require that the frictional force can never exceed the frictional
179  // coefficient times the normal force.
180  DualNumber<Real, Real> dual_u_slave(_u_slave[_qp]);
181  dual_u_slave.derivatives() = 1;
182 
183  auto b = _mu * _contact_pressure - std::abs(dual_u_slave);
184 
185  if (_ncp_type == "fb")
186  return (a + b - std::sqrt(a * a + b * b + _epsilon)).derivatives();
187  else
188  return std::min(a, b).derivatives();
189  }
190  }
191  }
192  return 0;
193 }

Referenced by computeJacobian().

◆ computeQpOffDiagJacobian()

Real TangentialNodalLMMechanicalContact::computeQpOffDiagJacobian ( Moose::ConstraintJacobianType  type,
unsigned  jvar 
)
overrideprotectedvirtual

Definition at line 196 of file TangentialNodalLMMechanicalContact.C.

198 {
199  std::map<dof_id_type, PenetrationInfo *>::iterator found =
200  _penetration_locator._penetration_info.find(_current_node->id());
201  if (found != _penetration_locator._penetration_info.end())
202  {
203  PenetrationInfo * pinfo = found->second;
204  if (pinfo != NULL)
205  {
207  return 0.;
208 
209  // Our local dual number is going to depend on only three degrees of freedom: the slave nodal
210  // dofs for disp_x (index 0), disp_y (index 1), and the contact pressure (index 2). The latter
211  // of course exists only on the slave side
212  typedef DualNumber<Real, DNDerivativeSize<3>> LocalDN;
213 
214  RealVectorValue tangent_vec(pinfo->_normal(1), -pinfo->_normal(0), 0);
215 
216  LocalDN dual_disp_x_dot(_disp_x_dot);
217  // We index the zeroth entry of the _du_dot_du member variable because there is only one
218  // degree of freedom on the node
219  Moose::derivInsert(dual_disp_x_dot.derivatives(), 0, _du_dot_du[0]);
220 
221  LocalDN dual_disp_y_dot(_disp_y_dot);
222  Moose::derivInsert(dual_disp_y_dot.derivatives(), 1, _du_dot_du[0]);
223 
224  LocalDN dual_contact_pressure(_contact_pressure);
225  Moose::derivInsert(dual_contact_pressure.derivatives(), 2, 1);
226 
227  auto v_dot_tan = VectorValue<LocalDN>(dual_disp_x_dot, dual_disp_y_dot, 0) * tangent_vec;
228 
229  // NCP part 1: requirement that either there is no slip **or** slip velocity and
230  // frictional force exerted **by** the slave side are in the same direction
231  LocalDN a;
232  if (v_dot_tan * _u_slave[_qp] < 0)
233  a = -std::abs(v_dot_tan);
234  else
235  a = std::abs(v_dot_tan);
236 
237  // NCP part 2: require that the frictional force can never exceed the frictional
238  // coefficient times the normal force.
239  auto b = _mu * dual_contact_pressure - std::abs(_u_slave[_qp]);
240 
241  LocalDN ncp_value;
242  if (_ncp_type == "fb")
243  ncp_value = a + b - std::sqrt(a * a + b * b + _epsilon);
244  else
245  ncp_value = std::min(a, b);
246 
247  if (jvar == _contact_pressure_id)
248  return ncp_value.derivatives()[2];
249  else if (jvar == _master_var.number())
250  return ncp_value.derivatives()[0];
251  else if (jvar == _disp_y_id)
252  return ncp_value.derivatives()[1];
253  }
254  }
255  return 0.;
256 }

Referenced by computeOffDiagJacobian().

◆ computeQpResidual()

Real TangentialNodalLMMechanicalContact::computeQpResidual ( Moose::ConstraintType  type)
overrideprotectedvirtual

Definition at line 116 of file TangentialNodalLMMechanicalContact.C.

117 {
118  std::map<dof_id_type, PenetrationInfo *>::iterator found =
119  _penetration_locator._penetration_info.find(_current_node->id());
120  if (found != _penetration_locator._penetration_info.end())
121  {
122  PenetrationInfo * pinfo = found->second;
123  if (pinfo != NULL)
124  {
126  return _u_slave[_qp];
127  else
128  {
129  RealVectorValue tangent_vec(pinfo->_normal(1), -pinfo->_normal(0), 0);
130  Real v_dot_tan = RealVectorValue(_disp_x_dot, _disp_y_dot, 0) * tangent_vec;
131 
132  // NCP part 1: requirement that either there is no slip **or** slip velocity and
133  // frictional force exerted **by** the slave side are in the same direction
134  Real a;
135  if (v_dot_tan * _u_slave[_qp] < 0)
136  a = -std::abs(v_dot_tan);
137  else
138  a = std::abs(v_dot_tan);
139 
140  // NCP part 2: require that the frictional force can never exceed the frictional
141  // coefficient times the normal force.
142  auto b = _mu * _contact_pressure - std::abs(_u_slave[_qp]);
143 
144  if (_ncp_type == "fb")
145  return a + b - std::sqrt(a * a + b * b + _epsilon);
146  else
147  return std::min(a, b);
148  }
149  }
150  }
151  return 0;
152 }

Referenced by computeResidual().

◆ computeQpSlaveValue()

Real TangentialNodalLMMechanicalContact::computeQpSlaveValue ( )
overrideprotectedvirtual

Definition at line 70 of file TangentialNodalLMMechanicalContact.C.

71 {
72  return _u_slave[_qp];
73 }

◆ computeResidual()

void TangentialNodalLMMechanicalContact::computeResidual ( )
overrideprotectedvirtual

Definition at line 76 of file TangentialNodalLMMechanicalContact.C.

77 {
78  DenseVector<Number> & re = _assembly.residualBlock(_var.number());
79 
80  _qp = 0;
81 
82  re(0) = computeQpResidual(Moose::Slave);
83 }

Member Data Documentation

◆ _contact_pressure

const Real& TangentialNodalLMMechanicalContact::_contact_pressure
protected

◆ _contact_pressure_id

const unsigned TangentialNodalLMMechanicalContact::_contact_pressure_id
protected

Definition at line 38 of file TangentialNodalLMMechanicalContact.h.

Referenced by computeQpOffDiagJacobian().

◆ _disp_x_dot

const Real& TangentialNodalLMMechanicalContact::_disp_x_dot
protected

◆ _disp_y_dot

const Real& TangentialNodalLMMechanicalContact::_disp_y_dot
protected

◆ _disp_y_id

const unsigned TangentialNodalLMMechanicalContact::_disp_y_id
protected

Definition at line 43 of file TangentialNodalLMMechanicalContact.h.

Referenced by computeQpOffDiagJacobian().

◆ _du_dot_du

const VariableValue& TangentialNodalLMMechanicalContact::_du_dot_du
protected

Definition at line 45 of file TangentialNodalLMMechanicalContact.h.

Referenced by computeQpOffDiagJacobian().

◆ _epsilon

const Real TangentialNodalLMMechanicalContact::_epsilon
protected

◆ _mu

const Real TangentialNodalLMMechanicalContact::_mu
protected

◆ _ncp_type

const MooseEnum TangentialNodalLMMechanicalContact::_ncp_type
protected

The documentation for this class was generated from the following files:
TangentialNodalLMMechanicalContact::computeQpJacobian
virtual Real computeQpJacobian(Moose::ConstraintJacobianType type) override
Definition: TangentialNodalLMMechanicalContact.C:154
TangentialNodalLMMechanicalContact::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(Moose::ConstraintJacobianType type, unsigned jvar) override
Definition: TangentialNodalLMMechanicalContact.C:196
TangentialNodalLMMechanicalContact::computeJacobian
virtual void computeJacobian() override
Definition: TangentialNodalLMMechanicalContact.C:86
TangentialNodalLMMechanicalContact::_mu
const Real _mu
Definition: TangentialNodalLMMechanicalContact.h:47
TangentialNodalLMMechanicalContact::_contact_pressure_id
const unsigned _contact_pressure_id
Definition: TangentialNodalLMMechanicalContact.h:38
TangentialNodalLMMechanicalContact::_contact_pressure
const Real & _contact_pressure
Definition: TangentialNodalLMMechanicalContact.h:37
TangentialNodalLMMechanicalContact::_disp_y_dot
const Real & _disp_y_dot
Definition: TangentialNodalLMMechanicalContact.h:41
TangentialNodalLMMechanicalContact::computeQpResidual
virtual Real computeQpResidual(Moose::ConstraintType type) override
Definition: TangentialNodalLMMechanicalContact.C:116
TangentialNodalLMMechanicalContact::_disp_y_id
const unsigned _disp_y_id
Definition: TangentialNodalLMMechanicalContact.h:43
TangentialNodalLMMechanicalContact::_epsilon
const Real _epsilon
Definition: TangentialNodalLMMechanicalContact.h:48
TangentialNodalLMMechanicalContact::_ncp_type
const MooseEnum _ncp_type
Definition: TangentialNodalLMMechanicalContact.h:50
TangentialNodalLMMechanicalContact::_disp_x_dot
const Real & _disp_x_dot
Definition: TangentialNodalLMMechanicalContact.h:40
TangentialNodalLMMechanicalContact::_du_dot_du
const VariableValue & _du_dot_du
Definition: TangentialNodalLMMechanicalContact.h:45