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

Get/Set Equivalence Ratio/Mixture Fraction Functions for C++ #28

Closed
g3bk47 opened this issue Jan 20, 2020 · 3 comments
Closed

Get/Set Equivalence Ratio/Mixture Fraction Functions for C++ #28

g3bk47 opened this issue Jan 20, 2020 · 3 comments
Labels
work-in-progress An enhancement that someone is currently working on

Comments

@g3bk47
Copy link

g3bk47 commented Jan 20, 2020

Abstract

I implemented the set_equivalence_ratio functionality from python in the C++ interface. In addition to the original python function, the new functions support the composition of fuel and oxidizer being passed as mole and mass fractions. Also, the get_equivalence_ratio function in the current implementation seems to be wrong. A fixed version is provided together with functions to determine the mixture fraction. A fork with some proof of concept code can be found here:
g3bk47/cantera@d00b40f
The implementation itself is quite trivial, but there are some open questions about the naming schemes, calling C++ from python and other minor points.

Motivation

Describe the need for the work being done:

  • What problem is it trying to solve?
    Bring the functionality from python to C++, add the mixture fraction concept and fix the get_equivalence_ratio function
  • Who is affected by the change?
    No breaking changes, only additions

Description

For a detailed description, see the threads in the user group:
https://groups.google.com/forum/embed/#!topic/cantera-users/owoAebI6rr8
https://groups.google.com/forum/embed/#!topic/cantera-users/gs-wHjo18Do

References

g3bk47/cantera@d00b40f
https://groups.google.com/forum/embed/#!topic/cantera-users/owoAebI6rr8
https://groups.google.com/forum/embed/#!topic/cantera-users/gs-wHjo18Do

@g3bk47 g3bk47 added the work-in-progress An enhancement that someone is currently working on label Jan 20, 2020
@ischoegl
Copy link
Member

@g3bk47 ... looking at your fork, the work is mostly done. The remaining things are to link everything back into the cython interface, and to convert your proof_of_work.py to unit tests. For the former, you need to add your new C++ methods to _cantera.pxd so you can use them from thermo.pyx. Once the cython calls work, the latter is straightforward. One relatively short and recent example for how a cython function is moved to C++ is in Cantera/cantera@7a87819.

As the next Cantera release (2.5) is relatively close, it may make sense to create a pull request. I can give some pointers, although I’m not among those who make decisions about adoption.

@g3bk47
Copy link
Author

g3bk47 commented Feb 17, 2020

@ischoegl Thanks for offering your help. I will prepare a pull request until Tuesday so that it can hopefully be included in the 2.5 release.

@g3bk47
Copy link
Author

g3bk47 commented Jul 6, 2020

Changes have been merged (Cantera/cantera#851)

@g3bk47 g3bk47 closed this as completed Jul 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
work-in-progress An enhancement that someone is currently working on
Projects
None yet
Development

No branches or pull requests

2 participants