GroupEconomicLimitsChecker.hpp
Go to the documentation of this file.
1/*
2 Copyright 2023 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_GROUP_ECONOMIC_LIMITS_CHECKER_HEADER_INCLUDED
21#define OPM_GROUP_ECONOMIC_LIMITS_CHECKER_HEADER_INCLUDED
22
24#include <opm/input/eclipse/Schedule/Group/GroupEconProductionLimits.hpp>
25#include <opm/input/eclipse/Units/UnitSystem.hpp>
26
27#include <array>
28#include <map>
29#include <string>
30
31namespace Opm
32{
33
34template<class Scalar> class BlackoilWellModelGeneric;
35class DeferredLogger;
36class Group;
37template<class Scalar> class WellState;
38class WellTestState;
39
40template<class Scalar>
42{
43public:
45 WellTestState& well_test_state,
46 const Group& group,
47 const double simulation_time,
48 const int report_step_idx,
49 DeferredLogger& deferred_logger);
50 void closeWells();
51 bool minGasRate();
52 bool minOilRate();
53 bool waterCut();
54 bool GOR();
55 bool WGR();
56 void doWorkOver();
57 bool endRun();
61 std::string message_separator(const char sep_char = '*',
62 const size_t sep_length = 110) const
63 { return std::string(sep_length, sep_char); }
64
65 static constexpr int NUM_PHASES = 3;
66
67private:
68 void displayDebugMessage(const std::string& msg) const;
69 void addPrintMessage(const std::string& msg,
70 const Scalar value,
71 const Scalar limit,
72 const UnitSystem::measure measure);
73 bool closeWellsRecursive(const Group& group, int level = 0);
74 void throwNotImplementedError(const std::string& error) const;
75
76 const BlackoilWellModelGeneric<Scalar>& well_model_;
77 const Group& group_;
78 const double simulation_time_;
79 const int report_step_idx_;
80 DeferredLogger& deferred_logger_;
81 const std::string date_string_;
82 const UnitSystem& unit_system_;
83 const WellState<Scalar>& well_state_;
84 WellTestState& well_test_state_;
85 const Schedule& schedule_;
86 GroupEconProductionLimits::GEconGroupProp gecon_props_;
87 bool debug_ = true;
88 std::array<Scalar,NUM_PHASES> production_rates_;
89 std::map<int, BlackoilPhases::PhaseIndex> phase_idx_map_ = {
93 };
94 std::map<BlackoilPhases::PhaseIndex, int> phase_idx_reverse_map_;
95 std::string message_;
96};
97
98} // namespace Opm
99
100#endif // OPM_GROUP_ECONOMIC_LIMITS_CHECKER_HEADER_INCLUDED
@ Liquid
Definition: BlackoilPhases.hpp:42
@ Aqua
Definition: BlackoilPhases.hpp:42
@ Vapour
Definition: BlackoilPhases.hpp:42
Class for handling the blackoil well model.
Definition: BlackoilWellModelGeneric.hpp:83
Definition: DeferredLogger.hpp:57
Definition: GroupEconomicLimitsChecker.hpp:42
std::string message_separator(const char sep_char=' *', const size_t sep_length=110) const
Definition: GroupEconomicLimitsChecker.hpp:61
static constexpr int NUM_PHASES
Definition: GroupEconomicLimitsChecker.hpp:65
GroupEconomicLimitsChecker(const BlackoilWellModelGeneric< Scalar > &well_model, WellTestState &well_test_state, const Group &group, const double simulation_time, const int report_step_idx, DeferredLogger &deferred_logger)
Definition: WellState.hpp:62
Definition: BlackoilPhases.hpp:27