https://mooseframework.inl.gov
Loading...
Searching...
No Matches
HeatCapacityConductionTimeDerivative.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 $C_p \\frac{\\partial T}{\\partial t}$ of "
19 "the heat equation with the heat capacity $C_p$ as an argument.");
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 "heat_capacity", "heat_capacity", "Property name of the heat capacity material property");
27 return params;
28}
29
31 const InputParameters & parameters)
33 _heat_capacity(getMaterialProperty<Real>("heat_capacity")),
34 _d_heat_capacity_dT(getMaterialPropertyDerivative<Real>("heat_capacity", _var.name()))
35{
36 // get number of coupled variables
37 unsigned int nvar = _coupled_moose_vars.size();
38
39 // reserve space for derivatives
40 _d_heat_capacity_dargs.resize(nvar);
41
42 // iterate over all coupled variables
43 for (unsigned int i = 0; i < nvar; ++i)
45 &getMaterialPropertyDerivative<Real>("heat_capacity", _coupled_moose_vars[i]->name());
46}
47
48Real
53
54Real
56{
57 // on-diagonal Jacobian with all terms that may depend on the kernel variable
60}
61
62Real
64{
65 // get the coupled variable jvar is referring to
66 const unsigned int cvar = mapJvarToCvar(jvar);
67
68 // off-diagonal contribution with terms that depend on coupled variables
69 return (*_d_heat_capacity_dargs[cvar])[_qp] * _phi[_j][_qp] * TimeDerivative::computeQpResidual();
70}
registerMooseObject("HeatTransferApp", HeatCapacityConductionTimeDerivative)
const std::string name
Definition Setup.h:21
A class for defining the time derivative of the heat equation.
HeatCapacityConductionTimeDerivative(const InputParameters &parameters)
const MaterialProperty< Real > & _heat_capacity
Heat capacity and its derivatives with respect to temperature and other coupled variables.
std::vector< const MaterialProperty< Real > * > _d_heat_capacity_dargs
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
static InputParameters validParams()
virtual Real computeQpResidual() override
virtual Real computeQpJacobian() override