Dear all,

I’m trying to use compute heat/flux command to calculate thermal conductivity of Cu-Ar nanofluids while facing an error which goes :

ERROR: Invalid thermo keyword in variable formula (…/variable.cpp:2008)

I’ve checked my program and found no error. Besides, i notice that while the fix ave/correlate command was annotated, the error disappeared.(although the error messege says error relates to the variable formula) I’m confused about this problem and i appreciate any advice.

Part of my program is as follows: (I’m using LAMMPS (8 Jun 2016-ICMS))

# thermpal conductivity calculation

compute ArKe Ar ke/atom

# per-atom vector

compute ArPe Ar pe/atom

# per-atom vector

compute ArS Ar stress/atom NULL virial

# per-atom vector

compute ArFlux Ar heat/flux ArKe ArPe ArS

# 6 component vector:[Jx Jy Jz Jx_v Jy_v Jz_v]

compute ArVelo Ar property/atom vx vy vz

# 3 per-atom vectors

variable ArEnthalpy equal ave(c_ArKe)+ave(c_ArPe)

# scalar

variable ArfluxX equal c_ArFlux[1]-(v_ArEnthalpy*sum(c_ArVelo[1]))

# scalar, partial enthalpy of each atom

variable ArfluxY equal c_ArFlux[2]-(v_ArEnthalpy*sum(c_ArVelo[2]))
variable ArfluxZ equal c_ArFlux[3]-(v_ArEnthalpy*sum(c_ArVelo[3]))

compute CuKe Cu ke/atom

compute CuPe Cu pe/atom

compute CuS Cu stress/atom NULL virial

compute CuFlux Cu heat/flux CuKe CuPe CuS

compute CuVelo Cu property/atom vx vy vz

variable CuEnthalpy equal ave(c_CuKe)+ave(c_CuPe)

variable CufluxX equal c_CuFlux[1]-(v_CuEnthalpy*sum(c_CuVelo[1]))
variable CufluxY equal c_CuFlux[2]-(v_CuEnthalpy*sum(c_CuVelo[2]))

variable CufluxZ equal c_CuFlux[3]-(v_CuEnthalpy*sum(c_CuVelo[3]))

variable fluxX equal ArfluxX+CufluxX

# scalar

variable fluxY equal ArfluxY+CufluxY

variable fluxZ equal ArfluxZ+CufluxZ

fix JJ all ave/correlate $s $p $d &

v_fluxX v_fluxY v_fluxZ type auto &

file profile.heatflux ave running

# error occurs here

#variable scale equal s*dt*{convert}/vol/${kB}/$t/t
#variable k11 equal trap(f_JJ[3])*{scale}

#variable k22 equal trap(f_JJ[4])*{scale}
#variable k33 equal trap(f_JJ[5])*{scale}

#variable kappa equal (v_k11+v_k22+v_k33)/3.0

thermo $d

thermo_style custom step temp density

# v_fluxX v_fluxY v_fluxZ v_k11 v_k22 v_k33 v_kappa

dump 4 all xyz 5000 calculation.xyz

run ${step_2}

Best regards,

George