avoid negative rs/rv max

This commit is contained in:
Tor Harald Sandve 2024-12-09 13:21:01 +01:00
parent 96da980897
commit b9b0257e8a

View File

@ -289,11 +289,11 @@ copyToWellState(const MultisegmentWellGeneric<Scalar>& mswell,
Scalar rvMax = 0.0;
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
// Both oil and gas active.
rsMax = FluidSystem::oilPvt()
.saturatedGasDissolutionFactor(pvtReg, temperature, segment_pressure[seg]);
rsMax = std::max(Scalar{0.0}, FluidSystem::oilPvt()
.saturatedGasDissolutionFactor(pvtReg, temperature, segment_pressure[seg]));
rvMax = FluidSystem::gasPvt()
.saturatedOilVaporizationFactor(pvtReg, temperature, segment_pressure[seg]);
rvMax = std::max(Scalar{0.0}, FluidSystem::gasPvt()
.saturatedOilVaporizationFactor(pvtReg, temperature, segment_pressure[seg]));
}
// 1) Infer phase splitting for oil/gas.