Hi Everyone,
I am trying to simulate a case with a two-particle collision without gravity. Where one particle is fixed and another particle is moving with a certain velocity. However, after using the velocity command both particles are still stationary.
Please can someone highlight what mistake I am making?
My input LIGGGHTS script is as follow:
variable dt equal 1e-9
variable m_chamber equal 1.07e-5
variable m_chamber2 equal 1.07e-5
variable t_set equal 0.01 #time to initialise the simulation [sec]
variable t_set2 equal 1.00 #time to initialise the simulation [sec]
variable dump_rate equal 0.001/${dt} #rate of writing dump rate []
variable st_set equal ${t_set}/${dt} #steps to initialise the simulation []
variable st_set2 equal ${t_set2}/${dt} #steps to initialise the simulation []
echo both
atom_style granular
atom_modify map array
communicate single vel yes
boundary f f f
newton off
units si
region reg block -0.09 0.09 &
-0.09 0.09 &
-0.09 0.09 &
units box
create_box 1 reg
include matprops.lmp
#neighbor ${dp} bin
neigh_modify delay 0
# timestep, gravity
timestep ${dt}
fix gravi all gravity 0. vector 0. 0. 1.
# particle distributions and insertion, large numbers are primes used for RNG startup
fix pts1 all particletemplate/sphere 67867979 &
atom_type 1 &
density constant ${rhop} &
radius constant ${rp}
fix pts2 all particletemplate/sphere 67867979 &
atom_type 1 &
density constant ${rhop} &
radius constant ${rp}
fix pdd1 all particledistribution/discrete 15485863 1 pts1 1
fix pdd2 all particledistribution/discrete 15485863 1 pts2 1
variable xmin_ch equal -.001
variable ymin_ch equal -.001
variable xmax_ch equal .001
variable ymax_ch equal .001
variable zmin_cA equal .011
variable zmax_cA equal .013
variable zmin_cB equal -.013
variable zmax_cB equal -.011
region cA block ${xmin_ch} ${xmax_ch} &
${ymin_ch} ${ymax_ch} &
${zmin_cA} ${zmax_cA}
region cB block ${xmin_ch} ${xmax_ch} &
${ymin_ch} ${ymax_ch} &
${zmin_cB} ${zmax_cB}
fix ins_cA all insert/pack seed 6028157 &
distributiontemplate pdd1 &
vel constant 0. 0. 0. &
insert_every once &
overlapcheck yes &
all_in yes &
mass_in_region ${m_chamber} &
region cA
fix ins_cB all insert/pack seed 6028157 &
distributiontemplate pdd2 &
vel constant 0. 0. 0. &
insert_every once &
overlapcheck yes &
all_in yes &
mass_in_region ${m_chamber2} &
region cB
# apply nve integration to all particles that are inserted as single particles
fix integr all nve/sphere
group particlesInRegionCB region cB
# screen output
thermo_style custom step atoms ke
thermo 5000
thermo_modify lost ignore norm no
# insert the first particles so that dump is not empty
shell mkdir ./post
shell mkdir ./restart
dump dmp all custom/vtk ${dump_rate} ./post/particles_*.vtk id type x y z vx vy vz fx fy fz radius mass
dump_modify dmp sort id
#-------Run---------------------------------------------------------------------------------------------------------------------------------------------------------#
run ${st_set}
unfix ins_cA
unfix ins_cB
velocity particlesInRegionCB set NULL NULL -1.0
#-------Write restart file------------------------------------------------------------------------------------------------------------------------------------------#
run ${st_set2}
write_restart ./restart/restart.liggghts
Attachment | Size |
---|---|
![]() | 4.54 KB |
shaik | Mon, 07/08/2024 - 15:33
Solution script
Probably it might be useful for someone else in the future, I created a python supported script that can provide xyz co-ordinate for the particle collision and respective results are saved in post folder.
You can review the script and make the necessary changes per your requirements.
units si
atom_style sphere
atom_modify map array
communicate single vel yes
boundary f f f
newton off
# Define the region and create box
region mybox block -0.09 0.09 -0.09 0.09 -0.09 0.09 units box
create_box 1 mybox
neigh_modify delay 0
# Material properties for stainless steel
variable density equal 6050
# Create two particles
create_atoms 1 single {part_1_x} {part_1_y} {part_1_z} units box
create_atoms 1 single {part_2_x} {part_2_y} {part_2_z} units box
# Set particle mass and diameter
set type 1 diameter 0.0015 density 6050
# Define groups
group stationary id 2
group moving id 1
fix m1 all property/global youngsModulus peratomtype 210e9
fix m2 all property/global poissonsRatio peratomtype 0.3
fix m3 all property/global coefficientRestitution peratomtypepair 1 .8
fix m4 all property/global coefficientFriction peratomtypepair 1 .15
pair_style gran model hertz tangential history
pair_coeff * *
# Fix settings
fix integrator all nve/sphere
fix gravity all gravity 0.0 vector 0.0 0.0 1.0
# Set initial velocities
velocity moving set {part_1_v11} {part_1_v12} {part_1_v13} units box
velocity stationary set {part_2_v21} {part_2_v22} {part_2_v23} units box
# Output settings
timestep 1e-9
thermo_style custom step time atoms ke
thermo 100000
# insert the first particles so that dump is not empty
variable s equal stride({file_start},{file_end},{file_step})
dump dmp all custom 1 ./{folder_name}/post/particles_*.liggghts id type x y z vx vy vz omegax omegay omegaz radius mass
dump_modify dmp every v_s first yes sort id
# Run the simulation for enough time to see the collision
run {file_run}