I am trying to do lj fluid simulations using lj units in lammps. For this, I want to create an initial configuration for a given reduced density (as defined in lammps lj units).
For this I am defining a region with a certain box size, say side = 8 (reduced units), then using lattice command followed by create_atoms command, I create the simulation box with atoms in it.
As we mention the reduced density in the lattice command for lj units, I am unable to understand how does it calculate the no. of atoms in the simulation box. I have read the description for this in lammps documentation, but did not understand fully.
From some experimentation, I realized that if we input the side length back-calculated from taking number of atoms as 512, gives the expected density for different densities with simple cubic lattice.
Whereas, the same is true for fcc lattice with dimensions input corresponding to 256 atoms.
Please look into it and try to explain the reasoning behind it.
Hi - the problem in your original post is that you are using the lattice command after
creating the box. You need to use it before you create the box (followed by creating the atoms),
and things will work as you expect.
I.e. if you use lattice fcc 1.0 versus lattice sc 1.0 you will get more atoms in a bigger box for fcc
than for sc, and the two reduced densities will be the same (1.0). More atoms b/c the fcc cubic unit
cell has 4 atoms whereas the sc cubic unit cell has 1.
This is b/c the create_box command uses lattice units by default, and if you haven’t defined
a lattice then it doesn’t know if you are going to use fcc vs sc vs whatever to create atoms and it cannot create a box of the correct size to achieve the density you specify.