My Project
aquifer.hpp
1 /*
2  Copyright 2021 Equinor ASA.
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_RESTART_AQUIFER_HPP
21 #define OPM_RESTART_AQUIFER_HPP
22 
23 #include <opm/parser/eclipse/EclipseState/Grid/FaceDir.hpp>
24 
25 #include <cstddef>
26 #include <memory>
27 #include <optional>
28 #include <unordered_map>
29 #include <utility>
30 #include <vector>
31 
32 namespace Opm {
33  class AquiferConfig;
34  class EclipseGrid;
35  class UnitSystem;
36 } // Opm
37 
38 namespace Opm { namespace EclIO {
39  class RestartFileView;
40 }} // Opm::EclIO
41 
42 namespace Opm { namespace RestartIO {
43 
44  class RstAquifer
45  {
46  public:
47  struct CarterTracy {
48  int aquiferID{};
49  int inftableID{};
50  int pvttableID{};
51 
52  double porosity{};
53  double datum_depth{};
54  double total_compr{};
55  double inner_radius{};
56  double permeability{};
57  double thickness{};
58  double angle_fraction{};
59  double initial_pressure{};
60 
61  double time_constant{};
62  double influx_constant{};
63  double water_density{};
64  double water_viscosity{};
65  };
66 
67  struct Fetkovich {
68  int aquiferID{};
69  int pvttableID{};
70 
71  double prod_index{};
72  double total_compr{};
73  double initial_watvolume{};
74  double datum_depth{};
75 
76  double initial_pressure{};
77  double time_constant{};
78  };
79 
80  class Connections {
81  public:
82  struct Cell {
83  std::size_t global_index;
84  double influx_coeff;
85  double effective_facearea;
86  FaceDir::DirEnum face_dir;
87  };
88 
89  const std::vector<Cell>& cells() const
90  {
91  return this->cells_;
92  }
93 
94  void reserve(const std::vector<Cell>::size_type cpty)
95  {
96  this->cells_.reserve(cpty);
97  }
98 
99  template <typename... Args>
100  void emplace_back(Args&&... args)
101  {
102  this->cells_.push_back(Cell { std::forward<Args>(args)... });
103  }
104 
105  private:
106  std::vector<Cell> cells_{};
107  };
108 
109  explicit RstAquifer(std::shared_ptr<EclIO::RestartFileView> rstView,
110  const EclipseGrid* grid,
111  const UnitSystem& usys);
112 
113  RstAquifer(const RstAquifer& rhs);
114  RstAquifer(RstAquifer&& rhs);
115  RstAquifer& operator=(const RstAquifer& rhs);
116  RstAquifer& operator=(RstAquifer&& rhs);
117 
118  ~RstAquifer();
119 
120  bool hasAnalyticAquifers() const;
121 
122  const std::vector<CarterTracy>& carterTracy() const;
123  const std::vector<Fetkovich>& fetkovich() const;
124  const std::unordered_map<int, Connections>& connections() const;
125 
126  private:
127  class Implementation;
128  std::unique_ptr<Implementation> pImpl_;
129  };
130 }} // Opm::RestartIO
131 
132 #endif // OPM_RESTART_AQUIFER_HPP
Definition: aquifer.hpp:80
Definition: aquifer.hpp:45
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: aquifer.hpp:47
Definition: aquifer.hpp:67