Merge pull request #1608 from andlaus/fix_2p_wells

well model: fix valgrind complaints if either oil or gas are disabled
This commit is contained in:
Atgeirr Flø Rasmussen 2018-10-31 15:16:56 +01:00 committed by GitHub
commit 985b1b17f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -692,8 +692,21 @@ namespace Opm {
}
// Use average Rs and Rv:
double Rs = std::min(ra.rs, surface_rates[ig]/(surface_rates[io]+1.0e-15));
double Rv = std::min(ra.rv, surface_rates[io]/(surface_rates[ig]+1.0e-15));
auto a = ra.rs;
auto b = a;
if (io >= 0 && ig >= 0) {
b = surface_rates[ig]/(surface_rates[io]+1.0e-15);
}
double Rs = std::min(a, b);
a = ra.rv;
b = a;
if (io >= 0 && ig >= 0) {
b = surface_rates[io]/(surface_rates[ig]+1.0e-15);
}
double Rv = std::min(a, b);
// Determinant of 'R' matrix
const double detR = 1.0 - (Rs * Rv);