WellTest.hpp
Go to the documentation of this file.
1/*
2 Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
3 Copyright 2017 Statoil ASA.
4 Copyright 2017 IRIS
5 Copyright 2019 Norce
6
7 This file is part of the Open Porous Media project (OPM).
8
9 OPM is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 OPM is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with OPM. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23
24#ifndef OPM_WELL_TEST_HEADER_INCLUDED
25#define OPM_WELL_TEST_HEADER_INCLUDED
26
27#include <limits>
28#include <vector>
29
30namespace Opm
31{
32
33class DeferredLogger;
34struct PhaseUsage;
35template<class Scalar> class SingleWellState;
36class WellEconProductionLimits;
37template<class Scalar> class WellInterfaceGeneric;
38class WellTestState;
39
41template<class Scalar>
42class WellTest {
43public:
45 WellTest(const WellInterfaceGeneric<Scalar>& well) : well_(well) {}
46
48 const double simulation_time,
49 const bool write_message_to_opmlog,
50 WellTestState& well_test_state,
51 bool zero_group_target,
52 DeferredLogger& deferred_logger) const;
53
54 void updateWellTestStatePhysical(const double simulation_time,
55 const bool write_message_to_opmlog,
56 WellTestState& well_test_state,
57 DeferredLogger& deferred_logger) const;
58
59private:
60 struct RatioLimitCheckReport {
61 static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max();
62 bool ratio_limit_violated = false;
63 int worst_offending_completion = INVALIDCOMPLETION;
64 Scalar violation_extent = 0.0;
65 };
66
67 void checkMaxGORLimit(const WellEconProductionLimits& econ_production_limits,
69 RatioLimitCheckReport& report) const;
70
71 void checkMaxWGRLimit(const WellEconProductionLimits& econ_production_limits,
73 RatioLimitCheckReport& report) const;
74
75 void checkMaxWaterCutLimit(const WellEconProductionLimits& econ_production_limits,
77 RatioLimitCheckReport& report) const;
78
79 template<class RatioFunc>
80 bool checkMaxRatioLimitWell(const SingleWellState<Scalar>& ws,
81 const Scalar max_ratio_limit,
82 const RatioFunc& ratioFunc) const;
83
84 template<class RatioFunc>
85 void checkMaxRatioLimitCompletions(const SingleWellState<Scalar>& ws,
86 const Scalar max_ratio_limit,
87 const RatioFunc& ratioFunc,
88 RatioLimitCheckReport& report) const;
89
90 bool checkRateEconLimits(const WellEconProductionLimits& econ_production_limits,
91 const std::vector<Scalar>& rates_or_potentials,
92 DeferredLogger& deferred_logger) const;
93
94 RatioLimitCheckReport
95 checkRatioEconLimits(const WellEconProductionLimits& econ_production_limits,
97 DeferredLogger& deferred_logger) const;
98
99
100 const WellInterfaceGeneric<Scalar>& well_;
101};
102
103}
104
105#endif // OPM_WELL_TEST_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Definition: SingleWellState.hpp:42
Definition: WellInterfaceGeneric.hpp:51
Class for performing well tests.
Definition: WellTest.hpp:42
void updateWellTestStateEconomic(const SingleWellState< Scalar > &ws, const double simulation_time, const bool write_message_to_opmlog, WellTestState &well_test_state, bool zero_group_target, DeferredLogger &deferred_logger) const
void updateWellTestStatePhysical(const double simulation_time, const bool write_message_to_opmlog, WellTestState &well_test_state, DeferredLogger &deferred_logger) const
WellTest(const WellInterfaceGeneric< Scalar > &well)
Constructor sets reference to well.
Definition: WellTest.hpp:45
Definition: blackoilboundaryratevector.hh:37