diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index d9ccc535a..22d341b6c 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -329,8 +329,6 @@ namespace Opm { void addWellPressureEquations(PressureMatrix& jacobian, const BVector& weights,const bool use_well_weights) const; - std::vector> getMaxWellConnections() const; - void addWellPressureEquationsStruct(PressureMatrix& jacobian) const; void initGliftEclWellMap(GLiftEclWells &ecl_well_map); diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.cpp b/opm/simulators/wells/BlackoilWellModelGeneric.cpp index e0cc62c35..48615946c 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.cpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.cpp @@ -1369,4 +1369,28 @@ assignWellTracerRates(data::Wells& wsrpt, } } + std::vector> +BlackoilWellModelGeneric:: +getMaxWellConnections() const +{ + std::vector> wells; + + auto schedule_wells = schedule().getWellsatEnd(); + schedule_wells.erase(std::remove_if(schedule_wells.begin(), schedule_wells.end(), not_on_process_), schedule_wells.end()); + wells.reserve(schedule_wells.size()); + + // initialize the additional cell connections introduced by wells. + for ( const auto& well : schedule_wells ) + { + std::vector compressed_well_perforations = this->getCellsForConnections(well); + + // also include wells with no perforations in case + std::sort(compressed_well_perforations.begin(), + compressed_well_perforations.end()); + + wells.push_back(compressed_well_perforations); + } + return wells; +} + } diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.hpp b/opm/simulators/wells/BlackoilWellModelGeneric.hpp index ade3edff6..382c3a857 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.hpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.hpp @@ -382,6 +382,7 @@ protected: virtual int compressedIndexForInterior(int cartesian_cell_idx) const = 0; std::vector getCellsForConnections(const Well& well) const; + std::vector> getMaxWellConnections() const; std::vector getWellsForTesting(const int timeStepIdx, const double simulationTime); diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 21540239d..943647bd8 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -1472,31 +1472,6 @@ namespace Opm { return w.size(); } - template - std::vector> - BlackoilWellModel:: - getMaxWellConnections() const - { - std::vector> wells; - - auto schedule_wells = schedule().getWellsatEnd(); - schedule_wells.erase(std::remove_if(schedule_wells.begin(), schedule_wells.end(), not_on_process_), schedule_wells.end()); - wells.reserve(schedule_wells.size()); - - // initialize the additional cell connections introduced by wells. - for ( const auto& well : schedule_wells ) - { - std::vector compressed_well_perforations = this->getCellsForConnections(well); - - // also include wells with no perforations in case - std::sort(compressed_well_perforations.begin(), - compressed_well_perforations.end()); - - wells.push_back(compressed_well_perforations); - } - return wells; - } - template void BlackoilWellModel::