www.mooseframework.org
RichardsSeff2waterRSC.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 water 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 "RichardsSeff2waterRSC.h"
16 
17 template <>
18 InputParameters
20 {
21  InputParameters params = validParams<RichardsSeff>();
22  params.addRequiredParam<Real>(
23  "oil_viscosity",
24  "Viscosity of oil (gas) phase. It is assumed this is double the water-phase viscosity");
25  params.addRequiredParam<Real>("scale_ratio",
26  "This is porosity/permeability/beta^2, where beta "
27  "may be chosen by the user (RSC define beta<0, but "
28  "MOOSE only uses beta^2, so its sign is "
29  "irrelevant). It has dimensions [time]");
30  params.addRequiredParam<Real>("shift", "effective saturation is a function of (Pc - shift)");
31  params.addClassDescription("Rogers-Stallybrass-Clements version of effective saturation for the "
32  "water phase, valid for residual saturations = 0, and viscosityOil = "
33  "2*viscosityWater. seff_water = 1/Sqrt(1 + Exp(Pc - shift)/scale)), "
34  "where scale = 0.25*scale_ratio*oil_viscosity");
35  return params;
36 }
37 
38 RichardsSeff2waterRSC::RichardsSeff2waterRSC(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 RichardsSeff2waterRSC::seff(std::vector<const VariableValue *> p, unsigned int qp) const
49 {
50  Real pc = (*p[1])[qp] - (*p[0])[qp];
51  return RichardsSeffRSC::seff(pc, _shift, _scale);
52 }
53 
54 void
55 RichardsSeff2waterRSC::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 RichardsSeff2waterRSC::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 }
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 d2seff(Real pc, Real shift, Real scale)
2nd derivative of effective saturation wrt capillary pressure
Real seff(std::vector< const VariableValue * > p, unsigned int qp) const
water effective saturation
Base class for effective saturation as a function of porepressure(s) The functions seff...
Definition: RichardsSeff.h:22
RichardsSeff2waterRSC(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
InputParameters validParams< RichardsSeff >()
Definition: RichardsSeff.C:14
static Real seff(Real pc, Real shift, Real scale)
effective saturation as a function of capillary pressure
static Real dseff(Real pc, Real shift, Real scale)
derivative of effective saturation wrt capillary pressure
InputParameters validParams< RichardsSeff2waterRSC >()