From 9454ba1fe58c70f425c7be38536cf0511f5781ce Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Mon, 19 Dec 2022 12:36:16 +0100 Subject: [PATCH] Fix Todd-Longstaff model. Only modify density (i.e) the effective gravity contribution and not the volumes itself --- opm/models/blackoil/blackoilsolventmodules.hh | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/opm/models/blackoil/blackoilsolventmodules.hh b/opm/models/blackoil/blackoilsolventmodules.hh index b194d1bef..701c2e6d5 100644 --- a/opm/models/blackoil/blackoilsolventmodules.hh +++ b/opm/models/blackoil/blackoilsolventmodules.hh @@ -999,36 +999,35 @@ private: const Evaluation bg = fs.invB(gasPhaseIdx); const Evaluation bs = solventInverseFormationVolumeFactor(); - // Set the effective invB factors - fs.setInvB(oilPhaseIdx, pmisc * bOilEff + (1.0 - pmisc) * bo); - fs.setInvB(gasPhaseIdx, pmisc * bGasEff + (1.0 - pmisc) * bg); - solventInvFormationVolumeFactor_ = pmisc * bSolventEff + (1.0 - pmisc) * bs; + const Evaluation bo_eff = pmisc * bOilEff + (1.0 - pmisc) * bo; + const Evaluation bg_eff = pmisc * bGasEff + (1.0 - pmisc) * bg; + const Evaluation bs_eff = pmisc * bSolventEff + (1.0 - pmisc) * bs; // set the densities fs.setDensity(oilPhaseIdx, - fs.invB(oilPhaseIdx) + bo_eff *(FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx) + FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx)*fs.Rs())); fs.setDensity(gasPhaseIdx, - fs.invB(gasPhaseIdx) + bg_eff *(FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx) + FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx)*fs.Rv())); - solventDensity_ = solventInverseFormationVolumeFactor()*solventRefDensity(); + solventDensity_ = bs_eff*solventRefDensity(); // set the viscosity / mobility // TODO make it possible to store and modify the viscosity in fs directly // keep the mu*b interpolation Evaluation& mobo = asImp_().mobility_[oilPhaseIdx]; - muOilEff = fs.invB(oilPhaseIdx) / (pmisc * bOilEff / muOilEff + (1.0 - pmisc) * bo / muOil); + muOilEff = bo_eff / (pmisc * bOilEff / muOilEff + (1.0 - pmisc) * bo / muOil); mobo *= muOil / muOilEff; Evaluation& mobg = asImp_().mobility_[gasPhaseIdx]; - muGasEff = fs.invB(gasPhaseIdx) / (pmisc * bGasEff / muGasEff + (1.0 - pmisc) * bg / muGas); + muGasEff = bg_eff / (pmisc * bGasEff / muGasEff + (1.0 - pmisc) * bg / muGas); mobg *= muGas / muGasEff; // Update viscosity of solvent - solventViscosity_ = solventInvFormationVolumeFactor_ / (pmisc * bSolventEff / muSolventEff + (1.0 - pmisc) * bs / muSolvent); + solventViscosity_ = bs_eff / (pmisc * bSolventEff / muSolventEff + (1.0 - pmisc) * bs / muSolvent); } protected: