https://mooseframework.inl.gov
MortarArchardsLawAux.C
Go to the documentation of this file.
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 "MortarArchardsLawAux.h"
11 #include "MooseVariableFE.h"
12 #include "FEProblemBase.h"
13 #include "Assembly.h"
14 
16 
19 {
21  params.addClassDescription(
22  "Returns the weighted gap velocity at a node. This quantity is useful for mortar contact, "
23  "particularly when dual basis functions are used in contact mechanics");
24  params.addCoupledVar("v",
25  "Optional variable to take the value of. If omitted the value of the "
26  "`variable` itself is returned.");
27  params.addRequiredCoupledVar("displacements",
28  "The displacement variables. This mortar nodal auxiliary kernel can "
29  "take two or three displacements");
30  params.addRequiredCoupledVar("normal_pressure",
31  "The name of the Lagrange multiplier that holds the normal contact "
32  "pressure in mortar formulations");
33  params.addParam<bool>("use_displaced_mesh",
34  true,
35  "Whether to use the displaced mesh to compute the auxiliary kernel value");
36  params.addParam<bool>(
37  "incremental",
38  true,
39  "Whether to accumulate worn-out depth (The default 'true' is strongly recommended)");
40  params.addRequiredParam<Real>(
41  "friction_coefficient",
42  "Friction coefficient used to compute wear (to match that of frictional contact)");
43  params.addRequiredParam<Real>(
44  "energy_wear_coefficient",
45  "Energy wear coefficient is a surface-dependent parameter used in Archard's wear law");
46  params.set<bool>("interpolate_normals") = false;
47 
48  return params;
49 }
50 
52  : MortarNodalAuxKernel(parameters),
53  _normal_pressure(coupledValueLower("normal_pressure")),
54  _friction_coefficient(getParam<Real>("friction_coefficient")),
55  _energy_wear_coefficient(getParam<Real>("energy_wear_coefficient")),
56  _displacements(
57  {getVar("displacements", 0), getVar("displacements", 1), getVar("displacements", 2)}),
58  _has_disp_z(_displacements[2] ? true : false),
59  _secondary_x_dot(_displacements[0]->adUDot()),
60  _primary_x_dot(_displacements[0]->adUDotNeighbor()),
61  _secondary_y_dot(_displacements[1]->adUDot()),
62  _primary_y_dot(_displacements[1]->adUDotNeighbor()),
63  _secondary_z_dot(_has_disp_z ? &_displacements[2]->adUDot() : nullptr),
64  _primary_z_dot(_has_disp_z ? &_displacements[2]->adUDotNeighbor() : nullptr),
65  _worn_depth(0),
66  _qp_gap_velocity_nodal(0)
67 {
68  if (!_displaced)
69  paramError("use_displaced_mesh",
70  "The MortarArchardsLawAux auxiliary kernel requires the use of displaced meshes to "
71  "compute the worn-out depth.");
72 }
73 
74 Real
76 {
77  mooseAssert(_normals.size() == _test_lower.size(),
78  "Normals and test_lower must be the same size");
79  _worn_depth = 0;
80  for (_qp = 0; _qp < _qrule_msm->n_points(); _qp++)
81  {
83  for (_i = 0; _i < _test_lower.size(); ++_i)
85  }
86 
87  return _worn_depth;
88 }
89 
90 void
92 {
94 }
95 
96 void
98 {
99  RealVectorValue gap_velocity_vec;
100  gap_velocity_vec(0) = MetaPhysicL::raw_value(_secondary_x_dot[_qp] - _primary_x_dot[_qp]);
101  gap_velocity_vec(1) = MetaPhysicL::raw_value(_secondary_y_dot[_qp] - _primary_y_dot[_qp]);
102 
103  if (_has_disp_z)
104  gap_velocity_vec(2) = MetaPhysicL::raw_value((*_secondary_z_dot)[_qp] - (*_primary_z_dot)[_qp]);
105 
106  // Remove point-wise normal component of the relative velocity
107  gap_velocity_vec -= gap_velocity_vec.contract(_normals[_i]) * _normals[_i];
108 
109  // Compute norm of the relative tangential velocity (used to compute the weighted quantity)
110  const auto norm_tangential_vel = gap_velocity_vec.norm();
111 
112  const auto worn_out_depth_dt = norm_tangential_vel * _energy_wear_coefficient *
114  _coord_msm[_qp];
115 
116  // Accumulate worn-out depth over time.
117  _worn_depth += _test_lower[_i][_qp] * worn_out_depth_dt;
118 }
auto norm() const -> decltype(std::norm(Real()))
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
CompareTypes< Real, T2 >::supertype contract(const TypeVector< T2 > &) const
const ADVariableValue & _primary_x_dot
x-velocity on the primary face
static InputParameters validParams()
T & set(const std::string &name, bool quiet_mode=false)
const bool _has_disp_z
For 2D mortar contact no displacement will be specified, so const pointers used.
auto raw_value(const Eigen::Map< T > &in)
MooseVariable * getVar(const std::string &var_name, unsigned int comp)
const VariableValue & _normal_pressure
const std::vector< Real > & _JxW_msm
Compute worn-out depth based on Archard&#39;s wear law.
const libMesh::QBase *const & _qrule_msm
void addRequiredParam(const std::string &name, const std::string &doc_string)
const ADVariableValue *const _primary_z_dot
z-velocity on the primary face
const OutputTools< ComputeValueType >::VariableTestValue & _test_lower
const ADVariableValue & _secondary_x_dot
x-velocity on the secondary face
const ADVariableValue & _secondary_y_dot
y-velocity on the secondary face
std::vector< Point > _normals
const MooseArray< Real > & _coord_msm
static InputParameters validParams()
unsigned int n_points() const
const ADVariableValue *const _secondary_z_dot
z-velocity on the secondary face
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MortarArchardsLawAux(const InputParameters &parameters)
Constructor of mortar auxiliary kernel to compute nodal worn-out depth.
const ADVariableValue & _primary_y_dot
y-velocity on the primary face
void addClassDescription(const std::string &doc_string)
const Real _friction_coefficient
Friction coefficient used to compute Archard&#39;s law.
const Real _energy_wear_coefficient
Typically a constant used to characterize wear behavior of a material surface.
registerMooseObject("ContactApp", MortarArchardsLawAux)
Real computeValue() override
Real _worn_depth
The worn-out depth due to Archard&#39;s law (Aux Kernel computed value)