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

forward and reverse orders #163

Open
rebeccaem opened this issue Aug 21, 2015 · 15 comments
Open

forward and reverse orders #163

rebeccaem opened this issue Aug 21, 2015 · 15 comments

Comments

@rebeccaem
Copy link

I have a chemkin reaction input file with one reaction to test forward and reverse orders. Right now, including the final two lines (or any variation with different orders) makes no difference in the output. Are these currently recognized by Antioch?

!
! ONE-RXN TEST MODEL
!
ELEMENTS
H O
END
SPECIES
H2 O2 H2O
END
REACTIONS
2H2 + O2 <=> 2H2O        3.0e13    0.0e-16    0.0e-16
FORD/H2 2.0/O2 1.0/
RORD/H2O 1.0/
END
@pbauman
Copy link
Member

pbauman commented Aug 21, 2015

Related to #153? Comments @SylvainPlessis

@rebeccaem
Copy link
Author

Not sure if this helps, but right now reverse rates look good. It's just
that I try to change the order of forward or backward reactions and nothing
changes.

On Friday, August 21, 2015, Paul T. Bauman [email protected] wrote:

Related to #153 #153?
Comments @SylvainPlessis https://github.com/SylvainPlessis


Reply to this email directly or view it on GitHub
#163 (comment).

@variscarey
Copy link

I don't think the Chemkin parser checks for FORD or RORD in the file
currently(and thus nothing happens). This didn't come up in testing as
only one of the chemkin inputs we received from the EXACT people had FORD
(and didn't have RORD at all). There are probably some other gaps in
parsing coverage for some of the more esoteric Chemkin options.

Varis

On Fri, Aug 21, 2015 at 4:15 PM, Rebecca Morrison [email protected]
wrote:

Not sure if this helps, but right now reverse rates look good. It's just
that I try to change the order of forward or backward reactions and nothing
changes.

On Friday, August 21, 2015, Paul T. Bauman [email protected]
wrote:

Related to #153 #153?
Comments @SylvainPlessis https://github.com/SylvainPlessis


Reply to this email directly or view it on GitHub
<#163 (comment)
.


Reply to this email directly or view it on GitHub
#163 (comment).

Varis Carey
Assistant Professor
Department of Mathematical and Statistical Sciences
University of Colorado Denver

@rebeccaem
Copy link
Author

I see. What about in xml?

@pbauman
Copy link
Member

pbauman commented Aug 24, 2015

Thanks @variscarey.

I'm working on introducing CPPUnit into Antioch for testing to help us start dropping in coverage (and subsequent Antioch code, if needed, hooray test-driven development). I have in mind targeting ChemKin parsing (not just kinetics, thermo as well).

@pbauman
Copy link
Member

pbauman commented Aug 24, 2015

@beanSnippet

For my edification, can you please describe what you expect FORD and RORD to do?

@rebeccaem
Copy link
Author

Say you have the reaction A + B <-> C. The standard order on each species' concentration that shows up in the ODEs is 1, i.e. dA/dt = -k A B (I'm abusing notation here by writing the concentration of A as just A). But you might want a different order on A, say dA/dt = -k A^2 B. In the Chemkin format, this would be specified by the line

FORD/A 2.0/ B 1.0/

where FORD stands for Forward Order and RORD for Reverse Order.

@variscarey
Copy link

I don't think the xml parser allows non-default FORD & RORD specification(I
don't see a parsing tag for this). You can hack this by screwing with the
reaction definition in either the chemkin or xml format. I also suspect
that decimal/real valued orders may not be supported by the parsing setup,
so if you want to specify a
stoichmetric coefficient like 1.3 the hack will not work.

I think this is a useful feature, especially when trying to model reduced
reactions/missing chemistry, so we'll try and add this to antioch soon.

Varis

Varis

On Mon, Aug 24, 2015 at 9:53 AM, Rebecca Morrison [email protected]
wrote:

Say you have the reaction A + B <-> C. The standard order on each
species' concentration that shows up in the ODEs is 1, i.e. dA/dt = -k A B
(I'm abusing notation here by writing the concentration of A as just A).
But you might want a different order on A, say dA/dt = -k A^2 B. In the
Chemkin format, this would be specified by the line

FORD/A 2.0/ B 1.0/

where FORD stands for Forward Order and RORD for Reverse Order.


Reply to this email directly or view it on GitHub
#163 (comment).

Varis Carey
Assistant Professor
Department of Mathematical and Statistical Sciences
University of Colorado Denver

@rebeccaem
Copy link
Author

Okay, got it. And yes, I've only come across this feature in seriously reduced models, but it would be a nice feature to have. I will need decimal orders, so I'll go ahead and implement the necessary stuff apart from Antioch for now. The reaction set is fairly small, so this isn't a huge problem at the moment. Thanks for the quick clarifications.

@SylvainPlessis
Copy link
Contributor

Antioch indeed doesn't have that feature. We are in the elementary process approximation (even for duplicate, three body, etc.), see 2.2.1 in documentation for a little bit more details.

Also, as @variscarey said, the stoichiometric coefficients are static_cast<int>'d through the process of computing the rate constant, no hack is possible.

Adding explicit orders of reaction should not be complicated, that would be a std::vector<CoeffType> for forward and backward rate, being by default respectively equal to _species_reactant_stoichiometry and _species_product_stoichiometry. The biggest part being defining keywords and updating the parsers. Now the powers would be computed with CoeffType instead of int, will there be a loss of performances here? Or should we generalize to any integer values and not any value?

@rebeccaem
Copy link
Author

For my case, I have fractional orders for some reactants and products. If I hacked the code to remove the int static cast (is it there for a non-performance reason?) and maybe avoid going through the parser to get the order values to compute_rate_of_progress, would this work?

Also, will using orders instead of stoichiometric coefficients for some species affect the way the backward rate is computed from thermo?

@SylvainPlessis
Copy link
Contributor

If you hack the code:

  1. yes you will have the desired partial orders of reactions and the expected forward rate, but
  2. indeed you will change the backward rate, because you'll change the value of gamma (see section 2.2.1, going backward, equation 2.2-4; and appendix A.2.2), and thus you won't have the expected backward rate

@rebeccaem
Copy link
Author

That's what I figured after looking a little deeper. I decided to write my own function to compute backwards rates instead of hacking Antioch to change orders.

@pbauman
Copy link
Member

pbauman commented Feb 5, 2016

@SylvainPlessis Please confirm #172/#181 fixed this and go ahead and close, please.

@rebeccaem
Copy link
Author

Hi everyone,

I know this response is like eons in Antioch time, sorry! I just ran a little test using xml file and it looks good so far. There is an xml file (one-test-orders.xml) with specified orders and another (one-test-no-orders.xml) without specified orders. The rest of the test file that I used and makefile are also included. Hope that helps.

test-orders.zip

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

4 participants