mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Radiation P-1 model - added protection for divide by zero
This commit is contained in:
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user