https://mooseframework.inl.gov
HeatConductionTimeDerivative.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
13 
16 {
18  params.addClassDescription("Time derivative term $\\rho c_p \\frac{\\partial T}{\\partial t}$ of "
19  "the thermal energy conservation equation.");
20 
21  // Density may be changing with deformation, so we must integrate
22  // over current volume by setting the use_displaced_mesh flag.
23  params.set<bool>("use_displaced_mesh") = true;
24 
25  params.addParam<MaterialPropertyName>(
26  "specific_heat",
27  "specific_heat",
28  "Name of the volumetric isobaric specific heat material property");
29  params.addParam<MaterialPropertyName>(
30  "specific_heat_dT",
31  "Name of the material property for the derivative of the specific heat with respect "
32  "to the variable.");
33 
39  params.addParam<MaterialPropertyName>(
40  "density_name", "density", "Property name of the density material property");
41  params.addParam<MaterialPropertyName>(
42  "density_name_dT",
43  "Name of material property for the derivative of the density with respect to the variable.");
44  return params;
45 }
46 
48  : TimeDerivative(parameters),
49  _specific_heat(getMaterialProperty<Real>("specific_heat")),
50  _specific_heat_dT(isParamValid("specific_heat_dT")
51  ? &getMaterialProperty<Real>("specific_heat_dT")
52  : nullptr),
53  _density(getMaterialProperty<Real>("density_name")),
54  _density_dT(isParamValid("density_name_dT") ? &getMaterialProperty<Real>("density_name_dT")
55  : nullptr)
56 {
57 }
58 
59 Real
61 {
63 }
64 
65 Real
67 {
70  jac += (*_specific_heat_dT)[_qp] * _density[_qp] * _phi[_j][_qp] *
72  if (_density_dT)
73  jac += _specific_heat[_qp] * (*_density_dT)[_qp] * _phi[_j][_qp] *
75  return jac;
76 }
A class for defining the time derivative of the heat equation.
virtual Real computeQpResidual() override
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
const MaterialProperty< Real > & _specific_heat
static InputParameters validParams()
virtual Real computeQpJacobian()
Compute the jacobian of the Heat Equation time derivative.
const MaterialProperty< Real > *const _specific_heat_dT
static InputParameters validParams()
Contructor for Heat Equation time derivative term.
virtual Real computeQpJacobian() override
const MaterialProperty< Real > & _density
virtual Real computeQpResidual()
Compute the residual of the Heat Equation time derivative.
unsigned int _j
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
HeatConductionTimeDerivative(const InputParameters &parameters)
registerMooseObject("HeatTransferApp", HeatConductionTimeDerivative)
const VariablePhiValue & _phi
unsigned int _qp
const MaterialProperty< Real > *const _density_dT