ERROR: Variable name for fix ave/correlate does not exist (../fix_ave_correlate.cpp:215)

hello dear
i’m trying to simulate water-cu.i want to compute thermal conductivity kappa.this my input code.when it runs it shows this ERROR: Variable name for fix ave/correlate does not exist (…/fix_ave_correlate.cpp:215).does anybody know about this error?
thanks
regard

atom_style full
bond_style harmonic #hybrid harmonic
angle_style harmonic #hybrid harmonic
kspace_style pppm 1.0e-5

variable T equal 300
variable V equal vol
variable dt equal 2

variable x equal 23.41
variable y equal 23.41

variable rho equal 0.6
variable t equal 0.002
variable rc equal 2.5

variable p equal 200 # correlation length
variable s equal 2 # sample interval
variable d equal $p*$s # dump interval

convert from LAMMPS real units to SI

variable kB equal 1.3806504e-23 # [J/K] Boltzmann
variable kCal2J equal 4186.0/6.02214e23
variable atm2Pa equal 101325.0
variable A2m equal 1.0e-10
variable fs2s equal 1.0e-15

variable convert equal {atm2Pa}*{atm2Pa}{fs2s}*{A2m}{A2m}*{A2m}

read_data water.data

group hydrogen type 1
group water type 1 2
group cu type 3
group oxygen type 2

lattice fcc 3.615 #Cu lattice constant
region Cu sphere 0 0 0 7 units box
create_atoms 3 region Cu

pair_style hybrid lj/cut/coul/long 0.1521 3.157 eam lj/cut 3.157 # 7.5
pair_coeff 1 1 lj/cut/coul/long 0.0460 0.4000 #H-H epsilon sigm # 108.0e-21 32.0e-11
pair_coeff 1 2 lj/cut/coul/long 0.0836 1.7753 #O-H epsilon sigma
pair_coeff 1 3 lj/cut 0.6589 0.2117 #H-Cu epsilon sigma
pair_coeff 2 2 lj/cut/coul/long 0.1521 3.157 #O-O epsilon sigma # 0 0
pair_coeff 2 3 lj/cut 1.198 1.587 #O-Cu epsilon sigma
pair_coeff 3 3 eam cu.eam #Cu-Cu

bond_coeff 1 450 0.9572 #O-H
angle_coeff 1 55 104.52 #H-O-H

++++++++++++++++setting+++++++++++++++++++++

neighbor 2.0 bin
neigh_modify delay 0 every 1 check yes

min_modify dmax 0.01
minimize 1.0e-20 0 100000 300000

velocity all create 300.0 4928459 rot yes dist gaussian #23482341

fix 1 hydrogen shake 1e-6 500 0 m 1.0 a 1 #for hydrogen
fix 12 water npt temp 300.0 300.0 100.0 iso 0.0 0.0 1000.0

timestep 0.000002
thermo $d
thermo_style custom step etotal enthalpy pe press ke
thermo_modify flush yes

run 400
reset_timestep 0

gs

Green-Kubo viscosity calculation

Define distinct components of symmetric traceless stress tensor

variable pxy equal pxy
variable pxx equal pxx-press
variable pyz equal pyz

fix SS all ave/correlate $s $p $d &
v_pxy v_pxz v_pyz type auto file S0St.dat ave running

variable scale equal {convert}/({kB}$T)$V*s*{dt}
variable v11 equal trap(f_SS[3]){scale} variable v22 equal trap(f_SS[4])*{scale}
variable v33 equal trap(f_SS[5])
${scale}
thermo_style custom step temp press v_pxy v_pxz v_pyz v_v11 v_v22 v_v33

run 5000

variable v equal (v_v11+v_v22+v_v33)/3.0
variable ndens equal count(all)/vol
print “average viscosity: $v [Pa.s/@ T K, {ndens} /A^3”

dear users
i’ want to simulate water-cu in a cubic. want to compute viscosity.i have attached my input code.when it runs it shows this ERROR : Variable name for fix ave/correlate does not exist (…/fix_ave_correlate.cpp:215).does anybody know about this error?
thanks
regard

atom_style full
bond_style harmonic #hybrid harmonic
angle_style harmonic #hybrid harmonic
kspace_style pppm 1.0e-5

variable T equal 300
variable V equal vol
variable dt equal 2

variable x equal 23.41
variable y equal 23.41

variable rho equal 0.6
variable t equal 0.002
variable rc equal 2.5

variable p equal 200 # correlation length
variable s equal 2 # sample interval
variable d equal $p*$s # dump interval

convert from LAMMPS real units to SI

variable kB equal 1.3806504e-23 # [J/K] Boltzmann
variable kCal2J equal 4186.0/6.02214e23
variable atm2Pa equal 101325.0
variable A2m equal 1.0e-10
variable fs2s equal 1.0e-15

variable convert equal {atm2Pa}*{atm2Pa}{fs2s}*{A2m}{A2m}*{A2m}

read_data water.data

group hydrogen type 1
group water type 1 2
group cu type 3
group oxygen type 2

lattice fcc 3.615 #Cu lattice constant
region Cu sphere 0 0 0 7 units box
create_atoms 3 region Cu

pair_style hybrid lj/cut/coul/long 0.1521 3.157 eam lj/cut 3.157 # 7.5
pair_coeff 1 1 lj/cut/coul/long 0.0460 0.4000 #H-H epsilon sigm # 108.0e-21 32.0e-11
pair_coeff 1 2 lj/cut/coul/long 0.0836 1.7753 #O-H epsilon sigma
pair_coeff 1 3 lj/cut 0.6589 0.2117 #H-Cu epsilon sigma
pair_coeff 2 2 lj/cut/coul/long 0.1521 3.157 #O-O epsilon sigma # 0 0
pair_coeff 2 3 lj/cut 1.198 1.587 #O-Cu epsilon sigma
pair_coeff 3 3 eam cu.eam #Cu-Cu

bond_coeff 1 450 0.9572 #O-H
angle_coeff 1 55 104.52 #H-O-H

++++++++++++++++setting+++++++++++++++++++++

neighbor 2.0 bin
neigh_modify delay 0 every 1 check yes

min_modify dmax 0.01
minimize 1.0e-20 0 100000 300000

velocity all create 300.0 4928459 rot yes dist gaussian #23482341

fix 1 hydrogen shake 1e-6 500 0 m 1.0 a 1 #for hydrogen
fix 12 water npt temp 300.0 300.0 100.0 iso 0.0 0.0 1000.0

timestep 0.000002
thermo $d
thermo_style custom step etotal enthalpy pe press ke
thermo_modify flush yes

run 400
reset_timestep 0

gs

Green-Kubo viscosity calculation

Define distinct components of symmetric traceless stress tensor

variable pxy equal pxy
variable pxx equal pxx-press
variable pyz equal pyz

fix SS all ave/correlate $s $p $d &
v_pxy v_pxz v_pyz type auto file S0St.dat ave running

variable scale equal {convert}/({kB}$T)$V*s*{dt}
variable v11 equal trap(f_SS[3]){scale} variable v22 equal trap(f_SS[4])*{scale}
variable v33 equal trap(f_SS[5])
${scale}
thermo_style custom step temp press v_pxy v_pxz v_pyz v_v11 v_v22 v_v33

run 5000

variable v equal (v_v11+v_v22+v_v33)/3.0
variable ndens equal count(all)/vol
print “average viscosity: $v [Pa.s/@ T K, {ndens} /A^3”

This is the error:

ERROR : Variable name for fix ave/correlate does not exist (

This is from your script:

variable pxy equal pxy
variable pxx equal pxx-press
variable pyz equal pyz
fix SS all ave/correlate $s $p $d &
v_pxy v_pxz v_pyz type auto file S0St.dat ave running

The command accesses 3 variables. They are not the

same variables you define.

Steve