Merge pull request #3648 from totto82/fix_waghystr

avoid negative C factor
This commit is contained in:
Tor Harald Sandve
2023-09-01 15:03:02 +02:00
committed by GitHub

View File

@@ -558,7 +558,9 @@ public:
if (swatImbStartNxt_ < 0.0) { // Initial check ...
swatImbStartNxt_ = std::max(Swco_, Swco_ + krnSw - krwSw);
if (swatImbStartNxt_ > Swco_ + tolWAG_) {
// check if we are in threephase state sw > swco + tolWag and so > tolWag
// (sw = swco + krnSw - krwSw and so = krwSw for oil/gas params)
if ( (swatImbStartNxt_ > Swco_ + tolWAG_) && krwSw > tolWAG_) {
swatImbStart_ = swatImbStartNxt_;
krnSwWAG_ = krnSw;
krnSwDrainStartNxt_ = krnSwWAG_;
@@ -675,7 +677,7 @@ private:
}
}
if (isDrain_ && krnSwDrainRevert_ > SncrtWAG_) { //Reversal from drain to imb
if (isDrain_ && (1.0-krnSwDrainRevert_) > SncrtWAG_) { //Reversal from drain to imb
cTransf_ = 1.0/(SncrtWAG_-Sncrd_ + 1.0e-12) - 1.0/(1.0-krnSwDrainRevert_-Sncrd_);
}