mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
rename completion to connection
This commit is contained in:
parent
edbeb4538e
commit
22d144c3cd
@ -202,7 +202,7 @@ protected:
|
||||
new CartesianIndexMapper(*grid_, cartesianDimension_, cartesianCellId_);
|
||||
}
|
||||
|
||||
void filterCompletions_()
|
||||
void filterConnections_()
|
||||
{
|
||||
// not handling the removal of completions for this type of grid yet.
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ public:
|
||||
eclState_->getRestartConfig().overrideRestartWriteInterval(outputInterval);
|
||||
|
||||
asImp_().createGrids_();
|
||||
asImp_().filterCompletions_();
|
||||
asImp_().filterConnections_();
|
||||
asImp_().finalizeInit_();
|
||||
}
|
||||
|
||||
|
@ -264,8 +264,8 @@ protected:
|
||||
globalTrans_ = nullptr;
|
||||
}
|
||||
|
||||
// removing some completions located in inactive grid cells
|
||||
void filterCompletions_()
|
||||
// removing some connection located in inactive grid cells
|
||||
void filterConnections_()
|
||||
{
|
||||
assert(grid_);
|
||||
Grid grid = *grid_;
|
||||
|
@ -195,15 +195,15 @@ public:
|
||||
|| well->getPLTActive(reportStepNum)))
|
||||
continue;
|
||||
|
||||
for (const auto& completion: well->getConnections(reportStepNum)) {
|
||||
const size_t i = size_t(completion.getI());
|
||||
const size_t j = size_t(completion.getJ());
|
||||
const size_t k = size_t(completion.getK());
|
||||
for (const auto& connection: well->getConnections(reportStepNum)) {
|
||||
const size_t i = size_t(connection.getI());
|
||||
const size_t j = size_t(connection.getJ());
|
||||
const size_t k = size_t(connection.getK());
|
||||
const size_t index = simulator_.vanguard().eclState().getInputGrid().getGlobalIndex(i, j, k);
|
||||
|
||||
oilCompletionPressures_.emplace(std::make_pair(index, 0.0));
|
||||
waterCompletionSaturations_.emplace(std::make_pair(index, 0.0));
|
||||
gasCompletionSaturations_.emplace(std::make_pair(index, 0.0));
|
||||
oilConnectionPressures_.emplace(std::make_pair(index, 0.0));
|
||||
waterConnectionSaturations_.emplace(std::make_pair(index, 0.0));
|
||||
gasConnectionSaturations_.emplace(std::make_pair(index, 0.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -557,14 +557,14 @@ public:
|
||||
}
|
||||
|
||||
// Adding Well RFT data
|
||||
if (oilCompletionPressures_.count(cartesianIdx) > 0) {
|
||||
oilCompletionPressures_[cartesianIdx] = Opm::getValue(fs.pressure(oilPhaseIdx));
|
||||
if (oilConnectionPressures_.count(cartesianIdx) > 0) {
|
||||
oilConnectionPressures_[cartesianIdx] = Opm::getValue(fs.pressure(oilPhaseIdx));
|
||||
}
|
||||
if (waterCompletionSaturations_.count(cartesianIdx) > 0) {
|
||||
waterCompletionSaturations_[cartesianIdx] = Opm::getValue(fs.saturation(waterPhaseIdx));
|
||||
if (waterConnectionSaturations_.count(cartesianIdx) > 0) {
|
||||
waterConnectionSaturations_[cartesianIdx] = Opm::getValue(fs.saturation(waterPhaseIdx));
|
||||
}
|
||||
if (gasCompletionSaturations_.count(cartesianIdx) > 0) {
|
||||
gasCompletionSaturations_[cartesianIdx] = Opm::getValue(fs.saturation(gasPhaseIdx));
|
||||
if (gasConnectionSaturations_.count(cartesianIdx) > 0) {
|
||||
gasConnectionSaturations_[cartesianIdx] = Opm::getValue(fs.saturation(gasPhaseIdx));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -654,33 +654,33 @@ public:
|
||||
continue;
|
||||
wellData.connections.resize(well->getConnections(reportStepNum).size());
|
||||
size_t count = 0;
|
||||
for (const auto& completion: well->getConnections(reportStepNum)) {
|
||||
const size_t i = size_t(completion.getI());
|
||||
const size_t j = size_t(completion.getJ());
|
||||
const size_t k = size_t(completion.getK());
|
||||
for (const auto& connection: well->getConnections(reportStepNum)) {
|
||||
const size_t i = size_t(connection.getI());
|
||||
const size_t j = size_t(connection.getJ());
|
||||
const size_t k = size_t(connection.getK());
|
||||
|
||||
const size_t index = simulator_.vanguard().eclState().getInputGrid().getGlobalIndex(i, j, k);
|
||||
auto& completionData = wellData.connections[count];
|
||||
completionData.index = index;
|
||||
auto& connectionData = wellData.connections[count];
|
||||
connectionData.index = index;
|
||||
count++;
|
||||
}
|
||||
wellDatas.emplace(std::make_pair(well->name(), wellData));
|
||||
}
|
||||
|
||||
Opm::data::Well& wellData = wellDatas.at(well->name());
|
||||
for (auto& completionData: wellData.connections) {
|
||||
const auto index = completionData.index;
|
||||
if (oilCompletionPressures_.count(index) > 0)
|
||||
completionData.cell_pressure = oilCompletionPressures_.at(index);
|
||||
if (waterCompletionSaturations_.count(index) > 0)
|
||||
completionData.cell_saturation_water = waterCompletionSaturations_.at(index);
|
||||
if (gasCompletionSaturations_.count(index) > 0)
|
||||
completionData.cell_saturation_gas = gasCompletionSaturations_.at(index);
|
||||
for (auto& connectionData: wellData.connections) {
|
||||
const auto index = connectionData.index;
|
||||
if (oilConnectionPressures_.count(index) > 0)
|
||||
connectionData.cell_pressure = oilConnectionPressures_.at(index);
|
||||
if (waterConnectionSaturations_.count(index) > 0)
|
||||
connectionData.cell_saturation_water = waterConnectionSaturations_.at(index);
|
||||
if (gasConnectionSaturations_.count(index) > 0)
|
||||
connectionData.cell_saturation_gas = gasConnectionSaturations_.at(index);
|
||||
}
|
||||
}
|
||||
oilCompletionPressures_.clear();
|
||||
waterCompletionSaturations_.clear();
|
||||
gasCompletionSaturations_.clear();
|
||||
oilConnectionPressures_.clear();
|
||||
waterConnectionSaturations_.clear();
|
||||
gasConnectionSaturations_.clear();
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -1317,9 +1317,9 @@ private:
|
||||
ScalarBuffer pressureTimesPoreVolume_;
|
||||
ScalarBuffer pressureTimesHydrocarbonVolume_;
|
||||
std::map<std::pair<std::string, int>, double> blockData_;
|
||||
std::map<size_t, Scalar> oilCompletionPressures_;
|
||||
std::map<size_t, Scalar> waterCompletionSaturations_;
|
||||
std::map<size_t, Scalar> gasCompletionSaturations_;
|
||||
std::map<size_t, Scalar> oilConnectionPressures_;
|
||||
std::map<size_t, Scalar> waterConnectionSaturations_;
|
||||
std::map<size_t, Scalar> gasConnectionSaturations_;
|
||||
};
|
||||
} // namespace Ewoms
|
||||
|
||||
|
@ -156,7 +156,7 @@ protected:
|
||||
cartesianIndexMapper_ = new CartesianIndexMapper(*grid_);
|
||||
}
|
||||
|
||||
void filterCompletions_()
|
||||
void filterConnections_()
|
||||
{
|
||||
// not handling the removal of completions for this type of grid yet.
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ protected:
|
||||
}
|
||||
|
||||
void updateWellTopology_(unsigned reportStepIdx OPM_UNUSED,
|
||||
const WellConnectionsMap& wellCompletions,
|
||||
const WellConnectionsMap& wellConnections,
|
||||
std::vector<bool>& gridDofIsPenetrated) const
|
||||
{
|
||||
auto& model = simulator_.model();
|
||||
@ -643,14 +643,14 @@ protected:
|
||||
unsigned globalDofIdx = elemCtx.globalSpaceIndex(dofIdx, /*timeIdx=*/0);
|
||||
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
|
||||
// it...
|
||||
continue;
|
||||
|
||||
gridDofIsPenetrated[globalDofIdx] = true;
|
||||
|
||||
auto eclWell = wellCompletions.at(cartesianDofIdx).second;
|
||||
auto eclWell = wellConnections.at(cartesianDofIdx).second;
|
||||
eclWell->addDof(elemCtx, dofIdx);
|
||||
|
||||
wells.insert(eclWell);
|
||||
@ -666,7 +666,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void computeWellConnectionsMap_(unsigned reportStepIdx OPM_UNUSED, WellConnectionsMap& cartesianIdxToCompletionMap)
|
||||
void computeWellConnectionsMap_(unsigned reportStepIdx OPM_UNUSED, WellConnectionsMap& cartesianIdxToConnectionMap)
|
||||
{
|
||||
const auto& deckSchedule = simulator_.vanguard().schedule();
|
||||
|
||||
@ -679,7 +679,7 @@ protected:
|
||||
#endif
|
||||
|
||||
// compute the mapping from logically Cartesian indices to the well the
|
||||
// respective completion.
|
||||
// respective connection.
|
||||
const std::vector<const Opm::Well*>& deckWells = deckSchedule.getWells(reportStepIdx);
|
||||
for (size_t deckWellIdx = 0; deckWellIdx < deckWells.size(); ++deckWellIdx) {
|
||||
const Opm::Well* deckWell = deckWells[deckWellIdx];
|
||||
@ -690,7 +690,7 @@ protected:
|
||||
#ifndef NDEBUG
|
||||
if( simulator_.vanguard().grid().comm().size() == 1 )
|
||||
{
|
||||
std::cout << "Well '" << wellName << "' suddenly appears in the completions "
|
||||
std::cout << "Well '" << wellName << "' suddenly appears in the connection "
|
||||
<< "for the report step, but has not been previously specified. "
|
||||
<< "Ignoring.\n";
|
||||
}
|
||||
@ -699,21 +699,21 @@ protected:
|
||||
}
|
||||
|
||||
std::array<int, 3> cartesianCoordinate;
|
||||
// set the well parameters defined by the current set of completions
|
||||
const auto& completionSet = deckWell->getConnections(reportStepIdx);
|
||||
for (size_t complIdx = 0; complIdx < completionSet.size(); complIdx ++) {
|
||||
const auto& completion = completionSet.get(complIdx);
|
||||
cartesianCoordinate[ 0 ] = completion.getI();
|
||||
cartesianCoordinate[ 1 ] = completion.getJ();
|
||||
cartesianCoordinate[ 2 ] = completion.getK();
|
||||
// set the well parameters defined by the current set of connections
|
||||
const auto& connectionSet = deckWell->getConnections(reportStepIdx);
|
||||
for (size_t connIdx = 0; connIdx < connectionSet.size(); connIdx ++) {
|
||||
const auto& connection = connectionSet.get(connIdx);
|
||||
cartesianCoordinate[ 0 ] = connection.getI();
|
||||
cartesianCoordinate[ 1 ] = connection.getJ();
|
||||
cartesianCoordinate[ 2 ] = connection.getK();
|
||||
unsigned cartIdx = simulator_.vanguard().cartesianIndex( cartesianCoordinate );
|
||||
|
||||
// in this code we only support each cell to be part of at most a single
|
||||
// well. TODO (?) change this?
|
||||
assert(cartesianIdxToCompletionMap.count(cartIdx) == 0);
|
||||
assert(cartesianIdxToConnectionMap.count(cartIdx) == 0);
|
||||
|
||||
auto eclWell = wells_[wellIndex(wellName)];
|
||||
cartesianIdxToCompletionMap[cartIdx] = std::make_pair(&completion, eclWell);
|
||||
cartesianIdxToConnectionMap[cartIdx] = std::make_pair(&connection, eclWell);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -735,7 +735,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
// associate the well completions with grid cells and register them in the
|
||||
// associate the well connections with grid cells and register them in the
|
||||
// Peaceman well object
|
||||
const auto& vanguard = simulator_.vanguard();
|
||||
const GridView gridView = vanguard.gridView();
|
||||
@ -780,7 +780,7 @@ protected:
|
||||
// permeability by the one specified in the deck-> Note: this
|
||||
// is not implemented by opm-parser yet...
|
||||
/*
|
||||
Scalar Kh = completion->getEffectivePermeability();
|
||||
Scalar Kh = connection->getEffectivePermeability();
|
||||
if (std::isfinite(Kh) && Kh > 0.0)
|
||||
eclWell->setEffectivePermeability(elemCtx, dofIdx, Kh);
|
||||
*/
|
||||
|
@ -208,7 +208,7 @@ void test_readWriteWells() {
|
||||
w1.control = 1;
|
||||
|
||||
/*
|
||||
* the completion keys (active indices) and well names correspond to the
|
||||
* the connection keys (active indices) and well names correspond to the
|
||||
* input deck. All other entries in the well structures are arbitrary.
|
||||
*/
|
||||
w1.connections.push_back( { 88, rc1, 30.45, 123.45 } );
|
||||
|
Loading…
Reference in New Issue
Block a user