From a3755b54d8990546ad128879a077402ad93efa5a Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 15 Nov 2024 22:04:04 -0500 Subject: [PATCH] [1D] Prevent two-point control from finding solutions with reverse flow Fixes #1787 --- src/oneD/Flow1D.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/oneD/Flow1D.cpp b/src/oneD/Flow1D.cpp index d9792c527c..720a772431 100644 --- a/src/oneD/Flow1D.cpp +++ b/src/oneD/Flow1D.cpp @@ -1258,6 +1258,9 @@ void Flow1D::enableTwoPointControl(bool twoPointControl) { if (isStrained()) { m_twoPointControl = twoPointControl; + // Prevent finding spurious solutions with negative velocity (outflow) at either + // inlet. + setBounds(c_offset_V, -1e-5, 1e20); } else { throw CanteraError("Flow1D::enableTwoPointControl", "Invalid operation: two-point control can only be used"