I am getting error while inserting multiple particles as below:
```
If you perform one of the steps above LIGGGHTS(R) needs to be recompiled to generate the optimized code.
(/build/liggghts-YO7u74/liggghts-3.8.0+repack1/src/contact_models.h:364)
ERROR: Fix particletemplate/sphere (id pts2): invalid radius random style (/build/liggghts-YO7u74/liggghts-3.8.0+repack1/src/fix_template_sphere.cpp:199)
```
Any I idea , what did I miss here?
Here is my script
```
###################################Header for General commands#######################################################
atom_style granular #Simulation of particles
boundary f p f #fixed boundaries -> particles will be deleted if leaving the simulation box x, y, z
units si
communicate single vel yes #default
newton off #default
###################################System variables##################################################################
#Definition of boundaries
variable xmin equal -0.3
variable xmax equal 0.3
variable ymin equal -0.6
variable ymax equal 0.6
variable zmin equal -0.6
variable zmax equal 0.6
#Definition of the timestep
variable dt equal 0.0001 #timestep = 0.0001 second; Each iteration step represents 0.0001 seconds.
###################################Specific variables for current simulation#########################################
variable natoms equal 2 #1 -> particle #2->drum parts
####variable for material properties####
####Young Modulus####
variable youngmodulus1 equal 1e7 #N/mm²
variable youngmodulus2 equal 1e7 #N/mm²
####Poission ratio####
variable poission1 equal 0.3
variable poission2 equal 0.3
####variable for contact properties####
####coefficient of restitution####
variable CoR11 equal 0.6
variable CoR12 equal 0.6
variable CoR21 equal 0.6
variable CoR22 equal 0.6
####sliding friction coefficient####
variable sf11 equal 0.3
variable sf12 equal 0.3
variable sf21 equal 0.3
variable sf22 equal 0.0
####rolling friction coefficient####
variable rf11 equal 0.8
variable rf12 equal 0.8
variable rf21 equal 0.8
variable rf22 equal 0.8
####variable for particle####
#Number of particle radius
variable nradii equal 2
variable big_radius equal 0.05 #m (10cm diameter)
variable min_radius equal 0.005 #m (0.01m diameter)
variable max_radius equal 0.015 #m (0.03m diameter)
variable frac1 equal 0.5 #10%
variable frac2 equal 0.5 #90%
variable density_big equal 7800 #kg/m³ for larger particles
variable density_small equal 2500 #kg/m³ for smaller particles
####filling parameters####
variable filltime equal 5 #seconds #filltime to generate the particles
variable fillmass equal 120 #kg #total mass of bulk material
variable fillmassrate equal ${fillmass}/${filltime} #kg/s #mass rate for the particle generation
variable fillsteps equal ${filltime}/${dt} #Transform time to iteration steps
variable rotatime equal 60 #seconds #rotatime: how long will the drum rotate
variable rotasteps equal ${rotatime}/${dt} #Transform time to iteration steps
####screw velocities####
variable drumPeriod equal 4 #s #Period of the drum rotation (time for 1 rotation)
###################################Definition of simulationbox#######################################################
region reg block ${xmin} ${xmax} ${ymin} ${ymax} ${zmin} ${zmax} units box
create_box 2 reg
neighbor 0.004 bin #default
neigh_modify every 1 check yes
neigh_modify delay 0 #default
#################################Definition of the contact models####################################################
#pair_style gran model hertz tangential history rolling_friction epsd2 #contact model
pair_style gran model hertz tangential history tangential_damping on limitForce off
pair_coeff * * #default
timestep ${dt}
fix integrator all nve/sphere #default
fix gravi all gravity 9.81 vector 0.0 0.0 -1.0 #gravity of 9.81 m/s² in negative z direction
###################################Definition of Material properties#################################################
fix m1 all property/global youngsModulus peratomtype ${youngmodulus1} ${youngmodulus2}
fix m2 all property/global poissonsRatio peratomtype ${poission1} ${poission2}
fix m3 all property/global coefficientRestitution peratomtypepair ${natoms} 0.6 0.6 0.6 0.6
fix m4 all property/global coefficientFriction peratomtypepair ${natoms} ${sf11} ${sf12} ${sf21} ${sf22}
fix m5 all property/global coefficientRollingFriction peratomtypepair ${natoms} ${rf11} ${rf12} ${rf21} ${rf22}
###################################Generation and Loading of the Geometry .stl#######################################
fix Drum all mesh/surface file meshes/Drum.stl type 2 #scale 0.001 #Load Drum
fix Front all mesh/surface file meshes/Front.stl type 2 #scale 0.001 #Load Front face of the drum
fix Back all mesh/surface file meshes/Back.stl type 2 #scale 0.001 #Load Back face of the drum
fix walls all wall/gran model hertz tangential history rolling_friction epsd2 mesh n_meshes 3 meshes Drum Front Back
###################################Generation and Insertion of the particles#########################################
fix pts1 all particletemplate/sphere 10487 atom_type 1 density constant ${density_big} radius constant ${big_radius}
fix pts2 all particletemplate/sphere 11887 atom_type 1 density constant ${density_small} radius uniform ${min_radius} ${max_radius}
fix pdd1 all particledistribution/discrete 32452867 ${nradii} pts1 ${frac1} pts2 ${frac2}
fix ins_mesh all mesh/surface/planar file meshes/Insertionsface.stl type 1 scale 0.9
fix ins all insert/stream seed 86028157 distributiontemplate pdd1 &
mass ${fillmass} massrate ${fillmassrate} overlapcheck yes all_in yes vel constant 0 0 -0.75 &
insertion_face ins_mesh extrude_length 0.1
###################################Dumping of the data for post-processing to visualize############################
shell mkdir post
#Definition of the dumptime
variable dumptime equal 0.05 # Every 0.05 s 1 image , timestep = 0.0001 second; Each iteration step represents 0.0001 seconds
variable dumpstep equal ${dumptime}/${dt} #Transform to iteration steps
#======= ID ==========
variable nom string SAG012
#=====================
#compute cpt all wall/gran/local force
#compute cpt2 all reduce sum c_cpt[1]
compute cout all pair/gran/local id force
compute cwall all wall/gran/local id force
dump dmpfrc all local 5000 particles/dump.force_*.liggghts c_cout[1] c_cout[2] c_cout[3] c_cout[4] c_cout[5] c_cout[6]
dump dmpfrcw all local 5000 wall/dump.wall_*.liggghts c_cwall[1] c_cwall[2] c_cwall[3] c_cwall[4] c_cwall[5] c_cwall[6]
dump dmpparticle all custom ${dumpstep} post/particles_*.liggghts id type x y z vx vy vz fx fy fz radius mass
dump dmpDrum all mesh/stl ${dumpstep} post/Drum*.stl Drum #dump Drum
dump dmpFront all mesh/stl ${dumpstep} post/Front*.stl Front #dump Front face
dump dmpBack all mesh/stl ${dumpstep} post/Back*.stl Back #dump Back face
variable acc atom sqrt(fx*fx+fy*fy+fz*fz)/mass
dump dmp all custom/vtk 5000 post/chute_*.vtk id type type x y z ix iy iz vx vy vz fx fy fz omegax omegay omegaz v_acc mass radius
dump dumpstress all mesh/gran/VTK 5000 post/mesh_*.vtk stress wear
dump dmp0 all custom 5000 all/dump*.data id type x y z vx vy vz fx fy fz omegax omegay omegaz v_acc mass radius
#thermo_style custom step cpu atoms ke f_t[1] f_t[2] #f_ressort # ke
thermo 5000
#####################################Thermo Dynamic ####################################
#thermo_style custom step cpu atoms ke f_t[1] f_t[2] #f_ressort # ke
#thermo 5000
####################################RUN the simulation filling and rotation###########################################################
fix MoveDrum all move/mesh mesh Drum rotate origin 0 0 0 axis 1. 0. 0. period ${drumPeriod} #Rotation of drum
fix MoveFront all move/mesh mesh Front rotate origin 0 0 0 axis 1. 0. 0. period ${drumPeriod} #Rotation of front face
fix MoveBack all move/mesh mesh Back rotate origin 0 0 0 axis 1. 0. 0. period ${drumPeriod} #Rotation of back face
run ${rotasteps}
run ${fillsteps}
unfix ins
```
pain08 | Sat, 12/28/2024 - 17:44
hi the error is in this line
hi the error is in this line
fix pts2 all particletemplate/sphere 11887 atom_type 1 density constant ${density_small} radius uniform ${min_radius} ${max_radius}
radius uniform might not be suported for your liggghts version if you need multiple raidi you try this
fix pts1 all particletemplate/sphere 32453513 atom_type 1 density constant 1250 radius constant 0.001
fix pts2 all particletemplate/sphere 32453087 atom_type 1 density constant 1250 radius constant 0.00105
fix pts3 all particletemplate/sphere 32453101 atom_type 1 density constant 1250 radius constant 0.0011
fix pts4 all particletemplate/sphere 32453123 atom_type 1 density constant 1250 radius constant 0.00115
fix pts5 all particletemplate/sphere 32454503 atom_type 2 density constant 1250 radius constant 0.001
fix pts6 all particletemplate/sphere 32453287 atom_type 2 density constant 1250 radius constant 0.00105
fix pts7 all particletemplate/sphere 32453293 atom_type 2 density constant 1250 radius constant 0.0011
fix pts8 all particletemplate/sphere 32453297 atom_type 2 density constant 1250 radius constant 0.00115
good luck