In my simulation, I want to use the recognition particle velocity to judge the adsorption time and count the number of particles whose velocity is lower than the threshold as the adsorption amount, but after I tried this writing method, the system prompted me to make this mistake, hoping to get your help to realize my idea. Here is my in file.
Basic setting
#------------------------------------------------------------------------
units real
boundary p p p
dimension 3
atom_style full
timestep 0.01#后期修改
neighbor 2.0 bin
neigh_modify every 5 delay 0 check yes one 5000
#------------------------------------------------------------------------
Potential
#------------------------------------------------------------------------
pair_style lj/cut/coul/long 10 12.5
pair_modify mix arithmetic
bond_style harmonic
angle_style harmonic
dihedral_style harmonic
improper_style cvff
kspace_style pppm 1e-4
read_data T_Layer2.data
#------------------------------------------------------------------------
Define the molecule groups
#------------------------------------------------------------------------
group CO2 type 1 2
group kerogen type 3 4 5 6 7 8 9 10 11 &
12 13 14 15 16 17 18 19 20
#------------------------------------------------------------------------
Define the minimization
#------------------------------------------------------------------------
min_style cg
minimize 1.0e-8 1.0e-10 1000 10000
#------------------------------------------------------------------------
Define the nvt ensemble
#------------------------------------------------------------------------
velocity kerogen set 0 0 0
velocity all create 300 123456 dist gaussian
fix kero kerogen setforce 0 0 0
fix 1 all nvt temp 300 300 1 #temp
run 100
unfix 1
reset_timestep 0
#------------------------------------------------------------------------
Equilibaration
#------------------------------------------------------------------------
fix 3 all npt temp 303.15 303.15 10 &
iso 296.1 296.1 10 #0~30MPa
#------------------------------------------------------------------------
Production run
#------------------------------------------------------------------------
compute carbon_vel all reduce ave (sqrt(vxvx+vyvy+vz*vz)*type==1)
fix avg_vel all ave/time 10 5 100 c_carbon_vel file avg_vel.txt
variable v_thresh equal 1.0
compute absorb all reduce count(c_carbon_vel<${v_thresh}*type==1)
variable absorb equal c_absorb
thermo 10
thermo_style custom step v_absorb
run 100
#-----------------------------End the simulation-------------------------------