www.mooseframework.org
RichardsSeff1RSC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
22 
25 {
27  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  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  params.addParam<Real>("shift", "effective saturation is a function of (Pc - shift)");
36  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  return params;
42 }
43 
45  : RichardsSeff(parameters),
46  _oil_viscosity(getParam<Real>("oil_viscosity")),
47  _scale_ratio(getParam<Real>("scale_ratio")),
48  _shift(getParam<Real>("shift")),
49  _scale(0.25 * _scale_ratio * _oil_viscosity)
50 {
51 }
52 
53 Real
54 RichardsSeff1RSC::seff(std::vector<const VariableValue *> p, unsigned int qp) const
55 {
56  Real pc = -(*p[0])[qp];
57  return RichardsSeffRSC::seff(pc, _shift, _scale);
58 }
59 
60 void
61 RichardsSeff1RSC::dseff(std::vector<const VariableValue *> p,
62  unsigned int qp,
63  std::vector<Real> & result) const
64 {
65  Real pc = -(*p[0])[qp];
66  result[0] = -RichardsSeffRSC::dseff(pc, _shift, _scale);
67 }
68 
69 void
70 RichardsSeff1RSC::d2seff(std::vector<const VariableValue *> p,
71  unsigned int qp,
72  std::vector<std::vector<Real>> & result) const
73 {
74  Real pc = -(*p[0])[qp];
75  result[0][0] = RichardsSeffRSC::d2seff(pc, _shift, _scale);
76 }
registerMooseObject("RichardsApp", RichardsSeff1RSC)
static Real d2seff(Real pc, Real shift, Real scale)
2nd derivative of effective saturation wrt capillary pressure
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
Base class for effective saturation as a function of porepressure(s) The functions seff...
Definition: RichardsSeff.h:18
static InputParameters validParams()
Definition: RichardsSeff.C:15
Rogers-Stallybrass-Clements version of effective saturation for single-phase simulations as a functio...
void d2seff(std::vector< const VariableValue *> p, unsigned int qp, std::vector< std::vector< Real >> &result) const
second derivative of effective saturation as a function of porepressure
Real _shift
RSC shift.
RichardsSeff1RSC(const InputParameters &parameters)
void dseff(std::vector< const VariableValue *> p, unsigned int qp, std::vector< Real > &result) const
derivative of effective saturation as a function of porepressure
static Real seff(Real pc, Real shift, Real scale)
effective saturation as a function of capillary pressure
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static Real dseff(Real pc, Real shift, Real scale)
derivative of effective saturation wrt capillary pressure
Real _scale
RSC scale.
void addClassDescription(const std::string &doc_string)
Real seff(std::vector< const VariableValue *> p, unsigned int qp) const
water effective saturation