ERROR: Fix insert/rate/region (id ins): 'start' step can not be before current step (../fix_insert.cpp:573)

Submitted by txf8378 on Wed, 04/12/2017 - 03:18

Hi, everyone

I face a error when I used the command Fix insert/rate/region, and I don't know what is the reason, anyone could give me some suggestions?

Coupling...
Starting up LIGGGHTS
Executing command: 'run 5 '
run 5
ERROR: Fix insert/rate/region (id ins): 'start' step can not be before current step (../fix_insert.cpp:573)

I list the input as belowe

echo both
log ../DEM/log.liggghts
thermo_log ../DEM/post/thermo.txt

atom_style granular
atom_modify map array
boundary m m m
newton off

communicate single vel yes

units si
processors 1 1 2

# read the restart file
read_restart ../DEM/post/restart/liggghts.restart
region reg cylinder z 0 0 0.014 0.0 0.055 units box
neighbor 0.002 bin
neigh_modify delay 0 binsize 0.01

# Material properties required for granular pair styles

fix m1 all property/global youngsModulus peratomtype 5.e6 5.e6
fix m2 all property/global poissonsRatio peratomtype 0.25 0.25
fix m3 all property/global coefficientRestitution peratomtypepair 2 0.9 0.9 0.9 0.9
fix m4 all property/global coefficientFriction peratomtypepair 2 0.3 0.3 0.3 0.3

# pair style
pair_style gran model hertz tangential history
pair_coeff * *

# timestep, gravity
timestep 0.00001
fix gravi all gravity 9.81 vector 0. 0. -1.
#fix bu all buoyancy level 0.056 dim z density 1000
# walls
fix walls1 all wall/gran model hertz tangential history primitive type 1 zcylinder 0.014 0.0 0.0
fix zwall1 all wall/gran model hertz tangential history primitive type 1 zplane 0.005

# cfd coupling
fix cfd all couple/cfd couple_every 100 mpi
fix cfd2 all couple/cfd/force

region bc cylinder z 0 0 0.0135 0.04 EDGE side in units box
fix pts2 all particletemplate/sphere 15485863 atom_type 2 density constant 2000 radius constant 0.0005
fix pdd2 all particledistribution/discrete 15485867 1 pts2 1.0

#fix ins all insert/pack seed 123457 distributiontemplate pdd2 insert_every 1000 overlapcheck yes vel constant 0 0 -0.00001 particles_in_region 5000 region bc ntry_mc 10000
fix ins all insert/rate/region seed 32452843 distributiontemplate pdd2 nparticles 15000 particlerate 10000 vel constant 0.0 0.0 0.0 insert_every 2000 overlapcheck yes region bc ntry_mc 10000
# apply nve integration to all particles that are inserted as single particles
fix integr all nve/sphere

# output settings, include total thermal energy
#compute rke all erotate/sphere
thermo_style custom step atoms ke vol
thermo 1000
thermo_modify lost ignore norm no
compute_modify thermo_temp dynamic yes

dump dmp all custom 1000 ../DEM/post/dump.liggghts_run id type x y z
run 0

j-kerbl's picture

j-kerbl | Thu, 05/11/2017 - 10:11

Hi,

the insert/rate/region has a keyword "start" which tells it at which time-step to start the insertion and is as default the next "time-step".
See http://www.cfdem.com/media/DEM/docu/fix_insert_rate_region.html
I suggest to read the current time-step and add 1 to start the insertion. Then the initialization phase of the simulation run should be over and it should work properly. To do so you can use variables:
#read step from thermo keywords
variable step equal step
variable startStep equal ${step}+1
fix ins all insert/rate/region seed 32452843 distributiontemplate pdd2 nparticles 15000 particlerate 10000 vel constant 0.0 0.0 0.0 insert_every 2000 start ${startStep} overlapcheck yes region bc ntry_mc 10000

I hope this helps you out.

Cheers,
Josef

TimMJN's picture

TimMJN | Fri, 10/20/2017 - 09:41

This solution might come too late for you, but for anyone coming up on this page:

I encountered the same problem. The solution by Josef doesn't work, since step+1 is already the default value for start. Instead, I found that the problem is fixed by making sure the insertion fix in your init and run files have different IDs.

Hope this helps anyone!

Cheers,

Tim

Kind regards,

Tim Nijssen
Eindhoven University of Technology

Min Zhang's picture

Min Zhang | Wed, 10/07/2020 - 00:24

Hello Tim,

Yes, it works for me. I am wondering whether you know what is happening here and why it is working.

Thanks and best regards,
Min