Well.hpp
Go to the documentation of this file.
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 
20 
21 #ifndef WELL_HPP_
22 #define WELL_HPP_
23 
32 
33 #include <opm/common/utility/platform_dependent/disable_warnings.h>
34 
35 #include <boost/optional.hpp>
36 
37 #include <opm/common/utility/platform_dependent/reenable_warnings.h>
38 
39 #include <memory>
40 #include <string>
41 #include <limits>
42 
43 namespace Opm {
44 
45 
46 
47  class Well {
48  public:
49  Well(const std::string& name, std::shared_ptr<const EclipseGrid> grid , int headI, int headJ, Value<double> refDepth , Phase::PhaseEnum preferredPhase,
50  TimeMapConstPtr timeMap, size_t creationTimeStep, WellCompletion::CompletionOrderEnum completionOrdering = WellCompletion::TRACK, bool allowCrossFlow = true);
51  const std::string& name() const;
52 
53  bool hasBeenDefined(size_t timeStep) const;
54  const std::string getGroupName(size_t timeStep) const;
55  void setGroupName(size_t timeStep , const std::string& groupName);
56 
57  WellCommon::StatusEnum getStatus(size_t timeStep) const;
58  bool setStatus(size_t timeStep, WellCommon::StatusEnum Status);
59 
60  int getHeadI() const;
61  int getHeadJ() const;
62  double getRefDepth() const;
64 
65  bool isAvailableForGroupControl(size_t timeStep) const;
66  void setAvailableForGroupControl(size_t timeStep, bool isAvailableForGroupControl);
67  double getGuideRate(size_t timeStep) const;
68  void setGuideRate(size_t timeStep, double guideRate);
69  GuideRate::GuideRatePhaseEnum getGuideRatePhase(size_t timeStep) const;
70  void setGuideRatePhase(size_t timeStep, GuideRate::GuideRatePhaseEnum phase);
71  double getGuideRateScalingFactor(size_t timeStep) const;
72  void setGuideRateScalingFactor(size_t timeStep, double scalingFactor);
73 
74  bool isProducer(size_t timeStep) const;
75  bool isInjector(size_t timeStep) const;
76  void addWELSPECS(DeckRecordConstPtr deckRecord);
77  void addCompletions(size_t time_step , const std::vector<CompletionPtr>& newCompletions);
78  void addCompletionSet(size_t time_step, const CompletionSetConstPtr newCompletionSet);
79  CompletionSetConstPtr getCompletions(size_t timeStep) const;
80 
81  bool setProductionProperties(size_t timeStep , const WellProductionProperties properties);
83  const WellProductionProperties& getProductionProperties(size_t timeStep) const;
84 
85  bool setInjectionProperties(size_t timeStep , const WellInjectionProperties properties);
87  const WellInjectionProperties& getInjectionProperties(size_t timeStep) const;
88 
89  bool setPolymerProperties(size_t timeStep , const WellPolymerProperties properties);
90  WellPolymerProperties getPolymerPropertiesCopy(size_t timeStep) const;
91  const WellPolymerProperties& getPolymerProperties(size_t timeStep) const;
92 
93  bool setSolventFraction(size_t timeStep , const double fraction);
94  const double& getSolventFraction(size_t timeStep) const;
95 
96  bool getRFTActive(size_t time_step) const;
97  void setRFTActive(size_t time_step, bool value);
98  bool getPLTActive(size_t time_step) const;
99  void setPLTActive(size_t time_step, bool value);
100  int findWellFirstOpen(int startTimeStep) const;
101  void setRFTForWellWhenFirstOpen(int numSteps,size_t currentStep);
102 
103  static bool wellNameInWellNamePattern(const std::string& wellName, const std::string& wellNamePattern);
104 
106 
107  bool getAllowCrossFlow() const;
108 
109 
110 
111 
112 
113  private:
114  void setRefDepthFromCompletions() const;
115  size_t m_creationTimeStep;
116  std::string m_name;
117 
118  std::shared_ptr<DynamicState<WellCommon::StatusEnum> > m_status;
119 
120  std::shared_ptr<DynamicState<bool> > m_isAvailableForGroupControl;
121  std::shared_ptr<DynamicState<double> > m_guideRate;
122  std::shared_ptr<DynamicState<GuideRate::GuideRatePhaseEnum> > m_guideRatePhase;
123  std::shared_ptr<DynamicState<double> > m_guideRateScalingFactor;
124 
125  std::shared_ptr<DynamicState<bool> > m_isProducer;
126  std::shared_ptr<DynamicState<CompletionSetConstPtr> > m_completions;
127  std::shared_ptr<DynamicState<WellProductionProperties> > m_productionProperties;
128  std::shared_ptr<DynamicState<WellInjectionProperties> > m_injectionProperties;
129  std::shared_ptr<DynamicState<WellPolymerProperties> > m_polymerProperties;
130  std::shared_ptr<DynamicState<double> > m_solventFraction;
131  std::shared_ptr<DynamicState<std::string> > m_groupName;
132  std::shared_ptr<DynamicState<bool> > m_rft;
133  std::shared_ptr<DynamicState<bool> > m_plt;
134 
135  // WELSPECS data - assumes this is not dynamic
136 
137  TimeMapConstPtr m_timeMap;
138  int m_headI;
139  int m_headJ;
140  mutable Value<double> m_refDepth;
141  Phase::PhaseEnum m_preferredPhase;
142  std::shared_ptr<const EclipseGrid> m_grid;
143 
145  bool m_allowCrossFlow;
146 
147  };
148  typedef std::shared_ptr<Well> WellPtr;
149  typedef std::shared_ptr<const Well> WellConstPtr;
150 }
151 
152 
153 
154 #endif /* WELL_HPP_ */
Definition: WellPolymerProperties.hpp:26
bool setPolymerProperties(size_t timeStep, const WellPolymerProperties properties)
std::shared_ptr< const TimeMap > TimeMapConstPtr
Definition: TimeMap.hpp:77
StatusEnum
Definition: ScheduleEnums.hpp:29
Definition: Deck.hpp:29
int getHeadI() const
bool getAllowCrossFlow() const
std::shared_ptr< const CompletionSet > CompletionSetConstPtr
Definition: CompletionSet.hpp:64
bool setInjectionProperties(size_t timeStep, const WellInjectionProperties properties)
Definition: WellInjectionProperties.hpp:27
WellProductionProperties getProductionPropertiesCopy(size_t timeStep) const
bool setSolventFraction(size_t timeStep, const double fraction)
void setAvailableForGroupControl(size_t timeStep, bool isAvailableForGroupControl)
bool setProductionProperties(size_t timeStep, const WellProductionProperties properties)
std::shared_ptr< Well > WellPtr
Definition: Well.hpp:148
WellPolymerProperties getPolymerPropertiesCopy(size_t timeStep) const
GuideRate::GuideRatePhaseEnum getGuideRatePhase(size_t timeStep) const
void addCompletionSet(size_t time_step, const CompletionSetConstPtr newCompletionSet)
double getGuideRateScalingFactor(size_t timeStep) const
const std::string getGroupName(size_t timeStep) const
bool hasBeenDefined(size_t timeStep) const
double getRefDepth() const
bool getRFTActive(size_t time_step) const
const std::string & name() const
const double & getSolventFraction(size_t timeStep) const
void setGuideRateScalingFactor(size_t timeStep, double scalingFactor)
Phase::PhaseEnum getPreferredPhase() const
void setGuideRatePhase(size_t timeStep, GuideRate::GuideRatePhaseEnum phase)
void setPLTActive(size_t time_step, bool value)
PhaseEnum
Definition: ScheduleEnums.hpp:75
bool getPLTActive(size_t time_step) const
const WellInjectionProperties & getInjectionProperties(size_t timeStep) const
int getHeadJ() const
void setRFTActive(size_t time_step, bool value)
WellCompletion::CompletionOrderEnum getWellCompletionOrdering() const
bool isInjector(size_t timeStep) const
void setRFTForWellWhenFirstOpen(int numSteps, size_t currentStep)
const WellPolymerProperties & getPolymerProperties(size_t timeStep) const
CompletionOrderEnum
Definition: ScheduleEnums.hpp:56
WellInjectionProperties getInjectionPropertiesCopy(size_t timeStep) const
int findWellFirstOpen(int startTimeStep) const
WellCommon::StatusEnum getStatus(size_t timeStep) const
Well(const std::string &name, std::shared_ptr< const EclipseGrid > grid, int headI, int headJ, Value< double > refDepth, Phase::PhaseEnum preferredPhase, TimeMapConstPtr timeMap, size_t creationTimeStep, WellCompletion::CompletionOrderEnum completionOrdering=WellCompletion::TRACK, bool allowCrossFlow=true)
GuideRatePhaseEnum
Definition: ScheduleEnums.hpp:202
std::shared_ptr< const DeckRecord > DeckRecordConstPtr
Definition: DeckRecord.hpp:54
double getGuideRate(size_t timeStep) const
Definition: ScheduleEnums.hpp:59
Definition: WellProductionProperties.hpp:27
const WellProductionProperties & getProductionProperties(size_t timeStep) const
bool isProducer(size_t timeStep) const
void addCompletions(size_t time_step, const std::vector< CompletionPtr > &newCompletions)
void setGroupName(size_t timeStep, const std::string &groupName)
void setGuideRate(size_t timeStep, double guideRate)
Definition: Well.hpp:47
void addWELSPECS(DeckRecordConstPtr deckRecord)
CompletionSetConstPtr getCompletions(size_t timeStep) const
bool setStatus(size_t timeStep, WellCommon::StatusEnum Status)
static bool wellNameInWellNamePattern(const std::string &wellName, const std::string &wellNamePattern)
bool isAvailableForGroupControl(size_t timeStep) const
std::shared_ptr< const Well > WellConstPtr
Definition: Well.hpp:149