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