My Project
OilVaporizationProperties.hpp
1 /*
2  Copyright 2016 Statoil 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 #ifndef DRSDT_HPP
20 #define DRSDT_HPP
21 
22 #include <string>
23 #include <vector>
24 
25 namespace Opm
26 {
27  /*
28  * The OilVaporizationProperties class
29  * This classe is used to store the values from {VAPPARS, DRSDT, DRVDT, DRSDTCON}
30  * The VAPPARS and {DRSDT, DRVDT} are mutal exclusive and will cancel previous settings of the other keywords.
31  * The DRSDTCON implements a dissolution rate based on convective mixing.
32  * Ask for type first and the ask for the correct values for this type, asking for values not valid for the current type will throw a logic exception.
33  */
35  public:
36  enum class OilVaporization {
37  UNDEF = 0,
38  VAPPARS = 1,
39  DRDT = 2, // DRSDT or DRVDT
40  DRSDTCON = 3 // DRSDTCON
41  };
42 
43 
45  explicit OilVaporizationProperties(const size_t numPvtReginIdx);
46 
47  static OilVaporizationProperties serializeObject();
48 
49  static void updateDRSDT(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRSDT, const std::vector<std::string>& option);
50  static void updateDRSDTCON(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRSDT, const std::vector<std::string>& option);
51  static void updateDRVDT(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRVDT);
52  static void updateVAPPARS(Opm::OilVaporizationProperties& ovp, double vap1, double vap2);
53 
54  OilVaporization getType() const;
55  double getMaxDRSDT(const size_t pvtRegionIdx) const;
56  double getMaxDRVDT(const size_t pvtRegionIdx) const;
57  bool getOption(const size_t pvtRegionIdx) const;
58  bool drsdtActive() const;
59  bool drvdtActive() const;
60  bool drsdtConvective() const;
61  bool defined() const;
62  size_t numPvtRegions() const {return m_maxDRSDT.size();}
63 
64  double vap1() const;
65  double vap2() const;
66 
67  /*
68  * if either argument was default constructed == will always be false
69  * and != will always be true
70  */
71  bool operator==( const OilVaporizationProperties& ) const;
72  bool operator!=( const OilVaporizationProperties& ) const;
73 
74  template<class Serializer>
75  void serializeOp(Serializer& serializer)
76  {
77  serializer(m_type);
78  serializer(m_vap1);
79  serializer(m_vap2);
80  serializer(m_maxDRSDT);
81  serializer(m_maxDRSDT_allCells);
82  serializer(m_maxDRVDT);
83  }
84 
85  private:
86  OilVaporization m_type = OilVaporization::UNDEF;
87  double m_vap1;
88  double m_vap2;
89  std::vector<double> m_maxDRSDT;
90  std::vector<bool> m_maxDRSDT_allCells;
91  std::vector<double> m_maxDRVDT;
92  };
93 }
94 #endif // DRSDT_H
Definition: OilVaporizationProperties.hpp:34
Definition: Serializer.hpp:38
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29