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 32 of file SpecificHeatConductionTimeDerivative.h.

Constructor & Destructor Documentation

◆ SpecificHeatConductionTimeDerivative()

SpecificHeatConductionTimeDerivative::SpecificHeatConductionTimeDerivative ( const InputParameters &  parameters)

Definition at line 35 of file SpecificHeatConductionTimeDerivative.C.

37  : DerivativeMaterialInterface<JvarMapKernelInterface<TimeDerivative>>(parameters),
38  _specific_heat(getMaterialProperty<Real>("specific_heat")),
39  _d_specific_heat_dT(getMaterialPropertyDerivative<Real>("specific_heat", _var.name())),
40  _density(getMaterialProperty<Real>("density")),
41  _d_density_dT(getMaterialPropertyDerivative<Real>("density", _var.name()))
42 {
43  // Get number of coupled variables
44  unsigned int nvar = _coupled_moose_vars.size();
45 
46  // reserve space for derivatives
47  _d_specific_heat_dargs.resize(nvar);
48  _d_density_dargs.resize(nvar);
49 
50  // Iterate over all coupled variables
51  for (unsigned int i = 0; i < nvar; ++i)
52  {
53  const std::string iname = _coupled_moose_vars[i]->name();
54  _d_specific_heat_dargs[i] = &getMaterialPropertyDerivative<Real>("specific_heat", iname);
55  _d_density_dargs[i] = &getMaterialPropertyDerivative<Real>("density", iname);
56  }
57 }
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

◆ computeQpJacobian()

Real SpecificHeatConductionTimeDerivative::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 66 of file SpecificHeatConductionTimeDerivative.C.

67 {
68  const Real dT = TimeDerivative::computeQpResidual();
69 
70  // on-diagonal Jacobian with all terms that may depend on the kernel variable
71  return _specific_heat[_qp] * _density[_qp] * TimeDerivative::computeQpJacobian() +
72  _d_specific_heat_dT[_qp] * _phi[_j][_qp] * _density[_qp] * dT +
73  _specific_heat[_qp] * _d_density_dT[_qp] * _phi[_j][_qp] * dT;
74 }
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.

◆ computeQpOffDiagJacobian()

Real SpecificHeatConductionTimeDerivative::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 77 of file SpecificHeatConductionTimeDerivative.C.

78 {
79  // get the coupled variable jvar is referring to
80  const unsigned int cvar = mapJvarToCvar(jvar);
81 
82  // off-diagonal contribution with terms that depend on coupled variables
83  const Real dT = TimeDerivative::computeQpResidual();
84  return (*_d_specific_heat_dargs[cvar])[_qp] * _phi[_j][_qp] * _density[_qp] * dT +
85  _specific_heat[_qp] * (*_d_density_dargs[cvar])[_qp] * _phi[_j][_qp] * dT;
86 }
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.

◆ computeQpResidual()

Real SpecificHeatConductionTimeDerivative::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 60 of file SpecificHeatConductionTimeDerivative.C.

61 {
62  return _specific_heat[_qp] * _density[_qp] * TimeDerivative::computeQpResidual();
63 }
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

◆ _d_density_dargs

std::vector<const MaterialProperty<Real> *> SpecificHeatConductionTimeDerivative::_d_density_dargs
protected

◆ _d_density_dT

const MaterialProperty<Real>& SpecificHeatConductionTimeDerivative::_d_density_dT
protected

Definition at line 51 of file SpecificHeatConductionTimeDerivative.h.

Referenced by computeQpJacobian().

◆ _d_specific_heat_dargs

std::vector<const MaterialProperty<Real> *> SpecificHeatConductionTimeDerivative::_d_specific_heat_dargs
protected

◆ _d_specific_heat_dT

const MaterialProperty<Real>& SpecificHeatConductionTimeDerivative::_d_specific_heat_dT
protected

Definition at line 45 of file SpecificHeatConductionTimeDerivative.h.

Referenced by computeQpJacobian().

◆ _density

const MaterialProperty<Real>& SpecificHeatConductionTimeDerivative::_density
protected

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

Definition at line 50 of file SpecificHeatConductionTimeDerivative.h.

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

◆ _specific_heat

const MaterialProperty<Real>& SpecificHeatConductionTimeDerivative::_specific_heat
protected

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

Definition at line 44 of file SpecificHeatConductionTimeDerivative.h.

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


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