www.mooseframework.org
RichardsSeff2gasVG.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 // van-Genuchten gas effective saturation as a function of (Pwater, Pgas), and its derivs wrt to
9 // that pressure
10 //
11 #include "RichardsSeff2gasVG.h"
12 
13 template <>
14 InputParameters
16 {
17  InputParameters params = validParams<RichardsSeff>();
18  params.addRequiredRangeCheckedParam<Real>("al",
19  "al > 0",
20  "van-Genuchten alpha parameter. Must "
21  "be positive. Single-phase VG seff = "
22  "(1 + (-al*c)^(1/(1-m)))^(-m)");
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 Single-phase VG seff = (1 + "
28  "(-al*p)^(1/(1-m)))^(-m)");
29  params.addClassDescription("van-Genuchten effective saturation as a function of (Pwater, Pgas) "
30  "suitable for use for the gas phase in two-phase simulations. With "
31  "Pc=Pgas-Pwater, seff = 1 - (1 + (al*pc)^(1/(1-m)))^(-m)");
32  return params;
33 }
34 
35 RichardsSeff2gasVG::RichardsSeff2gasVG(const InputParameters & parameters)
36  : RichardsSeff(parameters), _al(getParam<Real>("al")), _m(getParam<Real>("m"))
37 {
38 }
39 
40 Real
41 RichardsSeff2gasVG::seff(std::vector<const VariableValue *> p, unsigned int qp) const
42 {
43  Real negpc = (*p[0])[qp] - (*p[1])[qp];
44  return 1 - RichardsSeffVG::seff(negpc, _al, _m);
45 }
46 
47 void
48 RichardsSeff2gasVG::dseff(std::vector<const VariableValue *> p,
49  unsigned int qp,
50  std::vector<Real> & result) const
51 {
52  Real negpc = (*p[0])[qp] - (*p[1])[qp];
53  result[0] = -RichardsSeffVG::dseff(negpc, _al, _m);
54  result[1] = -result[0];
55 }
56 
57 void
58 RichardsSeff2gasVG::d2seff(std::vector<const VariableValue *> p,
59  unsigned int qp,
60  std::vector<std::vector<Real>> & result) const
61 {
62  Real negpc = (*p[0])[qp] - (*p[1])[qp];
63  result[0][0] = -RichardsSeffVG::d2seff(negpc, _al, _m);
64  result[0][1] = -result[0][0];
65  result[1][0] = -result[0][0];
66  result[1][1] = result[0][0];
67 }
Real _m
van Genuchten m parameter
Real seff(std::vector< const VariableValue * > p, unsigned int qp) const
gas effective saturation
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
RichardsSeff2gasVG(const InputParameters &parameters)
static Real seff(Real p, Real al, Real m)
effective saturation as a fcn of 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
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
InputParameters validParams< RichardsSeff2gasVG >()
InputParameters validParams< RichardsSeff >()
Definition: RichardsSeff.C:14
static Real d2seff(Real p, Real al, Real m)
2nd derivative of effective saturation wrt porepressure
Real _al
van Genuchten alpha parameter