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;
41class Schedule;
42class SummaryState;
43template<typename Scalar, typename IndexTraits> class GroupStateHelper;
44template<typename Scalar, typename IndexTraits> class WellInterfaceGeneric;
45template<typename Scalar, typename IndexTraits> class WellState;
46
48template<typename Scalar, typename IndexTraits>
50public:
52 explicit WellGroupControls(const WellInterfaceGeneric<Scalar, IndexTraits>& well) : well_(well) {}
53
54 using RateConvFunc = std::function<void(const RegionId, const int,
55 const std::optional<std::string>&, std::vector<Scalar>&)>;
57
58 template<class EvalWell>
59 void getGroupInjectionControl(const Group& group,
60 const GroupStateHelperType& groupStateHelper,
61 const InjectorType& injectorType,
62 const EvalWell& bhp,
63 const EvalWell& injection_rate,
64 const RateConvFunc& rateConverter,
65 Scalar efficiencyFactor,
66 EvalWell& control_eq) const;
67
68 std::optional<Scalar>
69 getGroupInjectionTargetRate(const Group& group,
70 const GroupStateHelperType& groupStateHelper,
71 const InjectorType& injectorType,
72 const RateConvFunc& rateConverter,
73 Scalar efficiencyFactor) const;
74
75 template<class EvalWell>
76 void getGroupProductionControl(const Group& group,
77 const GroupStateHelperType& groupStateHelper,
78 const EvalWell& bhp,
79 const std::vector<EvalWell>& rates,
80 const RateConvFunc& rateConverter,
81 Scalar efficiencyFactor,
82 EvalWell& control_eq) const;
83
84 Scalar getGroupProductionTargetRate(const Group& group,
85 const GroupStateHelperType& groupStateHelper,
86 const RateConvFunc& rateConverter,
87 Scalar efficiencyFactor) const;
88
89 static std::pair<Scalar, Group::ProductionCMode> getAutoChokeGroupProductionTargetRate(const Group& bottom_group,
90 const Group& group,
91 const GroupStateHelperType& groupStateHelper,
92 const std::vector<Scalar>& resv_coeff,
93 Scalar efficiencyFactor);
94
95private:
97};
98
99}
100
101#endif // OPM_WELL_GROUP_CONTROLS_HEADER_INCLUDED
Definition: GroupStateHelper.hpp:54
Class for computing well group controls.
Definition: WellGroupControls.hpp:49
Scalar getGroupProductionTargetRate(const Group &group, const GroupStateHelperType &groupStateHelper, const RateConvFunc &rateConverter, Scalar efficiencyFactor) const
std::optional< Scalar > getGroupInjectionTargetRate(const Group &group, const GroupStateHelperType &groupStateHelper, const InjectorType &injectorType, const RateConvFunc &rateConverter, Scalar efficiencyFactor) const
WellGroupControls(const WellInterfaceGeneric< Scalar, IndexTraits > &well)
Constructor sets reference to well.
Definition: WellGroupControls.hpp:52
static std::pair< Scalar, Group::ProductionCMode > getAutoChokeGroupProductionTargetRate(const Group &bottom_group, const Group &group, const GroupStateHelperType &groupStateHelper, const std::vector< Scalar > &resv_coeff, Scalar efficiencyFactor)
void getGroupProductionControl(const Group &group, const GroupStateHelperType &groupStateHelper, const EvalWell &bhp, const std::vector< EvalWell > &rates, const RateConvFunc &rateConverter, Scalar efficiencyFactor, EvalWell &control_eq) const
std::function< void(const RegionId, const int, const std::optional< std::string > &, std::vector< Scalar > &)> RateConvFunc
Definition: WellGroupControls.hpp:55
void getGroupInjectionControl(const Group &group, const GroupStateHelperType &groupStateHelper, const InjectorType &injectorType, const EvalWell &bhp, const EvalWell &injection_rate, const RateConvFunc &rateConverter, Scalar efficiencyFactor, EvalWell &control_eq) const
Definition: WellInterfaceGeneric.hpp:53
Definition: blackoilbioeffectsmodules.hh:43
int RegionId
Definition: WellConstraints.hpp:38