[lammps-users] Number of molecules.

Dear all ,

i am new both to Lammps and to MD.I want to do some simulations which may for example CO2 or H2O. I read in the manual that i can define an initial volume from the data file with xlo,xhi,ylo,yhi,zlo,zhi which create a volume V.I want to use a NPT ensembe at first with T=300K and P=1atm for example.How can i know how many molecules can i put inside my box or i don’t care because i use an NPT and the volume will change? Are there Tables where i can find what is the density under specific T and P? How can i do the same if i use the NVE about the total number of molecules in order for all the above to have my CO2 in a vapour condition?

Regards
Jim

You can look up that stuff in tables. If you are just looking to get your feet wet, I'd go with a water simulation. 1g/cm3 at 298K and 1atm. Or thereabouts. It depends on the potential you choose. That will get you close enough. If you run NPT with a poorly chosen configuration you will have problems. Try packmol for creating a configuration. It's worked well for me.
Cheers,
Matt

Hi ,
thank you for your answer. Basically i am interested in CO2 ,but i cannot find these tables that you were saying. I would like to have a diagram for example density-pressure for different temperatures, but what i’ve found so far it doesn’t match my needs. You are saying that all these depends on the potential i use,why?The first has a physical meaning and the potential is something we create-choose.

Cheers
Jim

is a very nice source of data for PVT behavior of a variety of pure fluids, including CO2. A potential is fit, usually to a set of experiments on a set of molecules. Thus it when you use it on similar molecules it is an interpolation or extrapolation. The original fit is only an approximation, the subsequent extrapolation introduces more uncertainty. So different potentials represent reality differently. Thus you have to “know” how a potential performs for the properties you are interested in. The community has a general feel for this, but nothing matches your own experience gained by trial and error! Paul Jim panathinaikos wrote:

Thank you for your answer. The thing is that when you use a npt ensembe for example you keep constant P,T,and the number of molecules. So the only thing that van be changed is the V. The page that you proposed me,and some others that i ve found talks about isobaric,isothermal isochoric properties. How someone can choose what he needs in order to do the needed calculations to decide the number of molecules he needs? And if i decide to put a arbitrary number of molecules which it is very big for the initial volume which i will have define by using npt don’t i solve the problem because i leave |Volume to change?

Jim

2010/3/27 Jim panathinaikos <drazentl@…33…8…>

Thank you for your answer. The thing is that when you use a npt ensembe for example you keep constant P,T,and the number of molecules. So the only thing that van be changed is the V. The page that you proposed me,and some others that i ve found talks about isobaric,isothermal isochoric properties. How someone can choose what he needs in order to do the needed calculations to decide the number of molecules he needs? And if i decide to put a arbitrary number of molecules which it is very big for the initial volume which i will have define by using npt don’t i solve the problem because i leave |Volume to change?

The options in the NIST Webbook allow you to see how properties vary at a constant pressure for various temperatures, or vice versa. But that doesn’t mean the data isn’t constant pressure and constant temperature for a given value in the table. So, for instance the density for 300 K and 1 bar value should be the same if you look it up in either the constant pressure table or the constant temperature table.

As for putting in arbitrary number in, yes, you should eventually get to a stable result. However, in general, the closer you can start to the state you want to reach, the easier it is for the simulation to get there. (Big changes are usually bad from an MD perspective.)

–AEI

NIST also has the density … with that and a calculator you can get a pretty good starting point! Another approach is to start with a somewhat low density and squash the cell by applying pressure, then taking that cell and allowing it to equilibrate at your desired pressure. Starting with a high density tends to have problems because atoms are too close. However, at low density the molecules don’t interact much, so it takes a long time for the cell to shrink unless you apply a moderate pressure, like 100 atm.

Paul

Jim panathinaikos wrote:

I'm not quite sure what you are asking. If you are asking what ensemble (NPT,NVE,NVT,etc) is appropriate for the calculation you want, I suggest you get an introductory text for statistical mechanics. This is a very complicated topic, and it's easy to make mistakes. For example, people often calculate dynamical properties like diffusion while using thermostats - which is a mistake. Albeit, a common one.

If you are asking about the size of system you will need to do the calculation you want, again you should get an introductory text for computer simulations. There are many strange effects from the finite size of a system.

I suggest getting a copy of Computer Simulation of Liquids, Allen and Tildesley. It will be a lot more helpful than this mailing list.

Matt

Quoting Jim panathinaikos <[email protected]...>:

Lets assume that for a CO2 i have T=300K and P=1bar. these give rho=1.7730kg/m3. If i change it to number density using the relationship r_number=(Na*rho)/M,
M molar mass i get something like 0.02726nm^-3. Now my question that i cannot understand how it works is: Do i have to choose the number of molecules and then calculate the Volume or the first the volume and then the number of molecules?

Jim

The choice is yours. You can either pick a box size and pack it with molecules, or you can choose how many molecules you want to build and size the box accordingly. Since you have to build the system–LAMMPS doesn’t build it for you–you are free to choose whichever method suits your needs best.

–AEI