mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-12 17:02:02 -05:00
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:
1 file changed
+15
-2
@@ -692,8 +692,21 @@ namespace Opm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Use average Rs and Rv:
|
// Use average Rs and Rv:
|
||||||
double Rs = std::min(ra.rs, surface_rates[ig]/(surface_rates[io]+1.0e-15));
|
auto a = ra.rs;
|
||||||
double Rv = std::min(ra.rv, surface_rates[io]/(surface_rates[ig]+1.0e-15));
|
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
|
// Determinant of 'R' matrix
|
||||||
const double detR = 1.0 - (Rs * Rv);
|
const double detR = 1.0 - (Rs * Rv);
|
||||||
|
|||||||
Reference in new issue
Block a user