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 23 : MortarFrictionalStateAux::validParams() 17 : { 18 23 : InputParameters params = AuxKernel::validParams(); 19 23 : params.set<ExecFlagEnum>("execute_on") = EXEC_NONLINEAR; 20 23 : params.addClassDescription("This class creates discrete states for nodes into frictional " 21 : "contact, including contact/no-contact and stick/slip."); 22 46 : params.addRequiredCoupledVar("tangent_one", 23 : "First tangent vector Lagrange multiplier for computing the mortar " 24 : "frictional pressure vector."); 25 46 : params.addCoupledVar("tangent_two", 26 : "Second tangent vector Lagrange multiplier for computing the mortar " 27 : "frictional pressure vector."); 28 46 : params.addRequiredCoupledVar( 29 : "contact_pressure", 30 : "Normal contact pressure Lagrange multiplier from the mortar contact enforcement."); 31 46 : params.addRequiredParam<Real>("mu", "Friction coefficient to compute nodal states"); 32 46 : params.addParam<Real>("tolerance", 1.0e-3, "Tolerance value used to determine the states"); 33 46 : params.addParam<bool>( 34 46 : "use_displaced_mesh", true, "Whether to use the displaced mesh to get the mortar interface."); 35 23 : return params; 36 0 : } 37 : 38 14 : MortarFrictionalStateAux::MortarFrictionalStateAux(const InputParameters & params) 39 : : AuxKernel(params), 40 14 : _tangent_one(coupledValueLower("tangent_one")), 41 40 : _tangent_two(isParamValid("tangent_two") ? coupledValueLower("tangent_two") : _zero), 42 14 : _contact_pressure(coupledValueLower("contact_pressure")), 43 28 : _use_displaced_mesh(getParam<bool>("use_displaced_mesh")), 44 28 : _mu(getParam<Real>("mu")), 45 42 : _tolerance(getParam<Real>("tolerance")) 46 : { 47 : // Only consider nodal quantities 48 14 : if (!isNodal()) 49 0 : mooseError("MortarFrictionalStateAux auxiliary kernel can only be used with nodal kernels."); 50 : 51 14 : 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 14 : if (!this->_bnd) 58 0 : paramError("boundary", 59 : "MortarFrictionalStateAux auxiliary kernel must be restricted to a boundary."); 60 : 61 14 : const auto mortar_dimension = _subproblem.mesh().dimension() - 1; 62 54 : 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 12 : } 67 : 68 : Real 69 2538 : 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 2538 : if (_contact_pressure[_qp] > _tolerance) 79 : status = 2; 80 : 81 : const Real tangential_pressure = 82 2538 : std::sqrt(_tangent_one[_qp] * _tangent_one[_qp] + _tangent_two[_qp] * _tangent_two[_qp]); 83 : 84 2538 : const Real tangential_pressure_sat = _mu * _contact_pressure[_qp]; 85 : 86 2538 : if (status == 2 && tangential_pressure * (1.0 + _tolerance) > tangential_pressure_sat) 87 : status = 3; 88 : 89 2538 : return status; 90 : }