WellTestConfig.hpp
Go to the documentation of this file.
1/*
2 Copyright 2018 Statoil 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#ifndef WELLTEST_CONFIG_H
20#define WELLTEST_CONFIG_H
21
22#include <cstddef>
23#include <string>
24#include <vector>
25
26
27namespace Opm {
28
30public:
31 enum Reason {
34 GROUP = 4,
37 };
38
39 struct WTESTWell {
45 // the related WTEST keywords is entered and will begin
46 // taking effects since this report step
48
49 bool operator==(const WTESTWell& data) const {
50 return name == data.name &&
51 shut_reason == data.shut_reason &&
52 test_interval == data.test_interval &&
53 num_test == data.num_test &&
54 startup_time == data.startup_time &&
55 begin_report_step == data.begin_report_step;
56 }
57
58 template<class Serializer>
59 void serializeOp(Serializer& serializer)
60 {
61 serializer(name);
62 serializer(shut_reason);
63 serializer(test_interval);
64 serializer(num_test);
65 serializer(startup_time);
66 serializer(begin_report_step);
67 }
68 };
69
71
73
74 void add_well(const std::string& well, Reason reason, double test_interval, int num_test, double startup_time, int current_step);
75 void add_well(const std::string& well, const std::string& reasons, double test_interval,
76 int num_test, double startup_time, int current_step);
77 void drop_well(const std::string& well);
78 bool has(const std::string& well) const;
79 bool has(const std::string& well, Reason reason) const;
80 const WTESTWell& get(const std::string& well, Reason reason) const;
81 size_t size() const;
82
83 static std::string reasonToString(const Reason reason);
84
85 bool operator==(const WellTestConfig& data) const;
86
87 template<class Serializer>
88 void serializeOp(Serializer& serializer)
89 {
90 serializer.vector(wells);
91 }
92
93private:
94 std::vector<WTESTWell> wells;
95
96 WTESTWell* getWell(const std::string& well_name, const Reason reason);
97};
98
99
100}
101
102#endif
103
const char *const string
Definition: cJSON.h:170
Definition: Serializer.hpp:38
Definition: WellTestConfig.hpp:29
static std::string reasonToString(const Reason reason)
static WellTestConfig serializeObject()
void serializeOp(Serializer &serializer)
Definition: WellTestConfig.hpp:88
bool has(const std::string &well) const
void add_well(const std::string &well, const std::string &reasons, double test_interval, int num_test, double startup_time, int current_step)
size_t size() const
const WTESTWell & get(const std::string &well, Reason reason) const
void add_well(const std::string &well, Reason reason, double test_interval, int num_test, double startup_time, int current_step)
Reason
Definition: WellTestConfig.hpp:31
@ ECONOMIC
Definition: WellTestConfig.hpp:33
@ COMPLETION
Definition: WellTestConfig.hpp:36
@ THP_DESIGN
Definition: WellTestConfig.hpp:35
@ PHYSICAL
Definition: WellTestConfig.hpp:32
@ GROUP
Definition: WellTestConfig.hpp:34
bool operator==(const WellTestConfig &data) const
void drop_well(const std::string &well)
bool has(const std::string &well, Reason reason) const
Definition: A.hpp:4
static std::string data()
Definition: exprtk.hpp:40022
Definition: WellTestConfig.hpp:39
double startup_time
Definition: WellTestConfig.hpp:44
double test_interval
Definition: WellTestConfig.hpp:42
void serializeOp(Serializer &serializer)
Definition: WellTestConfig.hpp:59
std::string name
Definition: WellTestConfig.hpp:40
Reason shut_reason
Definition: WellTestConfig.hpp:41
bool operator==(const WTESTWell &data) const
Definition: WellTestConfig.hpp:49
int num_test
Definition: WellTestConfig.hpp:43
int begin_report_step
Definition: WellTestConfig.hpp:47