mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4834 from steink/assure_non_negative_oil_fraction
Prevent negative oil fractions in well segments
This commit is contained in:
commit
27466bae66
@ -499,6 +499,12 @@ volumeFraction(const int seg,
|
|||||||
/* if (has_solvent) {
|
/* if (has_solvent) {
|
||||||
oil_fraction -= evaluation_[seg][SFrac];
|
oil_fraction -= evaluation_[seg][SFrac];
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
// oil_fraction may turn out negative due to round-off, in that case
|
||||||
|
// set to zero (but keep derivatives)
|
||||||
|
if (oil_fraction.value() < 0.0) {
|
||||||
|
oil_fraction.setValue(0.0);
|
||||||
|
}
|
||||||
return oil_fraction;
|
return oil_fraction;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user