My Project
Loading...
Searching...
No Matches
EclActionHandler.hpp
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
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 2 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 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
23
24#ifndef ECL_ACTION_HANDLER_HPP
25#define ECL_ACTION_HANDLER_HPP
26
27#include <opm/simulators/utils/ParallelCommunication.hpp>
28
29#include <functional>
30#include <string>
31#include <unordered_map>
32#include <vector>
33
34namespace Opm {
35
36namespace Action {
37class ActionX;
38class State;
39}
40
41class BlackoilWellModelGeneric;
42class EclipseState;
43class Schedule;
44struct SimulatorUpdate;
45class SummaryState;
46class UDQState;
47
50{
51public:
53 using TransFunc = std::function<void(bool)>;
54
55 EclActionHandler(EclipseState& ecl_state,
56 Schedule& schedule,
57 Action::State& actionState,
58 SummaryState& summaryState,
59 BlackoilWellModelGeneric& wellModel,
60 Parallel::Communication comm);
61
62 void applyActions(int reportStep,
63 double sim_time,
64 const TransFunc& updateTrans);
65
67 void evalUDQAssignments(const unsigned episodeIdx,
69
70 private:
71 /*
72 This function is run after applyAction has been completed in the Schedule
73 implementation. The sim_update argument should have members & flags for
74 the simulator properties which need to be updated. This functionality is
75 probably not complete.
76 */
77 void applySimulatorUpdate(int report_step,
79 bool& commit_wellstate,
80 const TransFunc& updateTrans);
81
82 std::unordered_map<std::string, double>
83 fetchWellPI(int reportStep,
84 const Action::ActionX& action,
85 const std::vector<std::string>& matching_wells) const;
86
87 EclipseState& ecl_state_;
88 Schedule& schedule_;
89 Action::State& actionState_;
90 SummaryState& summaryState_;
91 BlackoilWellModelGeneric& wellModel_;
92 Parallel::Communication comm_;
93};
94
95} // namespace Opm
96
97#endif // ECL_ACTION_HANDLER_HPP
Definition AquiferInterface.hpp:35
Class for handling the blackoil well model.
Definition BlackoilWellModelGeneric.hpp:82
Class handling Action support in simulator.
Definition EclActionHandler.hpp:50
std::function< void(bool)> TransFunc
Function handle to update transmissiblities.
Definition EclActionHandler.hpp:53
void evalUDQAssignments(const unsigned episodeIdx, UDQState &udq_state)
Evaluates UDQ assign statements.
Definition EclActionHandler.cpp:253
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27