20 #ifndef OPM_WELLSGROUP_HPP 21 #define OPM_WELLSGROUP_HPP 23 #include <opm/core/wells/InjectionSpecification.hpp> 24 #include <opm/core/wells/ProductionSpecification.hpp> 25 #include <opm/core/grid.h> 26 #include <opm/core/props/BlackoilPhases.hpp> 28 #include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp> 29 #include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp> 45 double res_inj_rates[3];
46 double res_prod_rates[3];
47 double surf_inj_rates[3];
48 double surf_prod_rates[3];
58 const double efficiency_factor,
65 const std::string&
name()
const;
126 virtual bool conditionsMet(
const std::vector<double>& well_bhp,
127 const std::vector<double>& well_reservoirrates_phase,
128 const std::vector<double>& well_surfacerates_phase,
137 const InjectionSpecification::InjectorType injector_type,
139 const bool only_group) = 0;
147 const bool only_group) = 0;
161 virtual std::pair<WellNode*, double>
getWorstOffending(
const std::vector<double>& well_reservoirrates_phase,
162 const std::vector<double>& well_surfacerates_phase,
163 ProductionSpecification::ControlMode mode) = 0;
166 double getTarget(ProductionSpecification::ControlMode mode)
const;
169 double getTarget(InjectionSpecification::ControlMode mode)
const;
195 const BlackoilPhases::PhaseIndex phase)
const = 0;
207 const std::vector<double>& well_surfacerates_phase) = 0;
211 const std::vector<double>& conversion_coeffs) = 0;
213 virtual void applyVREPGroupControl(
const double target,
214 const InjectionSpecification::InjectorType injector_type,
215 const std::vector<double>& well_voidage_rates,
216 const std::vector<double>& conversion_coeffs,
217 const bool only_group) = 0;
219 virtual double getTotalVoidageRate(
const std::vector<double>& well_voidage_rates) = 0;
230 virtual double getProductionRate(
const std::vector<double>& well_rates,
231 const ProductionSpecification::ControlMode prod_mode)
const = 0;
233 virtual void updateWellProductionTargets(
const std::vector<double>& well_rates) = 0;
235 virtual void updateWellInjectionTargets(
const std::vector<double>& well_rates) = 0;
237 virtual void setTargetUpdated(
const bool flag) = 0;
241 virtual bool canProduceMore()
const = 0;
249 virtual bool groupProdTargetConverged(
const std::vector<double>& well_rates)
const = 0;
251 double efficiencyFactor()
const;
253 void setEfficiencyFactor(
const double efficiency_factor);
258 const double* surf_rates,
259 const ProductionSpecification::ControlMode mode);
263 const double* surf_rates,
264 const InjectionSpecification::ControlMode mode);
271 bool individual_control_;
274 double efficiency_factor_;
289 const double efficiency_factor,
296 void addChild(std::shared_ptr<WellsGroupInterface> child);
298 virtual bool conditionsMet(
const std::vector<double>& well_bhp,
299 const std::vector<double>& well_reservoirrates_phase,
300 const std::vector<double>& well_surfacerates_phase,
304 virtual std::pair<WellNode*, double>
getWorstOffending(
const std::vector<double>& well_reservoirrates_phase,
305 const std::vector<double>& well_surfacerates_phase,
306 ProductionSpecification::ControlMode mode);
314 const InjectionSpecification::InjectorType injector_type,
351 const BlackoilPhases::PhaseIndex phase)
const;
363 const std::vector<double>& well_surfacerates_phase);
367 const std::vector<double>& conversion_coeffs);
369 virtual void applyVREPGroupControl(
const double target,
370 const InjectionSpecification::InjectorType injector_type,
371 const std::vector<double>& well_voidage_rates,
372 const std::vector<double>& conversion_coeffs,
373 const bool only_group);
375 virtual double getTotalVoidageRate(
const std::vector<double>& well_voidage_rates);
377 virtual void updateWellProductionTargets(
const std::vector<double>& well_rates);
379 virtual void updateWellInjectionTargets(
const std::vector<double>& well_rates);
381 virtual void setTargetUpdated(
const bool flag);
383 virtual double getProductionRate(
const std::vector<double>& well_rates,
384 const ProductionSpecification::ControlMode prod_mode)
const;
386 virtual bool canProduceMore()
const;
388 virtual bool groupProdTargetConverged(
const std::vector<double>& well_rates)
const;
391 std::vector<std::shared_ptr<WellsGroupInterface> > children_;
400 const double efficiency_factor,
406 virtual bool conditionsMet(
const std::vector<double>& well_bhp,
407 const std::vector<double>& well_reservoirrates_phase,
408 const std::vector<double>& well_surfacerates_phase,
413 void setWellsPointer(
Wells* wells,
int self_index);
420 virtual std::pair<WellNode*, double>
getWorstOffending(
const std::vector<double>& well_reservoirrates_phase,
421 const std::vector<double>& well_surfacerates_phase,
422 ProductionSpecification::ControlMode mode);
430 const InjectionSpecification::InjectorType injector_type,
467 const BlackoilPhases::PhaseIndex phase)
const;
482 const std::vector<double>& well_surfacerates_phase);
486 const std::vector<double>& conversion_coeffs);
488 virtual void applyVREPGroupControl(
const double target,
489 const InjectionSpecification::InjectorType injector_type,
490 const std::vector<double>& well_voidage_rates,
491 const std::vector<double>& conversion_coeffs,
492 const bool only_group);
494 virtual double getTotalVoidageRate(
const std::vector<double>& well_voidage_rates);
498 virtual double getProductionRate(
const std::vector<double>& well_rates,
499 const ProductionSpecification::ControlMode prod_mode)
const;
501 virtual void updateWellProductionTargets(
const std::vector<double>& well_rates);
503 virtual void updateWellInjectionTargets(
const std::vector<double>& well_rates);
513 int selfIndex()
const;
515 bool targetUpdated()
const;
517 bool isGuideRateWellPotential()
const;
519 void setIsGuideRateWellPotential(
const bool flag);
521 virtual void setTargetUpdated(
const bool flag);
523 virtual bool canProduceMore()
const;
525 virtual bool groupProdTargetConverged(
const std::vector<double>& well_rates)
const;
530 int group_control_index_;
533 bool target_updated_;
537 bool is_guiderate_wellpotential_;
544 std::shared_ptr<WellsGroupInterface> createWellWellsGroup(
const Well* well,
size_t timeStep,
551 std::shared_ptr<WellsGroupInterface> createGroupWellsGroup(
const Group& group,
size_t timeStep,
virtual void applyProdGroupControl(const ProductionSpecification::ControlMode control_mode, const double target, bool only_group)
Sets the current active control to the provided one for all producers within the group.
Definition: WellsGroup.cpp:326
bool individualControl() const
Return whether the well is running under group control target or under their own limit.
Definition: WellsGroup.cpp:240
virtual bool conditionsMet(const std::vector< double > &well_bhp, const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase, WellPhasesSummed &summed_phases)
Checks if each condition is met, applies well controls where needed (that is, it either changes the a...
Definition: WellsGroup.cpp:348
virtual double productionGuideRate(bool only_group)=0
Calculates the production guide rate for the group.
virtual int numberOfLeafNodes()=0
Calculates the number of leaf nodes in the given group.
virtual WellsGroupInterface * findGroup(const std::string &name_of_node)=0
virtual int numberOfLeafNodes()
Calculates the number of leaf nodes in the given group.
Definition: WellsGroup.cpp:457
void operator+=(const WellPhasesSummed &other)
Sums each component.
Definition: WellsGroup.cpp:50
Definition: WellsGroup.hpp:396
virtual void applyInjGroupControls()
Applies any injection group control relevant to all children nodes.
Definition: WellsGroup.cpp:1377
virtual std::pair< WellNode *, double > getWorstOffending(const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase, ProductionSpecification::ControlMode mode)
Gets the worst offending well based on the input.
Definition: WellsGroup.cpp:469
virtual double injectionGuideRate(bool only_group)
Calculates the injection guide rate for the group.
Definition: WellsGroup.cpp:1400
virtual void applyInjGroupControls()=0
Applies any injection group control relevant to all children nodes.
virtual double productionGuideRate(bool only_group)
Calculates the production guide rate for the group.
Definition: WellsGroup.cpp:561
double getTarget(ProductionSpecification::ControlMode mode) const
Gets the target rate for the given mode.
Definition: WellsGroup.cpp:189
int groupControlIndex() const
Returning the group control index.
Definition: WellsGroup.cpp:1412
virtual bool conditionsMet(const std::vector< double > &well_bhp, const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase, WellPhasesSummed &summed_phases)
Checks if each condition is met, applies well controls where needed (that is, it either changes the a...
Definition: WellsGroup.cpp:929
virtual void applyExplicitReinjectionControls(const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)
Applies explicit reinjection controls.
Definition: WellsGroup.cpp:623
Definition: ProductionSpecification.hpp:10
const std::string & name() const
The unique identifier for the well or well group.
Definition: WellsGroup.cpp:92
const PhaseUsage & phaseUsage() const
Phase usage information.
Definition: WellsGroup.cpp:97
virtual void applyProdGroupControl(const ProductionSpecification::ControlMode control_mode, const double target, const bool only_group)=0
Sets the current active control to the provided one for all producers within the group.
virtual double getTotalProductionFlow(const std::vector< double > &phase_flows, const BlackoilPhases::PhaseIndex phase) const
Gets the total production flow of the given phase.
Definition: WellsGroup.cpp:1163
virtual void applyProdGroupControl(const ProductionSpecification::ControlMode control_mode, const double target, bool only_group)
Sets the current active control to the provided one for all producers within the group.
Definition: WellsGroup.cpp:1291
Definition: AnisotropicEikonal.cpp:446
virtual bool isLeafNode() const
Definition: WellsGroup.cpp:102
Data structure aggregating static information about all wells in a scenario.
Definition: wells.h:50
Definition: WellsGroup.hpp:54
virtual void applyVREPGroupControls(const std::vector< double > &well_voidage_rates, const std::vector< double > &conversion_coeffs)
TODO: prototyping a VREP enforcement function.
Definition: WellsGroup.cpp:1201
bool isInjector() const
Returing whether the well is a injector.
Definition: WellsGroup.cpp:1425
virtual void applyInjGroupControl(const InjectionSpecification::ControlMode control_mode, const InjectionSpecification::InjectorType injector_type, const double target, const bool only_group)=0
Sets the current active control to the provided one for all injectors within the group.
virtual void applyVREPGroupControls(const std::vector< double > &well_voidage_rates, const std::vector< double > &conversion_coeffs)
TODO: prototyping a VREP enforcement function.
Definition: WellsGroup.cpp:687
virtual void applyInjGroupControl(const InjectionSpecification::ControlMode control_mode, const InjectionSpecification::InjectorType injector_type, const double target, bool only_group)
Sets the current active control to the provided one for all injectors within the group.
Definition: WellsGroup.cpp:297
const InjectionSpecification & injSpec() const
Injection specifications for the well or well group.
Definition: WellsGroup.cpp:119
Basic information needed for group control (each group should typically not exceed the sum of its lea...
Definition: WellsGroup.hpp:42
virtual void applyExplicitReinjectionControls(const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)=0
Applies explicit reinjection controls.
Definition: WellsGroup.hpp:285
virtual WellsGroupInterface * findGroup(const std::string &name_of_node)
Definition: WellsGroup.cpp:265
virtual void applyVREPGroupControls(const std::vector< double > &well_voidage_rates, const std::vector< double > &conversion_coeffs)=0
TODO: prototyping a VREP enforcement function.
virtual WellsGroupInterface * findGroup(const std::string &name_of_node)
Definition: WellsGroup.cpp:1015
virtual void applyInjGroupControl(const InjectionSpecification::ControlMode control_mode, const InjectionSpecification::InjectorType injector_type, const double target, bool only_group)
Sets the current active control to the provided one for all injectors within the group.
Definition: WellsGroup.cpp:1082
virtual double injectionGuideRate(bool only_group)=0
Calculates the injection guide rate for the group.
WellType
Well type indicates desired/expected well behaviour.
Definition: wells.h:41
const WellsGroupInterface * getParent() const
Gets the parent of the group, NULL if no parent.
Definition: WellsGroup.cpp:82
virtual double productionGuideRate(bool only_group)
Calculates the production guide rate for the group.
Definition: WellsGroup.cpp:1385
virtual void applyExplicitReinjectionControls(const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)
Applies explicit reinjection controls.
Definition: WellsGroup.cpp:1194
virtual std::pair< WellNode *, double > getWorstOffending(const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase, ProductionSpecification::ControlMode mode)
Gets the worst offending well based on the input.
Definition: WellsGroup.cpp:1070
const ProductionSpecification & prodSpec() const
Production specifications for the well or well group.
Definition: WellsGroup.cpp:112
void setParent(WellsGroupInterface *parent)
Sets the parent.
Definition: WellsGroup.cpp:107
Definition: BlackoilPhases.hpp:36
virtual void applyProdGroupControls()
Applies any production group control relevant to all children nodes.
Definition: WellsGroup.cpp:485
virtual double getTotalProductionFlow(const std::vector< double > &phase_flows, const BlackoilPhases::PhaseIndex phase) const =0
Gets the total production flow of the given phase.
virtual bool conditionsMet(const std::vector< double > &well_bhp, const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase, WellPhasesSummed &summed_phases)=0
Checks if each condition is met, applies well controls where needed (that is, it either changes the a...
Definition: InjectionSpecification.hpp:10
virtual double injectionGuideRate(bool only_group)
Calculates the injection guide rate for the group.
Definition: WellsGroup.cpp:579
virtual double getTotalProductionFlow(const std::vector< double > &phase_flows, const BlackoilPhases::PhaseIndex phase) const
Gets the total production flow of the given phase.
Definition: WellsGroup.cpp:594
virtual std::pair< WellNode *, double > getWorstOffending(const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase, ProductionSpecification::ControlMode mode)=0
Gets the worst offending well based on the input.
virtual int numberOfLeafNodes()
Calculates the number of leaf nodes in the given group.
Definition: WellsGroup.cpp:1036
virtual void applyProdGroupControls()=0
Applies any production group control relevant to all children nodes.
WellType type() const
Returns the type of the well.
Definition: WellsGroup.cpp:1181
virtual void applyInjGroupControls()
Applies any injection group control relevant to all children nodes.
Definition: WellsGroup.cpp:522
virtual void applyProdGroupControls()
Applies any production group control relevant to all children nodes.
Definition: WellsGroup.cpp:1372
bool isProducer() const
Returing whether the well is a producer.
Definition: WellsGroup.cpp:1419
void setIndividualControl(const bool)
Update the status for individual contrl.
Definition: WellsGroup.cpp:245
virtual bool isLeafNode() const
Definition: WellsGroup.cpp:1025
double getAccumulativeEfficiencyFactor() const
the efficiency factor for groups are muliplitive, this function return the resulted final efficiency ...
Definition: WellsGroup.cpp:1624
double rateByMode(const double *res_rates, const double *surf_rates, const ProductionSpecification::ControlMode mode)
Calculates the correct rate for the given ProductionSpecification::ControlMode.
Definition: WellsGroup.cpp:139