My Project
Loading...
Searching...
No Matches
BlackoilWellModelGasLift.hpp
1/*
2 Copyright 2016 SINTEF ICT, Applied Mathematics.
3 Copyright 2016 - 2017 Statoil ASA.
4 Copyright 2017 Dr. Blatt - HPC-Simulation-Software & Services
5 Copyright 2016 - 2018 IRIS AS
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#ifndef OPM_BLACKOILWELLMODEL_GASLIFT_HEADER_INCLUDED
23#define OPM_BLACKOILWELLMODEL_GASLIFT_HEADER_INCLUDED
24
26#include <opm/simulators/wells/GasLiftSingleWellGeneric.hpp>
27
28#include <memory>
29#include <map>
30#include <string>
31
32namespace Opm {
33
34class DeferredLogger;
35template<class Scalar> class GroupState;
36template<class Scalar> class WellState;
37template<class TypeTag> class WellInterface;
38
39template<class Scalar>
41{
42public:
43 using GLiftOptWells = std::map<std::string, std::unique_ptr<GasLiftSingleWellGeneric<Scalar>>>;
44 using GLiftProdWells = std::map<std::string, const WellInterfaceGeneric<Scalar>*>;
45 using GLiftWellStateMap = std::map<std::string, std::unique_ptr<GasLiftWellState<Scalar>>>;
46 using GLiftEclWells = typename GasLiftGroupInfo<Scalar>::GLiftEclWells;
47 using GLiftSyncGroups = typename GasLiftSingleWellGeneric<Scalar>::GLiftSyncGroups;
48
50 : terminal_output_(terminal_output)
51 {}
52
53 static constexpr bool glift_debug = false;
54
55 void gliftDebug(const std::string& msg,
57
58 bool terminalOutput() const { return terminal_output_; }
59
60 template<class Serializer>
61 void serializeOp(Serializer& serializer)
62 {
63 serializer(last_glift_opt_time_);
64 }
65
66 bool operator==(const BlackoilWellModelGasLiftGeneric& that) const
67 { return this->last_glift_opt_time_ == that.last_glift_opt_time_; }
68
69protected:
70 void gliftDebugShowALQ(const std::vector<WellInterfaceGeneric<Scalar>*>& well_container,
71 const WellState<Scalar>& wellState,
73
74 void gasLiftOptimizationStage2(const Parallel::Communication& comm,
75 const Schedule& schedule,
76 const SummaryState& summaryState,
77 WellState<Scalar>& wellState,
78 GroupState<Scalar>& groupState,
79 GLiftProdWells& prod_wells,
80 GLiftOptWells& glift_wells,
82 GLiftWellStateMap& map,
83 const int episodeIndex,
85
86 bool terminal_output_;
87 double last_glift_opt_time_ = -1.0;
88};
89
91template<typename TypeTag>
93 public BlackoilWellModelGasLiftGeneric<GetPropType<TypeTag, Properties::Scalar>>
94{
96
97public:
98 using Base::glift_debug;
100 using GLiftEclWells = typename GasLiftGroupInfo<Scalar>::GLiftEclWells;
101 using GLiftOptWells = typename Base::GLiftOptWells;
102 using GLiftProdWells = typename Base::GLiftProdWells;
103 using GLiftSyncGroups = typename GasLiftSingleWellGeneric<Scalar>::GLiftSyncGroups;
104 using GLiftWellStateMap = typename Base::GLiftWellStateMap;
106 using WellInterfacePtr = std::shared_ptr<WellInterface<TypeTag>>;
107
109 const PhaseUsage& phase_usage)
111 , phase_usage_(phase_usage)
112 {}
113
114 static void initGliftEclWellMap(const std::vector<WellInterfacePtr>& well_container,
115 GLiftEclWells& ecl_well_map);
116
117 bool maybeDoGasLiftOptimize(const Simulator& simulator,
118 const std::vector<WellInterfacePtr>& well_container,
119 WellState<Scalar>& wellState,
120 GroupState<Scalar>& groupState,
122
123private:
124 void gasLiftOptimizationStage1(const Simulator& simulator,
125 const std::vector<WellInterfacePtr>& well_container,
126 WellState<Scalar>& wellState,
127 GroupState<Scalar>& groupState,
128 GLiftProdWells& prod_wells,
129 GLiftOptWells& glift_wells,
131 GLiftWellStateMap& state_map,
133
134 // cannot be const since it accesses the non-const WellState
135 void gasLiftOptimizationStage1SingleWell(WellInterface<TypeTag>* well,
136 const Simulator& simulator,
137 WellState<Scalar>& wellState,
138 GroupState<Scalar>& groupState,
139 GLiftProdWells& prod_wells,
140 GLiftOptWells& glift_wells,
142 GLiftWellStateMap& state_map,
143 GLiftSyncGroups& groups_to_sync,
145
146 const PhaseUsage& phase_usage_;
147};
148
149} // namespace Opm
150
151#include "BlackoilWellModelGasLift_impl.hpp"
152
153#endif
Defines a type tags and some fundamental properties all models.
Definition BlackoilWellModelGasLift.hpp:41
Class for handling the gaslift in the blackoil well model.
Definition BlackoilWellModelGasLift.hpp:94
Definition DeferredLogger.hpp:57
Definition GasLiftGroupInfo.hpp:46
Definition GroupState.hpp:43
Definition WellInterfaceGeneric.hpp:53
Definition WellInterface.hpp:77
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:66
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
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition propertysystem.hh:235
Definition BlackoilPhases.hpp:46