View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000657 | OpenFOAM | Bug | public | 2012-10-04 17:02 | 2013-02-25 18:35 |
Reporter | Assigned To | henry | |||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Linux 2.6.32-279.2.1.el6.x86_64 | OS | Red Hat Enterprise Linux | OS Version | 6.3 |
Summary | 0000657: Reaction rate calculation causes sigFpe when nMoles == SMALL is used in K(T) | ||||
Description | When species are added together (for mixtures) nMoles is clipped to be SMALL when they should be 0 to avoid numerical issues. In specieThermoI.H, the Kc(T) and Kn(T) functions guard against using this artificially clipped value when calculating Kc or Kn. However, K(T) does not guard against this. Because of the way the JANAF coefficients are combined, very large coefficients can result for mixtures of "zero" species (see henry's comment 0000764 in bug 0000327 showing the size of the H2 coefficients). This can result in K(T) = very small (10^-60 in my case) when it really should be 1, which crashes the calculation of the reverse reaction rates (kr = kf / Kc(T)). I suggest adding a guard in specieThermo::K(const scalar T) as: if (equal(this->nMoles(), SMALL)) { return 1.0; //exp(0) = 1 } else { scalar arg = -this->nMoles()*this->g(T)/(this->RR*T); if (arg < 600.0) { return ::exp(arg); } else { return VGREAT; } } | ||||
Additional Information | To make sure this wasn't the same issue as in Bug 0000327 I used species which all had the same value for Tcommon. | ||||
Tags | No tags attached. | ||||
|
Thanks for the bug report and suggested fix. Resolved by commit 607fe3a131a7c8d61be49dedc3209e33d98e6ca2 |
|
The proposed fix is erroneous. For example try running the tutorial OpenFOAM-2.1.x/tutorials/combustion/chemFoam/gri The change has been reverted pending an acceptable change. |