www.mooseframework.org
HeatConductionTimeDerivative.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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(
19  "Time derivative term $\\rho c_p \\frac{\\partial T}{\\partial t}$ of "
20  "the heat equation for quasi-constant specific heat $c_p$ and the density $\\rho$.");
21 
22  // Density may be changing with deformation, so we must integrate
23  // over current volume by setting the use_displaced_mesh flag.
24  params.set<bool>("use_displaced_mesh") = true;
25 
26  params.addParam<MaterialPropertyName>(
27  "specific_heat", "specific_heat", "Name of the specific heat material property");
28  params.addParam<MaterialPropertyName>(
29  "specific_heat_dT",
30  "Name of the material property for the derivative of the specific heat with respect "
31  "to the variable.");
32 
38  params.addParam<MaterialPropertyName>(
39  "density_name", "density", "Property name of the density material property");
40  params.addParam<MaterialPropertyName>(
41  "density_name_dT",
42  "Name of material property for the derivative of the density with respect to the variable.");
43  return params;
44 }
45 
47  : TimeDerivative(parameters),
48  _specific_heat(getMaterialProperty<Real>("specific_heat")),
49  _specific_heat_dT(isParamValid("specific_heat_dT")
50  ? &getMaterialProperty<Real>("specific_heat_dT")
51  : nullptr),
52  _density(getMaterialProperty<Real>("density_name")),
53  _density_dT(isParamValid("density_name_dT") ? &getMaterialProperty<Real>("density_name_dT")
54  : nullptr)
55 {
56 }
57 
58 Real
60 {
62 }
63 
64 Real
66 {
69  jac += (*_specific_heat_dT)[_qp] * _density[_qp] * _phi[_j][_qp] *
71  if (_density_dT)
72  jac += _specific_heat[_qp] * (*_density_dT)[_qp] * _phi[_j][_qp] *
74  return jac;
75 }
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