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