https://mooseframework.inl.gov
RichardsSeff2gasRSC.C
Go to the documentation of this file.
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 oil (gas) 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 "RichardsSeff2gasRSC.h"
18 
20 
23 {
25  params.addParam<Real>(
26  "oil_viscosity",
27  "Viscosity of oil (gas) phase. It is assumed this is double the water-phase viscosity");
28  params.addParam<Real>("scale_ratio",
29  "This is porosity/permeability/beta^2, where beta may be "
30  "chosen by the user (RSC define beta<0, but MOOSE only uses "
31  "beta^2, so its sign is irrelevant). It has dimensions "
32  "[time]");
33  params.addParam<Real>("shift", "effective saturation is a function of (Pc - shift)");
34  params.addClassDescription("Rogers-Stallybrass-Clements version of effective saturation for the "
35  "oil (gas) phase, valid for residual saturations = 0, and "
36  "viscosityOil = 2*viscosityWater. seff_gas = 1 - 1/Sqrt(1 + Exp((Pc "
37  "- shift)/scale)), where scale = 0.25*scale_ratio*oil_viscosity");
38  return params;
39 }
40 
42  : RichardsSeff(parameters),
43  _oil_viscosity(getParam<Real>("oil_viscosity")),
44  _scale_ratio(getParam<Real>("scale_ratio")),
45  _shift(getParam<Real>("shift")),
46  _scale(0.25 * _scale_ratio * _oil_viscosity)
47 {
48 }
49 
50 Real
51 RichardsSeff2gasRSC::seff(std::vector<const VariableValue *> p, unsigned int qp) const
52 {
53  Real pc = (*p[1])[qp] - (*p[0])[qp];
54  return 1 - RichardsSeffRSC::seff(pc, _shift, _scale);
55 }
56 
57 void
58 RichardsSeff2gasRSC::dseff(std::vector<const VariableValue *> p,
59  unsigned int qp,
60  std::vector<Real> & result) const
61 {
62  Real pc = (*p[1])[qp] - (*p[0])[qp];
63  result[1] = -RichardsSeffRSC::dseff(pc, _shift, _scale);
64  result[0] = -result[1];
65 }
66 
67 void
68 RichardsSeff2gasRSC::d2seff(std::vector<const VariableValue *> p,
69  unsigned int qp,
70  std::vector<std::vector<Real>> & result) const
71 {
72  Real pc = (*p[1])[qp] - (*p[0])[qp];
73  result[1][1] = -RichardsSeffRSC::d2seff(pc, _shift, _scale);
74  result[0][1] = -result[1][1];
75  result[1][0] = -result[1][1];
76  result[0][0] = result[1][1];
77 }
static Real d2seff(Real pc, Real shift, Real scale)
2nd derivative of effective saturation wrt capillary pressure
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
registerMooseObject("RichardsApp", RichardsSeff2gasRSC)
Real _shift
RSC shift.
Real _scale
RSC scale.
RichardsSeff2gasRSC(const InputParameters &parameters)
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
Rogers-Stallybrass-Clements version of effective saturation of oil (gas) phase as a function of (Pwat...
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 InputParameters validParams()
static Real dseff(Real pc, Real shift, Real scale)
derivative of effective saturation wrt capillary pressure
void addClassDescription(const std::string &doc_string)
Real seff(std::vector< const VariableValue *> p, unsigned int qp) const
oil effective saturation
void dseff(std::vector< const VariableValue *> p, unsigned int qp, std::vector< Real > &result) const
derivative of effective saturation as a function of porepressure