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 
23 {
25  params.addRequiredParam<Real>(
26  "oil_viscosity",
27  "Viscosity of oil (gas) phase. It is assumed this is double the water-phase viscosity");
28  params.addRequiredParam<Real>("scale_ratio",
29  "This is porosity/permeability/beta^2, where beta "
30  "may be chosen by the user (RSC define beta<0, but "
31  "MOOSE only uses beta^2, so its sign is "
32  "irrelevant). It has dimensions [time]");
33  params.addRequiredParam<Real>("shift", "effective saturation is a function of (Pc - shift)");
34  params.addClassDescription("Rogers-Stallybrass-Clements version of effective saturation for the "
35  "water phase, valid for residual saturations = 0, and viscosityOil = "
36  "2*viscosityWater. seff_water = 1/Sqrt(1 + Exp(Pc - shift)/scale)), "
37  "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 RichardsSeff2waterRSC::seff(std::vector<const VariableValue *> p, unsigned int qp) const
52 {
53  Real pc = (*p[1])[qp] - (*p[0])[qp];
54  return RichardsSeffRSC::seff(pc, _shift, _scale);
55 }
56 
57 void
58 RichardsSeff2waterRSC::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 RichardsSeff2waterRSC::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
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
void dseff(std::vector< const VariableValue *> p, unsigned int qp, std::vector< Real > &result) const
derivative of effective saturation as a function of porepressure
registerMooseObject("RichardsApp", RichardsSeff2waterRSC)
static InputParameters validParams()
RichardsSeff2waterRSC(const InputParameters &parameters)
void addRequiredParam(const std::string &name, const std::string &doc_string)
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 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
Rogers-Stallybrass-Clements version of effective saturation of water phase as a function of (Pwater...
Real seff(std::vector< const VariableValue *> p, unsigned int qp) const
water effective saturation
static Real dseff(Real pc, Real shift, Real scale)
derivative of effective saturation wrt capillary pressure
void addClassDescription(const std::string &doc_string)