Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-reactant orders for non-electrochemical reactions #317

Closed
imitrichev opened this issue Feb 4, 2016 · 2 comments
Closed

Allow non-reactant orders for non-electrochemical reactions #317

imitrichev opened this issue Feb 4, 2016 · 2 comments

Comments

@imitrichev
Copy link
Contributor

Good day! I need an ability to have non-reactant partial orders for reactions. It will make possible to define global reactions and use Cantera to calculate their kinetics.
So, I propose to add this ability, when new nonreactant_orders option in cti is true.
(or, maybe, I have something missed, and there is a specific class for global kinetics in Cantera?)

It was intended to have non-reactant reaction orders only for electrochemical reactions, as one can see.
Now, if one uses cti (and I always use it), cti->ctml converter ctml_writer.py blocks "non-reactant order" for any reaction (link).

I've also tried example sofc.py with sofc.cti adding non-reactant order for edge_reaction.
edge_reaction("O(m) + (ox) + 2 electron <=> (m) + O''(ox)",
[5.0e13, 0.0, 120.0], beta = 0.5, id="edge-f3", order= "H(m):0.01")
It expectedly fails.

order specified for non-reactant: H(m)
....
File "/usr/local/lib/python2.7/site-packages/cantera/ctml_writer.py", line 1143, in init
raise CTI_Error("order specified for non-reactant: "+o)
CTI_Error

However, the tests are passed as they do not make use of ctml_writer.
Is that check in ctml_writer.py redundant? We have one more check in Reaction::validate() here.

Many thanks for your attention!
Ivan.

@speth
Copy link
Member

speth commented Feb 5, 2016

Indeed, as a result of the refactoring which introduced the C++ Reaction class, the handling of reaction orders was generalized in a way which means that non-reactant orders can be used without any trouble.

I agree that by default, Cantera should still treat these as errors without a specific override, and that adding a nonreactant_orders option to the CTI reaction class, which parallels the negative_orders option would be appropriate.

There are a number of checks in ctml_writer which are redundant with checks performed in the C++ code. These checks used to be more important when the process for importing a mechanism required manually converting the CTI file to XML, so that errors could be caught in the conversion step rather than only when finally trying to import the mechanism.

@imitrichev
Copy link
Contributor Author

Well, I will check how it works and prepare a small pull request in the near future!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants