www.mooseframework.org
HeatConduction.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "HeatConduction.h"
9 #include "MooseMesh.h"
10 
11 template <>
12 InputParameters
14 {
15  InputParameters params = validParams<Diffusion>();
16  params.addClassDescription(
17  "Computes residual/Jacobian contribution for $(k \\nabla T, \\nabla \\psi)$ term.");
18  params.addParam<MaterialPropertyName>(
19  "diffusion_coefficient",
20  "thermal_conductivity",
21  "Property name of the diffusivity (Default: thermal_conductivity)");
22  params.addParam<MaterialPropertyName>(
23  "diffusion_coefficient_dT",
24  "thermal_conductivity_dT",
25  "Property name of the derivative of the diffusivity with respect "
26  "to the variable (Default: thermal_conductivity_dT)");
27  params.set<bool>("use_displaced_mesh") = true;
28  return params;
29 }
30 
31 HeatConductionKernel::HeatConductionKernel(const InputParameters & parameters)
32  : Diffusion(parameters),
33  _diffusion_coefficient(getMaterialProperty<Real>("diffusion_coefficient")),
34  _diffusion_coefficient_dT(hasMaterialProperty<Real>("diffusion_coefficient_dT")
35  ? &getMaterialProperty<Real>("diffusion_coefficient_dT")
36  : NULL)
37 {
38 }
39 
40 Real
42 {
43  return _diffusion_coefficient[_qp] * Diffusion::computeQpResidual();
44 }
45 
46 Real
48 {
49  Real jac = _diffusion_coefficient[_qp] * Diffusion::computeQpJacobian();
51  jac += (*_diffusion_coefficient_dT)[_qp] * _phi[_j][_qp] * Diffusion::computeQpResidual();
52  return jac;
53 }
HeatConductionKernel(const InputParameters &parameters)
virtual Real computeQpResidual()
InputParameters validParams< HeatConductionKernel >()
const MaterialProperty< Real > & _diffusion_coefficient
virtual Real computeQpJacobian()
const MaterialProperty< Real > *const _diffusion_coefficient_dT