diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 2c72586f11..f121238f37 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -225,7 +225,6 @@ list (APPEND MAIN_SOURCE_FILES opm/simulators/wells/GroupEconomicLimitsChecker.cpp opm/simulators/wells/GroupState.cpp opm/simulators/wells/GroupStateHelper.cpp - opm/simulators/wells/GroupTargetCalculator.cpp opm/simulators/wells/MSWellHelpers.cpp opm/simulators/wells/MultisegmentWellAssemble.cpp opm/simulators/wells/MultisegmentWellEquations.cpp @@ -1169,7 +1168,6 @@ list (APPEND PUBLIC_HEADER_FILES opm/simulators/wells/GroupEconomicLimitsChecker.hpp opm/simulators/wells/GroupState.hpp opm/simulators/wells/GroupStateHelper.hpp - opm/simulators/wells/GroupTargetCalculator.hpp opm/simulators/wells/GuideRateHandler.hpp opm/simulators/wells/MSWellHelpers.hpp opm/simulators/wells/MultisegmentWell.hpp @@ -1379,6 +1377,7 @@ if(MPI_FOUND) opm/simulators/flow/rescoup/ReservoirCouplingSlaveReportStep.cpp opm/simulators/flow/rescoup/ReservoirCouplingSpawnSlaves.cpp opm/simulators/flow/rescoup/ReservoirCouplingTimeStepper.cpp + opm/simulators/wells/GroupTargetCalculator.cpp opm/simulators/wells/rescoup/RescoupReceiveGroupTargets.cpp opm/simulators/wells/rescoup/RescoupReceiveSlaveGroupData.cpp opm/simulators/wells/rescoup/RescoupSendSlaveGroupData.cpp @@ -1395,6 +1394,7 @@ if(MPI_FOUND) opm/simulators/flow/rescoup/ReservoirCouplingSlaveReportStep.hpp opm/simulators/flow/rescoup/ReservoirCouplingSpawnSlaves.hpp opm/simulators/flow/rescoup/ReservoirCouplingTimeStepper.hpp + opm/simulators/wells/GroupTargetCalculator.hpp opm/simulators/wells/rescoup/RescoupProxy.hpp opm/simulators/wells/rescoup/RescoupReceiveSlaveGroupData.hpp opm/simulators/wells/rescoup/RescoupReceiveGroupTargets.hpp diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 60295a671f..3819323924 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -45,14 +45,14 @@ #include #include #include -#include -#include #include #include #ifdef RESERVOIR_COUPLING_ENABLED -#include +#include #include +#include +#include #endif #include @@ -596,6 +596,34 @@ namespace Opm { RescoupSendSlaveGroupData slave_group_data_sender{this->groupStateHelper()}; slave_group_data_sender.sendSlaveGroupDataToMaster(); } + + template + void + BlackoilWellModel:: + sendMasterGroupTargetsToSlaves() + { + // This function is called by the master process to send the group targets to the slaves. + RescoupTargetCalculator target_calculator{ + this->guide_rate_handler_, + this->groupStateHelper() + }; + target_calculator.calculateMasterGroupTargetsAndSendToSlaves(); + } + + template + void + BlackoilWellModel:: + receiveGroupTargetsFromMaster(int reportStepIdx) + { + RescoupReceiveGroupTargets target_receiver{ + this->guide_rate_handler_, + this->wellState(), + this->groupState(), + reportStepIdx + }; + target_receiver.receiveGroupTargetsFromMaster(); + } + #endif // RESERVOIR_COUPLING_ENABLED template @@ -655,33 +683,6 @@ namespace Opm { } } - template - void - BlackoilWellModel:: - sendMasterGroupTargetsToSlaves() - { - // This function is called by the master process to send the group targets to the slaves. - RescoupTargetCalculator target_calculator{ - this->guide_rate_handler_, - this->groupStateHelper() - }; - target_calculator.calculateMasterGroupTargetsAndSendToSlaves(); - } - - template - void - BlackoilWellModel:: - receiveGroupTargetsFromMaster(int reportStepIdx) - { - RescoupReceiveGroupTargets target_receiver{ - this->guide_rate_handler_, - this->wellState(), - this->groupState(), - reportStepIdx - }; - target_receiver.receiveGroupTargetsFromMaster(); - } - // called at the end of a report step template void diff --git a/opm/simulators/wells/GroupStateHelper.cpp b/opm/simulators/wells/GroupStateHelper.cpp index 5e7bbfee8a..da2527781e 100644 --- a/opm/simulators/wells/GroupStateHelper.cpp +++ b/opm/simulators/wells/GroupStateHelper.cpp @@ -1491,6 +1491,7 @@ GroupStateHelper::worstOffendingWell(const Group& group, // Private methods // --------------------------------------------------------------------- +#ifdef RESERVOIR_COUPLING_ENABLED template ReservoirCoupling::Phase GroupStateHelper:: @@ -1517,6 +1518,7 @@ activePhaseIdxToRescoupPhase_(int phase_pos) const throw std::logic_error("Invalid phase_pos in activePhaseIdxToRescoupPhase"); return ReservoirCoupling::Phase::Oil; // just to avoid warning } +#endif template Scalar @@ -1589,10 +1591,10 @@ GroupStateHelper::getGuideRateVector_(const std::vector Scalar -GroupStateHelper::getReservoirCouplingMasterGroupRate_(const Group& group, - const int phase_pos, - const bool res_rates, - const bool is_injector) const +GroupStateHelper::getReservoirCouplingMasterGroupRate_([[maybe_unused]] const Group& group, + [[maybe_unused]] const int phase_pos, + [[maybe_unused]] const bool res_rates, + [[maybe_unused]] const bool is_injector) const { #ifdef RESERVOIR_COUPLING_ENABLED if (this->isReservoirCouplingMaster()) { diff --git a/opm/simulators/wells/GroupStateHelper.hpp b/opm/simulators/wells/GroupStateHelper.hpp index 917cab4437..b46fe54547 100644 --- a/opm/simulators/wells/GroupStateHelper.hpp +++ b/opm/simulators/wells/GroupStateHelper.hpp @@ -346,12 +346,14 @@ public: DeferredLogger& deferred_logger) const; private: +#ifdef RESERVOIR_COUPLING_ENABLED /// @brief Convert active phase index to ReservoirCoupling::Phase enum /// @param phase_pos Active phase index (0, 1, or 2 in a 3-phase model) /// @return The corresponding ReservoirCoupling::Phase enum value /// @note This uses the canonical phase ordering (Oil=0, Gas=1, Water=2) - ReservoirCoupling::Phase activePhaseIdxToRescoupPhase_(int phase_pos) const; +#endif + //! \brief Compute partial efficiency factor for addback calculation. //! //! The addback in constraint checking must use the partial efficiency factor