My Project
Loading...
Searching...
No Matches
WellGroupHelpers.hpp
1/*
2 Copyright 2019 Norce.
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_WELLGROUPHELPERS_HEADER_INCLUDED
22#define OPM_WELLGROUPHELPERS_HEADER_INCLUDED
23
24#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
25#include <opm/input/eclipse/EclipseState/Grid/FieldPropsManager.hpp>
26#include <opm/simulators/utils/ParallelCommunication.hpp>
27
28#include <map>
29#include <string>
30#include <vector>
31
32namespace Opm
33{
34
35class DeferredLogger;
36class Group;
37class GroupState;
38namespace Network { class ExtNetwork; }
39struct PhaseUsage;
40class Schedule;
41class VFPProdProperties;
42class WellState;
43class FieldPropsManager;
44
45namespace Network { class ExtNetwork; }
46
47namespace WellGroupHelpers
48{
49
50
51
52 void setCmodeGroup(const Group& group,
53 const Schedule& schedule,
54 const SummaryState& summaryState,
55 const int reportStepIdx,
56 GroupState& group_state);
57
58 void accumulateGroupEfficiencyFactor(const Group& group,
59 const Schedule& schedule,
60 const int reportStepIdx,
61 double& factor);
62
63 double sumWellSurfaceRates(const Group& group,
64 const Schedule& schedule,
65 const WellState& wellState,
66 const int reportStepIdx,
67 const int phasePos,
68 const bool injector);
69
70 double sumWellResRates(const Group& group,
71 const Schedule& schedule,
72 const WellState& wellState,
73 const int reportStepIdx,
74 const int phasePos,
75 const bool injector);
76
77 double sumSolventRates(const Group& group,
78 const Schedule& schedule,
79 const WellState& wellState,
80 const int reportStepIdx,
81 const bool injector);
82
83 void updateGroupTargetReduction(const Group& group,
84 const Schedule& schedule,
85 const int reportStepIdx,
86 const bool isInjector,
87 const PhaseUsage& pu,
88 const GuideRate& guide_rate,
89 const WellState& wellState,
90 GroupState& group_state,
91 std::vector<double>& groupTargetReduction);
92
93 void updateGuideRates(const Group& group,
94 const Schedule& schedule,
95 const SummaryState& summary_state,
96 const PhaseUsage& pu,
97 int report_step,
98 double sim_time,
99 WellState& well_state,
100 const GroupState& group_state,
101 const Parallel::Communication& comm,
102 GuideRate* guide_rate,
103 std::vector<double>& pot,
104 Opm::DeferredLogger& deferred_logge);
105
106 void updateGuideRateForProductionGroups(const Group& group,
107 const Schedule& schedule,
108 const PhaseUsage& pu,
109 const int reportStepIdx,
110 const double& simTime,
111 WellState& wellState,
112 const GroupState& group_state,
113 const Parallel::Communication& comm,
114 GuideRate* guideRate,
115 std::vector<double>& pot);
116
117 void updateGuideRatesForWells(const Schedule& schedule,
118 const PhaseUsage& pu,
119 const int reportStepIdx,
120 const double& simTime,
121 const WellState& wellState,
122 const Parallel::Communication& comm,
123 GuideRate* guideRate);
124
125 void updateGuideRatesForInjectionGroups(const Group& group,
126 const Schedule& schedule,
127 const SummaryState& summaryState,
128 const Opm::PhaseUsage& pu,
129 const int reportStepIdx,
130 const WellState& wellState,
131 const GroupState& group_state,
132 GuideRate* guideRate,
133 Opm::DeferredLogger& deferred_logger);
134
135 void updateVREPForGroups(const Group& group,
136 const Schedule& schedule,
137 const int reportStepIdx,
138 const WellState& wellState,
139 GroupState& group_state);
140
141 void updateReservoirRatesInjectionGroups(const Group& group,
142 const Schedule& schedule,
143 const int reportStepIdx,
144 const WellState& wellState,
145 GroupState& group_state);
146
147 void updateSurfaceRatesInjectionGroups(const Group& group,
148 const Schedule& schedule,
149 const int reportStepIdx,
150 const WellState& wellState,
151 GroupState& group_state);
152
153 void updateWellRates(const Group& group,
154 const Schedule& schedule,
155 const int reportStepIdx,
156 const WellState& wellStateNupcol,
157 WellState& wellState);
158
159 void updateGroupProductionRates(const Group& group,
160 const Schedule& schedule,
161 const int reportStepIdx,
162 const WellState& wellState,
163 GroupState& group_state);
164
165 void updateWellRatesFromGroupTargetScale(const double scale,
166 const Group& group,
167 const Schedule& schedule,
168 const int reportStepIdx,
169 bool isInjector,
170 const GroupState& group_state,
171 WellState& wellState);
172
173 void updateREINForGroups(const Group& group,
174 const Schedule& schedule,
175 const int reportStepIdx,
176 const PhaseUsage& pu,
177 const SummaryState& st,
178 const WellState& wellState,
179 GroupState& group_state,
180 bool sum_rank);
181
182
184 std::pair<std::optional<std::string>, double> worstOffendingWell(const Group& group,
185 const Schedule& schedule,
186 const int reportStepIdx,
187 const Group::ProductionCMode& offendedControl,
188 const PhaseUsage& pu,
189 const Parallel::Communication& comm,
190 const WellState& wellState,
191 DeferredLogger& deferred_logger);
192
193
194 template <class RegionalValues>
195 void updateGpMaintTargetForGroups(const Group& group,
196 const Schedule& schedule,
197 const RegionalValues& regional_values,
198 const int reportStepIdx,
199 const double dt,
200 const WellState& well_state,
201 GroupState& group_state);
202
203 std::map<std::string, double>
204 computeNetworkPressures(const Opm::Network::ExtNetwork& network,
205 const WellState& well_state,
206 const GroupState& group_state,
207 const VFPProdProperties& vfp_prod_props,
208 const Schedule& schedule,
209 const int report_time_step);
210
211 GuideRate::RateVector
212 getWellRateVector(const WellState& well_state, const PhaseUsage& pu, const std::string& name);
213
214 GuideRate::RateVector
215 getProductionGroupRateVector(const GroupState& group_state, const PhaseUsage& pu, const std::string& group_name);
216
217 double getGuideRate(const std::string& name,
218 const Schedule& schedule,
219 const WellState& wellState,
220 const GroupState& group_state,
221 const int reportStepIdx,
222 const GuideRate* guideRate,
223 const GuideRateModel::Target target,
224 const PhaseUsage& pu);
225
226
227 double getGuideRateInj(const std::string& name,
228 const Schedule& schedule,
229 const WellState& wellState,
230 const GroupState& group_state,
231 const int reportStepIdx,
232 const GuideRate* guideRate,
233 const GuideRateModel::Target target,
234 const Phase& injectionPhase,
235 const PhaseUsage& pu);
236
237 int groupControlledWells(const Schedule& schedule,
238 const WellState& well_state,
239 const GroupState& group_state,
240 const int report_step,
241 const std::string& group_name,
242 const std::string& always_included_child,
243 const bool is_production_group,
244 const Phase injection_phase);
245
246
247 std::pair<bool, double> checkGroupConstraintsInj(const std::string& name,
248 const std::string& parent,
249 const Group& group,
250 const WellState& wellState,
251 const GroupState& group_state,
252 const int reportStepIdx,
253 const GuideRate* guideRate,
254 const double* rates,
255 Phase injectionPhase,
256 const PhaseUsage& pu,
257 const double efficiencyFactor,
258 const Schedule& schedule,
259 const SummaryState& summaryState,
260 const std::vector<double>& resv_coeff,
261 DeferredLogger& deferred_logger);
262
263
264
265
266
267
268 std::vector<std::string> groupChainTopBot(const std::string& bottom,
269 const std::string& top,
270 const Schedule& schedule,
271 const int report_step);
272
273
274
275
276 std::pair<bool, double> checkGroupConstraintsProd(const std::string& name,
277 const std::string& parent,
278 const Group& group,
279 const WellState& wellState,
280 const GroupState& group_state,
281 const int reportStepIdx,
282 const GuideRate* guideRate,
283 const double* rates,
284 const PhaseUsage& pu,
285 const double efficiencyFactor,
286 const Schedule& schedule,
287 const SummaryState& summaryState,
288 const std::vector<double>& resv_coeff,
289 DeferredLogger& deferred_logger);
290
291 template <class AverageRegionalPressureType>
292 void setRegionAveragePressureCalculator(const Group& group,
293 const Schedule& schedule,
294 const int reportStepIdx,
295 const FieldPropsManager& fp,
296 const PhaseUsage& pu,
297 std::map<std::string, std::unique_ptr<AverageRegionalPressureType>>& regionalAveragePressureCalculator);
298
299
300} // namespace WellGroupHelpers
301
302} // namespace Opm
303
304#endif
Definition DeferredLogger.hpp:57
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27
Definition BlackoilPhases.hpp:46