# Wall import from CAD
atom_style	granular
boundary	m m m
newton		off
atom_modify	sort 0 0

communicate	single vel yes
units		si

region		reg block -0.01 0.51 -0.06 0.01 -1.22 0.01  units box
create_box	1 reg

neighbor	0.02 bin
neigh_modify	delay 0

#Material properties required for new pair styles

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.7
fix 		m4 all property/global coefficientFriction peratomtypepair 1 0.05
fix 		m5 all property/global characteristicVelocity scalar 2.

#New pair style
pair_style gran model hooke tangential history #Hooke without cohesion
pair_coeff	* *

timestep	0.00005

fix		1 all nve/sphere
fix		2 all gravity 9.81 vector 0.0 0.0 -1.0

#import triangular mesh
fix		cad all mesh/surface file meshes/mesh.stl type 1 scale 0.001 move 0. 0. 0. rotate axis 1. 0. 0. angle -90. #temperature 100.

#use the imported mesh as granular wall
fix granwalls all wall/gran model hooke tangential history mesh n_meshes 1 meshes cad

#insertion region (for deprecated pour/legacy)
#region		bc block 0.21 0.25 -0.045 -0.005 -0.015 -0.00 units box

#definition of insertion face
fix		inface all mesh/surface file meshes/insertion_face.stl type 1

#distributions for insertion
fix		pts1 all particletemplate/sphere 1 atom_type 1 density constant 2500 radius constant 0.005
fix		pdd1 all particledistribution/discrete 1.  1 pts1 1.0

group		nve_group region reg

#particle insertion
fix		ins nve_group insert/stream seed 5330 distributiontemplate pdd1 &
			maxattempt 100 nparticles 10000 particlerate 1000 overlapcheck yes all_in no vel constant 0. 0. -1.0 &
			insertion_face inface extrude_length 0.02	

fix		ts all check/timestep/gran 1000 0.1 0.1
compute		1 all erotate/sphere
thermo_style	custom step atoms ke c_1 f_ts[1] f_ts[2] vol
thermo		1000
thermo_modify	lost ignore norm no
compute_modify	thermo_temp dynamic yes

#dump commands
dump		dmp all custom 300 post/dump*.meshGran id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz radius
dump 		dmpstl all mesh/stl 300 post/dump*.stl

#insert particles
run			10000 upto
unfix		ins

#run
run			40000 upto

