Properly initialize mixing controls after restart.

This commit is contained in:
Vegard Kippe 2024-08-26 18:01:01 +02:00
parent cc08df226e
commit 8f45cbe4c4

View File

@ -2211,9 +2211,8 @@ protected:
const auto& schedule = simulator.vanguard().schedule();
const auto& eclState = simulator.vanguard().eclState();
const auto& initconfig = eclState.getInitConfig();
const int restart_step = initconfig.getRestartStep();
{
int restart_step = initconfig.getRestartStep();
simulator.setTime(schedule.seconds(restart_step));
simulator.startNextEpisode(simulator.startTime() + simulator.time(),
@ -2247,6 +2246,9 @@ protected:
this->micp_.resize(numElems);
}
// Initialize mixing controls before trying to set any lastRx valuesx
this->mixControls_.init(numElems, restart_step, eclState.runspec().tabdims().getNumPVTTables());
for (std::size_t elemIdx = 0; elemIdx < numElems; ++elemIdx) {
auto& elemFluidState = initialFluidStates_[elemIdx];
elemFluidState.setPvtRegionIndex(pvtRegionIndex(elemIdx));