https://mooseframework.inl.gov
ADInterfaceJouleHeatingConstraint.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.addClassDescription(
19  "Joule heating model, for the case of a closed gap interface, to calculate the heat flux "
20  "contribution created when an electric potential difference occurs across that interface.");
21  params.addRequiredCoupledVar(
22  "potential_lagrange_multiplier",
23  "The name of the lagrange multiplier variable used in the calculation of the electrical "
24  "potential mortar constrain calculation");
25  params.addRequiredParam<MaterialPropertyName>(
26  "primary_electrical_conductivity",
27  "The electrical conductivity of the primary surface solid material");
28  params.addRequiredParam<MaterialPropertyName>(
29  "secondary_electrical_conductivity",
30  "The electrical conductivity of the secondary surface solid material");
31  params.addParam<Real>("weighting_factor",
32  0.5,
33  "Weight applied to divide the heat flux from Joule heating at the "
34  "interface between the primary and secondary surfaces.");
35  return params;
36 }
37 
39  const InputParameters & parameters)
40  : ADMortarConstraint(parameters),
41  _lm_electrical_potential(adCoupledLowerValue("potential_lagrange_multiplier")),
42  _primary_conductivity(getNeighborADMaterialProperty<Real>("primary_electrical_conductivity")),
43  _secondary_conductivity(getADMaterialProperty<Real>("secondary_electrical_conductivity")),
44  _weight_factor(getParam<Real>("weighting_factor"))
45 {
46 }
47 
48 ADReal
50 {
51  // calculate the harmonic means of the two material properties
53  const ADReal C_harmonic = 2.0 * _primary_conductivity[_qp] * _secondary_conductivity[_qp] / C_sum;
54 
56  ADReal q_electric = potential_flux_sq / C_harmonic;
57 
58  switch (mortar_type)
59  {
61  {
62  auto source = -q_electric * _weight_factor * _test_primary[_i][_qp];
63  return source;
64  }
65 
67  {
68  auto source = -q_electric * (1.0 - _weight_factor) * _test_secondary[_i][_qp];
69  return source;
70  }
71 
72  default:
73  return 0;
74  }
75 }
const VariableTestValue & _test_secondary
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const ADMaterialProperty< Real > & _primary_conductivity
Electrical conductivity of the two solid materials at the closed gap interface.
This Constraint implements thermal contact arising from Joule heating at an interface subject to a po...
unsigned int _i
DualNumber< Real, DNDerivativeType, true > ADReal
void addRequiredParam(const std::string &name, const std::string &doc_string)
const ADVariableValue & _lm_electrical_potential
Lagrange multiplier variable from the separately solved electrical contact.
const Real _weight_factor
Factor used to weight the distribution of the heat flux at interface between the primary and secondar...
ADInterfaceJouleHeatingConstraint(const InputParameters &parameters)
virtual ADReal computeQpResidual(Moose::MortarType mortar_type) final
Computes the heat source added to each interface side as a function of the electric potential drop th...
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("HeatTransferApp", ADInterfaceJouleHeatingConstraint)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
const ADMaterialProperty< Real > & _secondary_conductivity
const VariableTestValue & _test_primary
unsigned int _qp