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 18 of file JouleHeatingSource.h.

Constructor & Destructor Documentation

JouleHeatingSource::JouleHeatingSource ( const InputParameters &  parameters)

Definition at line 17 of file JouleHeatingSource.C.

18  : DerivativeMaterialInterface<JvarMapKernelInterface<HeatSource>>(parameters),
19  _grad_elec(coupledGradient("elec")),
20  _elec_var(coupled("elec")),
21  _elec_cond(getMaterialProperty<Real>("electrical_conductivity")),
22  _delec_cond_dT(getMaterialPropertyDerivative<Real>("electrical_conductivity", _var.name())),
23  _delec_cond_darg(_coupled_moose_vars.size())
24 {
25  for (unsigned int i = 0; i < _delec_cond_darg.size(); ++i)
26  _delec_cond_darg[i] = &getMaterialPropertyDerivative<Real>("electrical_conductivity",
27  _coupled_moose_vars[i]->name());
28 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _delec_cond_dT
const MaterialProperty< Real > & _elec_cond
const unsigned int _elec_var
std::vector< const MaterialProperty< Real > * > _delec_cond_darg

Member Function Documentation

Real JouleHeatingSource::computeQpJacobian ( )
protectedvirtual

Definition at line 43 of file JouleHeatingSource.C.

44 {
45  return -_delec_cond_dT[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _phi[_j][_qp] * _test[_i][_qp];
46 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _delec_cond_dT
Real JouleHeatingSource::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 49 of file JouleHeatingSource.C.

50 {
51  const unsigned int cvar = mapJvarToCvar(jvar);
52 
53  if (jvar == _elec_var)
54  return -2 * _elec_cond[_qp] * _grad_elec[_qp] * _grad_phi[_j][_qp] * _test[_i][_qp] -
55  (*_delec_cond_darg[cvar])[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _phi[_j][_qp] *
56  _test[_i][_qp];
57 
58  return -(*_delec_cond_darg[cvar])[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _phi[_j][_qp] *
59  _test[_i][_qp];
60 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _elec_cond
const unsigned int _elec_var
std::vector< const MaterialProperty< Real > * > _delec_cond_darg
Real JouleHeatingSource::computeQpResidual ( )
protectedvirtual

Definition at line 37 of file JouleHeatingSource.C.

38 {
39  return -_elec_cond[_qp] * _grad_elec[_qp] * _grad_elec[_qp] * _test[_i][_qp];
40 }
const VariableGradient & _grad_elec
const MaterialProperty< Real > & _elec_cond
void JouleHeatingSource::initialSetup ( )
virtual

Definition at line 31 of file JouleHeatingSource.C.

32 {
33  validateNonlinearCoupling<Real>("electrical_conductivity");
34 }

Member Data Documentation

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

Definition at line 35 of file JouleHeatingSource.h.

Referenced by computeQpOffDiagJacobian(), and JouleHeatingSource().

const MaterialProperty<Real>& JouleHeatingSource::_delec_cond_dT
private

Definition at line 34 of file JouleHeatingSource.h.

Referenced by computeQpJacobian().

const MaterialProperty<Real>& JouleHeatingSource::_elec_cond
private

Definition at line 33 of file JouleHeatingSource.h.

Referenced by computeQpOffDiagJacobian(), and computeQpResidual().

const unsigned int JouleHeatingSource::_elec_var
private

Definition at line 31 of file JouleHeatingSource.h.

Referenced by computeQpOffDiagJacobian().

const VariableGradient& JouleHeatingSource::_grad_elec
private

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