Using the nparticles keyword with fix insert/rate/region

Submitted by ktduclos on Sun, 07/14/2013 - 16:35

I am trying to use the insert/rate/region command to create a cylinder filled with particles. I have not been able to figure out what role the nparticles keyword plays in determining the number of particles added. I thought that the total number would be limited to "nparticles", but when I run the simulation new particles keep being added after reaching "nparticles". How do I create a region with a fixed number of particles? The code is below. Thanks in advance for your help.

fix ins all insert/rate/region seed 3645 distributiontemplate pdd nparticles 100000 particlerate 1000000 insert_every 1000 overlapcheck no region factory

Plain text icon in.scratch_1.txt2.32 KB
Plain text icon log.liggghts_3.txt213.24 KB

cstoltz | Mon, 07/15/2013 - 04:04

Can you post the log file? nparticles should be the maximum number of particles generated so I'm curious as to what the log file looks like.

ckloss's picture

ckloss | Mon, 07/15/2013 - 15:22


which version are you using? can you post the full in-file as well?


ktduclos | Mon, 07/15/2013 - 23:53

# A simple simulation of a cylinder filled with sand
# Based on a combination of the example movingMeshGran
# and a tutorial by Chris Stoltz

### Initialization

units si
atom_style granular

boundary f f f
newton off
communicate single vel yes
#processors 2 2 1

# Domain
region domain block -0.05 0.05 -0.05 0.05 -0.05 0.05 units box
create_box 1 domain

# Neighbor listing
neighbor 0.0002 bin
neigh_modify delay 0

### Setup

# Material properties
fix m1 all property/global youngsModulus peratomtype 5.e6
fix m2 all property/global poissonsRatio peratomtype 0.45

fix m3 all property/global coefficientRestitution peratomtypepair 1 0.05
fix m4 all property/global coefficientFriction peratomtypepair 1 0.05

fix m5 all property/global characteristicVelocity scalar 2.

# Physics, integrator, and gravity
pair_style gran/hooke/history 1 0
pair_coeff * *

fix int all nve/sphere
fix grav all gravity 9.81 vector 0.0 0.0 -1.0

timestep 0.0000002

# Make some walls
fix bottomWall all wall/gran/hooke/history 1 0 zplane -0.05 0.05 1
fix cylinderWall all wall/gran/hooke/history 1 0 zcylinder 0.05 1

# Particle insertion
# Pour
# group nve_group region domain
# fix ins nve_group pour 1000 1 427389 vol 0.5 1000 diam uniform 0.0002 0.0002 dens uniform 2500 2500 rate 0.1 region factory

# Insert/rate/region
region factory cylinder z 0. 0. 0.05 -0.05 0. units box
fix pts all particletemplate/sphere 1 atom_type 1 density constant 1000 radius constant 0.0002
fix pdd all particledistribution/discrete 324434 1 pts 1.0
fix ins all insert/rate/region seed 3645 distributiontemplate pdd nparticles 10000 particlerate 100000 insert_every 1000 overlapcheck no region factory

# Thermodynamopiic settings
compute 1 all erotate/sphere
thermo_style custom step atoms ke c_1 vol
thermo 1000
thermo_modify lost ignore norm no
compute_modify thermo_temp dynamic yes

# Insert first particles and run time step check
fix ctg all check/timestep/gran 1 0.01 0.01
run 1
unfix ctg

# Make a dump of particles and the stl file
dump dmp all custom 200 post/dump.scratch id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
# dump dumpstl all stl 200 post/dump*.stl

### Run simulation
run 500000 upto
unfix ins

run 10000

ktduclos | Tue, 07/16/2013 - 00:48

Sorry to post the in file twice. I just found the place to upload files. The version here with the command "run 500000 upto" seems to work. However, when I increase the time to 1000000 (as it is in the uploaded version), the simulation adds 20000 instead of 10000 particles.

cstoltz | Tue, 07/16/2013 - 11:07

According to your logfile, you're using LIGGGHTS 1.5. Try upgrading to the most recent version as there has been substantial improvement in the code since then.


ktduclos | Thu, 07/18/2013 - 18:12

You were right. This seems to have been fixed in 2.3.6.

Thanks for your help,

ckloss's picture

ckloss | Thu, 07/18/2013 - 18:12

>>According to your logfile, you're using LIGGGHTS 1.5. Try upgrading to the most
>>recent version as there has been substantial improvement in the code since then.