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