www.mooseframework.org
Public Member Functions | Static 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)
 

Static Public Member Functions

static InputParameters validParams ()
 

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

Constructor & Destructor Documentation

◆ SpecificHeatConductionTimeDerivative()

SpecificHeatConductionTimeDerivative::SpecificHeatConductionTimeDerivative ( const InputParameters &  parameters)

Definition at line 36 of file SpecificHeatConductionTimeDerivative.C.

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

Member Function Documentation

◆ computeQpJacobian()

Real SpecificHeatConductionTimeDerivative::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 67 of file SpecificHeatConductionTimeDerivative.C.

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

◆ computeQpOffDiagJacobian()

Real SpecificHeatConductionTimeDerivative::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Definition at line 78 of file SpecificHeatConductionTimeDerivative.C.

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

◆ computeQpResidual()

Real SpecificHeatConductionTimeDerivative::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 61 of file SpecificHeatConductionTimeDerivative.C.

62 {
63  return _specific_heat[_qp] * _density[_qp] * TimeDerivative::computeQpResidual();
64 }

◆ validParams()

InputParameters SpecificHeatConductionTimeDerivative::validParams ( )
static

Definition at line 17 of file SpecificHeatConductionTimeDerivative.C.

18 {
19  InputParameters params = TimeDerivative::validParams();
20  params.addClassDescription(
21  "Time derivative term $\\rho c_p \\frac{\\partial T}{\\partial t}$ of "
22  "the heat equation with the specific heat $c_p$ and the density $\\rho$ as arguments.");
23 
24  // Density may be changing with deformation, so we must integrate
25  // over current volume by setting the use_displaced_mesh flag.
26  params.set<bool>("use_displaced_mesh") = true;
27 
28  params.addParam<MaterialPropertyName>(
29  "specific_heat", "specific_heat", "Property name of the specific heat material property");
30  params.addParam<MaterialPropertyName>(
31  "density", "density", "Property name of the density material property");
32  params.addCoupledVar("args", "Vector of additional arguments of the specific heat and density");
33  return params;
34 }

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 52 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 46 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 51 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 45 of file SpecificHeatConductionTimeDerivative.h.

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


The documentation for this class was generated from the following files:
SpecificHeatConductionTimeDerivative::_d_density_dargs
std::vector< const MaterialProperty< Real > * > _d_density_dargs
Definition: SpecificHeatConductionTimeDerivative.h:53
SpecificHeatConductionTimeDerivative::_d_density_dT
const MaterialProperty< Real > & _d_density_dT
Definition: SpecificHeatConductionTimeDerivative.h:52
SpecificHeatConductionTimeDerivative::_density
const MaterialProperty< Real > & _density
Density and its derivatives with respect to temperature and other coupled variables.
Definition: SpecificHeatConductionTimeDerivative.h:51
validParams
InputParameters validParams()
SpecificHeatConductionTimeDerivative::_specific_heat
const MaterialProperty< Real > & _specific_heat
Specific heat and its derivatives with respect to temperature and other coupled variables.
Definition: SpecificHeatConductionTimeDerivative.h:45
SpecificHeatConductionTimeDerivative::_d_specific_heat_dT
const MaterialProperty< Real > & _d_specific_heat_dT
Definition: SpecificHeatConductionTimeDerivative.h:46
SpecificHeatConductionTimeDerivative::_d_specific_heat_dargs
std::vector< const MaterialProperty< Real > * > _d_specific_heat_dargs
Definition: SpecificHeatConductionTimeDerivative.h:47