10#include "gtest/gtest.h"
14const Real
eps = 1.0e-8;
15const Real
tol = 1.0e-6;
17TEST(PorousFlowBrooksCoreyTest, sat)
22 const Real seff = std::pow(2.5 / 1.2, -2.0);
27TEST(PorousFlowBrooksCoreyTest, dsat)
40TEST(PorousFlowBrooksCoreyTest, d2sat)
53TEST(PorousFlowBrooksCoreyTest, cap)
56 const Real pc = 1.2 * std::pow(0.3, -1.0 / 2.0);
62TEST(PorousFlowBrooksCoreyTest, dcap)
73TEST(PorousFlowBrooksCoreyTest, d2cap)
84TEST(PorousFlowBrooksCoreyTest, relpermw)
88 const Real relperm = std::pow(0.3, (2.0 + 3.0 * 2.5) / 2.5);
92TEST(PorousFlowBrooksCoreyTest, drelpermw)
103TEST(PorousFlowBrooksCoreyTest, relpermnw)
107 const Real relperm = 0.3 * 0.3 * (1.0 - std::pow(1.0 - 0.3, (2.0 + 2.5) / 2.5));
111TEST(PorousFlowBrooksCoreyTest, drelpermnw)
122TEST(PorousFlowBrooksCoreyTest, adrelpermw)
132 EXPECT_NEAR(adrelperm.value(), relperm,
tol);
133 EXPECT_NEAR(adrelperm.derivatives()[0], drelperm,
tol);
136TEST(PorousFlowBrooksCoreyTest, adrelpermnw)
146 EXPECT_NEAR(adrelperm.value(), relperm,
tol);
147 EXPECT_NEAR(adrelperm.derivatives()[0], drelperm,
tol);
DualNumber< Real, DNDerivativeType, true > ADReal
TEST(PorousFlowBrooksCoreyTest, sat)
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 relativePermeabilityW(const T &seff, Real lambda)
Relative permeability of the wetting phase as a function of effective saturation.
Real capillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
Capillary pressure as a function of effective saturation.
Real d2EffectiveSaturation(Real pc, Real pe, Real lambda)
Second derivative of effective saturation wrt porepressure.
Real dCapillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
Derivative of capillary pressure wrt effective saturation.
Real dRelativePermeabilityW(Real seff, Real lambda)
Derivative of relative permeability of the wetting phase wrt to effective saturation.
Real dEffectiveSaturation(Real pc, Real pe, Real lambda)
Derivative of effective saturation wrt porepressure.
Real d2CapillaryPressure(Real seff, Real pe, Real lambda, Real pc_max)
Second derivative of capillary pressure wrt effective saturation.
Real effectiveSaturation(Real pc, Real pe, Real lambda)
Effective saturation as a function of capillary pressure Note: seff = 1 for p >= 0.
T relativePermeabilityNW(const T &seff, Real lambda)
Relative permeability of the non-wetting phase as a function of effective saturation.