From c777c42b31f3bc3fe388b0c2f256bdd30a17a8e0 Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Wed, 30 Apr 2025 11:34:30 +0200 Subject: [PATCH] not using too small d = 1. - rs*rv in StandardWellConnections too small denominator can cause small volrat and too big density. --- opm/simulators/wells/StandardWellConnections.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opm/simulators/wells/StandardWellConnections.cpp b/opm/simulators/wells/StandardWellConnections.cpp index c3c51b750f..b8d1a778b4 100644 --- a/opm/simulators/wells/StandardWellConnections.cpp +++ b/opm/simulators/wells/StandardWellConnections.cpp @@ -85,7 +85,8 @@ namespace { } const Scalar denom = Scalar{1} - rs*rv; - if (! (denom > Scalar{0})) { + // too small denominator can cause small volrat and too big density + if (! (denom > threshold)) { const auto msg = fmt::format(R"(Problematic denominator value {} for well {}. Connection density calculation with (Rs, Rv) = ({}, {}). Proceeding as if no dissolution or vaporisation for this connection)", @@ -131,7 +132,8 @@ namespace { } const Scalar d = Scalar{1} - rsw*rvw; - if (! (d > Scalar{0})) { + // too small denominator can cause small volrat and too big density + if (! (d > threshold)) { const auto msg = fmt::format(R"(Problematic denominator value {} for well {}. Connection density calculation with (Rsw, Rvw) = ({}, {}). Proceeding as if no dissolution or vaporisation for this connection)",