mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
BlackoilWellModel: mode code using WellConnections to compile unit
This commit is contained in:
@@ -1239,4 +1239,24 @@ shouldIterateNetwork(const int reportStepIdx,
|
|||||||
network_imbalance > balance.pressure_tolerance();
|
network_imbalance > balance.pressure_tolerance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<int>
|
||||||
|
BlackoilWellModelGeneric::
|
||||||
|
getCellsForConnections(const Well& well) const
|
||||||
|
{
|
||||||
|
std::vector<int> wellCells;
|
||||||
|
// All possible connections of the well
|
||||||
|
const auto& connectionSet = well.getConnections();
|
||||||
|
wellCells.reserve(connectionSet.size());
|
||||||
|
|
||||||
|
for (const auto& connection : connectionSet)
|
||||||
|
{
|
||||||
|
int compressed_idx = compressedIndexForInterior(connection.global_index());
|
||||||
|
if (compressed_idx >= 0) { // Ignore connections in inactive/remote cells.
|
||||||
|
wellCells.push_back(compressed_idx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return wellCells;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -343,6 +343,7 @@ protected:
|
|||||||
/// \brief get compressed index for interior cells (-1, otherwise
|
/// \brief get compressed index for interior cells (-1, otherwise
|
||||||
virtual int compressedIndexForInterior(int cartesian_cell_idx) const = 0;
|
virtual int compressedIndexForInterior(int cartesian_cell_idx) const = 0;
|
||||||
|
|
||||||
|
std::vector<int> getCellsForConnections(const Well& well) const;
|
||||||
|
|
||||||
Schedule& schedule_;
|
Schedule& schedule_;
|
||||||
const SummaryState& summaryState_;
|
const SummaryState& summaryState_;
|
||||||
|
|||||||
@@ -128,20 +128,7 @@ namespace Opm {
|
|||||||
// initialize the additional cell connections introduced by wells.
|
// initialize the additional cell connections introduced by wells.
|
||||||
for (const auto& well : schedule_wells)
|
for (const auto& well : schedule_wells)
|
||||||
{
|
{
|
||||||
std::vector<int> wellCells;
|
std::vector<int> wellCells = this->getCellsForConnections(well);
|
||||||
// All possible connections of the well
|
|
||||||
const auto& connectionSet = well.getConnections();
|
|
||||||
wellCells.reserve(connectionSet.size());
|
|
||||||
|
|
||||||
for (std::size_t c = 0; c < connectionSet.size(); c++)
|
|
||||||
{
|
|
||||||
const auto& connection = connectionSet.get(c);
|
|
||||||
int compressed_idx = compressedIndexForInterior(connection.global_index());
|
|
||||||
if ( compressed_idx >= 0 ) { // Ignore connections in inactive/remote cells.
|
|
||||||
wellCells.push_back(compressed_idx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int cellIdx : wellCells) {
|
for (int cellIdx : wellCells) {
|
||||||
neighbors[cellIdx].insert(wellCells.begin(),
|
neighbors[cellIdx].insert(wellCells.begin(),
|
||||||
wellCells.end());
|
wellCells.end());
|
||||||
@@ -1288,19 +1275,7 @@ namespace Opm {
|
|||||||
// initialize the additional cell connections introduced by wells.
|
// initialize the additional cell connections introduced by wells.
|
||||||
for ( const auto& well : schedule_wells )
|
for ( const auto& well : schedule_wells )
|
||||||
{
|
{
|
||||||
std::vector<int> compressed_well_perforations;
|
std::vector<int> compressed_well_perforations = this->getCellsForConnections(well);
|
||||||
// All possible completions of the well
|
|
||||||
const auto& completionSet = well.getConnections();
|
|
||||||
compressed_well_perforations.reserve(completionSet.size());
|
|
||||||
|
|
||||||
for (const auto& connection: well.getConnections())
|
|
||||||
{
|
|
||||||
const int compressed_idx = compressedIndexForInterior(connection.global_index());
|
|
||||||
if ( compressed_idx >= 0 ) // Ignore completions in inactive/remote cells.
|
|
||||||
{
|
|
||||||
compressed_well_perforations.push_back(compressed_idx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// also include wells with no perforations in case
|
// also include wells with no perforations in case
|
||||||
std::sort(compressed_well_perforations.begin(),
|
std::sort(compressed_well_perforations.begin(),
|
||||||
|
|||||||
Reference in New Issue
Block a user