https://mooseframework.inl.gov
ElectrostaticContactCondition.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 
11 
13 
16 {
18  params.addParam<MaterialPropertyName>(
19  "primary_conductivity", "electrical_conductivity", "Conductivity on the primary block.");
20  params.addParam<MaterialPropertyName>(
21  "secondary_conductivity", "electrical_conductivity", "Conductivity on the secondary block.");
22  params.addParam<MaterialPropertyName>(
23  "mean_hardness",
24  "mean_hardness",
25  "Geometric mean of the hardness of each contacting material.");
26  params.addParam<Real>("user_electrical_contact_conductance",
27  "User-supplied electrical contact conductance coefficient.");
28  params.addParam<FunctionName>("mechanical_pressure",
29  0.0,
30  "Mechanical pressure uniformly applied at the contact surface area "
31  "(Pressure = Force / Surface Area).");
32  params.addClassDescription(
33  "Interface condition that describes the current continuity and contact conductance across a "
34  "boundary formed between two dissimilar materials (resulting in a potential discontinuity). "
35  "Conductivity on each side of the boundary is defined via the material properties system.");
36  return params;
37 }
38 
40  : ADInterfaceKernel(parameters),
41  _conductivity_primary(getADMaterialProperty<Real>("primary_conductivity")),
42  _conductivity_secondary(getNeighborADMaterialProperty<Real>("secondary_conductivity")),
43  _mean_hardness(isParamValid("user_electrical_contact_conductance")
44  ? getGenericZeroMaterialProperty<Real, true>("mean_hardness")
45  : getADMaterialProperty<Real>("mean_hardness")),
46  _mechanical_pressure(getFunction("mechanical_pressure")),
47  _user_contact_conductance(isParamValid("user_electrical_contact_conductance")
48  ? getParam<Real>("user_electrical_contact_conductance")
49  : _real_zero),
50  _alpha_electric(64.0),
51  _beta_electric(0.35)
52 {
53  _conductance_was_set = parameters.isParamSetByUser("user_electrical_contact_conductance");
55 
57  mooseError(
58  "In ",
59  _name,
60  ", both user-supplied electrical contact conductance and mean hardness values (for "
61  "calculating contact conductance) have been provided. Please only provide one or the "
62  "other!");
63 }
64 
65 ADReal
67 {
68  ADReal res = 0.0;
69  ADReal contact_conductance = 0.0;
70 
71  ADReal mean_conductivity = 2 * _conductivity_primary[_qp] * _conductivity_secondary[_qp] /
73 
75  contact_conductance = _user_contact_conductance;
77  contact_conductance =
78  _alpha_electric * mean_conductivity *
81 
82  switch (type)
83  {
84  case Moose::Element:
85  res = -contact_conductance * (_neighbor_value[_qp] - _u[_qp]) * _test[_i][_qp];
86  break;
87 
88  case Moose::Neighbor:
90  break;
91  }
92 
93  return res;
94 }
const Real & _user_contact_conductance
User-provided electrical contact conductance constant value.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const Function & _mechanical_pressure
Mechanical pressure uniformly applied at the contact surface area (user-supplied for now) ...
static InputParameters validParams()
const Real _alpha_electric
Experimental proportional fit parameter for contact conductance parameter (set using Cincotti et al D...
const ADTemplateVariableGradient< T > & _grad_u
ElectrostaticContactCondition(const InputParameters &parameters)
DGResidualType
DualNumber< Real, DNDerivativeType, true > ADReal
const ADTemplateVariableValue< T > & _u
const MooseArray< Point > & _q_point
const ADMaterialProperty< Real > & _conductivity_primary
Electrical conductivity property for the primary side.
registerMooseObject("ElectromagneticsApp", ElectrostaticContactCondition)
This ADInterfaceKernel object calculates the electrostatic potential value and gradient relationship ...
bool _conductance_was_set
Check parameter for user-provided electrical contact conductance value.
const std::string & type() const
bool _mean_hardness_was_set
Check parameter for material-provided mean hardness value.
const ADMaterialProperty< Real > & _conductivity_secondary
Electrical conductivity property for the secondary side.
const std::string _name
virtual ADReal computeQpResidual(Moose::DGResidualType type) override
bool isParamSetByUser(const std::string &name) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const OutputTools< T >::VariableTestValue & _test_neighbor
const ADTemplateVariableValue< T > & _neighbor_value
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
const MooseArray< Point > & _normals
const InputParameters & parameters() const
const ADMaterialProperty< Real > & _mean_hardness
Geometric mean of the hardness from both sides of the boundary, taken in as a material property...
virtual Real value(Real t, const Point &p) const
const Real _beta_electric
Experimental power fit parameter for contact conductance parameter (set using Cincotti et al DOI:10...
MooseUnits pow(const MooseUnits &, int)
const OutputTools< T >::VariableTestValue & _test