BlackoilPropertiesFromDeck: properly calculate the Rs and Rv values for viscosity

the dissolution factors used for the viscosities were always zero so
far. this was not discovered earlier because flow is completely
unaffected by this since the only place where this class is used in
flow is the equilibration code and the equilibration code does not
need phase viscosities.

thanks to @atgeirr for finding this.
This commit is contained in:
Andreas Lauser 2016-03-08 10:56:11 +01:00
parent 41faabe61a
commit dfda345661

View File

@ -242,6 +242,7 @@ namespace Opm
double* dmudp) const
{
const auto& pu = phaseUsage();
const int np = numPhases();
enum PressureEvalTag {};
typedef Opm::LocalAd::Evaluation<double, PressureEvalTag, /*size=*/1> LadEval;
@ -254,6 +255,9 @@ namespace Opm
pLad.derivatives[0] = 1.0;
R_.resize(n*np);
this->compute_R_(n, p, T, z, cells, &R_[0]);
for (int i = 0; i < n; ++ i) {
int cellIdx = cells[i];
int pvtRegionIdx = cellPvtRegionIdx_[cellIdx];
@ -268,6 +272,7 @@ namespace Opm
}
if (pu.phase_used[BlackoilPhases::Liquid]) {
RsLad.value = R_[i*np + pu.phase_pos[BlackoilPhases::Liquid]];
muLad = oilPvt_.viscosity(pvtRegionIdx, TLad, pLad, RsLad);
int offset = pu.num_phases*cellIdx + pu.phase_pos[BlackoilPhases::Liquid];
mu[offset] = muLad.value;
@ -275,6 +280,7 @@ namespace Opm
}
if (pu.phase_used[BlackoilPhases::Vapour]) {
RvLad.value = R_[i*np + pu.phase_pos[BlackoilPhases::Vapour]];
muLad = gasPvt_.viscosity(pvtRegionIdx, TLad, pLad, RvLad);
int offset = pu.num_phases*cellIdx + pu.phase_pos[BlackoilPhases::Vapour];
mu[offset] = muLad.value;