Hi,
Currently, this can’t be done using the modifyReaction method — only the parameters of the rate constant can be changed. This is specified in the documentation for the method: “The stoichiometric equation, type of the reaction, reaction orders, third body efficiencies, reversibility, etc. must be unchanged.”
Regards,
Ray
On Thursday, September 12, 2019 at 5:15:48 PM UTC-4, Adhiraj Dasgupta wrote:
Adhiraj,
The way that the Kinetics object works is that it makes copies of the parameters in Reaction objects when the reactions are added to the kinetics manager, putting these values into various arrays so that they can be used efficiently for repeatedly evaluating rates. The original Reaction object is rarely used after this. This is the reason the modifyReaction method is necessary in the first place — changes to the rate constant of a Reaction object would otherwise have no effect. The problem you are running into is that modifyReaction doesn’t support your use case — it only updates the internal parameters associated with the rate constant, not reaction orders or other parameters.
If you’re trying to optimize a parameters for a mechanism with only a small number of reactions, it may be efficient enough to delete and recreate the Kinetics object each time. You can reuse the ThermoPhase object, and if you’re doing ReactorNet simulations, you should be able to reuse the Reactor object as well by calling setKineticsMgr with the new Kinetics object.
Regards,
Ray