diff --git a/opm/autodiff/BlackoilPropsAdFromDeck.cpp b/opm/autodiff/BlackoilPropsAdFromDeck.cpp index 5c8939f31..24ef884ae 100644 --- a/opm/autodiff/BlackoilPropsAdFromDeck.cpp +++ b/opm/autodiff/BlackoilPropsAdFromDeck.cpp @@ -177,16 +177,16 @@ BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(const BlackoilPropsAdFromDeck& surfaceDensity_.resize(numRegions); for (int regionIdx = 0; regionIdx < numRegions; ++regionIdx) { - if (phase_usage_.phase_used[Liquid]) { - surfaceDensity_[regionIdx][phase_usage_.phase_pos[Liquid]] + if (phase_usage_.phase_used[Oil]) { + surfaceDensity_[regionIdx][phase_usage_.phase_pos[Oil]] = densityKeyword.getRecord(regionIdx).getItem("OIL").getSIDouble(0); } - if (phase_usage_.phase_used[Aqua]) { - surfaceDensity_[regionIdx][phase_usage_.phase_pos[Aqua]] + if (phase_usage_.phase_used[Water]) { + surfaceDensity_[regionIdx][phase_usage_.phase_pos[Water]] = densityKeyword.getRecord(regionIdx).getItem("WATER").getSIDouble(0); } - if (phase_usage_.phase_used[Vapour]) { - surfaceDensity_[regionIdx][phase_usage_.phase_pos[Vapour]] + if (phase_usage_.phase_used[Gas]) { + surfaceDensity_[regionIdx][phase_usage_.phase_pos[Gas]] = densityKeyword.getRecord(regionIdx).getItem("GAS").getSIDouble(0); } } diff --git a/opm/autodiff/BlackoilPropsAdInterface.hpp b/opm/autodiff/BlackoilPropsAdInterface.hpp index c6e923638..5333e4a76 100644 --- a/opm/autodiff/BlackoilPropsAdInterface.hpp +++ b/opm/autodiff/BlackoilPropsAdInterface.hpp @@ -21,7 +21,7 @@ #define OPM_BLACKOILPROPSADINTERFACE_HEADER_INCLUDED #include -#include +#include namespace Opm { @@ -75,16 +75,6 @@ namespace Opm /// \return Object describing the active phases. virtual PhaseUsage phaseUsage() const = 0; - // ------ Canonical named indices for each phase ------ - - /// Canonical named indices for each phase. - enum PhaseIndex { Water = BlackoilPhases::Aqua, Oil = BlackoilPhases::Liquid, - Gas = BlackoilPhases::Vapour, - Aqua = BlackoilPhases::Aqua, - Liquid = BlackoilPhases::Liquid, - Vapour = BlackoilPhases::Vapour, - MaxNumPhases = BlackoilPhases::MaxNumPhases}; - // ------ Density ------ /// Densities of stock components at surface conditions. diff --git a/tests/test_boprops_ad.cpp b/tests/test_boprops_ad.cpp index a59dccf1f..9eb5f2845 100644 --- a/tests/test_boprops_ad.cpp +++ b/tests/test_boprops_ad.cpp @@ -116,17 +116,17 @@ BOOST_FIXTURE_TEST_CASE(SurfaceDensity, TestFixture) typedef Opm::BlackoilPropsAdFromDeck::V V; - enum { Water = Opm::BlackoilPropsAdFromDeck::Water }; + enum { Water = Opm::Water }; V rho0AD_Water = boprops_ad.surfaceDensity(Water, cells); BOOST_REQUIRE_EQUAL(rho0AD_Water.size(), cells.size()); BOOST_CHECK_EQUAL(rho0AD_Water[0], 1000.0); - enum { Oil = Opm::BlackoilPropsAdFromDeck::Oil }; + enum { Oil = Opm::Oil }; V rho0AD_Oil = boprops_ad.surfaceDensity(Oil, cells); BOOST_REQUIRE_EQUAL(rho0AD_Oil.size(), cells.size()); BOOST_CHECK_EQUAL(rho0AD_Oil[0], 800.0); - enum { Gas = Opm::BlackoilPropsAdFromDeck::Gas }; + enum { Gas = Opm::Gas }; V rho0AD_Gas = boprops_ad.surfaceDensity(Gas, cells); BOOST_REQUIRE_EQUAL(rho0AD_Gas.size(), cells.size()); BOOST_CHECK_EQUAL(rho0AD_Gas[0], 1.0);