BlackoilWellModelGuideRates.hpp
Go to the documentation of this file.
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
31namespace Opm {
32
33template<typename Scalar, typename IndexTraits> class WellGroupHelper;
34template<typename Scalar, typename IndexTraits> class BlackoilWellModelGeneric;
35namespace data {
36struct GroupData;
37struct GroupGuideRates;
38class GuideRateValue;
39class Wells;
40}
41class Group;
42class Well;
43
45template<typename Scalar, typename IndexTraits>
47{
48public:
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 WellGroupHelperType& wgHelper() const { return wellModel_.wgHelper(); }
77
78private:
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
95};
96
97
98} // namespace Opm
99
100#endif
Class for handling the blackoil well model.
Definition: BlackoilWellModelGeneric.hpp:95
Class for handling the guide rates in the blackoil well model.
Definition: BlackoilWellModelGuideRates.hpp:47
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.
std::unordered_map< std::string, data::GuideRateValue > calculateWellGuideRates(const int reportStepIdx) const
Calculate guide rate values for all wells.
void assignGroupGuideRates(const Group &group, const std::unordered_map< std::string, data::GroupGuideRates > &groupGuideRates, data::GroupData &gdata) const
Assign group guide rates.
std::unordered_map< std::string, data::GroupGuideRates > calculateAllGroupGuideRates(const int reportStepIdx) const
Calculates guide rate for all groups.
void assignWellGuideRates(data::Wells &wsrpt, const int reportStepIdx) const
Assign well guide rates.
const WellGroupHelperType & wgHelper() const
Definition: BlackoilWellModelGuideRates.hpp:76
Definition: WellGroupHelper.hpp:51
Definition: blackoilbioeffectsmodules.hh:43