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