BoxMaker
How many solvent molecules, solutes and ions go into a simulation box at a target concentration, and what concentration the rounded counts actually give.
Why does the box size matter?
Molecule counts must be whole numbers, so a small box can only reach certain concentrations. The steps show the concentration that the rounded count actually gives as the box grows, for the solute most affected by rounding, against its target (dashed). Your box is marked. At physiological salt (0.15 M) a 4 nm box holds only about six ion pairs, so a single ion changes the concentration by 17%.
GROMACS
Packmol
About BoxMaker
Setting up a crowded or salty solution means converting a concentration from a paper (molar, molal, mass or mole fraction) into exact molecule counts for a box, and keeping the total mass consistent with the solution density. BoxMaker does the conversion, shows the error from rounding, and writes the commands to build the box.
Python: pip install git+https://github.com/siba-p/nanomatkit, then nanomatkit box --edge 4 --solute glycine:75.07:2.0:m.
Method
Mass balance of a box of volume at solution density :
Concentration units for solute :
Molar and fixed-count solutes are placed first; the solvent then fills the remaining mass, with molal and mole-fraction solutes solved together with it.
Check: a 3 nm water box (0.997 g/cm³) holds 900 molecules; molality and mole-fraction targets are reproduced exactly before rounding.