Cantera Error Thrown by Plog::validate

1,083 views
Skip to first unread message

carlos_...@brown.edu

unread,
Jul 23, 2014, 5:16:37 PM7/23/14
to canter...@googlegroups.com
Hi all,
I am attempting to use a cti mechanism with Cantera in Python to compute some post reflected shockwave velocities/properties. However I am getting an error from the Cantera RxnRates.h file under the kinetics include folder and it looks like this:

***********************************************************************
CanteraError thrown by Plog::validate:
Invalid rate coefficient for reaction #129:
C2H5 + O2 <=> C2H4 + HO2
at P = 10.1325, T = 1
***********************************************************************


Due to certain rights on the mechanism file I am using I am unable to post the actual file. But in the mechanism file, I have reaction that uses pdep_arrhenius(....) and thus logarithmic interpolation between pressures is needed to calculate a rate constant. Now back to the error, I am a little confused as to why Cantera is evaluating the rate constant for such low Temperature, in this case 1 K. Is there a way I can have Cantera only perform this validation on a narrower Temperature range so that I do not get this error? If there is anymore information that would be useful please let me know and I will clarify.
-Carlos

Bryan W. Weber

unread,
Jul 24, 2014, 9:03:39 AM7/24/14
to canter...@googlegroups.com
Hi Carlos,

What are you doing when this error is thrown? Can you post the parameters for just this reaction?

Bryan

carlos_...@brown.edu

unread,
Jul 24, 2014, 10:08:11 AM7/24/14
to canter...@googlegroups.com
Sure. The portion of the mechanism that is throwing the error is the following:

# Reaction 130
pdep_arrhenius('C2H5 + O2 <=> C2H4 + HO2',
               [(0.0001, 'atm'), 3.180000E+17, -2.5, -54.4],
               [(0.0001, 'atm'), 2.420000E+02, 2.5, -3061.0],
               [(0.0003, 'atm'), 1.060000E+18, -2.65, 201.3],
               [(0.0003, 'atm'), 3.480000E+02, 2.46, -2914.0],
               [(0.001, 'atm'), 3.070000E+18, -2.76, 590.3],
               [(0.001, 'atm'), 6.650000E+02, 2.38, -2585.0],
               [(0.003, 'atm'), 6.200000E+18, -2.81, 1032.0],
               [(0.003, 'atm'), 1.360000E+03, 2.3, -2165.0],
               [(0.01, 'atm'), 2.390000E+19, -2.94, 1733.0],
               [(0.01, 'atm'), 1.730000E+03, 2.28, -1900.0],
               [(0.03, 'atm'), 1.240000E+17, -2.09, 1693.0],
               [(0.03, 'atm'), 1.470000E+06, 1.51, 2089.0],
               [(0.1, 'atm'), 1.200000E+12, -0.05, 9857.0],
               [(0.1, 'atm'), 1.560000E+15, -1.39, 1933.0],
               [(0.3, 'atm'), 4.350000E+21, -2.58, 21610.0],
               [(0.3, 'atm'), 1.250000E+14, -0.98, 2327.0],
               [(1.0, 'atm'), 6.850000E+23, -3.99, 7061.0],
               [(1.0, 'atm'), 3.420000E+03, 2.23, -499.0],
               [(3.0, 'atm'), 6.200000E+26, -4.8, 9713.0],
               [(3.0, 'atm'), 4.540000E+04, 1.92, 510.7],
               [(10.0, 'atm'), 6.630000E+27, -4.96, 12160.0],
               [(10.0, 'atm'), 1.310000E+04, 2.09, 1028.0],
               [(30.0, 'atm'), 4.740000E+25, -4.19, 13000.0],
               [(30.0, 'atm'), 1.150000E+02, 2.69, 867.2],
               [(100.0, 'atm'), 4.850000E+22, -3.18, 13650.0],
               [(100.0, 'atm'), 1.600000E+00, 3.19, 728.7],
               options='duplicate')


More information as to what I am trying to do here. What I am trying to do is simulate a shocktube reaction where a shockwave is used to significantly raise the temperature and pressure of a gas mixture. What I have is a python module that calculates the thermo data (temperature and pressure)  of the gas mixture that results from the shockwave exitation. The temperature range that the gas is experiencing ranges from room temperature all the way up to about 2000 K. So what I am wondering is if there is a way to have the Plog::vaildate cantera error check not check the Plog interpolation for low temperatures below my range of interest or at least disable this check. Even better, I would like to know why exactly this error is thrown. According to the printed error, it fails at a check of 10.1325 Pa and 1 Kevin.

-Carlos


Ray Speth

unread,
Jul 24, 2014, 12:14:03 PM7/24/14
to canter...@googlegroups.com
Hi Carlos,

The error comes from evaluating the second Arrhenius expression at T = 1 K, where evaluating exp(-Ea/RT) results in an overflow (the value becomes "infinity") which causes errors in trying to evaluate the rate expression. Of course, this expression won't overflow at more reasonable temperatures. The problematic cases I'd seen before were ones where one of the rate expressions had a negative A-factor, which leads to errors when trying to do the logarithmic interpolation between pressures. In those cases, the selection of temperatures to test wasn't that important, so even a value like 1 K was fine as a test. I will make changes to this validation to use a set of temperatures less likely to cause problems, but in the mean time, you can add the following line to your CTI file to disable the reaction validation:

validate(reactions='no')

Regards,
Ray

carlos_...@brown.edu

unread,
Jul 24, 2014, 12:24:29 PM7/24/14
to canter...@googlegroups.com
Hi Ray, where in the cti file should this line be placed?
-Carlos

Ray Speth

unread,
Jul 24, 2014, 12:35:51 PM7/24/14
to canter...@googlegroups.com
Carlos,

It's a top-level expression, e.g. the same as the units(...) function. It applies globally to all phases defined in that CTI file; the order doesn't matter.

Regards,
Ray

carlos_...@brown.edu

unread,
Jul 28, 2014, 9:33:35 AM7/28/14
to canter...@googlegroups.com
Hi Ray, sorry to bother you again but I was wanting to know if there is an option to turn off the negative A-factor error check. I have two reactions that are duplicates, so the sum of the two rate constants will be used to determine an effective rate constant. However, based on my data the best fit requires me to have a negative A-factor in one of the reactions. Is there a way I can pass the mechanism through Cantera without it throwing an error about having negative A-coefficients int eh mechanism data?
-Carlos

Ray Speth

unread,
Jul 28, 2014, 12:00:06 PM7/28/14
to canter...@googlegroups.com
Carlos,

Yes, there is an option to do this, for exactly the case you described, which is the 'negative_A' option on the reaction (documentation). For example:

reaction("NH + NO <=> N2O + H", [2.94000E+14, -0.4, 0],
         options=["duplicate"])
reaction("NH + NO <=> N2O + H", [-2.16000E+13, -0.23, 0],
         options=["negative_A", "duplicate"])

Regards,
Ray

ahfaz ahmed

unread,
Apr 19, 2016, 3:20:42 PM4/19/16
to Cantera Users' Group
Hi Ray 

I have encountered a similar error and I also tried the ways to make it go : options=["negative_A", "duplicate"]) and validate(reactions='no').

The error is not going away.

Procedure: Plog::validate
Error:   Invalid rate coefficient for reaction #13727:
CYC5H9 + O2 <=> CPT1Q2J
at P = 99.9976, T = 1

I am using cantera on matlab

Here is the section in CTI its pointing to

# Reaction 13727
pdep_arrhenius('CYC5H9 + O2 <=> CPTO2J',
               [(0.0009869, 'atm'), 2.570000e+197, -53.25, 130200.0],
               [(0.0009869, 'atm'), 1.880000e+53, -13.74, 8629.0],
               [(0.009869, 'atm'), 1.900000e+47, -11.49, 8243.0],
               [(0.009869, 'atm'), 6.050000e+43, -12.22, 1122.0],
               [(0.09869, 'atm'), 6.110000e+42, -9.79, 8192.0],
               [(0.09869, 'atm'), 1.400000e+132, -41.32, 23220.0],
               [(0.9869, 'atm'), 1.440000e+35, -7.2, 6727.0],
               [(0.9869, 'atm'), 1.190000e+87, -25.73, 14280.0],
               [(9.869, 'atm'), 2.600000e+26, -4.38, 4195.0],
               [(9.869, 'atm'), 7.160000e+69, -19.85, 10690.0],
               [(98.69, 'atm'), 5.620000e+21, -2.85, 3218.0],
               [(98.69, 'atm'), 5.570000e+40, -9.81, 4793.0])
#  fit btw. 300 and 1100 K with MAE of 6.3%, 15.2%
#  fit btw. 300 and 1200 K with MAE of 8.2%, 25.7%
#  fit btw. 300 and 1300 K with MAE of 6.0%, 20.5%
#  fit btw. 300 and 1500 K with MAE of 5.5%, 20.0%
#  fit btw. 300 and 1800 K with MAE of 5.5%, 19.1%
#  fit btw. 300 and 2000 K with MAE of 2.8%, 10.1%
# CPTO2J=>CYC5H9+O2 1.09E+24       -3.04    35390.0
#   PLOG/9.869E-04    3.33E+50      -15.01    31840.0/
#   PLOG/9.869E-04    3.76E+57      -14.42    42850.0/                            ! fit btw. 300 and 1100 K with MAE of 7.6%, 26.5%
#   PLOG/9.869E-03    4.36E+53      -12.84    43000.0/
#   PLOG/9.869E-03    1.83E+203      -65.45    69570.0/                           ! fit btw. 300 and 1200 K with MAE of 7.3%, 25.4%
#   PLOG/9.869E-02    2.30E+49      -11.20    43060.0/
#   PLOG/9.869E-02    6.02E+130      -40.03    56260.0/                           ! fit btw. 300 and 1300 K with MAE of 6.0%, 20.1%
#   PLOG/9.869E-01    1.13E+42       -8.71    41750.0/
#   PLOG/9.869E-01    3.86E+88      -25.43    47910.0/                            ! fit btw. 300 and 1500 K with MAE of 5.5%, 20.0%
#   PLOG/9.869E+00    3.32E+33       -5.95    39330.0/
#   PLOG/9.869E+00    1.23E+72      -19.79    44470.0/                            ! fit btw. 300 and 1800 K with MAE of 5.6%, 19.7%
#   PLOG/9.869E+01    2.92E+29       -4.59    38760.0/
#   PLOG/9.869E+01    9.95E+42       -9.75    38600.0/                            ! fit btw. 300 and 2000 K with MAE of 2.8%, 9.8%

Ray Speth

unread,
Apr 19, 2016, 11:02:35 PM4/19/16
to Cantera Users' Group
Hi,

You are apparently using an outdated version of Cantera. Please update to the latest release (2.2.1) which contains a fix for this problem.

Regards,
Ray

Mark Fuller

unread,
Jul 19, 2017, 3:26:57 PM7/19/17
to Cantera Users' Group
Hi all,
I am working with version 2.3.0 and have an unpublished mechanism that I am trying to convert which gives a similar error:


***********************************************************************
CanteraError thrown by Plog::validate:
Invalid rate coefficient for reaction 'C2H3 + CH2O <=> C2H4 + HCO'
at P = 101.325, T = 200
***********************************************************************

I have attempted to update my cti file with validate(reactions='no') , which I have placed one line above and one line below the "units" line at the start of the file without success.
There is also a thermo discontinuity warning that is being shown when I load the cti file - that is also not going away when I add "species='no'" to the validate argument.
I'm guessing this means I'm doing it wrong. Can anyone advise as to more specifically how I should manipulate the cti file to get it to run? I'm not interested in 200 K - ideally I would adjust the validation temperature range to fit the range I'm trying to model, but the previous comments don't make it appear as though it were a user option.

Thank you

Ray Speth

unread,
Jul 19, 2017, 6:27:30 PM7/19/17
to Cantera Users' Group
Mark,

There is currently no way to turn off this validation. The "validate(reactions='no')" option only affects the check for duplicate reactions. As far as I know, the "species='no'" option does not do anything.

Regards,
Ray

Mark Fuller

unread,
Feb 1, 2018, 3:01:08 PM2/1/18
to Cantera Users' Group
I am attempting now to address a validate error for a duplicate reaction with negative A.
I have a MWE that properly loads when the negative A reaction is commented out (as in the uploaded version), but does when uncommented.
I checked the numbers and I do not believe the sum of the reaction rates is ever negative

I am running Cantera 2.3.0 on Fedora 27

Thanks
negA_mwe.cti

Ray Speth

unread,
Feb 1, 2018, 9:40:33 PM2/1/18
to Cantera Users' Group

Hi Mark,

The way to write this is as a single reaction with multiple rate expressions at each pressure, rather than as two separate reactions. For example:

pdep_arrhenius('C2H3 + CH2O <=> C2H4 + HCO',
               [(0.001, 'atm'), 1.100000e+07, 1.09, 1807.0],
               [(0.001, 'atm'), -2.300000e+16, -1.269, 20617.0],
               [(0.01, 'atm'), 2.500000e+07, 0.993, 1995.0],
               [(0.01, 'atm'), -5.200000e+16, -1.366, 20805.0],
               [(0.1, 'atm'), 2.500000e+08, 0.704, 2596.0],
               [(0.1, 'atm'), -1.500000e+18, -1.769, 22524.0],
               [(1.0, 'atm'), 1.400000e+10, 0.209, 3934.0],
               [(1.0, 'atm'), -8.500000e+19, -2.264, 23862.0],
               [(10.0, 'atm'), 3.500000e+13, -0.726, 6944.0],
               [(10.0, 'atm'), -4.400000e+23, -3.278, 27795.0],
               [(100.0, 'atm'), 3.300000e+14, -0.866, 10966.0],
               [(100.0, 'atm'), -4.200000e+24, -3.418, 31817.0],
               [(1000.0, 'atm'), 1.700000e+01, 3.17, 9400.0],
               [(1000.0, 'atm'), -2.100000e+11, 0.618, 30251.0])

Regards,
Ray

Mark Fuller

unread,
Feb 2, 2018, 10:05:23 AM2/2/18
to Cantera Users' Group
Thanks - that change allows my file to load and run.
Does this mean, however, that the ['duplicate','negative_A'] format is deprecated?
Should the documentation be updated to reflect this?

Ray Speth

unread,
Feb 5, 2018, 12:37:32 AM2/5/18
to Cantera Users' Group

Mark,

No, nothing has changed regarding the duplicate or negative_A options. That approach is still applicable to reactions that are written as a set of elementary reactions (i.e. each with just a single rate expression).

Although I have seen reactions written this way in numerous mechanisms, I believe that writing separate “plog” reactions with the different sets of rate constants does not do the interpolation in the intended way. All the rate constants at a particular pressure should be evaluated and added together, and then the interpolation in pressure should be done. However, writing the reactions as independent, duplicate reactions causes these steps to be done in the reverse order, which gives a different result, notably in the case of negative A factors where it simply can’t be done.

Regards,
Ray

Chikpezili Ajulu

unread,
Jul 15, 2019, 6:45:06 PM7/15/19
to Cantera Users' Group
Hi Ray,

I ran into the same error for my n-heptane model from RMG. When I try to convert to .cti file it throws this error:

(flame_env) [ajulu.c@login-01 chemkin]$ ck2cti --input=chem_annotated.inp --transport=tran.dat 
Wrote CTI mechanism file to 'chem_annotated.cti'.
Mechanism contains 312 species and 6067 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 Plog::validate:
Invalid rate coefficient for reaction 'C2H3O2(47) <=> CH3(19) + CO2(7)'
at P = 1.01325e+07, T = 500
***********************************************************************

Is it possible that I can do what you suggested, validate(reactions='no')in the .cti file header and it passes ? 

Regards,

Chikpezili 

Bryan W. Weber

unread,
Jul 15, 2019, 8:21:04 PM7/15/19
to Cantera Users' Group
Chikpezili,

Almost always, this means that there is a negative A factor in that particular reaction at that pressure. If the reaction rate becomes negative, the log is undefined, so avoiding validation will not solve the problem. There are a few other recent posts on this same topic.

Best,
Bryan
Reply all
Reply to author
Forward
0 new messages