My Project
Loading...
Searching...
No Matches
GroupEconomicLimitsChecker.hpp
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
23#include <opm/core/props/BlackoilPhases.hpp>
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
34class BlackoilWellModelGeneric;
35class DeferredLogger;
36class Group;
37class WellState;
38class WellTestState;
39
41 {
42 public:
44 const BlackoilWellModelGeneric &well_model,
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 );
51 void closeWells();
52 bool minGasRate();
53 bool minOilRate();
54 bool waterCut();
55 bool GOR();
56 bool WGR();
57 void doWorkOver();
58 bool endRun();
59 int numProducersOpenInitially();
60 int numProducersOpen();
61 void activateEndRun();
62 std::string message_separator(const char sep_char='*', const size_t sep_length=110) const { return std::string(sep_length, sep_char); }
63
64 static constexpr int NUM_PHASES = 3;
65 private:
66 void displayDebugMessage(const std::string &msg) const;
67 void addPrintMessage(const std::string &msg, const double value, const double limit, const UnitSystem::measure measure);
68 bool closeWellsRecursive(const Group& group, int level = 0);
69 void throwNotImplementedError(const std::string &error) const;
70 const BlackoilWellModelGeneric &well_model_;
71 const Group &group_;
72 const double simulation_time_;
73 const int report_step_idx_;
74 DeferredLogger &deferred_logger_;
75 const std::string date_string_;
76 const UnitSystem& unit_system_;
77 const WellState &well_state_;
78 WellTestState &well_test_state_;
79 const Schedule &schedule_;
80 GroupEconProductionLimits::GEconGroupProp gecon_props_;
81 bool debug_ = true;
82 std::array<double,NUM_PHASES> production_rates_;
83 std::map<int, BlackoilPhases::PhaseIndex> phase_idx_map_ = {
84 {0, BlackoilPhases::Liquid},
85 {1, BlackoilPhases::Vapour},
86 {2, BlackoilPhases::Aqua}};
87 std::map<BlackoilPhases::PhaseIndex, int> phase_idx_reverse_map_;
88 std::string message_;
89 };
90
91} // namespace Opm
92
93#endif // OPM_GROUP_ECONOMIC_LIMITS_CHECKER_HEADER_INCLUDED
Class for handling the blackoil well model.
Definition BlackoilWellModelGeneric.hpp:83
Definition DeferredLogger.hpp:57
Definition GroupEconomicLimitsChecker.hpp:41
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:61
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27