www.mooseframework.org
Public Member Functions | Protected Member Functions | List of all members
SpecificHeatConductionTimeDerivative Class Reference

A class for defining the time derivative of the heat equation. More...

#include <SpecificHeatConductionTimeDerivative.h>

Inheritance diagram for SpecificHeatConductionTimeDerivative:
[legend]

Public Member Functions

 SpecificHeatConductionTimeDerivative (const InputParameters &parameters)
 

Protected Member Functions

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

Protected Attributes

const MaterialProperty< Real > & _specific_heat
 Specific heat and its derivatives with respect to temperature and other coupled variables. More...
 
const MaterialProperty< Real > & _d_specific_heat_dT
 
std::vector< const MaterialProperty< Real > * > _d_specific_heat_dargs
 
const MaterialProperty< Real > & _density
 Density and its derivatives with respect to temperature and other coupled variables. More...
 
const MaterialProperty< Real > & _d_density_dT
 
std::vector< const MaterialProperty< Real > * > _d_density_dargs
 

Detailed Description

A class for defining the time derivative of the heat equation.

By default this Kernel computes: \( \rho * c_p * \frac{\partial T}{\partial t}, \) where \( \rho \) and \( c_p \) are material properties for "density" and "specific_heat", respectively.

Definition at line 29 of file SpecificHeatConductionTimeDerivative.h.

Constructor & Destructor Documentation

SpecificHeatConductionTimeDerivative::SpecificHeatConductionTimeDerivative ( const InputParameters &  parameters)

Definition at line 30 of file SpecificHeatConductionTimeDerivative.C.

32  : DerivativeMaterialInterface<JvarMapKernelInterface<TimeDerivative>>(parameters),
33  _specific_heat(getMaterialProperty<Real>("specific_heat")),
34  _d_specific_heat_dT(getMaterialPropertyDerivative<Real>("specific_heat", _var.name())),
35  _density(getMaterialProperty<Real>("density")),
36  _d_density_dT(getMaterialPropertyDerivative<Real>("density", _var.name()))
37 {
38  // Get number of coupled variables
39  unsigned int nvar = _coupled_moose_vars.size();
40 
41  // reserve space for derivatives
42  _d_specific_heat_dargs.resize(nvar);
43  _d_density_dargs.resize(nvar);
44 
45  // Iterate over all coupled variables
46  for (unsigned int i = 0; i < nvar; ++i)
47  {
48  const std::string iname = _coupled_moose_vars[i]->name();
49  _d_specific_heat_dargs[i] = &getMaterialPropertyDerivative<Real>("specific_heat", iname);
50  _d_density_dargs[i] = &getMaterialPropertyDerivative<Real>("density", iname);
51  }
52 }
std::vector< const MaterialProperty< Real > * > _d_density_dargs
const MaterialProperty< Real > & _density
Density and its derivatives with respect to temperature and other coupled variables.
std::vector< const MaterialProperty< Real > * > _d_specific_heat_dargs
const MaterialProperty< Real > & _specific_heat
Specific heat and its derivatives with respect to temperature and other coupled variables.

Member Function Documentation

Real SpecificHeatConductionTimeDerivative::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 61 of file SpecificHeatConductionTimeDerivative.C.

62 {
63  const Real dT = TimeDerivative::computeQpResidual();
64 
65  // on-diagonal Jacobian with all terms that may depend on the kernel variable
66  return _specific_heat[_qp] * _density[_qp] * TimeDerivative::computeQpJacobian() +
67  _d_specific_heat_dT[_qp] * _phi[_j][_qp] * _density[_qp] * dT +
68  _specific_heat[_qp] * _d_density_dT[_qp] * _phi[_j][_qp] * dT;
69 }
const MaterialProperty< Real > & _density
Density and its derivatives with respect to temperature and other coupled variables.
const MaterialProperty< Real > & _specific_heat
Specific heat and its derivatives with respect to temperature and other coupled variables.
Real SpecificHeatConductionTimeDerivative::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 72 of file SpecificHeatConductionTimeDerivative.C.

73 {
74  // get the coupled variable jvar is referring to
75  const unsigned int cvar = mapJvarToCvar(jvar);
76 
77  // off-diagonal contribution with terms that depend on coupled variables
78  const Real dT = TimeDerivative::computeQpResidual();
79  return (*_d_specific_heat_dargs[cvar])[_qp] * _phi[_j][_qp] * _density[_qp] * dT +
80  _specific_heat[_qp] * (*_d_density_dargs[cvar])[_qp] * _phi[_j][_qp] * dT;
81 }
std::vector< const MaterialProperty< Real > * > _d_density_dargs
const MaterialProperty< Real > & _density
Density and its derivatives with respect to temperature and other coupled variables.
std::vector< const MaterialProperty< Real > * > _d_specific_heat_dargs
const MaterialProperty< Real > & _specific_heat
Specific heat and its derivatives with respect to temperature and other coupled variables.
Real SpecificHeatConductionTimeDerivative::computeQpResidual ( )
overrideprotectedvirtual

Reimplemented in ConsistentSpecificHeatTimeDerivative.

Definition at line 55 of file SpecificHeatConductionTimeDerivative.C.

56 {
57  return _specific_heat[_qp] * _density[_qp] * TimeDerivative::computeQpResidual();
58 }
const MaterialProperty< Real > & _density
Density and its derivatives with respect to temperature and other coupled variables.
const MaterialProperty< Real > & _specific_heat
Specific heat and its derivatives with respect to temperature and other coupled variables.

Member Data Documentation

std::vector<const MaterialProperty<Real> *> SpecificHeatConductionTimeDerivative::_d_density_dargs
protected
const MaterialProperty<Real>& SpecificHeatConductionTimeDerivative::_d_density_dT
protected
std::vector<const MaterialProperty<Real> *> SpecificHeatConductionTimeDerivative::_d_specific_heat_dargs
protected
const MaterialProperty<Real>& SpecificHeatConductionTimeDerivative::_d_specific_heat_dT
protected
const MaterialProperty<Real>& SpecificHeatConductionTimeDerivative::_density
protected

Density and its derivatives with respect to temperature and other coupled variables.

Definition at line 47 of file SpecificHeatConductionTimeDerivative.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), ConsistentSpecificHeatTimeDerivative::computeQpResidual(), and computeQpResidual().

const MaterialProperty<Real>& SpecificHeatConductionTimeDerivative::_specific_heat
protected

Specific heat and its derivatives with respect to temperature and other coupled variables.

Definition at line 41 of file SpecificHeatConductionTimeDerivative.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), ConsistentSpecificHeatTimeDerivative::computeQpResidual(), and computeQpResidual().


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