opm-common
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/input/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  struct ConstantFlux {
81  int aquiferID{};
82 
83  double flow_rate{};
84  };
85 
86  class Connections {
87  public:
88  struct Cell {
89  std::size_t global_index;
90  double influx_coeff;
91  double effective_facearea;
92  FaceDir::DirEnum face_dir;
93  };
94 
95  const std::vector<Cell>& cells() const
96  {
97  return this->cells_;
98  }
99 
100  void reserve(const std::vector<Cell>::size_type cpty)
101  {
102  this->cells_.reserve(cpty);
103  }
104 
105  template <typename... Args>
106  void emplace_back(Args&&... args)
107  {
108  this->cells_.push_back(Cell { std::forward<Args>(args)... });
109  }
110 
111  private:
112  std::vector<Cell> cells_{};
113  };
114 
115  explicit RstAquifer(std::shared_ptr<EclIO::RestartFileView> rstView,
116  const EclipseGrid* grid,
117  const UnitSystem& usys);
118 
119  RstAquifer(const RstAquifer& rhs);
120  RstAquifer(RstAquifer&& rhs);
121  RstAquifer& operator=(const RstAquifer& rhs);
122  RstAquifer& operator=(RstAquifer&& rhs);
123 
124  ~RstAquifer();
125 
126  bool hasAnalyticAquifers() const;
127 
128  const std::vector<CarterTracy>& carterTracy() const;
129  const std::vector<ConstantFlux>& constantFlux() const;
130  const std::vector<Fetkovich>& fetkovich() const;
131  const std::unordered_map<int, Connections>& connections() const;
132 
133  private:
134  class Implementation;
135  std::unique_ptr<Implementation> pImpl_;
136  };
137 
138 }} // Opm::RestartIO
139 
140 #endif // OPM_RESTART_AQUIFER_HPP
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: aquifer.hpp:67
Definition: aquifer.hpp:44
Definition: aquifer.hpp:47
Definition: aquifer.hpp:86