IBVoidFraction bug (w/ fix)

Nucleophobe's picture
Submitted by Nucleophobe on Fri, 03/04/2016 - 00:24

Hi again,

I have a minor bug to report for the void fraction model 'IBVoidFraction'.

If the fluid-particle interface intersects exactly with a cell center in the CFD mesh, the void fraction is not calculated correctly and is instead set to '1' (i.e., fluid). This occurs because the lambda value returned is exactly '0' (e.g., see lines 162 -- 180).

The bug can be fixed by simply changing the comparators in 'IBVoidFraction.C' at lines 156, 160, and 371 from:
if(centreDist<radius && centreVertexDist<radius)
else if(centreDist<radius && centreVertexDist>radius)
and
if (centreDist < radius){

to:
if(centreDist<=radius && centreVertexDist<=radius)
else if(centreDist<=radius && centreVertexDist>radius)
and
if (centreDist<=radius){
.

I have attached a minimum working example with some images.

Thanks,
-Nuc