opm-simulators
Toggle main menu visibility
Loading...
Searching...
No Matches
TargetCalculator.hpp
1
/*
2
Copyright 2020 Equinor ASA.
3
4
This file is part of the Open Porous Media project (OPM).
5
6
OPM is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
OPM is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
20
21
#ifndef OPM_TARGETCALCULATOR_HEADER_INCLUDED
22
#define OPM_TARGETCALCULATOR_HEADER_INCLUDED
23
24
#include <opm/input/eclipse/Schedule/Group/Group.hpp>
25
#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
26
27
#include <optional>
28
#include <string>
29
#include <vector>
30
31
namespace
Opm
{
32
33
class
DeferredLogger
;
34
template
<
class
Scalar>
class
GroupState
;
35
template
<
typename
IndexTraits>
class
PhaseUsageInfo
;
36
37
namespace
WGHelpers {
38
41
template
<
typename
Scalar,
typename
IndexTraits>
42
class
TargetCalculator
43
{
44
public
:
45
TargetCalculator(
const
Group::ProductionCMode cmode,
46
const
PhaseUsageInfo<IndexTraits>
& pu,
47
const
std::vector<Scalar>& resv_coeff,
48
const
Scalar group_grat_target_from_sales,
49
const
std::string& group_name,
50
const
GroupState<Scalar>
& group_state,
51
const
bool
use_gpmaint);
52
53
template
<
typename
RateType>
54
RateType calcModeRateFromRates(
const
std::vector<RateType>& rates)
const
55
{
56
return
calcModeRateFromRates(rates.data());
57
}
58
59
template
<
typename
RateType>
60
RateType calcModeRateFromRates(
const
RateType* rates)
const
;
61
62
Scalar groupTarget(
const
std::optional<Group::ProductionControls>& ctrl,
63
DeferredLogger
& deferred_logger)
const
;
64
65
GuideRateModel::Target guideTargetMode()
const
;
66
67
private
:
68
Group::ProductionCMode cmode_;
69
const
PhaseUsageInfo<IndexTraits>
& pu_;
70
const
std::vector<Scalar>& resv_coeff_;
71
const
Scalar group_grat_target_from_sales_;
72
const
std::string& group_name_;
73
const
GroupState<Scalar>
& group_state_;
74
bool
use_gpmaint_;
75
};
76
79
template
<
typename
Scalar,
typename
IndexTraits>
80
class
InjectionTargetCalculator
81
{
82
public
:
83
InjectionTargetCalculator(
const
Group::InjectionCMode& cmode,
84
const
PhaseUsageInfo<IndexTraits>
& pu,
85
const
std::vector<Scalar>& resv_coeff,
86
const
std::string& group_name,
87
const
Scalar sales_target,
88
const
GroupState<Scalar>
& group_state,
89
const
Phase& injection_phase,
90
const
bool
use_gpmaint,
91
DeferredLogger
& deferred_logger);
92
93
template
<
typename
RateVec>
94
auto
calcModeRateFromRates(
const
RateVec& rates)
const
95
{
96
return
rates[pos_];
97
}
98
99
Scalar groupTarget(
const
std::optional<Group::InjectionControls>& ctrl,
100
DeferredLogger
& deferred_logger)
const
;
101
102
GuideRateModel::Target guideTargetMode()
const
;
103
104
private
:
105
Group::InjectionCMode cmode_;
106
const
PhaseUsageInfo<IndexTraits>
& pu_;
107
const
std::vector<Scalar>& resv_coeff_;
108
const
std::string& group_name_;
109
Scalar sales_target_;
110
const
GroupState<Scalar>
& group_state_;
111
bool
use_gpmaint_;
112
int
pos_;
113
GuideRateModel::Target target_;
114
};
115
116
}
// namespace WGHelpers
117
118
}
// namespace Opm
119
120
#endif
Opm::DeferredLogger
Definition
DeferredLogger.hpp:57
Opm::GroupState
Definition
GroupState.hpp:41
Opm::PhaseUsageInfo
Definition
GasLiftGroupInfo.hpp:37
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition
blackoilbioeffectsmodules.hh:43
opm
simulators
wells
TargetCalculator.hpp
Generated by
1.17.0