diff --git a/src/oneD/OneDim.cpp b/src/oneD/OneDim.cpp index e177d0117..c8b5bb4de 100644 --- a/src/oneD/OneDim.cpp +++ b/src/oneD/OneDim.cpp @@ -301,6 +301,10 @@ void OneDim::initTimeInteg(doublereal dt, doublereal* x) void OneDim::setSteadyMode() { + if (m_rdt == 0) { + return; + } + m_rdt = 0.0; m_jac->updateTransient(m_rdt, m_mask.data()); @@ -384,10 +388,6 @@ doublereal OneDim::timeStep(int nsteps, doublereal dt, doublereal* x, } } - // Prepare to solve the steady problem. - setSteadyMode(); - newton().setOptions(m_ss_jac_age); - // return the value of the last stepsize, which may be smaller // than the initial stepsize return dt; diff --git a/src/oneD/Sim1D.cpp b/src/oneD/Sim1D.cpp index 61a2d2529..a913c605a 100644 --- a/src/oneD/Sim1D.cpp +++ b/src/oneD/Sim1D.cpp @@ -5,6 +5,7 @@ #include "cantera/oneD/Sim1D.h" #include "cantera/oneD/MultiJac.h" #include "cantera/oneD/StFlow.h" +#include "cantera/oneD/MultiNewton.h" #include "cantera/numerics/funcs.h" #include "cantera/base/xml.h" @@ -244,6 +245,9 @@ void Sim1D::solve(int loglevel, bool refine_grid) writeline('.', 78, true, true); } while (!ok) { + // Attempt to solve the steady problem + setSteadyMode(); + newton().setOptions(m_ss_jac_age); debuglog("Attempt Newton solution of steady-state problem...", loglevel); int status = newtonSolve(loglevel-1);