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 <opm/input/eclipse/Deck/UDAValue.hpp>
24#include <opm/common/utility/Serializer.hpp>
25#include <opm/common/utility/MemPacker.hpp>
26
27#include <map>
28#include <optional>
29#include <string>
30
31namespace Opm {
32
33class DeckRecord;
34class Schedule;
35class SummaryState;
36
38public:
39 enum class EconWorkover {
40 NONE = 0,
41 CON = 1, // CON
42 CONP = 2, // +CON
43 WELL = 3,
44 PLUG = 4,
45 ALL = 5
46 };
47
48 class GEconGroup {
49 public:
50 GEconGroup() = default;
51 GEconGroup(const DeckRecord &record, const int report_step);
52 bool endRun() const;
53 UDAValue minOilRate() const;
54 UDAValue minGasRate() const;
55 UDAValue maxWaterCut() const;
56 UDAValue maxGasOilRatio() const;
57 UDAValue maxWaterGasRatio() const;
58 int maxOpenWells() const;
59 bool operator==(const GEconGroup& other) const;
60 int reportStep() const;
61 template<class Serializer>
62 void serializeOp(Serializer& serializer)
63 {
64 serializer(m_min_oil_rate);
65 serializer(m_min_gas_rate);
66 serializer(m_max_water_cut);
67 serializer(m_max_gas_oil_ratio);
68 serializer(m_max_water_gas_ratio);
69 serializer(m_workover);
70 serializer(m_end_run);
71 serializer(m_max_open_wells);
72 }
73 static GEconGroup serializationTestObject();
74 EconWorkover workover() const;
75
76 private:
77 UDAValue m_min_oil_rate;
78 UDAValue m_min_gas_rate;
79 UDAValue m_max_water_cut;
80 UDAValue m_max_gas_oil_ratio;
81 UDAValue m_max_water_gas_ratio;
82 EconWorkover m_workover;
83 bool m_end_run;
84 int m_max_open_wells;
85 int m_report_step; // Used to get UDQ undefined value
86 };
87
89 /* Same as GEconGroup but with UDA values realized at given report step*/
90 public:
91 GEconGroupProp(const double min_oil_rate,
92 const double min_gas_rate,
93 const double max_water_cut,
94 const double max_gas_oil_ratio,
95 const double max_water_gas_ratio,
96 EconWorkover workover,
97 bool end_run,
98 int max_open_wells);
99 bool endRun() const;
100 std::optional<double> minOilRate() const;
101 std::optional<double> minGasRate() const;
102 std::optional<double> maxWaterCut() const;
103 std::optional<double> maxGasOilRatio() const;
104 std::optional<double> maxWaterGasRatio() const;
105 int maxOpenWells() const;
106 EconWorkover workover() const;
107
108 private:
109 std::optional<double> m_min_oil_rate;
110 std::optional<double> m_min_gas_rate;
111 std::optional<double> m_max_water_cut;
112 std::optional<double> m_max_gas_oil_ratio;
113 std::optional<double> m_max_water_gas_ratio;
114 EconWorkover m_workover;
115 bool m_end_run;
116 int m_max_open_wells;
117 };
118
119 GroupEconProductionLimits() = default;
120 //explicit GroupEconProductionLimits(const RestartIO::RstWell& rstWell);
121
122 void add_group(const int report_step, const std::string &group_name, const DeckRecord &record);
123 static EconWorkover econWorkoverFromString(const std::string& string_value);
124 const GEconGroup& get_group(const std::string& gname) const;
125 GEconGroupProp get_group_prop(
126 const Schedule &schedule, const SummaryState &st, const std::string& gname) const;
127 bool has_group(const std::string& gname) const;
128 bool operator==(const GroupEconProductionLimits& other) const;
129 bool operator!=(const GroupEconProductionLimits& other) const;
130 template<class Serializer>
131 void serializeOp(Serializer& serializer) const
132 {
133 serializer(m_groups);
134 }
135 static GroupEconProductionLimits serializationTestObject();
136 size_t size() const;
137
138private:
139 std::map<std::string, GEconGroup> m_groups;
140};
141
142} // namespace Opm
143
144
145#endif
Definition DeckRecord.hpp:32
Definition GroupEconProductionLimits.hpp:88
Definition GroupEconProductionLimits.hpp:48
Definition GroupEconProductionLimits.hpp:37
Definition Schedule.hpp:88
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