opm-simulators
WellGroupConstraints.hpp
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 
33 namespace Opm
34 {
35 
36 class DeferredLogger;
37 class Group;
38 template<class Scalar> class GroupState;
39 enum class InjectorType;
40 using RegionId = int;
41 class Schedule;
42 class SummaryState;
43 template<typename Scalar, typename IndexTraits> class GroupStateHelper;
44 template<typename Scalar, typename IndexTraits> class WellInterfaceGeneric;
45 template<typename Scalar, typename IndexTraits> class WellState;
46 
48 template<typename Scalar, typename IndexTraits>
50 public:
52  explicit WellGroupConstraints(const WellInterfaceGeneric<Scalar, IndexTraits>& well) : well_(well) {}
53 
54  using RateConvFunc = std::function<void(const RegionId,
55  const int,
56  const std::optional<std::string>&,
57  std::vector<Scalar>&)>;
58  using GroupStateHelperType = GroupStateHelper<Scalar, IndexTraits>;
59  using WellStateType = WellState<Scalar, IndexTraits>;
60 
61  bool checkGroupConstraints(const GroupStateHelperType& groupStateHelper,
62  const Schedule& schedule,
63  const SummaryState& summaryState,
64  const RateConvFunc& rateConverter,
65  const bool check_guide_rate,
66  WellStateType& well_state) const;
67 
68 private:
69  std::pair<bool, Scalar>
70  checkGroupConstraintsInj(const Group& group,
71  const GroupStateHelperType& groupStateHelper,
72  const Scalar efficiencyFactor,
73  const SummaryState& summaryState,
74  const RateConvFunc& rateConverter,
75  const bool check_guide_rate) const;
76 
77  std::pair<bool, Scalar>
78  checkGroupConstraintsProd(const Group& group,
79  const GroupStateHelperType& groupStateHelper,
80  const Scalar efficiencyFactor,
81  const RateConvFunc& rateConverter,
82  const bool check_guide_rate) const;
83 
85 };
86 
87 }
88 
89 #endif // OPM_WELL_GROUP_CONSTRAINTS_HEADER_INCLUDED
WellGroupConstraints(const WellInterfaceGeneric< Scalar, IndexTraits > &well)
Constructor sets reference to well.
Definition: WellGroupConstraints.hpp:52
Class for computing well group constraints.
Definition: WellGroupConstraints.hpp:49
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Definition: BlackoilWellModelConstraints.hpp:37
Definition: BlackoilWellModelGeneric.hpp:75
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition: TemperatureModel.hpp:61