Printout of # of particles

Submitted by cstoltz on Tue, 12/07/2010 - 20:08

I'm running a simulation in which a bin is initially filled with equal masses of two different particle types (identical properties except radius), and then opened at the bottom to allow the particles to pour out. Can anyone help me figure out how to get the code to print out the number of each particle type remaining (or equivalently, the mass) using the thermo command?

I tried doing this by creating a group for each particle type, computing the mass and then reducing it. This is all done before the first run statement. However, it results in all zeros being reported. Can anyone help me out here?

group large type 1
group small type 2

#thermo settings
compute 1 large property/atom mass
compute 2 large reduce sum c_1
compute 3 small property/atom mass
compute 4 small reduce sum c_3
thermo_style custom cpu step atoms c_2 c_4
thermo 1000

Note - the atoms option on the thermo_style gives the total number of particles, but I haven't been able to break it down further.

Thanks,
Chris

ckloss's picture

ckloss | Tue, 12/07/2010 - 22:22

The issue is that groups are a static assignment... If you do it after all particles have been inserted and before you start discharging, it should work like you write above.

Otherwise, you could do it like:

variable s atom ceil(mass-0.1)
compute 2 all reduce sum v_s

where 0.1 is the threshold mass

Christoph