LCOV - code coverage report
Current view: top level - src/materials - PorousFlow2PhasePS_VG.C (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 1 31 3.2 %
Date: 2017-11-18 13:30:36 Functions: 2 7 28.6 %
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 "PorousFlow2PhasePS_VG.h"
       9             : #include "PorousFlowVanGenuchten.h"
      10             : 
      11             : #include <limits>
      12             : 
      13             : template <>
      14             : InputParameters
      15           0 : validParams<PorousFlow2PhasePS_VG>()
      16             : {
      17           0 :   InputParameters params = validParams<PorousFlow2PhasePS>();
      18           0 :   params.addRequiredRangeCheckedParam<Real>("m", "m >= 0 & m <= 1", "van Genuchten exponent m");
      19           0 :   params.addRangeCheckedParam<Real>("pc_max",
      20           0 :                                     -std::numeric_limits<Real>::max(),
      21             :                                     "pc_max <= 0",
      22             :                                     "Maximum capillary pressure (Pa). Must be <= 0. Default is "
      23           0 :                                     "-std::numeric_limits<Real>::max()");
      24           0 :   params.addRequiredRangeCheckedParam<Real>(
      25           0 :       "p0", "p0 > 0", "Capillary pressure coefficient P0. Must be > 0");
      26           0 :   params.addClassDescription("This Material calculates the 2 porepressures and the 2 saturations "
      27             :                              "in a 2-phase isothermal situation using a van Genucten capillary "
      28             :                              "pressure, and derivatives of these with respect to the "
      29           0 :                              "PorousFlowVariables");
      30           0 :   return params;
      31             : }
      32             : 
      33           0 : PorousFlow2PhasePS_VG::PorousFlow2PhasePS_VG(const InputParameters & parameters)
      34             :   : PorousFlow2PhasePS(parameters),
      35             : 
      36           0 :     _m(getParam<Real>("m")),
      37           0 :     _pc_max(getParam<Real>("pc_max")),
      38           0 :     _p0(getParam<Real>("p0")),
      39           0 :     _alpha(1.0 / _p0)
      40             : {
      41             :   mooseDeprecated("PorousFlow2PhasePS_VG is deprecated. Please use PorousFlow2PhasePS and a "
      42             :                   "PorousFlowCapillaryPressureVG UserObject instead");
      43             : 
      44           0 :   if (_dictator.numPhases() != 2)
      45             :     mooseError("The Dictator proclaims that the number of phases is ",
      46           0 :                _dictator.numPhases(),
      47             :                " whereas PorousFlow2PhasePS_VG can only be used for 2-phase simulation.  Be aware "
      48           0 :                "that the Dictator has noted your mistake.");
      49           0 : }
      50             : 
      51             : Real
      52           0 : PorousFlow2PhasePS_VG::capillaryPressure(Real saturation) const
      53             : {
      54           0 :   Real seff = effectiveSaturation(saturation);
      55           0 :   return PorousFlowVanGenuchten::capillaryPressure(seff, _alpha, _m, _pc_max);
      56             : }
      57             : 
      58             : Real
      59           0 : PorousFlow2PhasePS_VG::dCapillaryPressure_dS(Real saturation) const
      60             : {
      61           0 :   Real seff = effectiveSaturation(saturation);
      62           0 :   return PorousFlowVanGenuchten::dCapillaryPressure(seff, _alpha, _m, _pc_max) * _dseff_ds;
      63             : }
      64             : 
      65             : Real
      66           0 : PorousFlow2PhasePS_VG::d2CapillaryPressure_dS2(Real saturation) const
      67             : {
      68           0 :   Real seff = effectiveSaturation(saturation);
      69           0 :   return PorousFlowVanGenuchten::d2CapillaryPressure(seff, _alpha, _m, _pc_max) * _dseff_ds *
      70           0 :          _dseff_ds;
      71        2499 : }

Generated by: LCOV version 1.11