25#ifndef DUMUX_MATERIAL_FLUIDMATRIX_BROOKS_COREY_HH
26#define DUMUX_MATERIAL_FLUIDMATRIX_BROOKS_COREY_HH
48template <
class ScalarT,
class ParamsT = BrooksCoreyParams<ScalarT> >
53 using Scalar =
typename Params::Scalar;
78 swe = clamp(swe, 0.0, 1.0);
80 return params.pe()*pow(swe, -1.0/params.lambda());
105 return pow(pc/params.pe(), -params.lambda());
116 {
return params.pe(); }
141 swe = clamp(swe, 0.0, 1.0);
143 return - params.pe()/params.lambda() * pow(swe, -1/params.lambda() - 1);
166 return -params.lambda()/params.pe() * pow(pc/params.pe(), - params.lambda() - 1);
188 swe = clamp(swe, 0.0, 1.0);
190 return pow(swe, 2.0/params.lambda() + 3);
213 swe = clamp(swe, 0.0, 1.0);
215 return (2.0/params.lambda() + 3)*pow(swe, 2.0/params.lambda() + 2);
237 swe = clamp(swe, 0.0, 1.0);
239 const Scalar exponent = 2.0/params.lambda() + 1;
240 const Scalar tmp = 1.0 - swe;
241 return tmp*tmp*(1.0 - pow(swe, exponent));
265 swe = clamp(swe, 0.0, 1.0);
267 const auto lambdaInv = 1.0/params.lambda();
268 const auto swePow = pow(swe, 2*lambdaInv);
269 return 2*(swe - 1.0)*(1.0 + (0.5 + lambdaInv)*swePow - (1.5 + lambdaInv)*swePow*swe);
309 template<
class Scalar>
319 Scalar
lambda()
const {
return lambda_; }
329 Scalar pcEntry_, lambda_;
336 template<
class Scalar =
double>
339 const auto pcEntry = getParamFromGroup<Scalar>(paramGroup,
"BrooksCoreyPcEntry");
340 const auto lambda = getParamFromGroup<Scalar>(paramGroup,
"BrooksCoreyLambda");
341 return {pcEntry, lambda};
362 template<
class Scalar>
368 swe = clamp(
swe, 0.0, 1.0);
388 template<
class Scalar>
406 template<
class Scalar>
428 template<
class Scalar>
434 swe = clamp(
swe, 0.0, 1.0);
452 template<
class Scalar>
477 template<
class Scalar>
483 swe = clamp(
swe, 0.0, 1.0);
485 return pow(
swe, 2.0/params.
lambda() + 3.0);
503 template<
class Scalar>
509 swe = clamp(
swe, 0.0, 1.0);
511 return (2.0/params.
lambda() + 3.0)*pow(
swe, 2.0/params.
lambda() + 2.0);
528 template<
class Scalar>
534 swe = clamp(
swe, 0.0, 1.0);
536 const Scalar exponent = 2.0/params.
lambda() + 1.0;
537 const Scalar sne = 1.0 -
swe;
538 return sne*sne*(1.0 - pow(
swe, exponent));
557 template<
class Scalar>
563 swe = clamp(
swe, 0.0, 1.0);
565 const auto lambdaInv = 1.0/params.
lambda();
566 const auto swePow = pow(
swe, 2*lambdaInv);
567 return 2.0*(
swe - 1.0)*(1.0 + (0.5 + lambdaInv)*swePow - (1.5 + lambdaInv)*swePow*
swe);
578template <
class Scalar>
596 template<
class MaterialLaw>
597 void init(
const MaterialLaw* m,
const std::string& paramGroup)
599 pcLowSwe_ = getParamFromGroup<Scalar>(paramGroup,
"BrooksCoreyPcLowSweThreshold", 0.01);
600 entryPressure_ = getParamFromGroup<Scalar>(paramGroup,
"BrooksCoreyPcEntry");
602 initPcParameters_(m, pcLowSwe_);
605 template<
class MaterialLaw,
class BaseParams,
class EffToAbsParams>
606 void init(
const MaterialLaw* m,
const BaseParams& bp,
const EffToAbsParams& etap,
const Params<Scalar>& p)
609 entryPressure_ = bp.pcEntry();
611 initPcParameters_(m, pcLowSwe_);
619 return Dune::FloatCmp::eq(pcLowSwe_, o.pcLowSwe_, 1e-6)
620 && Dune::FloatCmp::eq(entryPressure_, o.entryPressure_, 1e-6);
637 if (
swe <= pcLowSwe_)
638 return pcLowSwePcValue_ + pcDerivativeLowSw_*(
swe - pcLowSwe_);
641 return pcDerivativeHighSwEnd_*(
swe - 1.0) + entryPressure_;
653 return pcDerivativeLowSw_;
656 return pcDerivativeHighSwEnd_;
667 if (
pc <= entryPressure_)
668 return 1.0 + (
pc - entryPressure_)/pcDerivativeHighSwEnd_;
670 else if (
pc >= pcLowSwePcValue_)
671 return (
pc - pcLowSwePcValue_)/pcDerivativeLowSw_ + pcLowSwe_;
682 if (
pc <= entryPressure_)
683 return 1.0/pcDerivativeHighSwEnd_;
685 else if (
pc >= pcLowSwePcValue_)
686 return 1.0/pcDerivativeLowSw_;
745 template<
class MaterialLaw>
746 void initPcParameters_(
const MaterialLaw* m,
const Scalar lowSwe)
748 const auto lowSw = MaterialLaw::EffToAbs::sweToSw(lowSwe, m->effToAbsParams());
749 const auto highSw = MaterialLaw::EffToAbs::sweToSw(1.0, m->effToAbsParams());
750 const auto dsw_dswe = MaterialLaw::EffToAbs::dsw_dswe(m->effToAbsParams());
751 pcDerivativeLowSw_ = m->template dpc_dsw<false>(lowSw)*dsw_dswe;
752 pcDerivativeHighSwEnd_ = m->template dpc_dsw<false>(highSw)*dsw_dswe;
753 pcLowSwePcValue_ = m->template pc<false>(lowSw);
757 Scalar pcLowSwePcValue_;
758 Scalar entryPressure_;
759 Scalar pcDerivativeLowSw_;
760 Scalar pcDerivativeHighSwEnd_;
767template<
typename Scalar =
double>
774template<
typename Scalar =
double>
Provides 3rd order polynomial splines.
A wrapper that can either contain a valid Scalar or NaN.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Specification of the material parameters for the Brooks Corey constitutive relations.
Implementation helper for capillary pressure and relative permeability <-> saturation relations for t...
Definition: brookscorey.hh:286
Implementation of the Brooks-Corey capillary pressure <-> saturation relation. This class bundles the...
Definition: brookscorey.hh:50
static Scalar dkrw_dswe(const Params ¶ms, Scalar swe)
The derivative of the relative permeability for the wetting phase with regard to the wetting saturati...
Definition: brookscorey.hh:208
static Scalar dswe_dpc(const Params ¶ms, Scalar pc)
The partial derivative of the effective saturation w.r.t. the capillary pressure according to Brooks ...
Definition: brookscorey.hh:159
ParamsT Params
Definition: brookscorey.hh:52
static Scalar dpc_dswe(const Params ¶ms, Scalar swe)
The partial derivative of the capillary pressure w.r.t. the effective saturation according to Brooks ...
Definition: brookscorey.hh:136
static Scalar krw(const Params ¶ms, Scalar swe)
The relative permeability for the wetting phase of the medium implied by the Brooks-Corey parameteriz...
Definition: brookscorey.hh:183
static Scalar pc(const Params ¶ms, Scalar swe)
The capillary pressure-saturation curve according to Brooks & Corey.
Definition: brookscorey.hh:73
typename Params::Scalar Scalar
Definition: brookscorey.hh:53
static Scalar endPointPc(const Params ¶ms)
The capillary pressure at Swe = 1.0 also called end point capillary pressure.
Definition: brookscorey.hh:115
static Scalar sw(const Params ¶ms, Scalar pc)
The saturation-capillary pressure curve according to Brooks & Corey.
Definition: brookscorey.hh:98
static Scalar krn(const Params ¶ms, Scalar swe)
The relative permeability for the nonwetting phase of the medium as implied by the Brooks-Corey param...
Definition: brookscorey.hh:232
static Scalar dkrn_dswe(const Params ¶ms, Scalar swe)
The derivative of the relative permeability for the nonwetting phase in regard to the wetting saturat...
Definition: brookscorey.hh:260
Implementation of the Brooks-Corey capillary pressure <-> saturation relation. This class bundles the...
Definition: brookscorey.hh:301
static Scalar dkrw_dswe(Scalar swe, const Params< Scalar > ¶ms)
The derivative of the relative permeability for the wetting phase with regard to the wetting saturati...
Definition: brookscorey.hh:504
static Scalar pc(Scalar swe, const Params< Scalar > ¶ms)
The capillary pressure-saturation curve according to Brooks & Corey.
Definition: brookscorey.hh:363
static Scalar dswe_dpc(Scalar pc, const Params< Scalar > ¶ms)
The partial derivative of the effective saturation w.r.t. the capillary pressure according to Brooks ...
Definition: brookscorey.hh:453
static Scalar swe(Scalar pc, const Params< Scalar > ¶ms)
The saturation-capillary pressure curve according to Brooks & Corey.
Definition: brookscorey.hh:389
static Scalar dpc_dswe(Scalar swe, const Params< Scalar > ¶ms)
The partial derivative of the capillary pressure w.r.t. the effective saturation according to Brooks ...
Definition: brookscorey.hh:429
static Params< Scalar > makeParams(const std::string ¶mGroup)
Construct from a subgroup from the global parameter tree.
Definition: brookscorey.hh:337
static Scalar dkrn_dswe(Scalar swe, const Params< Scalar > ¶ms)
The derivative of the relative permeability for the non-wetting phase in regard to the wetting satura...
Definition: brookscorey.hh:558
static Scalar krn(Scalar swe, const Params< Scalar > ¶ms)
The relative permeability for the non-wetting phase of the medium as implied by the Brooks-Corey para...
Definition: brookscorey.hh:529
static Scalar endPointPc(const Params< Scalar > ¶ms)
The capillary pressure at Swe = 1.0 also called end point capillary pressure.
Definition: brookscorey.hh:407
static Scalar krw(Scalar swe, const Params< Scalar > ¶ms)
The relative permeability for the wetting phase of the medium implied by the Brooks-Corey parameteriz...
Definition: brookscorey.hh:478
The parameter type.
Definition: brookscorey.hh:311
Scalar pcEntry() const
Definition: brookscorey.hh:316
void setPcEntry(Scalar pcEntry)
Definition: brookscorey.hh:317
bool operator==(const Params &p) const
Definition: brookscorey.hh:322
Scalar lambda() const
Definition: brookscorey.hh:319
Params(Scalar pcEntry, Scalar lambda)
Definition: brookscorey.hh:312
void setLambda(Scalar lambda)
Definition: brookscorey.hh:320
A regularization for the BrooksCorey material law.
Definition: brookscorey.hh:580
OptionalScalar< Scalar > pc(const Scalar swe) const
The regularized capillary pressure-saturation curve regularized part:
Definition: brookscorey.hh:630
OptionalScalar< Scalar > krn(const Scalar swe) const
The regularized relative permeability for the non-wetting phase.
Definition: brookscorey.hh:721
OptionalScalar< Scalar > dswe_dpc(const Scalar pc) const
The regularized partial derivative of the saturation to the capillary pressure.
Definition: brookscorey.hh:680
void init(const MaterialLaw *m, const std::string ¶mGroup)
Initialize the spline.
Definition: brookscorey.hh:597
OptionalScalar< Scalar > dkrn_dswe(const Scalar swe) const
The regularized derivative of the relative permeability for the non-wetting phase w....
Definition: brookscorey.hh:734
OptionalScalar< Scalar > dpc_dswe(const Scalar swe) const
The regularized partial derivative of the capillary pressure w.r.t. the saturation.
Definition: brookscorey.hh:650
OptionalScalar< Scalar > krw(const Scalar swe) const
The regularized relative permeability for the wetting phase.
Definition: brookscorey.hh:695
OptionalScalar< Scalar > dkrw_dswe(const Scalar swe) const
The regularized derivative of the relative permeability for the wetting phase w.r....
Definition: brookscorey.hh:708
OptionalScalar< Scalar > swe(const Scalar pc) const
The regularized saturation-capillary pressure curve.
Definition: brookscorey.hh:665
bool operator==(const BrooksCoreyRegularization &o) const
Equality comparison with another instance.
Definition: brookscorey.hh:617
void init(const MaterialLaw *m, const BaseParams &bp, const EffToAbsParams &etap, const Params< Scalar > &p)
Definition: brookscorey.hh:606
Regularization parameters.
Definition: brookscorey.hh:585
Params(S pcLowSwe=0.01)
Definition: brookscorey.hh:586
S pcLowSwe() const
Definition: brookscorey.hh:588
void setPcLowSwe(S pcLowSwe)
Definition: brookscorey.hh:589
This is a policy for 2p material laws how to convert absolute to relative saturations and vice versa.
Definition: efftoabsdefaultpolicy.hh:46
Wrapper class to implement regularized material laws (pc-sw, kr-sw) with a conversion policy between ...
Definition: materiallaw.hh:57