Merge pull request #2096 from totto82/avoid_nan_density

avoid nan in the density calculation
This commit is contained in:
Atgeirr Flø Rasmussen 2019-10-22 14:27:45 +02:00 committed by GitHub
commit 5d1e125ab9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2344,10 +2344,10 @@ namespace Opm
const unsigned oilpos = Indices::canonicalToActiveComponentIndex(FluidSystem::oilCompIdx);
double rs = 0.0;
double rv = 0.0;
if (!rsmax_perf.empty() && mix[oilpos] > 0.0) {
if (!rsmax_perf.empty() && mix[oilpos] > 1e-12) {
rs = std::min(mix[gaspos]/mix[oilpos], rsmax_perf[perf]);
}
if (!rvmax_perf.empty() && mix[gaspos] > 0.0) {
if (!rvmax_perf.empty() && mix[gaspos] > 1e-12) {
rv = std::min(mix[oilpos]/mix[gaspos], rvmax_perf[perf]);
}
if (rs != 0.0) {