disable drift compensation for cases without source terms

This commit is contained in:
Tor Harald Sandve committed 2022-08-17 10:21:25 +02:00
1 parent b3f62589f2
commit ceac9e5ad8
1 file changed
+7 -1
+7 -1
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();