LCOV - code coverage report
Current view: top level - src/userobjects - RichardsSeff1RSC.C (source / functions) Hit Total Coverage
Test: idaholab/moose richards: #31405 (292dce) with base fef103 Lines: 24 25 96.0 %
Date: 2025-09-04 07:56:35 Functions: 5 5 100.0 %
Legend: Lines: hit not hit

          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             : //  Rogers-Stallybrass-Clements version of effective saturation of water phase as a function of
      11             : //  pressure, and derivatives wrt that pressure.
      12             : //  This is mostly useful for 2phase, not single phase, models.
      13             : //  valid for residual saturations = 0, and viscosityOil = 2*viscosityWater.  (the "2" is important
      14             : //  here!).
      15             : // C Rogers, MP Stallybrass and DL Clements "On two phase filtration under gravity and with boundary
      16             : // infiltration: application of a Backlund transformation" Nonlinear Analysis Theory Methods and
      17             : // Applications 7 (1983) 785--799.
      18             : //
      19             : #include "RichardsSeff1RSC.h"
      20             : 
      21             : registerMooseObject("RichardsApp", RichardsSeff1RSC);
      22             : 
      23             : InputParameters
      24          13 : RichardsSeff1RSC::validParams()
      25             : {
      26          13 :   InputParameters params = RichardsSeff::validParams();
      27          26 :   params.addParam<Real>("oil_viscosity",
      28             :                         "Viscosity of oil (gas) phase.  It is assumed this is "
      29             :                         "double the water-phase viscosity.  (Note that this "
      30             :                         "effective saturation is mostly useful for 2-phase, not "
      31             :                         "single-phase.)");
      32          26 :   params.addParam<Real>("scale_ratio",
      33             :                         "This is porosity/permeability/beta^2, where beta may be "
      34             :                         "chosen by the user.  It has dimensions [time]");
      35          26 :   params.addParam<Real>("shift", "effective saturation is a function of (Pc - shift)");
      36          13 :   params.addClassDescription(
      37             :       "Rogers-Stallybrass-Clements version of effective saturation for the water phase, valid for "
      38             :       "residual saturations = 0, and viscosityOil = 2*viscosityWater.  seff_water = 1/Sqrt(1 + "
      39             :       "Exp((Pc - shift)/scale)), where scale = 0.25*scale_ratio*oil_viscosity.  Note that this "
      40             :       "effective saturation is mostly useful for 2-phase, not single-phase.");
      41          13 :   return params;
      42           0 : }
      43             : 
      44           6 : RichardsSeff1RSC::RichardsSeff1RSC(const InputParameters & parameters)
      45             :   : RichardsSeff(parameters),
      46           6 :     _oil_viscosity(getParam<Real>("oil_viscosity")),
      47          12 :     _scale_ratio(getParam<Real>("scale_ratio")),
      48          12 :     _shift(getParam<Real>("shift")),
      49           6 :     _scale(0.25 * _scale_ratio * _oil_viscosity)
      50             : {
      51           6 : }
      52             : 
      53             : Real
      54         606 : RichardsSeff1RSC::seff(std::vector<const VariableValue *> p, unsigned int qp) const
      55             : {
      56         606 :   Real pc = -(*p[0])[qp];
      57         606 :   return RichardsSeffRSC::seff(pc, _shift, _scale);
      58             : }
      59             : 
      60             : void
      61         606 : RichardsSeff1RSC::dseff(std::vector<const VariableValue *> p,
      62             :                         unsigned int qp,
      63             :                         std::vector<Real> & result) const
      64             : {
      65         606 :   Real pc = -(*p[0])[qp];
      66         606 :   result[0] = -RichardsSeffRSC::dseff(pc, _shift, _scale);
      67         606 : }
      68             : 
      69             : void
      70         606 : RichardsSeff1RSC::d2seff(std::vector<const VariableValue *> p,
      71             :                          unsigned int qp,
      72             :                          std::vector<std::vector<Real>> & result) const
      73             : {
      74         606 :   Real pc = -(*p[0])[qp];
      75         606 :   result[0][0] = RichardsSeffRSC::d2seff(pc, _shift, _scale);
      76         606 : }

Generated by: LCOV version 1.14