Skip to content

ck2yaml doesn't set third_body when parsing A+B+M reactions #800

@rwest

Description

@rwest

When parsing these reactions

H+CH2+M=CH3+M			 6.E14		 0.0		0.0
H+CH2(+M)<=>CH3(+M)                      6.0E+14     .000        .00
     LOW  /  1.040E+26   -2.760   1600.00/
     TROE/   .5620  91.00  5836.00  8552.00/

it seems that ck2yaml will interpret them both as pressure dependent and set pressure_dependent=True on both, but will only set the third_body attribute to M in the second reaction (the first reaction will have third_body=None).

When running through check_duplicate_reactions it will then reach the lines

                elif (r1.third_body.upper() == 'M' and
                      r1.kinetics.efficiencies.get(r2.third_body) == 0):

and give an AttributeError: 'NoneType' object has no attribute 'upper' because r1.third_body is None.

Presumably the fix is for the parsing of the first reaction to set third_body='M' ??

But putting

                if kind == 'third-body':
                    third_body = True
                    falloff3b = 'M'  # <<<< new line

in the parse_expression method means we're setting a variable named "fall-off third body" for something that's technically not a "fall off" reaction. And may have other issues.

Or is the answer to change how check_duplicate_reactions works?

Should

H+CH2+M=CH3+M			6.E14		 0.0		0.0
H+CH2(+M)<=>CH3(+M)                      6.000E+14     .000        .00
     LOW  /  1.040E+26   -2.760   1600.00/
     TROE/   .5620  91.00  5836.00  8552.00/

be considered duplicates anyway?

I know that Cantera does not consider these to be duplicates:

H+CH2=CH3			6.E14		 0.0		0.0
H+CH2(+M)<=>CH3(+M)                      6.000E+14     .000        .00

System information

  • Cantera version: 2.4
  • OS: Mac OS X
  • Python: Python 3.7

Attachments
mechanism.txt
thermo.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions