https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
JouleHeatingSource Class Reference

NOTE: The non-AD version of JouleHeatingSource will be deprecated in the near future (10/01/2025) in favor of exclusively using the AD version of JouleHeatingSource, since the ADJouleHeatingSource can calculate both electrostatic and electromagnetic Joule heating. More...

#include <JouleHeatingSource.h>

Inheritance diagram for JouleHeatingSource:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 JouleHeatingSource (const InputParameters &parameters)
 
virtual void initialSetup ()
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 

Private Attributes

const VariableGradient_grad_elec
 
const unsigned int _elec_var
 
const MaterialProperty< Real > & _elec_cond
 
const MaterialProperty< Real > & _delec_cond_dT
 
std::vector< const MaterialProperty< Real > * > _delec_cond_darg
 

Detailed Description

NOTE: The non-AD version of JouleHeatingSource will be deprecated in the near future (10/01/2025) in favor of exclusively using the AD version of JouleHeatingSource, since the ADJouleHeatingSource can calculate both electrostatic and electromagnetic Joule heating.

This kernel calculates the heat source term corresponding to joule heating, Q = J * E = elec_cond * grad_phi * grad_phi, where phi is the electrical potential.

Definition at line 27 of file JouleHeatingSource.h.

Constructor & Destructor Documentation

◆ JouleHeatingSource()

JouleHeatingSource::JouleHeatingSource ( const InputParameters parameters)

Definition at line 29 of file JouleHeatingSource.C.

31  _grad_elec(coupledGradient("elec")),
32  _elec_var(coupled("elec")),
33  _elec_cond(getMaterialProperty<Real>("electrical_conductivity")),
34  _delec_cond_dT(getMaterialPropertyDerivative<Real>("electrical_conductivity", _var.name())),
35  _delec_cond_darg(_coupled_moose_vars.size())
36 {
37  for (unsigned int i = 0; i < _delec_cond_darg.size(); ++i)
38  _delec_cond_darg[i] = &getMaterialPropertyDerivative<Real>("electrical_conductivity",
39  _coupled_moose_vars[i]->name());
40 
41  mooseDeprecated("The non-AD version of JouleHeatingSource will be deprecated in the near future "
42  "(10/01/2025) in favor of exclusively using the AD version of "
43  "JouleHeatingSource, since the ADJouleHeatingSource can calculate both "
44  "electrostatic and electromagnetic Joule heating.");
45 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _delec_cond_dT
const MaterialProperty< Real > & _elec_cond
const std::string name
Definition: Setup.h:20
const unsigned int _elec_var
void mooseDeprecated(Args &&... args)
std::vector< const MaterialProperty< Real > * > _delec_cond_darg

Member Function Documentation

◆ computeQpJacobian()

Real JouleHeatingSource::computeQpJacobian ( )
protectedvirtual

Definition at line 60 of file JouleHeatingSource.C.

61 {
62  return -_delec_cond_dT[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _phi[_j][_qp] * _test[_i][_qp];
63 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _delec_cond_dT

◆ computeQpOffDiagJacobian()

Real JouleHeatingSource::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 66 of file JouleHeatingSource.C.

67 {
68  const unsigned int cvar = mapJvarToCvar(jvar);
69 
70  if (jvar == _elec_var)
71  return -2 * _elec_cond[_qp] * _grad_elec[_qp] * _grad_phi[_j][_qp] * _test[_i][_qp] -
72  (*_delec_cond_darg[cvar])[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _phi[_j][_qp] *
73  _test[_i][_qp];
74 
75  return -(*_delec_cond_darg[cvar])[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _phi[_j][_qp] *
76  _test[_i][_qp];
77 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _elec_cond
const unsigned int _elec_var
std::vector< const MaterialProperty< Real > * > _delec_cond_darg

◆ computeQpResidual()

Real JouleHeatingSource::computeQpResidual ( )
protectedvirtual

Definition at line 54 of file JouleHeatingSource.C.

55 {
56  return -_elec_cond[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _test[_i][_qp];
57 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _elec_cond

◆ initialSetup()

void JouleHeatingSource::initialSetup ( )
virtual

Definition at line 48 of file JouleHeatingSource.C.

49 {
50  validateNonlinearCoupling<Real>("electrical_conductivity");
51 }

◆ validParams()

InputParameters JouleHeatingSource::validParams ( )
static

Definition at line 15 of file JouleHeatingSource.C.

16 {
17  InputParameters params =
19  params.addCoupledVar("elec", "Electric potential for joule heating.");
20  params.addParam<MaterialPropertyName>(
21  "electrical_conductivity",
22  "electrical_conductivity",
23  "Material property providing electrical conductivity of the material.");
24  params.addClassDescription("Calculates the heat source term corresponding to electrostatic Joule "
25  "heating.");
26  return params;
27 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _delec_cond_darg

std::vector<const MaterialProperty<Real> *> JouleHeatingSource::_delec_cond_darg
private

Definition at line 46 of file JouleHeatingSource.h.

Referenced by computeQpOffDiagJacobian(), and JouleHeatingSource().

◆ _delec_cond_dT

const MaterialProperty<Real>& JouleHeatingSource::_delec_cond_dT
private

Definition at line 45 of file JouleHeatingSource.h.

Referenced by computeQpJacobian().

◆ _elec_cond

const MaterialProperty<Real>& JouleHeatingSource::_elec_cond
private

Definition at line 44 of file JouleHeatingSource.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _elec_var

const unsigned int JouleHeatingSource::_elec_var
private

Definition at line 42 of file JouleHeatingSource.h.

Referenced by computeQpOffDiagJacobian().

◆ _grad_elec

const VariableGradient& JouleHeatingSource::_grad_elec
private

The documentation for this class was generated from the following files: