How "vol" is calculated?

Dear Lammps users,
Among the thermo_style keywords, there is something as “vol”. Is this the volume of the simulation box or the volume which the groups of all particles has occupied? Or this the sum of the volumes belong to any particle (seen the volume of an atom is still under debate)?
And how this is calculated?
Thanks and best regards,
Fahim

Dear Lammps users,
Among the thermo_style keywords, there is something as "vol". Is this the
volume of the simulation box or the volume which the groups of all particles
has occupied? Or this the sum of the volumes belong to any particle (seen
the volume of an atom is still under debate)?

vol is the volume of the simulation box.

the other "volumes" you mention are all ill-defined, not under debate.

axel

Thus, the alternative method for calculating the pressure described at http://lammps.sandia.gov/doc/compute_stress_atom.html may not be true for the systems where, say, the liquid does not entirely filled up the simulation box. right?

Fahim

As the compute stress/atom doc page states:

Note that as defined in the formula, per-atom stress is the negative of the per-atom pressure tensor. It is also 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 (pressure), but an individual atom’s volume is not well defined or easy to compute in a deformed solid or a liquid. See the compute voronoi/atom command for one possible way to estimate a per-atom volume.

Steve

I mean these three commands:

compute peratom all stress/atom NULL
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]
variable press equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)

In case we have a soft matter which does not fill up the entire simulation box, would the variable “press” defined above truly yield the pressure of the system (seen the “vol” is not the system volume but the simulation box volume)?

Thanks,
Fahim

I mean these three commands:

compute peratom all stress/atom NULL
compute p all reduce sum c_peratom[1] c_peratom[2] c_peratom[3]
variable press equal -(c_p[1]+c_p[2]+c_p[3])/(3*vol)

In case we have a soft matter which does not fill up the entire simulation
box, would the variable "press" defined above truly yield the pressure of
the system (seen the "vol" is not the system volume but the simulation box
volume)?

but your "system" *is* the entire simulation box (i.e. where your
atoms can go) and you are computing the pressure for that. remember
that pressure constitutes the averaged force per area of the given
volume and it phenomenologically represents the force to move that
boundary (or rather grow or shrink your simulation box or other
representative volume in this case).
so whatever you compute in this expression is the correct pressure as
experienced by the entire simulation box and should be the same as
would you get from compute pressure.

now you can make assumptions or derive expressions over how each
individual atom contributes to the total pressure and volume and then
turn this around and compute a pressure for subsystems or even
individual atoms, but as pointed out before, the definition of volume
in such cases is often difficult, ambiguous, or flat out ill-defined
and that makes the resulting numbers rather approximative (not
counting for statistical uncertainty due to the often large
fluctuations between time steps in condensed matter) if not totally
meaningless.

axel.

I will address this question in a different way. What LAMMPS does is mathematically very straightforward. If we disregard the contributions from atom velocities, both your variable v_press, as well as LAMMPS default definition of the thermo variable press, are exactly equal to a very simple derivative of the total potential energy: -dPE/dV. There are an infinite number of ways to deform a box to achieve a particular scalar change in volume dV. The obvious, natural, and computationally most convenient choice is to let all three box dimensions change in the same proportion and to let the atom positions change in proportion to the changes in the box dimensions a.k.a isotropic affine dilation/contraction. For a homogeneous material this is a good choice. For a heterogeneous material, perhaps not, but other choices introduce a host of mathematical and computational difficulties. A better strategy would be to use the LAMMPS per-atom stress to compute pressure in subvolumes that you believe to be fairly homogeneous.

Aidan

1 Like