Skip to content

Add a function to find species by chemical formula #603

@speth

Description

@speth

There are a few places in Cantera where a model handles a particular species in a special way, e.g. H2O and CO2 in the flame radiatiaton model, and O2- in IonGasTransport and we currently do this based on matching the species name. However, there is generally no requirement that species be named in this way, so it would be useful if we could find these species by their atomic composition instead.

This could be done in C++ by adding an overload to Phase::speciesIndex which takes a compositionMap as the argument. For the Python interface, it could involve another elif check for a dict containing the composition.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions