Merge pull request #1668 from totto82/remove_logging

Remove repetitive logging info
This commit is contained in:
Atgeirr Flø Rasmussen 2018-12-07 10:53:31 +01:00 committed by GitHub
commit 69cd2f9b84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 5 deletions

View File

@ -29,6 +29,8 @@
#include <opm/parser/eclipse/EclipseState/Schedule/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellTestState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/core/wells.h>
#include <opm/core/well_controls.h>
@ -391,7 +393,11 @@ namespace Opm
WellState& well_state,
wellhelpers::WellSwitchingLogger& logger);
void scaleProductivityIndex(const int perfIdx, double& productivity_index) const;
void scaleProductivityIndex(const int perfIdx, double& productivity_index);
// count the number of times an output log message is created in the productivity
// index calculations
int well_productivity_index_logger_counter_;
};
@ -438,6 +444,7 @@ namespace Opm
bool can_obtain_bhp_with_thp_limit = true;
// whether the well obey bhp limit when operated under thp limit
bool obey_bhp_limit_with_thp_limit = true;
};
}

View File

@ -107,6 +107,8 @@ namespace Opm
connectionRates_.resize(number_of_perforations_);
well_productivity_index_logger_counter_ = 0;
}
template<typename TypeTag>
@ -1245,20 +1247,27 @@ namespace Opm
template<typename TypeTag>
void
WellInterface<TypeTag>::scaleProductivityIndex(const int perfIdx, double& productivity_index) const
WellInterface<TypeTag>::scaleProductivityIndex(const int perfIdx, double& productivity_index)
{
const auto& connection = well_ecl_->getConnections(current_step_)[perfIdx];
const bool new_well = well_ecl_->hasEvent(ScheduleEvents::NEW_WELL , current_step_);
if (well_ecl_->getDrainageRadius(current_step_) < 0) {
OpmLog::warning("PRODUCTIVITY_INDEX_WARNING", "Negative drainage radius not supported. The productivity index is set to zero");
if (new_well && perfIdx == 0) {
OpmLog::warning("PRODUCTIVITY_INDEX_WARNING", "Negative drainage radius not supported. The productivity index is set to zero");
}
productivity_index = 0.0;
return;
}
if (connection.r0() > well_ecl_->getDrainageRadius(current_step_)) {
OpmLog::info("PRODUCTIVITY_INDEX_INFO", "The effective radius is larger then the well drainage radius for well " + name() +
" They are set to equal in the well productivity index calculations");
if (new_well && well_productivity_index_logger_counter_ < 1) {
OpmLog::info("PRODUCTIVITY_INDEX_INFO", "The effective radius is larger than the well drainage radius for well " + name() +
" They are set to equal in the well productivity index calculations");
well_productivity_index_logger_counter_++;
}
return;
}