60 using GasOilMaterialLaw = GasOilMaterialLawT;
61 using OilWaterMaterialLaw = OilWaterMaterialLawT;
62 using GasWaterMaterialLaw = GasWaterMaterialLawT;
70 static_assert(TraitsT::numPhases == 3,
71 "The number of phases considered by this capillary pressure "
72 "law is always three!");
73 static_assert(GasOilMaterialLaw::numPhases == 2,
74 "The number of phases considered by the gas-oil capillary "
75 "pressure law must be two!");
76 static_assert(OilWaterMaterialLaw::numPhases == 2,
77 "The number of phases considered by the oil-water capillary "
78 "pressure law must be two!");
79 static_assert(GasWaterMaterialLaw::numPhases == 2,
80 "The number of phases considered by the gas-water capillary "
81 "pressure law must be two!");
82 static_assert(std::is_same<
typename GasOilMaterialLaw::Scalar,
83 typename OilWaterMaterialLaw::Scalar>::value,
84 "The two two-phase capillary pressure laws must use the same "
85 "type of floating point values.");
87 using Traits = TraitsT;
88 using Params = ParamsT;
89 using Scalar =
typename Traits::Scalar;
91 static constexpr int numPhases = 3;
92 static constexpr int waterPhaseIdx = Traits::wettingPhaseIdx;
93 static constexpr int oilPhaseIdx = Traits::nonWettingPhaseIdx;
94 static constexpr int gasPhaseIdx = Traits::gasPhaseIdx;
134 template <
class ContainerT,
class Flu
idState>
136 const Params& params,
137 const FluidState& fluidState)
139 OPM_TIMEFUNCTION_LOCAL();
140 switch (params.approach()) {
141 case EclMultiplexerApproach::Stone1:
143 params.template getRealParams<EclMultiplexerApproach::Stone1>(),
147 case EclMultiplexerApproach::Stone2:
149 params.template getRealParams<EclMultiplexerApproach::Stone2>(),
153 case EclMultiplexerApproach::Default:
155 params.template getRealParams<EclMultiplexerApproach::Default>(),
159 case EclMultiplexerApproach::TwoPhase:
161 params.template getRealParams<EclMultiplexerApproach::TwoPhase>(),
165 case EclMultiplexerApproach::OnePhase:
178 static void oilWaterHysteresisParams(Scalar& soMax,
181 const Params& params)
183 OPM_TIMEFUNCTION_LOCAL();
184 switch (params.approach()) {
185 case EclMultiplexerApproach::Stone1:
186 Stone1Material::oilWaterHysteresisParams(soMax, swMax, swMin,
187 params.template getRealParams<EclMultiplexerApproach::Stone1>());
190 case EclMultiplexerApproach::Stone2:
191 Stone2Material::oilWaterHysteresisParams(soMax, swMax, swMin,
192 params.template getRealParams<EclMultiplexerApproach::Stone2>());
195 case EclMultiplexerApproach::Default:
196 DefaultMaterial::oilWaterHysteresisParams(soMax, swMax, swMin,
197 params.template getRealParams<EclMultiplexerApproach::Default>());
200 case EclMultiplexerApproach::TwoPhase:
201 TwoPhaseMaterial::oilWaterHysteresisParams(soMax, swMax, swMin,
202 params.template getRealParams<EclMultiplexerApproach::TwoPhase>());
205 case EclMultiplexerApproach::OnePhase:
218 static void setOilWaterHysteresisParams(
const Scalar& soMax,
223 OPM_TIMEFUNCTION_LOCAL();
224 switch (params.approach()) {
225 case EclMultiplexerApproach::Stone1:
226 Stone1Material::setOilWaterHysteresisParams(soMax, swMax, swMin,
227 params.template getRealParams<EclMultiplexerApproach::Stone1>());
230 case EclMultiplexerApproach::Stone2:
231 Stone2Material::setOilWaterHysteresisParams(soMax, swMax, swMin,
232 params.template getRealParams<EclMultiplexerApproach::Stone2>());
235 case EclMultiplexerApproach::Default:
236 DefaultMaterial::setOilWaterHysteresisParams(soMax, swMax, swMin,
237 params.template getRealParams<EclMultiplexerApproach::Default>());
240 case EclMultiplexerApproach::TwoPhase:
241 TwoPhaseMaterial::setOilWaterHysteresisParams(soMax, swMax, swMin,
242 params.template getRealParams<EclMultiplexerApproach::TwoPhase>());
245 case EclMultiplexerApproach::OnePhase:
258 static void gasOilHysteresisParams(Scalar& sgmax,
261 const Params& params)
263 OPM_TIMEFUNCTION_LOCAL();
264 switch (params.approach()) {
265 case EclMultiplexerApproach::Stone1:
266 Stone1Material::gasOilHysteresisParams(sgmax, shmax, somin,
267 params.template getRealParams<EclMultiplexerApproach::Stone1>());
270 case EclMultiplexerApproach::Stone2:
271 Stone2Material::gasOilHysteresisParams(sgmax, shmax, somin,
272 params.template getRealParams<EclMultiplexerApproach::Stone2>());
275 case EclMultiplexerApproach::Default:
276 DefaultMaterial::gasOilHysteresisParams(sgmax, shmax, somin,
277 params.template getRealParams<EclMultiplexerApproach::Default>());
280 case EclMultiplexerApproach::TwoPhase:
281 TwoPhaseMaterial::gasOilHysteresisParams(sgmax, shmax, somin,
282 params.template getRealParams<EclMultiplexerApproach::TwoPhase>());
285 case EclMultiplexerApproach::OnePhase:
291 static Scalar trappedGasSaturation(
const Params& params,
bool maximumTrapping)
293 OPM_TIMEFUNCTION_LOCAL();
294 switch (params.approach()) {
295 case EclMultiplexerApproach::Stone1:
296 return Stone1Material::trappedGasSaturation(params.template getRealParams<EclMultiplexerApproach::Stone1>(), maximumTrapping);
297 case EclMultiplexerApproach::Stone2:
298 return Stone2Material::trappedGasSaturation(params.template getRealParams<EclMultiplexerApproach::Stone2>(), maximumTrapping);
299 case EclMultiplexerApproach::Default:
300 return DefaultMaterial::trappedGasSaturation(params.template getRealParams<EclMultiplexerApproach::Default>(), maximumTrapping);
301 case EclMultiplexerApproach::TwoPhase:
302 return TwoPhaseMaterial::trappedGasSaturation(params.template getRealParams<EclMultiplexerApproach::TwoPhase>(), maximumTrapping);
303 case EclMultiplexerApproach::OnePhase:
309 static Scalar strandedGasSaturation(
const Params& params, Scalar
Sg, Scalar Kg)
311 OPM_TIMEFUNCTION_LOCAL();
312 switch (params.approach()) {
313 case EclMultiplexerApproach::Stone1:
314 return Stone1Material::strandedGasSaturation(params.template getRealParams<EclMultiplexerApproach::Stone1>(),
Sg, Kg);
315 case EclMultiplexerApproach::Stone2:
316 return Stone2Material::strandedGasSaturation(params.template getRealParams<EclMultiplexerApproach::Stone2>(),
Sg, Kg);
317 case EclMultiplexerApproach::Default:
318 return DefaultMaterial::strandedGasSaturation(params.template getRealParams<EclMultiplexerApproach::Default>(),
Sg, Kg);
319 case EclMultiplexerApproach::TwoPhase:
320 return TwoPhaseMaterial::strandedGasSaturation(params.template getRealParams<EclMultiplexerApproach::TwoPhase>(),
Sg, Kg);
321 case EclMultiplexerApproach::OnePhase:
327 static Scalar trappedOilSaturation(
const Params& params,
bool maximumTrapping)
329 OPM_TIMEFUNCTION_LOCAL();
330 switch (params.approach()) {
331 case EclMultiplexerApproach::Stone1:
332 return Stone1Material::trappedOilSaturation(params.template getRealParams<EclMultiplexerApproach::Stone1>(), maximumTrapping);
333 case EclMultiplexerApproach::Stone2:
334 return Stone2Material::trappedOilSaturation(params.template getRealParams<EclMultiplexerApproach::Stone2>(), maximumTrapping);
335 case EclMultiplexerApproach::Default:
336 return DefaultMaterial::trappedOilSaturation(params.template getRealParams<EclMultiplexerApproach::Default>(), maximumTrapping);
337 case EclMultiplexerApproach::TwoPhase:
338 return TwoPhaseMaterial::trappedOilSaturation(params.template getRealParams<EclMultiplexerApproach::TwoPhase>(), maximumTrapping);
339 case EclMultiplexerApproach::OnePhase:
345 static Scalar trappedWaterSaturation(
const Params& params)
347 OPM_TIMEFUNCTION_LOCAL();
348 switch (params.approach()) {
349 case EclMultiplexerApproach::Stone1:
350 return Stone1Material::trappedWaterSaturation(params.template getRealParams<EclMultiplexerApproach::Stone1>());
351 case EclMultiplexerApproach::Stone2:
352 return Stone2Material::trappedWaterSaturation(params.template getRealParams<EclMultiplexerApproach::Stone2>());
353 case EclMultiplexerApproach::Default:
354 return DefaultMaterial::trappedWaterSaturation(params.template getRealParams<EclMultiplexerApproach::Default>());
355 case EclMultiplexerApproach::TwoPhase:
356 return TwoPhaseMaterial::trappedWaterSaturation(params.template getRealParams<EclMultiplexerApproach::TwoPhase>());
357 case EclMultiplexerApproach::OnePhase:
369 static void setGasOilHysteresisParams(
const Scalar& sgmax,
374 OPM_TIMEFUNCTION_LOCAL();
375 switch (params.approach()) {
376 case EclMultiplexerApproach::Stone1:
377 Stone1Material::setGasOilHysteresisParams(sgmax, shmax, somin,
378 params.template getRealParams<EclMultiplexerApproach::Stone1>());
381 case EclMultiplexerApproach::Stone2:
382 Stone2Material::setGasOilHysteresisParams(sgmax, shmax, somin,
383 params.template getRealParams<EclMultiplexerApproach::Stone2>());
386 case EclMultiplexerApproach::Default:
387 DefaultMaterial::setGasOilHysteresisParams(sgmax, shmax, somin,
388 params.template getRealParams<EclMultiplexerApproach::Default>());
391 case EclMultiplexerApproach::TwoPhase:
392 TwoPhaseMaterial::setGasOilHysteresisParams(sgmax, shmax, somin,
393 params.template getRealParams<EclMultiplexerApproach::TwoPhase>());
396 case EclMultiplexerApproach::OnePhase:
411 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
412 static Evaluation
pcgn(
const Params& ,
415 throw std::logic_error(
"Not implemented: pcgn()");
427 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
428 static Evaluation
pcnw(
const Params& ,
431 throw std::logic_error(
"Not implemented: pcnw()");
437 template <
class ContainerT,
class Flu
idState>
442 throw std::logic_error(
"Not implemented: saturations()");
448 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
449 static Evaluation
Sg(
const Params& ,
452 throw std::logic_error(
"Not implemented: Sg()");
458 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
459 static Evaluation
Sn(
const Params& ,
462 throw std::logic_error(
"Not implemented: Sn()");
468 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
469 static Evaluation
Sw(
const Params& ,
472 throw std::logic_error(
"Not implemented: Sw()");
490 template <
class ContainerT,
class Flu
idState>
492 const Params& params,
493 const FluidState& fluidState)
495 OPM_TIMEFUNCTION_LOCAL();
496 switch (params.approach()) {
497 case EclMultiplexerApproach::Stone1:
499 params.template getRealParams<EclMultiplexerApproach::Stone1>(),
503 case EclMultiplexerApproach::Stone2:
505 params.template getRealParams<EclMultiplexerApproach::Stone2>(),
509 case EclMultiplexerApproach::Default:
511 params.template getRealParams<EclMultiplexerApproach::Default>(),
515 case EclMultiplexerApproach::TwoPhase:
517 params.template getRealParams<EclMultiplexerApproach::TwoPhase>(),
521 case EclMultiplexerApproach::OnePhase:
526 throw std::logic_error(
"Not implemented: relativePermeabilities() option for unknown EclMultiplexerApproach (="
527 + std::to_string(
static_cast<int>(params.approach())) +
")");
534 template <
class Evaluation,
class Flu
idState>
536 const FluidState& fluidState)
538 OPM_TIMEFUNCTION_LOCAL();
539 switch (params.approach()) {
540 case EclMultiplexerApproach::Stone1:
541 return Stone1Material::template relpermOilInOilGasSystem<Evaluation>
542 (params.template getRealParams<EclMultiplexerApproach::Stone1>(),
545 case EclMultiplexerApproach::Stone2:
546 return Stone2Material::template relpermOilInOilGasSystem<Evaluation>
547 (params.template getRealParams<EclMultiplexerApproach::Stone2>(),
550 case EclMultiplexerApproach::Default:
551 return DefaultMaterial::template relpermOilInOilGasSystem<Evaluation>
552 (params.template getRealParams<EclMultiplexerApproach::Default>(),
556 throw std::logic_error {
557 "relpermOilInOilGasSystem() is specific to three phases"
565 template <
class Evaluation,
class Flu
idState>
567 const FluidState& fluidState)
569 OPM_TIMEFUNCTION_LOCAL();
570 switch (params.approach()) {
571 case EclMultiplexerApproach::Stone1:
572 return Stone1Material::template relpermOilInOilWaterSystem<Evaluation>
573 (params.template getRealParams<EclMultiplexerApproach::Stone1>(),
576 case EclMultiplexerApproach::Stone2:
577 return Stone2Material::template relpermOilInOilWaterSystem<Evaluation>
578 (params.template getRealParams<EclMultiplexerApproach::Stone2>(),
581 case EclMultiplexerApproach::Default:
582 return DefaultMaterial::template relpermOilInOilWaterSystem<Evaluation>
583 (params.template getRealParams<EclMultiplexerApproach::Default>(),
587 throw std::logic_error {
588 "relpermOilInOilWaterSystem() is specific to three phases"
596 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
597 static Evaluation
krg(
const Params& ,
600 throw std::logic_error(
"Not implemented: krg()");
606 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
607 static Evaluation
krw(
const Params& ,
610 throw std::logic_error(
"Not implemented: krw()");
616 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
617 static Evaluation
krn(
const Params& ,
620 throw std::logic_error(
"Not implemented: krn()");
631 template <
class Flu
idState>
634 OPM_TIMEFUNCTION_LOCAL();
635 switch (params.approach()) {
636 case EclMultiplexerApproach::Stone1:
641 case EclMultiplexerApproach::Stone2:
646 case EclMultiplexerApproach::Default:
651 case EclMultiplexerApproach::TwoPhase:
655 case EclMultiplexerApproach::OnePhase: