From 65d61d1c4f224f8340efe1f85c9533c21fb7d9a7 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Mon, 10 Oct 2016 17:09:02 +0200 Subject: [PATCH] output cleanining up --- opm/core/wells/WellsGroup.cpp | 45 +++++++++++++++-------------------- opm/core/wells/WellsGroup.hpp | 2 +- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/opm/core/wells/WellsGroup.cpp b/opm/core/wells/WellsGroup.cpp index 1e54e71f..16359f1e 100644 --- a/opm/core/wells/WellsGroup.cpp +++ b/opm/core/wells/WellsGroup.cpp @@ -242,7 +242,7 @@ namespace Opm } - bool 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; } @@ -323,12 +323,8 @@ namespace Opm if (!only_group || (prodSpec().control_mode_ == ProductionSpecification::FLD || prodSpec().control_mode_ == ProductionSpecification::NONE)) { const double my_guide_rate = productionGuideRate(false); - std::cout << " only_group " << only_group << std::endl; - std::cout << " name " << name () << std::endl; - std::cout << " my_guide_rate is " << my_guide_rate << std::endl; if (my_guide_rate == 0.0) { // Nothing to do here - std::cout << "returning" << std::endl; return; } for (size_t i = 0; i < children_.size(); ++i) { @@ -427,7 +423,6 @@ namespace Opm production_mode_violated).first->shutWell(); return false; case ProductionSpecification::RATE: - std::cout << "Applying group control" << std::endl; applyProdGroupControl(production_mode_violated, getTarget(production_mode_violated), false); @@ -487,7 +482,6 @@ namespace Opm { // const double my_guide_rate = productionGuideRate(true); const double my_guide_rate = productionGuideRate(false); - std::cout << "my_guide_rate of group " << name() << " is " << my_guide_rate << std::endl; if (my_guide_rate == 0) { OPM_THROW(std::runtime_error, "Can't apply group control for group " << name() << " as the sum of guide rates for all group controlled wells is zero."); } @@ -714,7 +708,7 @@ namespace Opm } } - void WellsGroup::updateWellInjectionTargets(const std::vector& well_rates) + void WellsGroup::updateWellInjectionTargets(const std::vector& /*well_rates*/) { // NOT doing anything yet. // Will finish it when having an examples with more than one injection wells within same injection group. @@ -728,22 +722,30 @@ namespace Opm bool WellsGroup::isProducer() const { + return false; } bool WellsGroup::isInjector() const { + return false; } double WellsGroup::getLiquidProductionRate(const std::vector& /*well_rates*/) const { + // TODO: to be implemented + return -1.e98; } double WellsGroup::getOilProductionRate(const std::vector& /*well_rates*/) const { + // TODO: to be implemented + return -1.e98; } double WellsGroup::getWaterProductionRate(const std::vector& /*well_rates*/) const { + // TODO: to be implemented + return -1.e98; } @@ -920,19 +922,15 @@ namespace Opm const double target, const bool only_group) { - // Not changing if we're not forced to change - // It should be the well will under group control, if we prevent the well from group control - // with keyword WGRUPCON. - // It is just current undertstanding, while further change in the understanding will be possible. - // if (only_group - // && (injSpec().control_mode_ != InjectionSpecification::GRUP && injSpec().control_mode_ != InjectionSpecification::NONE)) { - // return; - // } if ( !isInjector() ) { assert(target == 0.0); return; } + if (only_group && individualControl()) { + return; + } + const double distr[3] = { 1.0, 1.0, 1.0 }; WellControlType wct; switch (control_mode) { @@ -1001,13 +999,12 @@ namespace Opm const double target, const bool only_group) { - /* if (only_group && (prodSpec().control_mode_ != ProductionSpecification::GRUP - && prodSpec().control_mode_ != ProductionSpecification::NONE)) { - std::cout << "Returning" << std::endl; - return; - } */ if ( !isProducer() ) { - // assert(target == 0.0); + assert(target == 0.0); + return; + } + + if (only_group && individualControl()) { return; } // We're a producer, so we need to negate the input @@ -1040,7 +1037,6 @@ namespace Opm distr[phase_pos[BlackoilPhases::Vapour]] = 1.0; break; case ProductionSpecification::LRAT: - std::cout << "applying rate" << std::endl; wct = SURFACE_RATE; if (!phase_used[BlackoilPhases::Liquid]) { OPM_THROW(std::runtime_error, "Oil phase not active and LRAT control specified."); @@ -1059,9 +1055,6 @@ namespace Opm OPM_THROW(std::runtime_error, "Group production control mode not handled: " << control_mode); } - std::cout << " well name " << name() << " group_control_index_ " << group_control_index_ << " ntarget " << ntarget - << std::endl; - if (group_control_index_ < 0) { // The well only had its own controls, no group controls. append_well_controls(wct, ntarget, invalid_alq, invalid_vfp, distr, self_index_, wells_); diff --git a/opm/core/wells/WellsGroup.hpp b/opm/core/wells/WellsGroup.hpp index a552f2d8..12159217 100644 --- a/opm/core/wells/WellsGroup.hpp +++ b/opm/core/wells/WellsGroup.hpp @@ -215,7 +215,7 @@ namespace Opm virtual bool shouldUpdateWellTargets() const; - virtual bool setShouldUpdateWellTargets(const bool); + virtual void setShouldUpdateWellTargets(const bool); /// Whether it is a production well /// Should only appy for WellNode