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 2929284 : relativePermeability(const T & seff, Real m) 29 : { 30 2929284 : if (MetaPhysicL::raw_value(seff) <= 0.0) 31 0 : return 0.0; 32 2929283 : else if (MetaPhysicL::raw_value(seff) >= 1.0) 33 0 : return 1.0; 34 166498 : return (1.0 + m) * std::pow(seff, m) - m * std::pow(seff, m + 1.0); 35 : } 36 : 37 : /** 38 : * Derivative of relative permeability with respect to effective saturation 39 : * @param seff effective saturation 40 : * @param m van Genuchten exponent 41 : * @return derivative of relative permeability wrt effective saturation 42 : */ 43 : Real dRelativePermeability(Real seff, Real m); 44 : 45 : /** 46 : * Second derivative of relative permeability with respect to effective saturation 47 : * @param seff effective saturation 48 : * @param m van Genuchten exponent 49 : * @return second derivative of relative permeability wrt effective saturation 50 : */ 51 : Real d2RelativePermeability(Real seff, Real m); 52 : }