mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
chemkinReader: Add tolerance to element balance check
Patch provided by Daniel Jasinski Resolved bug-report http://www.openfoam.org/mantisbt/view.php?id=1843
This commit is contained in:
@ -753,10 +753,11 @@ void Foam::chemkinReader::addReaction
|
|||||||
|
|
||||||
forAll(nAtoms, i)
|
forAll(nAtoms, i)
|
||||||
{
|
{
|
||||||
if (mag(nAtoms[i]) > SMALL)
|
if (mag(nAtoms[i]) > imbalanceTol_)
|
||||||
{
|
{
|
||||||
FatalErrorIn("chemkinReader::addReaction")
|
FatalErrorIn("chemkinReader::addReaction")
|
||||||
<< "Elemental imbalance in " << elementNames_[i]
|
<< "Elemental imbalance of " << mag(nAtoms[i])
|
||||||
|
<< " in " << elementNames_[i]
|
||||||
<< " in reaction" << nl
|
<< " in reaction" << nl
|
||||||
<< reactions_.last() << nl
|
<< reactions_.last() << nl
|
||||||
<< " on line " << lineNo_-1
|
<< " on line " << lineNo_-1
|
||||||
@ -839,7 +840,8 @@ Foam::chemkinReader::chemkinReader
|
|||||||
specieNames_(10),
|
specieNames_(10),
|
||||||
speciesTable_(species),
|
speciesTable_(species),
|
||||||
reactions_(speciesTable_, speciesThermo_),
|
reactions_(speciesTable_, speciesThermo_),
|
||||||
newFormat_(newFormat)
|
newFormat_(newFormat),
|
||||||
|
imbalanceTol_(ROOTSMALL)
|
||||||
{
|
{
|
||||||
read(CHEMKINFileName, thermoFileName);
|
read(CHEMKINFileName, thermoFileName);
|
||||||
}
|
}
|
||||||
@ -855,7 +857,8 @@ Foam::chemkinReader::chemkinReader
|
|||||||
specieNames_(10),
|
specieNames_(10),
|
||||||
speciesTable_(species),
|
speciesTable_(species),
|
||||||
reactions_(speciesTable_, speciesThermo_),
|
reactions_(speciesTable_, speciesThermo_),
|
||||||
newFormat_(thermoDict.lookupOrDefault("newFormat", false))
|
newFormat_(thermoDict.lookupOrDefault("newFormat", false)),
|
||||||
|
imbalanceTol_(thermoDict.lookupOrDefault("imbalanceTolerance", ROOTSMALL))
|
||||||
{
|
{
|
||||||
if (newFormat_)
|
if (newFormat_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -77,7 +77,7 @@ public:
|
|||||||
gas
|
gas
|
||||||
};
|
};
|
||||||
|
|
||||||
//- Species element
|
//- species element
|
||||||
struct specieElement
|
struct specieElement
|
||||||
{
|
{
|
||||||
word elementName;
|
word elementName;
|
||||||
@ -211,6 +211,9 @@ private:
|
|||||||
//- Flag to indicate that file is in new format
|
//- Flag to indicate that file is in new format
|
||||||
Switch newFormat_;
|
Switch newFormat_;
|
||||||
|
|
||||||
|
//- Tolerance for element imbalance in a reaction
|
||||||
|
scalar imbalanceTol_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user