www.mooseframework.org
PorousFlowBrooksCorey.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 
9 //#include "libmesh/utility.h"
10 
11 namespace PorousFlowBrooksCorey
12 {
13 Real
14 effectiveSaturation(Real pc, Real pe, Real lambda)
15 {
16  if (pc < pe)
17  return 1.0;
18  else
19  return std::pow(pc / pe, -lambda);
20 }
21 
22 Real
23 dEffectiveSaturation(Real pc, Real pe, Real lambda)
24 {
25  if (pc < pe)
26  return 0.0;
27  else
28  return -lambda * std::pow(pc / pe, -lambda - 1.0) / pe;
29 }
30 
31 Real
32 d2EffectiveSaturation(Real pc, Real pe, Real lambda)
33 {
34  if (pc < pe)
35  return 0.0;
36  else
37  return lambda * (lambda + 1.0) * std::pow(pc / pe, -lambda - 2.0) / pe / pe;
38 }
39 
40 Real
41 capillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
42 {
43  if (seff >= 1.0)
44  return 0.0;
45  else if (seff <= 0.0)
46  return pc_max;
47  else
48  return std::min(pe * std::pow(seff, -1.0 / lambda), pc_max);
49 }
50 
51 Real
52 dCapillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
53 {
54  if (seff <= 0.0 || seff >= 1.0)
55  return 0.0;
56  else
57  {
58  // Return 0 if pc > pc_max
59  if (capillaryPressure(seff, pe, lambda, pc_max) >= pc_max)
60  return 0.0;
61  else
62  return -pe * std::pow(seff, -1.0 / lambda - 1.0) / lambda;
63  }
64 }
65 
66 Real
67 d2CapillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
68 {
69  if (seff <= 0.0 || seff >= 1.0)
70  return 0.0;
71  else
72  {
73  // Return 0 if pc > pc_max
74  if (capillaryPressure(seff, pe, lambda, pc_max) >= pc_max)
75  return 0.0;
76  else
77  return (lambda + 1.0) * pe * std::pow(seff, -1.0 / lambda - 2.0) / lambda / lambda;
78  }
79 }
80 
81 Real
82 relativePermeabilityW(Real seff, Real lambda)
83 {
84  if (seff <= 0.0)
85  return 0.0;
86  else if (seff >= 1.0)
87  return 1.0;
88 
89  return std::pow(seff, (2.0 + 3.0 * lambda) / lambda);
90 }
91 
92 Real
93 dRelativePermeabilityW(Real seff, Real lambda)
94 {
95  // Guard against division by zero
96  if (seff <= 0.0 || seff >= 1.0)
97  return 0.0;
98 
99  return (2.0 + 3.0 * lambda) * std::pow(seff, (2.0 + 2.0 * lambda) / lambda) / lambda;
100 }
101 
102 Real
103 relativePermeabilityNW(Real seff, Real lambda)
104 {
105  if (seff <= 0.0)
106  return 0.0;
107  else if (seff >= 1.0)
108  return 1.0;
109 
110  return seff * seff * (1.0 - std::pow(1.0 - seff, (2.0 + lambda) / lambda));
111 }
112 
113 Real
114 dRelativePermeabilityNW(Real seff, Real lambda)
115 {
116  // Guard against division by zero
117  if (seff <= 0.0 || seff >= 1.0)
118  return 0.0;
119 
120  return seff * (2.0 +
121  (seff * (2.0 + 3.0 * lambda) - 2.0 * lambda) * std::pow(1.0 - seff, 2.0 / lambda) /
122  lambda);
123 }
124 }
Real capillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
Capillary pressure as a function of effective saturation.
Real relativePermeabilityW(Real seff, Real lambda)
Relative permeability of the wetting phase as a function of effective saturation. ...
Real dRelativePermeabilityNW(Real seff, Real lambda)
Derivative of relative permeability of the non-wetting phase wrt to effective saturation.
Real effectiveSaturation(Real pc, Real pe, Real lambda)
Effective saturation as a function of capillary pressure Note: seff = 1 for p >= 0.
Real dCapillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
Derivative of capillary pressure wrt effective saturation.
Real d2CapillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
Second derivative of capillary pressure wrt effective saturation.
Real dEffectiveSaturation(Real pc, Real pe, Real lambda)
Derivative of effective saturation wrt porepressure.
Real dRelativePermeabilityW(Real seff, Real lambda)
Derivative of relative permeability of the wetting phase wrt to effective saturation.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
Real d2EffectiveSaturation(Real pc, Real pe, Real lambda)
Second derivative of effective saturation wrt porepressure.
Real relativePermeabilityNW(Real seff, Real lambda)
Relative permeability of the non-wetting phase as a function of effective saturation.
Brooks-Corey effective saturation, capillary pressure and relative permeability functions.