Difference in thermodynamic data when using sim.step() versus sim.advance() for the same time iterations

14 views
Skip to first unread message

Christian Smith

unread,
Sep 8, 2025, 9:22:06 AM (5 days ago) Sep 8
to Cantera Users' Group
Hello!  I'm testing using sim.step() to initially solve a chemical kinetic model while saving the generated time steps to be used to resolve the same model using sim.advance().  Once this was done I noticed discrepancies between the data points at the same point in time.  Does sim.step() and sim.advance() produce different chemical kinetic behaviors?  Everything regarding the model and runtime is identical between each solution, the only difference is using sim.step() versus sim.advance() (which uses the time steps normally generated by sim.step()).  Thank you!  

Ray Speth

unread,
Sep 10, 2025, 10:56:33 AM (3 days ago) Sep 10
to Cantera Users' Group

Hi,

I’m not sure I understand exactly what you’re trying to do. The sim.advance method does not provide direct control over the internal steps taken by CVodes. All it does is interpolate the solution based on the most recent time steps to the specified point in time. However, it is unlikely that the integrator is actually taking the exact same steps in the second case, and so there will be some small differences in the solution, which should be at the scale of the specified relative and absolute integrator tolerances. One reason for this is that SUNDIALS uses a slightly different process for picking the initial step size when you use step() (where it has no idea of the time scales that are relevant to the problem) versus when you use advance(t1) (where the time you specify gives it at least some idea of a relevant scale).

If you’re seeing larger discrepancies than this, please provide a minimal working example so we can understand what’s going on.

Regards,
Ray

Reply all
Reply to author
Forward
0 new messages