WellGroupControls.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_CONTROLS_HEADER_INCLUDED
25#define OPM_WELL_GROUP_CONTROLS_HEADER_INCLUDED
26
27#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
28#include <string>
29#include <functional>
30#include <optional>
31#include <vector>
32
33namespace Opm
34{
35
36class DeferredLogger;
37class Group;
38template<class Scalar> class GroupState;
39enum class InjectorType;
40using RegionId = int;
41struct PhaseUsage;
42class Schedule;
43class SummaryState;
44template<class Scalar> class WellInterfaceGeneric;
45template<class Scalar> class WellState;
46
48template<class Scalar>
50public:
52 explicit WellGroupControls(const WellInterfaceGeneric<Scalar>& well) : well_(well) {}
53
54 using RateConvFunc = std::function<void(const RegionId, const int,
55 const std::optional<std::string>&, std::vector<Scalar>&)>;
56
57 template<class EvalWell>
58 void getGroupInjectionControl(const Group& group,
59 const WellState<Scalar>& well_state,
60 const GroupState<Scalar>& group_state,
61 const Schedule& schedule,
62 const SummaryState& summaryState,
63 const InjectorType& injectorType,
64 const EvalWell& bhp,
65 const EvalWell& injection_rate,
66 const RateConvFunc& rateConverter,
67 Scalar efficiencyFactor,
68 EvalWell& control_eq,
69 DeferredLogger& deferred_logger) const;
70
71 std::optional<Scalar>
72 getGroupInjectionTargetRate(const Group& group,
73 const WellState<Scalar>& well_state,
74 const GroupState<Scalar>& group_state,
75 const Schedule& schedule,
76 const SummaryState& summaryState,
77 const InjectorType& injectorType,
78 const RateConvFunc& rateConverter,
79 Scalar efficiencyFactor,
80 DeferredLogger& deferred_logger) const;
81
82 template<class EvalWell>
83 void getGroupProductionControl(const Group& group,
84 const WellState<Scalar>& well_state,
85 const GroupState<Scalar>& group_state,
86 const Schedule& schedule,
87 const SummaryState& summaryState,
88 const EvalWell& bhp,
89 const std::vector<EvalWell>& rates,
90 const RateConvFunc& rateConverter,
91 Scalar efficiencyFactor,
92 EvalWell& control_eq,
93 DeferredLogger& deferred_logger) const;
94
95 Scalar getGroupProductionTargetRate(const Group& group,
96 const WellState<Scalar>& well_state,
97 const GroupState<Scalar>& group_state,
98 const Schedule& schedule,
99 const SummaryState& summaryState,
100 const RateConvFunc& rateConverter,
101 Scalar efficiencyFactor,
102 DeferredLogger& deferred_logger) const;
103
104 static std::pair<Scalar, Group::ProductionCMode> getAutoChokeGroupProductionTargetRate(const std::string& name,
105 const Group& parent,
106 const WellState<Scalar>& well_state,
107 const GroupState<Scalar>& group_state,
108 const Schedule& schedule,
109 const SummaryState& summaryState,
110 const std::vector<Scalar>& resv_coeff,
111 Scalar efficiencyFactor,
112 const int reportStepIdx,
113 const PhaseUsage& pu,
114 const GuideRate* guideRate,
115 DeferredLogger& deferred_logger);
116
117private:
118 const WellInterfaceGeneric<Scalar>& well_;
119};
120
121}
122
123#endif // OPM_WELL_GROUP_CONTROLS_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Definition: GroupState.hpp:43
Class for computing well group controls.
Definition: WellGroupControls.hpp:49
WellGroupControls(const WellInterfaceGeneric< Scalar > &well)
Constructor sets reference to well.
Definition: WellGroupControls.hpp:52
void getGroupInjectionControl(const Group &group, const WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, const InjectorType &injectorType, const EvalWell &bhp, const EvalWell &injection_rate, const RateConvFunc &rateConverter, Scalar efficiencyFactor, EvalWell &control_eq, DeferredLogger &deferred_logger) const
std::function< void(const RegionId, const int, const std::optional< std::string > &, std::vector< Scalar > &)> RateConvFunc
Definition: WellGroupControls.hpp:55
void getGroupProductionControl(const Group &group, const WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, const EvalWell &bhp, const std::vector< EvalWell > &rates, const RateConvFunc &rateConverter, Scalar efficiencyFactor, EvalWell &control_eq, DeferredLogger &deferred_logger) const
std::optional< Scalar > getGroupInjectionTargetRate(const Group &group, const WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, const InjectorType &injectorType, const RateConvFunc &rateConverter, Scalar efficiencyFactor, DeferredLogger &deferred_logger) const
Scalar getGroupProductionTargetRate(const Group &group, const WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, const RateConvFunc &rateConverter, Scalar efficiencyFactor, DeferredLogger &deferred_logger) const
static std::pair< Scalar, Group::ProductionCMode > getAutoChokeGroupProductionTargetRate(const std::string &name, const Group &parent, const WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, const std::vector< Scalar > &resv_coeff, Scalar efficiencyFactor, const int reportStepIdx, const PhaseUsage &pu, const GuideRate *guideRate, DeferredLogger &deferred_logger)
Definition: WellInterfaceGeneric.hpp:53
Definition: WellState.hpp:65
Definition: blackoilboundaryratevector.hh:39
int RegionId
Definition: WellConstraints.hpp:37
Definition: BlackoilPhases.hpp:46