WellCollection.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2011 SINTEF ICT, Applied Mathematics.
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 OPM_WELLCOLLECTION_HPP
20 #define OPM_WELLCOLLECTION_HPP
21 
22 #include <vector>
23 #include <memory>
24 
26 #include <opm/core/grid.h>
28 
29 #include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
30 #include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp>
31 
32 namespace Opm
33 {
34 
36  {
37  public:
38 
39  void addField(GroupConstPtr fieldGroup, size_t timeStep, const PhaseUsage& phaseUsage);
40 
41  void addWell(WellConstPtr wellChild, size_t timeStep, const PhaseUsage& phaseUsage);
42 
43  void addGroup(GroupConstPtr groupChild, std::string parent_name,
44  size_t timeStep, const PhaseUsage& phaseUsage);
45 
50  void addChild(std::shared_ptr<WellsGroupInterface>& child_node,
51  const std::string& parent);
52 
54  void addChild(std::shared_ptr<WellsGroupInterface>& child_node);
55 
78  bool conditionsMet(const std::vector<double>& well_bhp,
79  const std::vector<double>& well_reservoirrates_phase,
80  const std::vector<double>& well_surfacerates_phase);
81 
83  void setWellsPointer(Wells* wells);
84 
86  const std::vector<WellNode*>& getLeafNodes() const;
87 
91  WellsGroupInterface* findNode(const std::string& name);
92 
96  const WellsGroupInterface* findNode(const std::string& name) const;
97 
99  void applyGroupControls();
100 
110  void applyExplicitReinjectionControls(const std::vector<double>& well_reservoirrates_phase,
111  const std::vector<double>& well_surfacerates_phase);
112 
113  private:
114  // To account for the possibility of a forest
115  std::vector<std::shared_ptr<WellsGroupInterface> > roots_;
116 
117  // This will be used to traverse the bottom nodes.
118  std::vector<WellNode*> leaf_nodes_;
119 
120 
121  };
122 
123 } // namespace Opm
124 #endif /* OPM_WELLCOLLECTION_HPP */
125 
void addGroup(GroupConstPtr groupChild, std::string parent_name, size_t timeStep, const PhaseUsage &phaseUsage)
Definition: wells.h:50
Definition: WellsGroup.hpp:54
bool conditionsMet(const std::vector< double > &well_bhp, const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)
void applyGroupControls()
Applies all group controls (injection and production)
const std::vector< WellNode * > & getLeafNodes() const
void setWellsPointer(Wells *wells)
Adds the well pointer to each leaf node (does not take ownership).
Definition: AnisotropicEikonal.hpp:43
void applyExplicitReinjectionControls(const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)
void addChild(std::shared_ptr< WellsGroupInterface > &child_node, const std::string &parent)
void addField(GroupConstPtr fieldGroup, size_t timeStep, const PhaseUsage &phaseUsage)
Definition: WellCollection.hpp:35
void addWell(WellConstPtr wellChild, size_t timeStep, const PhaseUsage &phaseUsage)
WellsGroupInterface * findNode(const std::string &name)
Definition: BlackoilPhases.hpp:36