mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Extract production update events from Schedule
This commit is contained in:
parent
a7362abb04
commit
222241b3b3
@ -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_;
|
||||
}
|
||||
|
@ -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