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:
177 static void oilWaterHysteresisParams(Scalar& pcSwMdc,
179 const Params& params)
181 OPM_TIMEFUNCTION_LOCAL();
182 switch (params.approach()) {
183 case EclMultiplexerApproach::Stone1:
184 Stone1Material::oilWaterHysteresisParams(pcSwMdc, krnSwMdc,
185 params.template getRealParams<EclMultiplexerApproach::Stone1>());
188 case EclMultiplexerApproach::Stone2:
189 Stone2Material::oilWaterHysteresisParams(pcSwMdc, krnSwMdc,
190 params.template getRealParams<EclMultiplexerApproach::Stone2>());
193 case EclMultiplexerApproach::Default:
194 DefaultMaterial::oilWaterHysteresisParams(pcSwMdc, krnSwMdc,
195 params.template getRealParams<EclMultiplexerApproach::Default>());
198 case EclMultiplexerApproach::TwoPhase:
199 TwoPhaseMaterial::oilWaterHysteresisParams(pcSwMdc, krnSwMdc,
200 params.template getRealParams<EclMultiplexerApproach::TwoPhase>());
203 case EclMultiplexerApproach::OnePhase:
215 static void setOilWaterHysteresisParams(
const Scalar& pcSwMdc,
216 const Scalar& krnSwMdc,
219 OPM_TIMEFUNCTION_LOCAL();
220 switch (params.approach()) {
221 case EclMultiplexerApproach::Stone1:
222 Stone1Material::setOilWaterHysteresisParams(pcSwMdc, krnSwMdc,
223 params.template getRealParams<EclMultiplexerApproach::Stone1>());
226 case EclMultiplexerApproach::Stone2:
227 Stone2Material::setOilWaterHysteresisParams(pcSwMdc, krnSwMdc,
228 params.template getRealParams<EclMultiplexerApproach::Stone2>());
231 case EclMultiplexerApproach::Default:
232 DefaultMaterial::setOilWaterHysteresisParams(pcSwMdc, krnSwMdc,
233 params.template getRealParams<EclMultiplexerApproach::Default>());
236 case EclMultiplexerApproach::TwoPhase:
237 TwoPhaseMaterial::setOilWaterHysteresisParams(pcSwMdc, krnSwMdc,
238 params.template getRealParams<EclMultiplexerApproach::TwoPhase>());
241 case EclMultiplexerApproach::OnePhase:
253 static void gasOilHysteresisParams(Scalar& pcSwMdc,
255 const Params& params)
257 OPM_TIMEFUNCTION_LOCAL();
258 switch (params.approach()) {
259 case EclMultiplexerApproach::Stone1:
260 Stone1Material::gasOilHysteresisParams(pcSwMdc, krnSwMdc,
261 params.template getRealParams<EclMultiplexerApproach::Stone1>());
264 case EclMultiplexerApproach::Stone2:
265 Stone2Material::gasOilHysteresisParams(pcSwMdc, krnSwMdc,
266 params.template getRealParams<EclMultiplexerApproach::Stone2>());
269 case EclMultiplexerApproach::Default:
270 DefaultMaterial::gasOilHysteresisParams(pcSwMdc, krnSwMdc,
271 params.template getRealParams<EclMultiplexerApproach::Default>());
274 case EclMultiplexerApproach::TwoPhase:
275 TwoPhaseMaterial::gasOilHysteresisParams(pcSwMdc, krnSwMdc,
276 params.template getRealParams<EclMultiplexerApproach::TwoPhase>());
279 case EclMultiplexerApproach::OnePhase:
285 static Scalar trappedGasSaturation(
const Params& params)
287 OPM_TIMEFUNCTION_LOCAL();
288 switch (params.approach()) {
289 case EclMultiplexerApproach::Stone1:
290 return params.template getRealParams<EclMultiplexerApproach::Stone1>().gasOilParams().SnTrapped();
291 case EclMultiplexerApproach::Stone2:
292 return params.template getRealParams<EclMultiplexerApproach::Stone2>().gasOilParams().SnTrapped();
293 case EclMultiplexerApproach::Default:
294 return params.template getRealParams<EclMultiplexerApproach::Default>().gasOilParams().SnTrapped();
295 case EclMultiplexerApproach::TwoPhase:
296 if(params.template getRealParams<EclMultiplexerApproach::TwoPhase>().approach() == EclTwoPhaseApproach::GasOil)
297 return params.template getRealParams<EclMultiplexerApproach::TwoPhase>().gasOilParams().SnTrapped();
298 if(params.template getRealParams<EclMultiplexerApproach::TwoPhase>().approach() == EclTwoPhaseApproach::GasWater)
299 return params.template getRealParams<EclMultiplexerApproach::TwoPhase>().gasWaterParams().SnTrapped();
301 case EclMultiplexerApproach::OnePhase:
307 static Scalar trappedOilSaturation(
const Params& params)
309 OPM_TIMEFUNCTION_LOCAL();
310 switch (params.approach()) {
311 case EclMultiplexerApproach::Stone1:
312 return params.template getRealParams<EclMultiplexerApproach::Stone1>().oilWaterParams().SnTrapped();
313 case EclMultiplexerApproach::Stone2:
314 return params.template getRealParams<EclMultiplexerApproach::Stone2>().oilWaterParams().SnTrapped();
315 case EclMultiplexerApproach::Default:
316 return params.template getRealParams<EclMultiplexerApproach::Default>().oilWaterParams().SnTrapped();
317 case EclMultiplexerApproach::TwoPhase:
318 if(params.template getRealParams<EclMultiplexerApproach::TwoPhase>().approach() == EclTwoPhaseApproach::GasOil)
319 return params.template getRealParams<EclMultiplexerApproach::TwoPhase>().gasOilParams().SwTrapped();
320 if(params.template getRealParams<EclMultiplexerApproach::TwoPhase>().approach() == EclTwoPhaseApproach::OilWater)
321 return params.template getRealParams<EclMultiplexerApproach::TwoPhase>().oilWaterParams().SnTrapped();
323 case EclMultiplexerApproach::OnePhase:
329 static Scalar trappedWaterSaturation(
const Params& params)
331 OPM_TIMEFUNCTION_LOCAL();
332 switch (params.approach()) {
333 case EclMultiplexerApproach::Stone1:
334 return params.template getRealParams<EclMultiplexerApproach::Stone1>().oilWaterParams().SwTrapped();
335 case EclMultiplexerApproach::Stone2:
336 return params.template getRealParams<EclMultiplexerApproach::Stone2>().oilWaterParams().SwTrapped();
337 case EclMultiplexerApproach::Default:
338 return params.template getRealParams<EclMultiplexerApproach::Default>().oilWaterParams().SwTrapped();
339 case EclMultiplexerApproach::TwoPhase:
340 if(params.template getRealParams<EclMultiplexerApproach::TwoPhase>().approach() == EclTwoPhaseApproach::GasWater)
341 return params.template getRealParams<EclMultiplexerApproach::TwoPhase>().gasWaterParams().SwTrapped();
342 if(params.template getRealParams<EclMultiplexerApproach::TwoPhase>().approach() == EclTwoPhaseApproach::OilWater)
343 return params.template getRealParams<EclMultiplexerApproach::TwoPhase>().oilWaterParams().SwTrapped();
345 case EclMultiplexerApproach::OnePhase:
356 static void setGasOilHysteresisParams(
const Scalar& pcSwMdc,
357 const Scalar& krnSwMdc,
360 OPM_TIMEFUNCTION_LOCAL();
361 switch (params.approach()) {
362 case EclMultiplexerApproach::Stone1:
363 Stone1Material::setGasOilHysteresisParams(pcSwMdc, krnSwMdc,
364 params.template getRealParams<EclMultiplexerApproach::Stone1>());
367 case EclMultiplexerApproach::Stone2:
368 Stone2Material::setGasOilHysteresisParams(pcSwMdc, krnSwMdc,
369 params.template getRealParams<EclMultiplexerApproach::Stone2>());
372 case EclMultiplexerApproach::Default:
373 DefaultMaterial::setGasOilHysteresisParams(pcSwMdc, krnSwMdc,
374 params.template getRealParams<EclMultiplexerApproach::Default>());
377 case EclMultiplexerApproach::TwoPhase:
378 TwoPhaseMaterial::setGasOilHysteresisParams(pcSwMdc, krnSwMdc,
379 params.template getRealParams<EclMultiplexerApproach::TwoPhase>());
382 case EclMultiplexerApproach::OnePhase:
397 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
398 static Evaluation
pcgn(
const Params& ,
401 throw std::logic_error(
"Not implemented: pcgn()");
413 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
414 static Evaluation
pcnw(
const Params& ,
417 throw std::logic_error(
"Not implemented: pcnw()");
423 template <
class ContainerT,
class Flu
idState>
428 throw std::logic_error(
"Not implemented: saturations()");
434 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
435 static Evaluation
Sg(
const Params& ,
438 throw std::logic_error(
"Not implemented: Sg()");
444 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
445 static Evaluation
Sn(
const Params& ,
448 throw std::logic_error(
"Not implemented: Sn()");
454 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
455 static Evaluation
Sw(
const Params& ,
458 throw std::logic_error(
"Not implemented: Sw()");
476 template <
class ContainerT,
class Flu
idState>
478 const Params& params,
479 const FluidState& fluidState)
481 OPM_TIMEFUNCTION_LOCAL();
482 switch (params.approach()) {
483 case EclMultiplexerApproach::Stone1:
485 params.template getRealParams<EclMultiplexerApproach::Stone1>(),
489 case EclMultiplexerApproach::Stone2:
491 params.template getRealParams<EclMultiplexerApproach::Stone2>(),
495 case EclMultiplexerApproach::Default:
497 params.template getRealParams<EclMultiplexerApproach::Default>(),
501 case EclMultiplexerApproach::TwoPhase:
503 params.template getRealParams<EclMultiplexerApproach::TwoPhase>(),
507 case EclMultiplexerApproach::OnePhase:
512 throw std::logic_error(
"Not implemented: relativePermeabilities() option for unknown EclMultiplexerApproach (="
513 + std::to_string(
static_cast<int>(params.approach())) +
")");
520 template <
class Evaluation,
class Flu
idState>
522 const FluidState& fluidState)
524 OPM_TIMEFUNCTION_LOCAL();
525 switch (params.approach()) {
526 case EclMultiplexerApproach::Stone1:
527 return Stone1Material::template relpermOilInOilGasSystem<Evaluation>
528 (params.template getRealParams<EclMultiplexerApproach::Stone1>(),
531 case EclMultiplexerApproach::Stone2:
532 return Stone2Material::template relpermOilInOilGasSystem<Evaluation>
533 (params.template getRealParams<EclMultiplexerApproach::Stone2>(),
536 case EclMultiplexerApproach::Default:
537 return DefaultMaterial::template relpermOilInOilGasSystem<Evaluation>
538 (params.template getRealParams<EclMultiplexerApproach::Default>(),
542 throw std::logic_error {
543 "relpermOilInOilGasSystem() is specific to three phases"
551 template <
class Evaluation,
class Flu
idState>
553 const FluidState& fluidState)
555 OPM_TIMEFUNCTION_LOCAL();
556 switch (params.approach()) {
557 case EclMultiplexerApproach::Stone1:
558 return Stone1Material::template relpermOilInOilWaterSystem<Evaluation>
559 (params.template getRealParams<EclMultiplexerApproach::Stone1>(),
562 case EclMultiplexerApproach::Stone2:
563 return Stone2Material::template relpermOilInOilWaterSystem<Evaluation>
564 (params.template getRealParams<EclMultiplexerApproach::Stone2>(),
567 case EclMultiplexerApproach::Default:
568 return DefaultMaterial::template relpermOilInOilWaterSystem<Evaluation>
569 (params.template getRealParams<EclMultiplexerApproach::Default>(),
573 throw std::logic_error {
574 "relpermOilInOilWaterSystem() is specific to three phases"
582 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
583 static Evaluation
krg(
const Params& ,
586 throw std::logic_error(
"Not implemented: krg()");
592 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
593 static Evaluation
krw(
const Params& ,
596 throw std::logic_error(
"Not implemented: krw()");
602 template <
class Flu
idState,
class Evaluation =
typename Flu
idState::Scalar>
603 static Evaluation
krn(
const Params& ,
606 throw std::logic_error(
"Not implemented: krn()");
617 template <
class Flu
idState>
620 OPM_TIMEFUNCTION_LOCAL();
621 switch (params.approach()) {
622 case EclMultiplexerApproach::Stone1:
627 case EclMultiplexerApproach::Stone2:
632 case EclMultiplexerApproach::Default:
637 case EclMultiplexerApproach::TwoPhase:
641 case EclMultiplexerApproach::OnePhase: