opm-simulators
BlackoilWellModelGuideRates.hpp
1 /*
2  Copyright 2016 SINTEF ICT, Applied Mathematics.
3  Copyright 2016 - 2017 Statoil ASA.
4  Copyright 2017 Dr. Blatt - HPC-Simulation-Software & Services
5  Copyright 2016 - 2018 IRIS AS
6 
7  This file is part of the Open Porous Media project (OPM).
8 
9  OPM is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OPM is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OPM. If not, see <http://www.gnu.org/licenses/>.
21 */
22 
23 #ifndef OPM_BLACKOILWELLMODEL_GUIDE_RATES_HEADER_INCLUDED
24 #define OPM_BLACKOILWELLMODEL_GUIDE_RATES_HEADER_INCLUDED
25 
26 #include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
27 
28 #include <string>
29 #include <unordered_map>
30 
31 namespace Opm {
32 
33 template<typename Scalar, typename IndexTraits> class GroupStateHelper;
34 template<typename Scalar, typename IndexTraits> class BlackoilWellModelGeneric;
35 namespace data {
36 struct GroupData;
37 struct GroupGuideRates;
38 class GuideRateValue;
39 class Wells;
40 }
41 class Group;
42 class Well;
43 
45 template<typename Scalar, typename IndexTraits>
47 {
48 public:
50 
53  : wellModel_(wellModel)
54  {}
55 
57  std::unordered_map<std::string, data::GuideRateValue>
58  calculateWellGuideRates(const int reportStepIdx) const;
59 
61  void assignWellGuideRates(data::Wells& wsrpt,
62  const int reportStepIdx) const;
63 
65  std::unordered_map<std::string, data::GroupGuideRates>
66  calculateAllGroupGuideRates(const int reportStepIdx) const;
67 
69  void assignGroupGuideRates(const Group& group,
70  const std::unordered_map<std::string, data::GroupGuideRates>& groupGuideRates,
71  data::GroupData& gdata) const;
72 
74  bool guideRateUpdateIsNeeded(const int reportStepIdx) const;
75 
76  const GroupStateHelperType& groupStateHelper() const { return wellModel_.groupStateHelper(); }
77 
78 private:
80  void getGuideRateValues(const GuideRate::RateVector& qs,
81  const bool is_inj,
82  const std::string& wgname,
83  data::GuideRateValue& grval) const;
84 
86  data::GuideRateValue getGuideRateValues(const Well& well) const;
87 
89  data::GuideRateValue getGuideRateValues(const Group& group) const;
90 
92  data::GuideRateValue getGuideRateInjectionGroupValues(const Group& group) const;
93 
94  const BlackoilWellModelGeneric<Scalar, IndexTraits>& wellModel_;
95 };
96 
97 
98 } // namespace Opm
99 
100 #endif
Class for handling the blackoil well model.
Definition: ActionHandler.hpp:39
BlackoilWellModelGuideRates(const BlackoilWellModelGeneric< Scalar, IndexTraits > &wellModel)
Constructor initializes reference to the well model.
Definition: BlackoilWellModelGuideRates.hpp:52
bool guideRateUpdateIsNeeded(const int reportStepIdx) const
Check if a guide rate update is needed.
Definition: BlackoilWellModelGuideRates.cpp:588
void assignWellGuideRates(data::Wells &wsrpt, const int reportStepIdx) const
Assign well guide rates.
Definition: BlackoilWellModelGuideRates.cpp:478
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Definition: BlackoilWellModelConstraints.hpp:37
Class for handling the guide rates in the blackoil well model.
Definition: BlackoilWellModelGuideRates.hpp:46
std::unordered_map< std::string, data::GroupGuideRates > calculateAllGroupGuideRates(const int reportStepIdx) const
Calculates guide rate for all groups.
Definition: BlackoilWellModelGuideRates.cpp:500
std::unordered_map< std::string, data::GuideRateValue > calculateWellGuideRates(const int reportStepIdx) const
Calculate guide rate values for all wells.
Definition: BlackoilWellModelGuideRates.cpp:393
void assignGroupGuideRates(const Group &group, const std::unordered_map< std::string, data::GroupGuideRates > &groupGuideRates, data::GroupData &gdata) const
Assign group guide rates.
Definition: BlackoilWellModelGuideRates.cpp:560