From 0e1e4e08e74854c6b421d0e2c0c96a08206c17cc Mon Sep 17 00:00:00 2001 From: Jostein Alvestad Date: Wed, 5 Sep 2018 23:31:40 +0200 Subject: [PATCH] Added changes to improve handling of ICON --- .../eclipse/AggregateConnectionData.cpp | 14 ++++----- .../EclipseState/Schedule/WellConnections.cpp | 30 ++++++++++--------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/opm/output/eclipse/AggregateConnectionData.cpp b/src/opm/output/eclipse/AggregateConnectionData.cpp index 6af0fb47d..563c650eb 100755 --- a/src/opm/output/eclipse/AggregateConnectionData.cpp +++ b/src/opm/output/eclipse/AggregateConnectionData.cpp @@ -54,11 +54,11 @@ namespace { { // make seqIndex to Connection map std::map seqIndConnMap; - //std::cout << "mapSeqIndexToConnection(" << std::endl; + std::cout << "mapSeqIndexToConnection(" << std::endl; for (const auto & conn : conns) { std::size_t sI = conn.getSeqIndex(); seqIndConnMap.insert(std::make_pair(sI, &conn)); - //std::cout << "mCSSITC sI: " << sI << " conn.getI,J,K" << conn.getI() << " , " << conn.getJ() << " , " << conn.getK() << std::endl; + std::cout << "mCSSITC sI: " << sI << " conn.getI,J,K" << conn.getI() << " , " << conn.getJ() << " , " << conn.getK() << std::endl; } return seqIndConnMap; } @@ -67,11 +67,11 @@ namespace { { // make CompSegSeqIndex to Connection map std::map cs_seqIndConnMap; - //std::cout << "mapCompSegSeqIndexToConnection" << std::endl; + std::cout << "mapCompSegSeqIndexToConnection" << std::endl; for (const auto & conn : conns) { std::size_t sI = conn.getCompSegSeqIndex(); cs_seqIndConnMap.insert(std::make_pair(sI, &conn)); - //std::cout << "mCSSITC sI: " << sI << " conn.getI,J,K" << conn.getI() << " , " << conn.getJ() << " , " << conn.getK() << std::endl; + std::cout << "mCSSITC sI: " << sI << " conn.getI,J,K" << conn.getI() << " , " << conn.getJ() << " , " << conn.getK() << std::endl; } return cs_seqIndConnMap; } @@ -104,13 +104,13 @@ namespace { sIToConn = mapSeqIndexToConnection(conns); } std::vector connSI; - int niSI = well->getConnections(sim_step).size(); - //std::cout << "ConnOP - well" << well->name() << " niSI: " << niSI << std::endl; + int niSI = well->getActiveConnections(sim_step).size(); + std::cout << "ConnOP - well" << well->name() << " niSI: " << niSI << std::endl; for (int iSI = 0; iSI < niSI; iSI++) { const auto searchSI = sIToConn.find(static_cast(iSI)); if (searchSI != sIToConn.end()) { connSI.push_back(searchSI->second); - //std::cout << "ConnOP - iSI " << iSI << " searchSI->second.getI,J,K" << searchSI->second->getI() << " , " << searchSI->second->getJ() << " , " << searchSI->second->getK() << std::endl; + std::cout << "ConnOP - iSI " << iSI << " searchSI->second.getI,J,K" << searchSI->second->getI() << " , " << searchSI->second->getJ() << " , " << searchSI->second->getK() << std::endl; } } for (auto nConn = connSI.size(), connID = 0*nConn; diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/WellConnections.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/WellConnections.cpp index 879264044..b46077533 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/WellConnections.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/WellConnections.cpp @@ -285,10 +285,11 @@ namespace { this->m_connections.end(), same_ijk ); // Only add connection for active grid cells - if (prev == this->m_connections.end()) { - if (grid.cellActive(I, J, k)) { - std::size_t noConn = this->m_connections.size(); - this->addConnection(I,J,k, + if (grid.cellActive(I, J, k)) { + if (prev == this->m_connections.end()) { + std::size_t noConn = this->m_connections.size(); + std::cout << "WellConnections - WC - prev-end, I: " << I << " J: " << J << " k: " << k << " noConn: " << noConn << std::endl; + this->addConnection(I,J,k, grid.getCellDepth( I,J,k ), state, CF, @@ -297,13 +298,14 @@ namespace { satTableId, direction, noConn, 0., 0., defaultSatTable); - } - } else { - std::size_t noConn = prev->getSeqIndex(); - // The complnum value carries over; the rest of the state is fully specified by - // the current COMPDAT keyword. - int complnum = prev->complnum(); - *prev = Connection(I,J,k, + } + else { + std::size_t noConn = prev->getSeqIndex(); + std::cout << "WellConnections - WC - prev-exist, I: " << I << " J: " << J << " k: " << k << " noConn: " << noConn << std::endl; + // The complnum value carries over; the rest of the state is fully specified by + // the current COMPDAT keyword. + int complnum = prev->complnum; + *prev = Connection(I,J,k, complnum, grid.getCellDepth(I,J,k), state, @@ -313,13 +315,13 @@ namespace { satTableId, direction, noConn, 0., 0., defaultSatTable); - } - } + } + } + } } - size_t WellConnections::size() const { return m_connections.size(); }