diff --git a/opm/core/simulator/initStateEquil.hpp b/opm/core/simulator/initStateEquil.hpp index 1b81b07bd..3767563f3 100644 --- a/opm/core/simulator/initStateEquil.hpp +++ b/opm/core/simulator/initStateEquil.hpp @@ -275,7 +275,13 @@ namespace Opm // Default initialisation: constant Rs below contact, saturated above. for (size_t i = 0; i < rec.size(); ++i) { const int cell = *(eqlmap.cells(i + 1).begin()); - const double p_contact = rec[i].goc.press; + if (rec[i].goc.depth != rec[i].main.depth) { + OPM_THROW(std::runtime_error, + "Cannot initialise: when no explicit RSVD table is given, \n" + "datum depth must be at the gas-oil-contact. " + "In EQUIL region " << (i + 1) << " (counting from 1), this does not hold."); + } + const double p_contact = rec[i].main.press; rs_func_.push_back(std::make_shared(props, cell, p_contact)); } } diff --git a/tests/equil_liveoil.DATA b/tests/equil_liveoil.DATA index 5b2766915..955a09b7f 100644 --- a/tests/equil_liveoil.DATA +++ b/tests/equil_liveoil.DATA @@ -42,5 +42,5 @@ DENSITY / EQUIL -50 150 50 0.25 45 0.35 +45 150 50 0.25 45 0.35 / diff --git a/tests/test_equil.cpp b/tests/test_equil.cpp index 38bdff80d..6a175acc2 100644 --- a/tests/test_equil.cpp +++ b/tests/test_equil.cpp @@ -499,9 +499,9 @@ BOOST_AUTO_TEST_CASE (DeckWithLiveOil) // solver, and it is unclear if we should check it against // the true answer or something else. const double reltol = 1.0e-6; - BOOST_CHECK_CLOSE(pressures[0][first] , 1.45e7 , reltol); - BOOST_CHECK_CLOSE(pressures[0][last ] , 1.545e7 , reltol); - BOOST_CHECK_CLOSE(pressures[1][last] , 1.5489764605846416e7 , reltol); + BOOST_CHECK_CLOSE(pressures[0][first] , 1.4551328443106037e7 , reltol); + BOOST_CHECK_CLOSE(pressures[0][last ] , 1.5501328443106037e7 , reltol); + BOOST_CHECK_CLOSE(pressures[1][last] , 1.5541598197355453e7 , reltol); const auto& sats = comp.saturation(); // std::cout << "Saturations:\n";