Hi Cory,
I don’t see any significant drawbacks to this approach. The interface of the ReactorNet constructor has been stable since Cantera 2.0, and the step method hasn’t changed since Cantera 2.3 (where an optional argument was removed). And given how fundamental these classes and methods are, any change would come with a round of warnings first.
The one larger change that would affect this is that I would like to eventually replace the advance_to_steady_state solver with a different algorithm based on the steady-state solver used for 1D flames. This is some work that was started quite a while back (PR #1021) but is currently stalled. If and when that is completed, getting the steady-state solution for a reactor network will not involve calls into Python, so overriding the Python step method won’t have any effect. But even when that happens, there will be a release with the existing advance_to_steady_state method in place with a deprecation warning.
Regards,
Ray
Hi Cory,
There may not be a strong use case for bringing the full ExtensibleXyz capability to ReactorNet, but it might be useful for this scenario and some debugging use cases to add optional Python callback functions to ReactorNet, similar to the set_time_step_callback and set_steady_callback methods that are available in the 1D solver.
I think adding functionality to automatically build SolutionArray objects for each reactor is a great idea. The possibility of doing this from the C++ side opened up thank’s to Ingmar’s work bringing the SolutionArray class to C++ in Cantera 3.0 — the original implementation I had made was Python only. Please consider writing that up as an item in the Enhancements repository.
Regards,
Ray