Skip to content

Error tracking a particle when the containing cell is unrefined (DPMDyMFoam)

Summary

OpenFOAM crashes when the mesh is unrefined using DPMDyMFoam. It happens when any level+1 cell containing a particle is unrefined 1 level. The error message is:

FOAM FATAL ERROR: (openfoam-2012) Cell not found for particle position (-0.0056421567 -0.081679551 -0.0117107).

Steps to reproduce

Steps: 1 - blockMesh (the grid is simple but parametrized, so it will take 1 min).

2 - DPMDyMFoam.

3 - Stop after time 0.005 is reached (1 - 2 mins) and the solution is saved.

4 - Use a higher unrefinement value (dynamicMeshDict --> lowrefinementlevel 2; unrefinementlevel 1;

5 - Run DPMDyMFoam again and the error presets itself after unrefinement.

Example case

bugDPMDyMFoam.zip

generalScheme.pdf

I have provided a case. The particles are injected in the primary jet (see pdf), which also contains air.

What is the current bug behaviour?

What is the expected correct behavior?

Relevant logs and/or images

Environment information

  • OpenFOAM version : v2012 (Also present in V1912 and V1706
  • Operating system : ubuntu
  • Hardware info :
  • Compiler : precompiled

Possible fixes

To fix:

in "void Foam::particle::locate" --> change "const label celli," for "label celli,"

and modify the rest of the code to:

// Find the cell, if it has not been given if (celli < 0) { celli = mesh_.cellTree().findInside(position);

}
if (celli < 0)   // replaced celli_ with celli  
{   
    FatalErrorInFunction
        << "Cell not found for particle position " << position << "."
        << exit(FatalError);
}
celli_ = celli; // moved this definition to the bottom 
Edited by Jairo Andrés Gutiérrez