So, I have started to learn NAMD because I need that for a project I will be doing in the next couple of months. I have some prior experience of MD with gromacs. I thought that since NAMD has a GUI frontend (VMD) it would be easier to learn but I am finding it much much harder to learn.

For my work, I need to simulate droplets of water (basically a fixed number of water molecules in vaccum, without any periodic boundary). However, I have no idea how or where to start. All of the tutorials online seems to focus primarily on proteins and how to simulate them so they are not of much help.

I tried to use the VMD solvate plugin to generate a box of solvent but there does not seem to be an option to control the actual number of water molecules (something similar to gmx solvate -maxsol 200 from gromacs). It creates a box of water molecules, however, I don't know how to change the box to a sphere and remove the periodic boundary conditions (The water molecules does not need to be shifted because the MD run will automatically push it into a spherical shape).

Finally VMD solvate seems to take the topology for water from an internal file which gives TIP3P water, however, the psf file generated does not seem to have any parameters, so I am not sure how the simulation will run.

As for running the actual equilibriation, I am running into even more problems. QwikMD does not read the psf file, and I cannot figure out any way to change the boundary condition to spherical, or remove it.

So, my question is: How do I run simulations of water in NAMD ? (with the least amount of hassle)

A step-by-step answer would be the most helpful, but any answer is greatly appreciated.

  • 1
    $\begingroup$ Take a look at this message from the VMD e-mail list. $\endgroup$
    – Camps
    Commented Jun 14, 2021 at 23:11
  • $\begingroup$ @Camps Thank you, I have already seen that post. My main problem is controlling the number of water molecules, changing parameters and actually running simulation. $\endgroup$
    – S R Maiti
    Commented Jun 15, 2021 at 8:02
  • $\begingroup$ I think you can try to stimulate difference droplets with different sizes and then count the waters on it, making a "correlation". $\endgroup$
    – Camps
    Commented Jun 15, 2021 at 15:37
  • $\begingroup$ My research project isn't really about correlating number of water molecules with something, it's mainly on introducing ions into the droplet and seeing how they behave, so to keep things consistent, I have been asked by my supervisor to use exactly 200 water molecules for each drop. $\endgroup$
    – S R Maiti
    Commented Jun 15, 2021 at 18:59
  • 1
    $\begingroup$ I didn't intend you change your research project, sorry. You can always count the number of molecules and delete somes this get the desire number. $\endgroup$
    – Camps
    Commented Jun 16, 2021 at 1:25

2 Answers 2


One way could be as follow.

  1. Download software PACKMOL.
  2. Download the examples files (tar.gz or zip).
  3. Modify the file solvprotein-comment.inp: removing the info about the protein, and the ions and define the number of water molecules and the size of the droplet:
# Protein solvated by water and ions

# All atoms from diferent molecules will be at least 2.0 Angstroms apart
# at the solution

tolerance 2.0

# The type of the files will be pdb 

filetype pdb

# The name of the output file

output solvprotein.pdb

# The protein will be fixed with its center of mass at center of the
# box, and no rotation (the first three zeros correspond to the position
# of the center of mass and the last three correspond to the euler
# angles of rotation, in radian, relative to the position in the input
# file). 

#structure protein.pdb
#  number 0
#  fixed 0. 0. 0. 0. 0. 0.
#  centerofmass
#end structure

# Water molecules will be put inside a sphere that contains the protein.
# There will be 16500 water molecules that will be put in a sphere
# centered in the origin, and a radius of 50. Angstroms.

structure water.pdb
  number 300
  inside sphere 0. 0. 0. 10.
end structure

# The ions will be put in the same region as the water molecules, so
# they will be inside the water sphere and will be solvating the protein
# as well.

#structure CLA.pdb
#  number 0
#  inside sphere 0. 0. 0. 50.
#end structure

#structure SOD.pdb
#  number 0
#  inside sphere 0. 0. 0. 50.
#end structure
  1. Run the program as packmol < solvprotein-comment.inp.
  2. Go to charmm.gui server and generate the input for NAMD.

I run for three droplets with 300 water molecules and 5 (blue), 10 (cyan) and 15 (yellow) angstroms. The image are bellow. enter image description here

  • $\begingroup$ Thanks! Could you please add some information about the input from CHARMM gui and how to run it with NAMD? I can create water spheres with gromacs, my main problem is in running NAMD. (Though the packmol program seems quite handy) $\endgroup$
    – S R Maiti
    Commented Jun 18, 2021 at 16:42
  • 1
    $\begingroup$ When you upload your system in the charmm.gui server, it will create a tar.gz file with all the files needed to run NAMD/GROMACS/etc. including the script job. You just will run that script. $\endgroup$
    – Camps
    Commented Jun 18, 2021 at 17:57
  • $\begingroup$ Thanks Camps! I have related question. I am using NAMD for the simulation purpose. I have pdb & psf of polystyrene (PS) and graphene. I wanted to generate a complex system containing graphene at the centre and 5 PS on top of it in a water box. I could generate the pdb file of such a complex using packmol but I don't know how to generate psf of that complex. psf and pdb of the generated complex are required for NAMD simulation. Also, I do have top and par files of both PS and graphene. Thanks in advance! $\endgroup$
    – Crisna
    Commented May 12, 2022 at 11:49

Another way is to use Amber file with NAMD!

Amber tleap is more user friendly, you can set the box size with box mol {x y z}. The only difference is you need to use top and crd files, not psf and pdb, in the NAMD configure file.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .