https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Functions | Variables
PorousFlowBrooksCoreyTest.C File Reference

Go to the source code of this file.

Functions

 TEST (PorousFlowBrooksCoreyTest, sat)
 
 TEST (PorousFlowBrooksCoreyTest, dsat)
 
 TEST (PorousFlowBrooksCoreyTest, d2sat)
 
 TEST (PorousFlowBrooksCoreyTest, cap)
 
 TEST (PorousFlowBrooksCoreyTest, dcap)
 
 TEST (PorousFlowBrooksCoreyTest, d2cap)
 
 TEST (PorousFlowBrooksCoreyTest, relpermw)
 
 TEST (PorousFlowBrooksCoreyTest, drelpermw)
 
 TEST (PorousFlowBrooksCoreyTest, relpermnw)
 
 TEST (PorousFlowBrooksCoreyTest, drelpermnw)
 
 TEST (PorousFlowBrooksCoreyTest, adrelpermw)
 
 TEST (PorousFlowBrooksCoreyTest, adrelpermnw)
 

Variables

const Real eps = 1.0e-8
 
const Real tol = 1.0e-6
 

Function Documentation

◆ TEST() [1/12]

TEST ( PorousFlowBrooksCoreyTest  ,
adrelpermnw   
)

Definition at line 136 of file PorousFlowBrooksCoreyTest.C.

137{
138 ADReal sat = 0.3;
139 Moose::derivInsert(sat.derivatives(), 0, 1.0);
140
141 const auto adrelperm = PorousFlowBrooksCorey::relativePermeabilityNW(sat, 2.5);
142
143 const auto relperm = PorousFlowBrooksCorey::relativePermeabilityNW(sat.value(), 2.5);
144 const auto drelperm = PorousFlowBrooksCorey::dRelativePermeabilityNW(sat.value(), 2.5);
145
146 EXPECT_NEAR(adrelperm.value(), relperm, tol);
147 EXPECT_NEAR(adrelperm.derivatives()[0], drelperm, tol);
148}
DualNumber< Real, DNDerivativeType, true > ADReal
const Real tol
void derivInsert(SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N > > &derivs, libMesh::dof_id_type index, Real value)
Real dRelativePermeabilityNW(Real seff, Real lambda)
Derivative of relative permeability of the non-wetting phase wrt to effective saturation.
T relativePermeabilityNW(const T &seff, Real lambda)
Relative permeability of the non-wetting phase as a function of effective saturation.

◆ TEST() [2/12]

TEST ( PorousFlowBrooksCoreyTest  ,
adrelpermw   
)

Definition at line 122 of file PorousFlowBrooksCoreyTest.C.

123{
124 ADReal sat = 0.3;
125 Moose::derivInsert(sat.derivatives(), 0, 1.0);
126
127 const auto adrelperm = PorousFlowBrooksCorey::relativePermeabilityW(sat, 2.5);
128
129 const auto relperm = PorousFlowBrooksCorey::relativePermeabilityW(sat.value(), 2.5);
130 const auto drelperm = PorousFlowBrooksCorey::dRelativePermeabilityW(sat.value(), 2.5);
131
132 EXPECT_NEAR(adrelperm.value(), relperm, tol);
133 EXPECT_NEAR(adrelperm.derivatives()[0], drelperm, tol);
134}
T relativePermeabilityW(const T &seff, Real lambda)
Relative permeability of the wetting phase as a function of effective saturation.
Real dRelativePermeabilityW(Real seff, Real lambda)
Derivative of relative permeability of the wetting phase wrt to effective saturation.

◆ TEST() [3/12]

TEST ( PorousFlowBrooksCoreyTest  ,
cap   
)

Definition at line 53 of file PorousFlowBrooksCoreyTest.C.

54{
55 EXPECT_NEAR(1.2, PorousFlowBrooksCorey::capillaryPressure(1.3, 1.2, 2.0, 1.0e9), tol);
56 const Real pc = 1.2 * std::pow(0.3, -1.0 / 2.0);
57 EXPECT_NEAR(pc, PorousFlowBrooksCorey::capillaryPressure(0.3, 1.2, 2.0, 1.0e9), tol);
58 EXPECT_NEAR(1000.0, PorousFlowBrooksCorey::capillaryPressure(0.0, 1.2, 2.0, 1000.0), tol);
59 EXPECT_NEAR(1.2, PorousFlowBrooksCorey::capillaryPressure(1.0, 1.2, 2.0, 1000.0), tol);
60}
Real capillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
Capillary pressure as a function of effective saturation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ TEST() [4/12]

TEST ( PorousFlowBrooksCoreyTest  ,
d2cap   
)

Definition at line 73 of file PorousFlowBrooksCoreyTest.C.

74{
75 Real fd;
76 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::d2CapillaryPressure(1.3, 1.2, 2.0, 1.0e9), tol);
77 fd = (PorousFlowBrooksCorey::dCapillaryPressure(0.3 + eps, 1.2, 2.0, 1.0e9) -
78 PorousFlowBrooksCorey::dCapillaryPressure(0.3, 1.2, 2.0, 1.0e9)) /
79 eps;
80 EXPECT_NEAR(fd, PorousFlowBrooksCorey::d2CapillaryPressure(0.3, 1.2, 2.0, 1.0e9), tol);
81 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::d2CapillaryPressure(1.01, 1.2, 2.0, 1.0e9), tol);
82}
const Real eps
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.

◆ TEST() [5/12]

TEST ( PorousFlowBrooksCoreyTest  ,
d2sat   
)

Definition at line 40 of file PorousFlowBrooksCoreyTest.C.

41{
42 Real fd;
43 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::d2EffectiveSaturation(0.99, 1.0, 2.0), tol);
44
47 eps;
48 EXPECT_NEAR(fd, PorousFlowBrooksCorey::d2EffectiveSaturation(2.5, 1.2, 2.0), tol);
49
50 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::d2EffectiveSaturation(1.0e9, 1.2, 2.0), tol);
51}
Real d2EffectiveSaturation(Real pc, Real pe, Real lambda)
Second derivative of effective saturation wrt porepressure.
Real dEffectiveSaturation(Real pc, Real pe, Real lambda)
Derivative of effective saturation wrt porepressure.

◆ TEST() [6/12]

TEST ( PorousFlowBrooksCoreyTest  ,
dcap   
)

Definition at line 62 of file PorousFlowBrooksCoreyTest.C.

63{
64 Real fd;
65 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::dCapillaryPressure(1.3, 1.2, 2.0, 1.0e9), tol);
66 fd = (PorousFlowBrooksCorey::capillaryPressure(0.3 + eps, 1.2, 2.0, 1.0e9) -
67 PorousFlowBrooksCorey::capillaryPressure(0.3, 1.2, 2.0, 1.0e9)) /
68 eps;
69 EXPECT_NEAR(fd, PorousFlowBrooksCorey::dCapillaryPressure(0.3, 1.2, 2.0, 1.0e9), tol);
70 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::dCapillaryPressure(1.01, 1.2, 2.0, 1.0e9), tol);
71}

◆ TEST() [7/12]

TEST ( PorousFlowBrooksCoreyTest  ,
drelpermnw   
)

Definition at line 111 of file PorousFlowBrooksCoreyTest.C.

112{
113 Real fd;
114 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::dRelativePermeabilityNW(1.1, 2.5), tol);
115 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::dRelativePermeabilityNW(-1.0, 2.5), tol);
118 eps;
119 EXPECT_NEAR(fd, PorousFlowBrooksCorey::dRelativePermeabilityNW(0.3, 2.5), tol);
120}

◆ TEST() [8/12]

TEST ( PorousFlowBrooksCoreyTest  ,
drelpermw   
)

Definition at line 92 of file PorousFlowBrooksCoreyTest.C.

93{
94 Real fd;
95 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::dRelativePermeabilityW(1.1, 2.5), tol);
96 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::dRelativePermeabilityW(-1.0, 2.5), tol);
99 eps;
100 EXPECT_NEAR(fd, PorousFlowBrooksCorey::dRelativePermeabilityW(0.3, 2.5), tol);
101}

◆ TEST() [9/12]

TEST ( PorousFlowBrooksCoreyTest  ,
dsat   
)

Definition at line 27 of file PorousFlowBrooksCoreyTest.C.

28{
29 Real fd;
30 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::dEffectiveSaturation(0.99, 1.0, 2.0), tol);
31
32 fd = (PorousFlowBrooksCorey::effectiveSaturation(2.5 + eps, 1.2, 2.0) -
34 eps;
35 EXPECT_NEAR(fd, PorousFlowBrooksCorey::dEffectiveSaturation(2.5, 1.2, 2.0), tol);
36
37 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::dEffectiveSaturation(1.0e9, 1.2, 2.0), tol);
38}
Real effectiveSaturation(Real pc, Real pe, Real lambda)
Effective saturation as a function of capillary pressure Note: seff = 1 for p >= 0.

◆ TEST() [10/12]

TEST ( PorousFlowBrooksCoreyTest  ,
relpermnw   
)

Definition at line 103 of file PorousFlowBrooksCoreyTest.C.

104{
105 EXPECT_NEAR(1.0, PorousFlowBrooksCorey::relativePermeabilityNW(1.1, 2.5), tol);
106 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::relativePermeabilityNW(-1.0, 2.5), tol);
107 const Real relperm = 0.3 * 0.3 * (1.0 - std::pow(1.0 - 0.3, (2.0 + 2.5) / 2.5));
108 EXPECT_NEAR(relperm, PorousFlowBrooksCorey::relativePermeabilityNW(0.3, 2.5), tol);
109}

◆ TEST() [11/12]

TEST ( PorousFlowBrooksCoreyTest  ,
relpermw   
)

Definition at line 84 of file PorousFlowBrooksCoreyTest.C.

85{
86 EXPECT_NEAR(1.0, PorousFlowBrooksCorey::relativePermeabilityW(1.1, 2.5), tol);
87 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::relativePermeabilityW(-1.0, 2.5), tol);
88 const Real relperm = std::pow(0.3, (2.0 + 3.0 * 2.5) / 2.5);
89 EXPECT_NEAR(relperm, PorousFlowBrooksCorey::relativePermeabilityW(0.3, 2.5), tol);
90}

◆ TEST() [12/12]

TEST ( PorousFlowBrooksCoreyTest  ,
sat   
)

Definition at line 17 of file PorousFlowBrooksCoreyTest.C.

18{
19 EXPECT_NEAR(1.0, PorousFlowBrooksCorey::effectiveSaturation(0.99, 1.0, 2.0), tol);
20 EXPECT_NEAR(1.0, PorousFlowBrooksCorey::effectiveSaturation(1.0, 1.0, 2.0), tol);
21
22 const Real seff = std::pow(2.5 / 1.2, -2.0);
23 EXPECT_NEAR(seff, PorousFlowBrooksCorey::effectiveSaturation(2.5, 1.2, 2.0), tol);
24 EXPECT_NEAR(0.0, PorousFlowBrooksCorey::effectiveSaturation(1.0e9, 1.2, 2.0), tol);
25}

Variable Documentation

◆ eps

const Real eps = 1.0e-8

Definition at line 14 of file PorousFlowBrooksCoreyTest.C.

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().

◆ tol

const Real tol = 1.0e-6

Definition at line 15 of file PorousFlowBrooksCoreyTest.C.

Referenced by TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), and TEST().