Stop running after one time step

Hi everyone,

The attached is my case file. Two files calc_force_dem and calc_collision_wall_mod are edited. The solver can be built without any errors. However, it stops running after only one time step. I am
puzzled about this.

test.zip (771.6 KB)

(reply deleted, I was testing with the wrong version of the code. Please refer to Jeff’s answer)

The error is coming from your modified code:

At line 313 of file calc_force_dem.f
Fortran runtime error: Index '1' of dimension 1 of array 'postcohesive' above upper bound of 0

We recommend building in debug mode when modifying any code. This will point out most mistakes such as the one above.

Here the postcohesive array is not allocated because you are not using a cohesion model. Either use another array or allocate postcohesive.

Thank you very much. I have solved this problem with your help. By the way, how to build codes in debug mode?

Hi @jeff.dietiker

Thanks for your help. The solver runs without any unexpected interruptions if I activate the cohesion model in the solid panel. The hamaker constant is given zero when the VDW cohesive force is not considered while the liquid bridge force is considered.

In the original code file calc_force_dem.f, the VDW cohesive force is assigned to a variable called PostCohesive for visualizing its magnitude when post-processing. In order to check the magnitude of the edited liquid bridge force, this force is also assigned to the PostCohesive. The cohesive force is activated in the output/VTK panel before running. However, unlike modeling the VDW cohesive force, the cohesive force equals to zero against time. The cohesive force should also be nonzero when modeling the liquid bridge force. I am confused about this.

test.zip (840.7 KB)

I see non-zero values of PostCohesive. My recommendation when you implement and test a new model is to start with a very small setup with a few particles, and put print statements in the code to figure out what is wrong if you get unexpected results.

Hi @jeff.dietiker , thanks for your help. I find the PostCohesive presents non-zero values if the shared memory parallel in the build solver is not selected. However, the PostCohesive equals to zero after several time steps.

Here, the PostCohesive represents the ratio of liquid bridge force and gravity acting on a particle.

image

This line of code for the liquid bridge force is similar to that of the original VDW force in form.

image

The PostCohesive can show the non-zero values of VDW force both with and without the selection of shared memory parallel in the build solver. Curiously, the PostCohesive can not show the non-zero values of the edited liquid bridge force if the shared memory parallel in the build solver is selected.

How to solve this problem for parallel? Thank you.

test.zip (840.7 KB)