diff --git a/opm/input/eclipse/Schedule/Schedule.cpp b/opm/input/eclipse/Schedule/Schedule.cpp index 20fe97a8c01..17b837b8428 100644 --- a/opm/input/eclipse/Schedule/Schedule.cpp +++ b/opm/input/eclipse/Schedule/Schedule.cpp @@ -1688,16 +1688,6 @@ File {} line {}.)", pattern, location.keyword, location.filename, location.linen this->checkIfAllConnectionsIsShut(report_step); } - - void Schedule::filterConnections(const ActiveGridCells& grid) { - for (auto& sched_state : this->snapshots) { - for (auto& well : sched_state.wells()) { - well.get().filterConnections(grid); - } - } - } - - const UDQConfig& Schedule::getUDQConfig(std::size_t timeStep) const { return this->snapshots[timeStep].udq.get(); } diff --git a/opm/input/eclipse/Schedule/Schedule.hpp b/opm/input/eclipse/Schedule/Schedule.hpp index 6a8a8ab7422..adfc3b58226 100644 --- a/opm/input/eclipse/Schedule/Schedule.hpp +++ b/opm/input/eclipse/Schedule/Schedule.hpp @@ -369,11 +369,6 @@ namespace Opm { const Group& getGroup(const std::string& groupName, std::size_t timeStep) const; std::optional first_RFT() const; - /* - Will remove all completions which are connected to cell which is not - active. Will scan through all wells and all timesteps. - */ - void filterConnections(const ActiveGridCells& grid); std::size_t size() const; bool write_rst_file(std::size_t report_step) const; diff --git a/opm/input/eclipse/Schedule/Well/Well.cpp b/opm/input/eclipse/Schedule/Well/Well.cpp index 9353b1f89fd..5a11b9bec66 100644 --- a/opm/input/eclipse/Schedule/Well/Well.cpp +++ b/opm/input/eclipse/Schedule/Well/Well.cpp @@ -1920,11 +1920,6 @@ bool Well::updateICDFlowScalingFactors() return false; } -void Well::filterConnections(const ActiveGridCells& grid) -{ - this->connections->filter(grid); -} - std::size_t Well::firstTimeStep() const { return this->init_step; diff --git a/opm/input/eclipse/Schedule/Well/Well.hpp b/opm/input/eclipse/Schedule/Well/Well.hpp index 67f8e97be8b..fdeeef18bc6 100644 --- a/opm/input/eclipse/Schedule/Well/Well.hpp +++ b/opm/input/eclipse/Schedule/Well/Well.hpp @@ -587,7 +587,6 @@ class Well { bool applyGlobalWPIMULT(double scale_factor); void addWellSegmentsFromLengthsAndDepths(const std::vector>& lengths_and_depths, double diameter, const KeywordLocation& location); - void filterConnections(const ActiveGridCells& grid); ProductionControls productionControls(const SummaryState& st) const; InjectionControls injectionControls(const SummaryState& st) const; int vfp_table_number() const; diff --git a/opm/input/eclipse/Schedule/Well/WellConnections.cpp b/opm/input/eclipse/Schedule/Well/WellConnections.cpp index c5234cfe71c..f0b88938921 100644 --- a/opm/input/eclipse/Schedule/Well/WellConnections.cpp +++ b/opm/input/eclipse/Schedule/Well/WellConnections.cpp @@ -1054,16 +1054,6 @@ CF and Kh items for well {} must both be specified or both defaulted/negative)", return ! (*this == rhs); } - void WellConnections::filter(const ActiveGridCells& grid) - { - auto isInactive = [&grid](const Connection& c) { - return !grid.cellActive(c.getI(), c.getJ(), c.getK()); - }; - - auto new_end = std::remove_if(m_connections.begin(), m_connections.end(), isInactive); - m_connections.erase(new_end, m_connections.end()); - } - double WellConnections::segment_perf_length(int segment) const { double perf_length = 0; diff --git a/opm/input/eclipse/Schedule/Well/WellConnections.hpp b/opm/input/eclipse/Schedule/Well/WellConnections.hpp index d3395af9c18..45d3e7a7667 100644 --- a/opm/input/eclipse/Schedule/Well/WellConnections.hpp +++ b/opm/input/eclipse/Schedule/Well/WellConnections.hpp @@ -132,7 +132,6 @@ namespace Opm { const_iterator end() const { return this->m_connections.end(); } auto begin() { return this->m_connections.begin(); } auto end() { return this->m_connections.end(); } - void filter(const ActiveGridCells& grid); bool allConnectionsShut() const; /// Order connections irrespective of input order. /// The algorithm used is the following: diff --git a/tests/parser/ConnectionTests.cpp b/tests/parser/ConnectionTests.cpp index 1700ba9bdc3..95d932f53eb 100644 --- a/tests/parser/ConnectionTests.cpp +++ b/tests/parser/ConnectionTests.cpp @@ -534,7 +534,7 @@ END ctf_props.rw = 0.234; ctf_props.r0 = 0.157; - connP.addConnection(9, 9, 1, // 10, 10, 2 + connP.addConnection(8, 9, 0, // 9, 10, 1 199, Opm::Connection::State::OPEN, 2015.0, ctf_props, 1); @@ -569,7 +569,7 @@ END } // Reset CF -- simulating COMPDAT record (active cell) - connP.addConnection(8, 9, 1, // 10, 10, 2 + connP.addConnection(8, 9, 1, // 9, 10, 2 198, Opm::Connection::State::OPEN, 2015.0, ctf_props, 1); @@ -586,27 +586,14 @@ END BOOST_CHECK_CLOSE(connP[3].CF(), 50.0*cp_rm3_per_db(), 1.0e-10); } - const auto& grid = es.getInputGrid(); - const auto actCells = Opm::ActiveGridCells { - std::size_t{10}, std::size_t{10}, std::size_t{3}, - grid.getActiveMap().data(), - grid.getNumActive() - }; - - connP.filter(actCells); - - BOOST_REQUIRE_EQUAL(connP.size(), std::size_t{3}); - BOOST_CHECK_CLOSE(connP[0].CF(), 16.0*expectCF , 1.0e-10); - BOOST_CHECK_CLOSE(connP[1].CF(), 16.0*expectCF , 1.0e-10); - BOOST_CHECK_CLOSE(connP[2].CF(), 50.0*cp_rm3_per_db(), 1.0e-10); - { std::vector scalingApplicable; connP.applyWellPIScaling(2.0, scalingApplicable); BOOST_CHECK_CLOSE(connP[0].CF(), 32.0*expectCF , 1.0e-10); BOOST_CHECK_CLOSE(connP[1].CF(), 32.0*expectCF , 1.0e-10); - BOOST_CHECK_CLOSE(connP[2].CF(), 50.0*cp_rm3_per_db(), 1.0e-10); + BOOST_CHECK_CLOSE(connP[2].CF(), 400.0*cp_rm3_per_db(), 1.0e-10); + BOOST_CHECK_CLOSE(connP[3].CF(), 50.0*cp_rm3_per_db(), 1.0e-10); } } diff --git a/tests/parser/ScheduleTests.cpp b/tests/parser/ScheduleTests.cpp index 5aa23e606b3..4f64a662cb7 100644 --- a/tests/parser/ScheduleTests.cpp +++ b/tests/parser/ScheduleTests.cpp @@ -387,48 +387,6 @@ WELSPECS )" }; } - std::string createDeckWithWellsAndCompletionData() - { - return { R"( -START -- 0 -1 NOV 1979 / -GRID -PORO - 1000*0.1 / -PERMX - 1000*1 / -PERMY - 1000*0.1 / -PERMZ - 1000*0.01 / -SCHEDULE -DATES -- 1 - 1 DES 1979/ -/ -WELSPECS - 'OP_1' 'OP' 9 9 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / - 'OP_2' 'OP' 8 8 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / - 'OP_3' 'OP' 7 7 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / -/ -COMPDAT - 'OP_1' 9 9 1 1 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / - 'OP_1' 9 9 2 2 'OPEN' 1* 46.825 0.311 4332.346 1* 1* 'X' 22.123 / - 'OP_2' 8 8 1 3 'OPEN' 1* 1.168 0.311 107.872 1* 1* 'Y' 21.925 / - 'OP_2' 8 7 3 3 'OPEN' 1* 15.071 0.311 1391.859 1* 1* 'Y' 21.920 / - 'OP_2' 8 7 3 6 'OPEN' 1* 6.242 0.311 576.458 1* 1* 'Y' 21.915 / - 'OP_3' 7 7 1 1 'OPEN' 1* 27.412 0.311 2445.337 1* 1* 'Y' 18.521 / - 'OP_3' 7 7 2 2 'OPEN' 1* 55.195 0.311 4923.842 1* 1* 'Y' 18.524 / -/ -DATES -- 2,3 - 10 JUL 2007 / - 10 AUG 2007 / -/ -COMPDAT // with defaulted I and J - 'OP_1' 0 * 3 9 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / -/ -)" }; - } - bool has_name(const std::vector& names, const std::string& name) { @@ -3828,48 +3786,6 @@ WCONINJH } } -BOOST_AUTO_TEST_CASE(FilterCompletions2) { - const auto& deck = Parser{}.parseString(createDeckWithWellsAndCompletionData()); - EclipseGrid grid1(10,10,10); - const TableManager table ( deck ); - const FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); - const Runspec runspec (deck); - - /* mutable */ Schedule schedule { - deck, grid1, fp, NumericalAquifers{}, - runspec, std::make_shared() - }; - - std::vector actnum = grid1.getACTNUM(); - - { - const auto& c1_1 = schedule.getWell("OP_1", 1).getConnections(); - const auto& c1_3 = schedule.getWell("OP_1", 3).getConnections(); - BOOST_CHECK_EQUAL(2U, c1_1.size()); - BOOST_CHECK_EQUAL(9U, c1_3.size()); - } - - actnum[grid1.getGlobalIndex(8,8,1)] = 0; - { - std::vector globalCell(grid1.getNumActive()); - for(std::size_t i = 0; i < grid1.getNumActive(); ++i) { - if (actnum[grid1.getGlobalIndex(i)]) { - globalCell[i] = grid1.getGlobalIndex(i); - } - } - - ActiveGridCells active(grid1.getNXYZ(), globalCell.data(), - grid1.getNumActive()); - - schedule.filterConnections(active); - - const auto& c1_1 = schedule.getWell("OP_1", 1).getConnections(); - const auto& c1_3 = schedule.getWell("OP_1", 3).getConnections(); - BOOST_CHECK_EQUAL(1U, c1_1.size()); - BOOST_CHECK_EQUAL(8U, c1_3.size()); - } -} - BOOST_AUTO_TEST_CASE(VFPINJ_TEST) { const std::string input = R"( START