mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
BlackoilWellModel: move inferLocalShutWells to generic class
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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_;
|
||||
|
||||
|
||||
@@ -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>::
|
||||
|
||||
Reference in New Issue
Block a user