opm-simulators
PerfData.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_PERFDATA_HEADER_INCLUDED
21 #define OPM_PERFDATA_HEADER_INCLUDED
22 
23 #include <opm/simulators/wells/ConnFiltrateData.hpp>
24 #include <opm/simulators/wells/ConnFracStatistics.hpp>
25 
26 #include <cstddef>
27 #include <vector>
28 #include <array>
29 
30 namespace Opm {
31 
32 template<class Scalar>
33 class PerfData
34 {
35 private:
36  bool injector{false};
37 
38 public:
39  PerfData() = default;
40  PerfData(std::size_t num_perf,
41  bool injector_,
42  std::size_t num_phases);
43 
44  static PerfData serializationTestObject();
45 
46  std::size_t size() const;
47  bool empty() const;
48  bool try_assign(const PerfData& other);
49 
54 
55  template<class Serializer>
56  void serializeOp(Serializer& serializer)
57  {
58  serializer(injector);
59  serializer(pressure);
60  serializer(rates);
61  serializer(phase_rates);
62  serializer(phase_mixing_rates);
63  serializer(solvent_rates);
64  serializer(polymer_rates);
65  serializer(brine_rates);
66  serializer(prod_index);
67  serializer(microbial_rates);
68  serializer(oxygen_rates);
69  serializer(urea_rates);
70  serializer(cell_index);
71  serializer(connection_transmissibility_factor);
72  serializer(connection_d_factor);
73  serializer(connection_compaction_tmult);
74  serializer(satnum_id);
75  serializer(ecl_index);
76  serializer(water_throughput);
77  serializer(skin_pressure);
78  serializer(water_velocity);
79  serializer(filtrate_data);
80  serializer(connFracStatistics);
81  serializer(gas_mass_rates);
82  serializer(wat_mass_rates);
83  }
84 
85  bool operator==(const PerfData&) const;
86 
87  // Note to maintainers: If you make changes to this list of data
88  // members, then please update the constructor, operator==(),
89  // serializationTestObject(), and serializeOp() accordingly. Moreover,
90  // if you're adding a new member representing a dynamically calculated
91  // result, e.g., a flow rate, then please update try_assign() as well.
92 
93  std::vector<Scalar> pressure{};
94  std::vector<Scalar> rates{};
95  std::vector<Scalar> phase_rates{};
96  std::vector<std::array<Scalar,4>> phase_mixing_rates{};
97  std::vector<Scalar> solvent_rates{};
98  std::vector<Scalar> polymer_rates{};
99  std::vector<Scalar> brine_rates{};
100  std::vector<Scalar> prod_index{};
101  std::vector<Scalar> microbial_rates{};
102  std::vector<Scalar> oxygen_rates{};
103  std::vector<Scalar> urea_rates{};
104  std::vector<std::size_t> cell_index{};
105  std::vector<Scalar> connection_transmissibility_factor{};
106  std::vector<Scalar> connection_d_factor{};
107  std::vector<Scalar> connection_compaction_tmult{};
108  std::vector<int> satnum_id{};
109  std::vector<std::size_t> ecl_index{};
110  std::vector<Scalar> gas_mass_rates{};
111  std::vector<Scalar> wat_mass_rates{};
112 
113  // The water_throughput, skin_pressure and water_velocity variables are
114  // only used for injectors to check the injectivity.
115  std::vector<Scalar> water_throughput{};
116  std::vector<Scalar> skin_pressure{};
117  std::vector<Scalar> water_velocity{};
118 
119  ConnFiltrateData<Scalar> filtrate_data{};
120  std::vector<ConnFracStatistics<Scalar>> connFracStatistics{};
121 };
122 
123 } // namespace Opm
124 
125 #endif // OPM_PERFDATA_HEADER_INCLUDED
Definition: ConnFiltrateData.hpp:29
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Definition: PerfData.hpp:33
void prepareInjectorContainers()
Make containers valid for injectors.
Definition: PerfData.cpp:61