Increasing the box size under npt ensemble

Dear all,
When I use fix NPT, the size of my simulation box increases in three dimensions continuously. (T300, P0)
what is the main reason for this?

thanks a lot.

Do you want to know how a barostat works? Or do you want to know why your system behaves in an unexpected way? For the latter, you need to give more information about your system, for the former you are not really on the right forum.

I want to know why my system behaves in an unexpected way.
I want to deform a box but when I relax it before deformation, the size of the box increases in three dimensions. That is not acceptable!!
I mean when the box is held in 300 K for 100ps, the size increased continuously equally in three dimensions…
What kind of information do you need?

You need to provide a minimal version of your input and specify the LAMMPS version you are using.

1 Like

Why are you calling it “not acceptable”? Is it because the corresponding equilibrium density of your system deviates from the reference value that should prevail? This could be for a number of different reasons (maybe even the force field itself is not able to reproduce the density).

It is not unacceptable that the simulation box expands or contracts when you use NPT. Within the barostat strategy, there is a part of it that adjusts the total space allowed for you system to ultimately allow for the mean value of pressure you are setting up in the command line. If for some reason you do not want the dimensions of your box to change in all directions, there are ways to do it (you can check how to do it in the fix npt page of LAMMPS manual).

1 Like

LAMMPS (23 Jun 2022 - Update 2)

tensile test

dimension 3
boundary p p p
units metal
atom_style atomic


pair_style lj/cut 2.5
pair_coeff 1 1 0.0242 4.39 10.975
pair_coeff 2 2 0.0143 4.50 11.25
pair_coeff 3 3 0.0017 4.02 10.05

compute csym all centro/atom fcc
compute stress all stress/atom NULL
compute xx all reduce sum c_stress[1]
compute yy all reduce sum c_stress[2]
compute zz all reduce sum c_stress[3]
compute xy all reduce sum c_stress[4]
compute xz all reduce sum c_stress[5]
compute yz all reduce sum c_stress[6]

neighbor 1.0 bin
neigh_modify every 1 delay 6 check yes

fix 10 all box/relax iso 0.0 vmax 0.001
min_style cg
minimize 1e-15 1e-15 50000 500000
unfix 10
min_style cg
minimize 1e-15 1e-15 50000 500000

reset_timestep 0
timestep 0.001

velocity all create 300 97456 mom yes rot yes dist gaussian units box

fix 1 all nvt temp 300 300 0.1 tchain 5
run 50000
unfix 1

fix 2 all npt temp 300 300 0.1 iso 0.0 0.0 1.0
run 50000
unfix 2

Exactly the change in the size of the simulation box is not acceptable, because there is no reason for that. It’s a simple relaxation or holding in desired temperature.

The change in the box’s size is acceptable and necessary. If you look at the expression that gives the pressure in the atomistic level (you can find this in the compute pressure page) you will see that it depends on the forces acting on all atoms. So a value of pressure implies in a given interspacing between neighbors, amongst other things. The way to cause the atoms in your system to be more packed together is to change the volume of the simulation box.

You can even reason this in terms of basic classical thermodynamics. If you are doing calorimetry at constant temperature and pressure, you see an increase in volume of your system, correct? You cannot macroscopically fix whatever T, P and V at the same time.

And even once you are at equilibrium, if you are working in the NPT ensemble, you will have fluctuations in volume since your system is free to do so.

1 Like

If your is a solid, iso is rarely a good choice as it can be better to decouple the direction of space. Apart that, its difficult to say more as the issue most likely lies in the topology file ‘’.

Note that your input is far from being “minimal”.

I changed the input in the previous message.
And input file is OK.

Yes, sure. Thanks a lot.

Yes, that’s right. But I think it couldn’t increase continuously and infinitely.

Yes, that’s right. But I think it couldn’t increase continuously and infinitely.

Possibly there is something wrong with your initial microstate then… somehow atoms too close together so that they start simply experiencing unreaslistically large values of forces to make this “infinite” increase in volume happen.

Maybe something your minimization was not able to solve.

1 Like

How do you know that? In the quoted input there is not regular thermodynamic output and you are only running for 50ps which hardly counts as “infinitely”. It would be extremely helpful, if you would provide such thermo output and for a regular interval during your NVT and NPT runs.

LAMMPS will do what the forces tell it to do. So, if you have unexpected behavior it is usually that you have input something that is inconsistent or not suitable. For example, have you considered, that your force field parameters may not be suitable for the geometry that you are simulating?
A simple plain Lennard-Jones potential is somewhat limited in what kind of systems and geometries it can represent well.

It was a very good and useful comment. I’ll check it.
Thank you.

Yes sure. I’ll do it again.

Yes, I checked all the parameters as far as I could.

That kind of statement is the equivalent of “trust me, I know what I am doing” and thus has no value in the context of scientific research. Your posts and questions do not inspire such trust.

Unless you can provide confirmation from an independent and reputable source, that those parameters have been verified to be suitable for the kind of system you are simulating, they have to be considered questionable, if the results of the simulation are not as expected. The fact, that your default Lennard-Jones cutoff is set to a rather unusually short 2.5 Angstrom is very suspicious.

Thank you for your kindness.
Unfortunately, this parameter was not specified in the reference article and they did not reply to my email.