From 3e7f74d3840b1aa160753b2aecfc847d7c046d22 Mon Sep 17 00:00:00 2001 From: hnil Date: Wed, 28 Jun 2023 13:09:04 +0200 Subject: [PATCH 1/2] -- fixes for twophase relperm --- .../EclTwoPhaseMaterial.hpp | 22 +++++++++++++++++++ .../EclTwoPhaseMaterialParams.hpp | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterial.hpp b/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterial.hpp index 66ec4e3cd..71a42b17a 100644 --- a/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterial.hpp +++ b/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterial.hpp @@ -125,6 +125,21 @@ public: * \param params Parameters * \param state The fluid state */ + template + static Scalar relpermOilInOilGasSystem(const Params& params, + const FluidState& fluidState){ + throw std::logic_error { + "relpermOilInOilGasSystem() is specific to three phases" + }; + } + template + static Scalar relpermOilInOilWaterSystem(const Params& params, + const FluidState& fluidState){ + throw std::logic_error { + "relpermOilInOilWaterSystem() is specific to three phases" + }; + } + template static void capillaryPressures(ContainerT& values, const Params& params, @@ -225,6 +240,13 @@ public: params.gasOilParams().update(pcSwMdc, krwSw, krnSwMdc); } + static Scalar trappedGasSaturation(const Params& params){ + if(params.approach() == EclTwoPhaseApproach::GasOil) + return params.gasOilParams().SnTrapped(); + if(params.approach() == EclTwoPhaseApproach::GasWater) + return params.gasWaterParams().SnTrapped(); + return 0.0; // oil-water case + } /*! * \brief Capillary pressure between the gas and the non-wetting * liquid (i.e., oil) phase. diff --git a/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterialParams.hpp b/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterialParams.hpp index 616c41fa1..e8c710897 100644 --- a/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterialParams.hpp +++ b/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterialParams.hpp @@ -134,7 +134,7 @@ public: serializer(*oilWaterParams_); serializer(*gasWaterParams_); } - + void setSwl(Scalar val){} private: EclTwoPhaseApproach approach_; From 6de987eaec292845a7886cb7f94d50c6e80905ff Mon Sep 17 00:00:00 2001 From: hnil Date: Wed, 26 Jul 2023 14:09:15 +0200 Subject: [PATCH 2/2] fixed after review --- .../EclTwoPhaseMaterial.hpp | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterial.hpp b/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterial.hpp index 71a42b17a..95c2ff7a3 100644 --- a/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterial.hpp +++ b/opm/material/fluidmatrixinteractions/EclTwoPhaseMaterial.hpp @@ -111,20 +111,6 @@ public: //! are dependent on the phase composition static constexpr bool isCompositionDependent = false; - /*! - * \brief Implements the multiplexer three phase capillary pressure law - * used by the ECLipse simulator. - * - * This material law is valid for three fluid phases and only - * depends on the saturations. - * - * The required two-phase relations are supplied by means of template - * arguments and can be an arbitrary other material laws. - * - * \param values Container for the return values - * \param params Parameters - * \param state The fluid state - */ template static Scalar relpermOilInOilGasSystem(const Params& params, const FluidState& fluidState){ @@ -139,7 +125,22 @@ public: "relpermOilInOilWaterSystem() is specific to three phases" }; } - + + /*! + * \brief Implements the multiplexer three phase capillary pressure law + * used by the ECLipse simulator. + * + * This material law is valid for three fluid phases and only + * depends on the saturations. + * + * The required two-phase relations are supplied by means of template + * arguments and can be an arbitrary other material laws. + * + * \param values Container for the return values + * \param params Parameters + * \param state The fluid state + */ + template static void capillaryPressures(ContainerT& values, const Params& params, @@ -170,7 +171,7 @@ public: const Evaluation& Sw = decay(fluidState.saturation(waterPhaseIdx)); - values[waterPhaseIdx] = 0.0; + values[waterPhaseIdx] = 0.0; values[gasPhaseIdx] = GasWaterMaterialLaw::twoPhaseSatPcnw(params.gasWaterParams(), Sw); break; } @@ -364,7 +365,7 @@ public: case EclTwoPhaseApproach::GasWater: { const Evaluation& Sw = decay(fluidState.saturation(waterPhaseIdx)); - + values[waterPhaseIdx] = GasWaterMaterialLaw::twoPhaseSatKrw(params.gasWaterParams(), Sw); values[gasPhaseIdx] = GasWaterMaterialLaw::twoPhaseSatKrn(params.gasWaterParams(), Sw); @@ -431,7 +432,7 @@ public: case EclTwoPhaseApproach::GasWater: { Scalar Sw = scalarValue(fluidState.saturation(waterPhaseIdx)); - + return params.gasWaterParams().update(/*pcSw=*/1.0, /*krwSw=*/0.0, /*krnSw=*/Sw); break; }