24 #ifndef OPM_WELLINTERFACE_GENERIC_HEADER_INCLUDED
25 #define OPM_WELLINTERFACE_GENERIC_HEADER_INCLUDED
27 #include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
39 class ParallelWellInfo;
40 struct PerforationData;
46 class SingleWellState;
57 const int pvtRegionIdx,
58 const int num_components,
60 const int index_of_well,
61 const std::vector<PerforationData>& perf_data);
67 const std::string&
name()
const;
76 const std::vector<int>&
cells()
const {
return well_cells_; }
81 const Well& wellEcl()
const;
88 bool isOperableAndSolvable()
const;
90 void initCompletions();
91 void closeCompletions(
const WellTestState& wellTestState);
93 void setVFPProperties(
const VFPProperties* vfp_properties_arg);
94 void setGuideRate(
const GuideRate* guide_rate_arg);
95 void setWellEfficiencyFactor(
const double efficiency_factor);
96 void setRepRadiusPerfLength(
const std::vector<int>& cartesian_to_compressed);
97 void setWsolvent(
const double wsolvent);
98 void setDynamicThpLimit(
const double thp_limit);
99 void updatePerforatedCell(std::vector<bool>& is_cell_perforated);
105 this->wellStatus_ = Well::Status::STOP;
109 this->wellStatus_ = Well::Status::OPEN;
112 bool wellIsStopped()
const {
113 return this->wellStatus_ == Well::Status::STOP;
116 int currentStep()
const {
117 return this->current_step_;
120 int pvtRegionIdx()
const {
121 return pvtRegionIdx_;
124 const GuideRate* guideRate()
const {
128 int numComponents()
const {
129 return num_components_;
132 int numPhases()
const {
133 return number_of_phases_;
136 int numPerfs()
const {
137 return number_of_perforations_;
140 double refDepth()
const {
144 double gravity()
const {
148 const VFPProperties* vfpProperties()
const {
149 return vfp_properties_;
152 const ParallelWellInfo& parallelWellInfo()
const {
153 return parallel_well_info_;
156 const std::vector<double>& perfDepth()
const {
160 std::vector<double>& perfDepth() {
164 const std::vector<double>& wellIndex()
const {
168 double getTHPConstraint(
const SummaryState& summaryState)
const;
169 double getALQ(
const WellState& well_state)
const;
170 double wsolvent()
const;
173 bool isVFPActive(DeferredLogger& deferred_logger)
const;
175 void reportWellSwitching(
const SingleWellState& ws, DeferredLogger& deferred_logger)
const;
178 bool getAllowCrossFlow()
const;
179 double mostStrictBhpFromBhpLimits(
const SummaryState& summaryState)
const;
180 void updateWellTestStatePhysical(
const double simulation_time,
181 const bool write_message_to_opmlog,
182 WellTestState& well_test_state,
183 DeferredLogger& deferred_logger)
const;
188 bool isOperableAndSolvable()
const {
189 if (!operable_under_only_bhp_limit || !solvable) {
192 return ( (isOperableUnderBHPLimit() || isOperableUnderTHPLimit()) );
196 bool isOperableUnderBHPLimit()
const {
197 return operable_under_only_bhp_limit && obey_thp_limit_under_bhp_limit;
200 bool isOperableUnderTHPLimit()
const {
201 return can_obtain_bhp_with_thp_limit && obey_bhp_limit_with_thp_limit;
204 void resetOperability() {
205 operable_under_only_bhp_limit =
true;
206 obey_thp_limit_under_bhp_limit =
true;
207 can_obtain_bhp_with_thp_limit =
true;
208 obey_bhp_limit_with_thp_limit =
true;
214 bool operable_under_only_bhp_limit =
true;
217 bool obey_thp_limit_under_bhp_limit =
true;
219 bool can_obtain_bhp_with_thp_limit =
true;
221 bool obey_bhp_limit_with_thp_limit =
true;
223 bool solvable =
true;
231 const int current_step_;
235 const int pvtRegionIdx_;
237 const int num_components_;
240 int number_of_phases_;
245 const std::vector<PerforationData>* perf_data_;
251 mutable std::vector<double> ipr_a_;
252 mutable std::vector<double> ipr_b_;
255 std::vector<int> well_cells_;
258 std::vector<double> well_index_;
261 int number_of_perforations_;
264 std::vector<double> perf_depth_;
267 std::vector<double> perf_rep_radius_;
270 std::vector<double> perf_length_;
273 std::vector<double> bore_diameters_;
290 std::map<int, std::vector<int>> completions_;
296 std::vector<int> saturation_table_number_;
298 Well::Status wellStatus_;
304 std::optional<double> dynamic_thp_limit_;
306 double well_efficiency_factor_;
308 const GuideRate* guide_rate_;
310 std::vector< std::string> well_control_log_;
Class encapsulating some information about parallel wells.
Definition: ParallelWellInfo.hpp:252
A thin wrapper class that holds one VFPProdProperties and one VFPInjProperties object.
Definition: VFPProperties.hpp:37
Definition: WellInterfaceGeneric.hpp:51
bool wellHasTHPConstraints(const SummaryState &summaryState) const
Returns true if the well has one or more THP limits/constraints.
Definition: WellInterfaceGeneric.cpp:150
int indexOfWell() const
Index of well in the wells struct and wellState.
Definition: WellInterfaceGeneric.cpp:123
const std::string & name() const
Well name.
Definition: WellInterfaceGeneric.cpp:108
const std::vector< int > & cells() const
Well cells.
Definition: WellInterfaceGeneric.hpp:76
bool underPredictionMode() const
Returns true if the well is currently in prediction mode (i.e. not history mode).
Definition: WellInterfaceGeneric.cpp:205
bool isProducer() const
True if the well is a producer.
Definition: WellInterfaceGeneric.cpp:118
bool isInjector() const
True if the well is an injector.
Definition: WellInterfaceGeneric.cpp:113
const std::vector< PerforationData > & perforationData() const
Get the perforations of the well.
Definition: WellInterfaceGeneric.cpp:103
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:26
Definition: BlackoilPhases.hpp:45
Definition: WellInterfaceGeneric.hpp:187