LCOV - code coverage report
Current view: top level - src/materials - PorousFlowRelativePermeabilityBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #31405 (292dce) with base fef103 Lines: 18 19 94.7 %
Date: 2025-09-04 07:55:56 Functions: 8 8 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 "PorousFlowRelativePermeabilityBC.h"
      11             : #include "PorousFlowBrooksCorey.h"
      12             : 
      13             : registerMooseObject("PorousFlowApp", PorousFlowRelativePermeabilityBC);
      14             : registerMooseObject("PorousFlowApp", ADPorousFlowRelativePermeabilityBC);
      15             : 
      16             : template <bool is_ad>
      17             : InputParameters
      18        2655 : PorousFlowRelativePermeabilityBCTempl<is_ad>::validParams()
      19             : {
      20        2655 :   InputParameters params = PorousFlowRelativePermeabilityBaseTempl<is_ad>::validParams();
      21        5310 :   params.addRequiredParam<Real>("lambda", "The Brooks-Corey exponent of the phase");
      22        5310 :   params.addParam<bool>("nw_phase", false, "Set true if this is the non-wetting phase");
      23        2655 :   params.addClassDescription("Brooks-Corey relative permeability");
      24        2655 :   return params;
      25           0 : }
      26             : 
      27             : template <bool is_ad>
      28        2061 : PorousFlowRelativePermeabilityBCTempl<is_ad>::PorousFlowRelativePermeabilityBCTempl(
      29             :     const InputParameters & parameters)
      30             :   : PorousFlowRelativePermeabilityBaseTempl<is_ad>(parameters),
      31        2061 :     _lambda(this->template getParam<Real>("lambda")),
      32        6183 :     _is_nonwetting(this->template getParam<bool>("nw_phase"))
      33             : {
      34        2061 : }
      35             : 
      36             : template <bool is_ad>
      37             : GenericReal<is_ad>
      38      399492 : PorousFlowRelativePermeabilityBCTempl<is_ad>::relativePermeability(GenericReal<is_ad> seff) const
      39             : {
      40      399492 :   if (_is_nonwetting)
      41      225894 :     return PorousFlowBrooksCorey::relativePermeabilityNW(seff, _lambda);
      42             :   else
      43      173598 :     return PorousFlowBrooksCorey::relativePermeabilityW(seff, _lambda);
      44             : }
      45             : 
      46             : template <bool is_ad>
      47             : Real
      48      399492 : PorousFlowRelativePermeabilityBCTempl<is_ad>::dRelativePermeability(Real seff) const
      49             : {
      50      399492 :   if (_is_nonwetting)
      51      225894 :     return PorousFlowBrooksCorey::dRelativePermeabilityNW(seff, _lambda);
      52             :   else
      53      173598 :     return PorousFlowBrooksCorey::dRelativePermeabilityW(seff, _lambda);
      54             : }
      55             : 
      56             : template class PorousFlowRelativePermeabilityBCTempl<false>;
      57             : template class PorousFlowRelativePermeabilityBCTempl<true>;

Generated by: LCOV version 1.14