Merge pull request #4701 from atgeirr/threshold-pressure-zero

Do not set pressure diff to zero when not necessary.
This commit is contained in:
Bård Skaflestad 2023-06-11 14:45:05 +02:00 committed by GitHub
commit 6afda71480
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -389,14 +389,16 @@ public:
// of threshold pressure is a quite big hack that only makes sense for ECL // of threshold pressure is a quite big hack that only makes sense for ECL
// datasets. (and even there, its physical justification is quite // datasets. (and even there, its physical justification is quite
// questionable IMO.) // questionable IMO.)
if (std::abs(Toolbox::value(pressureDifference)) > thpres) { if (thpres > 0.0) {
if (pressureDifference < 0.0) if (std::abs(Toolbox::value(pressureDifference)) > thpres) {
pressureDifference += thpres; if (pressureDifference < 0.0)
else pressureDifference += thpres;
pressureDifference -= thpres; else
} pressureDifference -= thpres;
else { }
pressureDifference = 0.0; else {
pressureDifference = 0.0;
}
} }
} }