diff --git a/opm/simulators/utils/satfunc/GasPhaseConsistencyChecks.cpp b/opm/simulators/utils/satfunc/GasPhaseConsistencyChecks.cpp index d2961bda9..8d80a1750 100644 --- a/opm/simulators/utils/satfunc/GasPhaseConsistencyChecks.cpp +++ b/opm/simulators/utils/satfunc/GasPhaseConsistencyChecks.cpp @@ -55,6 +55,8 @@ template void Opm::Satfunc::PhaseChecks::Gas::SGmax:: testImpl(const EclEpsScalingPointsInfo& endPoints) { + // 0 < SGU <= 1 + this->sgu_ = endPoints.Sgu; if (! std::isfinite(this->sgu_)) { @@ -64,8 +66,8 @@ testImpl(const EclEpsScalingPointsInfo& endPoints) return; } - const auto low = this->sgu_ < Scalar{0}; - const auto high = ! (this->sgu_ < Scalar{1}); + const auto low = ! (this->sgu_ > Scalar{0}); + const auto high = this->sgu_ > Scalar{1}; if (low || high) { this->setViolated(); diff --git a/opm/simulators/utils/satfunc/GasPhaseConsistencyChecks.hpp b/opm/simulators/utils/satfunc/GasPhaseConsistencyChecks.hpp index d34f1f444..7f015ff4d 100644 --- a/opm/simulators/utils/satfunc/GasPhaseConsistencyChecks.hpp +++ b/opm/simulators/utils/satfunc/GasPhaseConsistencyChecks.hpp @@ -104,13 +104,13 @@ namespace Opm::Satfunc::PhaseChecks::Gas { /// Descriptive textual summary of this check. std::string description() const override { - return { "Non-negative maximum gas saturation strictly less than one" }; + return { "Positive maximum gas saturation must not exceed one" }; } /// Textual representation of the consistency condition. std::string condition() const override { - return { "0 <= SGU < 1" }; + return { "0 < SGU <= 1" }; } /// Retrieve names of the exported check values. diff --git a/tests/test_GasSatfuncConsistencyChecks.cpp b/tests/test_GasSatfuncConsistencyChecks.cpp index 0eb039956..255cd1b4d 100644 --- a/tests/test_GasSatfuncConsistencyChecks.cpp +++ b/tests/test_GasSatfuncConsistencyChecks.cpp @@ -192,7 +192,7 @@ BOOST_AUTO_TEST_CASE(All_Good) { auto endPoints = Opm::EclEpsScalingPointsInfo{}; - endPoints.Sgu = 0.125f; // >= 0 && < 1 + endPoints.Sgu = 0.125f; // > 0 && <= 1 check.test(endPoints); } @@ -266,7 +266,7 @@ BOOST_AUTO_TEST_CASE(Is_One) { auto check = Checks::SGmax{}; auto endPoints = Opm::EclEpsScalingPointsInfo{}; - endPoints.Sgu = 1.0; // >= 1 + endPoints.Sgu = 1.0; // <= 1 check.test(endPoints); @@ -277,8 +277,8 @@ BOOST_AUTO_TEST_CASE(Is_One) BOOST_CHECK_CLOSE(value, 1.0, 1.0e-8); } - BOOST_CHECK_MESSAGE(check.isViolated(), "Test must be violated"); - BOOST_CHECK_MESSAGE(check.isCritical(), "Test must be violated at critical level"); + BOOST_CHECK_MESSAGE(! check.isViolated(), "Test must not be violated"); + BOOST_CHECK_MESSAGE(! check.isCritical(), "Test must not be violated at critical level"); } BOOST_AUTO_TEST_CASE(Exceeds_One)