Fix Todd-Longstaff model. Only modify density (i.e) the effective gravity contribution and not the volumes itself

This commit is contained in:
Tor Harald Sandve 2022-12-19 12:36:16 +01:00
parent 58f01949b7
commit 9454ba1fe5

View File

@ -999,36 +999,35 @@ private:
const Evaluation bg = fs.invB(gasPhaseIdx); const Evaluation bg = fs.invB(gasPhaseIdx);
const Evaluation bs = solventInverseFormationVolumeFactor(); const Evaluation bs = solventInverseFormationVolumeFactor();
// Set the effective invB factors const Evaluation bo_eff = pmisc * bOilEff + (1.0 - pmisc) * bo;
fs.setInvB(oilPhaseIdx, pmisc * bOilEff + (1.0 - pmisc) * bo); const Evaluation bg_eff = pmisc * bGasEff + (1.0 - pmisc) * bg;
fs.setInvB(gasPhaseIdx, pmisc * bGasEff + (1.0 - pmisc) * bg); const Evaluation bs_eff = pmisc * bSolventEff + (1.0 - pmisc) * bs;
solventInvFormationVolumeFactor_ = pmisc * bSolventEff + (1.0 - pmisc) * bs;
// set the densities // set the densities
fs.setDensity(oilPhaseIdx, fs.setDensity(oilPhaseIdx,
fs.invB(oilPhaseIdx) bo_eff
*(FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx) *(FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx)
+ FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx)*fs.Rs())); + FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx)*fs.Rs()));
fs.setDensity(gasPhaseIdx, fs.setDensity(gasPhaseIdx,
fs.invB(gasPhaseIdx) bg_eff
*(FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx) *(FluidSystem::referenceDensity(gasPhaseIdx, pvtRegionIdx)
+ FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx)*fs.Rv())); + FluidSystem::referenceDensity(oilPhaseIdx, pvtRegionIdx)*fs.Rv()));
solventDensity_ = solventInverseFormationVolumeFactor()*solventRefDensity(); solventDensity_ = bs_eff*solventRefDensity();
// set the viscosity / mobility // set the viscosity / mobility
// TODO make it possible to store and modify the viscosity in fs directly // TODO make it possible to store and modify the viscosity in fs directly
// keep the mu*b interpolation // keep the mu*b interpolation
Evaluation& mobo = asImp_().mobility_[oilPhaseIdx]; 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; mobo *= muOil / muOilEff;
Evaluation& mobg = asImp_().mobility_[gasPhaseIdx]; 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; mobg *= muGas / muGasEff;
// Update viscosity of solvent // 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: protected: