mech-reduction write_yaml problem

177 views
Skip to first unread message

Yuan Fang

unread,
Oct 8, 2023, 5:54:26 AM10/8/23
to Cantera Users' Group
Hi all,

I have found some inconsistencies in the output results of Cantera's mechanism reduction program, specifically concerning the A values for Falloff reactions. The discrepancies appear to involve the multipliers of A in both Low and High pressure situations when compared to the A values in the Chemkin original file.

As an example, taking the official `mechanism_reduction.py` provided on cantera website, the generated `gri30-reduced-80-reaction.yaml` file contains reactions like the following:

```yaml
- equation: CH2CO + H (+M) <=> CH2CHO (+M)
  type: falloff
  low-P-rate-constant: {A: 1.012e+36, b: -7.63, Ea: 1.6125136e+07}
  high-P-rate-constant: {A: 4.865e+08, b: 0.422, Ea: -7.34292e+06}
  Troe: {A: 0.465, T3: 201.0, T1: 1773.0, T2: 5333.0}
```

In comparison, the Chemkin version is as follows:

```
H+CH2CO(+M) <=> CH2CHO(+M)   4.865E+11  0.422  -1755.00
LOW/ 1.012E+42  -7.63  3854.0/
TROE/ 0.465  201.0  1773.0  5333.0 /
```

In this example, the A factor in the Low situation differs by a factor of 1e6, while the A factor in the High situation differs by a factor of 1e3. Similarly, for another reaction:

```yaml
- equation: N2O (+M) <=> N2 + O (+M)
  type: falloff
  low-P-rate-constant: {A: 6.37e+11, b: 0.0, Ea: 2.3698176e+08}
  high-P-rate-constant: {A: 7.91e+10, b: 0.0, Ea: 2.3438768e+08}
  efficiencies: {AR: 0.625, C2H6: 3.0, CH4: 2.0, CO: 1.5, CO2: 2.0, H2: 2.0, H2O: 6.0}
```

The Chemkin version appears as follows:

```
N2O(+M) <=> N2+O(+M)   7.910E+10   .000   56020.00
LOW/ 6.370E+14   .000  56640.00/
H2/2.00/ H2O/6.00/ CH4/2.00/ CO/1.50/ CO2/2.00/ C2H6/3.00/ AR/ .625/
```

In this case, the A factor in the High remains unchanged, but the A factor in the Low differs by a factor of 1e3.

I understand that Cantera defaults to units of m, kmol, whereas Chemkin uses cm, mol, resulting in a 1000-fold difference. However, I am puzzled about the root cause of these inconsistencies and their potential impact on simulation results. With other mech, I also met such inconsistencies in pressure-dependent Arrhenius reactions, where some reactions exhibit a 1000-fold decrease in values of A factors at different pressures while others do not.

The conversion of Ea appears to be normal, always with a difference of 4184-fold.

cantera version: 3.0
python version: 3.9

Thank you for your assistance.

Ray Speth

unread,
Oct 9, 2023, 5:57:11 PM10/9/23
to Cantera Users' Group

Hi,

These rate constants are all as-expected. The trick to understanding this is knowing what the dimensions of the rate constant are in each case, and in particular that for falloff reactions, the high- and low-pressure rate constants have different units. The documentation for falloff reactions provides some insight here. In the high pressure limit, the reaction rate is independent of [M]. In your first example, the forward rate of reaction can be calculated as:

R_f = [H][CH2CO] A_\infty T^b \exp(T_a/T)

which means that A_\infty must have units of m^3/kmol/s and the conversion factor to cm^3/mol/s is 1000. In contrast, at the low pressure limit, the forward rate of reaction can be calculated as

R_f = [H][CH2CO][M] A_0 T^b \exp(T_a/T)

which means that A_0 must have units of m^6/kmol^2/s and the conversion factor to cm^6/kmol^2/s is 1,000,000.

You can repeat this exercise for the second reaction and will see that, since there is only a single reactant, the high-pressure rate has units of 1/s and a unity conversion factor, while the low pressure rate has units of m^3/kmol/s and a conversion factor of 1000.

Regards,
Ray

Yuan Fang

unread,
Oct 10, 2023, 9:15:11 AM10/10/23
to Cantera Users' Group
Hi Ray,

Your response was very timely and clear. Thank you!

Regards,
Yuan

zamaria krajewski

unread,
Dec 2, 2023, 6:26:36 PM12/2/23
to Cantera Users' Group
Hello, It is a great honor to have the opportunity to see two discussions on mechanisms,
which has recently led me to start learning cantera https://www.cantera.org/examples/python/kinetics/custom_reactions.py.html
 After study this code, I wanted to write my own YAML file on the reaction mechanism of methane and water vapor on the surface of Ni based materials, Methane and water both operate at 1000K with Ni based surface catalysts
but it was never successful. This is the code I wrote,

import cantera as ct


gas = ct.Solution('gri30.yaml')
surf_species = {'H2O', 'CH4', 'CO', 'H2'}


surf = ct.Interface('gri30.yaml', 'surface', [gas])


surf.add_reaction_from_string('H2O(S) + H(S) <=> H2O(S) + e')
surf.add_reaction_from_string('CH4(S) + H(S) <=> CH3(S) + H2(S)')
surf.add_reaction_from_string('CH4(S) + CH3(S) <=> CH3(S) + CH3(S)')


catalyst_sites = ct.Site(ct.SiteType.site_density, 1.e-5, 0.1)
catalyst = ct.Solution(thermo='ideal-gas', species=surf_species)
catalyst.TP = gas.TP


catalyst.set_multiplier(0.01, 'H2O(S)')
catalyst.set_multiplier(0.01, 'CH4(S)')


surf.coverages = {'H2O(S)': 0.01, 'CH4(S)': 0.01}
surf.coverages *= catalyst_sites


surf.write('ni_catalyst.yaml', 'surface', quiet=True)

At the same time, I also know that it is possible to convert through a chemkin file, but the conversion process has also encountered a series of problems, so now I want to write the mechanism file myself through cantera。
I have been writing this code for a week now. In fact, it is the reaction of water as a gas and methane as a gas on the Ni based surface to generate YAML file format。I hope to receive your help. Thank you very much
Regards,
rrcits

Ray Speth

unread,
Dec 21, 2023, 3:00:15 PM12/21/23
to Cantera Users' Group

Hi rrcits,

I’m confused by the syntax that you’re using in the example code provided. I don’t think Cantera has ever contained an add_reaction_from_string method or a Site class. What were you basing this code on? If you’re trying to create a standalone mechanism file, I think you should just write in the YAML format directly, rather than trying to construct the mechanism in Python and then write out the file. The option of doing this programmatically through the Python interface is mostly of use when the contents of the mechanisms are determined parametrically, rather than just representing a specific, fixed mechanism.

If you’re having trouble converting an existing Chemkin-format file, please share the input files and the error message you get. Otherwise, it’s quite difficult to provide any meaningful advice.

Regards,
Ray

Reply all
Reply to author
Forward
0 new messages