https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
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.");
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
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 {
60 case Moose::MortarType::Primary:
61 {
62 auto source = -q_electric * _weight_factor * _test_primary[_i][_qp];
63 return source;
64 }
65
66 case Moose::MortarType::Secondary:
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}
registerMooseObject("HeatTransferApp", ADInterfaceJouleHeatingConstraint)
DualNumber< Real, DNDerivativeType, true > ADReal
This Constraint implements thermal contact arising from Joule heating at an interface subject to a po...
ADInterfaceJouleHeatingConstraint(const InputParameters &parameters)
const ADMaterialProperty< Real > & _secondary_conductivity
const Real _weight_factor
Factor used to weight the distribution of the heat flux at interface between the primary and secondar...
const ADMaterialProperty< Real > & _primary_conductivity
Electrical conductivity of the two solid materials at the closed gap interface.
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...
const ADVariableValue & _lm_electrical_potential
Lagrange multiplier variable from the separately solved electrical contact.
static InputParameters validParams()
unsigned int _qp
unsigned int _i
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const VariableTestValue & _test_secondary
const VariableTestValue & _test_primary