From 37e49a62c831fb537c4937a27faee217c0fae0b8 Mon Sep 17 00:00:00 2001 From: Robert Kloefkorn Date: Tue, 9 Feb 2016 16:39:30 +0100 Subject: [PATCH] BlackoilModelBase: use single precision for solver when dt < 20 days. --- opm/autodiff/BlackoilModelBase_impl.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opm/autodiff/BlackoilModelBase_impl.hpp b/opm/autodiff/BlackoilModelBase_impl.hpp index 6eb4ece58..49721c6b4 100644 --- a/opm/autodiff/BlackoilModelBase_impl.hpp +++ b/opm/autodiff/BlackoilModelBase_impl.hpp @@ -250,7 +250,8 @@ namespace detail { const bool converged = asImpl().getConvergence(dt, iteration); const bool must_solve = (iteration < nonlinear_solver.minIter()) || (!converged); if (must_solve) { - residual_.singlePrecision = false ; + // enable single precision for solvers when dt is smaller then 20 days + residual_.singlePrecision = (unit::convert::to(dt, unit::day) < 20.) ; // Compute the nonlinear update. V dx = asImpl().solveJacobianSystem();