mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: multiComponentMixture: fixes #2206
- added bit of tolerance - write difference
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2021 OpenCFD Ltd.
|
Copyright (C) 2021-2022 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -64,15 +64,23 @@ void Foam::multiComponentMixture<ThermoType>::correctMassFractions()
|
|||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Sum of mass fractions is zero for species " << this->species()
|
<< "Sum of mass fractions is zero for species " << this->species()
|
||||||
|
<< nl
|
||||||
|
<< incrIndent << indent
|
||||||
|
<< "Min of mass fraction sum " << min(Yt).value()
|
||||||
|
<< decrIndent
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mag(max(Yt).value()) != scalar(1))
|
const scalar diff(mag(max(Yt).value()) - scalar(1));
|
||||||
|
|
||||||
|
if (diff > ROOTVSMALL)
|
||||||
{
|
{
|
||||||
WarningInFunction
|
WarningInFunction
|
||||||
<< "Sum of mass fractions is different from one for species "
|
<< "Sum of mass fractions is different from one for species "
|
||||||
<< this->species()
|
<< this->species()
|
||||||
<< nl;
|
<< nl << incrIndent << indent
|
||||||
|
<< "Max of mass fraction sum differs from 1 by " << diff
|
||||||
|
<< decrIndent << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(Y_, n)
|
forAll(Y_, n)
|
||||||
|
|||||||
Reference in New Issue
Block a user