Rename Completions -> Connections

This commit is contained in:
Joakim Hove 2018-06-10 21:15:37 +02:00
parent 3b5e746702
commit 2bd9c0ea78
4 changed files with 23 additions and 23 deletions

View File

@ -266,7 +266,7 @@ protected:
Grid grid = *grid_; Grid grid = *grid_;
grid.switchToGlobalView(); grid.switchToGlobalView();
const auto eclipseGrid = Opm::UgGridHelpers::createEclipseGrid(grid, this->eclState().getInputGrid()); const auto eclipseGrid = Opm::UgGridHelpers::createEclipseGrid(grid, this->eclState().getInputGrid());
this->schedule().filterCompletions(eclipseGrid); this->schedule().filterConnections(eclipseGrid);
} }
Grid* grid_; Grid* grid_;

View File

@ -192,7 +192,7 @@ public:
|| well->getPLTActive(reportStepNum))) || well->getPLTActive(reportStepNum)))
continue; continue;
for (const auto& completion: well->getCompletions(reportStepNum)) { for (const auto& completion: well->getConnections(reportStepNum)) {
const size_t i = size_t(completion.getI()); const size_t i = size_t(completion.getI());
const size_t j = size_t(completion.getJ()); const size_t j = size_t(completion.getJ());
const size_t k = size_t(completion.getK()); const size_t k = size_t(completion.getK());
@ -649,15 +649,15 @@ public:
if (!(well->getRFTActive(reportStepNum) if (!(well->getRFTActive(reportStepNum)
|| well->getPLTActive(reportStepNum))) || well->getPLTActive(reportStepNum)))
continue; continue;
wellData.completions.resize(well->getCompletions(reportStepNum).size()); wellData.connections.resize(well->getConnections(reportStepNum).size());
size_t count = 0; size_t count = 0;
for (const auto& completion: well->getCompletions(reportStepNum)) { for (const auto& completion: well->getConnections(reportStepNum)) {
const size_t i = size_t(completion.getI()); const size_t i = size_t(completion.getI());
const size_t j = size_t(completion.getJ()); const size_t j = size_t(completion.getJ());
const size_t k = size_t(completion.getK()); const size_t k = size_t(completion.getK());
const size_t index = simulator_.vanguard().eclState().getInputGrid().getGlobalIndex(i, j, k); const size_t index = simulator_.vanguard().eclState().getInputGrid().getGlobalIndex(i, j, k);
auto& completionData = wellData.completions[count]; auto& completionData = wellData.connections[count];
completionData.index = index; completionData.index = index;
count++; count++;
} }
@ -665,7 +665,7 @@ public:
} }
Opm::data::Well& wellData = wellDatas.at(well->name()); Opm::data::Well& wellData = wellDatas.at(well->name());
for (auto& completionData: wellData.completions) { for (auto& completionData: wellData.connections) {
const auto index = completionData.index; const auto index = completionData.index;
if (oilCompletionPressures_.count(index) > 0) if (oilCompletionPressures_.count(index) > 0)
completionData.cell_pressure = oilCompletionPressures_.at(index); completionData.cell_pressure = oilCompletionPressures_.at(index);

View File

@ -36,7 +36,7 @@
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp> #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/ConnectionSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
#include <opm/material/common/Exceptions.hpp> #include <opm/material/common/Exceptions.hpp>
@ -80,7 +80,7 @@ class EclWellManager
typedef Ewoms::EclPeacemanWell<TypeTag> Well; typedef Ewoms::EclPeacemanWell<TypeTag> Well;
typedef std::map<int, std::pair<const Opm::Completion*, std::shared_ptr<Well> > > WellCompletionsMap; typedef std::map<int, std::pair<const Opm::Connection*, std::shared_ptr<Well> > > WellConnectionsMap;
typedef Dune::FieldVector<Evaluation, numEq> EvalEqVector; typedef Dune::FieldVector<Evaluation, numEq> EvalEqVector;
@ -128,8 +128,8 @@ public:
{ {
unsigned episodeIdx = simulator_.episodeIndex(); unsigned episodeIdx = simulator_.episodeIndex();
WellCompletionsMap wellCompMap; WellConnectionsMap wellCompMap;
computeWellCompletionsMap_(episodeIdx, wellCompMap); computeWellConnectionsMap_(episodeIdx, wellCompMap);
if (wasRestarted || wellTopologyChanged_(eclState, deckSchedule, episodeIdx)) if (wasRestarted || wellTopologyChanged_(eclState, deckSchedule, episodeIdx))
updateWellTopology_(episodeIdx, wellCompMap, gridDofIsPenetrated_); updateWellTopology_(episodeIdx, wellCompMap, gridDofIsPenetrated_);
@ -604,7 +604,7 @@ protected:
} }
void updateWellTopology_(unsigned reportStepIdx OPM_UNUSED, void updateWellTopology_(unsigned reportStepIdx OPM_UNUSED,
const WellCompletionsMap& wellCompletions, const WellConnectionsMap& wellCompletions,
std::vector<bool>& gridDofIsPenetrated) const std::vector<bool>& gridDofIsPenetrated) const
{ {
auto& model = simulator_.model(); auto& model = simulator_.model();
@ -663,7 +663,7 @@ protected:
} }
} }
void computeWellCompletionsMap_(unsigned reportStepIdx OPM_UNUSED, WellCompletionsMap& cartesianIdxToCompletionMap) void computeWellConnectionsMap_(unsigned reportStepIdx OPM_UNUSED, WellConnectionsMap& cartesianIdxToCompletionMap)
{ {
const auto& deckSchedule = simulator_.vanguard().schedule(); const auto& deckSchedule = simulator_.vanguard().schedule();
@ -697,7 +697,7 @@ protected:
std::array<int, 3> cartesianCoordinate; std::array<int, 3> cartesianCoordinate;
// set the well parameters defined by the current set of completions // set the well parameters defined by the current set of completions
const auto& completionSet = deckWell->getCompletions(reportStepIdx); const auto& completionSet = deckWell->getConnections(reportStepIdx);
for (size_t complIdx = 0; complIdx < completionSet.size(); complIdx ++) { for (size_t complIdx = 0; complIdx < completionSet.size(); complIdx ++) {
const auto& completion = completionSet.get(complIdx); const auto& completion = completionSet.get(complIdx);
cartesianCoordinate[ 0 ] = completion.getI(); cartesianCoordinate[ 0 ] = completion.getI();
@ -715,7 +715,7 @@ protected:
} }
} }
void updateWellParameters_(unsigned reportStepIdx, const WellCompletionsMap& wellCompletions) void updateWellParameters_(unsigned reportStepIdx, const WellConnectionsMap& wellConnections)
{ {
const auto& deckSchedule = simulator_.vanguard().schedule(); const auto& deckSchedule = simulator_.vanguard().schedule();
const std::vector<const Opm::Well*>& deckWells = deckSchedule.getWells(reportStepIdx); const std::vector<const Opm::Well*>& deckWells = deckSchedule.getWells(reportStepIdx);
@ -753,14 +753,14 @@ protected:
unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0); unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0);
unsigned cartesianDofIdx = vanguard.cartesianIndex(globalDofIdx); unsigned cartesianDofIdx = vanguard.cartesianIndex(globalDofIdx);
if (wellCompletions.count(cartesianDofIdx) == 0) if (wellConnections.count(cartesianDofIdx) == 0)
// the current DOF is not contained in any well, so we must skip // the current DOF is not contained in any well, so we must skip
// it... // it...
continue; continue;
const auto& compInfo = wellCompletions.at(cartesianDofIdx); const auto& connInfo = wellConnections.at(cartesianDofIdx);
const Opm::Completion* completion = compInfo.first; const Opm::Connection* connection = connInfo.first;
std::shared_ptr<Well> eclWell = compInfo.second; std::shared_ptr<Well> eclWell = connInfo.second;
eclWell->addDof(elemCtx, dofIdx); eclWell->addDof(elemCtx, dofIdx);
// the catch is a hack for a ideosyncrasy of opm-parser with regard to // the catch is a hack for a ideosyncrasy of opm-parser with regard to
@ -768,7 +768,7 @@ protected:
// completion, there seems to be no other way to detect this except for // completion, there seems to be no other way to detect this except for
// catching the exception // catching the exception
try { try {
eclWell->setRadius(elemCtx, dofIdx, 0.5*completion->getDiameter()); eclWell->setRadius(elemCtx, dofIdx, 0.5*connection->getDiameter());
} }
catch (const std::logic_error&) catch (const std::logic_error&)
{} {}
@ -784,7 +784,7 @@ protected:
// overwrite the automatically computed connection // overwrite the automatically computed connection
// transmissibilty factor by the one specified in the deck-> // transmissibilty factor by the one specified in the deck->
const auto& ctf = completion->getConnectionTransmissibilityFactorAsValueObject(); const auto& ctf = connection->getConnectionTransmissibilityFactorAsValueObject();
if (ctf.hasValue() && ctf.getValue() > 0.0) if (ctf.hasValue() && ctf.getValue() > 0.0)
eclWell->setConnectionTransmissibilityFactor(elemCtx, dofIdx, ctf.getValue()); eclWell->setConnectionTransmissibilityFactor(elemCtx, dofIdx, ctf.getValue());
} }

View File

@ -210,14 +210,14 @@ void test_readWriteWells() {
* the completion keys (active indices) and well names correspond to the * the completion keys (active indices) and well names correspond to the
* input deck. All other entries in the well structures are arbitrary. * input deck. All other entries in the well structures are arbitrary.
*/ */
w1.completions.push_back( { 88, rc1, 30.45, 123.45 } ); w1.connections.push_back( { 88, rc1, 30.45, 123.45 } );
w1.completions.push_back( { 288, rc2, 33.19, 67.89 } ); w1.connections.push_back( { 288, rc2, 33.19, 67.89 } );
w2.rates = r2; w2.rates = r2;
w2.bhp = 2.34; w2.bhp = 2.34;
w2.temperature = 4.56; w2.temperature = 4.56;
w2.control = 2; w2.control = 2;
w2.completions.push_back( { 188, rc3, 36.22, 19.28 } ); w2.connections.push_back( { 188, rc3, 36.22, 19.28 } );
Opm::data::Wells wellRates; Opm::data::Wells wellRates;