opm-common
SingleNumericalAquifer.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_SINGLENUMERICALAQUIFER_HPP
21 #define OPM_SINGLENUMERICALAQUIFER_HPP
22 
23 #include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferConnection.hpp>
24 #include <opm/input/eclipse/EclipseState/Aquifer/NumericalAquifer/NumericalAquiferCell.hpp>
25 
26 #include <set>
27 #include <unordered_map>
28 #include <vector>
29 
30 namespace Opm {
31  class NNC;
32  struct NNCdata;
33  class FieldPropsManager;
34 
36  double volume;
37  double pore_volume;
38  double depth;
39  double porosity;
40  int satnum;
41  int pvtnum;
42  };
43 
45  {
46  public:
47  explicit SingleNumericalAquifer(const size_t aqu_id);
48  SingleNumericalAquifer() = default;
49 
50  void addAquiferCell(const NumericalAquiferCell& aqu_cell);
51  void addAquiferConnection(const NumericalAquiferConnection& aqu_con);
52 
53  void postProcessConnections(const EclipseGrid& grid, const std::vector<int>& actnum);
54 
55  // TODO: the following two can be made one function. Let us see
56  // how we use them at the end
57  size_t numCells() const;
58  size_t id() const;
59  size_t numConnections() const;
60  const NumericalAquiferCell* getCellPrt(size_t index) const;
61 
62  void applyMinPV(const EclipseGrid& grid);
63 
64  std::unordered_map<size_t, AquiferCellProps> aquiferCellProps() const;
65 
66  std::vector<NNCdata> aquiferCellNNCs() const;
67  std::vector<NNCdata> aquiferConnectionNNCs(const EclipseGrid &grid, const FieldPropsManager &fp) const;
68 
69  const std::vector<NumericalAquiferConnection>& connections() const;
70 
71  bool operator==(const SingleNumericalAquifer& other) const;
72 
73  template<class Serializer>
74  void serializeOp(Serializer& serializer) {
75  serializer(this->id_);
76  serializer(this->cells_);
77  serializer(this->connections_);
78  }
79 
80  private:
81  // Maybe this id_ is not necessary
82  // Because if it is a map, the id will be there
83  // Then adding aquifer cells will be much easier with the
84  // default constructor
85  size_t id_{};
86  std::vector<NumericalAquiferCell> cells_{};
87  std::vector<NumericalAquiferConnection> connections_{};
88  };
89 }
90 
91 
92 #endif //OPM_SINGLENUMERICALAQUIFER_HPP
Definition: NumericalAquiferCell.hpp:31
Definition: FieldPropsManager.hpp:42
Definition: SingleNumericalAquifer.hpp:35
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: SingleNumericalAquifer.hpp:44
Class for (de-)serializing.
Definition: Serializer.hpp:94
Definition: NumericalAquiferConnection.hpp:34