From a5a9f5ee4e4323d26ea329b235b72934be443b9d Mon Sep 17 00:00:00 2001 From: goncalvesmachadoc Date: Wed, 14 Sep 2022 16:11:36 +0200 Subject: [PATCH 1/4] addtestfordeadoilwithhumid&wetgas --- CMakeLists_files.cmake | 4 +- tests/equil_humidwetgas.DATA | 142 ++++++++++++++++ tests/equil_rvvd_and_rvwvd.DATA | 152 ++++++++++++++++++ .../{equil_livegas.DATA => equil_wetgas.DATA} | 4 +- tests/test_equil.cc | 131 ++++++++++++++- 5 files changed, 428 insertions(+), 5 deletions(-) create mode 100644 tests/equil_humidwetgas.DATA create mode 100644 tests/equil_rvvd_and_rvwvd.DATA rename tests/{equil_livegas.DATA => equil_wetgas.DATA} (88%) diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 7e41217a8..42aa9aa84 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -210,9 +210,11 @@ list (APPEND TEST_DATA_FILES tests/capillary_overlap.DATA tests/capillarySwatinit.DATA tests/deadfluids.DATA - tests/equil_livegas.DATA + tests/equil_wetgas.DATA tests/equil_liveoil.DATA tests/equil_rsvd_and_rvvd.DATA + tests/equil_rvvd_and_rvwvd.DATA + tests/equil_humidwetgas.DATA tests/wetgas.DATA tests/satfuncEPS_B.DATA tests/wells_manager_data.data diff --git a/tests/equil_humidwetgas.DATA b/tests/equil_humidwetgas.DATA new file mode 100644 index 000000000..382b8745e --- /dev/null +++ b/tests/equil_humidwetgas.DATA @@ -0,0 +1,142 @@ +NOECHO + +RUNSPEC ====== + +WATER +OIL +GAS +VAPWAT +VAPOIL + +TABDIMS + 1 1 40 20 1 20 / + +DIMENS +1 1 20 +/ + +WELLDIMS + 30 10 2 30 / + +START + 1 'JAN' 1990 / + +NSTACK + 25 / + +EQLDIMS +-- NTEQUL + 1 / + + +FMTOUT +FMTIN + +GRID ====== + +DXV +1.0 +/ + +DYV +1.0 +/ + +DZV +20*5.0 +/ + + +PORO +20*0.2 +/ + + +PERMZ + 20*1.0 +/ + +PERMY +20*100.0 +/ + +PERMX +20*100.0 +/ + +BOX + 1 1 1 1 1 1 / + +TOPS +0.0 +/ + +PROPS ====== + +PVDO +100 1.0 1.0 +200 0.9 1.0 +/ + +PVTG +-- Pg Rv Bg mug + 100 0.0001 0.010 0.1 + 0.0 0.0104 0.1 / + 200 0.0004 0.005 0.2 + 0.0 0.0054 0.2 / +/ + +PVTGW +-- Pg Rvw Bg mug + 100 0.0001 0.010 0.1 + 0.0 0.0104 0.1 / + 200 0.0004 0.005 0.2 + 0.0 0.0054 0.2 / +/ + +SWOF +0.2 0 1 0.9 +1 1 0 0.1 +/ + +SGOF +0 0 1 0.2 +0.8 1 0 0.5 +/ + +PVTW +--RefPres Bw Comp Vw Cv + 1. 1.0 4.0E-5 0.96 0.0 / + + +ROCK +--RefPres Comp + 1. 5.0E-5 / + +DENSITY +700 1000 1 +/ + +SOLUTION ====== +EQUIL + 45 150 45 0.25 45 0.35 1* 1* 0 1* 1* 1* +/ + +RPTSOL +'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RV' 'RVW' 'RESTART=2' / + +SUMMARY ====== +RUNSUM + +SEPARATE + +SCHEDULE ====== + +TSTEP +1 / + +RPTSCHED +'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RV' 'RVW' 'RESTART=3' 'NEWTON=2' / + + +END \ No newline at end of file diff --git a/tests/equil_rvvd_and_rvwvd.DATA b/tests/equil_rvvd_and_rvwvd.DATA new file mode 100644 index 000000000..d4f7c04bd --- /dev/null +++ b/tests/equil_rvvd_and_rvwvd.DATA @@ -0,0 +1,152 @@ +NOECHO + +RUNSPEC ====== + +WATER +OIL +GAS +VAPWAT +VAPOIL + +TABDIMS + 1 1 40 20 1 20 / + +DIMENS +1 1 20 +/ + +WELLDIMS + 30 10 2 30 / + +START + 1 'JAN' 1990 / + +NSTACK + 25 / + +EQLDIMS +-- NTEQUL + 1 / + + +FMTOUT +FMTIN + +GRID ====== + +DXV +1.0 +/ + +DYV +1.0 +/ + +DZV +20*5.0 +/ + + +PORO +20*0.2 +/ + + +PERMZ + 20*1.0 +/ + +PERMY +20*100.0 +/ + +PERMX +20*100.0 +/ + +BOX + 1 1 1 1 1 1 / + +TOPS +0.0 +/ + +PROPS ====== + +PVDO +100 1.0 1.0 +200 0.9 1.0 +/ + + +PVTG +-- Pg Rv Bg Vg + 100 0.0001 0.010 0.1 + 0.0 0.0104 0.1 / + 200 0.0004 0.005 0.2 + 0.0 0.0054 0.2 / +/ + +PVTGW +-- Pg Rvw Bg mug + 100 0.0001 0.010 0.1 + 0.0 0.0104 0.1 / + 200 0.0004 0.005 0.2 + 0.0 0.0054 0.2 / +/ + +SWOF +0.2 0 1 0.9 +1 1 0 0.1 +/ + +SGOF +0 0 1 0.2 +0.8 1 0 0.5 +/ + +PVTW +--RefPres Bw Comp Vw Cv + 1. 1.0 4.0E-5 0.96 0.0 / + + +ROCK +--RefPres Comp + 1. 5.0E-5 / + +DENSITY +700 1000 1 +/ + +SOLUTION ====== + +EQUIL +45 150 50 0.25 45 0.35 1 1 0 +/ + +RSVD + 0 0.0 + 100 100. / + +RVWVD + 0 0.0 + 100 100. / + +RPTSOL +'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RV' 'RVW' 'RESTART=2' / + +SUMMARY ====== +RUNSUM + +SEPARATE + +SCHEDULE ====== + +TSTEP +1 / + +RPTSCHED +'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RV' 'RVW' 'RESTART=3' 'NEWTON=2' / + + +END \ No newline at end of file diff --git a/tests/equil_livegas.DATA b/tests/equil_wetgas.DATA similarity index 88% rename from tests/equil_livegas.DATA rename to tests/equil_wetgas.DATA index 4717c0481..9cf0c5eb8 100644 --- a/tests/equil_livegas.DATA +++ b/tests/equil_wetgas.DATA @@ -115,7 +115,7 @@ EQUIL / RPTSOL -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / +'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RV' 'RESTART=2' / SUMMARY ====== RUNSUM @@ -128,7 +128,7 @@ TSTEP 1 / RPTSCHED -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / +'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RV' 'RESTART=3' 'NEWTON=2' / END diff --git a/tests/test_equil.cc b/tests/test_equil.cc index 7222d2a9e..036eb249f 100644 --- a/tests/test_equil.cc +++ b/tests/test_equil.cc @@ -776,11 +776,11 @@ BOOST_AUTO_TEST_CASE(DeckWithLiveOil) } } -BOOST_AUTO_TEST_CASE(DeckWithLiveGas) +BOOST_AUTO_TEST_CASE(DeckWithWetGas) { using TypeTag = Opm::Properties::TTag::TestEquilTypeTag; using FluidSystem = Opm::GetPropType; - auto simulator = initSimulator("equil_livegas.DATA"); + auto simulator = initSimulator("equil_wetgas.DATA"); const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); @@ -858,6 +858,68 @@ BOOST_AUTO_TEST_CASE(DeckWithLiveGas) } } +//TODO Find corret values +BOOST_AUTO_TEST_CASE(DeckWithHumidWetGas) +{ + using TypeTag = Opm::Properties::TTag::TestEquilTypeTag; + using FluidSystem = Opm::GetPropType; + auto simulator = initSimulator("equil_humidawetgas.DATA"); + const auto& eclipseState = simulator->vanguard().eclState(); + Opm::GridManager gm(eclipseState.getInputGrid()); + const UnstructuredGrid& grid = *(gm.c_grid()); + + EquilFixture::Initializer comp(*simulator->problem().materialLawManager(), + eclipseState, + simulator->vanguard().grid(), + simulator->vanguard().gridView(), + simulator->vanguard().cartesianMapper(), 9.80665); + const auto& pressures = comp.press(); + BOOST_REQUIRE_EQUAL(pressures.size(), 3U); + BOOST_REQUIRE_EQUAL(int(pressures[0].size()), grid.number_of_cells); + + const int first = 0, last = grid.number_of_cells - 1; + const double reltol = 1.0e-1; + + BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][first], 1.482150311e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][last], 1.547988347e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][first], 1.491150311e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][last], 1.548988347e7, reltol); + + const auto& sats = comp.saturation(); + + std::vector s_opm[3]; + s_opm[FluidSystem::waterPhaseIdx] = { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.24310545, 0.5388, 0.78458, 0.91540, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; + s_opm[FluidSystem::oilPhaseIdx] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.18288667, 0.0846, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + s_opm[FluidSystem::gasPhaseIdx] = { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.75689455, 0.4612, 0.03253333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + for (int phase = 0; phase < 3; ++phase) { + BOOST_REQUIRE_EQUAL(sats[phase].size(), s_opm[phase].size()); + for (size_t i = 0; i < s_opm[phase].size(); ++i) { + BOOST_CHECK_CLOSE(sats[phase][i], s_opm[phase][i], 100.*reltol); + } + std::cout << std::endl; + } + + const auto& rv = comp.rv(); + const auto& rvw = comp.rvw(); + const std::vector rv_opm { + 2.4884509e-4, 2.4910378e-4, 2.4936267e-4, 2.4962174e-4, + 2.4988100e-4, 2.5014044e-4, 2.5040008e-4, 2.5065990e-4, + 2.5091992e-4, 2.5118012e-4, 2.5223082e-4, 2.5105e-4, + 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, + 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4}; + const std::vector rvw_opm { + 2.4884509e-4, 2.4910378e-4, 2.4936267e-4, 2.4962174e-4, + 2.4988100e-4, 2.5014044e-4, 2.5040008e-4, 2.5065990e-4, + 2.5091992e-4, 2.5118012e-4, 2.5223082e-4, 2.5105e-4, + 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, + 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4}; + + for (size_t i = 0; i < rv_opm.size(); ++i) { + BOOST_CHECK_CLOSE(rv[i], rv_opm[i], reltol); + BOOST_CHECK_CLOSE(rvw[i], rvw_opm[i], reltol); + } +} + BOOST_AUTO_TEST_CASE(DeckWithRSVDAndRVVD) { using TypeTag = Opm::Properties::TTag::TestEquilTypeTag; @@ -1054,6 +1116,71 @@ BOOST_AUTO_TEST_CASE(DeckWithPBVDAndPDVD) } } +BOOST_AUTO_TEST_CASE(DeckWithRVVDAndRVWVD) +{ + using TypeTag = Opm::Properties::TTag::TestEquilTypeTag; + using FluidSystem = Opm::GetPropType; + auto simulator = initSimulator("equil_rvvd_and_rvwvd.DATA"); + const auto& eclipseState = simulator->vanguard().eclState(); + Opm::GridManager gm(eclipseState.getInputGrid()); + const UnstructuredGrid& grid = *(gm.c_grid()); + + EquilFixture::Initializer comp(*simulator->problem().materialLawManager(), + eclipseState, + simulator->vanguard().grid(), + simulator->vanguard().gridView(), + simulator->vanguard().cartesianMapper(), 9.80665); + const auto& pressures = comp.press(); + BOOST_REQUIRE_EQUAL(pressures.size(), 3U); + BOOST_REQUIRE_EQUAL(int(pressures[0].size()), grid.number_of_cells); + + const int first = 0, last = grid.number_of_cells - 1; + const double reltol = 1.0e-4; + + BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][first], 1.483499660e7, reltol); // opm + BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][last], 1.547924516e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][first], 1.492499660e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][last], 1.548924516e7, reltol); + + const auto& sats = comp.saturation(); + + std::vector s_opm[3]; + s_opm[FluidSystem::waterPhaseIdx] = { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2223045711692897, 0.52882298575945874, 0.78152142505479982, 0.91816512259416283, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; + s_opm[FluidSystem::oilPhaseIdx] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.19637607881498206, 0.08183487740583717, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + s_opm[FluidSystem::gasPhaseIdx] = { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.7776954288307103, 0.47117701424054126, 0.02210249613021811, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + + for (int phase = 0; phase < 3; ++phase) { + BOOST_REQUIRE_EQUAL(sats[phase].size(), s_opm[phase].size()); + for (size_t i = 0; i < s_opm[phase].size(); ++i) { + BOOST_CHECK_CLOSE(sats[phase][i], s_opm[phase][i], reltol); + } + std::cout << std::endl; + } + + const auto& rvw = comp.rvw(); + const std::vector rvw_opm { + 74.62498302, 74.65959041, 74.69438035, 74.72935336, + 74.76450995, 74.79985061, 74.83537588, 74.87527065, + 74.96863769, 75.08891765, 52.5, 57.5, + 62.5, 67.5, 72.5, 76.45954841, + 76.70621045, 76.95287736, 77.19954913, 77.44622578}; + + const auto& rv = comp.rv(); + const std::vector rv_opm { + 2.50e-6, 7.50e-6, 1.25e-5, 1.75e-5, + 2.25e-5, 2.75e-5, 3.25e-5, 3.75e-5, + 4.25e-5, 2.51158386e-4, 2.52203372e-4, 5.75e-5, + 6.25e-5, 6.75e-5, 7.25e-5, 7.75e-5, + 8.25e-5, 8.75e-5, 9.25e-5, 9.75e-5}; + + for (size_t i = 0; i < rv_opm.size(); ++i) { + BOOST_CHECK_CLOSE(rvw[i], rvw_opm[i], reltol); + BOOST_CHECK_CLOSE(rv[i], rv_opm[i], reltol); + } +} + +//Both equil cases with TODO RS, RV and RVW + BOOST_AUTO_TEST_CASE(DeckWithSwatinit) { #if 0 From 0a91b773d83ced9ca3afb0b80ee05f75893c9668 Mon Sep 17 00:00:00 2001 From: goncalvesmachadoc Date: Fri, 16 Sep 2022 14:17:53 +0200 Subject: [PATCH 2/4] test also with live oil --- CMakeLists_files.cmake | 4 +- tests/equil_humidwetgas.DATA | 11 +++--- ...vd.DATA => equil_rsvd_rvvd_and_rvwvd.DATA} | 37 +++++++++++++------ tests/test_equil.cc | 37 ++++++++++--------- 4 files changed, 54 insertions(+), 35 deletions(-) rename tests/{equil_rvvd_and_rvwvd.DATA => equil_rsvd_rvvd_and_rvwvd.DATA} (57%) diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 42aa9aa84..62a0ca40d 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -212,9 +212,9 @@ list (APPEND TEST_DATA_FILES tests/deadfluids.DATA tests/equil_wetgas.DATA tests/equil_liveoil.DATA - tests/equil_rsvd_and_rvvd.DATA - tests/equil_rvvd_and_rvwvd.DATA tests/equil_humidwetgas.DATA + tests/equil_rsvd_and_rvvd.DATA + tests/equil_rsvd_rvvd_and_rvwvd.DATA tests/wetgas.DATA tests/satfuncEPS_B.DATA tests/wells_manager_data.data diff --git a/tests/equil_humidwetgas.DATA b/tests/equil_humidwetgas.DATA index 382b8745e..c9ccd506f 100644 --- a/tests/equil_humidwetgas.DATA +++ b/tests/equil_humidwetgas.DATA @@ -1,12 +1,12 @@ -NOECHO +NNOECHO RUNSPEC ====== WATER OIL GAS -VAPWAT VAPOIL +VAPWAT TABDIMS 1 1 40 20 1 20 / @@ -79,7 +79,7 @@ PVDO / PVTG --- Pg Rv Bg mug +-- Pg Rv Bg Vg 100 0.0001 0.010 0.1 0.0 0.0104 0.1 / 200 0.0004 0.005 0.2 @@ -87,7 +87,7 @@ PVTG / PVTGW --- Pg Rvw Bg mug +-- Pg Rvw Bg Vg 100 0.0001 0.010 0.1 0.0 0.0104 0.1 / 200 0.0004 0.005 0.2 @@ -118,8 +118,9 @@ DENSITY / SOLUTION ====== + EQUIL - 45 150 45 0.25 45 0.35 1* 1* 0 1* 1* 1* +45 150 50 0.25 45 0.35 1* 1* 0 / RPTSOL diff --git a/tests/equil_rvvd_and_rvwvd.DATA b/tests/equil_rsvd_rvvd_and_rvwvd.DATA similarity index 57% rename from tests/equil_rvvd_and_rvwvd.DATA rename to tests/equil_rsvd_rvvd_and_rvwvd.DATA index d4f7c04bd..8469b597d 100644 --- a/tests/equil_rvvd_and_rvwvd.DATA +++ b/tests/equil_rsvd_rvvd_and_rvwvd.DATA @@ -1,12 +1,13 @@ -NOECHO +NNOECHO RUNSPEC ====== WATER OIL GAS -VAPWAT +DISGAS VAPOIL +VAPWAT TABDIMS 1 1 40 20 1 20 / @@ -73,12 +74,22 @@ TOPS PROPS ====== -PVDO -100 1.0 1.0 -200 0.9 1.0 +PVTO +-- Rs Pbub Bo Vo + 0 1. 1.0000 1.20 / + 20 40. 1.0120 1.17 / + 40 80. 1.0255 1.14 / + 60 120. 1.0380 1.11 / + 80 160. 1.0510 1.08 / + 100 200. 1.0630 1.06 / + 120 240. 1.0750 1.03 / + 140 280. 1.0870 1.00 / + 160 320. 1.0985 .98 / + 180 360. 1.1100 .95 / + 200 400. 1.1200 .94 + 500. 1.1189 .94 / / - PVTG -- Pg Rv Bg Vg 100 0.0001 0.010 0.1 @@ -88,7 +99,7 @@ PVTG / PVTGW --- Pg Rvw Bg mug +-- Pg Rvw Bg Vg 100 0.0001 0.010 0.1 0.0 0.0104 0.1 / 200 0.0004 0.005 0.2 @@ -128,12 +139,16 @@ RSVD 0 0.0 100 100. / +RVVD + 0. 0. + 100. 0.0001 / + RVWVD - 0 0.0 - 100 100. / + 0. 0. + 100. 0.0001 / RPTSOL -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RV' 'RVW' 'RESTART=2' / +'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RV' 'RVW' 'RESTART=2' / SUMMARY ====== RUNSUM @@ -146,7 +161,7 @@ TSTEP 1 / RPTSCHED -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RV' 'RVW' 'RESTART=3' 'NEWTON=2' / +'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RV' 'RVW' 'RESTART=3' 'NEWTON=2' / END \ No newline at end of file diff --git a/tests/test_equil.cc b/tests/test_equil.cc index 036eb249f..b56eadc6f 100644 --- a/tests/test_equil.cc +++ b/tests/test_equil.cc @@ -858,12 +858,11 @@ BOOST_AUTO_TEST_CASE(DeckWithWetGas) } } -//TODO Find corret values BOOST_AUTO_TEST_CASE(DeckWithHumidWetGas) { using TypeTag = Opm::Properties::TTag::TestEquilTypeTag; using FluidSystem = Opm::GetPropType; - auto simulator = initSimulator("equil_humidawetgas.DATA"); + auto simulator = initSimulator("equil_humidwetgas.DATA"); const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); @@ -879,14 +878,12 @@ BOOST_AUTO_TEST_CASE(DeckWithHumidWetGas) const int first = 0, last = grid.number_of_cells - 1; const double reltol = 1.0e-1; - BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][first], 1.482150311e7, reltol); BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][last], 1.547988347e7, reltol); BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][first], 1.491150311e7, reltol); BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][last], 1.548988347e7, reltol); const auto& sats = comp.saturation(); - std::vector s_opm[3]; s_opm[FluidSystem::waterPhaseIdx] = { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.24310545, 0.5388, 0.78458, 0.91540, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; s_opm[FluidSystem::oilPhaseIdx] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.18288667, 0.0846, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -900,14 +897,15 @@ BOOST_AUTO_TEST_CASE(DeckWithHumidWetGas) } const auto& rv = comp.rv(); - const auto& rvw = comp.rvw(); const std::vector rv_opm { 2.4884509e-4, 2.4910378e-4, 2.4936267e-4, 2.4962174e-4, 2.4988100e-4, 2.5014044e-4, 2.5040008e-4, 2.5065990e-4, 2.5091992e-4, 2.5118012e-4, 2.5223082e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4}; - const std::vector rvw_opm { + + const auto& rvw = comp.rvw(); + const std::vector rvw_opm { 2.4884509e-4, 2.4910378e-4, 2.4936267e-4, 2.4962174e-4, 2.4988100e-4, 2.5014044e-4, 2.5040008e-4, 2.5065990e-4, 2.5091992e-4, 2.5118012e-4, 2.5223082e-4, 2.5105e-4, @@ -1116,11 +1114,11 @@ BOOST_AUTO_TEST_CASE(DeckWithPBVDAndPDVD) } } -BOOST_AUTO_TEST_CASE(DeckWithRVVDAndRVWVD) +BOOST_AUTO_TEST_CASE(DeckWithRSVDAndRVVDAndRVWVD) { using TypeTag = Opm::Properties::TTag::TestEquilTypeTag; using FluidSystem = Opm::GetPropType; - auto simulator = initSimulator("equil_rvvd_and_rvwvd.DATA"); + auto simulator = initSimulator("equil_rsvd_and_rvvd_and_rvwvd.DATA"); const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); const UnstructuredGrid& grid = *(gm.c_grid()); @@ -1136,14 +1134,12 @@ BOOST_AUTO_TEST_CASE(DeckWithRVVDAndRVWVD) const int first = 0, last = grid.number_of_cells - 1; const double reltol = 1.0e-4; - - BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][first], 1.483499660e7, reltol); // opm + BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][first], 1.483499660e7, reltol); BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][last], 1.547924516e7, reltol); BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][first], 1.492499660e7, reltol); BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][last], 1.548924516e7, reltol); - const auto& sats = comp.saturation(); - + const auto& sats = comp.saturation(); std::vector s_opm[3]; s_opm[FluidSystem::waterPhaseIdx] = { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2223045711692897, 0.52882298575945874, 0.78152142505479982, 0.91816512259416283, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; s_opm[FluidSystem::oilPhaseIdx] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.19637607881498206, 0.08183487740583717, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; @@ -1157,8 +1153,8 @@ BOOST_AUTO_TEST_CASE(DeckWithRVVDAndRVWVD) std::cout << std::endl; } - const auto& rvw = comp.rvw(); - const std::vector rvw_opm { + const auto& rs = comp.rs(); + const std::vector rs_opm { // opm 74.62498302, 74.65959041, 74.69438035, 74.72935336, 74.76450995, 74.79985061, 74.83537588, 74.87527065, 74.96863769, 75.08891765, 52.5, 57.5, @@ -1173,14 +1169,21 @@ BOOST_AUTO_TEST_CASE(DeckWithRVVDAndRVWVD) 6.25e-5, 6.75e-5, 7.25e-5, 7.75e-5, 8.25e-5, 8.75e-5, 9.25e-5, 9.75e-5}; + const auto& rvw = comp.rvw(); + const std::vector rvw_opm { + 2.50e-6, 7.50e-6, 1.25e-5, 1.75e-5, + 2.25e-5, 2.75e-5, 3.25e-5, 3.75e-5, + 4.25e-5, 2.51158386e-4, 2.52203372e-4, 5.75e-5, + 6.25e-5, 6.75e-5, 7.25e-5, 7.75e-5, + 8.25e-5, 8.75e-5, 9.25e-5, 9.75e-5}; + for (size_t i = 0; i < rv_opm.size(); ++i) { - BOOST_CHECK_CLOSE(rvw[i], rvw_opm[i], reltol); + BOOST_CHECK_CLOSE(rs[i], rs_opm[i], reltol); BOOST_CHECK_CLOSE(rv[i], rv_opm[i], reltol); + BOOST_CHECK_CLOSE(rvw[i], rvw_opm[i], reltol); } } -//Both equil cases with TODO RS, RV and RVW - BOOST_AUTO_TEST_CASE(DeckWithSwatinit) { #if 0 From c82e769697dbf6a19ba08e4095418f913d1ef689 Mon Sep 17 00:00:00 2001 From: goncalvesmachadoc Date: Tue, 20 Sep 2022 10:56:54 +0200 Subject: [PATCH 3/4] fixes --- CMakeLists_files.cmake | 2 +- tests/equil_humidwetgas.DATA | 4 ++-- tests/equil_rsvd_and_rvvd.DATA | 4 ++-- ...rvvd_and_rvwvd.DATA => equil_rsvd_and_rvvd_and_rvwvd.DATA} | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) rename tests/{equil_rsvd_rvvd_and_rvwvd.DATA => equil_rsvd_and_rvvd_and_rvwvd.DATA} (97%) diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 62a0ca40d..34ed4123f 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -214,7 +214,7 @@ list (APPEND TEST_DATA_FILES tests/equil_liveoil.DATA tests/equil_humidwetgas.DATA tests/equil_rsvd_and_rvvd.DATA - tests/equil_rsvd_rvvd_and_rvwvd.DATA + tests/equil_rsvd_and_rvvd_and_rvwvd.DATA tests/wetgas.DATA tests/satfuncEPS_B.DATA tests/wells_manager_data.data diff --git a/tests/equil_humidwetgas.DATA b/tests/equil_humidwetgas.DATA index c9ccd506f..1b9109ae2 100644 --- a/tests/equil_humidwetgas.DATA +++ b/tests/equil_humidwetgas.DATA @@ -1,4 +1,4 @@ -NNOECHO +NOECHO RUNSPEC ====== @@ -120,7 +120,7 @@ DENSITY SOLUTION ====== EQUIL -45 150 50 0.25 45 0.35 1* 1* 0 +45 150 45 0.25 45 0.35 1* 1* 0 1* 1* 1* / RPTSOL diff --git a/tests/equil_rsvd_and_rvvd.DATA b/tests/equil_rsvd_and_rvvd.DATA index bfc965c25..2b1d091c8 100644 --- a/tests/equil_rsvd_and_rvvd.DATA +++ b/tests/equil_rsvd_and_rvvd.DATA @@ -135,7 +135,7 @@ RVVD 100. 0.0001 / RPTSOL -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / +'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RV' 'RESTART=2' / SUMMARY ====== RUNSUM @@ -148,7 +148,7 @@ TSTEP 1 / RPTSCHED -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / +'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RV' 'RESTART=3' 'NEWTON=2' / END diff --git a/tests/equil_rsvd_rvvd_and_rvwvd.DATA b/tests/equil_rsvd_and_rvvd_and_rvwvd.DATA similarity index 97% rename from tests/equil_rsvd_rvvd_and_rvwvd.DATA rename to tests/equil_rsvd_and_rvvd_and_rvwvd.DATA index 8469b597d..1d8af4166 100644 --- a/tests/equil_rsvd_rvvd_and_rvwvd.DATA +++ b/tests/equil_rsvd_and_rvvd_and_rvwvd.DATA @@ -1,4 +1,4 @@ -NNOECHO +NOECHO RUNSPEC ====== @@ -132,7 +132,7 @@ DENSITY SOLUTION ====== EQUIL -45 150 50 0.25 45 0.35 1 1 0 +45 150 45 0.25 45 0.35 1 1 0 1* 1* 1 / RSVD From 0b505e5f714eb89ab714084aa0142dd874f39037 Mon Sep 17 00:00:00 2001 From: goncalvesmachadoc Date: Sat, 1 Oct 2022 16:46:59 +0200 Subject: [PATCH 4/4] add flag and values --- tests/test_equil.cc | 96 ++++++++++++++++++++++++++------------------- 1 file changed, 56 insertions(+), 40 deletions(-) diff --git a/tests/test_equil.cc b/tests/test_equil.cc index b56eadc6f..102a37663 100644 --- a/tests/test_equil.cc +++ b/tests/test_equil.cc @@ -81,13 +81,27 @@ namespace TTag { struct TestEquilTypeTag { using InheritsFrom = std::tuple; }; +struct TestEquilVapwatTypeTag { + using InheritsFrom = std::tuple; +}; } template struct EclWellModel { using type = BlackoilWellModel; }; - +template +struct EnableEvaporation { + static constexpr bool value = true; +}; +template +struct EclWellModel { + using type = BlackoilWellModel; +}; +template +struct EnableEvaporation { + static constexpr bool value = true; +}; } // namespace Opm::Properties template @@ -862,6 +876,7 @@ BOOST_AUTO_TEST_CASE(DeckWithHumidWetGas) { using TypeTag = Opm::Properties::TTag::TestEquilTypeTag; using FluidSystem = Opm::GetPropType; + FluidSystem::setEnableVaporizedWater(true); auto simulator = initSimulator("equil_humidwetgas.DATA"); const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); @@ -878,16 +893,16 @@ BOOST_AUTO_TEST_CASE(DeckWithHumidWetGas) const int first = 0, last = grid.number_of_cells - 1; const double reltol = 1.0e-1; - BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][first], 1.482150311e7, reltol); - BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][last], 1.547988347e7, reltol); - BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][first], 1.491150311e7, reltol); - BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][last], 1.548988347e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][first], 1.480599988e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][last], 1.549297524e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][first], 1.489599988e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][last], 1.550297524e7, reltol); const auto& sats = comp.saturation(); std::vector s_opm[3]; - s_opm[FluidSystem::waterPhaseIdx] = { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.24310545, 0.5388, 0.78458, 0.91540, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; - s_opm[FluidSystem::oilPhaseIdx] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.18288667, 0.0846, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - s_opm[FluidSystem::gasPhaseIdx] = { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.75689455, 0.4612, 0.03253333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + s_opm[FluidSystem::waterPhaseIdx] = { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.35838026, 0.64069098, 0.9154626, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; + s_opm[FluidSystem::oilPhaseIdx] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.02738364, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + s_opm[FluidSystem::gasPhaseIdx] = { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.64161973, 0.359309012, 0.057153701, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; for (int phase = 0; phase < 3; ++phase) { BOOST_REQUIRE_EQUAL(sats[phase].size(), s_opm[phase].size()); for (size_t i = 0; i < s_opm[phase].size(); ++i) { @@ -898,19 +913,19 @@ BOOST_AUTO_TEST_CASE(DeckWithHumidWetGas) const auto& rv = comp.rv(); const std::vector rv_opm { - 2.4884509e-4, 2.4910378e-4, 2.4936267e-4, 2.4962174e-4, - 2.4988100e-4, 2.5014044e-4, 2.5040008e-4, 2.5065990e-4, - 2.5091992e-4, 2.5118012e-4, 2.5223082e-4, 2.5105e-4, - 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, - 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4}; + 0.00024837999651755729, 0.00024869285236692635, 0.00024900604366769004, 0.00024931957094322978, + 0.00024963343471801471, 0.00024994763551760586, 0.00025026217386865733, 0.00025057705029892072, + 0.00025089226533724643, 0.00025120780158539152, 0.00025105, 0.00025105, + 0.00025105, 0.00025105, 0.00025105, 0.00025105, + 0.00025105, 0.00025105, 0.00025105, 0.00025105}; const auto& rvw = comp.rvw(); const std::vector rvw_opm { - 2.4884509e-4, 2.4910378e-4, 2.4936267e-4, 2.4962174e-4, - 2.4988100e-4, 2.5014044e-4, 2.5040008e-4, 2.5065990e-4, - 2.5091992e-4, 2.5118012e-4, 2.5223082e-4, 2.5105e-4, - 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, - 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4}; + 0.00024837999651755729, 0.00024869285236692635, 0.00024900604366769004, 0.00024931957094322978, + 0.00024963343471801471, 0.00024994763551760586, 0.00025026217386865733, 0.00025057705029892072, + 0.00025089226533724643, 0.00025120780158539152, 0.00025236969680655122, 0.00025384953117447344, + 0.00025532939474124625, 0.00025680928750801825, 0.00025828920947593858, 0.00025976916064615645, + 0.00026124914101982041, 0.00026272915059807997, 0.0002642091893820838, 0.00026568925737298143}; for (size_t i = 0; i < rv_opm.size(); ++i) { BOOST_CHECK_CLOSE(rv[i], rv_opm[i], reltol); @@ -1118,6 +1133,7 @@ BOOST_AUTO_TEST_CASE(DeckWithRSVDAndRVVDAndRVWVD) { using TypeTag = Opm::Properties::TTag::TestEquilTypeTag; using FluidSystem = Opm::GetPropType; + FluidSystem::setEnableVaporizedWater(true); auto simulator = initSimulator("equil_rsvd_and_rvvd_and_rvwvd.DATA"); const auto& eclipseState = simulator->vanguard().eclState(); Opm::GridManager gm(eclipseState.getInputGrid()); @@ -1134,16 +1150,16 @@ BOOST_AUTO_TEST_CASE(DeckWithRSVDAndRVVDAndRVWVD) const int first = 0, last = grid.number_of_cells - 1; const double reltol = 1.0e-4; - BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][first], 1.483499660e7, reltol); - BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][last], 1.547924516e7, reltol); - BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][first], 1.492499660e7, reltol); - BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][last], 1.548924516e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][first], 1.483359963e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::waterPhaseIdx][last], 1.549297524e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][first], 1.492359963e7, reltol); + BOOST_CHECK_CLOSE(pressures[FluidSystem::oilPhaseIdx][last], 1.550297524e7, reltol); const auto& sats = comp.saturation(); std::vector s_opm[3]; - s_opm[FluidSystem::waterPhaseIdx] = { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2223045711692897, 0.52882298575945874, 0.78152142505479982, 0.91816512259416283, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; - s_opm[FluidSystem::oilPhaseIdx] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.19637607881498206, 0.08183487740583717, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - s_opm[FluidSystem::gasPhaseIdx] = { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.7776954288307103, 0.47117701424054126, 0.02210249613021811, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + s_opm[FluidSystem::waterPhaseIdx] = { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.32527877578987319, 0.62976875867666171, 0.918795223850500588, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; + s_opm[FluidSystem::oilPhaseIdx] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.054786199472198836, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + s_opm[FluidSystem::gasPhaseIdx] = { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.674721224210102681, 0.37023124132333829, 0.026418562022795279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; for (int phase = 0; phase < 3; ++phase) { BOOST_REQUIRE_EQUAL(sats[phase].size(), s_opm[phase].size()); @@ -1155,27 +1171,27 @@ BOOST_AUTO_TEST_CASE(DeckWithRSVDAndRVVDAndRVWVD) const auto& rs = comp.rs(); const std::vector rs_opm { // opm - 74.62498302, 74.65959041, 74.69438035, 74.72935336, - 74.76450995, 74.79985061, 74.83537588, 74.87527065, - 74.96863769, 75.08891765, 52.5, 57.5, - 62.5, 67.5, 72.5, 76.45954841, - 76.70621045, 76.95287736, 77.19954913, 77.44622578}; + 74.617998198796087,74.652774471604374, 74.687905898686935, 74.723393674854691, + 74.759238999357947, 74.795443075905553, 74.832007112684167, 74.892422092838459, + 74.986801564438935, 75.088917653469338, 52.5, 57.5, + 62.5, 67.5, 72.5, 76.528193441026076, + 76.774856836636729, 77.021525099679991, 77.268198230347295, 77.514876228830232}; const auto& rv = comp.rv(); const std::vector rv_opm { - 2.50e-6, 7.50e-6, 1.25e-5, 1.75e-5, - 2.25e-5, 2.75e-5, 3.25e-5, 3.75e-5, - 4.25e-5, 2.51158386e-4, 2.52203372e-4, 5.75e-5, - 6.25e-5, 6.75e-5, 7.25e-5, 7.75e-5, - 8.25e-5, 8.75e-5, 9.25e-5, 9.75e-5}; + 2.5000000000000002e-06, 7.5000000000000002e-06, 1.2500000000000001e-05, 1.7500000000000002e-05, + 2.2500000000000001e-05, 2.7500000000000004e-05, 3.2500000000000004e-05, 3.7500000000000003e-05, + 4.2500000000000003e-05, 0.00025116322680309166, 5.2500000000000002e-05, 5.7500000000000002e-05, + 6.2500000000000001e-05, 6.7500000000000001e-05, 7.25e-05, 7.75e-05, + 8.25e-05, 8.7500000000000013e-05, 9.2500000000000012e-05, 9.7499999999999998e-05}; const auto& rvw = comp.rvw(); const std::vector rvw_opm { - 2.50e-6, 7.50e-6, 1.25e-5, 1.75e-5, - 2.25e-5, 2.75e-5, 3.25e-5, 3.75e-5, - 4.25e-5, 2.51158386e-4, 2.52203372e-4, 5.75e-5, - 6.25e-5, 6.75e-5, 7.25e-5, 7.75e-5, - 8.25e-5, 8.75e-5, 9.25e-5, 9.75e-5}; + 0.00024920798919277656, 0.00024941664682962629, 0.00024962743539212165, 0.00024984036204912818, + 0.00025005543399614773, 0.00025027265845543336, 0.000250492042676105, 0.00025071359393426718, + 0.00025093731953312241, 0.00025116322680309166, 0.00025236969680655122, 0.00025384953117447344, + 0.00025532939474124625, 0.00025680928750801825, 0.00025828920947593858, 0.00025976916064615645, + 0.00026124914101982041, 0.00026272915059807997, 0.0002642091893820838, 0.00026568925737298143}; for (size_t i = 0; i < rv_opm.size(); ++i) { BOOST_CHECK_CLOSE(rs[i], rs_opm[i], reltol);