LCOV - code coverage report
Current view: top level - src/kernels - HeatConduction.C (source / functions) Hit Total Coverage
Test: idaholab/moose heat_transfer: #32971 (54bef8) with base c6cf66 Lines: 20 21 95.2 %
Date: 2026-05-29 20:37:03 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        2445 : HeatConductionKernel::validParams()
      17             : {
      18        2445 :   InputParameters params = Diffusion::validParams();
      19        2445 :   params.addClassDescription("Diffusive heat conduction term $-\\nabla\\cdot(k\\nabla T)$ of the "
      20             :                              "thermal energy conservation equation");
      21        4890 :   params.addParam<MaterialPropertyName>("diffusion_coefficient",
      22             :                                         "thermal_conductivity",
      23             :                                         "Property name of the diffusion coefficient");
      24        4890 :   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        2445 :   params.set<bool>("use_displaced_mesh") = true;
      30        2445 :   return params;
      31           0 : }
      32             : 
      33        1289 : HeatConductionKernel::HeatConductionKernel(const InputParameters & parameters)
      34             :   : Diffusion(parameters),
      35        1289 :     _diffusion_coefficient(getMaterialProperty<Real>("diffusion_coefficient")),
      36        1289 :     _diffusion_coefficient_dT(hasMaterialProperty<Real>("diffusion_coefficient_dT")
      37        2893 :                                   ? &getMaterialProperty<Real>("diffusion_coefficient_dT")
      38        1289 :                                   : NULL)
      39             : {
      40        1289 : }
      41             : 
      42             : Real
      43   384860540 : HeatConductionKernel::computeQpResidual()
      44             : {
      45   384860540 :   return _diffusion_coefficient[_qp] * Diffusion::computeQpResidual();
      46             : }
      47             : 
      48             : Real
      49   781921200 : HeatConductionKernel::computeQpJacobian()
      50             : {
      51   781921200 :   Real jac = _diffusion_coefficient[_qp] * Diffusion::computeQpJacobian();
      52   781921200 :   if (_diffusion_coefficient_dT)
      53   598922998 :     jac += (*_diffusion_coefficient_dT)[_qp] * _phi[_j][_qp] * Diffusion::computeQpResidual();
      54   781921200 :   return jac;
      55             : }

Generated by: LCOV version 1.14