How to reach to a desired( or properly equilibrated) pressure in NVT ensemble in LAMMPS?

    I've been working on an ionic liquid that I was involved in
simulating with Lammps, but when I started to write its paper, I found a
mistake (or a neglect) that makes almost all the results useless. I
would always compare the pVT simulation data with the corresponding
experimental data with an error below 3% for the comparison of V of
simulation and experimental (in P, T similar), and so I assumed my
simulations are validated, but when a couple of weeks ago, I compared p
simulation and experimental (in V, T similar), I found a very weird
error of 50, sometimes 300%. Because of the pressure difference, I
thought that this could be because of the NVT ensemble pressure
fluctuation, and maybe it cannot reach the equilibrium( I used a big
simulation�time and the error percent�between two following
average pressure was revolving�around almost 8%), so I tried to use
pressure control methods, so I added the following commands:

    fix 1 all nve / limit 0.01
  
    fix 2 all box / relax iso 1184 vmax 0.001
  
    run 100000

    unfix 1

    unfix 2

    fix 3 all press / berendsen iso 1184 1184 100000.0
  
    run 50000

    unfix 3

    the main input was as follows:(I included the new commands too),

    units real

    dimension 3

    boundary p p p

    atom_style full

    pair_style lj / cut / coul / long 11

    pair_modify mix geometric tail yes

    kspace_style pppm 1.0e-4

    read_data ionicdata.data

    neighbor 2.0 bin

    neigh_modify delay 2 every 1 check yes

    fix 1 all nve / limit 0.01
  
    fix 2 all box / relax iso 1184 vmax 0.001
  
    run 100000

    unfix 1

    unfix 2

    fix 3 all press / berendsen iso 1184 1184 100000.0
  
    run 50000

    unfix 3

    fix 6 all nvt temp 350 350 10.0

    run 1,000,000
  
    I tried to include all the important parts. My first question is that,
in your opinion, these additional commands will have any effect on the
issue, and will they help me to get the desired and equilibrated
pressure? The second question is that I still encounter errors, and I am
trying to fix them, so if you have any comments about these codes or the
new ones that I can use to get the desired pressure, please mention in
your answer.
  
    I would appreciate any advice.

    Thank you in advance

  �

  Hosein Geraili Daronkola

  M.Sc.Graduated of physical chemistry

  Physical Chemistry,

  Department of Chemistry,

  Sharif University of Technology.

  [email protected]

I am having trouble making sense of what exactly you were expecting, what went wrong, etc. Are you saying initially the pressures, temperatures and volumes you got were in the same ballpark as the experiments, and when you checked later they weren’t? If so, how did your checks before and after differ? You’re not making it very easy for people to help you with so little information. Remember that no one can read your mind.

About your input: fix 3 is definitely bogus. Fix press/berendsen does not do time integration, so you need to use it in combination with a “fix nve” or “fix nvt” in order to do anything.

With regards to the equilibration issue, all I can say is that if your pressure, volume and/or temperature are not constant in time, they for sure cannot be in equilibrium. The reverse is not necessarily true. If they are steady state, you should wonder whether or not what you are seeing makes sense to you. Is the steady-state pressure you end up with close to what you put in the barostat? Does the pressure stay at the average pressure even after you disable pressure control? You use real units, so does the pressure you see make any sort of sense on a physical level?

hosein,

i have to agree with stefan, it is near impossible to make sense out of your (too) many e-mails (please think everything through and present a cohesive description of what you are worrying about, not a “brain dump” every hour).

some general comments:

  • your simulation protocol makes little sense. typically one would run a minimization before running MD. using nve/limit should only be needed for pathologically bad setups (after minimization), which indicates, that perhaps part of the problem is the generation of the starting geometry. furthermore, fix box/relax is mean for use with minimization, not MD. as stefan already mentioned fix press/berendsen is pointless without a time integration fix.
  • you seem to be ignoring the fact, that dense liquids are not very compressible. so even a small change in volume can result in large changes in pressure.
  • …and there are no remarks about the most important issue: is your force field supposed to reproduce experimental data? most classical force fields deviate from the experiment in multiple properties. even DFT calculations can be off significantly. i would expect that to be an issue for ionic liquids unless you have parameters that are specifically parameterized to reproduce experimental density/pressure/temperature data. in that case, you would simply have to follow the protocol described in the relevant publications
  • i am surprised that you are mentioning writing this up for a paper, when there are such fundamental open questions, lack of background knowledge, and mistakes in basic simulation protocols.

axel.