Skip to content

Synchronization of ReactionRate objects: Reaction vs MultiRate #1211

Open
@ischoegl

Description

@ischoegl

Problem description

Both 'legacy' and 'new' frameworks copy reaction rate objects into contiguous arrays of objects that are evaluated by Kinetics specializations (as all objects are in consecutive memory, access is efficient). As a result, it is necessary to use a modifyReaction route to change parameters, etc.. In addition, it is also not possible to query internal states of the rate object from a Reaction that was used to originally create the rate.

Behavior

The new framework being introduced in 2.6 allows for a more uniform access to Reaction and ReactionRate objects, but currently does not synchronize parameters and internal states once a Reaction is added to a Kinetics object. A user attempting to query any information will always access internal states of the original copy owned by Reaction, and is unable to access the copy used for evaluation (see, e.g. discussion in #1181).

System information

  • Cantera version: 2.6.0a4
  • OS: any
  • Python/MATLAB/other software versions: N/A

Additional context

Potential solutions.

  1. Use a single copy of a ReactionRate object
  2. Keep copies synchronized (see proof-of-concept in Proof-of-concept: Modify reaction rates in memory #1051)

As long as performance is comparable, solution (1) is preferable. Notably, the Python API requires shared_ptrs for access, which may create additional overhead. Also see blog post, which indicates that (2) is likely to outperform (1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions