BlackoilWellModel: move inferLocalShutWells to generic class

This commit is contained in:
Arne Morten Kvarving
2021-06-07 12:20:49 +02:00
parent ad4b34dc30
commit 172d344ab2
4 changed files with 24 additions and 28 deletions

View File

@@ -278,8 +278,6 @@ namespace Opm {
protected:
Simulator& ebosSimulator_;
std::vector<int> local_shut_wells_{};
// a vector of all the wells.
std::vector<WellInterfacePtr > well_container_{};
@@ -291,8 +289,6 @@ namespace Opm {
// create the well container
std::vector<WellInterfacePtr > createWellContainer(const int time_step);
void inferLocalShutWells();
WellInterfacePtr
createWellPointer(const int wellID,
const int time_step) const;

View File

@@ -1552,4 +1552,24 @@ forceShutWellByNameIfPredictionMode(const std::string& wellname,
return (well_was_shut == 1);
}
void
BlackoilWellModelGeneric::
inferLocalShutWells()
{
this->local_shut_wells_.clear();
const auto nw = this->numLocalWells();
auto used = std::vector<bool>(nw, false);
for (const auto& wellPtr : this->well_container_generic_) {
used[wellPtr->indexOfWell()] = true;
}
for (auto wellID = 0; wellID < nw; ++wellID) {
if (! used[wellID]) {
this->local_shut_wells_.push_back(wellID);
}
}
}
}

View File

@@ -315,6 +315,8 @@ protected:
void updateAndCommunicateGroupData(const int reportStepIdx,
const int iterationIdx);
void inferLocalShutWells();
const Schedule& schedule_;
const SummaryState& summaryState_;
const EclipseState& eclState_;
@@ -332,6 +334,8 @@ protected:
// a vector of all the wells.
std::vector<WellInterfaceGeneric*> well_container_generic_{};
std::vector<int> local_shut_wells_{};
std::vector<ParallelWellInfo> parallel_well_info_;
std::vector<ParallelWellInfo*> local_parallel_well_info_;

View File

@@ -708,30 +708,6 @@ namespace Opm {
template <typename TypeTag>
void BlackoilWellModel<TypeTag>::
inferLocalShutWells()
{
this->local_shut_wells_.clear();
const auto nw = this->numLocalWells();
auto used = std::vector<bool>(nw, false);
for (const auto& wellPtr : this->well_container_) {
used[wellPtr->indexOfWell()] = true;
}
for (auto wellID = 0; wellID < nw; ++wellID) {
if (! used[wellID]) {
this->local_shut_wells_.push_back(wellID);
}
}
}
template <typename TypeTag>
typename BlackoilWellModel<TypeTag>::WellInterfacePtr
BlackoilWellModel<TypeTag>::