diff --git a/opm/simulators/utils/satfunc/ThreePointHorizontalConsistencyChecks.cpp b/opm/simulators/utils/satfunc/ThreePointHorizontalConsistencyChecks.cpp index d86704c35..0c143f5fe 100644 --- a/opm/simulators/utils/satfunc/ThreePointHorizontalConsistencyChecks.cpp +++ b/opm/simulators/utils/satfunc/ThreePointHorizontalConsistencyChecks.cpp @@ -51,7 +51,7 @@ testImpl(const EclEpsScalingPointsInfo& endPoints) const auto sr = Scalar{1} - (this->sogcr_ + this->swl_); - const auto low = ! (this->swl_ < sr); + const auto low = ! (this->sgcr_ < sr); const auto high = ! (sr < this->sgu_); if (low || high) { @@ -86,7 +86,7 @@ testImpl(const EclEpsScalingPointsInfo& endPoints) const auto sr = Scalar{1} - (this->sowcr_ + this->sgl_); - const auto low = ! (this->sgl_ < sr); + const auto low = ! (this->swcr_ < sr); const auto high = ! (sr < this->swu_); if (low || high) { diff --git a/tests/test_ThreePointHorizontalSatfuncConsistencyChecks.cpp b/tests/test_ThreePointHorizontalSatfuncConsistencyChecks.cpp index 10c3ccaba..fd49f8c5c 100644 --- a/tests/test_ThreePointHorizontalSatfuncConsistencyChecks.cpp +++ b/tests/test_ThreePointHorizontalSatfuncConsistencyChecks.cpp @@ -92,6 +92,37 @@ BOOST_AUTO_TEST_CASE(All_Good) BOOST_CHECK_MESSAGE(! check.isCritical(), "Test must not be violated at critical level"); } +BOOST_AUTO_TEST_CASE(All_Good_2) +{ + auto check = Checks::DisplacingOil_GO{}; + + constexpr auto expectNumExportedCheckValues = std::size_t{5}; + + { + auto endPoints = Opm::EclEpsScalingPointsInfo{}; + endPoints.Swl = 0.4f; + endPoints.Sgcr = 0.15f; + endPoints.Sogcr = 0.2f; + endPoints.Sgu = 0.6; + + check.test(endPoints); + } + + { + auto values = std::vector(expectNumExportedCheckValues); + check.exportCheckValues(values.data()); + + BOOST_CHECK_CLOSE(values[0], 0.4f, 1.0e-6f); + BOOST_CHECK_CLOSE(values[1], 0.2f, 1.0e-6f); + BOOST_CHECK_CLOSE(values[2], 0.15f, 1.0e-6f); + BOOST_CHECK_CLOSE(values[3], 0.4f, 1.0e-5f); + BOOST_CHECK_CLOSE(values[4], 0.6f, 1.0e-6f); + } + + 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(Non_Finite) { // NaN