My Project
Loading...
Searching...
No Matches
AquiferFlux.hpp
1/*
2 Copyright (C) 2023 Equinor
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_AQUIFERFLUX_HPP
21#define OPM_AQUIFERFLUX_HPP
22
23#include <optional>
24#include <unordered_map>
25#include <unordered_set>
26#include <vector>
27
28namespace Opm {
29 class DeckKeyword;
30 class DeckRecord;
31}
32
33namespace Opm { namespace RestartIO {
34 class RstAquifer;
35}} // Opm::RestartIO
36
37namespace Opm {
39 {
40 SingleAquiferFlux() = default;
41 explicit SingleAquiferFlux(const DeckRecord& record);
42
43 // using id to create an inactive dummy aquifer
44 explicit SingleAquiferFlux(int id);
45 SingleAquiferFlux(int id, double flux, double sal, bool active_, double temp, double pres);
46
47 int id {0};
48 double flux {0.};
49 double salt_concentration {0.};
50 bool active {false};
51 std::optional<double> temperature;
52 std::optional<double> datum_pressure;
53
54 bool operator==(const SingleAquiferFlux& other) const;
55
56 template <class Serializer>
57 void serializeOp(Serializer& serializer)
58 {
59 serializer(this->id);
60 serializer(this->flux);
61 serializer(this->salt_concentration);
62 serializer(this->active);
63 serializer(this->temperature);
64 serializer(this->datum_pressure);
65 }
66
67 static SingleAquiferFlux serializationTestObject();
68 };
69
71 {
72 public:
73 using AquFluxs = std::unordered_map<int, SingleAquiferFlux>;
74
75 AquiferFlux() = default;
76 explicit AquiferFlux(const std::vector<const DeckKeyword*>& keywords);
77
78 // Primarily for unit testing purposes.
79 explicit AquiferFlux(const std::vector<SingleAquiferFlux>& aquifers);
80
81 void appendAqufluxSchedule(const std::unordered_set<int>& ids);
82
83 bool hasAquifer(int id) const;
84
85 bool operator==(const AquiferFlux& other) const;
86
87 size_t size() const;
88
89 AquFluxs::const_iterator begin() const;
90 AquFluxs::const_iterator end() const;
91
92 void loadFromRestart(const RestartIO::RstAquifer& rst);
93
94 template <class Serializer>
95 void serializeOp(Serializer& serializer)
96 {
97 serializer(this->m_aquifers);
98 }
99
100 static AquiferFlux serializationTestObject();
101
102 private:
103 AquFluxs m_aquifers{};
104 };
105} // end of namespace Opm
106
107#endif //OPM_AQUIFERFLUX_HPP
Definition AquiferFlux.hpp:71
Definition DeckRecord.hpp:32
Definition aquifer.hpp:45
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 AquiferFlux.hpp:39