diff --git a/opm/core/WellCollection.cpp b/opm/core/WellCollection.cpp index f873c259f..585c5eaaf 100644 --- a/opm/core/WellCollection.cpp +++ b/opm/core/WellCollection.cpp @@ -122,4 +122,22 @@ namespace Opm roots_[i]->applyInjGroupControls(); } } + + /// Applies explicit reinjection controls. This must be called at each timestep to be correct. + /// \param[in] well_reservoirrates_phase + /// A vector containing reservoir rates by phase for each well. + /// Is assumed to be ordered the same way as the related Wells-struct, + /// with all phase rates of a single well adjacent in the array. + /// \param[in] well_surfacerates_phase + /// A vector containing surface rates by phase for each well. + /// Is assumed to be ordered the same way as the related Wells-struct, + /// with all phase rates of a single well adjacent in the array. + + void WellCollection::applyExplicitReinjectionControls(const std::vector& well_reservoirrates_phase, + const std::vector& well_surfacerates_phase) + { + for (size_t i = 0; i < roots_.size(); ++i) { + roots_[i]->applyExplicitReinjectionControls(well_reservoirrates_phase, well_surfacerates_phase); + } + } } diff --git a/opm/core/WellCollection.hpp b/opm/core/WellCollection.hpp index a5db76d71..3e71ab020 100644 --- a/opm/core/WellCollection.hpp +++ b/opm/core/WellCollection.hpp @@ -88,6 +88,18 @@ namespace Opm /// Applies all group controls (injection and production) void applyGroupControls(); + /// Applies explicit reinjection controls. This must be called at each timestep to be correct. + /// \param[in] well_reservoirrates_phase + /// A vector containing reservoir rates by phase for each well. + /// Is assumed to be ordered the same way as the related Wells-struct, + /// with all phase rates of a single well adjacent in the array. + /// \param[in] well_surfacerates_phase + /// A vector containing surface rates by phase for each well. + /// Is assumed to be ordered the same way as the related Wells-struct, + /// with all phase rates of a single well adjacent in the array. + void applyExplicitReinjectionControls(const std::vector& well_reservoirrates_phase, + const std::vector& well_surfacerates_phase); + private: // To account for the possibility of a forest std::vector > roots_; diff --git a/opm/core/WellsManager.cpp b/opm/core/WellsManager.cpp index 6d3b782e3..d0d79b9bd 100644 --- a/opm/core/WellsManager.cpp +++ b/opm/core/WellsManager.cpp @@ -696,4 +696,20 @@ namespace Opm well_surfacerates_phase); } + /// Applies explicit reinjection controls. This must be called at each timestep to be correct. + /// \param[in] well_reservoirrates_phase + /// A vector containing reservoir rates by phase for each well. + /// Is assumed to be ordered the same way as the related Wells-struct, + /// with all phase rates of a single well adjacent in the array. + /// \param[in] well_surfacerates_phase + /// A vector containing surface rates by phase for each well. + /// Is assumed to be ordered the same way as the related Wells-struct, + /// with all phase rates of a single well adjacent in the array. + + void WellsManager::applyExplicitReinjectionControls(const std::vector& well_reservoirrates_phase, + const std::vector& well_surfacerates_phase) + { + well_collection_.applyExplicitReinjectionControls(well_reservoirrates_phase, well_surfacerates_phase); + } + } // namespace Opm diff --git a/opm/core/WellsManager.hpp b/opm/core/WellsManager.hpp index cdae43c16..61fb32c3d 100644 --- a/opm/core/WellsManager.hpp +++ b/opm/core/WellsManager.hpp @@ -86,6 +86,18 @@ namespace Opm bool conditionsMet(const std::vector& well_bhp, const std::vector& well_reservoirrates_phase, const std::vector& well_surfacerates_phase); + + /// Applies explicit reinjection controls. This must be called at each timestep to be correct. + /// \param[in] well_reservoirrates_phase + /// A vector containing reservoir rates by phase for each well. + /// Is assumed to be ordered the same way as the related Wells-struct, + /// with all phase rates of a single well adjacent in the array. + /// \param[in] well_surfacerates_phase + /// A vector containing surface rates by phase for each well. + /// Is assumed to be ordered the same way as the related Wells-struct, + /// with all phase rates of a single well adjacent in the array. + void applyExplicitReinjectionControls(const std::vector& well_reservoirrates_phase, + const std::vector& well_surfacerates_phase); private: // Disable copying and assignment.