User Guide#
The Packmol step builds a region (a cluster or a periodic cell) filled with molecules, using Packmol [Martinez2009]. You say which molecules and in what proportions, and how big the region is or how much material it holds; the step works out the numbers of molecules and the dimensions, has Packmol place the molecules without overlaps, and replaces or adds a structure in SEAMM with the result.
The molecules#
Each row of the table at the bottom of the dialog is one kind of molecule:
- Component
fluidorsolute. Fluid molecules fill the region in the given proportions. A solute is a single molecule fixed at the center of the region, with the fluid packed around it – a protein in water, say, or a periodic cell of a zeolite or MOF to fill. There can be at most one solute.- Source and definition
Where the molecule comes from:
SMILES: the definition is a SMILES string, and the step builds the molecule with Open Babel. Charged species are fine:[Li+],F[P-](F)(F)(F)(F)F.configuration: a structure already in SEAMM, from a Read Structure or From SMILES step earlier in the flowchart. The definition names it assystem/configuration(e.g.PF6/initial), or justconfigurationfor one in the current system; an empty definition orcurrentuses the current configuration. A source structure can be anything SMILES cannot describe well, such as a cluster of a lithium ion with its solvent shell. It is left unchanged.
- Amount and as
How much of a fluid molecule there is, given in one of three ways:
proportionRelative amounts of the molecules:
1and3give one molecule of the first kind for every three of the second. Only the ratios matter. Proportions are (above the table) says whether they are numbers of molecules (by number of molecules, mole ratios) or masses (by mass, weight ratios, e.g. EC:DMC 3:7 by weight).molality (mol/kg)Moles per kilogram of the solvent.
molarity (mol/L)Moles per liter of the region. Not offered with
calculated using the Ideal Gas Law, where the volume follows from the number of molecules.
The molecules given as proportions are the solvent, and there must be at least one. The others – typically the ions of a salt – are added to it: in proportion to its mass for molalities, and to the volume of the region for molarities. A solute has no amount; there is always one.
Any of the entries can be a variable, e.g. $smiles or $ratio.
The region#
Create periodic system chooses between a cluster (No) and a periodic cell
(Yes), and Shape of the region between cubic, rectangular and
spherical; a periodic cell is cubic or rectangular. In a periodic cell the
fluid molecules are packed 1 Å inside each face, half of Packmol’s 2 Å tolerance, so
that they are at least 2 Å from the images of those near the opposite face. (Packmol’s
own periodic boundary conditions do not keep them apart: with water, dozens of pairs
ended up closer than 1.8 Å across the faces, and the MD failed at once.)
How big is it?#
The dimensions will be sets the size of the region in one of five ways. Some of them also fix how much fluid there is, and the rest leave that to Get number of fluid molecules by (below).
given explicitlyThe edge of the cube, the three sides
a,bandcof a rectangular box, or the diameter of the sphere.calculated from the volumeThe volume; for a rectangular box, also the ratios of its sides (
a ratio,b ratio,c ratio, e.g. 1, 1, 2 for a box twice as long in z).calculated from the solute dimensionsFor a solute: the region is the solute’s bounding box or sphere plus a layer of fluid of the given solvent thickness. In a periodic cell the layer is added once per side, since the neighboring images supply the rest. A periodic solute – a crystal cell to fill – gives the cell itself; it must be orthorhombic.
calculated from the densityThe density of the whole region. The number of molecules comes first (from an approximate number of atoms or molecules), and the volume follows from their mass.
calculated using the Ideal Gas LawFor a gas: the temperature and pressure. The number of molecules comes first, and the volume follows from \(PV = NkT\).
How much fluid?#
Get number of fluid molecules by offers the choices that make sense with the dimensions:
rounding this number of atoms/rounding this number of moleculesAn approximate total, from which the step takes the nearest whole numbers of molecules in the requested proportions and concentrations. With a solute, its atoms count toward the number of atoms but it is not one of the molecules.
using the densityThe density of the region, given its size; the solvent fills it to that density, with any molecules given as molarities already in it.
using the Ideal Gas LawThe temperature and pressure, given the size of the region.
With calculated from the density or calculated using the Ideal Gas Law the
amount is one of the first two, since the density or T and P then sets the size; with
calculated from the solute dimensions it is one of the last two.
Molarities with a size calculated from the density are solved for together: the volume depends on the mass, which includes the molecules given as molarities, whose number depends on the volume.
Forcefields#
If a forcefield has been chosen before the Packmol step – with a Model Chemistry step
(FF@oplsaa, ReaxFF@...) or a Forcefield step – the step assigns the
forcefield’s atom types and charges to each kind of molecule before packing, and the
packed system carries them, ready for LAMMPS. Assign forcefield controls this: If not assigned
(the default) types only molecules that lack types for the current forcefield,
Always retypes them all, and No leaves the molecules as they are. Machine-learned
potentials (PyTorch) and OpenKIM models need no atom types, so with them nothing is
assigned.
The new structure#
First structure says what to do with the packed structure: overwrite the current configuration (the default), add a new configuration to the current system, or create a new system. System name and Configuration name name it. The structure’s bonds, with their bond orders, come from the molecules; its charge is the sum of their charges.
The output#
The step first prints what it will do, then what it built: the size of the region, and a table of the molecules. For each it gives
the amount requested and the amount actually packed: for the solvent its composition, in percent by number of molecules (
%) or by mass (wt%); for the other molecules their molarity (M) or molality (mol/kg);the number of molecules;
the molarity – moles per liter of the whole region, solute included;
when there are molecules besides the solvent, their molality, per kilogram of solvent.
Since the numbers of molecules are whole, the actual amounts differ a little from the requested ones, the more so the fewer molecules there are. Last come the total number of atoms and the density.
Tips#
Neutral cells. For ions, make sure the amounts give a neutral cell: the same molarity or molality for
[Li+]andF[P-](F)(F)(F)(F)F, or twice as much[Li+]as of a dianion. The packed structure’s charge is the sum of the molecules’ charges.Dense or crowded systems. Packmol keeps atoms of different molecules at least 2 Å apart. Near or above the liquid density, especially with large molecules, it may take long or fail to converge. Pack at a somewhat lower density and let a constant-pressure (NPT) simulation bring the system to its equilibrium density.
Small cells and dilute solutions. A small cell holds few molecules, so minor components round far from the requested amount, or to zero: at 0.1 M a 30 Å cube holds only about 1.6 ions of each kind. Use enough atoms for the composition you want, and check the actual amounts in the output.
Different every time. Packmol starts from random positions, so each run gives a different packing of the same composition.
References#
L. Martínez, R. Andrade, E. G. Birgin, J. M. Martínez. PACKMOL: A package for building initial configurations for molecular dynamics simulations. J. Comput. Chem. 2009, 30, 2157-2164. DOI: 10.1002/jcc.21224