thanks for your reply, and after searched the previous mailing list
(https://lammps.sandia.gov/threads/msg33197.html ) and manual. i found my
problem is about " performing a hybrid simulation in NPT with water atoms in
rigid body, and ethanol not". So I tried the advice in the above mailing
list and modified my input file to "fix npt ethanol npt temp 298 298 100
iso 1 1 1000 dilate ethanol, fix nvt H2O rigid/nvt/small molecule temp 298
298 100". and the error is also, high temperature peaks appears even after
long equilibration runs and the system failed at last with bond atom
missing. So i am confused about how to perform the hybrid simulation with
water atom in rigid body and ethanol in flexibel in Lammps
best regards
Yalishanda
Dear Yalishanda
These kinds of hybrid simulations are complicated to run. I
honestly don't know how to run these hybrid simulations in LAMMPS
correctly. The best help I can provide is to send you a list of
alternative methods you can try. If someone else has an opinion,
please post a reply. If you figure out which of these methods works,
please post again to the list.
As you know, Axel is referring to these two lines from your input file:
fix rigid H2O rigid/npt/small molecule temp 298 298 100 iso 1 1 1000
fix npt ethanol npt temp 298 298 100 iso 1 1 1000
Both of these lines will update the simulation box size in order to
preserve the pressure. You must change your input file so that only
one of these commands controls the box size. If my understanding is
correct, then it does not matter whether you control the pressure
using the fix which moves the rigid H2O molecules, or using the fix
which integrates other flexible molecules in your system. (From the
documentation: "Regardless of what atoms are in the fix group (the
only atoms which are time integrated), a global pressure or stress
tensor is computed for all atoms.")
Here are some alternatives to your approach. I'm not sure which one
of these approaches will produce the correct physical behavior. You
will have to try each, and compare the behavior.
There are multiple reasons a simulation can crash. Try the simplest
simulation first and verify it does not crash. "Method 1" and "Method
2" are constant-volume simulations (not constant pressure). Please
try them and verify that your simulation does not crash before adding
pressure regulation (methods 3-6):
Method 1: NVE simulation. This should run without crashing.
velocity all create 298 4928459
fix fxH2O H2O rigid/small molecule iso 1 1 1000
fix fxEthanol ethanol nve iso 1 1 1000
Method 2: NVT simulation. This should run without crashing.
fix fxH2O H2O rigid/small molecule iso 1 1 1000
fix fxEthanol ethanol nve iso 1 1 1000
fix fxLanvegin all langevin 298 298 100.0 48279
I personally prefer to use "fix langevin" to regulate the temperature
(instead the Nose-Hoover based thermostats you are using). Langevin
dynamics has a much simpler implementation than Nose-Hoover. "fix
langevin" simply applies a random force to the particles similar to
collisions they would experience when immersed in a heat bath. Both
"fix nvt" or "fix npt" use the Nose-Hoover algorithm. I confess I
have forgotten how Nose-Hoover thermostats work, but I worry that
strange behavior could occur when you are applying a Nose-Hoover
thermostat to PART of your system. (Not the whole system. If you
apply Langevin to part of your system, nothing too strange should
happen.)
https://lammps.sandia.gov/doc/fix_langevin.html
If methods 1 and 2 are working, then continue:
Method 3: Apply the pressure regulation to the H2O molecules. Apply a
random force to both H2O and ethanol (using fix langevin).
fix fxH2O H2O rigid/nph/small molecule iso 1 1 1000
fix fxEthanol ethanol nve iso 1 1 1000
fix fxLanvegin all langevin 298 298 100.0 48279
Method 4: Apply the pressure regulation to the ethanol molecules.
Apply a random force to both H2O and ethanol (using fix langevin).
fix fxH2O H2O rigid/small molecule
fix fxEthanol ethanol nve iso 1 1 1000 dilate mobile
fix fxLangevin all langevin 298 298 100.0 48279
Method 5: Regulate the pressure of the system using the H2O molecules
fix fxH2O H2O rigid/nvt/small molecule temp 298 298 100 iso 1 1 1000
fix fxEthanol ethanol nvt temp 298 298 100
https://lammps.sandia.gov/doc/fix_rigid.html
https://lammps.sandia.gov/doc/fix_nve.html
Method 6: Regulate the pressure of the system using the ethanol molecules
You tried this already?
fix fxH2O H2O rigid/nvt/small molecule temp 298 298 100
fix fxEthanol ethanol npt temp 298 298 100 iso 1 1 1000 dilate ethanol
https://lammps.sandia.gov/doc/fix_rigid.html
If you tried this and it did not work, there are other reasons a
simulation can crash. In that case, probably "Method 1" (described
earlier) should also crash. So try method 1 first.
HOPEFULLY one of these methods work (method 3-6).
If not, then try method 7 and 8 below.
Is it correct to apply a Nose-Hoover thermostat to both the H2O
molecules and the ethanol molecules? I honestly don't remember. The
next 2 methods apply temperature regulation to EITHER H2O OR ethanol.
send your
Method 7: Regulate the temperature and pressure of the system using
the H2O molecules
fix fxH2O H2O rigid/nvt/small molecule temp 298 298 100 iso 1 1 1000
fix fxEthanol ethanol nve
compute tempH20 H20 temp
fix_modify fxH20 temp tempH20
Method 8: Regulate the temperature and pressure of the system using
the ethanol molecules
fix fxH2O H2O rigid/small molecule
fix fxEthanol ethanol npt temp 298 298 100 iso 1 1 1000 dilate ethanol
I also suggest you create a version TIP5P which is ALMOST rigid.
Use strong, stiff bonds and angles to preserve the shape of the TIP5P
molecule (at least 2000.0), and reduce the timestep to 0.05fs or less
(to prevent numerical instability resulting from these stiff bonds).
You will not use this in your final simulations, because it is
inefficient to use such a small timestep. However you can compare the
simulations you run using methods 3-6 with a simulation using no rigid
molecules, to see which of these methods reproduces the correct
potential energy and volume.
I am sorry that I cannot tell you which method to use.
Good luck.
Andrew
P.S.
TIP5P is a water model I would love to include with moltemplate.
If you get this working, would you be willing to submit "tip5p.lt"
file so I can put it on the moltemplate web page and git download
page? (I can add your name to the list of contributors if you like.)