Skip to content

Commit

Permalink
Remove functions to filter connections
Browse files Browse the repository at this point in the history
  • Loading branch information
joakim-hove committed Oct 4, 2019
1 parent 3280f26 commit 94f679e
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 71 deletions.
1 change: 0 additions & 1 deletion opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ namespace Opm
Will remove all completions which are connected to cell which is not
active. Will scan through all wells and all timesteps.
*/
void filterConnections(const EclipseGrid& grid);
size_t size() const;

void applyAction(size_t reportStep, const Action::ActionX& action, const Action::Result& result);
Expand Down
1 change: 0 additions & 1 deletion opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ class Well2 {
bool handleCOMPLUMP(const DeckRecord& record);
bool handleWPIMULT(const DeckRecord& record);

void filterConnections(const EclipseGrid& grid);
void switchToInjector();
void switchToProducer();
ProductionControls productionControls(const SummaryState& st) const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ namespace Opm {

const_iterator begin() const { return this->m_connections.begin(); }
const_iterator end() const { return this->m_connections.end(); }
void filter(const EclipseGrid& grid);
bool allConnectionsShut() const;
/// Order connections irrespective of input order.
/// The algorithm used is the following:
Expand Down
26 changes: 0 additions & 26 deletions src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2483,32 +2483,6 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
}


void Schedule::filterConnections(const EclipseGrid& grid) {
for (auto& dynamic_pair : this->wells_static) {
auto& dynamic_state = dynamic_pair.second;
for (auto& well_pair : dynamic_state.unique()) {
if (well_pair.second)
well_pair.second->filterConnections(grid);
}
}

for (auto& dynamic_pair : this->wells_static) {
auto& dynamic_state = dynamic_pair.second;
for (auto& well_pair : dynamic_state.unique()) {
if (well_pair.second)
well_pair.second->filterConnections(grid);
}
}

for (auto& dynamic_pair : this->wells_static) {
auto& dynamic_state = dynamic_pair.second;
for (auto& well_pair : dynamic_state.unique()) {
if (well_pair.second)
well_pair.second->filterConnections(grid);
}
}
}

const VFPProdTable& Schedule::getVFPProdTable(int table_id, size_t timeStep) const {
const auto pair = vfpprod_tables.find(table_id);
if (pair == vfpprod_tables.end())
Expand Down
5 changes: 0 additions & 5 deletions src/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,6 @@ bool Well2::handleWELSEGS(const DeckKeyword& keyword) {
return false;
}

void Well2::filterConnections(const EclipseGrid& grid) {
this->connections->filter(grid);
}


std::size_t Well2::firstTimeStep() const {
return this->init_step;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,12 +465,4 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
return !( *this == rhs );
}


void WellConnections::filter(const EclipseGrid& grid) {
auto new_end = std::remove_if(m_connections.begin(),
m_connections.end(),
[&grid](const Connection& c) { return !grid.cellActive(c.getI(), c.getJ(), c.getK()); });
this->num_removed += std::distance(new_end, m_connections.end());
m_connections.erase(new_end, m_connections.end());
}
}
29 changes: 0 additions & 29 deletions tests/parser/ScheduleTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2924,35 +2924,6 @@ BOOST_AUTO_TEST_CASE(historic_BHP_and_THP) {
}
}

BOOST_AUTO_TEST_CASE(FilterCompletions2) {
EclipseGrid grid1(10,10,10);
std::vector<int> actnum(1000,1);
auto deck = createDeckWithWellsAndCompletionData();
TableManager table ( deck );
Eclipse3DProperties eclipseProperties ( deck , table, grid1);
Runspec runspec (deck);
Schedule schedule(deck, grid1 , eclipseProperties, runspec);
{
const auto& c1_1 = schedule.getWell2("OP_1", 1).getConnections();
const auto& c1_3 = schedule.getWell2("OP_1", 3).getConnections();
BOOST_CHECK_EQUAL(2, c1_1.size());
BOOST_CHECK_EQUAL(9, c1_3.size());
}
actnum[grid1.getGlobalIndex(8,8,1)] = 0;
{
EclipseGrid grid2(grid1, actnum);
schedule.filterConnections(grid2);

const auto& c1_1 = schedule.getWell2("OP_1", 1).getConnections();
const auto& c1_3 = schedule.getWell2("OP_1", 3).getConnections();
BOOST_CHECK_EQUAL(1, c1_1.size());
BOOST_CHECK_EQUAL(8, c1_3.size());

BOOST_CHECK_EQUAL(2, c1_1.inputSize());
BOOST_CHECK_EQUAL(9, c1_3.inputSize());
}
}




Expand Down

0 comments on commit 94f679e

Please sign in to comment.