Aquancon.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2017 TNO
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_AQUANCON_HPP
21#define OPM_AQUANCON_HPP
22
23/*
24 Aquancon is a data container object meant to hold the data from the AQUANCON keyword.
25 This also includes the logic for parsing and connections to grid cells. It is meant to be used by opm-grid and opm-simulators in order to
26 implement the analytical aquifer models in OPM Flow.
27*/
28
29#include <unordered_map>
30
38
39namespace Opm {
40
41 class Aquancon {
42 public:
43
44 struct AquancCell {
46 std::size_t global_index;
47 std::pair<bool, double> influx_coeff;
50
51 AquancCell(int aquiferID_arg, std::size_t gi, const std::pair<bool, double>& ic, double im, FaceDir::DirEnum fd) :
52 aquiferID(aquiferID_arg),
53 global_index(gi),
54 influx_coeff(ic),
55 influx_mult(im),
56 face_dir(fd)
57 {}
58
59 AquancCell() = default;
60
61 bool operator==(const AquancCell& other) const {
62 return this->aquiferID == other.aquiferID &&
63 this->global_index == other.global_index &&
64 this->influx_coeff == other.influx_coeff &&
65 this->influx_mult == other.influx_mult &&
66 this->face_dir == other.face_dir;
67 }
68
69 template<class Serializer>
70 void serializeOp(Serializer& serializer)
71 {
72 serializer(aquiferID);
73 serializer(global_index);
74 serializer(influx_coeff);
75 serializer(influx_mult);
76 serializer(face_dir);
77 }
78 };
79
80
81 Aquancon() = default;
82 Aquancon(const EclipseGrid& grid, const Deck& deck);
83 Aquancon(const std::unordered_map<int, std::vector<Aquancon::AquancCell>>& data);
84
86
87 const std::unordered_map<int, std::vector<Aquancon::AquancCell>>& data() const;
88 bool operator==(const Aquancon& other) const;
89 bool active() const;
90
91 const std::vector<Aquancon::AquancCell> operator[](int aquiferID) const;
92
93 template<class Serializer>
94 void serializeOp(Serializer& serializer)
95 {
96 serializer.map(cells);
97 }
98
99 private:
100 static bool cellInsideReservoirAndActive(const EclipseGrid& grid, int i, int j, int k);
101 static bool neighborCellInsideReservoirAndActive(const EclipseGrid& grid, int i, int j, int k, FaceDir::DirEnum faceDir);
102
103
104 std::unordered_map<int, std::vector<Aquancon::AquancCell>> cells;
105 };
106}
107
108#endif
Definition: Aquancon.hpp:41
Aquancon(const EclipseGrid &grid, const Deck &deck)
Aquancon()=default
const std::vector< Aquancon::AquancCell > operator[](int aquiferID) const
static Aquancon serializeObject()
void serializeOp(Serializer &serializer)
Definition: Aquancon.hpp:94
bool active() const
const std::unordered_map< int, std::vector< Aquancon::AquancCell > > & data() const
bool operator==(const Aquancon &other) const
Aquancon(const std::unordered_map< int, std::vector< Aquancon::AquancCell > > &data)
Definition: Deck.hpp:115
Definition: EclipseGrid.hpp:54
Definition: Serializer.hpp:38
DirEnum
Definition: FaceDir.hpp:30
Definition: A.hpp:4
Definition: Aquancon.hpp:44
void serializeOp(Serializer &serializer)
Definition: Aquancon.hpp:70
double influx_mult
Definition: Aquancon.hpp:48
std::size_t global_index
Definition: Aquancon.hpp:46
FaceDir::DirEnum face_dir
Definition: Aquancon.hpp:49
bool operator==(const AquancCell &other) const
Definition: Aquancon.hpp:61
int aquiferID
Definition: Aquancon.hpp:45
std::pair< bool, double > influx_coeff
Definition: Aquancon.hpp:47
AquancCell(int aquiferID_arg, std::size_t gi, const std::pair< bool, double > &ic, double im, FaceDir::DirEnum fd)
Definition: Aquancon.hpp:51