WellGroupConstraints.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_GROUP_CONSTRAINTS_HEADER_INCLUDED
25#define OPM_WELL_GROUP_CONSTRAINTS_HEADER_INCLUDED
26
27#include <functional>
28#include <utility>
29#include <vector>
30#include <string>
31#include <optional>
32
33namespace Opm
34{
35
36class DeferredLogger;
37class Group;
38template<class Scalar> class GroupState;
39enum class InjectorType;
40using RegionId = int;
41class Schedule;
42class SummaryState;
43class WellInterfaceGeneric;
44template<class Scalar> class WellState;
45
48public:
50 WellGroupConstraints(const WellInterfaceGeneric& well) : well_(well) {}
51
52 using RateConvFunc = std::function<void(const RegionId, const int, const std::optional<std::string>&, std::vector<double>&)>;
53
55 const GroupState<double>& group_state,
56 const Schedule& schedule,
57 const SummaryState& summaryState,
58 const RateConvFunc& rateConverter,
59 DeferredLogger& deferred_logger) const;
60
61private:
62 std::pair<bool, double>
63 checkGroupConstraintsInj(const Group& group,
64 const WellState<double>& well_state,
65 const GroupState<double>& group_state,
66 const double efficiencyFactor,
67 const Schedule& schedule,
68 const SummaryState& summaryState,
69 const RateConvFunc& rateConverter,
70 DeferredLogger& deferred_logger) const;
71
72 std::pair<bool, double>
73 checkGroupConstraintsProd(const Group& group,
74 const WellState<double>& well_state,
75 const GroupState<double>& group_state,
76 const double efficiencyFactor,
77 const Schedule& schedule,
78 const SummaryState& summaryState,
79 const RateConvFunc& rateConverter,
80 DeferredLogger& deferred_logger) const;
81
82 const WellInterfaceGeneric& well_;
83};
84
85}
86
87#endif // OPM_WELL_GROUP_CONSTRAINTS_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Class for computing well group constraints.
Definition: WellGroupConstraints.hpp:47
WellGroupConstraints(const WellInterfaceGeneric &well)
Constructor sets reference to well.
Definition: WellGroupConstraints.hpp:50
std::function< void(const RegionId, const int, const std::optional< std::string > &, std::vector< double > &)> RateConvFunc
Definition: WellGroupConstraints.hpp:52
bool checkGroupConstraints(WellState< double > &well_state, const GroupState< double > &group_state, const Schedule &schedule, const SummaryState &summaryState, const RateConvFunc &rateConverter, DeferredLogger &deferred_logger) const
Definition: WellInterfaceGeneric.hpp:50
Definition: BlackoilPhases.hpp:27
int RegionId
Definition: WellConstraints.hpp:38