Neural networks allows ab initio simulation of water viscosity

A combination of sophisticated data-analysis methods and machine-learning techniques makes ab initio simulation of viscosity of water possible, overcoming the time-scale barrier that has so far hindered a systematic exploration of its viscous properties.
Neural networks allows ab initio simulation of water viscosity

The viscosity of fluids is a key parameter playing a fundamental role in many fields of science and technology, ranging from chemical and mechanical engineering, to biochemical processes and planetary sciences, to name but a few.

There are essentially two ways of calculating viscosity by Molecular Dynamics (MD) simulation. The first is to subject the simulated system to an external perturbation (e.g., a shear flow) and then calculate the steady-state response of the system to the perturbation. Alternatively, one can apply the Green-Kubo (GK) relations, i.e., the relations between the viscosity ( or in general the transport coefficients) and correlation functions of the out-of-diagonal element of the stress tensor (or the correspond flux). The GK method has the virtues of simplicity and ease of application in MD simulations while dealing with off-equilibrium MD, as required by the first approach, can be very tricky and needs great care. However, not all that glitters is gold and already in the early stage of this work, we noticed that the computation of the viscosity from GK formalism was affected by very serious statistical analysis problems. These problems arise mainly from the noisy nature of the correlation functions that enter the GK relations. Moreover, despite the great abundance of work on the properties of water from ab initio simulation, its viscous properties have been dodged since it was well established in the literature that “an accurate computation of the viscosity of water would require exceedingly long first-principles simulations” [1]. We, then, understood that a powerful technique such as the cepstral analysis [2] would have been an essential tool for the success of the project. Indeed this data-analysis technique, mainly used in speech recognition and sound engineering, allows to filter out the noise of the autocorrelation function and it has already been successful in order to computer thermal [3] and electric conductivity [4]. With cepstral analysis, we were able to compute the shear viscosity of water from relatively short (400 ps) trajectories taken from ab initio molecular dynamics simulations.

After this success, we wanted to explore a broad region of the phase space of liquid water, we were interested, in particular, in the temperature dependence of the viscosity of liquid water while going into the deep undercooled regime. In spite of our powerful data analysis workflow, such systematic study from fully ab initio simulations would have been computationally very demanding.  In order to overcome this time-scale barrier, we trained a deep-neural-network potential (NNP) on a DFT dataset of PBE water. We then performed MD simulations where the dynamics of the atoms was driven by our NNP and we computed the shear viscosity again using the cepstral analysis. The results that we obtained are fairly compatible with the ab initio ones, confirming that the NNP is capable to predict the viscosity of water correctly. With the NNP we had access to far longer trajectories, and, thus, the possibility to fully eviscerate the problems arising from the computation of the viscosity from GK, for the full discussion please read Section “Statistical analysis and finite-size scaling” of the related paper.

With both an efficient NNP and a strong data-analysis workflow at our disposal, we were ready to tackle the study of the temperature dependence of the viscosity of water. Unfortunately, the PBE approximation resulted to be not enough accurate to predict the experimental values for the viscosity. For example, if we consider its value at the melting point of the two “models”, which is about 417 K for the PBE and 273.15 K for experiments, we realize that our simulations underestimate the experimental viscosity by 70%. This shows that with the PBE model water not only freezes at too high temperature, but its dynamics is way too fast at melting.  

Comparison between the SCAN predictions and the experimental values for the shear viscosity of water as a function of the temperature
Comparison between the SCAN predictions and the experimental values for the shear viscosity of water as a function of the temperature

As a last effort, we trained a new NNP over accurate SCAN-DFT data, which is known to reproduce the properties of water better than PBE [5].
Once we offset the, rather small, difference in values of melting points, the SCAN-NNP could predict the temperature dependence of the viscosity of water with remarkable accuracy, leaving only in the deeply undercooled regime small shortcomings, possibly related to the subtle balance between the high- and low-density fluctuations that become more prominent upon undercooling.

If you would like to know more details, please take a look at our article published in npj Computational Materials: https://doi.org/10.1038/s41524-022-00830-7

References

[1] LaCount, M. D. & Gygi, F. Ensemble first-principles molecular dynamics simulations of water using the SCAN meta-GGA density functional. The J. Chem.Phys. 151,164101, DOI: https://doi.org/10.1063/1.5124957 (2019)

[2] Ercole, L., Marcolongo, A. & Baroni, S. Accurate thermal conductivities from optimally short molecular dynamics simulations. Sci. Reports 7, 15835, DOI: https://doi.org/10.1038/s41598-017-15843-2 (2017).

[3] Tisi, D. et al. Heat transport in liquid water from first-principles and deep neural network simulations. Phys. Rev. B 104, 224202, DOI: https://doi.org/10.1103/PhysRevB.104.224202 (2021).

[4] Grasselli, F., Stixrude, L. & Baroni, S. Heat and charge transport in H2O at ice-giant conditions from ab initio molecular dynamics simulations. Nat. Commun. 11, 3605, DOI: https://doi.org/10.1038/s41467-020-17275-5  (2020).

[5] Chen, M. et al. Ab initio theory and modeling of water. Proc. Natl. Acad. Sci. 114, 10846–10851, DOI: https://doi.org/10.1073/pnas.1712499114 (2017).