LCOV - code coverage report
Current view: top level - include/utils - PorousFlowFLACrelperm.h (source / functions) Hit Total Coverage
Test: idaholab/moose porous_flow: #31653 (2d163b) with base 0cc44f Lines: 4 6 66.7 %
Date: 2025-11-04 20:41:30 Functions: 2 2 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             : #pragma once
      11             : 
      12             : #include "MooseTypes.h"
      13             : 
      14             : /**
      15             :  * FLAC inspired relative permeability relationship
      16             :  */
      17             : 
      18             : namespace PorousFlowFLACrelperm
      19             : {
      20             : /**
      21             :  * Relative permeability as a function of effective saturation
      22             :  * @param seff effective saturation
      23             :  * @param m van Genuchten exponent
      24             :  * @return relative permeability
      25             :  */
      26             : template <typename T>
      27             : T
      28     2929068 : relativePermeability(const T & seff, Real m)
      29             : {
      30     2929068 :   if (MetaPhysicL::raw_value(seff) <= 0.0)
      31           0 :     return 0.0;
      32     2929067 :   else if (MetaPhysicL::raw_value(seff) >= 1.0)
      33           0 :     return 1.0;
      34             : 
      35             :   using std::pow;
      36      166714 :   return (1.0 + m) * pow(seff, m) - m * pow(seff, m + 1.0);
      37             : }
      38             : 
      39             : /**
      40             :  * Derivative of relative permeability with respect to effective saturation
      41             :  * @param seff effective saturation
      42             :  * @param m van Genuchten exponent
      43             :  * @return derivative of relative permeability wrt effective saturation
      44             :  */
      45             : Real dRelativePermeability(Real seff, Real m);
      46             : 
      47             : /**
      48             :  * Second derivative of relative permeability with respect to effective saturation
      49             :  * @param seff effective saturation
      50             :  * @param m van Genuchten exponent
      51             :  * @return second derivative of relative permeability wrt effective saturation
      52             :  */
      53             : Real d2RelativePermeability(Real seff, Real m);
      54             : }

Generated by: LCOV version 1.14