fix ave/correlate/long

Dear LAMMPS users,

I am working on the viscosity calculation in which I have a problem of integrating tensor components and writing output after “fix ave/correlate/long”. However, I do not have any problem while using “fix ave/correlate” command. I am using “lammps-30Jul16” version. Here below my input script,

The below once works fine,

fix TEN all ave/correlate 5 400 2000 v_pxy v_pxz type auto file correlation1.dat ave running

variable vxy equal trap(f_TEN[3])

variable vxz equal trap(f_TEN[4])

thermo_style custom step temp press v_vxy v_vxz

thermo 2000

In the case of “fix ave/correlate/long”, the manual explains this fix is similar to “fix ave/correlate” one. Therefore,

fix TEN all ave/correlate/long 5 2000 v_pxy v_pxz type auto file correlation2.dat

variable vxy equal trap(f_TEN[1])

variable vxz equal trap(f_TEN[2])

thermo_style custom step temp press v_vxy v_vxz

thermo 2000

My problem is, when I use “thermo_style multi” command I do not receive any problem, however when I switch to “thermo_style custom” like the above one, I get “ERROR: Mismatched fix in variable formula” error. I would like to integrate and write viscosity components at every Nfreq steps (2000, in this case). It would be great if someone helps me out from this issue.

Common errors in the manual say for this particular Error:

Mismatched fix in variable formula: A fix is referenced incorrectly or a fix that produces per-atom values is used in an equal-style variable formula.

I wonder if the above two fixes almost similar, it should work. Am I missing something here?

Thanks in advance

Regards,

Veerapandian

Dear LAMMPS users,

I am working on the viscosity calculation in which I have a problem of
integrating tensor components and writing output after “fix
ave/correlate/long”. However, I do not have any problem while using “fix
ave/correlate” command. I am using “lammps-30Jul16” version. Here below my
input script,

can you please provide a *complete* input script for a *small* system,
so that the situation can be easily reproduced and debugged.
at the moment your description is incomplete and particularly relevant
variable definitions are missing.

axel.

Dear Axel,

Thanks for your reply. Here below, I provide the example of Argon system from the manual

# Sample LAMMPS input script for viscosity of liquid Ar

units real

variable T equal 86.4956

variable V equal vol

variable dt equal 4.0

variable p equal 400 # correlation length

variable s equal 5 # sample interval

variable d equal $p*$s # dump interval

variable kB equal 1.3806504e-23 # [J/K/** Boltzmann}

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}

dimension 3

boundary p p p

lattice fcc 5.376 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1

region box block 0 4 0 4 0 4

create_box 1 box

create_atoms 1 box

mass 1 39.948

pair_style lj/cut 13.0

pair_coeff * * 0.2381 3.405

timestep ${dt}

thermo $d

velocity all create $T 102486 mom yes rot yes dist gaussian

fix NVT all nvt temp $T $T 10 drag 0.2

run 8000

reset_timestep 0

############ave/correlate##############

variable pxy equal pxy

variable pxz equal pxz

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 vxy equal trap(f_SS[3])*${scale}

variable vxz equal trap(f_SS[4])*${scale}

variable vyz equal trap(f_SS[5])*${scale}

thermo_style custom step temp press v_pxy v_pxz v_pyz v_vxy v_vxz v_vyz

run 100000

############ave/correlate/long##############

variable pxy1 equal pxy

variable pxz1 equal pxz

variable pyz1 equal pyz

fix SS1 all ave/correlate/long $s $d v_pxy1 v_pxz1 v_pyz1 type auto file S0Stlong.dat

variable scale equal {convert}/({kB}$T)$V*s*{dt}

variable v11 equal trap(f_SS1[1])*${scale}

variable v22 equal trap(f_SS1[2])*${scale}

variable v33 equal trap(f_SS1[3])*${scale}

thermo_style custom step temp press v_pxy1 v_pxz1 v_pyz1 v_v11 v_v22 v_v33

#thermo_style multi

run 100000

veera

Dear LAMMPS users,

I am working on the viscosity calculation in which I have a problem of
integrating tensor components and writing output after “fix
ave/correlate/long”. However, I do not have any problem while using “fix
ave/correlate” command. I am using “lammps-30Jul16” version. Here below my
input script,

The below once works fine,

fix TEN all ave/correlate 5 400 2000 v_pxy v_pxz type auto file
correlation1.dat ave running

variable vxy equal trap(f_TEN[3])

variable vxz equal trap(f_TEN[4])

thermo_style custom step temp press v_vxy v_vxz

thermo 2000

In the case of “fix ave/correlate/long”, the manual explains this fix is
similar to “fix ave/correlate” one. Therefore,

fix TEN all ave/correlate/long 5 2000 v_pxy v_pxz type auto file
correlation2.dat

variable vxy equal trap(f_TEN[1])

variable vxz equal trap(f_TEN[2])

thermo_style custom step temp press v_vxy v_vxz

thermo 2000

My problem is, when I use “thermo_style multi” command I do not receive any
problem, however when I switch to “thermo_style custom” like the above one,
I get “ERROR: Mismatched fix in variable formula” error. I would like to
integrate and write viscosity components at every Nfreq steps (2000, in this
case). It would be great if someone helps me out from this issue.

Common errors in the manual say for this particular Error:

Mismatched fix in variable formula: A fix is referenced incorrectly or a fix
that produces per-atom values is used in an equal-style variable formula.

I wonder if the above two fixes almost similar, it should work. Am I missing
something here?

yes. fix ave/correlate/long does not have the equidistant "correlation
buffer(s)", that you can integrate over. hence the omission of the
Nrepeat keyword, which determines the size of this kind of buffer.
hence you cannot use the following expressions with it:

variable v11 equal trap(f_SS1[1])*\{scale\} variable v22 equal trap\(f\_SS1\[2\]\)\*{scale}
variable v33 equal trap(f_SS1[3])*${scale}

axel.

Dear Axel,
Thanks for your reply.
I agree with you that there is no Nrepeat keyword to integrate over in the case of correlate/long.
Is there any possibility to integrate the resulting "fix ave/correlate/long" values in lammps?

Thank you

veera

Dear Axel,
Thanks for your reply.
I agree with you that there is no Nrepeat keyword to integrate over in the case of correlate/long.
Is there any possibility to integrate the resulting “fix ave/correlate/long” values in lammps?

How could you integrate over what isn’t there?