opm-common
NumericalAquifers.hpp
1 /*
2  Copyright (C) 2020 SINTEF Digital
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_NUMERICALAQUIFERS_HPP
21 #define OPM_NUMERICALAQUIFERS_HPP
22 
23 #include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/SingleNumericalAquifer.hpp>
24 
25 #include <cstddef>
26 #include <map>
27 #include <unordered_map>
28 #include <vector>
29 
30 namespace Opm {
31  class Deck;
32  class EclipseGrid;
33  class FieldPropsManager;
34  struct NumericalAquiferCell;
35 
37  public:
38  NumericalAquifers() = default;
39  NumericalAquifers(const Deck& deck, const EclipseGrid& grid, const FieldPropsManager& field_props);
40 
41  int numRecords() const { return static_cast<int>(this->m_num_records); }
42  std::size_t size() const;
43  bool hasAquifer(std::size_t aquifer_id) const;
44  const SingleNumericalAquifer& getAquifer(std::size_t aquifer_id) const;
45  const std::map<std::size_t, SingleNumericalAquifer>& aquifers() const;
46  bool operator==(const NumericalAquifers& other) const;
47 
48  std::unordered_map<std::size_t, const NumericalAquiferCell*> allAquiferCells() const;
49  std::vector<std::size_t> allAquiferCellIds() const;
50 
51  std::unordered_map<std::size_t, double> aquiferCellVolumes() const;
52 
53  std::vector<NNCdata> aquiferCellNNCs() const;
54  std::vector<NNCdata> aquiferConnectionNNCs(const EclipseGrid& grid, const FieldPropsManager& fp) const;
55 
56  std::unordered_map<std::size_t, AquiferCellProps> aquiferCellProps() const;
57 
58  void applyMinPV(const EclipseGrid& grid);
59 
60  void initConnections(const Deck& deck, const EclipseGrid& grid);
61  void postProcessConnections(const EclipseGrid& grid, const std::vector<int>& actnum);
62 
63  static NumericalAquifers serializationTestObject();
64  template <class Serializer>
65  void serializeOp(Serializer& serializer)
66  {
67  serializer(this->m_aquifers);
68  serializer(this->m_num_records);
69  }
70 
71  private:
72  std::map<std::size_t, SingleNumericalAquifer> m_aquifers{};
73  std::size_t m_num_records{0};
74 
75  void addAquiferCell(const NumericalAquiferCell& aqu_cell);
76  };
77 }
78 
79 #endif //OPM_NUMERICALAQUIFERS_HPP
Definition: NumericalAquiferCell.hpp:31
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:63
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: SingleNumericalAquifer.hpp:45
Definition: Deck.hpp:46
Definition: NumericalAquifers.hpp:36
Class for (de-)serializing.
Definition: Serializer.hpp:95