Problems with pressure using NVP-NVT

Dears,

I am a beginner in molecular dynamics and I need your help to solve this problem.

I am running a simulation using water/surfactant/decane/surfactant/water with 28438 atoms, 3ns NPT to shrink the box (50x50x120A), obtaining the right density and 2 ns NVT at 323K and 98 atm.

At NPT, the pressure is very good, near 100 atm without big fluctuations. But at NVT the pressure goes down, remaining in equilibrium in 50 atm.

My question is: how should I change the script to maintain the pressure close to 98 atm during NVT steps?

I tried do solve this problem reading the LAMMPS Manual and also here the Mailing Lists. But I was not able.

My Script:

pair_modify mix arithmetic tail yes
kspace_style pppm 1.0e-4

minimize 1.0e-4 1.0e-6 100 1000
reset_timestep 0

fix SHAKE all shake 0.0001 20 0 b 1 3 9 11 a 1

neighbor 2.0 bin

timestep 1.0

variable TK equal 323.15
variable PBAR equal 98.6923

velocity all create ${TK} 123456 rot yes mom yes dist gaussian

variable nsteps equal 2000000 # 2000 #
variable nptsteps equal 3000000 # 2000 #
variable nhalf equal {nsteps}/2 variable nprint equal {nsteps}/2000
variable ndump equal {nsteps}/100 variable xyzdump equal {nsteps}/20
variable padval equal 7 # 5
variable nrdf equal 100 # 10 #
variable Tdamp equal 100 # 10 #
variable Pdamp equal 500 # 50 #

fix 1 all nvt temp {TK} {TK} ${Tdamp}

fix 1 all npt temp {TK} {TK} {Tdamp} iso {PBAR} {PBAR} {Pdamp}

variable xPress equal c_thermo_press[1]
variable yPress equal c_thermo_press[2]
variable zPress equal c_thermo_press[3]

variable IFT equal (0.5lz(v_zPress-0.5*(v_xPress+v_yPress))*0.0101325)

dump 2 all image {xyzdump} nvt.*.jpg type type zoom 1.0 adiam 1.5 size 720 1280 dump_modify 2 pad {padval}

thermo_style custom step pe ke etotal temp press density vol lx ly lz pxx &
pyy pzz pxy pxz pyz v_IFT
thermo ${nprint}

run {nptsteps} unfix 1 fix 2 all nvt temp {TK} {TK} {Tdamp}

fix 2 all npt temp {TK} {TK} {Tdamp} iso {PBAR} {PBAR} {Pdamp}

run ${nsteps}

write_restart restart..lmp
write_data nvt.
.data

Thank you so much for your attention.

Kind regards,

Dr. Flávio Augusto de Freitas

Pós-doutorando na Curtin University

+61 426 814 028

Dears,

I am a beginner in molecular dynamics and I need your help to solve this problem.

I am running a simulation using water/surfactant/decane/surfactant/water with 28438 atoms, 3ns NPT to shrink the box (50x50x120A), obtaining the right density and 2 ns NVT at 323K and 98 atm.

At NPT, the pressure is very good, near 100 atm without big fluctuations. But at NVT the pressure goes down, remaining in equilibrium in 50 atm.

My question is: how should I change the script to maintain the pressure close to 98 atm during NVT steps?

​this is not so simple to say from remote and without knowing more details about your simulation. but there are a few things to consider:

  1. your kspace convergence of 1.0e-4 is not very tight. it may yield sufficiently converged forces for NVT ensemble calculations, where pressure is just a diagnostic, but i would test with a tighter convergence, e.g. 1.0e-5 or even ​1.0e-6
  2. how much does your system shrink? if it shrinks too much, you may need to recompute the structure factors, e.g. use multiple run commands to run parts of the equilibration, as the structure factors are only computed at the beginning of a run and kept the same during the run, assuming the volume changes are small and oscillating around an average value. this issue is enhanced by using a loose kspace convergence.
  3. you seem to have an anisotropic system, enforce isotropic box changes. have you checked the individual pressure components in each direction? are they the same? through isotropic box changes, you may prevent your system to reach equilibrium.
  4. don’t use the final box dimensions, but the average box dimensions over the last part of the equilibration run. condensed systems are not very compressible, so small deviations in length/volume may result in large changes in pressure.
  5. discuss with your adviser/supervisor. what you are asking about are not really LAMMPS issues, but general simulation problems that apply to any MD simulation. this is considered somewhat off-topic for this mailing list. that is, we don’t mind if a person ask about this very rarely, but it is being frowned upon, when people try to (ab)use the mailing list as a replacement from receiving the required tutoring from their adviser/supervisor/colleagues).

I tried do solve this problem reading the LAMMPS Manual and also here the Mailing Lists. But I was not able.

​yes, see my point #5. this is a mailing list about technical issues in using LAMMPS and developing/improving/using specific features in LAMMPS. it is not a maling list dedicated to solving general MD issues like yours.

axel.​