Merge pull request #5407 from totto82/fix_drsdt

avoid mass creation with drsdt
This commit is contained in:
Tor Harald Sandve 2024-06-20 12:14:22 +02:00 committed by GitHub
commit a419390854
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -677,9 +677,6 @@ public:
// Compute flux for output
this->model().linearizer().updateFlowsInfo();
// deal with DRSDT and DRVDT
this->asImp_().updateCompositionChangeLimits_();
if (this->enableDriftCompensation_) {
OPM_TIMEBLOCK(driftCompansation);
@ -1395,8 +1392,6 @@ public:
// the initial solution.
thresholdPressures_.finishInit();
updateCompositionChangeLimits_();
aquiferModel_.initialSolutionApplied();
if (this->simulator().episodeIndex() == 0) {
@ -1879,9 +1874,13 @@ protected:
const bool invalidateFromHyst = updateHysteresis_();
const bool invalidateFromMaxOilSat = updateMaxOilSaturation_();
// deal with DRSDT and DRVDT
const bool invalidateDRDT = this->asImp_().updateCompositionChangeLimits_();
// the derivatives may have change
bool invalidateIntensiveQuantities
= invalidateFromMaxWaterSat || invalidateFromMinPressure || invalidateFromHyst || invalidateFromMaxOilSat;
= invalidateFromMaxWaterSat || invalidateFromMinPressure || invalidateFromHyst || invalidateFromMaxOilSat || invalidateDRDT;
if (invalidateIntensiveQuantities) {
OPM_TIMEBLOCK(beginTimeStepInvalidateIntensiveQuantities);
this->model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0);
@ -1914,7 +1913,7 @@ protected:
}
// update the parameters needed for DRSDT and DRVDT
void updateCompositionChangeLimits_()
bool updateCompositionChangeLimits_()
{
OPM_TIMEBLOCK(updateCompositionChangeLimits);
// update the "last Rs" values for all elements, including the ones in the ghost
@ -1924,7 +1923,7 @@ protected:
this->mixControls_.drsdtActive(episodeIdx),
this->mixControls_.drvdtActive(episodeIdx)};
if (!active[0] && !active[1] && !active[2]) {
return;
return false;
}
this->updateProperty_("FlowProblem::updateCompositionChangeLimits_()) failed:",
@ -1944,6 +1943,8 @@ protected:
active);
}
);
return true;
}
bool updateMaxOilSaturation_()