In this example, we’ll build a simulation of a simple liquid (methanol) starting with a structure file (in XYZ format). Getting your molecule of choice into OpenMD is never a black box procedure, and will almost always require some hand adjustment of the input files. Assuming you’ve gotten a version of OpenMD built and installed (along with all of the prerequisite software), we’ll walk you through building the liquid simulation in the steps below.
- Start with a good structure for your molecule. If you are familiar with Avogadro, build the methanol structure (CH3OH), set up the force field, and optimize the structure. Save the structure as methanol.xyz. Alternatively, download the methanol.xyz structure to your working directory.
- Use the atom2omd program to convert the structure into a format that can be read by OpenMD:
atom2omd -ixyz methanol.xyz
This command will create an incomplete OpenMD file called methanol.omd that must be edited before it can be used.
- OpenMD can use a number of force fields, but in this example, we’ll use the Amber force field. If you are using this force field and are starting from an XYZ file or non-standard PDB file, you must edit the atom types. In the methanol.omd file:
- change the atom typing for the methyl carbon from C3 to CT
- change the O3 to OH
- The hydrogens on the carbon should also be changed from HC to H1
- The hydroxyl hydrogen can be left alone.
- At this point it is also a good idea to change the name of the molecule to something descriptive (perhaps “methanol”). This should be done in two places; once in the molecule description and another time in the component block.
- Before the simulation can run, add a forceField line after the component block:
forceField = "Amber";
At this stage, you should be able to run OpenMD on the file to check to make sure your hand-crafted atom typing can be matched up with types known by the force field:
openmd methanol.omdIf there are any problems, correct any unknown atom types, and repeat until you get an error about the “Integrator Factory”.
- Next, we’ll build a lattice of methanol molecules using this initial structure as a starting point. The density of liquid methanol is roughly 0.7918 g cm-3, so we’ll build a simple box of methanol molecules using the command:
simpleBuilder -o liquid.omd --density=0.7918 --nx=3 --ny=3 --nz=3 methanol.omd
This command creates a new system, liquid.omd which contains 108 copies of the methanol molecule arranged in a simple FCC lattice. FCC has 4 molecules in the unit cell, so the total number of molecules = 4 * 3 * 3 * 3 = 108. The molecules are packed at a distance commensurate with their liquid state density.
- To visualize what the system looks like at this stage, you can run:
Dump2XYZ -i liquid.omd
to create a file called liquid.xyz. This file can be viewed in VMD, Jmol, or any other chemical structure viewer.
- Add the following lines below the forceField line of the liquid.omd file:
ensemble = NVT;
cutoffMethod = "shifted_force";
electrostaticScreeningMethod = "damped";
cutoffRadius = 9;
dampingAlpha = 0.18;
targetTemp = 300;
tauThermostat = 1000;
dt = 1.0;
runTime = 1e3;
tempSet = "false";
sampleTime = 100;
statusTime = 10; - Initial configurations that are created from bare structures typically have no velocity information. To give an initial kick to the atoms (i.e. to sample the velocities from a Maxwell-Boltzmann distribution), you can use the following command:
thermalizer -o warm.omd -t 300 liquid.omd
This creates a new OpenMD file called warm.omd which has initial velocity information.
- At this stage, a simple simulation can be run:
openmd warm.omd
- This should complete relatively quickly, and should create a warm.stat file as well as a warm.dump file containing the actual trajectory.
- To view the contents of the trajectory file, you’ll need to convert the dump file into something another program can visualize:
Dump2XYZ -i warm.dump
will create a new file warm.xyz that can be viewed in VMD and many other chemical structure viewers.
- The “End-of-Run” file warm.eor can be re-purposed as the starting point for a new simulation:
cp warm.eor equilibration.omd
Edit the equilibration.omd file, and change parameters you’d like to change before running openmd on the new file.
#1 by Robin on April 6, 2015 - 2:54 pm
Warning: Undefined variable $my_comment_count in /Users/Gezelter/openmd/wordpress/wp-content/themes/arclite/functions.php on line 714
Quote
I am just a starter of OpenMD. As I just roughly took a look into the Manual, and after installing OpenMD in my own desktop, this simple example (Simple liquid simulations using OpenMD) has become the very first practical trial for me. We defined the molecule, and expanded it into the lattice consists of the same molecules, and then initiated their motion. I am very eager to go through more example simulations. But where might I be able to find some more good-easy tutorials? As like a simple substitution reaction in organic compounds. Great honor to this project. Regards.
#2 by Cesar Rosiles Mendoza on September 30, 2016 - 5:23 pm
Warning: Undefined variable $my_comment_count in /Users/Gezelter/openmd/wordpress/wp-content/themes/arclite/functions.php on line 714
Quote
I am type the command “atom2md -ixyz methanol.xyz” on terminal inside build folder, in this folder i have methanol.xyz file, the command is not found (-bash: atom2md: command not found), Of course I installed and built openMM in macosx Sierra 10.12, I need help with this , What i can do?
#3 by Dan Gezelter on September 30, 2016 - 9:17 pm
Warning: Undefined variable $my_comment_count in /Users/Gezelter/openmd/wordpress/wp-content/themes/arclite/functions.php on line 714
Quote
The build process will create a “bin” subdirectory that contains all of the executables, and this directory is probably not in your path. You can either add it to your path, or do a “make install” and then add the install bin directory to your path.
#4 by Cesar Rosiles Mendoza on September 30, 2016 - 5:25 pm
Warning: Undefined variable $my_comment_count in /Users/Gezelter/openmd/wordpress/wp-content/themes/arclite/functions.php on line 714
Quote
Me again, any command works
#5 by Cesar Rosiles Mendoza on October 1, 2016 - 12:27 pm
Warning: Undefined variable $my_comment_count in /Users/Gezelter/openmd/wordpress/wp-content/themes/arclite/functions.php on line 714
Quote
Thanks Dr. , i will try a simulation with nanoparticles of Fe3O2 . If other people have the same problem, the command for add a path is (macosx in the fault folder .¡There are other options¡ ) :
1. nano .bash_profile
2. yo need to write the path of you buil folder with:
export PATH=/Applications/build/bin:$PATH
3. for load command: ~/.bash_profile