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