Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #include "MortarFrictionalStateAux.h" 11 : #include "SystemBase.h" 12 : 13 : registerMooseObject("ContactApp", MortarFrictionalStateAux); 14 : 15 : InputParameters 16 17 : MortarFrictionalStateAux::validParams() 17 : { 18 17 : InputParameters params = AuxKernel::validParams(); 19 17 : params.set<ExecFlagEnum>("execute_on") = EXEC_NONLINEAR; 20 17 : params.addClassDescription("This class creates discrete states for nodes into frictional " 21 : "contact, including contact/no-contact and stick/slip."); 22 34 : params.addRequiredCoupledVar("tangent_one", 23 : "First tangent vector Lagrange multiplier for computing the mortar " 24 : "frictional pressure vector."); 25 34 : params.addCoupledVar("tangent_two", 26 : "Second tangent vector Lagrange multiplier for computing the mortar " 27 : "frictional pressure vector."); 28 34 : params.addRequiredCoupledVar( 29 : "contact_pressure", 30 : "Normal contact pressure Lagrange multiplier from the mortar contact enforcement."); 31 34 : params.addRequiredParam<Real>("mu", "Friction coefficient to compute nodal states"); 32 34 : params.addParam<Real>("tolerance", 1.0e-3, "Tolerance value used to determine the states"); 33 34 : params.addParam<bool>( 34 34 : "use_displaced_mesh", true, "Whether to use the displaced mesh to get the mortar interface."); 35 17 : return params; 36 0 : } 37 : 38 10 : MortarFrictionalStateAux::MortarFrictionalStateAux(const InputParameters & params) 39 : : AuxKernel(params), 40 10 : _tangent_one(coupledValueLower("tangent_one")), 41 28 : _tangent_two(isParamValid("tangent_two") ? coupledValueLower("tangent_two") : _zero), 42 10 : _contact_pressure(coupledValueLower("contact_pressure")), 43 20 : _use_displaced_mesh(getParam<bool>("use_displaced_mesh")), 44 20 : _mu(getParam<Real>("mu")), 45 30 : _tolerance(getParam<Real>("tolerance")) 46 : { 47 : // Only consider nodal quantities 48 10 : if (!isNodal()) 49 0 : mooseError("MortarFrictionalStateAux auxiliary kernel can only be used with nodal kernels."); 50 : 51 10 : if (!_use_displaced_mesh) 52 0 : paramError("use_displaced_mesh", 53 : "This auxiliary kernel requires the use of displaced meshes to compute the " 54 : "frictional pressure vector."); 55 : 56 : // Kernel need to be boundary restricted 57 10 : if (!this->_bnd) 58 0 : paramError("boundary", 59 : "MortarFrictionalStateAux auxiliary kernel must be restricted to a boundary."); 60 : 61 10 : const auto mortar_dimension = _subproblem.mesh().dimension() - 1; 62 38 : if (mortar_dimension == 2 && !isParamValid("tangent_two")) 63 2 : paramError("tangent_two", 64 : "MortarFrictionalStateAux auxiliary kernel requires a second tangent Lagrange " 65 : "multiplier for three-dimensional problems"); 66 8 : } 67 : 68 : Real 69 2133 : MortarFrictionalStateAux::computeValue() 70 : { 71 : // 0-NaN: Error 72 : // 1: Node is not in contact 73 : // 2: Node is in contact and sticking 74 : // 3: Node is in contact and sliding 75 : 76 : Real status = 1; 77 : 78 2133 : if (_contact_pressure[_qp] > _tolerance) 79 : status = 2; 80 : 81 : const Real tangential_pressure = 82 2133 : std::sqrt(_tangent_one[_qp] * _tangent_one[_qp] + _tangent_two[_qp] * _tangent_two[_qp]); 83 : 84 2133 : const Real tangential_pressure_sat = _mu * _contact_pressure[_qp]; 85 : 86 2133 : if (status == 2 && tangential_pressure * (1.0 + _tolerance) > tangential_pressure_sat) 87 : status = 3; 88 : 89 2133 : return status; 90 : }