My Project
WellEconProductionLimits.hpp
1 /*
2  Copyright 2016 SINTEF ICT, Applied Mathematics.
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 WELLECONPRODUCTIONLIMITS_HPP_HEADER_INCLUDED
21 #define WELLECONPRODUCTIONLIMITS_HPP_HEADER_INCLUDED
22 
23 #include <string>
24 
25 namespace Opm { namespace RestartIO {
26  struct RstWell;
27 }} // namespace Opm::RestartIO
28 
29 namespace Opm {
30 
31  class DeckRecord;
32 
34  public:
35 
36  enum class QuantityLimit {
37  RATE = 0,
38  POTN = 1
39  };
40 
41  static const std::string QuantityLimit2String(QuantityLimit enumValue);
42  static QuantityLimit QuantityLimitFromString(const std::string& stringValue);
43 
44 
45  enum class EconWorkover {
46  NONE = 0,
47  CON = 1, // CON
48  CONP = 2, // +CON
49  WELL = 3,
50  PLUG = 4,
51  // the following two only related to workover action
52  // on exceeding secondary water cut limit
53  LAST = 5,
54  RED = 6
55  };
56  static std::string EconWorkover2String(EconWorkover enumValue);
57  static EconWorkover EconWorkoverFromString(const std::string& stringValue);
58 
60  explicit WellEconProductionLimits(const DeckRecord& record);
61  explicit WellEconProductionLimits(const RestartIO::RstWell& rstWell);
62 
63  static WellEconProductionLimits serializationTestObject();
64 
65  // TODO: not handling things related to m_secondary_max_water_cut
66  // for the moment.
67 
68  // limit switch on?
69  bool onAnyEffectiveLimit() const;
70  bool onAnyRatioLimit() const;
71  bool onAnyRateLimit() const;
72  bool onMinOilRate() const;
73  bool onMinGasRate() const;
74  bool onMaxWaterCut() const;
75  bool onMaxGasOilRatio() const;
76  bool onMaxWaterGasRatio() const;
77  bool onSecondaryMaxWaterCut() const;
78  bool onMaxGasLiquidRatio() const;
79  // assuming Celsius temperature is used internally;
80  bool onMaxTemperature() const;
81  bool onMinLiquidRate() const;
82  bool onMinReservoirFluidRate() const;
83  // not sure what will happen if the followon well is a well does not exist.;
84  bool validFollowonWell() const;
85  bool requireWorkover() const;
86  bool requireSecondaryWorkover() const;
87  bool endRun() const;
88  double minOilRate() const;
89  double minGasRate() const;
90  double maxWaterCut() const;
91  double maxGasOilRatio() const;
92  double maxWaterGasRatio() const;
93  EconWorkover workover() const;
94  const std::string& followonWell() const;
95  QuantityLimit quantityLimit() const;
96  double maxSecondaryMaxWaterCut() const;
97  EconWorkover workoverSecondary() const;
98  double maxGasLiquidRatio() const;
99  double minLiquidRate() const;
100  double maxTemperature() const;
101  double minReservoirFluidRate() const;
102  bool operator==(const WellEconProductionLimits& other) const;
103  bool operator!=(const WellEconProductionLimits& other) const;
104 
105  template<class Serializer>
106  void serializeOp(Serializer& serializer)
107  {
108  serializer(m_min_oil_rate);
109  serializer(m_min_gas_rate);
110  serializer(m_max_water_cut);
111  serializer(m_max_gas_oil_ratio);
112  serializer(m_max_water_gas_ratio);
113  serializer(m_workover);
114  serializer(m_end_run);
115  serializer(m_followon_well);
116  serializer(m_quantity_limit);
117  serializer(m_secondary_max_water_cut);
118  serializer(m_workover_secondary);
119  serializer(m_max_gas_liquid_ratio);
120  serializer(m_min_liquid_rate);
121  serializer(m_max_temperature);
122  serializer(m_min_reservoir_fluid_rate);
123  }
124 
125  private:
126  double m_min_oil_rate;
127  double m_min_gas_rate;
128  double m_max_water_cut;
129  double m_max_gas_oil_ratio;
130  double m_max_water_gas_ratio;
131  EconWorkover m_workover;
132  bool m_end_run;
133  std::string m_followon_well;
134  QuantityLimit m_quantity_limit;
135  double m_secondary_max_water_cut;
136  EconWorkover m_workover_secondary;
137  double m_max_gas_liquid_ratio;
138  double m_min_liquid_rate;
139  double m_max_temperature;
140  double m_min_reservoir_fluid_rate;
141  };
142 } // namespace Opm
143 
144 #endif // WELLECONPRODUCTIONLIMITS_HPP_HEADER_INCLUDED
Definition: DeckRecord.hpp:32
Class for (de-)serializing.
Definition: Serializer.hpp:75
Definition: WellEconProductionLimits.hpp:33
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: well.hpp:43