From 1ab81ace5c9840dbaf16b11d1de89ed35de8ee57 Mon Sep 17 00:00:00 2001 From: Richard West Date: Tue, 31 May 2022 23:41:42 -0400 Subject: [PATCH] [Python] Fix ATOL in advance_to_steady_state The docstring says that if undefined it should match the solver ATOL, which makes sense to me. What the code in fact did was atol = self.rtol, which I presume is a typo, so have changed to atol = self.atol. Since RTOL is often ten or more orders of magnitude larger than ATOL, this could make some significant differences to people trying to use this method. However, the changes could be bad: if now we can't ever reach the steady state, or it takes much longer to reach steady state (already a complaint I hear), folks may complain that this commit just made it a bunch slower and less stable. (But at least they're now getting what they ask for, instead of just getting the wrong answer quicker). --- interfaces/cython/cantera/reactor.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/cython/cantera/reactor.pyx b/interfaces/cython/cantera/reactor.pyx index f536942b87..573ae51c6f 100644 --- a/interfaces/cython/cantera/reactor.pyx +++ b/interfaces/cython/cantera/reactor.pyx @@ -1415,7 +1415,7 @@ cdef class ReactorNet: """ # get default tolerances: if not atol: - atol = self.rtol + atol = self.atol if not residual_threshold: residual_threshold = 10. * self.rtol if residual_threshold <= self.rtol: