From 013c907e66d484002c64763719a62feb6fce77ec Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Tue, 18 Oct 2016 14:26:06 +0200 Subject: [PATCH] adding efficiency factor to the WellsGroupInterface. The one for the WellNode should be specified with WEFAC, which we are not handling for the moment, so we just set it to be 1.0 for the moment. --- opm/core/wells/WellsGroup.cpp | 35 ++++++++++++++++++++++++++++------- opm/core/wells/WellsGroup.hpp | 9 +++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/opm/core/wells/WellsGroup.cpp b/opm/core/wells/WellsGroup.cpp index 583c519c..6770b5a1 100644 --- a/opm/core/wells/WellsGroup.cpp +++ b/opm/core/wells/WellsGroup.cpp @@ -61,12 +61,14 @@ namespace Opm WellsGroupInterface::WellsGroupInterface(const std::string& myname, + const double efficicency_factor, const ProductionSpecification& prod_spec, const InjectionSpecification& inje_spec, const PhaseUsage& phase_usage) : parent_(NULL), should_update_well_targets_(false), individual_control_(true), // always begin with individual control + efficicency_factor_(efficicency_factor), name_(myname), production_specification_(prod_spec), injection_specification_(inje_spec), @@ -237,23 +239,38 @@ namespace Opm } - bool WellsGroupInterface::shouldUpdateWellTargets() const { + bool WellsGroupInterface::shouldUpdateWellTargets() const + { return should_update_well_targets_; } - void WellsGroupInterface::setShouldUpdateWellTargets(const bool should_update_well_targets) { + void WellsGroupInterface::setShouldUpdateWellTargets(const bool should_update_well_targets) + { should_update_well_targets_ = should_update_well_targets; } - bool WellsGroupInterface::individualControl() const { + bool WellsGroupInterface::individualControl() const + { return individual_control_; } - void WellsGroupInterface::setIndividualControl(const bool individual_control) { + void WellsGroupInterface::setIndividualControl(const bool individual_control) + { individual_control_ = individual_control; } + double WellsGroupInterface::efficicencyFactor() const + { + return efficicency_factor_; + } + + void WellsGroupInterface::setEfficiencyFactor(const double efficicency_factor) + { + efficicency_factor_=efficicency_factor; + } + + // ============== WellsGroup members ============= @@ -277,10 +294,11 @@ namespace Opm WellsGroup::WellsGroup(const std::string& myname, + const double efficiency_factor, const ProductionSpecification& prod_spec, const InjectionSpecification& inj_spec, const PhaseUsage& phase_usage) - : WellsGroupInterface(myname, prod_spec, inj_spec, phase_usage) + : WellsGroupInterface(myname, efficiency_factor, prod_spec, inj_spec, phase_usage) { } @@ -760,10 +778,11 @@ namespace Opm WellNode::WellNode(const std::string& myname, + const double efficiency_factor, const ProductionSpecification& prod_spec, const InjectionSpecification& inj_spec, const PhaseUsage& phase_usage) - : WellsGroupInterface(myname, prod_spec, inj_spec, phase_usage), + : WellsGroupInterface(myname, efficiency_factor, prod_spec, inj_spec, phase_usage), wells_(0), self_index_(-1), group_control_index_(-1), @@ -1315,7 +1334,9 @@ namespace Opm production_specification.control_mode_ = toProductionControlMode(WellProducer::ControlMode2String(properties.controlMode)); } } - std::shared_ptr wells_group(new WellNode(well->name(), production_specification, injection_specification, phase_usage)); + // TODO: should be specified with WEFAC, while we do not have this keyword support yet. + const double efficiency_factor = 1.0; + std::shared_ptr wells_group(new WellNode(well->name(), efficiency_factor, production_specification, injection_specification, phase_usage)); return wells_group; } } diff --git a/opm/core/wells/WellsGroup.hpp b/opm/core/wells/WellsGroup.hpp index c456db95..4a7d50ca 100644 --- a/opm/core/wells/WellsGroup.hpp +++ b/opm/core/wells/WellsGroup.hpp @@ -55,6 +55,7 @@ namespace Opm { public: WellsGroupInterface(const std::string& name, + const double efficicency_factor, const ProductionSpecification& prod_spec, const InjectionSpecification& inj_spec, const PhaseUsage& phase_usage); @@ -244,6 +245,9 @@ namespace Opm const double* surf_rates, const InjectionSpecification::ControlMode mode); + double efficicencyFactor() const; + void setEfficiencyFactor(const double efficicency_factor); + WellsGroupInterface* parent_; // when some well (mabye group also later), change status from group control @@ -254,6 +258,9 @@ namespace Opm // So not putting it in the WellsGroupInterface yet. bool individual_control_; + // Efficiency factor + double efficicency_factor_; + private: std::string name_; ProductionSpecification production_specification_; @@ -267,6 +274,7 @@ namespace Opm { public: WellsGroup(const std::string& name, + const double efficicency_factor, const ProductionSpecification& prod_spec, const InjectionSpecification& inj_spec, const PhaseUsage& phase_usage); @@ -366,6 +374,7 @@ namespace Opm { public: WellNode(const std::string& name, + const double efficicency_factor, const ProductionSpecification& prod_spec, const InjectionSpecification& inj_spec, const PhaseUsage& phase_usage);