diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C index dbdc804d8b..f10a1ce48b 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ const ThermoType& Foam::multiComponentMixture::constructSpeciesData template void Foam::multiComponentMixture::correctMassFractions() { - // It changes Yt patches to "calculated" + // Multiplication by 1.0 changes Yt patches to "calculated" volScalarField Yt("Yt", 1.0*Y_[0]); for (label n=1; n::correctMassFractions() Yt += Y_[n]; } + if (mag(max(Yt).value()) < ROOTVSMALL) + { + FatalErrorIn + ( + "void Foam::multiComponentMixture::" + "correctMassFractions()" + ) + << "Sum of mass fractions is zero for species " << this->species() + << exit(FatalError); + } + forAll(Y_, n) { Y_[n] /= Yt;