Skip to content
Snippets Groups Projects
Commit 993895b0 authored by andy's avatar andy Committed by Andrew Heather
Browse files

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

parent 116e3eec
Branches
Tags
No related merge requests found
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment