diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index a14e56cfa..a71253c43 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -106,7 +106,7 @@ namespace Opm { using SparseMatrixAdapter = GetPropType; typedef typename BaseAuxiliaryModule::NeighborSet NeighborSet; - using GasLiftSingleWell = ::Opm::GasLiftSingleWell; + using GasLiftSingleWell = GasLiftSingleWellGeneric; using GasLiftStage2 = ::Opm::GasLiftStage2; using GLiftWellStateMap = std::map>; diff --git a/opm/simulators/wells/GasLiftSingleWell.hpp b/opm/simulators/wells/GasLiftSingleWell.hpp index 58afc1c26..cafbae2b7 100644 --- a/opm/simulators/wells/GasLiftSingleWell.hpp +++ b/opm/simulators/wells/GasLiftSingleWell.hpp @@ -49,7 +49,7 @@ namespace Opm DeferredLogger &deferred_logger, WellState &well_state ); - const WellInterface &getStdWell() const { return std_well_; } + const WellInterfaceGeneric &getStdWell() const override { return std_well_; } private: std::optional computeBhpAtThpLimit_(double alq) const override; diff --git a/opm/simulators/wells/GasLiftSingleWellGeneric.hpp b/opm/simulators/wells/GasLiftSingleWellGeneric.hpp index b0e0fbd37..3b492e180 100644 --- a/opm/simulators/wells/GasLiftSingleWellGeneric.hpp +++ b/opm/simulators/wells/GasLiftSingleWellGeneric.hpp @@ -39,6 +39,7 @@ class DeferredLogger; class GasLiftWellState; class Schedule; class SummaryState; +class WellInterfaceGeneric; class WellState; class GasLiftSingleWellGeneric @@ -82,6 +83,8 @@ public: std::unique_ptr runOptimize(const int iteration_idx); + virtual const WellInterfaceGeneric& getStdWell() const = 0; + protected: GasLiftSingleWellGeneric(DeferredLogger &deferred_logger, WellState &well_state, diff --git a/opm/simulators/wells/GasLiftStage2.hpp b/opm/simulators/wells/GasLiftStage2.hpp index 0f70b0c80..d5299af46 100644 --- a/opm/simulators/wells/GasLiftStage2.hpp +++ b/opm/simulators/wells/GasLiftStage2.hpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include @@ -52,13 +52,13 @@ namespace Opm { template class GasLiftStage2 { - using GasLiftSingleWell = ::Opm::GasLiftSingleWell; + using GasLiftSingleWell = GasLiftSingleWellGeneric; using GLiftOptWells = std::map>; using GLiftProdWells = std::map; using GLiftWellStateMap = std::map>; using GradPair = std::pair; using GradPairItr = std::vector::iterator; - using GradInfo = typename GasLiftSingleWell::GradInfo; + using GradInfo = typename GasLiftSingleWellGeneric::GradInfo; using GradMap = std::map; using MPIComm = typename Dune::MPIHelper::MPICommunicator; #if DUNE_VERSION_NEWER(DUNE_COMMON, 2, 7) @@ -217,7 +217,6 @@ namespace Opm bool checkGasTarget(); bool checkOilTarget(); void updateRates(const std::string &name); - private: }; }; diff --git a/opm/simulators/wells/GasLiftStage2_impl.hpp b/opm/simulators/wells/GasLiftStage2_impl.hpp index e874acaee..21a8813a7 100644 --- a/opm/simulators/wells/GasLiftStage2_impl.hpp +++ b/opm/simulators/wells/GasLiftStage2_impl.hpp @@ -350,7 +350,7 @@ getCurrentWellRates_(const std::string &well_name, const std::string &group_name std::string debug_info; if (this->stage1_wells_.count(well_name) == 1) { GasLiftSingleWell &gs_well = *(this->stage1_wells_.at(well_name).get()); - const WellInterface &well = gs_well.getStdWell(); + const WellInterfaceGeneric &well = gs_well.getStdWell(); well_ptr = &well; GasLiftWellState &state = *(this->well_state_map_.at(well_name).get()); std::tie(oil_rate, gas_rate) = state.getRates(); @@ -435,7 +435,7 @@ getStdWellRates_(const WellInterfaceGeneric &well) // groups are located at the other nodes (not leaf nodes) of the tree // template -std::vector *> +std::vector GasLiftStage2:: getGroupGliftWells_(const Group &group) { @@ -1135,7 +1135,7 @@ updateRates(const std::string &well_name) const GradInfo &gi = this->parent.dec_grads_.at(well_name); GasLiftWellState &state = *(this->parent.well_state_map_.at(well_name).get()); GasLiftSingleWell &gs_well = *(this->parent.stage1_wells_.at(well_name).get()); - const WellInterface &well = gs_well.getStdWell(); + const WellInterfaceGeneric &well = gs_well.getStdWell(); // only get deltas for wells owned by this rank if (this->parent.well_state_.wellIsOwned(well.indexOfWell(), well_name)) { const auto &well_ecl = well.wellEcl();