From 775573e3b2557cb013d1279db349d8b43ca5758d Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Tue, 22 Oct 2019 13:04:29 +0200 Subject: [PATCH] avoid nan in the density calculation --- opm/simulators/wells/StandardWell_impl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index e623e6b1f..7e90242be 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -2338,10 +2338,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) {