ENH: Radiation P-1 model - added protection for divide by zero

This commit is contained in:
andy
2014-08-04 15:50:14 +01:00
committed by Andrew Heather
parent 116e3eec5a
commit 993895b048

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -217,6 +217,8 @@ void Foam::radiation::P1::calculate()
E_ = absorptionEmission_->E();
const volScalarField sigmaEff(scatter_->sigmaEff());
const dimensionedScalar a0 ("a0", a_.dimensions(), ROOTVSMALL);
// Construct diffusion
const volScalarField gamma
(
@ -228,7 +230,7 @@ void Foam::radiation::P1::calculate()
IOobject::NO_READ,
IOobject::NO_WRITE
),
1.0/(3.0*a_ + sigmaEff)
1.0/(3.0*a_ + sigmaEff + a0)
);
// Solve G transport equation