question on units

Hi,

I am looking at building a nanowire with free surfaces and a periodic distance along its length. I have read several previous papers and was curious about whether the length in LAMMPS in the periodic direction needed to be a multiple of the lattice constant. For example, several papers on nanowires have a length of say 100nm, clearly not divisible by the lattice constant of aluminum. I would expect that the length on the periodic dimension should be in lattice units to ensure periodicity. Is this the case or can any distance be chosen on the periodic length. I know I can choose units box or units lattice, but am I introducing error but have a distance in a periodic dimension not divisible by the lattice constant?

Thanks for your help.

LIam

Hi,

I am looking at building a nanowire with free surfaces and a periodic distance along its length. I have read several previous papers and was curious about whether the length in LAMMPS in the periodic direction needed to be a multiple of the lattice constant

See below

example, several papers on nanowires have a length of say 100nm, clearly not divisible by the lattice constant of aluminum. I would expect that the length on the periodic dimension should be in lattice units to ensure periodicity. Is this the case or can any distance be chosen on the periodic length. I know I can choose units box or units lattice,

As you realize, the “units” command is not the issue.

am I introducing error but have a distance in a periodic dimension not divisible by the lattice constant?

Are you using periodic boundary conditions?

If so, then generally speaking, if the atoms in system do not fit within the periodic boundaries of the simulation box, then there is a danger that the atoms from different periodic images (copies) of will overlap when they are “wrapped”. Overlap can cause the force between thes atoms (in neighboring images) to be astronomical, causing your simulation to crash.

Do you want to simulate the entire length of the wire (of length 100nm)?

Or, do you want to model just a small fragment of the wire (and use periodic boundary conditions to make it effectively infinitely long)?

Or do you want to do both? (build a 100nm long cylinder of aluminum AND use periodic boundary conditions) In that case, the size of the aluminum unit cell I have been using is approximately 4.05 angstroms. 100nm is approximately equal to 247x4.05 (= 1000.35 Angstroms). To avoid atom overlap, you could either choose a periodic box of length 1000.35 Angstroms, or squish the atoms in the unit cell slightly (to length 4.04858). Either way, this seems like a needlessly large simulation.

Andrew

For reference, I am getting my aluminum unit cell width from this file:
https://github.com/jewettaij/moltemplate/blob/master/examples/all_atom/force_field_explicit_parameters/aluminum_crystal_strain/moltemplate_files/al_cell.lt

Thanks for the detailed response. To provide some more context, basically what I am asking is whether the nanowire set up will get me in trouble below due to the fact I am using box units and 160A (the periodic length in this case) is not divisible by 4.065.

Based on your response there may be some overlapped atoms on the edges. However when plotting the stress strain curve I don’t get any overly high stresses or simulation crashing. It looks pretty good to be honest. Is it possible that because I equilibrate (using an NPT) before straining the length is allowed to contract/expand to whatever natural length it wants/should be?

I assume if atoms were overlapped it would crash?

Also apologies, I meant 100A length, 100nm in periodic length is ridiculous.

# ------------------------ INITIALIZATION ----------------------------
units 		metal
dimension	3
boundary	p s s
atom_style	atomic
variable latparam equal 4.065

# ----------------------- ATOM DEFINITION ----------------------------
lattice		fcc ${latparam}
region		whole block 0 160 0 40 0 40 units box 
lattice 	fcc ${latparam} orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
create_atoms	1 region whole

As a follow up I have tried running it with delete atoms overlap. However I am unsure if this will delete the atoms on the periodic boundary. When doing so this does not change modulus/yield. Perhaps I am better just doing periodic lengths in lattice units, but I am curious if the simulation doesn’t crash and I get no temperature spikes then why is it a problem to not have the length divisible by the lattice unit. Maybe because I allow the length to contract first in an NPT?

Thanks for the detailed response. To provide some more context, basically what I am asking is whether the nanowire set up will get me in trouble below due to the fact I am using box units and 160A (the periodic length in this case) is not divisible by 4.065.

Based on your response there may be some overlapped atoms on the edges. However when plotting the stress strain curve I don’t get any overly high stresses or simulation crashing. It looks pretty good to be honest. Is it possible that because I equilibrate (using an NPT) before straining the length is allowed to contract/expand to whatever natural length it wants/should be?

I assume if atoms were overlapped it would crash?

Most likely.

Perhaps the atoms in your system do not overlap because you have not created as many atoms as you thought you did. Presumably, that’s not what you want either.

Unfortunately, I am not familiar with the “lattice” or “create_atoms” commands in LAMMPS, so I can’t help you with your input script.

I can offer some advice: You need to look at your system. Since your system lacks bonds, I would recommend using OVITO (https://www.ovito.org) to visualize your system. Run a short simulation in LAMMPS, and load the dump file using OVITO. (You can also use VMD, but you must create a “data” file first.)

— data files —

VMD (and topotools) can also be used to visualize your system. However, to do that, you must create a LAMMPS “DATA” file. One way to create a data file is using the “write_data” command (from within LAMMPS):

https://lammps.sandia.gov/doc/write_data.html

Once you have a DATA file, you can visualize it using VMD using these instructions:

(To visualize the size of the periodic box and check for atom overlap, scroll down to the bottom of that file for instructions.)

Andrew
P.S. Data files give you more freedom to customize your system. There are a variety of data file builders (a.k.a. “molecule builders”) here. For your simple system, I would recommend topotools or moltemplate.
You can also create a data file yourself (manually). The file format is not that complicated and is explained here