Corrected fluidDensity() function to account for dissolved gas.

This commit is contained in:
Atgeirr Flø Rasmussen 2013-05-31 14:59:56 +02:00
parent 59e36f72b3
commit d49be41cae

View File

@ -956,6 +956,10 @@ namespace Opm {
const double* rhos = fluid_.surfaceDensity();
ADB b = fluidReciprocFVF(phase, p, rs, cells);
ADB rho = V::Constant(p.size(), 1, rhos[phase]) * b;
if (phase == Oil && active_[Gas]) {
// It is correct to index into rhos with canonical phase indices.
rho += V::Constant(p.size(), 1, rhos[Gas]) * rs * b;
}
return rho;
}