Write radial distribution function code, and the result is divergent

Hello everyone, I tried to write the radial distribution function with reference to the literature of chiavol et al.(2013), but when the written rdf.f was used in the calculation example, it diverged at 0.0069s. When I did not change DG_ 0DNU, the example seems to be in progress smoothly. I want to know why, it’s the divergence caused by the DG_ 0DNU module? What can I do to make the example run smoothly after rewriting the code?
Search “chiavol” in the rdf.f file to find the place I rewritten.

I am looking forward to your help, thanks!


test.zip (73.2 KB)

Somehow the rdf.f file did not get included in the ZIP you uploaded. Please attach the file and I’ll take a look.

– Charles

I’m Sorry, Charles, I made a mistake. It should be rdf_ mod.f, this file should be in zip. Thank you for your help.

No worries. This is the contents of the uploaded zip file. Please try again.

CYLINDER_FACETS_IGNORED.stl  calc_force_dem.f   particle_input.dat
Cylinder.mfx                 geometry.stl
calc_collision_wall_mod.f    geometry_0001.stl

It’s strange. I’m right here. I uploaded it again. Please check whether the uploaded content is correct.
test_2022-07-23T223848.353381.zip (73.2 KB)

Hi, charles! I want you to know that it may not be the problem of the DG_0DNU module, because I tried again without changing this module, and the calculation is still divergent. I guess it may be that the item added after the original radial distribution function may tend to infinity. What you think, and what can I do?

Hi, Charles! The problem has been solved. Sorry to disturb!