The first goal is to setup a simulation in production mode by reducing output, and enabling restarting.
The second goal to understand the produced .ener file and do some basic analysis of the trajectory with VMD.

AIMD of bulk liquid water

For the sake of running this exercise quickly, we'll use the DZVP-GTH basis found in the HFX_BASIS file. This basis is smaller than what can be recommended for a subtle substance such as liquid water, rather use TZV2P-GTH, TZV2P-MOLOPT-GTH, or cc-TZV2P or better basis sets for production runs.

Topics:

MD section (timestep)

Thermostat (NVE, NVT, NPT)

1st task: prepapre inputs for MD

Start from the mode1.inp input file of the previous exercise, rename the file to water.inp. You'll also need a new file HFX_BASIS from the cp2k/data directory.

Now, run the input and check for successful completion of the job (look for the timing report or the ENDED AT line in the output).

During MD CP2K has generated various files named WATER-1.restart, WATER-pos-1.xyz, WATER-1.ener. These are a restart file for the MD (open this file in an editor to see that this is actually a regular input file), the trajectory of the MD, and a file summarizing the energies (potential, kinetic and conserved quantity). Before we analyze these files, we'll resubmit a job for the continuation of the MD.

modify the input to enable restarting:

&EXT_RESTART
RESTART_FILE_NAME WATER-1.restart
&END

If time permits, increase the WALLTIME (and the corresponding time limit in the job script), and run a longer job.

as soon as the job runs significantly longer than the time needed to perform the first few steps, restarting the job doesn't influence the efficiency. Your batch job system might have a convenient way to have chains of jobs, i.e. a simple way to enforce dependencies and automatic continuation. Look at the -w option of bsub, or –dependency of sbatch

Analysis

While running the MD simulations, it is useful to check that all is fine. Here, we do some basic analysis, to look at the structure and dynamics of the liquid.

2nd task: visualize the .ener file

A first quick check can be performed using the file WATER-1.ener which contains basic information

To judge if a system is well equilibrated is not easy. At least the temperature and the potential energy of the system must oscillate around an average and be free of long term drift. As a rule of thumb, discard 1/3 of the trajectory, use 2/3 for data analysis.

3rd task: visualize/analyze the trajectory file

We will use vmd to analyze the trajectory file. Note that the generated trajectory is only a few 100s of fs, typically, 10s of ps are needed for even for basic properties.

g(r)

1st, set the unit cell as needed. Now improve the Graphics/Representations to also show neighboring unit cells and visualize hydrogen bonds.

2nd, compute the O-O pair distribution function (Selections=name O) and similar for the O-H pair distribution function (including their integrals).

How many neighbors does a given water molecule have on average (3, 3-4, 4, 4-5, 5)?

IR spectrum

Based on the time evolution of the dipole of the system, the IR spectral density can be estimated. To estimate the dipole from AIMD, wannier centers need to be computed. This is out of scope of the current tutorial (TODO: find link). We employ a simple approximation, namely classical point charges for the water molecules. In this context the approximation is reasonable.

Lower frequencies need longer trajectories for reasonable estimates, at the very least 10 times the period of the signal

AIMD of simle ions in water solution

4th task: simple ions in solution

This task is optional, and can be performed at the end of the tutorial if time is available.

Introduce an ion in your system, and equilibrate this system. Study its dynamics and solvation structure.

The easiest way to do so is to replace one or more water molecules (depending on the size of the ion) by the ion in question. Obviously, the configuration produced in this way is far from equilibrium, and must be run for a while before it is representative.