www.mooseframework.org
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
JouleHeatingSource Class Reference

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 potenstial. More...

#include <JouleHeatingSource.h>

Inheritance diagram for JouleHeatingSource:
[legend]

Public Member Functions

 JouleHeatingSource (const InputParameters &parameters)
 
virtual void initialSetup ()
 

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

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 potenstial.

Definition at line 26 of file JouleHeatingSource.h.

Constructor & Destructor Documentation

◆ JouleHeatingSource()

JouleHeatingSource::JouleHeatingSource ( const InputParameters &  parameters)

Definition at line 27 of file JouleHeatingSource.C.

28  : DerivativeMaterialInterface<JvarMapKernelInterface<HeatSource>>(parameters),
29  _grad_elec(coupledGradient("elec")),
30  _elec_var(coupled("elec")),
31  _elec_cond(getMaterialProperty<Real>("electrical_conductivity")),
32  _delec_cond_dT(getMaterialPropertyDerivative<Real>("electrical_conductivity", _var.name())),
33  _delec_cond_darg(_coupled_moose_vars.size())
34 {
35  for (unsigned int i = 0; i < _delec_cond_darg.size(); ++i)
36  _delec_cond_darg[i] = &getMaterialPropertyDerivative<Real>("electrical_conductivity",
37  _coupled_moose_vars[i]->name());
38 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _delec_cond_dT
const MaterialProperty< Real > & _elec_cond
const std::string name
Definition: Setup.h:22
const unsigned int _elec_var
std::vector< const MaterialProperty< Real > * > _delec_cond_darg

Member Function Documentation

◆ computeQpJacobian()

Real JouleHeatingSource::computeQpJacobian ( )
protectedvirtual

Definition at line 53 of file JouleHeatingSource.C.

54 {
55  return -_delec_cond_dT[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _phi[_j][_qp] * _test[_i][_qp];
56 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _delec_cond_dT

◆ computeQpOffDiagJacobian()

Real JouleHeatingSource::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 59 of file JouleHeatingSource.C.

60 {
61  const unsigned int cvar = mapJvarToCvar(jvar);
62 
63  if (jvar == _elec_var)
64  return -2 * _elec_cond[_qp] * _grad_elec[_qp] * _grad_phi[_j][_qp] * _test[_i][_qp] -
65  (*_delec_cond_darg[cvar])[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _phi[_j][_qp] *
66  _test[_i][_qp];
67 
68  return -(*_delec_cond_darg[cvar])[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _phi[_j][_qp] *
69  _test[_i][_qp];
70 }
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 47 of file JouleHeatingSource.C.

48 {
49  return -_elec_cond[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _test[_i][_qp];
50 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _elec_cond

◆ initialSetup()

void JouleHeatingSource::initialSetup ( )
virtual

Definition at line 41 of file JouleHeatingSource.C.

42 {
43  validateNonlinearCoupling<Real>("electrical_conductivity");
44 }

Member Data Documentation

◆ _delec_cond_darg

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

Definition at line 43 of file JouleHeatingSource.h.

Referenced by computeQpOffDiagJacobian(), and JouleHeatingSource().

◆ _delec_cond_dT

const MaterialProperty<Real>& JouleHeatingSource::_delec_cond_dT
private

Definition at line 42 of file JouleHeatingSource.h.

Referenced by computeQpJacobian().

◆ _elec_cond

const MaterialProperty<Real>& JouleHeatingSource::_elec_cond
private

Definition at line 41 of file JouleHeatingSource.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

◆ _elec_var

const unsigned int JouleHeatingSource::_elec_var
private

Definition at line 39 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: