Pairwise interaction term for superquadric particles in LIGGGHTS

Submitted by RonMexico on Tue, 01/19/2021 - 18:44

I have made a similar post in the user forum (https://www.cfdem.com/forums/stressatom-superquadric-particles), but since this now appears to be a bug, this seems to be the more appropriate forum.

I have a simple case of a few particles inside of a periodic domain. I use the granular formulation and the superquadric formulation with spherical particles of the same diameter. The output compute stress/atom and compute pressure do not match between simulations during the time of the pairwise interaction only. My guess is that there is a bug in the pairwise interaction output code for superquadric particles. The forces and positions are identical throughout both simulations, which means it is also only an output error and does not seem to affect the particle trajectories.

I am attaching both of my input files for reference.

Thanks!

yx_zou | Mon, 10/11/2021 - 04:02

I also found this bug. Have you found a solution?

RonMexico | Wed, 11/03/2021 - 18:38

You could dig in the source code to see if you find where the problem is and report back here. I was documenting the problem at the time for the developers. My understanding of the code is not yet where I can quickly determine the source of a bug.

Kashminder | Fri, 12/03/2021 - 22:32

I was wondering if anyone can share the structure of the data file or the actual data file for superquadric particles

JacopoB | Thu, 07/11/2024 - 19:14

Hi.

Thank you for sharing the scripts to quickly test the code.
I can confirm the bug is present in the release version of Ligggths.
I do not know if this is still of interest but I think I have found where it originates after a but of debugging.

It seems fairly easy to solve.
In the file pair_gran_base.h you need to move the lines
sidata.delta[0] = delx;
sidata.delta[1] = dely;
sidata.delta[2] = delz;

after
cmodel.endSurfacesIntersect(sidata, 0, i_forces, j_forces);

This is because, the functions that check if two superquadric particles intersect with each other overwrite the surface intersection data (sidata.delta).
Apparently, this is not the case for granular particles.

I will try to fix it by raising the issue on github and pushing the code, if the developers allow.

Best,
Jacopo