From 913ad2173308b72678f26f8095c152354c4dfa6e Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Tue, 18 Jan 2022 10:12:20 +0100 Subject: [PATCH] return zero thp value for extremely small injection rate it is a finding from one of the test case. --- opm/simulators/wells/VFPInjProperties.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/opm/simulators/wells/VFPInjProperties.cpp b/opm/simulators/wells/VFPInjProperties.cpp index 3a2b56c75c..0899a40889 100644 --- a/opm/simulators/wells/VFPInjProperties.cpp +++ b/opm/simulators/wells/VFPInjProperties.cpp @@ -31,6 +31,8 @@ #include +#include + namespace Opm { double VFPInjProperties::bhp(int table_id, @@ -52,7 +54,10 @@ double VFPInjProperties::thp(int table_id, const VFPInjTable& table = detail::getTable(m_tables, table_id); //Find interpolation variables - double flo = detail::getFlo(table, aqua, liquid, vapour); + const double flo = detail::getFlo(table, aqua, liquid, vapour); + if (std::abs(flo) < std::numeric_limits::epsilon()) { + return 0.; + } const std::vector thp_array = table.getTHPAxis(); int nthp = thp_array.size();