From 8a00315137bd1c4b88ca68a5d07450aae5ea693e Mon Sep 17 00:00:00 2001 From: Henry Date: Thu, 14 May 2015 18:51:26 +0100 Subject: [PATCH] ReversibleReaction: Protect against /0 --- .../ReversibleReaction/ReversibleReaction.C | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C b/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C index d23d674c4e..4ec61e8e5f 100644 --- a/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C +++ b/src/thermophysicalModels/specie/reaction/Reactions/ReversibleReaction/ReversibleReaction.C @@ -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; + } }