mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ReversibleReaction: Protect against /0
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -144,7 +144,16 @@ Foam::scalar Foam::ReversibleReaction
|
||||
const scalarField& c
|
||||
) const
|
||||
{
|
||||
return kfwd/this->Kc(p, T);
|
||||
scalar Kc = this->Kc(p, T);
|
||||
|
||||
if (mag(Kc > VSMALL))
|
||||
{
|
||||
return kfwd/Kc;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user