OilVaporizationProperties.hpp
Go to the documentation of this file.
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 <memory>
24#include <vector>
25
26namespace Opm
27{
28 /*
29 * The OilVaporizationProperties class
30 * This classe is used to store the values from {VAPPARS, DRSDT, DRVDT}
31 * The VAPPARS and {DRSDT, DRVDT} are mutal exclusive and will cancel previous settings of the other keywords.
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 };
41
42
44 explicit OilVaporizationProperties(const size_t numPvtReginIdx);
45
47
48 static void updateDRSDT(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRSDT, const std::vector<std::string>& option);
49 static void updateDRVDT(Opm::OilVaporizationProperties& ovp, const std::vector<double>& maxDRVDT);
50 static void updateVAPPARS(Opm::OilVaporizationProperties& ovp, double vap1, double vap2);
51
53 double getMaxDRSDT(const size_t pvtRegionIdx) const;
54 double getMaxDRVDT(const size_t pvtRegionIdx) const;
55 bool getOption(const size_t pvtRegionIdx) const;
56 bool drsdtActive() const;
57 bool drvdtActive() const;
58 bool defined() const;
59 size_t numPvtRegions() const {return m_maxDRSDT.size();}
60
61 double vap1() const;
62 double vap2() const;
63
64 /*
65 * if either argument was default constructed == will always be false
66 * and != will always be true
67 */
70
71 template<class Serializer>
72 void serializeOp(Serializer& serializer)
73 {
74 serializer(m_type);
75 serializer(m_vap1);
76 serializer(m_vap2);
77 serializer(m_maxDRSDT);
78 serializer(m_maxDRSDT_allCells);
79 serializer(m_maxDRVDT);
80 }
81
82 private:
84 double m_vap1;
85 double m_vap2;
86 std::vector<double> m_maxDRSDT;
87 std::vector<bool> m_maxDRSDT_allCells;
88 std::vector<double> m_maxDRVDT;
89 };
90}
91#endif // DRSDT_H
Definition: OilVaporizationProperties.hpp:34
static void updateVAPPARS(Opm::OilVaporizationProperties &ovp, double vap1, double vap2)
static void updateDRSDT(Opm::OilVaporizationProperties &ovp, const std::vector< double > &maxDRSDT, const std::vector< std::string > &option)
size_t numPvtRegions() const
Definition: OilVaporizationProperties.hpp:59
void serializeOp(Serializer &serializer)
Definition: OilVaporizationProperties.hpp:72
OilVaporization
Definition: OilVaporizationProperties.hpp:36
OilVaporization getType() const
double getMaxDRSDT(const size_t pvtRegionIdx) const
bool operator==(const OilVaporizationProperties &) const
static void updateDRVDT(Opm::OilVaporizationProperties &ovp, const std::vector< double > &maxDRVDT)
bool getOption(const size_t pvtRegionIdx) const
static OilVaporizationProperties serializeObject()
double getMaxDRVDT(const size_t pvtRegionIdx) const
bool operator!=(const OilVaporizationProperties &) const
OilVaporizationProperties(const size_t numPvtReginIdx)
Definition: Serializer.hpp:38
Definition: A.hpp:4