View Issue Details

IDProjectCategoryView StatusLast Update
0001314OpenFOAMBugpublic2014-06-06 10:23
Reporteruser941Assigned Towill  
PrioritynormalSeveritytrivialReproducibilityhave not tried
Status resolvedResolutionfixed 
Platformx86_64OSopensuseOS Version12.1
Summary0001314: sigsegv in reactingfoam for single species reaction
Descriptioncomputing reactions involving only two species leads to segmentation fault.

e.g. reaction
reactants = products
Steps To Reproducerun reactingfoam with the following simple reaction

reaction
    {
        type irreversibleArrheniusReaction;
        reaction "rectants = products";
        A 1.04e5;
        beta 1;
        Ta 10800;
    }
Additional InformationIn function omega in chemistryModel.C on lines 191 and 234 a loop over some array starts at 1. Apparently the array is shorter for such simple reactions above.

TagsNo tags attached.

Activities

will

2014-06-05 12:01

manager   ~0003102

The loops seem correct to me. The index is set to zero and then the loop starts from 1. The loop picks the index of smallest concentration involved in the reaction. If the number of reactants/products is one, the loop is never entered, and the zero index is retained by default.

I've modified the counterFlowFlame2D case to use just an "A = B" type reaction, and it runs fine. The segfault may be from somewhere else. Could you please upload a small case which fails?

user941

2014-06-05 13:35

 

counterFlowFlame2D.zip (11,246 bytes)

user941

2014-06-05 13:37

  ~0003104

OK. I've done the same thing as you did. Additionally I remove all other species.
Now I get a sigfpe from the chemistryreader.
Note that if you add N2 back into the species section of the reactions file it'll work.

will

2014-06-05 14:40

manager   ~0003105

Your two species are both set to zero. Multi-component thermo normalises the fractions by dividing by the total fraction. In this case, that results in a divide by zero error.

The error is a floating point error (sigFpe) and not a segfault (sigSegv).

Is this the same error as your original case? If so, there doesn't appear to be a bug here.

user941

2014-06-05 15:18

 

duct.zip (9,968 bytes)

user941

2014-06-05 15:23

  ~0003106

First of all thank you for the immediate response.

OK. I set up another test case. as simple as possible.
It runs fine with just 2 species. Please ignore any warnings from janaf thermo.

However, I get sigfpe from the chemistryReader if I use constant transport and thermo packages.

user941

2014-06-05 15:34

  ~0003107

By the way, the very same case runs fine with OF-2.1.x

will

2014-06-06 10:23

manager   ~0003109

There was a bug. Reaction.C creates a thermo for RHS minus LHS of the reaction, so it can calculate changes in enthalpy/free energy/etc... It was also creating a transport model, which it doesn't need. The mixing rules for the transport models can divide by zero if the left and right hand sides are identical, as is the case with your "A = B" reaction.

Commit 645a94ec380c54329c3510083532acd73bee2381 fixes this. The reaction class now only creates the thermo, and not the transport. Thanks for the report.

Issue History

Date Modified Username Field Change
2014-06-05 10:51 user941 New Issue
2014-06-05 12:01 will Note Added: 0003102
2014-06-05 13:35 user941 File Added: counterFlowFlame2D.zip
2014-06-05 13:37 user941 Note Added: 0003104
2014-06-05 14:40 will Note Added: 0003105
2014-06-05 15:18 user941 File Added: duct.zip
2014-06-05 15:23 user941 Note Added: 0003106
2014-06-05 15:34 user941 Note Added: 0003107
2014-06-06 10:23 will Note Added: 0003109
2014-06-06 10:23 will Status new => resolved
2014-06-06 10:23 will Resolution open => fixed
2014-06-06 10:23 will Assigned To => will