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

[cti] Allow non-reactant orders for reaction #321

Closed
wants to merge 2 commits into from

Conversation

imitrichev
Copy link
Contributor

Resolves #317.
Adding new option nonreactant_orders that could be used in cti like this:

reaction("C8H18 + 12.5 O2 => 8 CO2 + 9 H2O", [4.6e11, 0.0, 30.0],
         order="C8H18:-0.25 CO:0.15", 
         options=['negative_orders', 'nonreactant_orders'])

In the example reaction order is specified for non-reactant CO.

…rders.

The corresponding flag allow_nonreactant_orders, `Class Reaction`,
also becomes true when using this option in cti/ctml.
@bryanwweber
Copy link
Member

Thank you for adding this! Can you also add a test for this functionality? There is a class set up to test CTML conversion here: https://github.com/Cantera/cantera/blob/master/interfaces/cython/cantera/test/test_convert.py#L361
You can just add a new function to test the non-reactant orders

@speth
Copy link
Member

speth commented Feb 25, 2016

I would assume that it would be easier to run the test suite on your own machine (scons test) and debug the issues there, although of course in the end the Travis build should also succeed.

The immediate cause of the failure is the lack of a colon at the end of your for statement.

I would also recommend not using assertEqual on floating point numbers. You can use assertNear instead.

@imitrichev
Copy link
Contributor Author

Thank you for your suggestions! I've made the changes. Test test_reaction_orders now verifies conversion of negative and non-reactant reaction orders using reaction_orders.cti.

Please, look, if this is OK, when you have a time.

@speth speth closed this in 7e71645 Feb 27, 2016
@speth speth mentioned this pull request Nov 29, 2016
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

Successfully merging this pull request may close these issues.

3 participants