@@ -209,6 +209,54 @@ class SteadyStateSystem
209209 m_tfactor = tfactor;
210210 }
211211
212+ // ! Set the default factor by which the time step is increased after a
213+ // ! successful step when the Jacobian is re-used.
214+ // !
215+ // ! The default value is 1.5, matching historical behavior.
216+ // ! @param tfactor factor time step is multiplied by after a successful step
217+ void setTimeStepGrowthFactor (double tfactor) {
218+ if (tfactor < 1.0 ) {
219+ throw CanteraError (" SteadyStateSystem::setTimeStepGrowthFactor" ,
220+ " Time step growth factor must be >= 1.0. Got {}." , tfactor);
221+ }
222+ m_tstep_growth = tfactor;
223+ }
224+
225+ // ! Get the successful-step time step growth factor.
226+ double timeStepGrowthFactor () const {
227+ return m_tstep_growth;
228+ }
229+
230+ // ! Enable or disable adaptive time-step growth heuristics.
231+ // !
232+ // ! If disabled, steady solvers use the fixed growth factor from
233+ // ! setTimeStepGrowthFactor(). Disabled by default.
234+ void setAdaptiveTimeStepGrowth (bool enabled) {
235+ m_adaptive_tstep_growth = enabled;
236+ }
237+
238+ // ! Get whether adaptive time-step growth heuristics are enabled.
239+ bool adaptiveTimeStepGrowth () const {
240+ return m_adaptive_tstep_growth;
241+ }
242+
243+ // ! Select which adaptive time-step growth heuristic is used.
244+ // !
245+ // ! Supported values are 1-4.
246+ void setTimeStepGrowthHeuristic (int heuristic) {
247+ if (heuristic < 1 || heuristic > 4 ) {
248+ throw CanteraError (" SteadyStateSystem::setTimeStepGrowthHeuristic" ,
249+ " Time step growth heuristic must be in the range [1, 4]. Got {}." ,
250+ heuristic);
251+ }
252+ m_tstep_growth_heuristic = heuristic;
253+ }
254+
255+ // ! Get the selected adaptive time-step growth heuristic.
256+ int timeStepGrowthHeuristic () const {
257+ return m_tstep_growth_heuristic;
258+ }
259+
212260 // ! Set the maximum number of timeteps allowed before successful steady-state solve
213261 void setMaxTimeStepCount (int nmax) {
214262 m_nsteps_max = nmax;
@@ -286,6 +334,17 @@ class SteadyStateSystem
286334 // ! Factor time step is multiplied by if time stepping fails ( < 1 )
287335 double m_tfactor = 0.5 ;
288336
337+ // ! Factor time step is multiplied by after successful steps when no new Jacobian
338+ // ! evaluation is needed.
339+ double m_tstep_growth = 1.5 ;
340+
341+ // ! If `true`, use residual- or iteration-based heuristics to gate time-step
342+ // ! growth; otherwise use the fixed growth factor.
343+ bool m_adaptive_tstep_growth = false ;
344+
345+ // ! Selected adaptive growth heuristic (1-4). See timeStepIncreaseFactor().
346+ int m_tstep_growth_heuristic = 2 ;
347+
289348 shared_ptr<vector<double >> m_state; // !< Solution vector
290349
291350 // ! Work array used to hold the residual or the new solution
0 commit comments