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