Questions on Using two fixes recenter

Dear all,

I am trying to model a droplet on a solid substrate using LAMMPS. The version I am using is 30-JUL-16.

In order to use a cylinder binning style in compute chunk/atom, I would like to fix both x and y coordinates of center of mass of the droplet and fix z coordinate of the center of mass of solid substrate by using following:

fix 3 liquid recenter INIT INIT NULL shift all
fix 4 solid recenter NULL NULL INIT shift all

Since one fix recenter has to be placed before the other, there will be a warning:

WARNING: Fix recenter should come after all other integration fixes (…/fix_recenter.cpp:133)

Based on your experience and understanding, would you think that it is fine to use two fix recenter in this way?

By the way, I have a quick question about using fix nvt. It would be great if you could also comment on it. To equilibrate such system to meet certain temperature using nose hoover thermostat, is it ok to apply two fix nvt separately to liquid and solid?

What I found was when I only used a fix nvt to the whole system, I would get more vapor particles. I think this is because the mass of the particles are different between solid and liquid.

Any suggestions or thoughts will be appreciated.

Kind regards,
Hugh Huang

Dear all,

I am trying to model a droplet on a solid substrate using LAMMPS. The
version I am using is 30-JUL-16.

In order to use a cylinder binning style in compute chunk/atom, I would like
to fix both x and y coordinates of center of mass of the droplet and fix z
coordinate of the center of mass of solid substrate by using following:

fix 3 liquid recenter INIT INIT NULL shift all
fix 4 solid recenter NULL NULL INIT shift all

Since one fix recenter has to be placed before the other, there will be a
warning:

WARNING: Fix recenter should come after all other integration fixes
(../fix_recenter.cpp:133)

Based on your experience and understanding, would you think that it is fine
to use two fix recenter in this way?

no. it makes no sense. the application of the second fix will negate
the impact of the first.

By the way, I have a quick question about using fix nvt. It would be great
if you could also comment on it. To equilibrate such system to meet certain
temperature using nose hoover thermostat, is it ok to apply two fix nvt
separately to liquid and solid?

yes and no. it doesn't matter how you get to equilibrium, but with two
separate fix nvt you'll have a different system. whether that is the
desired state or not, cannot be said in this general fashion.

What I found was when I only used a fix nvt to the whole system, I would get
more vapor particles. I think this is because the mass of the particles are
different between solid and liquid.

that reasoning doesn't convince me. instead, your description sounds
like you have different amounts of potential energy stored in your
subsystems leading to different initial temperatures in your two
subsystems, which may take some time to reach equilibrium. since
evaporation is an activated process, it is difficult to say without
knowing any details, which of the two situations is the equilibrium
state. probably neither.

i would suggest to first run a brief minimization before starting MD
and then start equilbration with a dissipative thermostat, e.g. fix
langevin + fix nve, to enforce fast equipartitioning of the kinetic
energy and later switch to fix nvt. if this still leads to different
temperatures, you may need to check whether other simulation
parameters like time step or potential parameters are adequate.

axel.

Dear all,

I am trying to model a droplet on a solid substrate using LAMMPS. The
version I am using is 30-JUL-16.

In order to use a cylinder binning style in compute chunk/atom, I would like
to fix both x and y coordinates of center of mass of the droplet and fix z
coordinate of the center of mass of solid substrate by using following:

fix 3 liquid recenter INIT INIT NULL shift all
fix 4 solid recenter NULL NULL INIT shift all

Since one fix recenter has to be placed before the other, there will be a
warning:

WARNING: Fix recenter should come after all other integration fixes
(../fix_recenter.cpp:133)

Based on your experience and understanding, would you think that it is fine
to use two fix recenter in this way?

no. it makes no sense. the application of the second fix will negate
the impact of the first.

correction. i missed the different placement of NULL and INIT.
the use of fix recenter should be legal, but i would be very worried,
why this is needed.
you may be masking an unphysical center of mass drift of your system.

Dear Axel,

Thank you very much for your reply and suggestions.

I would like to explain why I want to use two fix recenter in this way.

I want to measure the contact angle between droplet and solid substrate, hence I will need to use cylinder binning for plotting a 2D density profile. When computing the chunk averaging for the droplet, I want to fix z-coordinates of solid substrate. This way it won’t fluctuate or drift because of the interactions between particles and I can measure the angle easily by telling where the top layer has been. At the same time, keeping x and y coordinates of center of mass of the droplet(liquid) is needed for cylinder binning (to meet the input values c1 (x) and c2 (y) in radial dimension).

My thoughts was with ‘shift all’ at the end, this should be fine because the whole system are shifted independently in 3 dimensions(x,y,z). Since you have mentioned this may cause unphysical drift of the center of mass of the system, would you be able to explain this a bit more to me? Would this cause artificial errors during calculations/time integration? What would it be different from if I only fix the x and y coordinates of center of mass of the droplet?

Thank you again for your suggestions on my nvt question. I will give it a try.

Many thanks,
Hugh

Dear Axel,

Sorry that I forgot to ask this in my previous email.

To determine when such system reaches the equilibrium state, is it just to monitor the total energy of system? Or other ways would also work such as monitor the number of particles in the cluster (droplet)?

Regards,
Pengyu

Dear Axel,

Thank you very much for your reply and suggestions.

I would like to explain why I want to use two fix recenter in this way.

I want to measure the contact angle between droplet and solid substrate,
hence I will need to use cylinder binning for plotting a 2D density profile.
When computing the chunk averaging for the droplet, I want to fix
z-coordinates of solid substrate. This way it won't fluctuate or drift
because of the interactions between particles and I can measure the angle
easily by telling where the top layer has been. At the same time, keeping x
and y coordinates of center of mass of the droplet(liquid) is needed for
cylinder binning (to meet the input values c1 (x) and c2 (y) in radial
dimension).

fix recenter doesn't immobilize your substrate, it just translates it
so that its center of mass coordinates are unchanged.
in other words, the system remains unchanged, you essentially are
changing (i.e. translating) your frame of reference.

My thoughts was with 'shift all' at the end, this should be fine because the
whole system are shifted independently in 3 dimensions(x,y,z). Since you
have mentioned this may cause unphysical drift of the center of mass of the
system, would you be able to explain this a bit more to me? Would this cause

you didn't pay attention to what i wrote. i didn't say fix recenter
*causes* a drift, i said it could *hide* a drift.

Dear Axel,

Sorry that I forgot to ask this in my previous email.

To determine when such system reaches the equilibrium state, is it just to
monitor the total energy of system? Or other ways would also work such as
monitor the number of particles in the cluster (droplet)?

this is impossible to say in this generality. you'll never know for
certain whether a system is in equilibrium, except for the most
trivial cases.
usually it doesn't matter if you have a "perfect" equilibrium, but you
need to be sufficiently close, so that the error caused is negligible
relative to the systematic error of the calculation of the property
you want to determine.

in your case, i would expect a significant systematic error, as your
results may depend, for example on how many layers you use for
determining the density profile and several other geometrical
properties, not to mention that you are trying to compute a property
that is well defined for macroscopic calculations, but less so on the
atomic scale.

axel.

Dear Axel,

Thank you again for the very useful comments.

Sorry that I did not see what you meant before about hiding the drift.

Regards,
Pengyu

Dear Axel,

I’ve tried what you suggested before for equilibrating my system:

"i would suggest to first run a brief minimization before starting MD
and then start equilbration with a dissipative thermostat, e.g. fix
langevin + fix nve, to enforce fast equipartitioning of the kinetic
energy and later switch to fix nvt. if this still leads to different
temperatures, you may need to check whether other simulation
parameters like time step or potential parameters are adequate.

"

With a Langevin thermostat, both groups can meet the same targeted temperature. After switching to fix nvt, temperature of individual group starts to diverge a bit, although the overall temperature of the entire system stays constant. I find Steve has commented on something similar before from http://lammps.sandia.gov/threads/msg04621.html :

"First, I would setup compute temp commands on

<i>both groups (oil & water).  Then I would verify
that they both start at 300 and then diverge (one
gets hot and one get's cold) but that the combination
of both groups stays at 300.

If that happens, then it is a possible outcome of using
one NVT thermostat on a heterogeneous group of
molecules.  Basically, the thermostat applies a global
scaling factor which can affect different modes (molecules)
differently.  One solution is to use 2 NVT thermostats,
one for water, one for oil.  Another solution is to use a
different thermostat, like Langevin, which is applied
to each atom individually and typically doesn't have that
problem.

Steve"</i>

Does this mean that if I want to use a nose-hoover thermostat and keep both groups at same temperature, I have to use two NVT?   

Thanks for your time again.

Regards,
Pengyu

Dear Axel,

I've tried what you suggested before for equilibrating my system:

"i would suggest to first run a brief minimization before starting MD
and then start equilbration with a dissipative thermostat, e.g. fix
langevin + fix nve, to enforce fast equipartitioning of the kinetic
energy and later switch to fix nvt. if this still leads to different
temperatures, you may need to check whether other simulation
parameters like time step or potential parameters are adequate.
"

With a Langevin thermostat, both groups can meet the same targeted
temperature. After switching to fix nvt, temperature of individual group
starts to diverge a bit, although the overall temperature of the entire
system stays constant. I find Steve has commented on something similar
before from http://lammps.sandia.gov/threads/msg04621.html :

"First, I would setup compute temp commands on

both groups (oil & water). Then I would verify
that they both start at 300 and then diverge (one
gets hot and one get's cold) but that the combination
of both groups stays at 300.

If that happens, then it is a possible outcome of using
one NVT thermostat on a heterogeneous group of
molecules. Basically, the thermostat applies a global
scaling factor which can affect different modes (molecules)
differently. One solution is to use 2 NVT thermostats,
one for water, one for oil. Another solution is to use a
different thermostat, like Langevin, which is applied
to each atom individually and typically doesn't have that
problem.

Steve"

Does this mean that if I want to use a nose-hoover thermostat and keep both
groups at same temperature, I have to use two NVT?

there is no general "do this, not that" answer to these kind of
situations. one usually has to answer with "it depends".
the main question is: why does the temperature in those two groups
diverge? one possible reason is, that your time step is too large of
one, but not the other and hence the error differs, which will lead to
differing kinetic energy and since the thermostat will remove energy
globally, the separation occurs. in this case, using two thermostats
will simply hide your error in integrating the equations of motion.
there may be other reasons.

a simple test would be to run the equilibrated system with fix nve and
observe the two groups. and then try out different (shorter) time
steps to see, if that makes a difference.

axel.