# box with vacuum and pressure

Dear all,

I’m trying to equilibrate a slab with pbc in all three dimensions but with the vacuum in z dimension on top and bottom of the slab.

I have a big enough system meaning 82000 atoms.

I’m using ‘fix 2 all npt temp 300.0 300.0 100.0 iso 0.0 0.0 100. drag 0.2’

I ran the calculation for about 100 ps. The thing is that the average pressure didn’t converge, i.e. if I add, say, 10 more ps, I am getting different value for the average. Fluctuations are ok, between -200, 200 atmospheres. I would think that the MD time is not enough but I have a pretty simple system - a crystal of single element and I think 100ps must be sufficient. I have tried with pdump 1000, higher drag value but no help. Then I coupled only xy and what happened is that z dimension started contracting until it almost reached the slab surface, so that the vacuum was ‘removed’. I would like to ask how is vacuum handled in the pressure calculation, obviously the volume in the pressure formula is the volume of the box.

Thanks for any comments.

Manana,

With or without vacuum, pressure is calculated in the same way:

``````compute		peratom all stress/atom
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)
``````

But the above is based on the condition that the system is hydrostatic. Since your system does not seem to be hydrostatic, the property pressure is not meaningful. Therefore even if it converges it does not mean anything. Rather, monitoring three normal stresses independently is a better choice.

In MD, one does not relax the box dimension with vacuum. In your case, I suggest you use just “x 0 0 pdamp y 0 0 pdamp”, or you may couple xy if you wish, but left z out.

Ray

Dear all,

I'm trying to equilibrate a slab with pbc in all three dimensions but with
the vacuum in z dimension on top and bottom of the slab.

I have a big enough system meaning 82000 atoms.

I'm using 'fix 2 all npt temp 300.0 300.0 100.0 iso 0.0 0.0 100. drag 0.2'

I ran the calculation for about 100 ps. The thing is that the average
pressure didn't converge, i.e. if I add, say, 10 more ps, I am getting
different value for the average. Fluctuations are ok, between -200, 200
atmospheres. I would think that the MD time is not enough but I have a
pretty simple system - a crystal of single element and I think 100ps must be
sufficient. I have tried with pdump 1000, higher drag value but no help.
Then I coupled only xy and what happened is that z dimension started
contracting until it almost reached the slab surface, so that the vacuum was
'removed'. I would like to ask how is vacuum handled in the pressure
calculation, obviously the volume in the pressure formula is the volume of
the box.

neither of both settings make a lot of sense. if you want to keep the
slab configuration, you should not touch the z dimension and leave it
as it. since you have interfaces to vacuum, there is no need to adjust
the box in that direction. at best it makes not difference, at worst
it messes up your simulation, since you get unwanted interactions
between the periodic images of the slab.

axel.