www.mooseframework.org
RichardsSeffVG.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 effective saturation as a function of pressure (not capillary pressure)
9 //
10 #include "RichardsSeffVG.h"
11 
12 Real
13 RichardsSeffVG::seff(Real p, Real al, Real m)
14 {
15  Real n, seff;
16 
17  if (p >= 0)
18  return 1.0;
19  else
20  {
21  n = 1.0 / (1.0 - m);
22  seff = 1 + std::pow(-al * p, n);
23  return std::pow(seff, -m);
24  }
25 }
26 
27 Real
28 RichardsSeffVG::dseff(Real p, Real al, Real m)
29 {
30  if (p >= 0)
31  return 0.0;
32  else
33  {
34  Real n = 1.0 / (1.0 - m);
35  Real inner = 1 + std::pow(-al * p, n);
36  Real dinner_dp = -n * al * std::pow(-al * p, n - 1);
37  Real dseff_dp = -m * std::pow(inner, -m - 1) * dinner_dp;
38  return dseff_dp;
39  }
40 }
41 
42 Real
43 RichardsSeffVG::d2seff(Real p, Real al, Real m)
44 {
45  if (p >= 0)
46  return 0.0;
47  else
48  {
49  Real n = 1.0 / (1.0 - m);
50  Real inner = 1 + std::pow(-al * p, n);
51  Real dinner_dp = -n * al * std::pow(-al * p, n - 1);
52  Real d2inner_dp2 = n * (n - 1) * al * al * std::pow(-al * p, n - 2);
53  Real d2seff_dp2 = m * (m + 1) * std::pow(inner, -m - 2) * std::pow(dinner_dp, 2) -
54  m * std::pow(inner, -m - 1) * d2inner_dp2;
55  return d2seff_dp2;
56  }
57 }
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
static Real d2seff(Real p, Real al, Real m)
2nd derivative of effective saturation wrt porepressure
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)