Set correct episode before initial call to invalidateAndUpdateIntensiveQuantities

This commit is contained in:
Vegard Kippe 2024-08-27 15:51:56 +02:00
parent 8f45cbe4c4
commit 0485bfb47f
2 changed files with 8 additions and 7 deletions

View File

@ -601,9 +601,7 @@ public:
// update maximum water saturation and minimum pressure
// used when ROCKCOMP is activated
// Do not update max RS first step after a restart
asImp_().updateExplicitQuantities_(episodeIdx, timeStepSize, first_step_ && (episodeIdx > 0));
first_step_ = false;
asImp_().updateExplicitQuantities_(episodeIdx, timeStepSize);
if (nonTrivialBoundaryConditions()) {
this->model().linearizer().updateBoundaryConditionData();
@ -1873,7 +1871,7 @@ private:
Implementation& asImp_()
{ return *static_cast<Implementation *>(this); }
protected:
void updateExplicitQuantities_(int episodeIdx, int timeStepSize, const bool first_step_after_restart = false)
void updateExplicitQuantities_(int episodeIdx, int timeStepSize)
{
OPM_TIMEBLOCK(updateExplicitQuantities);
const bool invalidateFromMaxWaterSat = updateMaxWaterSaturation_();
@ -1884,8 +1882,8 @@ protected:
const bool invalidateFromMaxOilSat = updateMaxOilSaturation_();
// deal with DRSDT and DRVDT (do not update first step after a restart)
const bool invalidateDRDT = !first_step_after_restart && this->asImp_().updateCompositionChangeLimits_();
// deal with DRSDT and DRVDT
const bool invalidateDRDT = this->asImp_().updateCompositionChangeLimits_();
// the derivatives may have change
bool invalidateIntensiveQuantities
@ -2890,9 +2888,10 @@ private:
BCData<int> bcindex_;
bool nonTrivialBoundaryConditions_ = false;
bool explicitRockCompaction_ = false;
bool first_step_ = true;
ModuleParams moduleParams_;
};
} // namespace Opm

View File

@ -195,6 +195,8 @@ public:
{
init(timer);
// Make cache up to date. No need for updating it in elementCtx.
// NB! Need to be at the correct step in case of restart
simulator_.setEpisodeIndex(timer.currentStepNum());
simulator_.model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0);
// Main simulation loop.
while (!timer.done()) {