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