disable drift compensation for cases without source terms

This commit is contained in:
Tor Harald Sandve 2022-08-12 09:48:40 +02:00
parent b3f62589f2
commit ceac9e5ad8

View File

@ -1840,7 +1840,13 @@ public:
// if requested, compensate systematic mass loss for cells which were "well
// behaved" in the last time step
if (enableDriftCompensation_) {
// Note that we don't allow for drift compensation if there is
// no source terms i.e. no wells and no aquifers.
const auto& schedule = this->simulator().vanguard().schedule();
int episodeIdx = this->simulator().episodeIndex();
const auto& aquifer = this->simulator().vanguard().eclState().aquifer();
bool compensateDrift = schedule.numWells(episodeIdx) > 0 && aquifer.active();
if (enableDriftCompensation_ && compensateDrift) {
const auto& simulator = this->simulator();
const auto& model = this->model();