Skip to content

Commit 970ba91

Browse files
author
Tor Harald Sandve
committed
avoid negative rs/rv max
1 parent 96da980 commit 970ba91

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

opm/simulators/wells/MultisegmentWellPrimaryVariables.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ copyToWellState(const MultisegmentWellGeneric<Scalar>& mswell,
289289
Scalar rvMax = 0.0;
290290
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
291291
// Both oil and gas active.
292-
rsMax = FluidSystem::oilPvt()
293-
.saturatedGasDissolutionFactor(pvtReg, temperature, segment_pressure[seg]);
292+
rsMax = std::max(0.0, FluidSystem::oilPvt()
293+
.saturatedGasDissolutionFactor(pvtReg, temperature, segment_pressure[seg]));
294294

295-
rvMax = FluidSystem::gasPvt()
296-
.saturatedOilVaporizationFactor(pvtReg, temperature, segment_pressure[seg]);
295+
rvMax = std::max(0.0, FluidSystem::gasPvt()
296+
.saturatedOilVaporizationFactor(pvtReg, temperature, segment_pressure[seg]));
297297
}
298298

299299
// 1) Infer phase splitting for oil/gas.

0 commit comments

Comments
 (0)