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;
37class WellInterfaceGeneric;
38class WellTestState;
39
41class WellTest {
42public:
44 WellTest(const WellInterfaceGeneric& well) : well_(well) {}
45
47 const double simulation_time,
48 const bool write_message_to_opmlog,
49 WellTestState& well_test_state,
50 DeferredLogger& deferred_logger) const;
51
52 void updateWellTestStatePhysical(const double simulation_time,
53 const bool write_message_to_opmlog,
54 WellTestState& well_test_state,
55 DeferredLogger& deferred_logger) const;
56
57private:
58 struct RatioLimitCheckReport {
59 static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max();
60 bool ratio_limit_violated = false;
61 int worst_offending_completion = INVALIDCOMPLETION;
62 double violation_extent = 0.0;
63 };
64
65 void checkMaxGORLimit(const WellEconProductionLimits& econ_production_limits,
67 RatioLimitCheckReport& report) const;
68
69 void checkMaxWGRLimit(const WellEconProductionLimits& econ_production_limits,
71 RatioLimitCheckReport& report) const;
72
73 void checkMaxWaterCutLimit(const WellEconProductionLimits& econ_production_limits,
75 RatioLimitCheckReport& report) const;
76
77 template<class RatioFunc>
78 bool checkMaxRatioLimitWell(const SingleWellState<double>& ws,
79 const double max_ratio_limit,
80 const RatioFunc& ratioFunc) const;
81
82 template<class RatioFunc>
83 void checkMaxRatioLimitCompletions(const SingleWellState<double>& ws,
84 const double max_ratio_limit,
85 const RatioFunc& ratioFunc,
86 RatioLimitCheckReport& report) const;
87
88 bool checkRateEconLimits(const WellEconProductionLimits& econ_production_limits,
89 const std::vector<double>& rates_or_potentials,
90 DeferredLogger& deferred_logger) const;
91
92 RatioLimitCheckReport
93 checkRatioEconLimits(const WellEconProductionLimits& econ_production_limits,
95 DeferredLogger& deferred_logger) const;
96
97
98 const WellInterfaceGeneric& well_;
99};
100
101}
102
103#endif // OPM_WELL_TEST_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Definition: WellInterfaceGeneric.hpp:50
Class for performing well tests.
Definition: WellTest.hpp:41
WellTest(const WellInterfaceGeneric &well)
Constructor sets reference to well.
Definition: WellTest.hpp:44
void updateWellTestStateEconomic(const SingleWellState< double > &ws, const double simulation_time, const bool write_message_to_opmlog, WellTestState &well_test_state, DeferredLogger &deferred_logger) const
void updateWellTestStatePhysical(const double simulation_time, const bool write_message_to_opmlog, WellTestState &well_test_state, DeferredLogger &deferred_logger) const
Definition: BlackoilPhases.hpp:27