WellConstraints.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_CONSTRAINTS_HEADER_INCLUDED
25#define OPM_WELL_CONSTRAINTS_HEADER_INCLUDED
26
27#include <opm/input/eclipse/Schedule/Well/Well.hpp>
28
29#include <functional>
30#include <utility>
31#include <vector>
32#include <optional>
33
34namespace Opm
35{
36
37class DeferredLogger;
38using RegionId = int;
39class Rates;
40template<class Scalar> class SingleWellState;
41class SummaryState;
43enum class WellInjectorCMode;
44enum class WellProducerCMode;
45
48public:
50 WellConstraints(const WellInterfaceGeneric& well) : well_(well) {}
51
52 using RateConvFunc = std::function<void(const RegionId, const int,
53 const std::vector<double>&,
54 std::vector<double>&)>;
55
56 bool
58 const SummaryState& summaryState,
59 const RateConvFunc& calcReservoirVoidageRates,
60 bool& thp_limit_violated_but_not_switched,
61 DeferredLogger& deferred_logger,
62 const std::optional<Well::InjectionControls>& inj_controls = std::nullopt,
63 const std::optional<Well::ProductionControls>& prod_controls = std::nullopt) const;
64
65private:
66 WellInjectorCMode
67 activeInjectionConstraint(const SingleWellState<double>& ws,
68 const SummaryState& summaryState,
69 bool& thp_limit_violated_but_not_switched,
70 DeferredLogger& deferred_logger,
71 const std::optional<Well::InjectionControls>& inj_controls = std::nullopt) const;
72
73 WellProducerCMode
74 activeProductionConstraint(const SingleWellState<double>& ws,
75 const SummaryState& summaryState,
76 const RateConvFunc& calcReservoirVoidageRates,
77 bool& thp_limit_violated_but_not_switched,
78 DeferredLogger& deferred_logger,
79 const std::optional<Well::ProductionControls>& prod_controls = std::nullopt) const;
80
81 const WellInterfaceGeneric& well_;
82};
83
84}
85
86#endif // OPM_WELL_CONSTRAINTS_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Definition: SingleWellState.hpp:41
Class for computing well group constraints.
Definition: WellConstraints.hpp:47
bool checkIndividualConstraints(SingleWellState< double > &ws, const SummaryState &summaryState, const RateConvFunc &calcReservoirVoidageRates, bool &thp_limit_violated_but_not_switched, DeferredLogger &deferred_logger, const std::optional< Well::InjectionControls > &inj_controls=std::nullopt, const std::optional< Well::ProductionControls > &prod_controls=std::nullopt) const
WellConstraints(const WellInterfaceGeneric &well)
Constructor sets reference to well.
Definition: WellConstraints.hpp:50
std::function< void(const RegionId, const int, const std::vector< double > &, std::vector< double > &)> RateConvFunc
Definition: WellConstraints.hpp:54
Definition: WellInterfaceGeneric.hpp:50
Definition: BlackoilPhases.hpp:27
int RegionId
Definition: WellConstraints.hpp:38