Trouble adding salt to an explicit tip4p water box

Hi All,

I am very new to lammps so i am sorry to bother everyone but I have been stuck trying to modify a tip4p explicit water box to include salt. My intial guess was to use the explict water model example here and add in the lines for creating the salt atoms into the configuration given therein.

units real
atom_style charge
atom_modify map array
region box block 0 34 0 29 0 73
create_box 5 box

mass 1 15.9994
mass 2 1.008
mass 3 1.0e-100
mass 4 24.305
mass 5 35.453

pair_style lj/cut/coul/cut 8.0
pair_coeff 1 1 0.1550 3.1536
pair_coeff 2 2 0.0 1.0
pair_coeff 3 3 0.0 1.0
pair_coeff 4 4 0.04690 2.43
pair_coeff 5 5 0.1500 4.04470 # ion Cl

fix mol all property/atom mol ghost yes
molecule water tip4p.mol
create_atoms 0 random 1600 34564 NULL mol water 25367 overlap 1.33
create_atoms 4 random 5 15154 NULL overlap 0.3 maxtry 500
create_atoms 5 random 5 15147 NULL overlap 0.3 maxtry 500

set type 4 charge 1
set type 5 charge -1

neigh_modify exclude molecule/intra all

timestep 0.5
fix integrate all rigid/small molecule langevin 300.0 300.0 100.0 2345634

thermo_style custom step temp press etotal density pe ke
thermo 2000
run 40000
write_data Na-Cl-tip4p-explicit.data nocoeff

I know there is something fundamental that I am missing but I have not been able to figure out what.

What is missing here, is a description of what kind of problems you have.
Nobody can answer questions that you do not ask!

1 Like

Sorry about that Axel. Looking through the log file the main issue is that although I have 1600 waters, the number of rigid bodies is 1601 which contains all the atoms including the salt (aka 6410 atoms). What caused the rigid bodies to be greater than the number of waters?

The error message I have is that the Rigid body atoms are missing between atom ids that indicate two salt atoms.

I would assume that all your ions have the same molecule ID, so that fix rigid/small will group them into a single rigid body.

the cleaner approach would be to define a group for the water molecules and a group for the ions and then use fix rigid/small on the water group and fix nve on the ions.

1 Like