My Project
Schedule.hpp
1/*
2 Copyright 2013 Statoil 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#ifndef SCHEDULE_HPP
20#define SCHEDULE_HPP
21
22#include <cstddef>
23#include <ctime>
24#include <map>
25#include <memory>
26#include <optional>
27#include <iosfwd>
28#include <string>
29#include <unordered_map>
30#include <utility>
31#include <vector>
32
33#include <opm/input/eclipse/EclipseState/Runspec.hpp>
34#include <opm/input/eclipse/Parser/InputErrorAction.hpp>
35#include <opm/input/eclipse/Python/Python.hpp>
36#include <opm/input/eclipse/Schedule/GasLiftOpt.hpp>
37#include <opm/input/eclipse/Schedule/Group/Group.hpp>
38#include <opm/input/eclipse/Schedule/Group/GuideRateConfig.hpp>
39#include <opm/input/eclipse/Schedule/MessageLimits.hpp>
40#include <opm/input/eclipse/Schedule/Network/ExtNetwork.hpp>
41#include <opm/input/eclipse/Schedule/RPTConfig.hpp>
42#include <opm/input/eclipse/Schedule/ScheduleDeck.hpp>
43#include <opm/input/eclipse/Schedule/ScheduleState.hpp>
44#include <opm/input/eclipse/Schedule/Well/PAvg.hpp>
45#include <opm/input/eclipse/Schedule/Well/Well.hpp>
46#include <opm/input/eclipse/Schedule/Well/WellTestConfig.hpp>
47#include <opm/input/eclipse/Schedule/WriteRestartFileEvents.hpp>
48#include <opm/input/eclipse/Schedule/CompletedCells.hpp>
49#include <opm/input/eclipse/Schedule/Action/SimulatorUpdate.hpp>
50#include <opm/input/eclipse/Schedule/Action/WGNames.hpp>
51#include <opm/input/eclipse/Units/UnitSystem.hpp>
52
53namespace Opm
54{
55 class ActiveGridCells;
56 class Deck;
57 class DeckKeyword;
58 class DeckRecord;
59 class EclipseState;
60 class FieldPropsManager;
61 class GTNode;
62 class ParseContext;
63 class SCHEDULESection;
64 class SummaryState;
65 class ErrorGuard;
66 class UDQConfig;
67 class WellMatcher;
68
69 namespace RestartIO { struct RstState; }
70
71
73 std::shared_ptr<const Python> m_python_handle;
74 std::string m_input_path;
75 ScheduleRestartInfo rst_info;
76 MessageLimits m_deck_message_limits;
77 UnitSystem m_unit_system;
78 Runspec m_runspec;
79 RSTConfig rst_config;
80 std::optional<int> output_interval;
81 double sumthin{-1.0};
82 bool rptonly{false};
83 bool gaslift_opt_active{false};
84
85 ScheduleStatic() = default;
86
87 explicit ScheduleStatic(std::shared_ptr<const Python> python_handle) :
88 m_python_handle(python_handle)
89 {}
90
91 ScheduleStatic(std::shared_ptr<const Python> python_handle,
92 const ScheduleRestartInfo& restart_info,
93 const Deck& deck,
94 const Runspec& runspec,
95 const std::optional<int>& output_interval_,
96 const ParseContext& parseContext,
97 ErrorGuard& errors);
98
99 template<class Serializer>
100 void serializeOp(Serializer& serializer)
101 {
102 serializer(m_deck_message_limits);
103 serializer(this->rst_info);
104 serializer(m_runspec);
105 serializer(m_unit_system);
106 serializer(this->m_input_path);
107 serializer(rst_info);
108 serializer(rst_config);
109 serializer(this->output_interval);
110 serializer(this->gaslift_opt_active);
111 }
112
113
114 static ScheduleStatic serializationTestObject() {
115 auto python = std::make_shared<Python>(Python::Enable::OFF);
116 ScheduleStatic st(python);
117 st.m_deck_message_limits = MessageLimits::serializationTestObject();
118 st.m_runspec = Runspec::serializationTestObject();
119 st.m_unit_system = UnitSystem::newFIELD();
120 st.m_input_path = "Some/funny/path";
121 st.rst_config = RSTConfig::serializationTestObject();
122 st.rst_info = ScheduleRestartInfo::serializationTestObject();
123 return st;
124 }
125
126 bool operator==(const ScheduleStatic& other) const {
127 return this->m_input_path == other.m_input_path &&
128 this->m_deck_message_limits == other.m_deck_message_limits &&
129 this->m_unit_system == other.m_unit_system &&
130 this->rst_config == other.rst_config &&
131 this->rst_info == other.rst_info &&
132 this->gaslift_opt_active == other.gaslift_opt_active &&
133 this->m_runspec == other.m_runspec;
134 }
135 };
136
137
138 class Schedule {
139 public:
140 Schedule() = default;
141 explicit Schedule(std::shared_ptr<const Python> python_handle);
142 Schedule(const Deck& deck,
143 const EclipseGrid& grid,
144 const FieldPropsManager& fp,
145 const Runspec &runspec,
146 const ParseContext& parseContext,
147 ErrorGuard& errors,
148 std::shared_ptr<const Python> python,
149 const std::optional<int>& output_interval = {},
150 const RestartIO::RstState* rst = nullptr,
151 const TracerConfig* tracer_config = nullptr);
152
153 template<typename T>
154 Schedule(const Deck& deck,
155 const EclipseGrid& grid,
156 const FieldPropsManager& fp,
157 const Runspec &runspec,
158 const ParseContext& parseContext,
159 T&& errors,
160 std::shared_ptr<const Python> python,
161 const std::optional<int>& output_interval = {},
162 const RestartIO::RstState* rst = nullptr,
163 const TracerConfig* tracer_config = nullptr);
164
165 Schedule(const Deck& deck,
166 const EclipseGrid& grid,
167 const FieldPropsManager& fp,
168 const Runspec &runspec,
169 std::shared_ptr<const Python> python,
170 const std::optional<int>& output_interval = {},
171 const RestartIO::RstState* rst = nullptr,
172 const TracerConfig* tracer_config = nullptr);
173
174 Schedule(const Deck& deck,
175 const EclipseState& es,
176 const ParseContext& parseContext,
177 ErrorGuard& errors,
178 std::shared_ptr<const Python> python,
179 const std::optional<int>& output_interval = {},
180 const RestartIO::RstState* rst = nullptr);
181
182 template <typename T>
183 Schedule(const Deck& deck,
184 const EclipseState& es,
185 const ParseContext& parseContext,
186 T&& errors,
187 std::shared_ptr<const Python> python,
188 const std::optional<int>& output_interval = {},
189 const RestartIO::RstState* rst = nullptr);
190
191 Schedule(const Deck& deck,
192 const EclipseState& es,
193 std::shared_ptr<const Python> python,
194 const std::optional<int>& output_interval = {},
195 const RestartIO::RstState* rst = nullptr);
196
197 // The constructor *without* the Python arg should really only be used from Python itself
198 Schedule(const Deck& deck,
199 const EclipseState& es,
200 const std::optional<int>& output_interval = {},
201 const RestartIO::RstState* rst = nullptr);
202
203 static Schedule serializationTestObject();
204
205 /*
206 * If the input deck does not specify a start time, Eclipse's 1. Jan
207 * 1983 is defaulted
208 */
209 std::time_t getStartTime() const;
210 std::time_t posixStartTime() const;
211 std::time_t posixEndTime() const;
212 std::time_t simTime(std::size_t timeStep) const;
213 double seconds(std::size_t timeStep) const;
214 double stepLength(std::size_t timeStep) const;
215 std::optional<int> exitStatus() const;
216 const UnitSystem& getUnits() const { return this->m_static.m_unit_system; }
217 const Runspec& runspec() const { return this->m_static.m_runspec; }
218
219 std::size_t numWells() const;
220 std::size_t numWells(std::size_t timestep) const;
221 bool hasWell(const std::string& wellName) const;
222 bool hasWell(const std::string& wellName, std::size_t timeStep) const;
223
224 WellMatcher wellMatcher(std::size_t report_step) const;
225 std::vector<std::string> wellNames(const std::string& pattern, std::size_t timeStep, const std::vector<std::string>& matching_wells = {}) const;
226 std::vector<std::string> wellNames(const std::string& pattern) const;
227 std::vector<std::string> wellNames(std::size_t timeStep) const;
228 std::vector<std::string> wellNames() const;
229
230 bool hasGroup(const std::string& groupName, std::size_t timeStep) const;
231 std::vector<std::string> groupNames(const std::string& pattern, std::size_t timeStep) const;
232 std::vector<std::string> groupNames(std::size_t timeStep) const;
233 std::vector<std::string> groupNames(const std::string& pattern) const;
234 std::vector<std::string> groupNames() const;
235 /*
236 The restart_groups function returns a vector of groups pointers which
237 is organized as follows:
238
239 1. The number of elements is WELLDIMS::MAXGROUPS + 1
240 2. The elements are sorted according to group.insert_index().
241 3. If there are less than WELLDIMS::MAXGROUPS nullptr is used.
242 4. The very last element corresponds to the FIELD group.
243 */
244 std::vector<const Group*> restart_groups(std::size_t timeStep) const;
245
246 std::vector<std::string> changed_wells(std::size_t reportStep) const;
247 const Well& getWell(std::size_t well_index, std::size_t timeStep) const;
248 const Well& getWell(const std::string& wellName, std::size_t timeStep) const;
249 const Well& getWellatEnd(const std::string& well_name) const;
250 std::vector<Well> getWells(std::size_t timeStep) const;
251 std::vector<Well> getWellsatEnd() const;
252 void shut_well(const std::string& well_name, std::size_t report_step);
253 void stop_well(const std::string& well_name, std::size_t report_step);
254 void open_well(const std::string& well_name, std::size_t report_step);
255 void applyWellProdIndexScaling(const std::string& well_name, const std::size_t reportStep, const double scalingFactor);
256
257 std::vector<const Group*> getChildGroups2(const std::string& group_name, std::size_t timeStep) const;
258 std::vector<Well> getChildWells2(const std::string& group_name, std::size_t timeStep) const;
259 Well::ProducerCMode getGlobalWhistctlMmode(std::size_t timestep) const;
260
261 const UDQConfig& getUDQConfig(std::size_t timeStep) const;
262 void evalAction(const SummaryState& summary_state, std::size_t timeStep);
263
264 GTNode groupTree(std::size_t report_step) const;
265 GTNode groupTree(const std::string& root_node, std::size_t report_step) const;
266 const Group& getGroup(const std::string& groupName, std::size_t timeStep) const;
267
268 std::optional<std::size_t> first_RFT() const;
269 /*
270 Will remove all completions which are connected to cell which is not
271 active. Will scan through all wells and all timesteps.
272 */
273 void filterConnections(const ActiveGridCells& grid);
274 std::size_t size() const;
275
276 bool write_rst_file(std::size_t report_step) const;
277 const std::map< std::string, int >& rst_keywords( size_t timestep ) const;
278
279 /*
280 The applyAction() is invoked from the simulator *after* an ACTIONX has
281 evaluated to true. The return value is a small structure with
282 'information' which the simulator should take into account when
283 updating internal datastructures after the ACTIONX keywords have been
284 applied.
285 */
286 SimulatorUpdate applyAction(std::size_t reportStep, const Action::ActionX& action, const std::vector<std::string>& matching_wells, const std::unordered_map<std::string, double>& wellpi);
287 /*
288 The runPyAction() will run the Python script in a PYACTION keyword. In
289 the case of Schedule updates the recommended way of doing that from
290 PYACTION is to invoke a "normal" ACTIONX keyword internally from the
291 Python code. he return value from runPyAction() comes from such a
292 internal ACTIONX.
293 */
294 SimulatorUpdate runPyAction(std::size_t reportStep, const Action::PyAction& pyaction, Action::State& action_state, EclipseState& ecl_state, SummaryState& summary_state);
295
296
297 const GasLiftOpt& glo(std::size_t report_step) const;
298
299 bool operator==(const Schedule& data) const;
300 std::shared_ptr<const Python> python() const;
301
302
303 const ScheduleState& back() const;
304 const ScheduleState& operator[](std::size_t index) const;
305 std::vector<ScheduleState>::const_iterator begin() const;
306 std::vector<ScheduleState>::const_iterator end() const;
307 void create_next(const time_point& start_time, const std::optional<time_point>& end_time);
308 void create_next(const ScheduleBlock& block);
309 void create_first(const time_point& start_time, const std::optional<time_point>& end_time);
310
311
312 /*
313 The cmp() function compares two schedule instances in a context aware
314 manner. Floating point numbers are compared with a tolerance. The
315 purpose of this comparison function is to implement regression tests
316 for the schedule instances created by loading a restart file.
317 */
318 static bool cmp(const Schedule& sched1, const Schedule& sched2, std::size_t report_step);
319 void applyKeywords(std::vector<DeckKeyword*>& keywords, std::size_t timeStep);
320
321 template<class Serializer>
322 void serializeOp(Serializer& serializer)
323 {
324 serializer(this->m_static);
325 serializer(this->m_sched_deck);
326 serializer(this->action_wgnames);
327 serializer(this->exit_status);
328 serializer(this->snapshots);
329 serializer(this->restart_output);
330 serializer(this->completed_cells);
331
332 this->template pack_unpack<PAvg>(serializer);
333 this->template pack_unpack<WellTestConfig>(serializer);
334 this->template pack_unpack<GConSale>(serializer);
335 this->template pack_unpack<GConSump>(serializer);
336 this->template pack_unpack<WListManager>(serializer);
337 this->template pack_unpack<Network::ExtNetwork>(serializer);
338 this->template pack_unpack<Network::Balance>(serializer);
339 this->template pack_unpack<RPTConfig>(serializer);
340 this->template pack_unpack<Action::Actions>(serializer);
341 this->template pack_unpack<UDQActive>(serializer);
342 this->template pack_unpack<UDQConfig>(serializer);
343 this->template pack_unpack<NameOrder>(serializer);
344 this->template pack_unpack<GroupOrder>(serializer);
345 this->template pack_unpack<GuideRateConfig>(serializer);
346 this->template pack_unpack<GasLiftOpt>(serializer);
347 this->template pack_unpack<RFTConfig>(serializer);
348 this->template pack_unpack<RSTConfig>(serializer);
349
350 this->template pack_unpack_map<int, VFPProdTable>(serializer);
351 this->template pack_unpack_map<int, VFPInjTable>(serializer);
352 this->template pack_unpack_map<std::string, Group>(serializer);
353 this->template pack_unpack_map<std::string, Well>(serializer);
354 }
355
356 template <typename T, class Serializer>
357 void pack_unpack(Serializer& serializer) {
358 std::vector<T> value_list;
359 std::vector<std::size_t> index_list;
360
361 if (serializer.isSerializing())
362 this->template pack_state<T>(value_list, index_list);
363
364 serializer(value_list);
365 serializer(index_list);
366
367 if (!serializer.isSerializing())
368 this->template unpack_state<T>(value_list, index_list);
369 }
370
371 template <typename T>
372 std::vector<std::pair<std::size_t, T>> unique() const {
373 std::vector<std::pair<std::size_t, T>> values;
374 for (std::size_t index = 0; index < this->snapshots.size(); index++) {
375 const auto& member = this->snapshots[index].get<T>();
376 const auto& value = member.get();
377 if (values.empty() || !(value == values.back().second))
378 values.push_back( std::make_pair(index, value));
379 }
380 return values;
381 }
382
383
384 template <typename T>
385 void pack_state(std::vector<T>& value_list, std::vector<std::size_t>& index_list) const {
386 auto unique_values = this->template unique<T>();
387 for (auto& [index, value] : unique_values) {
388 value_list.push_back( std::move(value) );
389 index_list.push_back( index );
390 }
391 }
392
393
394 template <typename T>
395 void unpack_state(const std::vector<T>& value_list, const std::vector<std::size_t>& index_list) {
396 std::size_t unique_index = 0;
397 while (unique_index < value_list.size()) {
398 const auto& value = value_list[unique_index];
399 const auto& first_index = index_list[unique_index];
400 auto last_index = this->snapshots.size();
401 if (unique_index < (value_list.size() - 1))
402 last_index = index_list[unique_index + 1];
403
404 auto& target_state = this->snapshots[first_index];
405 target_state.get<T>().update( std::move(value) );
406 for (std::size_t index=first_index + 1; index < last_index; index++)
407 this->snapshots[index].get<T>().update( target_state.get<T>() );
408
409 unique_index++;
410 }
411 }
412
413
414 template <typename K, typename T, class Serializer>
415 void pack_unpack_map(Serializer& serializer) {
416 std::vector<T> value_list;
417 std::vector<std::size_t> index_list;
418
419 if (serializer.isSerializing())
420 pack_map<K,T>(value_list, index_list);
421
422 serializer(value_list);
423 serializer(index_list);
424
425 if (!serializer.isSerializing())
426 unpack_map<K,T>(value_list, index_list);
427 }
428
429
430 template <typename K, typename T>
431 void pack_map(std::vector<T>& value_list,
432 std::vector<std::size_t>& index_list) {
433
434 const auto& last_map = this->snapshots.back().get_map<K,T>();
435 std::vector<K> key_list{ last_map.keys() };
436 std::unordered_map<K,T> current_value;
437
438 for (std::size_t index = 0; index < this->snapshots.size(); index++) {
439 auto& state = this->snapshots[index];
440 const auto& current_map = state.template get_map<K,T>();
441 for (const auto& key : key_list) {
442 auto& value = current_map.get_ptr(key);
443 if (value) {
444 auto it = current_value.find(key);
445 if (it == current_value.end() || !(*value == it->second)) {
446 value_list.push_back( *value );
447 index_list.push_back( index );
448
449 current_value[key] = *value;
450 }
451 }
452 }
453 }
454 }
455
456
457 template <typename K, typename T>
458 void unpack_map(const std::vector<T>& value_list,
459 const std::vector<std::size_t>& index_list) {
460
461 std::unordered_map<K, std::vector<std::pair<std::size_t, T>>> storage;
462 for (std::size_t storage_index = 0; storage_index < value_list.size(); storage_index++) {
463 const auto& value = value_list[storage_index];
464 const auto& time_index = index_list[storage_index];
465
466 storage[ value.name() ].emplace_back( time_index, value );
467 }
468
469 for (const auto& [key, values] : storage) {
470 for (std::size_t unique_index = 0; unique_index < values.size(); unique_index++) {
471 const auto& [time_index, value] = values[unique_index];
472 auto last_index = this->snapshots.size();
473 if (unique_index < (values.size() - 1))
474 last_index = values[unique_index + 1].first;
475
476 auto& map_value = this->snapshots[time_index].template get_map<K,T>();
477 map_value.update(std::move(value));
478
479 for (std::size_t index=time_index + 1; index < last_index; index++) {
480 auto& forward_map = this->snapshots[index].template get_map<K,T>();
481 forward_map.update( key, map_value );
482 }
483 }
484 }
485 }
486
487 friend std::ostream& operator<<(std::ostream& os, const Schedule& sched);
488 void dump_deck(std::ostream& os) const;
489
490 private:
491 struct HandlerContext {
492 const ScheduleBlock& block;
493 const DeckKeyword& keyword;
494 const std::size_t currentStep;
495 const std::vector<std::string>& matching_wells;
496 const bool actionx_mode;
497 const ParseContext& parseContext;
498 ErrorGuard& errors;
499 SimulatorUpdate * sim_update;
500 const std::unordered_map<std::string, double> * target_wellpi;
501 std::unordered_map<std::string, double>* wpimult_global_factor;
502 const ScheduleGrid& grid;
503
504 HandlerContext(const ScheduleBlock& block_,
505 const DeckKeyword& keyword_,
506 const ScheduleGrid& grid_,
507 const std::size_t currentStep_,
508 const std::vector<std::string>& matching_wells_,
509 bool actionx_mode_,
510 const ParseContext& parseContext_,
511 ErrorGuard& errors_,
512 SimulatorUpdate * sim_update_,
513 const std::unordered_map<std::string, double> * target_wellpi_,
514 std::unordered_map<std::string, double>* wpimult_global_factor_)
515 : block(block_)
516 , keyword(keyword_)
517 , currentStep(currentStep_)
518 , matching_wells(matching_wells_)
519 , actionx_mode(actionx_mode_)
520 , parseContext(parseContext_)
521 , errors(errors_)
522 , sim_update(sim_update_)
523 , target_wellpi(target_wellpi_)
524 , wpimult_global_factor(wpimult_global_factor_)
525 , grid(grid_)
526 {}
527
528 void affected_well(const std::string& well_name) {
529 if (this->sim_update)
530 this->sim_update->affected_wells.insert(well_name);
531 }
532
533 };
534
535 // Please update the member functions
536 // - operator==(const Schedule&) const
537 // - serializationTestObject()
538 // - serializeOp(Serializer&)
539 // when you update/change this list of data members.
540 ScheduleStatic m_static;
541 ScheduleDeck m_sched_deck;
542 Action::WGNames action_wgnames;
543 std::optional<int> exit_status;
544 std::vector<ScheduleState> snapshots;
545 WriteRestartFileEvents restart_output;
546 CompletedCells completed_cells;
547
548 void load_rst(const RestartIO::RstState& rst,
549 const TracerConfig& tracer_config,
550 const ScheduleGrid& grid,
551 const FieldPropsManager& fp);
552 void addWell(Well well);
553 void addWell(const std::string& wellName,
554 const std::string& group,
555 int headI,
556 int headJ,
557 Phase preferredPhase,
558 const std::optional<double>& refDepth,
559 double drainageRadius,
560 bool allowCrossFlow,
561 bool automaticShutIn,
562 int pvt_table,
563 Well::GasInflowEquation gas_inflow,
564 std::size_t timeStep,
565 Connection::Order wellConnectionOrder);
566 bool updateWPAVE(const std::string& wname, std::size_t report_step, const PAvg& pavg);
567
568 void updateGuideRateModel(const GuideRateModel& new_model, std::size_t report_step);
569 GTNode groupTree(const std::string& root_node, std::size_t report_step, std::size_t level, const std::optional<std::string>& parent_name) const;
570 bool checkGroups(const ParseContext& parseContext, ErrorGuard& errors);
571 bool updateWellStatus( const std::string& well, std::size_t reportStep, Well::Status status, std::optional<KeywordLocation> = {});
572 void addWellToGroup( const std::string& group_name, const std::string& well_name , std::size_t timeStep);
573 void iterateScheduleSection(std::size_t load_start,
574 std::size_t load_end,
575 const ParseContext& parseContext,
576 ErrorGuard& errors,
577 const ScheduleGrid& grid,
578 const std::unordered_map<std::string, double> * target_wellpi,
579 const std::string& prefix,
580 const bool log_to_debug = false);
581 void addACTIONX(const Action::ActionX& action);
582 void addGroupToGroup( const std::string& parent_group, const std::string& child_group);
583 void addGroup(const std::string& groupName , std::size_t timeStep);
584 void addGroup(Group group);
585 void addGroup(const RestartIO::RstGroup& rst_group, std::size_t timeStep);
586 void addWell(const std::string& wellName, const DeckRecord& record, std::size_t timeStep, Connection::Order connection_order);
587 void checkIfAllConnectionsIsShut(std::size_t currentStep);
588 void end_report(std::size_t report_step);
589 void handleKeyword(std::size_t currentStep,
590 const ScheduleBlock& block,
591 const DeckKeyword& keyword,
592 const ParseContext& parseContext,
593 ErrorGuard& errors,
594 const ScheduleGrid& grid,
595 const std::vector<std::string>& matching_wells,
596 bool actionx_mode,
597 SimulatorUpdate* sim_update,
598 const std::unordered_map<std::string, double>* target_wellpi,
599 std::unordered_map<std::string, double>* wpimult_global_factor = nullptr);
600
601 void prefetch_cell_properties(const ScheduleGrid& grid, const DeckKeyword& keyword);
602 void store_wgnames(const DeckKeyword& keyword);
603 std::vector<std::string> wellNames(const std::string& pattern, const HandlerContext& context);
604 std::vector<std::string> wellNames(const std::string& pattern, std::size_t timeStep, const std::vector<std::string>& matching_wells, InputError::Action error_action, ErrorGuard& errors, const KeywordLocation& location) const;
605 void invalidNamePattern( const std::string& namePattern, const HandlerContext& context) const;
606 static std::string formatDate(std::time_t t);
607 std::string simulationDays(std::size_t currentStep) const;
608 void applyGlobalWPIMULT( const std::unordered_map<std::string, double>& wpimult_global_factor);
609
610 bool must_write_rst_file(std::size_t report_step) const;
611
612 void applyEXIT(const DeckKeyword&, std::size_t currentStep);
613 SimulatorUpdate applyAction(std::size_t reportStep, const std::string& action_name, const std::vector<std::string>& matching_wells);
614
630 bool handleNormalKeyword(HandlerContext& handlerContext);
631
632 // Keyword Handlers
633 void handlePYACTION(const DeckKeyword&);
634 void handleWELPIRuntime(HandlerContext&);
635
636 // Normal keyword handlers -- in KeywordHandlers.cpp
637
638 void handleBRANPROP (HandlerContext&);
639 void handleCOMPDAT (HandlerContext&);
640 void handleCOMPLUMP (HandlerContext&);
641 void handleCOMPORD (HandlerContext&);
642 void handleCOMPSEGS (HandlerContext&);
643 void handleDRSDT (HandlerContext&);
644 void handleDRSDTCON (HandlerContext&);
645 void handleDRSDTR (HandlerContext&);
646 void handleDRVDT (HandlerContext&);
647 void handleDRVDTR (HandlerContext&);
648 void handleEXIT (HandlerContext&);
649 void handleGCONINJE (HandlerContext&);
650 void handleGCONPROD (HandlerContext&);
651 void handleGCONSALE (HandlerContext&);
652 void handleGCONSUMP (HandlerContext&);
653 void handleGEFAC (HandlerContext&);
654 void handleGEOKeyword(HandlerContext&);
655 void handleGLIFTOPT (HandlerContext&);
656 void handleGPMAINT (HandlerContext&);
657 void handleGRUPNET (HandlerContext&);
658 void handleGRUPTREE (HandlerContext&);
659 void handleGUIDERAT (HandlerContext&);
660 void handleLIFTOPT (HandlerContext&);
661 void handleLINCOM (HandlerContext&);
662 void handleMESSAGES (HandlerContext&);
663 void handleMXUNSUPP (HandlerContext&);
664 void handleNETBALAN (HandlerContext&);
665 void handleNEXTSTEP (HandlerContext&);
666 void handleNODEPROP (HandlerContext&);
667 void handleNUPCOL (HandlerContext&);
668 void handleRPTONLY (HandlerContext&);
669 void handleRPTONLYO (HandlerContext&);
670 void handleRPTRST (HandlerContext&);
671 void handleRPTSCHED (HandlerContext&);
672 void handleTUNING (HandlerContext&);
673 void handleSAVE (HandlerContext&);
674 void handleSUMTHIN (HandlerContext&);
675 void handleUDQ (HandlerContext&);
676 void handleVAPPARS (HandlerContext&);
677 void handleVFPINJ (HandlerContext&);
678 void handleVFPPROD (HandlerContext&);
679 void handleWCONHIST (HandlerContext&);
680 void handleWCONINJE (HandlerContext&);
681 void handleWCONINJH (HandlerContext&);
682 void handleWCONPROD (HandlerContext&);
683 void handleWECON (HandlerContext&);
684 void handleWEFAC (HandlerContext&);
685 void handleWELOPEN (HandlerContext&);
686 void handleWELPI (HandlerContext&);
687 void handleWELSEGS (HandlerContext&);
688 void handleWELSPECS (HandlerContext&);
689 void handleWELTARG (HandlerContext&);
690 void handleWFOAM (HandlerContext&);
691 void handleWGRUPCON (HandlerContext&);
692 void handleWHISTCTL (HandlerContext&);
693 void handleWINJTEMP (HandlerContext&);
694 void handleWLIFTOPT (HandlerContext&);
695 void handleWLIST (HandlerContext&);
696 void handleWMICP (HandlerContext&);
697 void handleWPAVE (HandlerContext&);
698 void handleWPAVEDEP (HandlerContext&);
699 void handleWVFPEXP (HandlerContext&);
700 void handleWWPAVE (HandlerContext&);
701 void handleWPIMULT (HandlerContext&);
702 void handleWPMITAB (HandlerContext&);
703 void handleWPOLYMER (HandlerContext&);
704 void handleWRFT (HandlerContext&);
705 void handleWRFTPLT (HandlerContext&);
706 void handleWSALT (HandlerContext&);
707 void handleWSEGITER (HandlerContext&);
708 void handleWSEGSICD (HandlerContext&);
709 void handleWSEGAICD (HandlerContext&);
710 void handleWSEGVALV (HandlerContext&);
711 void handleWSKPTAB (HandlerContext&);
712 void handleWSOLVENT (HandlerContext&);
713 void handleWTEMP (HandlerContext&);
714 void handleWTEST (HandlerContext&);
715 void handleWTMULT (HandlerContext&);
716 void handleWTRACER (HandlerContext&);
717 };
718}
719
720#endif
Definition: ActionX.hpp:74
Definition: PyAction.hpp:41
Definition: State.hpp:40
Definition: WGNames.hpp:29
Simple class capturing active cells of a grid.
Definition: ActiveGridCells.hpp:36
Definition: CompletedCells.hpp:28
Definition: DeckKeyword.hpp:36
Definition: DeckRecord.hpp:32
Definition: Deck.hpp:63
About cell information and dimension: The actual grid information is held in a pointer to an ERT ecl_...
Definition: EclipseGrid.hpp:54
Definition: EclipseState.hpp:55
Definition: ErrorGuard.hpp:29
Definition: FieldPropsManager.hpp:38
Definition: GTNode.hpp:31
Definition: GasLiftOpt.hpp:30
Definition: Group.hpp:44
Definition: GuideRateModel.hpp:29
Definition: KeywordLocation.hpp:27
Definition: MessageLimits.hpp:28
Definition: PAvg.hpp:28
Definition: ParseContext.hpp:88
Definition: RSTConfig.hpp:196
Definition: Runspec.hpp:453
Definition: ScheduleDeck.hpp:54
Definition: ScheduleDeck.hpp:124
Definition: ScheduleGrid.hpp:29
Definition: ScheduleState.hpp:81
Definition: Schedule.hpp:138
Class for (de-)serializing.
Definition: Serializer.hpp:75
bool isSerializing() const
Returns true if we are currently doing a serialization operation.
Definition: Serializer.hpp:174
Definition: SummaryState.hpp:69
Definition: TracerConfig.hpp:31
Definition: UDQConfig.hpp:51
Definition: UnitSystem.hpp:33
Definition: WellMatcher.hpp:32
Definition: Well.hpp:78
Definition: WriteRestartFileEvents.hpp:31
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: group.hpp:33
Definition: state.hpp:54
Definition: ScheduleDeck.hpp:92
Definition: Schedule.hpp:72
Definition: SimulatorUpdate.hpp:35