Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions opm/simulators/flow/FlowProblem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,9 +661,6 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
// Compute flux for output
this->model().linearizer().updateFlowsInfo();

// deal with DRSDT and DRVDT
this->asImp_().updateCompositionChangeLimits_();

if (this->enableDriftCompensation_) {
OPM_TIMEBLOCK(driftCompansation);

Expand Down Expand Up @@ -1380,8 +1377,6 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
// the initial solution.
thresholdPressures_.finishInit();

updateCompositionChangeLimits_();
Comment thread
atgeirr marked this conversation as resolved.

aquiferModel_.initialSolutionApplied();

if (this->simulator().episodeIndex() == 0) {
Expand Down Expand Up @@ -1864,9 +1859,13 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
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);
Expand Down Expand Up @@ -1899,7 +1898,7 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
}

// 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
Expand All @@ -1909,7 +1908,7 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
this->mixControls_.drsdtActive(episodeIdx),
this->mixControls_.drvdtActive(episodeIdx)};
if (!active[0] && !active[1] && !active[2]) {
return;
return false;
}

this->updateProperty_("FlowProblem::updateCompositionChangeLimits_()) failed:",
Expand All @@ -1929,6 +1928,8 @@ class FlowProblem : public GetPropType<TypeTag, Properties::BaseProblem>
active);
}
);

return true;
}

bool updateMaxOilSaturation_()
Expand Down