Dear Heng
Thank you for the many interesting questions. Your question made me
realise that I have not tested my system sufficiently rigorously to
know my method works well at high pressure. (See below.)
Sorry to bother. I don't see anything wrong in the script. But this reminds
me a concern when I run a similar system in DPD.
I almost the same thing. One solid slab in the center and liquids around.
My concern is the pressure coupling is based on the total pressure tensors
in the entire simulation box including the contributions from the
liquid-solid interactions (is this correct?).
I think I understand your first question.
The answer to this question depends on whether or not you want the
coordinates of the solid to move as the system expands or contracts at
constant pressure:
1) If you want the solid atoms to expand/contract, then -I-think- you
want to include ALL the forces when you calculate the virial (the
pressure tensor). This includes the contributions from the liquid
atoms pushing on the solid atoms. (In other words: calculate the
pressure tensor in the ordinary way.)
2) However if you do not want the atoms in the solid to move, then you
should not include any forces acting on forces acting on the solid
when you calculate the virial.
We must use "dilate partial" when we apply "fix npt" to the atoms in
the liquid to prevent rescaling of the solid atoms. Here is the
relevant part of my script:
fix 2 mobile npt temp 300.0 300.0 100.0 z 1.0 1.0 1000.0 dilate partial
For this to work 3 things must be true:
a) Forces between atoms in the solid should not be included in the virial.
In my script I use this command to prevent these forces from being calculated:
neigh_modify exclude group immobile immobile
("immobile" is the name of the group of atoms in the solid.)
a) Forces from the liquid pushing on the solid also should not be
included in the virial.
In my script I use this command:
fix 1 immobile rigid single force * off off off torque * off off off
I hope this command has the effect of excluding these forces from the virial
(in addition to keeping the "immobile" group stationary).
Unfortunately I am not sure if this is correct. I am guessing.
(Trung or Tony please correct me if I am wrong. Exactly how does "fix
rigid" modify the virial?)
c) However forces from the solid pushing on the liquid should be
included in the virial.
My "proof" of this is located in equation 9 of the PDF I have attached.
If this is the case, the
pressure in the liquid phase will not equal to the reference pressure we set
in the pressure coupling but a lower value especially for smaller systems (I
suppose most of the simulations systems can be considered small...).
In my simulations, I am satisfied if the liquid has the correct pressure.
(By the way, I don't care what is the pressure inside the solid group
because I use "fix npt ... dilate partial" to prevent the solid atoms
from expanding or contracting. This is option "2)" above. Those atoms
don't move and I don't allow LAMMPS to calculate the forces between
them.)
confirmed it with local pressure measurement based on per-atom stress. The
pressure in the bulk liquid phase is lower than the reference pressure (I
excluded the interaction between solid as well, if that is included, the
pressure will be way off), though not much, but still big enough to
influence some sensitive quantaties (e.g. interfacial tension).
...
So is there any way that the pressure coupling can be implemented without
using the total pressure tensor? The only way I can think of now is making a
caliberation curve.
Perhaps there are two problems that you could be having:
i) LAMMPS is not reporting the pressure correctly (or you are
computing it the wrong way).
ii) LAMMPS is not choosing the correct volume. (There is a problem
with pressure regulation.)
I don't yet know the answer to the first problem (i). I saw several
posts about this topic recently, and when I find out, I will post a
followup message.
However I hope that the input script example file I posted this
morning solves the second problem (ii).
Unfortunately, I am not sure if the pressure in my liquid was equal to
my target pressure because in my tests the systems were initially
equilibrated at very low pressure (1atm). The target pressure could
have been 2atm, and I would not have noticed because the natural
fluctuations in pressure are so much larger (500atm).
In order to learn if "fix rigid" works at high pressures, tonight I
ran two additional simulations of water at high pressure=10000atm,
starting from the original volume (at 1 atm).
"solid-liquid" system. In this simulation, the atoms in the middle
layer were held stationary using "fix rigid" (as explained earlier.)
"pure-liquid" system. In this control system, all of the atoms were
allowed to move.
After pressure equilibration at the higher pressure, the pure-liquid
system compressed by 20%, and the liquid layer in the solid+liquid
system was compressed by a similar percentage ~20% of it's original
volume (+/- 5%). This makes me hopeful that "fix rigid" is working.
However, this is not a very accurate test. More testing is needed.
If I have time to setup more accurate high pressure tests, I will do
it and post the results here.
Cheers.
Andrew
Heng, if you have time, I'm curious to see what happens if you try
these 3 lines in your lammps script:
fix 1 immobile rigid single force * off off off torque * off off off
neigh_modify exclude group immobile immobile
fix 2 mobile npt temp 300.0 300.0 100.0 z 1.0 1.0 1000.0 dilate partial
(You may need to change the temperature and pressure.)
virial_immobile_atoms_sm.pdf (101 KB)