engineSearchIB Bugs (w/ fixes) - cfdemSolverIB

Nucleophobe's picture
Submitted by Nucleophobe on Thu, 03/03/2016 - 19:50

Hi,

First, thank you to everyone involved with the CFDEM®project for your hard work. Dr. Hager, your fictitious domain solver has been particularly helpful for my Ph.D. research.

There are a couple of bugs in the locate model 'engineSearchIB' that lead to an incorrect generation of the satellite points. Thus, when a particle resides on two or more processors, part of the particle may be 'missed'. In my experience, this can lead to large errors in the particle pathlines in some cases.

I am uploading a minimal working example along with fixed source code for 'engineSearchIB.C'. Here is a video of the minimal working example that illustrates the problem:
https://vimeo.com/157622304

The two bugs in 'engineSearchIB.C' are as follows:

  1. On line 127:
    scalar theta, phi, thetaSize=180/zSplit_,phiSize=360/xySplit_, factor=M_PI/180.;
    should be:
    scalar theta, phi, thetaSize=180./zSplit_,phiSize=360./xySplit_, factor=M_PI/180.;
    Notice the decimal places after 180 and 360. Without the decimal places, the calculations are evaluated using integer division. For small zSplit and xySplit, the bug only has a small effect. However, for larger zSplit and xySplit values, a 'gap' in the satellite points appears.
  2. On line 137:
    theta=factor*thetaSize*thetaLevel;
    should be:
    theta=factor*thetaSize*(thetaLevel+1);
    As originally implemented, the first 'thetaLevel' resides at a pole (resulting in repetition of the same point) and the last 'thetaLevel' is not considered.

See the attached PNG files for an illustration of the erroneous satellite points that are generated with the old code (also, python code in 'Summary' and images in 'Summary/Results').

I also added some code to 'cfdemSolverIB' to check the volume of the particles at each timestep (see 'src' directory), which might be useful for catching future bugs.

I hope this helps others that are using the fictitious domain solver 'cfdemSolverIB'.

-Nuc

Nucleophobe's picture

Nucleophobe | Thu, 03/03/2016 - 23:21

Thanks for confirming, Daniel.

I'll check the developer updates in the future.