www.mooseframework.org
RichardsSeff2gasVGshifted.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 // shifted van-Genuchten gas effective saturation as a function of (Pwater, Pgas), and its derivs
9 // wrt to that pressure
10 //
12 
13 template <>
14 InputParameters
16 {
17  InputParameters params = validParams<RichardsSeff>();
18  params.addRequiredRangeCheckedParam<Real>(
19  "al",
20  "al > 0",
21  "van-Genuchten alpha parameter. Must be positive. seff = (1 + "
22  "(-al*(P0-P1-shift))^(1/(1-m)))^(-m) (then scaled to 0 to 1)");
23  params.addRequiredRangeCheckedParam<Real>(
24  "m",
25  "m > 0 & m < 1",
26  "van-Genuchten m parameter. Must be between 0 and 1, and optimally "
27  "should be set to >0.5 seff = (1 + "
28  "(-al*(P0-P1-shift)^(1/(1-m)))^(-m) (then scaled to 0 to 1)");
29  params.addRequiredRangeCheckedParam<Real>(
30  "shift",
31  "shift > 0",
32  "Shift in capillary-pressure porepressure values. Standard "
33  "van-Genuchten Seff = Seff(Pwater-Pgas) is shifted to the right, and "
34  "then scaled to 0<=Seff<=1. This means that dS/dP>0 at S=1 which is "
35  "useful to provide nonsingular Jacobians for small dt.");
36  params.addClassDescription("Shifted van-Genuchten effective saturation as a function of (Pwater, "
37  "Pgas) suitable for use for the gas phase in two-phase simulations. "
38  " seff = (1 + (-al*(P0-p1-shift))^(1/(1-m)))^(-m), then scaled so it "
39  "runs between 0 and 1.");
40  return params;
41 }
42 
43 RichardsSeff2gasVGshifted::RichardsSeff2gasVGshifted(const InputParameters & parameters)
44  : RichardsSeff(parameters),
45  _al(getParam<Real>("al")),
46  _m(getParam<Real>("m")),
47  _shift(getParam<Real>("shift"))
48 {
50 }
51 
52 Real
53 RichardsSeff2gasVGshifted::seff(std::vector<const VariableValue *> p, unsigned int qp) const
54 {
55  Real negpc = (*p[0])[qp] - (*p[1])[qp];
56  negpc = negpc - _shift;
57  return std::max(1 - RichardsSeffVG::seff(negpc, _al, _m) / _scale, 0.0);
58 }
59 
60 void
61 RichardsSeff2gasVGshifted::dseff(std::vector<const VariableValue *> p,
62  unsigned int qp,
63  std::vector<Real> & result) const
64 {
65  Real negpc = (*p[0])[qp] - (*p[1])[qp];
66  negpc = negpc - _shift;
67  result[0] = -RichardsSeffVG::dseff(negpc, _al, _m) / _scale;
68  result[1] = -result[0];
69 }
70 
71 void
72 RichardsSeff2gasVGshifted::d2seff(std::vector<const VariableValue *> p,
73  unsigned int qp,
74  std::vector<std::vector<Real>> & result) const
75 {
76  Real negpc = (*p[0])[qp] - (*p[1])[qp];
77  negpc = negpc - _shift;
78  result[0][0] = -RichardsSeffVG::d2seff(negpc, _al, _m) / _scale;
79  result[0][1] = -result[0][0];
80  result[1][0] = -result[0][0];
81  result[1][1] = result[0][0];
82 }
Real seff(std::vector< const VariableValue * > p, unsigned int qp) const
gas 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
Real _al
van Genuchten alpha parameter
RichardsSeff2gasVGshifted(const InputParameters &parameters)
Base class for effective saturation as a function of porepressure(s) The functions seff...
Definition: RichardsSeff.h:22
static Real dseff(Real p, Real al, Real m)
derivative of effective saturation wrt porepressure
static Real seff(Real p, Real al, Real m)
effective saturation as a fcn of porepressure
InputParameters validParams< RichardsSeff >()
Definition: RichardsSeff.C:14
InputParameters validParams< RichardsSeff2gasVGshifted >()
Real _m
van Genuchten m parameter
static Real d2seff(Real p, Real al, Real m)
2nd derivative of effective saturation wrt porepressure
void dseff(std::vector< const VariableValue * > p, unsigned int qp, std::vector< Real > &result) const
derivative of effective saturation as a function of porepressure