ENH: Radiation P-1 model - added protection for divide by zero
This commit is contained in:
parent
9cc6cd612a
commit
4052d2fec0
1 changed files with 4 additions and 2 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
|
|
@ -217,6 +217,8 @@ void Foam::radiation::P1::calculate()
|
||||||
E_ = absorptionEmission_->E();
|
E_ = absorptionEmission_->E();
|
||||||
const volScalarField sigmaEff(scatter_->sigmaEff());
|
const volScalarField sigmaEff(scatter_->sigmaEff());
|
||||||
|
|
||||||
|
const dimensionedScalar a0 ("a0", a_.dimensions(), ROOTVSMALL);
|
||||||
|
|
||||||
// Construct diffusion
|
// Construct diffusion
|
||||||
const volScalarField gamma
|
const volScalarField gamma
|
||||||
(
|
(
|
||||||
|
|
@ -228,7 +230,7 @@ void Foam::radiation::P1::calculate()
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
1.0/(3.0*a_ + sigmaEff)
|
1.0/(3.0*a_ + sigmaEff + a0)
|
||||||
);
|
);
|
||||||
|
|
||||||
// Solve G transport equation
|
// Solve G transport equation
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue