Delete particle outside domain

Submitted by Rahul Kumar on Sun, 01/27/2019 - 14:02

Hi
I am doing a simulation of density calibration I want to delete all atom doing outside the domain. I am using the following code, but it is not working.

#--------------define region of interest to delete particles outside
region del_region block -0.5 0.5 0.0 1.6 0.0 1.0 units box side out
delete_atoms region del_region
#-----------------------------------------------------------------------------------

I also want to check mass of particle within a region, how can I do it?

paul | Tue, 01/29/2019 - 08:45

Maybe create your region, a region comprising everything, and subtract the two from each other.

Checking the mass would be a compute reduce sum over mass.

Philippe's picture

Philippe | Tue, 02/05/2019 - 13:33

Strange, since this should work. Can you attach a full, minimal input script that reproduces the problem?

cheers
Philippe

Rahul Kumar | Wed, 02/06/2019 - 10:03

Sir below is the fol input script. Please help me?

#Bulk Density calibration

atom_style granular
atom_modify map array
boundary m m m
newton off

communicate single vel yes

units si

region domain block -0.5 0.5 0.0 1.6 0.0 1.0 units box
create_box 2 domain
# create_box defines no. of atom type to be created within the simulation

neighbor 0.001 bin
neigh_modify delay 0

# defining timestep and gravity
timestep 0.0001
fix gravi all gravity 9.81 vector 0.0 -1.0 0.0

#distributions for insertion
fix pts1 all particletemplate/multisphere 15485863 atom_type 1 density constant 2280 nspheres 4 ntry 1000000 spheres file data/particle1.multisphere scale 0.015 type 1
fix pts2 all particletemplate/multisphere 15485867 atom_type 1 density constant 2280 nspheres 4 ntry 1000000 spheres file data/particle2.multisphere scale 0.015 type 2
fix pts3 all particletemplate/multisphere 32452843 atom_type 1 density constant 2280 nspheres 3 ntry 1000000 spheres file data/particle3.multisphere scale 0.015 type 3
fix pts4 all particletemplate/multisphere 32452867 atom_type 1 density constant 2280 nspheres 2 ntry 1000000 spheres file data/particle4.multisphere scale 0.015 type 4
fix pts5 all particletemplate/multisphere 49979687 atom_type 1 density constant 2280 nspheres 3 ntry 1000000 spheres file data/particle5.multisphere scale 0.015 type 5
fix pts6 all particletemplate/multisphere 49979693 atom_type 1 density constant 2280 nspheres 3 ntry 1000000 spheres file data/particle6.multisphere scale 0.015 type 6
fix pts7 all particletemplate/multisphere 67867967 atom_type 1 density constant 2280 nspheres 3 ntry 1000000 spheres file data/particle7.multisphere scale 0.015 type 7
fix pts8 all particletemplate/multisphere 67867979 atom_type 1 density constant 2280 nspheres 3 ntry 1000000 spheres file data/particle8.multisphere scale 0.015 type 8

fix pdd1 all particledistribution/discrete 86028121 8 pts1 0.078 pts2 0.078 pts3 0.078 pts4 0.1532 pts5 0.1532 pts6 0.1532 pts7 0.1532 pts8 0.1532

#Defining geometry
fix cad all mesh/surface file meshes/bulk_box.stl type 2 scale 0.001 curvature 1e-5
fix factory1 all mesh/surface file meshes/bulk_factory.stl type 1 scale 0.001 curvature 1e-5
fix factory2 all mesh/surface file meshes/bulk_factory2.stl type 1 scale 0.001 curvature 1e-5
fix factory3 all mesh/surface file meshes/bulk_factory3.stl type 1 scale 0.001 curvature 1e-5
fix granwalls all wall/gran model hertz tangential history mesh n_meshes 1 meshes cad

#Material properties required for new pair styles
# 1-iron ore 2 mn steel || for pair properties atom_type ij -> 2 11 12 21 22
fix m1 all property/global youngsModulus peratomtype 40e6 206e6
fix m2 all property/global poissonsRatio peratomtype 0.25 0.28
fix m3 all property/global coefficientRestitution peratomtypepair 2 0.2 0.2 0.2 0.2
fix m4 all property/global coefficientFriction peratomtypepair 2 0.8 0.69 0.69 0.8
fix m5 all property/global cohesionEnergyDensity peratomtypepair 2 5 2 2 5

#Defining contact model
pair_style gran model hertz tangential history cohesion sjkr #Hertzian with cohesion
pair_coeff * *

#region and insertion
group nve_group region domain

#particle insertion
fix ins1 nve_group insert/stream seed 86028157 distributiontemplate pdd1 &
nparticles INF particlerate 50 insert_every 2000 overlapcheck yes all_in no vel constant 0.0 -2.0 0.0 &
insertion_face factory1
fix ins2 nve_group insert/stream seed 86028157 distributiontemplate pdd1 &
nparticles INF particlerate 50 insert_every 2000 overlapcheck yes all_in no vel constant 0.0 -2.0 0.0 &
insertion_face factory2
fix ins3 nve_group insert/stream seed 86028157 distributiontemplate pdd1 &
nparticles INF particlerate 50 insert_every 2000 overlapcheck yes all_in no vel constant 0.0 -2.0 0.0 &
insertion_face factory3

#define region of interest to delete particles outside
region del_region block -0.5 0.5 0.0 1.6 0.0 1.0 units box side out
delete_atoms region del_region outlet compress yes
#delete_atoms region del_region

#apply nve integration to all particles that are inserted as single particles
fix integr all multisphere

#output settings, include total thermal energy
compute 1 all erotate/sphere
thermo_style custom step atoms ke c_1 vol
thermo 1000
thermo_modify lost ignore norm no

#insert the first particles so that dump is not empty
run 1
dump dmp all custom/vtk 200 post/bulk_*.vtk id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
dump dumpstress all mesh/gran/VTK 200 post/mesh_*.vtk stress wear cad

#insert particles
run 26000 upto
unfix ins1
unfix ins2
unfix ins3

Daniel Queteschiner | Wed, 02/20/2019 - 16:26

a) what is 'outlet' in your delete_atoms command? This probably throws an error ...
b) you issue the delete_atoms command prior to any particle insertion (which starts with the first run command and ends when you unfix the insertion fixes)
c) delete_atoms deletes atoms only once, not every time step.
d) if you use fixed boundaries instead of growing ones (i.e. boundary f f f), particles outside the domain will get deleted automatically

Rahul Kumar | Thu, 02/21/2019 - 11:24

Thanks for your suggestion, it is working