LCOV - code coverage report
Current view: top level - src/kernels - PorousFlowHeatMassTransfer.C (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #31405 (292dce) with base fef103 Lines: 22 23 95.7 %
Date: 2025-09-04 07:55:56 Functions: 6 6 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 "PorousFlowHeatMassTransfer.h"
      11             : 
      12             : #include "MooseVariable.h"
      13             : 
      14             : registerMooseObject("PorousFlowApp", PorousFlowHeatMassTransfer);
      15             : 
      16             : InputParameters
      17         443 : PorousFlowHeatMassTransfer::validParams()
      18             : {
      19         443 :   InputParameters params = Kernel::validParams();
      20             : 
      21         443 :   params.addClassDescription(
      22             :       "Calculate heat or mass transfer from a coupled variable v to the variable u. "
      23             :       "No mass lumping is performed here.");
      24         886 :   params.addRequiredCoupledVar(
      25             :       "v", "The variable which is tranfsered to u using a transfer coefficient");
      26         886 :   params.addCoupledVar("transfer_coefficient",
      27             :                        1.0,
      28             :                        "Transfer coefficient for heat or mass transferred between variables");
      29             : 
      30         443 :   return params;
      31           0 : }
      32             : 
      33         236 : PorousFlowHeatMassTransfer::PorousFlowHeatMassTransfer(const InputParameters & parameters)
      34             :   : Kernel(parameters),
      35         236 :     _v_var(coupled("v")),
      36         236 :     _v(coupledValue("v")),
      37         472 :     _coef_var(coupledValue("transfer_coefficient"))
      38             : {
      39         236 : }
      40             : 
      41             : Real
      42      653280 : PorousFlowHeatMassTransfer::computeQpResidual()
      43             : {
      44      653280 :   return _coef_var[_qp] * (_u[_qp] - _v[_qp]) * _test[_i][_qp];
      45             : }
      46             : 
      47             : Real
      48     1403000 : PorousFlowHeatMassTransfer::computeQpJacobian()
      49             : {
      50     1403000 :   return jac(_var.number());
      51             : }
      52             : 
      53             : Real
      54     1363960 : PorousFlowHeatMassTransfer::computeQpOffDiagJacobian(unsigned int jvar)
      55             : {
      56     1363960 :   return jac(jvar);
      57             : }
      58             : 
      59             : Real
      60     2766960 : PorousFlowHeatMassTransfer::jac(unsigned int jvar) const
      61             : {
      62     2766960 :   if (jvar == _var.number())
      63     1403000 :     return _coef_var[_qp] * _phi[_j][_qp] * _test[_i][_qp];
      64     1363960 :   else if (jvar == _v_var)
      65       28480 :     return -_coef_var[_qp] * _phi[_j][_qp] * _test[_i][_qp];
      66             :   return 0.0;
      67             : }

Generated by: LCOV version 1.14