Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions opm/input/eclipse/Schedule/Schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
5 changes: 0 additions & 5 deletions opm/input/eclipse/Schedule/Schedule.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,11 +369,6 @@ namespace Opm {
const Group& getGroup(const std::string& groupName, std::size_t timeStep) const;

std::optional<std::size_t> 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;
Expand Down
5 changes: 0 additions & 5 deletions opm/input/eclipse/Schedule/Well/Well.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion opm/input/eclipse/Schedule/Well/Well.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ class Well {
bool applyGlobalWPIMULT(double scale_factor);
void addWellSegmentsFromLengthsAndDepths(const std::vector<std::pair<double, double>>& 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;
Expand Down
10 changes: 0 additions & 10 deletions opm/input/eclipse/Schedule/Well/WellConnections.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion opm/input/eclipse/Schedule/Well/WellConnections.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 4 additions & 17 deletions tests/parser/ConnectionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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<bool> 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);
}
}

Expand Down
84 changes: 0 additions & 84 deletions tests/parser/ScheduleTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string>& names,
const std::string& name)
{
Expand Down Expand Up @@ -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<Python>()
};

std::vector<int> 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<int> 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
Expand Down