Extract NEW_WELL event from Schedule

This commit is contained in:
Joakim Hove 2019-03-21 11:45:50 +01:00
parent 222241b3b3
commit 27c78eb3dc
4 changed files with 8 additions and 8 deletions

View File

@ -671,6 +671,7 @@ namespace Opm
// Compute Productivity index if asked for
const auto& pu = phaseUsage();
const Opm::SummaryConfig& summaryConfig = ebosSimulator.vanguard().summaryConfig();
const Opm::Schedule& schedule = ebosSimulator.vanguard().schedule();
for (int p = 0; p < np; ++p) {
if ( (pu.phase_pos[Water] == p && (summaryConfig.hasSummaryKey("WPIW:" + name()) || summaryConfig.hasSummaryKey("WPIL:" + name())))
|| (pu.phase_pos[Oil] == p && (summaryConfig.hasSummaryKey("WPIO:" + name()) || summaryConfig.hasSummaryKey("WPIL:" + name())))
@ -678,8 +679,9 @@ namespace Opm
const unsigned int compIdx = flowPhaseToEbosCompIdx(p);
const double drawdown = well_state.perfPress()[first_perf_ + perf] - intQuants.fluidState().pressure(FluidSystem::oilPhaseIdx).value();
const bool new_well = schedule.hasWellEvent(name(), ScheduleEvents::NEW_WELL, current_step_);
double productivity_index = cq_s[compIdx].value() / drawdown;
scaleProductivityIndex(perf, productivity_index, deferred_logger);
scaleProductivityIndex(perf, productivity_index, new_well, deferred_logger);
well_state.productivityIndex()[np*index_of_well_ + p] += productivity_index;
}
}

View File

@ -616,6 +616,7 @@ namespace Opm
// Compute Productivity index if asked for
const auto& pu = phaseUsage();
const Opm::SummaryConfig& summaryConfig = ebosSimulator.vanguard().summaryConfig();
const Opm::Schedule& schedule = ebosSimulator.vanguard().schedule();
for (int p = 0; p < np; ++p) {
if ( (pu.phase_pos[Water] == p && (summaryConfig.hasSummaryKey("WPIW:" + name()) || summaryConfig.hasSummaryKey("WPIL:" + name())))
|| (pu.phase_pos[Oil] == p && (summaryConfig.hasSummaryKey("WPIO:" + name()) || summaryConfig.hasSummaryKey("WPIL:" + name())))
@ -623,8 +624,9 @@ namespace Opm
const unsigned int compIdx = flowPhaseToEbosCompIdx(p);
const double drawdown = well_state.perfPress()[first_perf_ + perf] - intQuants.fluidState().pressure(FluidSystem::oilPhaseIdx).value();
const bool new_well = schedule.hasWellEvent(name(), ScheduleEvents::NEW_WELL, current_step_);
double productivity_index = cq_s[compIdx].value() / drawdown;
scaleProductivityIndex(perf, productivity_index, deferred_logger);
scaleProductivityIndex(perf, productivity_index, new_well, deferred_logger);
well_state.productivityIndex()[np*index_of_well_ + p] += productivity_index;
}
}

View File

@ -413,7 +413,7 @@ namespace Opm
WellState& well_state,
Opm::DeferredLogger& deferred_logger);
void scaleProductivityIndex(const int perfIdx, double& productivity_index, Opm::DeferredLogger& deferred_logger);
void scaleProductivityIndex(const int perfIdx, double& productivity_index, const bool new_well, Opm::DeferredLogger& deferred_logger);
// count the number of times an output log message is created in the productivity
// index calculations

View File

@ -1262,13 +1262,9 @@ namespace Opm
template<typename TypeTag>
void
WellInterface<TypeTag>::scaleProductivityIndex(const int perfIdx, double& productivity_index, Opm::DeferredLogger& deferred_logger)
WellInterface<TypeTag>::scaleProductivityIndex(const int perfIdx, double& productivity_index, const bool new_well, Opm::DeferredLogger& deferred_logger)
{
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) {
if (new_well && perfIdx == 0) {
deferred_logger.warning("PRODUCTIVITY_INDEX_WARNING", "Negative drainage radius not supported. The productivity index is set to zero");