My Project
Loading...
Searching...
No Matches
GroupEconProductionLimits.hpp
1/*
2 Copyright 2023 Equinor ASA.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef GROUP_ECON_PRODUCTION_LIMITS_H
21#define GROUP_ECON_PRODUCTION_LIMITS_H
22
23#include <map>
24#include <string>
25#include <optional>
26
27#include <opm/input/eclipse/Deck/UDAValue.hpp>
28#include <opm/input/eclipse/Units/UnitSystem.hpp>
29#include <opm/input/eclipse/Schedule/Schedule.hpp>
30#include <opm/input/eclipse/Schedule/SummaryState.hpp>
31#include <opm/common/utility/Serializer.hpp>
32#include <opm/common/utility/MemPacker.hpp>
33
34namespace Opm {
35
36class DeckRecord;
37
39public:
40 enum class EconWorkover {
41 NONE = 0,
42 CON = 1, // CON
43 CONP = 2, // +CON
44 WELL = 3,
45 PLUG = 4,
46 ALL = 5
47 };
48
49 class GEconGroup {
50 public:
51 GEconGroup() = default;
52 GEconGroup(const DeckRecord &record, const int report_step);
53 bool endRun() const;
54 UDAValue minOilRate() const;
55 UDAValue minGasRate() const;
56 UDAValue maxWaterCut() const;
57 UDAValue maxGasOilRatio() const;
58 UDAValue maxWaterGasRatio() const;
59 int maxOpenWells() const;
60 bool operator==(const GEconGroup& other) const;
61 int reportStep() const;
62 template<class Serializer>
63 void serializeOp(Serializer& serializer)
64 {
65 serializer(m_min_oil_rate);
66 serializer(m_min_gas_rate);
67 serializer(m_max_water_cut);
68 serializer(m_max_gas_oil_ratio);
69 serializer(m_max_water_gas_ratio);
70 serializer(m_workover);
71 serializer(m_end_run);
72 serializer(m_max_open_wells);
73 }
74 static GEconGroup serializationTestObject();
75 EconWorkover workover() const;
76
77 private:
78 UDAValue m_min_oil_rate;
79 UDAValue m_min_gas_rate;
80 UDAValue m_max_water_cut;
81 UDAValue m_max_gas_oil_ratio;
82 UDAValue m_max_water_gas_ratio;
83 EconWorkover m_workover;
84 bool m_end_run;
85 int m_max_open_wells;
86 int m_report_step; // Used to get UDQ undefined value
87 };
88
90 /* Same as GEconGroup but with UDA values realized at given report step*/
91 public:
92 GEconGroupProp(const double min_oil_rate,
93 const double min_gas_rate,
94 const double max_water_cut,
95 const double max_gas_oil_ratio,
96 const double max_water_gas_ratio,
97 EconWorkover workover,
98 bool end_run,
99 int max_open_wells);
100 bool endRun() const;
101 std::optional<double> minOilRate() const;
102 std::optional<double> minGasRate() const;
103 std::optional<double> maxWaterCut() const;
104 std::optional<double> maxGasOilRatio() const;
105 std::optional<double> maxWaterGasRatio() const;
106 int maxOpenWells() const;
107 EconWorkover workover() const;
108
109 private:
110 std::optional<double> m_min_oil_rate;
111 std::optional<double> m_min_gas_rate;
112 std::optional<double> m_max_water_cut;
113 std::optional<double> m_max_gas_oil_ratio;
114 std::optional<double> m_max_water_gas_ratio;
115 EconWorkover m_workover;
116 bool m_end_run;
117 int m_max_open_wells;
118 };
119
120 GroupEconProductionLimits() = default;
121 //explicit GroupEconProductionLimits(const RestartIO::RstWell& rstWell);
122
123 void add_group(const int report_step, const std::string &group_name, const DeckRecord &record);
124 static EconWorkover econWorkoverFromString(const std::string& string_value);
125 const GEconGroup& get_group(const std::string& gname) const;
126 GEconGroupProp get_group_prop(
127 const Schedule &schedule, const SummaryState &st, const std::string& gname) const;
128 bool has_group(const std::string& gname) const;
129 bool operator==(const GroupEconProductionLimits& other) const;
130 bool operator!=(const GroupEconProductionLimits& other) const;
131 template<class Serializer>
132 void serializeOp(Serializer& serializer) const
133 {
134 serializer(m_groups);
135 }
136 static GroupEconProductionLimits serializationTestObject();
137 size_t size() const;
138
139private:
140 std::map<std::string, GEconGroup> m_groups;
141};
142
143} // namespace Opm
144
145
146#endif
Definition DeckRecord.hpp:32
Definition GroupEconProductionLimits.hpp:89
Definition GroupEconProductionLimits.hpp:49
Definition GroupEconProductionLimits.hpp:38
Definition Schedule.hpp:133
Class for (de-)serializing.
Definition Serializer.hpp:84
Definition SummaryState.hpp:68
Definition UDAValue.hpp:32
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30