Regarding compute stress/atom

Hi,

I am doing MD simulations on Oil-Water systems to calculate their interfacial tension using OPLS-AA. My scripts in LAMMPS are working fine and I am using “compute stress/atom” to calculate out IFT in through following piece of input.

compute peratom all stress/atom

variable dx1 equal 0.002

variable st1 atom (0.5*(c_peratom[2]+c_peratom[3])-c_peratom[1])/(3lylz*v_dx1)

fix 1 all ave/spatial 100 1 100 x lower ${dx1} v_st1 units reduced file “int_tensionprofile_0.002.dat” ave running overwrite

To get the interfacial tension, I add up the quantity st1 which I get for each bin and multiply it by bin size to get interfacial tension between Oil and Water system(Using Kirkwood-Buff formalism). But I am not able to arrive at correct IFT. The calculated value varies with bin size(dx1).

I have a doubt about compute stress/atom

As mentioned in the documentation of this document, they mention “It is really a stressvolume formulation, meaning the computed quantity is in units of pressurevolume. It would need to be divided by a per-atom volume to have units of stress”.

So when I calculate this variable st1, Do I need to divide by slab volume(which I am doing right now) or Do I need to divide by box volume( which I also checked and the values doesn’t vary with bin size but when I change the box-size, it changes) or Do I need to divide by atom volume( which seems impossible to me as my box is anisotropic in nature and I can’t divide Box volume by number of atoms)?

Any suggestions?

Thanks in advance.

P.S. : I read the threads on the same compute but couldn’t figure out much from the discussions.

Hi,

    I am doing MD simulations on Oil-Water systems to calculate their
interfacial tension using OPLS-AA. My scripts in LAMMPS are working fine and
I am using “compute stress/atom” to calculate out IFT in through following
piece of input.

[...]

So when I calculate this variable st1, Do I need to divide by slab
volume(which I am doing right now) or Do I need to divide by box volume(
which I also checked and the values doesn’t vary with bin size but when I
change the box-size, it changes) or Do I need to divide by atom volume(
which seems impossible to me as my box is anisotropic in nature and I can’t
divide Box volume by number of atoms)?

Any suggestions?

i am not an expert on this, but it may be that you could benefit from
that additional code that takenobu nakamura (cc'd) has been developing
and presented at the last LAMMPS workshop in ABQ.

axel.

As mentioned in the documentation of this document, they mention “It is really a stressvolume formulation, meaning the >computed quantity is in units of pressurevolume. It would need to be divided by a per-atom volume to have units of stress”.

So when I calculate this variable st1, Do I need to divide by slab volume(which I am doing right now) or Do I need to divide by >box volume( which I also checked and the values doesn’t vary with bin size but when I change the box-size, it changes) or Do >I need to divide by atom volume( which seems impossible to me as my box is anisotropic in nature and I can’t divide Box >volume by number of atoms)?

This complexity is why LAMMPS doesn’t attempt to do it for you. There’s no

one right answer to the question. And its more of a

stats/averaging question, than it is a LAMMPS question.

You can also look at compute voronoi/atom which can give you a reasonable

estimate of per-atom volume.

Steve