My Project
BCConfig.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 OPM_BCCONFIG_HPP
21#define OPM_BCCONFIG_HPP
22
23#include <vector>
24#include <cstddef>
25#include <optional>
26
27#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
28#include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp>
29
30
31namespace Opm {
32
33class Deck;
34class DeckRecord;
35
36enum class BCType {
37 RATE,
38 FREE,
39 DIRICHLET,
40 THERMAL
41};
42
43enum class BCComponent {
44 OIL,
45 GAS,
46 WATER,
47 SOLVENT,
48 POLYMER,
49 NONE
50};
51
52
53class BCConfig {
54public:
55
56 struct BCFace {
57 int i1,i2;
58 int j1,j2;
59 int k1,k2;
60 BCType bctype;
61 FaceDir::DirEnum dir;
62 BCComponent component;
63 double rate;
64 std::optional<double> pressure;
65 std::optional<double> temperature;
66
67 BCFace() = default;
68 explicit BCFace(const DeckRecord& record, const GridDims& grid);
69
70 static BCFace serializationTestObject();
71
72 bool operator==(const BCFace& other) const;
73
74 template<class Serializer>
75 void serializeOp(Serializer& serializer)
76 {
77 serializer(i1);
78 serializer(i2);
79 serializer(j1);
80 serializer(j2);
81 serializer(k1);
82 serializer(k2);
83 serializer(bctype);
84 serializer(dir);
85 serializer(component);
86 serializer(rate);
87 serializer(pressure);
88 serializer(temperature);
89 }
90 };
91
92
93 BCConfig() = default;
94 explicit BCConfig(const Deck& deck);
95
96 static BCConfig serializationTestObject();
97
98 std::size_t size() const;
99 std::vector<BCFace>::const_iterator begin() const;
100 std::vector<BCFace>::const_iterator end() const;
101 bool operator==(const BCConfig& other) const;
102
103 template<class Serializer>
104 void serializeOp(Serializer& serializer)
105 {
106 serializer(m_faces);
107 }
108
109private:
110 std::vector<BCFace> m_faces;
111};
112
113} //namespace Opm
114
115
116
117#endif
Definition: BCConfig.hpp:53
Definition: DeckRecord.hpp:32
Definition: Deck.hpp:49
Definition: GridDims.hpp:31
Class for (de-)serializing.
Definition: Serializer.hpp:84
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: BCConfig.hpp:56