opm-common
AICD.hpp
1 /*
2  Copyright 2020 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 AICD_HPP_HEADER_INCLUDED
21 #define AICD_HPP_HEADER_INCLUDED
22 
23 #include <opm/input/eclipse/Schedule/MSW/SICD.hpp>
24 
25 #include <map>
26 #include <string>
27 #include <utility>
28 #include <vector>
29 
30 namespace Opm {
31 
32  class DeckRecord;
33  class DeckKeyword;
34 
35 } // namespace Opm
36 
37 namespace Opm { namespace RestartIO {
38  struct RstSegment;
39 }} // namespace Opm::RestartIO
40 
41 namespace Opm {
42 
43  class AutoICD : public SICD
44  {
45  public:
46  AutoICD() = default;
47  explicit AutoICD(const DeckRecord& record);
48  explicit AutoICD(const RestartIO::RstSegment& rstSegment);
49 
50  static AutoICD serializationTestObject();
51 
52  // the function will return a map
53  // [
54  // "WELL1" : [<seg1, aicd1>, <seg2, aicd2> ...]
55  // ....
56  static std::map<std::string, std::vector<std::pair<int, AutoICD>>>
57  fromWSEGAICD(const DeckKeyword& wsegaicd);
58 
59  bool operator==(const AutoICD& data) const;
60 
61  template<class Serializer>
62  void serializeOp(Serializer& serializer)
63  {
64  this->SICD::serializeOp(serializer);
65  serializer(m_flow_rate_exponent);
66  serializer(m_visc_exponent);
67  serializer(m_oil_density_exponent);
68  serializer(m_water_density_exponent);
69  serializer(m_gas_density_exponent);
70  serializer(m_oil_viscosity_exponent);
71  serializer(m_water_viscosity_exponent);
72  serializer(m_gas_viscosity_exponent);
73  serializer(m_density_exponent);
74  }
75 
76  double flowRateExponent() const;
77  double viscExponent() const;
78  double oilDensityExponent() const;
79  double waterDensityExponent() const;
80  double gasDensityExponent() const;
81  double oilViscExponent() const;
82  double waterViscExponent() const;
83  double gasViscExponent() const;
84  double densityExponent() const;
85 
86  private:
87  double m_flow_rate_exponent {};
88  double m_visc_exponent {};
89  double m_oil_density_exponent {};
90  double m_water_density_exponent {};
91  double m_gas_density_exponent {};
92  double m_oil_viscosity_exponent {};
93  double m_water_viscosity_exponent {};
94  double m_gas_viscosity_exponent {};
95  double m_density_exponent {};
96  };
97 } // namespace Opm
98 
99 #endif // AICD_HPP_HEADER_INCLUDED
Definition: SICD.hpp:45
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: AICD.hpp:43
Definition: segment.hpp:33
Definition: DeckRecord.hpp:32
Class for (de-)serializing.
Definition: Serializer.hpp:94
Definition: DeckKeyword.hpp:36