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