How to distinguish the difference between DO_INDEX and CC in the calc_force_dem_mod module

Hi,

I am confused about to variables, DO_INDEX and CC, in the particle index part for the calc_force_dem_mod module. I feel they both relate to the present particle indexed. What is the difference about them?

Thanks for your help.

Kindly regards

We are basically computing the force between particles LL and I.

LL is the same as do_index

I is one of the neighbors of LL. CC allows to loop through the list of neighbors.

Thank you @jeff.dietiker , I have gradually understood the code for particle looping in this module.
I have a supplementary question. I feel it is hard to find the keyword OPTFLAG1 in the solid > DEM pane on GUI. Coud you remind me what does OPTFLAG1 refer to? This keyword also belongs to the part for particle looping.

I have another supplementary question.
As the code written below,
IF (LL .GT. 1) CC_START = NEIGHBOR_INDEX(LL-1)
CC_END = NEIGHBOR_INDEX(LL)
Why they are written like this and how to understand?
DO CC = CC_START, CC_END-1
Why it is CC_END-1?
I am confused about them.

It is basically a list of list. You may need to try some examples to really understand how it works.

Let’s say

NEIGHBOR_INDEX(32)=12
NEIGHBOR_INDEX(33)=16
NEIGHBOR_INDEX(34)=22

If we want to know which particles are the neighbors of particle LL=33, we first do

CC_START = NEIGHBOR_INDEX(LL-1)=12
CC_END = NEIGHBOR_INDEX(LL)=16

The particle IDs of the neighbors are stored in NEIGHBOR(CC). Here we have 4 neighbors and we will look up their IDs in NEIGHBOR(12) to NEIGHBOR(15).

If we want to find the neighbors of Particle 34 we would get them from NEIGHBOR(16) to NEIGHBOR(21).

1 Like

Thanks for your example and I’m getting it. In this example, do the number 12, 16, 22, 32, 33, 34 refer to particle IDs? If, for example, NEIGHBOR(12) returns particle ID, what does 12 refers to?

32, 33, 34 refer to particle IDs. 12, 16, 22 refer to the position in the lookup table NEIGHBOR that stores the neighbors particle IDs.

Here Particle 33 has 4 neighbors, and the particle IDs of the neighbors are stored in in NEIGHBOR(12) to NEIGHBOR(15), so you could have

NEIGHBOR(12) = 45
NEIGHBOR(13) = 51
NEIGHBOR(14) = 134
NEIGHBOR(15) = 157

which means Particles with IDs 45, 51, 134, 157 are neighbors of Particle ID 33.

You don’t need to fully understand the data structure to run the code. If you plan to do some development, it will take time to understand all these loops.

1 Like

Thank you very much. I have clearly understood it. I just begin my research and I will focus on liquid bridges between wet particles. calc_force_dem_mod module may be an important .f file for me and I have to learn this module. Much thanks.