Fix serial build

This commit is contained in:
Håkon Hægland committed 2025-12-22 17:23:24 +01:00
1 parent 6e28a2eb32
commit c1a2772bee
4 files changed
+42 -37

No files matched your search

+2 -2
View File
@@ -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
+31 -30
View File
@@ -45,14 +45,14 @@
#include <opm/simulators/wells/GuideRateHandler.hpp>
#include <opm/simulators/wells/ParallelPAvgDynamicSourceData.hpp>
#include <opm/simulators/wells/ParallelWBPCalculation.hpp>
#include <opm/simulators/wells/rescoup/RescoupReceiveGroupTargets.hpp>
#include <opm/simulators/wells/rescoup/RescoupTargetCalculator.hpp>
#include <opm/simulators/wells/VFPProperties.hpp>
#include <opm/simulators/wells/GroupStateHelper.hpp>
#ifdef RESERVOIR_COUPLING_ENABLED
#include <opm/simulators/wells/rescoup/RescoupSendSlaveGroupData.hpp>
#include <opm/simulators/wells/rescoup/RescoupReceiveGroupTargets.hpp>
#include <opm/simulators/wells/rescoup/RescoupReceiveSlaveGroupData.hpp>
#include <opm/simulators/wells/rescoup/RescoupSendSlaveGroupData.hpp>
#include <opm/simulators/wells/rescoup/RescoupTargetCalculator.hpp>
#endif
#include <opm/simulators/utils/DeferredLoggingErrorHelpers.hpp>
@@ -596,6 +596,34 @@ namespace Opm {
RescoupSendSlaveGroupData<Scalar, IndexTraits> slave_group_data_sender{this->groupStateHelper()};
slave_group_data_sender.sendSlaveGroupDataToMaster();
}
template<typename TypeTag>
void
BlackoilWellModel<TypeTag>::
sendMasterGroupTargetsToSlaves()
{
// This function is called by the master process to send the group targets to the slaves.
RescoupTargetCalculator<Scalar, IndexTraits> target_calculator{
this->guide_rate_handler_,
this->groupStateHelper()
};
target_calculator.calculateMasterGroupTargetsAndSendToSlaves();
}
template<typename TypeTag>
void
BlackoilWellModel<TypeTag>::
receiveGroupTargetsFromMaster(int reportStepIdx)
{
RescoupReceiveGroupTargets<Scalar, IndexTraits> target_receiver{
this->guide_rate_handler_,
this->wellState(),
this->groupState(),
reportStepIdx
};
target_receiver.receiveGroupTargetsFromMaster();
}
#endif // RESERVOIR_COUPLING_ENABLED
template<typename TypeTag>
@@ -655,33 +683,6 @@ namespace Opm {
}
}
template<typename TypeTag>
void
BlackoilWellModel<TypeTag>::
sendMasterGroupTargetsToSlaves()
{
// This function is called by the master process to send the group targets to the slaves.
RescoupTargetCalculator<Scalar, IndexTraits> target_calculator{
this->guide_rate_handler_,
this->groupStateHelper()
};
target_calculator.calculateMasterGroupTargetsAndSendToSlaves();
}
template<typename TypeTag>
void
BlackoilWellModel<TypeTag>::
receiveGroupTargetsFromMaster(int reportStepIdx)
{
RescoupReceiveGroupTargets<Scalar, IndexTraits> target_receiver{
this->guide_rate_handler_,
this->wellState(),
this->groupState(),
reportStepIdx
};
target_receiver.receiveGroupTargetsFromMaster();
}
// called at the end of a report step
template<typename TypeTag>
void
+6 -4
View File
@@ -1491,6 +1491,7 @@ GroupStateHelper<Scalar, IndexTraits>::worstOffendingWell(const Group& group,
// Private methods
// ---------------------------------------------------------------------
#ifdef RESERVOIR_COUPLING_ENABLED
template <typename Scalar, typename IndexTraits>
ReservoirCoupling::Phase
GroupStateHelper<Scalar, IndexTraits>::
@@ -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 <typename Scalar, typename IndexTraits>
Scalar
@@ -1589,10 +1591,10 @@ GroupStateHelper<Scalar, IndexTraits>::getGuideRateVector_(const std::vector<Sca
template <typename Scalar, typename IndexTraits>
Scalar
GroupStateHelper<Scalar, IndexTraits>::getReservoirCouplingMasterGroupRate_(const Group& group,
const int phase_pos,
const bool res_rates,
const bool is_injector) const
GroupStateHelper<Scalar, IndexTraits>::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()) {
+3 -1
View File
@@ -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