Duplicate reactions

476 views
Skip to first unread message

c.aa...@gmail.com

unread,
Mar 12, 2019, 11:01:07 AM3/12/19
to Cantera Users' Group
I have built a chemkin file using Reaction Mechanism Generator (RMG) version 2.3.0.

On cantera 2.3.0a3 (from the RMG conda channel) my chemkin file validates OK:
(rmg230) Richards-iMac:temp rwest$ python -c "import cantera; print(cantera.__version__)"
2.3.0a3
(rmg230) Richards-iMac:temp rwest$ ck2cti --input=chem_annotated.inp --permissive
Wrote CTI mechanism file to 'chem_annotated.cti'.
Mechanism contains 113 species and 3519 reactions.
Validating mechanism...PASSED.


but on cantera 2.4.0 (from the cantera channel) it gives a duplicate reaction error:
(cantera) Richards-iMac:temp rwest$ python -c "import cantera; print(cantera.__version__)"
2.4.0
(cantera) Richards-iMac:temp rwest$ ck2cti --input=chem_annotated.inp --permissive
Wrote CTI mechanism file to 'chem_annotated.cti'.
Mechanism contains 113 species and 3519 reactions.
Validating mechanism...FAILED.


***********************************************************************
CanteraError thrown by Kinetics::checkDuplicates:
Undeclared duplicate reactions detected:
Reaction 1256: 2 CO2(18) <=> 2 CO2(320)
Reaction 1173: CO2(320) <=> CO2(18)
***********************************************************************


These are both pressure dependent reactions with chebyshev form (the error message is not printing the `(+M)`  which is in the input file). 

! Reaction index: Chemkin #1256; RMG #26807
! PDep reaction: PDepNetwork #3926
! Flux pairs: CO2(320), CO2(18);
CO2
(320)(+M)=CO2(18)(+M)                            1.000e+00 0.000     0.000    
    TCHEB
/ 300.000   3000.000 /
    PCHEB
/ 0.010     98.692   /
    CHEB
/ 6 4/
    CHEB
/ 9.211e+00    1.104e+00    -3.353e-01   -1.749e-02  /
    CHEB
/ -1.851e-01   1.953e-01    1.752e-02    -3.300e-02  /
    CHEB
/ -4.336e-02   3.856e-02    1.067e-02    -5.482e-03  /
    CHEB
/ -1.522e-02   1.275e-02    3.942e-03    -1.453e-03  /
    CHEB
/ -6.170e-03   4.974e-03    1.626e-03    -4.805e-04  /
    CHEB
/ -2.679e-03   2.096e-03    7.154e-04    -1.745e-04  /


! Reaction index: Chemkin #1173; RMG #1877
! PDep reaction: PDepNetwork #276
! Flux pairs: CO2(18), CO2(320); CO2(18), CO2(320);
CO2
(18)+CO2(18)(+M)=CO2(320)+CO2(320)(+M)           1.000e+00 0.000     0.000    
    TCHEB
/ 300.000   3000.000 /
    PCHEB
/ 0.010     98.692   /
    CHEB
/ 6 4/
    CHEB
/ -6.582e+01   -1.842e-02   -1.269e-02   -6.920e-03  /
    CHEB
/ 6.831e+01    1.309e-02    8.958e-03    4.836e-03   /
    CHEB
/ -2.004e-02   4.074e-04    3.072e-04    1.920e-04   /
    CHEB
/ 8.858e-03    1.754e-04    1.215e-04    6.701e-05   /
    CHEB
/ -3.797e-03   3.275e-05    2.301e-05    1.298e-05   /
    CHEB
/ -3.432e-04   -4.239e-06   -2.823e-06   -1.450e-06  /



As they’re different reaction orders I’d think they’d not be duplicates.
RMG thinks they shouldn't be marked as duplicates.
I don't actually have Chemkin available to check what it thinks.

I think this means there is either a bug in 
1) RMG 2.3.0  and Cantera 2.3.0a3
or
2) Cantera 2.4.0


chem_annotated.inp

Ray Speth

unread,
Mar 16, 2019, 1:40:00 PM3/16/19
to Cantera Users' Group
Hi,

Cantera has always regarded reactions where all of the stoichiometric coefficients are a multiple of those for a different reaction as duplicates. However, there was a bug for a while in the duplicate reaction detection that caused it to fail to detect these reactions in some cases. This bug was fixed in the current release by commit 513b4320.

I don't know what Chemkin does in this case, but I also don't think the goal should be for Cantera to replicate its sometimes idiosyncratic behavior. I would support having ck2cti mark reactions as duplicates where necessary, however.

Regards,
Ray

Chikpezili Ajulu

unread,
Aug 15, 2019, 10:33:08 AM8/15/19
to Cantera Users' Group
Hi Ray,

This issue seems to have resurfaced again in one of my RMG models for n_Heptane using cantera 2.4.0. Basically I get a duplicate error when in reality both reactions aren't duplicates. In order for the reactions to pass I had to use `DUPLICATE` twice after each of those reactions. Below is the code also attached is the chemkin file and .cti file
```
C2H4O(738)(+M)=CH3CHO(39)(+M)                       1.000e+00 0.000     0.000    
   TCHEB/ 300.000   2000.000 /

   PCHEB/ 0.010     98.692   /
   CHEB/ 6 4/
    CHEB/ 9.163e+00    1.113e+00    -3.268e-01   -1.361e-02  /
   CHEB/ -2.862e-01   2.224e-01    3.399e-02    -2.755e-02  /
   CHEB/ -1.385e-01   7.040e-02    2.525e-02    -2.516e-03  /
   CHEB/ -8.871e-02   3.660e-02    1.498e-02    7.016e-04   /
   CHEB/ -5.514e-02   1.892e-02    8.495e-03    1.156e-03   /
   CHEB/ -3.103e-02   8.363e-03    4.197e-03    9.643e-04   /



Reaction index: Chemkin #8745; RMG #8480
! PDep reaction: PDepNetwork #107
! Flux pairs: CH3CHO(39), C2H4O(738); CH3CHO(39), C2H4O(738);
CH3CHO(39)+CH3CHO(39)(+M)=C2H4O(738)+C2H4O(738)(+M) 1.000e+00 0.000     0.000    
   TCHEB/ 300.000   2000.000 /

   PCHEB/ 0.010     98.692   /
   CHEB/ 6 4/
    CHEB/ -5.231e+01   -2.010e-02   -1.384e-02   -7.543e-03  /
   CHEB/ 5.000e+01    1.283e-02    8.772e-03    4.725e-03   /
   CHEB/ -6.302e-03   7.243e-04    5.240e-04    3.090e-04   /
   CHEB/ -1.784e-02   4.573e-04    3.165e-04    1.740e-04   /
   CHEB/ -1.569e-02   1.969e-04    1.368e-04    7.581e-05   /
   CHEB/ -9.442e-03   6.688e-05    4.666e-05    2.600e-05   /

```
from cantera import ck2cti
ck2cti.main([
    '--input=/Users/ebubeajulu/Code/nHeptane/chemkin/chem_annotated.inp',
    '--tran=/Users/ebubeajulu/Code/nHeptane/chemkin/tran.dat',
    '--output=/Users/ebubeajulu/Code/nHeptane/chemkin/chem_annotated.cti',
    '--permissive'])


Wrote CTI mechanism file to ‘/Users/ebubeajulu/Code/nHeptane/chemkin/chem_annotated.cti’.
Mechanism contains 449 species and 10579 reactions.
Validating mechanism...

**** WARNING ****
For species HOCHO(59), discontinuity in h/RT detected at Tmid = 1000
Value computed using low-temperature polynomial:  -40.3604
Value computed using high-temperature polynomial: -38.1678
FAILED.

***********************************************************************
CanteraError thrown by Kinetics::checkDuplicates:
Undeclared duplicate reactions detected:
Reaction 8880: 2 CH3CHO(39) <=> 2 C2H4O(738)
Reaction 8745: C2H4O(738) <=> CH3CHO(39)
***********************************************************************

An exception has occurred, use %tb to see the full traceback.
SystemExit: 1

```

On Saturday, March 16, 2019 at 1:40:00 PM UTC-4, Ray Speth wrote:
Hi,

Cantera has always regarded reactions where all of the stoichiometric coefficients are a multiple of those for a different reaction as duplicates. However, there was a bug for a while in the duplicate reaction detection that caused it to fail to detect these reactions in some cases. This bug was fixed in the current release by commit 513b4320.

I don't know what Chemkin does in this case, but I also don't think the goal should be for Cantera to replicate its sometimes idiosyncratic behavior. I would support having ck2cti mark reactions as duplicates where necessary, however.

Regards,
Ray
chem_annotated.inp
n-Heptane_ignition_delay.ipynb

Ray Speth

unread,
Sep 12, 2019, 6:23:05 PM9/12/19
to Cantera Users' Group
Hi,

This seems to be essentially identical to the previous case, so I would expect Cantera to exhibit the same behavior as before. Since I think it should be possible to use a valid Chemkin format mechanism without manual intervention, I have created a new Issue in the Cantera tracker so this doesn't get forgotten.

Regards,
Ray
Reply all
Reply to author
Forward
0 new messages