Avoid time step dependent jump in RS after restart

This commit is contained in:
Vegard Kippe 2024-08-28 16:28:51 +02:00
parent 0b6dd93903
commit eb869f211f

View File

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