Line data Source code
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 : 10 : #include "HeatConduction.h" 11 : #include "MooseMesh.h" 12 : 13 : registerMooseObjectAliased("HeatTransferApp", HeatConductionKernel, "HeatConduction"); 14 : 15 : InputParameters 16 4778 : HeatConductionKernel::validParams() 17 : { 18 4778 : InputParameters params = Diffusion::validParams(); 19 4778 : params.addClassDescription("Diffusive heat conduction term $-\\nabla\\cdot(k\\nabla T)$ of the " 20 : "thermal energy conservation equation"); 21 9556 : params.addParam<MaterialPropertyName>("diffusion_coefficient", 22 : "thermal_conductivity", 23 : "Property name of the diffusion coefficient"); 24 9556 : params.addParam<MaterialPropertyName>( 25 : "diffusion_coefficient_dT", 26 : "thermal_conductivity_dT", 27 : "Property name of the derivative of the diffusion coefficient with respect " 28 : "to the variable"); 29 4778 : params.set<bool>("use_displaced_mesh") = true; 30 4778 : return params; 31 0 : } 32 : 33 2550 : HeatConductionKernel::HeatConductionKernel(const InputParameters & parameters) 34 : : Diffusion(parameters), 35 2550 : _diffusion_coefficient(getMaterialProperty<Real>("diffusion_coefficient")), 36 2550 : _diffusion_coefficient_dT(hasMaterialProperty<Real>("diffusion_coefficient_dT") 37 5912 : ? &getMaterialProperty<Real>("diffusion_coefficient_dT") 38 2550 : : NULL) 39 : { 40 2550 : } 41 : 42 : Real 43 509468875 : HeatConductionKernel::computeQpResidual() 44 : { 45 509468875 : return _diffusion_coefficient[_qp] * Diffusion::computeQpResidual(); 46 : } 47 : 48 : Real 49 935427132 : HeatConductionKernel::computeQpJacobian() 50 : { 51 935427132 : Real jac = _diffusion_coefficient[_qp] * Diffusion::computeQpJacobian(); 52 935427132 : if (_diffusion_coefficient_dT) 53 712010362 : jac += (*_diffusion_coefficient_dT)[_qp] * _phi[_j][_qp] * Diffusion::computeQpResidual(); 54 935427132 : return jac; 55 : }