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