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 authored and GitHub committed 2018-10-31 15:16:56 +01:00
commit 985b1b17f0
1 file changed
+15 -2
+15 -2
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);