https://mooseframework.inl.gov
JouleHeatingHeatGeneratedAux.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("Compute heat generated from Joule heating.");
19  params.addParam<MaterialPropertyName>(
20  "heating_term", "electric_field_heating", "Material property providing the Joule heating.");
21  params.addCoupledVar("elec", "Electric potential for Joule heating.");
22  params.addParam<MaterialPropertyName>(
23  "electrical_conductivity",
24  "electrical_conductivity",
25  "Material property providing electrical conductivity of the material.");
26  return params;
27 }
28 
30  : AuxKernel(parameters),
31  _supplied_potential(isParamValid("elec")),
32 
33  _grad_elec(coupledGradient("elec")),
34  _elec_cond(_supplied_potential ? (hasMaterialProperty<Real>("electrical_conductivity")
35  ? &getMaterialProperty<Real>("electrical_conductivity")
36  : nullptr)
37  : nullptr),
38  _ad_elec_cond(
39  _supplied_potential
40  ? (!_elec_cond ? &getADMaterialProperty<Real>("electrical_conductivity") : nullptr)
41  : nullptr),
42 
43  _heating_residual(_supplied_potential ? getGenericZeroMaterialProperty<Real, true>()
44  : getADMaterialProperty<Real>("heating_term"))
45 {
48  "Directly coupling an electrostatic potential will be deprecated in the near future "
49  "(10/01/2025). Please use the material object 'ElectromagneticHeatingMaterial' to coupled "
50  "either the electrostatic or electromagnetic field for Joule heating.");
51 }
52 
53 Real
55 {
56  /*
57  * NOTE: Coupling in the gradient of the potential will be deprecated in the
58  * near future (10/01/2025). After the deprecation, the residual contribution of this kernel
59  * will be solely provided by the 'ElectromagneticHeatingMaterial' material object.
60  */
62  {
63  const Real elec_coef =
64  _elec_cond ? (*_elec_cond)[_qp] : MetaPhysicL::raw_value((*_ad_elec_cond)[_qp]);
65  return elec_coef * _grad_elec[_qp] * _grad_elec[_qp];
66  }
67  else
69 }
Auxiliary kernel for computing the heat generated from Joule heating.
void mooseDeprecated(Args &&... args) const
const VariableGradient & _grad_elec
Gradient of the coupled potential.
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
auto raw_value(const Eigen::Map< T > &in)
registerMooseObject("HeatTransferApp", JouleHeatingHeatGeneratedAux)
const bool _supplied_potential
Set to true when an electrostatic potential is provided.
JouleHeatingHeatGeneratedAux(const InputParameters &parameters)
const ADMaterialProperty< Real > & _heating_residual
The Joule heating residual provided as a material object.
const MaterialProperty< Real > *const _elec_cond
Holds the electric conductivity coefficient from the material system if non-AD.
void addCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const ADMaterialProperty< Real > *const _ad_elec_cond
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()