Use ScheduleState to handle VFP propertes + simplifications

This commit is contained in:
Joakim Hove
2021-01-14 19:22:34 +01:00
parent 8607539c2a
commit 17fcdfc87a
11 changed files with 53 additions and 109 deletions

View File

@@ -302,14 +302,14 @@ namespace Opm {
std::vector<int>(local_num_cells_, 0)));
rateConverter_->template defineState<ElementContext>(ebosSimulator_);
// update VFP properties
vfp_properties_.reset (new VFPProperties<VFPInjProperties,VFPProdProperties> (
schedule().getVFPInjTables(timeStepIdx),
schedule().getVFPProdTables(timeStepIdx)) );
this->initializeWellProdIndCalculators();
if (this->schedule()[timeStepIdx].events().hasEvent(ScheduleEvents::Events::WELL_PRODUCTIVITY_INDEX)) {
this->runWellPIScaling(timeStepIdx, local_deferredLogger);
{
const auto& sched_state = this->schedule()[timeStepIdx];
// update VFP properties
vfp_properties_.reset(new VFPProperties( sched_state.vfpinj(), sched_state.vfpprod()) );
this->initializeWellProdIndCalculators();
if (sched_state.events().hasEvent(ScheduleEvents::Events::WELL_PRODUCTIVITY_INDEX)) {
this->runWellPIScaling(timeStepIdx, local_deferredLogger);
}
}
// update the previous well state. This is used to restart failed steps.