return zero thp value for extremely small injection rate

it is a finding from one of the test case.
This commit is contained in:
Kai Bao 2022-01-18 10:12:20 +01:00
parent ea8a631ee0
commit 913ad21733

View File

@ -31,6 +31,8 @@
#include <opm/simulators/wells/VFPHelpers.hpp>
#include <limits>
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<double>::epsilon()) {
return 0.;
}
const std::vector<double> thp_array = table.getTHPAxis();
int nthp = thp_array.size();