LCOV - code coverage report
Current view: top level - src/kernels - HeatConduction.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #33187 (5aa0b2) with base d7c4bd Lines: 22 23 95.7 %
Date: 2026-06-30 12:20:37 Functions: 4 4 100.0 %
Legend: Lines: hit not hit

          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        2447 : HeatConductionKernel::validParams()
      17             : {
      18        2447 :   InputParameters params = Diffusion::validParams();
      19        2447 :   params.addClassDescription("Diffusive heat conduction term $-\\nabla\\cdot(k\\nabla T)$ of the "
      20             :                              "thermal energy conservation equation");
      21        4894 :   params.addParam<MaterialPropertyName>(
      22             :       "diffusion_coefficient", "thermal_conductivity", "Property name of the thermal conductivity");
      23        4894 :   params.deprecateParam("diffusion_coefficient", "thermal_conductivity", "07/01/2027");
      24        4894 :   params.addParam<MaterialPropertyName>(
      25             :       "diffusion_coefficient_dT",
      26             :       "thermal_conductivity_dT",
      27             :       "Property name of the derivative of the thermal conductivity with respect to the variable");
      28        4894 :   params.deprecateParam("diffusion_coefficient_dT", "thermal_conductivity_dT", "07/01/2027");
      29        2447 :   params.set<bool>("use_displaced_mesh") = true;
      30        2447 :   return params;
      31           0 : }
      32             : 
      33        1289 : HeatConductionKernel::HeatConductionKernel(const InputParameters & parameters)
      34             :   : Diffusion(parameters),
      35        1289 :     _thermal_conductivity(getMaterialProperty<Real>("thermal_conductivity")),
      36        1289 :     _thermal_conductivity_dT(hasMaterialProperty<Real>("thermal_conductivity_dT")
      37        2893 :                                  ? &getMaterialProperty<Real>("thermal_conductivity_dT")
      38        1289 :                                  : NULL)
      39             : {
      40        1289 : }
      41             : 
      42             : Real
      43   384916829 : HeatConductionKernel::computeQpResidual()
      44             : {
      45   384916829 :   return _thermal_conductivity[_qp] * Diffusion::computeQpResidual();
      46             : }
      47             : 
      48             : Real
      49   781910808 : HeatConductionKernel::computeQpJacobian()
      50             : {
      51   781910808 :   Real jac = _thermal_conductivity[_qp] * Diffusion::computeQpJacobian();
      52   781910808 :   if (_thermal_conductivity_dT)
      53   598907126 :     jac += (*_thermal_conductivity_dT)[_qp] * _phi[_j][_qp] * Diffusion::computeQpResidual();
      54   781910808 :   return jac;
      55             : }

Generated by: LCOV version 1.14