LCOV - code coverage report
Current view: top level - src/userobjects - PorousFlowCapillaryPressureVG.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 37 37 100.0 %
Date: 2017-11-17 17:48:31 Functions: 10 10 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /****************************************************************/
       2             : /* MOOSE - Multiphysics Object Oriented Simulation Environment  */
       3             : /*                                                              */
       4             : /*          All contents are licensed under LGPL V2.1           */
       5             : /*             See LICENSE for full restrictions                */
       6             : /****************************************************************/
       7             : 
       8             : #include "PorousFlowCapillaryPressureVG.h"
       9             : #include "PorousFlowVanGenuchten.h"
      10             : 
      11             : template <>
      12             : InputParameters
      13         159 : validParams<PorousFlowCapillaryPressureVG>()
      14             : {
      15         159 :   InputParameters params = validParams<PorousFlowCapillaryPressure>();
      16         636 :   params.addRequiredRangeCheckedParam<Real>(
      17             :       "m",
      18             :       "m >= 0 & m <= 1",
      19         159 :       "van Genuchten exponent m. Must be between 0 and 1, and optimally should be set to >0.5");
      20         636 :   params.addRequiredRangeCheckedParam<Real>(
      21         159 :       "alpha", "alpha > 0", "van Genuchten parameter alpha. Must be positive");
      22         636 :   params.addRangeCheckedParam<Real>("s_scale",
      23             :                                     1.0,
      24             :                                     "s_scale > 0.0 & s_scale <= 1.0",
      25             :                                     "CapillaryPressure = f(Seff * s_scale) - "
      26             :                                     "f(s_scale), where f is the van Genuchten "
      27             :                                     "expression.  Setting s_scale<1 is unusual "
      28             :                                     "but sometimes helps fully saturated, "
      29             :                                     "2-phase PP simulations converge as the "
      30         159 :                                     "zero derivative (1/f'(S=1)=0) is removed");
      31         318 :   params.addClassDescription("van Genuchten capillary pressure");
      32         159 :   return params;
      33             : }
      34             : 
      35         159 : PorousFlowCapillaryPressureVG::PorousFlowCapillaryPressureVG(const InputParameters & parameters)
      36             :   : PorousFlowCapillaryPressure(parameters),
      37         477 :     _m(getParam<Real>("m")),
      38         477 :     _alpha(getParam<Real>("alpha")),
      39         477 :     _s_scale(getParam<Real>("s_scale")),
      40         795 :     _pc_sscale(PorousFlowVanGenuchten::capillaryPressure(_s_scale, _alpha, _m, _pc_max))
      41             : {
      42         159 : }
      43             : 
      44             : Real
      45       64990 : PorousFlowCapillaryPressureVG::capillaryPressureCurve(Real saturation) const
      46             : {
      47       64990 :   const Real seff = effectiveSaturationFromSaturation(saturation) * _s_scale;
      48       64990 :   return PorousFlowVanGenuchten::capillaryPressure(seff, _alpha, _m, _pc_max) - _pc_sscale;
      49             : }
      50             : 
      51             : Real
      52       61475 : PorousFlowCapillaryPressureVG::dCapillaryPressureCurve(Real saturation) const
      53             : {
      54       61475 :   const Real seff = effectiveSaturationFromSaturation(saturation) * _s_scale;
      55       61475 :   return PorousFlowVanGenuchten::dCapillaryPressure(seff, _alpha, _m, _pc_max) * _dseff_ds *
      56       61475 :          _s_scale;
      57             : }
      58             : 
      59             : Real
      60       36397 : PorousFlowCapillaryPressureVG::d2CapillaryPressureCurve(Real saturation) const
      61             : {
      62       36397 :   const Real seff = effectiveSaturationFromSaturation(saturation) * _s_scale;
      63       36397 :   return PorousFlowVanGenuchten::d2CapillaryPressure(seff, _alpha, _m, _pc_max) * _dseff_ds *
      64       36397 :          _dseff_ds * _s_scale * _s_scale;
      65             : }
      66             : 
      67             : Real
      68     5989792 : PorousFlowCapillaryPressureVG::effectiveSaturation(Real pc) const
      69             : {
      70     5989792 :   return (1.0 / _s_scale) *
      71     5989792 :          PorousFlowVanGenuchten::effectiveSaturation(pc - _pc_sscale, _alpha, _m);
      72             : }
      73             : 
      74             : Real
      75     5872660 : PorousFlowCapillaryPressureVG::dEffectiveSaturation(Real pc) const
      76             : {
      77     5872660 :   return (1.0 / _s_scale) *
      78     5872660 :          PorousFlowVanGenuchten::dEffectiveSaturation(pc - _pc_sscale, _alpha, _m);
      79             : }
      80             : 
      81             : Real
      82     2734636 : PorousFlowCapillaryPressureVG::d2EffectiveSaturation(Real pc) const
      83             : {
      84     2734636 :   return (1.0 / _s_scale) *
      85     2734636 :          PorousFlowVanGenuchten::d2EffectiveSaturation(pc - _pc_sscale, _alpha, _m);
      86        2499 : }

Generated by: LCOV version 1.11