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 "PorousFlowRelativePermeabilityCorey.h" 11 : 12 : registerMooseObject("PorousFlowApp", PorousFlowRelativePermeabilityCorey); 13 : registerMooseObject("PorousFlowApp", ADPorousFlowRelativePermeabilityCorey); 14 : 15 : template <bool is_ad> 16 : InputParameters 17 24448 : PorousFlowRelativePermeabilityCoreyTempl<is_ad>::validParams() 18 : { 19 24448 : InputParameters params = PorousFlowRelativePermeabilityBaseTempl<is_ad>::validParams(); 20 48896 : params.addRequiredParam<Real>("n", "The Corey exponent of the phase."); 21 24448 : params.addClassDescription("This Material calculates relative permeability of the fluid phase, " 22 : "using the simple Corey model ((S-S_res)/(1-sum(S_res)))^n"); 23 24448 : return params; 24 0 : } 25 : 26 : template <bool is_ad> 27 19137 : PorousFlowRelativePermeabilityCoreyTempl<is_ad>::PorousFlowRelativePermeabilityCoreyTempl( 28 : const InputParameters & parameters) 29 : : PorousFlowRelativePermeabilityBaseTempl<is_ad>(parameters), 30 38274 : _n(this->template getParam<Real>("n")) 31 : { 32 19137 : } 33 : 34 : template <bool is_ad> 35 : GenericReal<is_ad> 36 21444481 : PorousFlowRelativePermeabilityCoreyTempl<is_ad>::relativePermeability(GenericReal<is_ad> seff) const 37 : { 38 : using std::pow; 39 21444481 : return pow(seff, _n); 40 : } 41 : 42 : template <bool is_ad> 43 : Real 44 21444481 : PorousFlowRelativePermeabilityCoreyTempl<is_ad>::dRelativePermeability(Real seff) const 45 : { 46 21444481 : return _n * std::pow(seff, _n - 1.0); 47 : } 48 : 49 : template class PorousFlowRelativePermeabilityCoreyTempl<false>; 50 : template class PorousFlowRelativePermeabilityCoreyTempl<true>;