something wrong in NPT

Dear Axel,

Thanks so much for your patience and nice reply. I really appreciate those unsung heroes, just like you, aidan…

I carefully thought about your comments and want to find some possible solutions to calculate what I want to do using LAMMPS.

three comments:

a) npt and nvt are the wrong ensembles for this kind of system,
at least for production. you want nve and non-periodic boundaries.

b) the “macroscopic” pressure for your system needs to be
computed differently than for a bulk system.

c) of course the volume of your system is the volume of the
simulation cell not just the enclosed volume of your setup.

axel.

In order to aviod the above mentioned problems. Perhaps I could use something like a piston to add a force/pressure on fluid with the system controlling by langevin thermostat. Here, the force direction should be non-periodic.

I did several tests and fond that in NPT('fix 2 part2 npt temp 300.0 300.0 10.0 z 1000.00 1000.00 10.0 dilate partial '), the temperature of fluid (part2) was always fluctuate around 350K but not the needed one (300K). Beside, the temperature of the entire system keeping 300K. That is to say, 50 K should be substracted from the fluid atoms. I changed the input fix command like this:
'fix 2 part2 npt temp 250.0 250.0 10.0 z 1000.00 1000.00 10.0 dilate partial.

Then, fluid temperature fluctuated around 300K. After NPT, another NVT was performed:

'fix 3 part2 nvt temp 300.0 300.0 10.0 ’

Fluid temperature was also 300K.

Now, it seems everything looks good. Just like what you said, something like very rare “two wrongs make a right” kind of deals ’ happened. I believe it is caused by some wrong volume issue and I think I need to add a piston than perform NPT in the system.

Thanks very much,

Hangyan

2011-09-23

Dear Axel,

Thanks so much for your patience and nice reply. I really appreciate
those unsung heroes, just like you, aidan...

well, i wouldn't call myself "unsung".
i "sing" very loudly. up to the point
that i get credit for work that i didn't
do, but simply explain to others.

I carefully thought about your comments and want to find some possible
solutions to calculate what I want to do using LAMMPS.

three comments:

a) npt and nvt are the wrong ensembles for this kind of system,
   at least for production. you want nve and non-periodic boundaries.

b) the "macroscopic" pressure for your system needs to be
   computed differently than for a bulk system.

c) of course the volume of your _system_ is the volume of the
    simulation cell not just the enclosed volume of your setup.

axel.

In order to aviod the above mentioned problems. Perhaps I could use
something like a piston to add a force/pressure on fluid with the

yes. a piston-like setup makes much more sense.
i suspect that a lot of the problems that people
have in understanding what an npt ensemble is
representing originates in assuming that those
two are the same.

system controlling by langevin thermostat. Here, the force direction
should be non-periodic.

the problem is not nvt vs. nve+langevin (i would contend that langevin
in this case would be worse than nvt) but the question of what
your system is coupling to *at all*. if you have a confined system,
there is no bulk to couple to, so if your system will heat up during
compression, it is a real physical effect. a thermostat would
manipulate that and thus make your simulation less realistic.
OTOH, there is the energy drift from numerical noise and truncation
and discretization errors that is unphysical, too.

thus i would start with nve and then see what kind of a total
energy drift you accumulate (with the piston is fixed position),
and then run nvt adjusted in a way to remove that drift, but only
barely so. that should give you a long enough reaction time of
the thermostat to not mess up your simulation by removing kinetic
energy too eagerly.

I did several tests and fond that in
NPT('fix 2 part2 npt temp 300.0 300.0 10.0 z 1000.00 1000.00 10.0 dilate partial '), the temperature of fluid (part2) was always fluctuate around 350K but not the needed one (300K). Beside, the temperature of the entire system keeping 300K. That is to say, 50 K should be substracted from the fluid atoms. I changed the input fix command like this:
'fix 2 part2 npt temp 250.0 250.0 10.0 z 1000.00 1000.00 10.0 dilate partial.

Then, fluid temperature fluctuated around 300K. After NPT, another NVT
was performed:

'fix 3 part2 nvt temp 300.0 300.0 10.0 '

Fluid temperature was also 300K.

Now, it seems everything looks good. Just like what you said,
something like very rare "two wrongs make a right" kind of deals '
happened. I believe it is caused by some wrong volume issue and I
think I need to add a piston than perform NPT in the system.

please make sure your nomenclature is accurate.
you _don't_ want to do an npt ensemble simulation.
you want to do a "pressure controlled" simulation
of a confined system. that is a cat of a very
different color.

cheers,
    axel.