My Project
Loading...
Searching...
No Matches
WellConstraints.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_CONSTRAINTS_HEADER_INCLUDED
25#define OPM_WELL_CONSTRAINTS_HEADER_INCLUDED
26
27#include <opm/input/eclipse/Schedule/Well/Well.hpp>
28
29#include <functional>
30#include <vector>
31#include <optional>
32
33namespace Opm
34{
35
36class DeferredLogger;
37using RegionId = int;
38class Rates;
39template<class Scalar> class SingleWellState;
40class SummaryState;
41template<class Scalar> class WellInterfaceGeneric;
42enum class WellInjectorCMode;
43enum class WellProducerCMode;
44
46template<class Scalar>
48public:
50 WellConstraints(const WellInterfaceGeneric<Scalar>& well) : well_(well) {}
51
52 using RateConvFunc = std::function<void(const RegionId, const int,
53 const std::vector<Scalar>&,
54 std::vector<Scalar>&)>;
55
56 bool
57 checkIndividualConstraints(SingleWellState<Scalar>& ws,
58 const SummaryState& summaryState,
59 const RateConvFunc& calcReservoirVoidageRates,
60 bool& thp_limit_violated_but_not_switched,
62 const std::optional<Well::InjectionControls>& inj_controls = std::nullopt,
63 const std::optional<Well::ProductionControls>& prod_controls = std::nullopt) const;
64
65private:
67 activeInjectionConstraint(const SingleWellState<Scalar>& ws,
68 const SummaryState& summaryState,
69 bool& thp_limit_violated_but_not_switched,
71 const std::optional<Well::InjectionControls>& inj_controls = std::nullopt) const;
72
74 activeProductionConstraint(const SingleWellState<Scalar>& ws,
75 const SummaryState& summaryState,
76 const RateConvFunc& calcReservoirVoidageRates,
77 bool& thp_limit_violated_but_not_switched,
79 const std::optional<Well::ProductionControls>& prod_controls = std::nullopt) const;
80
81 const WellInterfaceGeneric<Scalar>& well_;
82};
83
84}
85
86#endif // OPM_WELL_CONSTRAINTS_HEADER_INCLUDED
Definition DeferredLogger.hpp:57
Definition SingleWellState.hpp:42
Class for computing well group constraints.
Definition WellConstraints.hpp:47
WellConstraints(const WellInterfaceGeneric< Scalar > &well)
Constructor sets reference to well.
Definition WellConstraints.hpp:50
Definition WellInterfaceGeneric.hpp:52
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242