My Project
Aquifetp.hpp
1 /*
2  Copyright (C) 2017 TNO
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_AQUIFERFETP_HPP
21 #define OPM_AQUIFERFETP_HPP
22 
23 /*
24  The Aquiferfetp which stands for AquiferFetkovich is a data container object meant to hold the data for the fetkovich aquifer model.
25  This includes the logic for parsing as well as the associated tables. It is meant to be used by opm-grid and opm-simulators in order to
26  implement the Fetkovich analytical aquifer model in OPM Flow.
27 */
28 
29 #include <cstddef>
30 #include <optional>
31 #include <vector>
32 
33 namespace Opm {
34  class Deck;
35  class DeckRecord;
36  class TableManager;
37 }
38 
39 namespace Opm { namespace RestartIO {
40  class RstAquifer;
41 }} // Opm::RestartIO
42 
43 namespace Opm {
44 
45 class Aquifetp {
46  public:
47 
48  struct AQUFETP_data
49  {
50  friend class Aquifetp;
51 
52  AQUFETP_data() = default;
53  AQUFETP_data(const DeckRecord& record, const TableManager& tables);
54  AQUFETP_data(const int aquiferID_,
55  const int pvttableID_,
56  const double J_,
57  const double C_t_,
58  const double V0_,
59  const double d0_,
60  const double p0_);
61 
62  int aquiferID{};
63  int pvttableID{};
64 
65  double prod_index{};
66  double total_compr{};
67  double initial_watvolume{};
68  double datum_depth{};
69 
70  std::optional<double> initial_pressure{};
71 
72  static AQUFETP_data serializeObject();
73 
74  double timeConstant() const { return this->time_constant_; }
75  double waterDensity() const { return this->water_density_; }
76  double waterViscosity() const { return this->water_viscosity_; }
77 
78  bool operator==(const AQUFETP_data& other) const;
79 
80  void finishInitialisation(const TableManager& tables);
81 
82  template<class Serializer>
83  void serializeOp(Serializer& serializer)
84  {
85  serializer(this->aquiferID);
86  serializer(this->pvttableID);
87  serializer(this->prod_index);
88  serializer(this->total_compr);
89  serializer(this->initial_watvolume);
90  serializer(this->datum_depth);
91  serializer(this->initial_pressure);
92  serializer(this->time_constant_);
93  serializer(this->water_density_);
94  serializer(this->water_viscosity_);
95  }
96 
97  private:
98  double time_constant_{};
99  double water_density_{};
100  double water_viscosity_{};
101  };
102 
103  Aquifetp() = default;
104  Aquifetp(const TableManager& tables, const Deck& deck);
105  explicit Aquifetp(const std::vector<Aquifetp::AQUFETP_data>& data);
106 
107  void loadFromRestart(const RestartIO::RstAquifer& rst,
108  const TableManager& tables);
109 
110  static Aquifetp serializeObject();
111 
112  const std::vector<Aquifetp::AQUFETP_data>& data() const;
113 
114  std::size_t size() const;
115  std::vector<Aquifetp::AQUFETP_data>::const_iterator begin() const;
116  std::vector<Aquifetp::AQUFETP_data>::const_iterator end() const;
117  bool operator==(const Aquifetp& other) const;
118 
119  bool hasAquifer(const int aquID) const;
120 
121  template<class Serializer>
122  void serializeOp(Serializer& serializer)
123  {
124  serializer.vector(m_aqufetp);
125  }
126 
127 private:
128  std::vector<Aquifetp::AQUFETP_data> m_aqufetp;
129 };
130 }
131 
132 
133 #endif
Definition: Aquifetp.hpp:45
Definition: DeckRecord.hpp:32
Definition: Deck.hpp:63
Definition: aquifer.hpp:45
Definition: Serializer.hpp:38
Definition: TableManager.hpp:64
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: Aquifetp.hpp:49