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