mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Corrected fluidDensity() function to account for dissolved gas.
This commit is contained in:
parent
59e36f72b3
commit
d49be41cae
@ -954,8 +954,12 @@ namespace Opm {
|
|||||||
const std::vector<int>& cells) const
|
const std::vector<int>& cells) const
|
||||||
{
|
{
|
||||||
const double* rhos = fluid_.surfaceDensity();
|
const double* rhos = fluid_.surfaceDensity();
|
||||||
ADB b = fluidReciprocFVF(phase, p, rs, cells);
|
ADB b = fluidReciprocFVF(phase, p, rs, cells);
|
||||||
ADB rho = V::Constant(p.size(), 1, rhos[phase]) * b;
|
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;
|
return rho;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user