mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06: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();
|
||||
}
|
||||
|
||||
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
|
||||
virtual int compressedIndexForInterior(int cartesian_cell_idx) const = 0;
|
||||
|
||||
std::vector<int> getCellsForConnections(const Well& well) const;
|
||||
|
||||
Schedule& schedule_;
|
||||
const SummaryState& summaryState_;
|
||||
|
||||
@@ -128,20 +128,7 @@ namespace Opm {
|
||||
// initialize the additional cell connections introduced by wells.
|
||||
for (const auto& well : schedule_wells)
|
||||
{
|
||||
std::vector<int> wellCells;
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<int> wellCells = this->getCellsForConnections(well);
|
||||
for (int cellIdx : wellCells) {
|
||||
neighbors[cellIdx].insert(wellCells.begin(),
|
||||
wellCells.end());
|
||||
@@ -1288,19 +1275,7 @@ namespace Opm {
|
||||
// initialize the additional cell connections introduced by wells.
|
||||
for ( const auto& well : schedule_wells )
|
||||
{
|
||||
std::vector<int> compressed_well_perforations;
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
std::vector<int> compressed_well_perforations = this->getCellsForConnections(well);
|
||||
|
||||
// also include wells with no perforations in case
|
||||
std::sort(compressed_well_perforations.begin(),
|
||||
|
||||
Reference in New Issue
Block a user