From d640a16e5af48e42c7df097f7a53878e2b109e6f Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Thu, 16 Feb 2017 09:46:25 +0100 Subject: [PATCH] Update rs and rv value for free oil and gas case The rs and rv values are not used by the simulator for the case with free oil and gas (or water only case), but they must be updated for output. --- opm/autodiff/BlackoilModelEbos.hpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/opm/autodiff/BlackoilModelEbos.hpp b/opm/autodiff/BlackoilModelEbos.hpp index d384fe2d7..6912097e8 100644 --- a/opm/autodiff/BlackoilModelEbos.hpp +++ b/opm/autodiff/BlackoilModelEbos.hpp @@ -677,6 +677,11 @@ namespace Opm { switch (hydroCarbonState) { case HydroCarbonState::GasAndOil: { + // for the Gas and Oil case rs=rsSat and rv=rvSat + rs = FluidSystem::oilPvt().saturatedGasDissolutionFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]); + // use gas pressure? + rv = FluidSystem::gasPvt().saturatedOilVaporizationFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]); + if (sw > (1.0 - epsilon)) // water only i.e. do nothing break; @@ -684,15 +689,12 @@ namespace Opm { reservoir_state.hydroCarbonState()[cell_idx] = HydroCarbonState::OilOnly; // sg --> rs sg = 0; so = 1.0 - sw - sg; - const double& rsSat = FluidSystem::oilPvt().saturatedGasDissolutionFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]); - rs = rsSat*(1-epsilon); + rs *= (1-epsilon); } else if (so <= 0.0 && has_vapoil_) { reservoir_state.hydroCarbonState()[cell_idx] = HydroCarbonState::GasOnly; // sg --> rv so = 0; sg = 1.0 - sw - so; - // use gas pressure? - const double& rvSat = FluidSystem::gasPvt().saturatedOilVaporizationFactor(fs.pvtRegionIndex(), reservoir_state.temperature()[cell_idx], reservoir_state.pressure()[cell_idx]); - rv = rvSat*(1-epsilon); + rv *= (1-epsilon); } break; }