mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
a9f758a8e7
commit
ccc1ca0b76
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user