mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: distributionModels::general: avoid zero-division errors
This commit is contained in:
committed by
Andrew Heather
parent
0aa44f2b9b
commit
aeda015a78
@ -78,7 +78,7 @@ void Foam::distributionModels::general::initialise()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// normalize the distribution
|
// normalize the distribution
|
||||||
scalar sumArea = integral_.last();
|
const scalar sumArea = integral_.last();
|
||||||
|
|
||||||
for (label i = 0; i < nEntries_; ++i)
|
for (label i = 0; i < nEntries_; ++i)
|
||||||
{
|
{
|
||||||
@ -86,8 +86,8 @@ void Foam::distributionModels::general::initialise()
|
|||||||
integral_[i] /= sumArea + eps;
|
integral_[i] /= sumArea + eps;
|
||||||
}
|
}
|
||||||
|
|
||||||
meanValue_ /= sumArea;
|
meanValue_ /= sumArea + eps;
|
||||||
meanValue_ = cumulative_ ? (maxValue_ - meanValue_ + eps) : meanValue_;
|
meanValue_ = cumulative_ ? (maxValue_ - meanValue_) : meanValue_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user