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