LCOV - code coverage report
Current view: top level - src/kernels - PorousFlowHeatConduction.C (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #31405 (292dce) with base fef103 Lines: 26 27 96.3 %
Date: 2025-09-04 07:55:56 Functions: 5 5 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 "PorousFlowHeatConduction.h"
      11             : 
      12             : #include "MooseVariable.h"
      13             : 
      14             : registerMooseObject("PorousFlowApp", PorousFlowHeatConduction);
      15             : 
      16             : InputParameters
      17        1301 : PorousFlowHeatConduction::validParams()
      18             : {
      19        1301 :   InputParameters params = Kernel::validParams();
      20        2602 :   params.addRequiredParam<UserObjectName>(
      21             :       "PorousFlowDictator", "The UserObject that holds the list of PorousFlow variable names");
      22        1301 :   params.addClassDescription("Heat conduction in the Porous Flow module");
      23        1301 :   return params;
      24           0 : }
      25             : 
      26         700 : PorousFlowHeatConduction::PorousFlowHeatConduction(const InputParameters & parameters)
      27             :   : Kernel(parameters),
      28         700 :     _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
      29        1400 :     _la(getMaterialProperty<RealTensorValue>("PorousFlow_thermal_conductivity_qp")),
      30        1400 :     _dla_dvar(getMaterialProperty<std::vector<RealTensorValue>>(
      31             :         "dPorousFlow_thermal_conductivity_qp_dvar")),
      32        1400 :     _grad_t(getMaterialProperty<RealGradient>("PorousFlow_grad_temperature_qp")),
      33         700 :     _dgrad_t_dvar(
      34         700 :         getMaterialProperty<std::vector<RealGradient>>("dPorousFlow_grad_temperature_qp_dvar")),
      35         700 :     _dgrad_t_dgradvar(
      36        1400 :         getMaterialProperty<std::vector<Real>>("dPorousFlow_grad_temperature_qp_dgradvar"))
      37             : {
      38         700 : }
      39             : 
      40             : Real
      41     8680452 : PorousFlowHeatConduction::computeQpResidual()
      42             : {
      43     8680452 :   return _grad_test[_i][_qp] * (_la[_qp] * _grad_t[_qp]);
      44             : }
      45             : 
      46             : Real
      47    36769256 : PorousFlowHeatConduction::computeQpJacobian()
      48             : {
      49    36769256 :   return computeQpOffDiagJacobian(_var.number());
      50             : }
      51             : 
      52             : Real
      53   114224528 : PorousFlowHeatConduction::computeQpOffDiagJacobian(unsigned int jvar)
      54             : {
      55   114224528 :   if (_dictator.notPorousFlowVariable(jvar))
      56             :     return 0.0;
      57             : 
      58             :   // The PorousFlow variable index corresponding to the variable number jvar
      59   114224528 :   const unsigned int pvar = _dictator.porousFlowVariableNum(jvar);
      60             : 
      61   114224528 :   return _grad_test[_i][_qp] *
      62   114224528 :          ((_dla_dvar[_qp][pvar] * _grad_t[_qp] + _la[_qp] * _dgrad_t_dvar[_qp][pvar]) *
      63   114224528 :               _phi[_j][_qp] +
      64   114224528 :           _la[_qp] * _dgrad_t_dgradvar[_qp][pvar] * _grad_phi[_j][_qp]);
      65             : }

Generated by: LCOV version 1.14