opm-common
AquiferConfig.hpp
1 /*
2  Copyright (C) 2020 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_AUQIFER_CONFIG_HPP
21 #define OPM_AUQIFER_CONFIG_HPP
22 
23 #include <opm/input/eclipse/EclipseState/Aquifer/Aquancon.hpp>
24 #include <opm/input/eclipse/EclipseState/Aquifer/Aquifetp.hpp>
25 #include <opm/input/eclipse/EclipseState/Aquifer/AquiferCT.hpp>
26 #include <opm/input/eclipse/EclipseState/Aquifer/AquiferFlux.hpp>
27 #include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquifers.hpp>
28 
29 #include <cstddef>
30 #include <vector>
31 #include <unordered_set>
32 
33 namespace Opm {
34  class TableManager;
35  class EclipseGrid;
36  class Deck;
37  class FieldPropsManager;
38 } // namespace Opm
39 
40 namespace Opm { namespace RestartIO {
41  class RstAquifer;
42 }} // namespace Opm::RestartIO
43 
44 namespace Opm {
45 
47 public:
48 
49  AquiferConfig() = default;
50  AquiferConfig(const TableManager& tables, const EclipseGrid& grid,
51  const Deck& deck, const FieldPropsManager& field_props);
52  AquiferConfig(const Aquifetp& fetp, const AquiferCT& ct, const AquiferFlux& aqufluxs, const Aquancon& conn);
53  void load_connections(const Deck& deck, const EclipseGrid& grid);
54 
55  void pruneDeactivatedAquiferConnections(const std::vector<std::size_t>& deactivated_cells);
56  void loadFromRestart(const RestartIO::RstAquifer& aquifers,
57  const TableManager& tables);
58 
59  // there might be some aquifers (AQUFLUX only for now) are opened through
60  // SCHEDULE section while not specified in the SOLUTION section.
61  // We create dummy aquifers in the AquiferConfig to make sure we are aware of them
62  // when we handle the SUMMARY section.
63  // Since those aquifers are not active, basically we only need the id information
64  void appendAqufluxSchedule(const std::unordered_set<int>& ids);
65 
66  static AquiferConfig serializationTestObject();
67 
68  bool active() const;
69  const AquiferCT& ct() const;
70  const Aquifetp& fetp() const;
71  const AquiferFlux& aquflux() const;
72  const Aquancon& connections() const;
73  bool operator==(const AquiferConfig& other) const;
74  bool hasAquifer(const int aquID) const;
75  bool hasAnalyticalAquifer(const int aquID) const;
76 
77  bool hasNumericalAquifer() const;
78  bool hasAnalyticalAquifer() const;
79  const NumericalAquifers& numericalAquifers() const;
80  NumericalAquifers& mutableNumericalAquifers() const;
81 
82  template<class Serializer>
83  void serializeOp(Serializer& serializer)
84  {
85  serializer(aquifetp);
86  serializer(aquiferct);
87  serializer(aqconn);
88  serializer(aquiferflux);
89  serializer(numerical_aquifers);
90  }
91 
92 private:
93  Aquifetp aquifetp{};
94  AquiferCT aquiferct{};
95  AquiferFlux aquiferflux{};
96  mutable NumericalAquifers numerical_aquifers{};
97  Aquancon aqconn{};
98 };
99 
100 std::vector<int> analyticAquiferIDs(const AquiferConfig& cfg);
101 std::vector<int> numericAquiferIDs(const AquiferConfig& cfg);
102 }
103 
104 #endif
Definition: Aquancon.hpp:46
Definition: AquiferCT.hpp:45
Definition: FieldPropsManager.hpp:42
About cell information and dimension: The actual grid information is held in a pointer to an ERT ecl_...
Definition: EclipseGrid.hpp:62
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: AquiferConfig.hpp:46
Definition: TableManager.hpp:66
Definition: aquifer.hpp:44
Definition: Aquifetp.hpp:45
Definition: Deck.hpp:46
Definition: AquiferFlux.hpp:70
Definition: NumericalAquifers.hpp:38
Class for (de-)serializing.
Definition: Serializer.hpp:94