mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
commit
e16b19adc7
@ -256,7 +256,7 @@ namespace Opm {
|
||||
const double p = fs.pressure(FluidSystem::oilPhaseIdx).value();
|
||||
cellPressures[cellIdx] = p;
|
||||
}
|
||||
well_state_.init(wells(), cellPressures, wells_ecl_, timeStepIdx, &previous_well_state_, phase_usage_);
|
||||
well_state_.init(wells(), cellPressures, schedule(), wells_ecl_, timeStepIdx, &previous_well_state_, phase_usage_);
|
||||
|
||||
// handling MS well related
|
||||
if (param_.use_multisegment_well_) { // if we use MultisegmentWell model
|
||||
@ -502,7 +502,7 @@ namespace Opm {
|
||||
if (nw > 0) {
|
||||
const auto phaseUsage = phaseUsageFromDeck(eclState());
|
||||
const size_t numCells = Opm::UgGridHelpers::numCells(grid());
|
||||
well_state_.resize(wells, numCells, phaseUsage); // Resize for restart step
|
||||
well_state_.resize(wells, schedule(), numCells, phaseUsage); // Resize for restart step
|
||||
wellsToState(restartValues.wells, phaseUsage, well_state_);
|
||||
previous_well_state_ = well_state_;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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");
|
||||
|
@ -63,6 +63,7 @@ namespace Opm
|
||||
/// to give useful initial values to the bhp(), wellRates()
|
||||
/// and perfPhaseRates() fields, depending on controls
|
||||
void init(const Wells* wells, const std::vector<double>& cellPressures,
|
||||
const Schedule& schedule,
|
||||
const std::vector<const Well*>& wells_ecl, const int report_step,
|
||||
const WellStateFullyImplicitBlackoil* prevState, const PhaseUsage& pu)
|
||||
{
|
||||
@ -114,8 +115,7 @@ namespace Opm
|
||||
OPM_THROW(std::logic_error, "Could not find well " << well_name << " in wells_ecl ");
|
||||
}
|
||||
|
||||
const Well* well_ecl = wells_ecl[index_well_ecl];
|
||||
effective_events_occurred_[w] = (well_ecl->hasEvent(effective_events_mask, report_step) );
|
||||
effective_events_occurred_[w] = (schedule.hasWellEvent(well_name, effective_events_mask, report_step) );
|
||||
}
|
||||
} // end of if (!well_ecl.empty() )
|
||||
|
||||
@ -285,11 +285,11 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
void resize(const Wells* wells, size_t numCells, const PhaseUsage& pu)
|
||||
void resize(const Wells* wells, const Schedule& schedule, std::size_t numCells, const PhaseUsage& pu)
|
||||
{
|
||||
const std::vector<double> tmp(numCells, 0.0); // <- UGLY HACK to pass the size
|
||||
const std::vector<const Well*> wells_ecl;
|
||||
init(wells, tmp, wells_ecl, 0, nullptr, pu);
|
||||
init(wells, tmp, schedule, wells_ecl, 0, nullptr, pu);
|
||||
}
|
||||
|
||||
/// Allocate and initialize if wells is non-null. Also tries
|
||||
|
Loading…
Reference in New Issue
Block a user