Description
Abstract
Creation of empty Wall
, FlowDevice
and ReactorSurface
objects is not supported by the Python API, and Cantera/cantera#1765 removes preliminary support from experimental MATLAB. It would be consistent to disallow this at the C++ level as well, which would (eventually) simplify/streamline the interface by removing several methods and associated exception handling. Passing shared pointers to ReactorBase
objects to constructors instead would be a significant step towards elimination of raw pointers from the reactor code base. A similar argument holds for ReactorNet
and the pending ReactorEdge
(see Cantera/cantera#1697).
Motivation
Describe the need for the proposed change:
- What problem is it trying to solve? ... simplify reactor API
- Who is affected by the change? ... mostly developers
- Why is this a good solution? ... simplifies API
Possible Solutions
Update constructors and factory methods and clib
beyond changes introduced in Cantera/cantera#1765. Deprecate various install
methods. Constructors should be updated to use signatures similar to
FlowDevice(shared_ptr<ReactorBase> upstream=nullptr, shared_ptr<ReactorBase> downstream=nullptr,
const string& name="(none)")
where null upstream
/downstream
will raise deprecation warnings in 3.1, with defaults being removed thereafter.
References