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

Segmentation fault when reading erroneous mechanisms without transport data #312

Closed
thomasfiala opened this issue Nov 23, 2015 · 2 comments

Comments

@thomasfiala
Copy link
Contributor

When reading an erroneous mechanism (both .cti or .xml) that doesn't include transport parameters but shows a transport = 'Mix' or transport = 'Multi'` flag, Cantera returns a segmentation fault. Probably, there should be a warning instead.

Example: Mechanism:

units(length = "cm", time = "s", quantity = "mol", act_energy = "cal/mol")

ideal_gas(
      name = "gas",
      elements = " H ",
      species = """ H """,
      reactions = "all",
      transport="Mix",  # also returns segfault for "Multi"
      initial_state = state(temperature = 300.0, pressure = OneAtm)
      )

#-------------------------------------------------------------------------------
#  Species data 
#-------------------------------------------------------------------------------

species(
    name = "H",
    atoms = " H:1 ",
    thermo = (
       NASA( [  300.00,  1000.00], [  2.500000000E+00,   0.000000000E+00, 
                0.000000000E+00,   0.000000000E+00,   0.000000000E+00,
                2.547163000E+04,  -4.601176000E-01] ),
       NASA( [ 1000.00,  5000.00], [  2.500000000E+00,   0.000000000E+00, 
                0.000000000E+00,   0.000000000E+00,   0.000000000E+00,
                2.547163000E+04,  -4.601176000E-01] )
             ),
    #transport=gas_transport(geom='atom', diam=2.05, well_depth=145.0)
    #no error is returned if transport data is not commented out
    )
@bryanwweber
Copy link
Member

Hi Thomas,
Can you provide a few more details to reproduce the segfault? I use mechanisms all the time that have no transport info, and I have no trouble. I use them for homogeneous cases, so no Transport is necessary - is the segfault showing when you use this kind of mechanism in a 1D case?

@thomasfiala
Copy link
Contributor Author

The problem is that the mechanism shows a transport='Mix' or transport='Multi' flag. If you comment that out, the mechanism loads just fine. (I updated the description for this information.)

The segfault occurs when loading the mechanism. In python, a simple gas = ct.Solution('mech_test.cti') will do.

The error was brought up by a colleague of me who used an erroneous chemkin mechanism for a 1D flame.

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

2 participants