27 #ifndef OPM_ECL_HYSTERESIS_TWO_PHASE_LAW_HPP
28 #define OPM_ECL_HYSTERESIS_TWO_PHASE_LAW_HPP
38 template <
class EffectiveLawT,
39 class ParamsT = EclHysteresisTwoPhaseLawParams<EffectiveLawT> >
43 typedef EffectiveLawT EffectiveLaw;
44 typedef typename EffectiveLaw::Params EffectiveLawParams;
46 typedef typename EffectiveLaw::Traits Traits;
47 typedef ParamsT Params;
48 typedef typename EffectiveLaw::Scalar Scalar;
50 enum { wettingPhaseIdx = Traits::wettingPhaseIdx };
51 enum { nonWettingPhaseIdx = Traits::nonWettingPhaseIdx };
54 static const int numPhases = EffectiveLaw::numPhases;
56 "The endpoint scaling applies to the nested twophase laws, not to "
57 "the threephase one!");
63 static_assert(EffectiveLaw::implementsTwoPhaseApi,
64 "The material laws put into EclEpsTwoPhaseLaw must implement the "
65 "two-phase material law API!");
71 static_assert(EffectiveLaw::implementsTwoPhaseSatApi,
72 "The material laws put into EclEpsTwoPhaseLaw must implement the "
73 "two-phase material law saturation API!");
101 template <
class Container,
class Flu
idState>
106 throw std::invalid_argument(
"The capillaryPressures(fs) method is not yet implemented");
119 template <
class Container,
class Flu
idState>
124 throw std::invalid_argument(
"The pcnw(fs) method is not yet implemented");
138 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
139 static Evaluation
pcnw(
const Params& ,
142 throw std::invalid_argument(
"The pcnw(fs) method is not yet implemented");
145 template <
class Evaluation>
146 static Evaluation twoPhaseSatPcnw(
const Params& params,
const Evaluation&
Sw)
149 return EffectiveLaw::twoPhaseSatPcnw(params.drainageParams(),
Sw);
167 template <
class Container,
class Flu
idState>
172 throw std::invalid_argument(
"The saturations(fs) method is not yet implemented");
179 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
180 static Evaluation
Sw(
const Params& ,
183 throw std::invalid_argument(
"The Sw(fs) method is not yet implemented");
186 template <
class Evaluation>
187 static Evaluation twoPhaseSatSw(
const Params& ,
190 throw std::invalid_argument(
"The twoPhaseSatSw(pc) method is not yet implemented");
197 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
198 static Evaluation
Sn(
const Params& ,
201 throw std::invalid_argument(
"The Sn(pc) method is not yet implemented");
204 template <
class Evaluation>
205 static Evaluation twoPhaseSatSn(
const Params& ,
208 throw std::invalid_argument(
"The twoPhaseSatSn(pc) method is not yet implemented");
220 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
221 static Evaluation
krw(
const Params& ,
224 throw std::invalid_argument(
"The krw(fs) method is not yet implemented");
227 template <
class Evaluation>
228 static Evaluation twoPhaseSatKrw(
const Params& params,
const Evaluation&
Sw)
231 if (!params.config().enableHysteresis() || params.config().krHysteresisModel() < 0)
232 return EffectiveLaw::twoPhaseSatKrw(params.drainageParams(),
Sw);
234 if (params.config().krHysteresisModel() == 0)
236 return EffectiveLaw::twoPhaseSatKrw(params.drainageParams(),
Sw);
239 assert(params.config().krHysteresisModel() == 1);
240 return EffectiveLaw::twoPhaseSatKrw(params.imbibitionParams(),
Sw);
246 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
247 static Evaluation
krn(
const Params& ,
250 throw std::invalid_argument(
"The krn(fs) method is not yet implemented");
253 template <
class Evaluation>
254 static Evaluation twoPhaseSatKrn(
const Params& params,
const Evaluation&
Sw)
257 if (!params.config().enableHysteresis() || params.config().krHysteresisModel() < 0)
258 return EffectiveLaw::twoPhaseSatKrn(params.drainageParams(),
Sw);
262 if (
Sw <= params.krnSwMdc())
263 return EffectiveLaw::twoPhaseSatKrn(params.drainageParams(),
Sw);
265 return EffectiveLaw::twoPhaseSatKrn(params.imbibitionParams(),
266 Sw + params.deltaSwImbKrn());
A default implementation of the parameters for the material law which implements the ECL relative per...
This material law implements the hysteresis model of the ECL file format.
Definition: EclHysteresisTwoPhaseLaw.hpp:41
static const bool isSaturationDependent
Specify whether the quantities defined by this material law are saturation dependent.
Definition: EclHysteresisTwoPhaseLaw.hpp:77
static Evaluation krn(const Params &, const FluidState &)
The relative permeability of the non-wetting phase.
Definition: EclHysteresisTwoPhaseLaw.hpp:247
static void capillaryPressures(Container &, const Params &, const FluidState &)
The capillary pressure-saturation curves depending on absolute saturations.
Definition: EclHysteresisTwoPhaseLaw.hpp:102
static Evaluation Sw(const Params &, const FluidState &)
Calculate wetting liquid phase saturation given that the rest of the fluid state has been initialized...
Definition: EclHysteresisTwoPhaseLaw.hpp:180
static const bool isCompositionDependent
Specify whether the quantities defined by this material law are dependent on the phase composition.
Definition: EclHysteresisTwoPhaseLaw.hpp:89
static const bool isPressureDependent
Specify whether the quantities defined by this material law are dependent on the absolute pressure.
Definition: EclHysteresisTwoPhaseLaw.hpp:81
static const bool implementsTwoPhaseApi
Specify whether this material law implements the two-phase convenience API.
Definition: EclHysteresisTwoPhaseLaw.hpp:61
static Evaluation Sn(const Params &, const FluidState &)
Calculate non-wetting liquid phase saturation given that the rest of the fluid state has been initial...
Definition: EclHysteresisTwoPhaseLaw.hpp:198
static void saturations(Container &, const Params &, const FluidState &)
The saturation-capillary pressure curves.
Definition: EclHysteresisTwoPhaseLaw.hpp:168
static Evaluation krw(const Params &, const FluidState &)
The relative permeability for the wetting phase.
Definition: EclHysteresisTwoPhaseLaw.hpp:221
static const int numPhases
The number of fluid phases.
Definition: EclHysteresisTwoPhaseLaw.hpp:54
static Evaluation pcnw(const Params &, const FluidState &)
The capillary pressure-saturation curve.
Definition: EclHysteresisTwoPhaseLaw.hpp:139
static const bool implementsTwoPhaseSatApi
Specify whether this material law implements the two-phase convenience API which only depends on the ...
Definition: EclHysteresisTwoPhaseLaw.hpp:69
static const bool isTemperatureDependent
Specify whether the quantities defined by this material law are temperature dependent.
Definition: EclHysteresisTwoPhaseLaw.hpp:85
static void relativePermeabilities(Container &, const Params &, const FluidState &)
The relative permeability-saturation curves depending on absolute saturations.
Definition: EclHysteresisTwoPhaseLaw.hpp:120