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 21171185 : PorousFlowRelativePermeabilityCoreyTempl<is_ad>::relativePermeability(GenericReal<is_ad> seff) const 37 : { 38 21171185 : return std::pow(seff, _n); 39 : } 40 : 41 : template <bool is_ad> 42 : Real 43 21171185 : PorousFlowRelativePermeabilityCoreyTempl<is_ad>::dRelativePermeability(Real seff) const 44 : { 45 21171185 : return _n * std::pow(seff, _n - 1.0); 46 : } 47 : 48 : template class PorousFlowRelativePermeabilityCoreyTempl<false>; 49 : template class PorousFlowRelativePermeabilityCoreyTempl<true>;