ExtboContainer.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
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 2 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 Consult the COPYING file in the top-level source directory of this
19 module for the precise wording of the license and the list of
20 copyright holders.
21*/
26#ifndef OPM_EXTBO_CONTAINER_HPP
27#define OPM_EXTBO_CONTAINER_HPP
28
29#include <map>
30#include <string>
31#include <utility>
32#include <vector>
33
34namespace Opm {
35
36namespace data { class Solution; }
37
38template<class Scalar>
40{
41 using ScalarBuffer = std::vector<Scalar>;
42
43public:
47 {
50 Scalar rs;
51 Scalar rv;
52 Scalar xVolume;
53 Scalar yVolume;
54 Scalar oilDensity;
55 Scalar gasDensity;
57 };
58
61 static std::pair<Scalar, Scalar>
63
64 void allocate(const unsigned bufferSize,
65 std::map<std::string, int>& rstKeywords,
66 const bool extendedOutput,
67 const bool log);
68
69 void assignMassFractions(const unsigned globalDofIdx,
70 const Scalar gas,
71 const Scalar oil,
72 const Scalar co2);
73
74 void assignVolumes(const unsigned globalDofIdx,
75 const Scalar xVolume,
76 const Scalar yVolume);
77
78 void assignZFraction(const unsigned globalDofIdx,
79 const Scalar zFraction);
80
81 void assignPhaseMassFractions(const unsigned globalDofIdx,
82 const Scalar oil,
83 const Scalar gas);
84
85 void outputRestart(data::Solution& sol);
86
87 bool allocated() const
88 { return allocated_; }
89
91 { return !oilPhaseSolventMassFraction_.empty() || !gasPhaseSolventMassFraction_.empty(); }
92
93private:
94 bool allocated_ = false;
95 bool warnedUnwritten_ = false;
96 ScalarBuffer X_volume_;
97 ScalarBuffer Y_volume_;
98 ScalarBuffer Z_fraction_;
99 ScalarBuffer mFracOil_;
100 ScalarBuffer mFracGas_;
101 ScalarBuffer mFracCo2_;
102 ScalarBuffer oilPhaseSolventMassFraction_;
103 ScalarBuffer gasPhaseSolventMassFraction_;
104};
105
106} // namespace Opm
107
108#endif // OPM_EXTBO_CONTAINER_HPP
Definition: ExtboContainer.hpp:40
void assignVolumes(const unsigned globalDofIdx, const Scalar xVolume, const Scalar yVolume)
void outputRestart(data::Solution &sol)
void assignMassFractions(const unsigned globalDofIdx, const Scalar gas, const Scalar oil, const Scalar co2)
void assignZFraction(const unsigned globalDofIdx, const Scalar zFraction)
void assignPhaseMassFractions(const unsigned globalDofIdx, const Scalar oil, const Scalar gas)
void allocate(const unsigned bufferSize, std::map< std::string, int > &rstKeywords, const bool extendedOutput, const bool log)
static std::pair< Scalar, Scalar > phaseSolventMassFractions(const PhaseFractionInput &cell)
bool allocated() const
Definition: ExtboContainer.hpp:87
bool phaseMassFractionsRequested() const
Definition: ExtboContainer.hpp:90
Definition: blackoilbioeffectsmodules.hh:45
Definition: ExtboContainer.hpp:47
Scalar rs
Definition: ExtboContainer.hpp:50
Scalar oilDensity
Definition: ExtboContainer.hpp:54
Scalar rv
Definition: ExtboContainer.hpp:51
Scalar solventDensity
Definition: ExtboContainer.hpp:56
Scalar oilSaturation
Definition: ExtboContainer.hpp:48
Scalar yVolume
Definition: ExtboContainer.hpp:53
Scalar xVolume
Definition: ExtboContainer.hpp:52
Scalar gasSaturation
Definition: ExtboContainer.hpp:49
Scalar gasDensity
Definition: ExtboContainer.hpp:55