How is the enthalpy computed in gromacs?

GROMACS version: 2021.4-2
GROMACS modification: Yes/No
Hello, I’m trying to run MD simulations of liquid propanol in the NPT ensemble, and I’m a bit confused about my results. After the simulation, I computed the thermodynamic proprieties below using gmx energy:

Energy Average Err.Est. RMSD Tot-Drift

Potential -20.5116 0.84 2.40346 -4.75479 (kJ/mol)
Total Energy 14.1659 0.84 2.42722 -4.66579 (kJ/mol)
Temperature 298.024 0.16 3.71291 0.764872 (K)
Pressure -13.653 11 401.47 0.0591182 (bar)
Volume 62.8428 0.47 1.26078 -2.81342 (nm^3)
Density 794.311 5.8 15.1766 34.2912 (kg/m^3)
Enthalpy 7086.76 420 1213.68 -2333.07 (kJ/mol)

The enthalpy is much larger than the total energy and the potential energy, and I would like why. Furthermore, gromacs also computed other thermodynamics properties, that are printed below:

Volume = 7.56896e-05 m^3/mol
Enthalpy = 14.1735 kJ/mol
Coefficient of Thermal Expansion Alpha_P = 0.0289423 (1/K)
Isothermal Compressibility Kappa = 6.14731e-09 (m^3/J)
Adiabatic bulk modulus = 1.62673e+08 (J/m^3)
Heat capacity at constant pressure Cp = 3989.33 J/(mol K)
Cp-Cv = 3073.76 J/(mol K)

Now the enthalpy appear again, but with a very different value. Why there are two enthapies in gromacs?

That looks strange. Do you get the same with a supported version of GROMACS?
You say that you calculated the values in the upper table using gmx energy. How did you calculate the values below?

Hi MagnusL. What would be a supported version? The values below were computed also with gmx energy. When I use gmx energy, gromacs automatically compute all these values.

2023 and 2024 are supported, see https://manual.gromacs.org/current/release-notes/index.html for more information.

Thanks for the clarification. But I still don’t understand fully. I don’t think gmx energy calculates anything automatically. And it looks strange that there are two volume and enthalpy outputs. Could you copy and paste the gmx energy command you are running, all output from the command (i.e. what observables you can choose from), the observables you choose to analyse as well as the results from the command?

Thanks, I will try to install the latest version of gromacs and run again. To comando I used was

gmx energy -f md.edr -fluct_props -nmol 500 -o prop_md.xvg

and I selected potencial, temperature, total-energy, density, enthalpy, volume and pressure. The output was (it’s a bit different because it’s another test, but the problem continue):

          :-) GROMACS - gmx energy, 2021.4-Ubuntu-2021.4-2 (-:

                        GROMACS is written by:
 Andrey Alekseenko              Emile Apol              Rossen Apostolov     
     Paul Bauer           Herman J.C. Berendsen           Par Bjelkmar       
   Christian Blau           Viacheslav Bolnykh             Kevin Boyd        
 Aldert van Buuren           Rudi van Drunen             Anton Feenstra      
Gilles Gouaillardet             Alan Gray               Gerrit Groenhof      
   Anca Hamuraru            Vincent Hindriksen          M. Eric Irrgang      
  Aleksei Iupinov           Christoph Junghans             Joe Jordan        
Dimitrios Karkoulis            Peter Kasson                Jiri Kraus        
  Carsten Kutzner              Per Larsson              Justin A. Lemkul     
   Viveca Lindahl            Magnus Lundborg             Erik Marklund       
    Pascal Merz             Pieter Meulenhoff            Teemu Murtola       
    Szilard Pall               Sander Pronk              Roland Schulz       
   Michael Shirts            Alexey Shvetsov             Alfons Sijbers      
   Peter Tieleman              Jon Vincent              Teemu Virolainen     
 Christian Wennberg            Maarten Wolf              Artem Zhmurov       
                       and the project leaders:
    Mark Abraham, Berk Hess, Erik Lindahl, and David van der Spoel

Copyright (c) 1991-2000, University of Groningen, The Netherlands.
Copyright (c) 2001-2019, The GROMACS development team at
Uppsala University, Stockholm University and
the Royal Institute of Technology, Sweden.
check out http://www.gromacs.org for more information.

GROMACS is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1
of the License, or (at your option) any later version.

GROMACS: gmx energy, version 2021.4-Ubuntu-2021.4-2
Executable: /usr/bin/gmx
Data prefix: /usr
Working dir: /home/leonardo/Desktop/doutorado/Calc_propanol/MD_propanol_liquido
Command line:
gmx energy -f md.edr -fluct_props -nmol 500 -o prop_md.xvg

Opened md.edr as single precision energy file

Select the terms you want from the following list by
selecting either (part of) the name or the number or a combination.
End your selection with an empty line or a zero.

1 Bond 2 Angle 3 Ryckaert-Bell. 4 LJ-14
5 Coulomb-14 6 LJ-(SR) 7 Disper.-corr. 8 Coulomb-(SR)
9 Coul.-recip. 10 Potential 11 Kinetic-En. 12 Total-Energy
13 Conserved-En. 14 Temperature 15 Pres.-DC 16 Pressure
17 Constr.-rmsd 18 Box-X 19 Box-Y 20 Box-Z
21 Volume 22 Density 23 pV 24 Enthalpy
25 Vir-XX 26 Vir-XY 27 Vir-XZ 28 Vir-YX
29 Vir-YY 30 Vir-YZ 31 Vir-ZX 32 Vir-ZY
33 Vir-ZZ 34 Pres-XX 35 Pres-XY 36 Pres-XZ
37 Pres-YX 38 Pres-YY 39 Pres-YZ 40 Pres-ZX
41 Pres-ZY 42 Pres-ZZ 43 #Surf*SurfTen 44 T-System
45 Lamb-System

Last energy frame read 5000 time 1000.000

Statistics over 500001 steps [ 0.0000 through 1000.0000 ps ], 7 data sets
All statistics are over 5001 points (frames)

Energy Average Err.Est. RMSD Tot-Drift

Potential -20.1634 0.031 0.509918 0.16298 (kJ/mol)
Total Energy 14.525 0.031 0.659254 0.160342 (kJ/mol)
Temperature 298.068 0.03 3.43175 -0.0226725 (K)
Pressure 6.17727 10 392.094 -53.3204 (bar)
Volume 62.7184 0.02 0.269243 0.0483782 (nm^3)
Density 795.568 0.25 3.41745 -0.609909 (kg/m^3)
Enthalpy 7266.29 15 329.632 80.1737 (kJ/mol)

You may want to use the -driftcorr flag in order to correct
for spurious drift in the graphs. Note that this is not
a substitute for proper equilibration and sampling!

Temperature dependent fluctuation properties at T = 298.068.

Heat capacities obtained from fluctuations do not include
quantum corrections. If you want to get a more accurate estimate
please use the g_dos program.

WARNING: Please verify that your simulations are converged and perform
a block-averaging error analysis (not implemented in g_energy yet)
Volume = 7.55398e-05 m^3/mol
Enthalpy = 14.5326 kJ/mol
Coefficient of Thermal Expansion Alpha_P = 0.000594451 (1/K)
Isothermal Compressibility Kappa = 2.80862e-10 (m^3/J)
Adiabatic bulk modulus = 3.56046e+09 (J/m^3)
Heat capacity at constant pressure Cp = 294.188 J/(mol K)
Cp-Cv = 28.3289 J/(mol K)

++++ PLEASE READ AND CITE THE FOLLOWING REFERENCE ++++
M. P. Allen and D. J. Tildesley
Computer simulation of liquids
Oxford Science Publications 1 (1987) pp. 1
-------- -------- — Thank You — -------- --------

I can reproduce the error in GROMACS 2021.4, but it works fine in version 2022 (at least from version 2022.3). The problem seems to be inconsistent treatment of -nmol.

I installed 2024.1 and run the simulation, and it worked also! There is no more inconsistencies. Now I will use this version of gromacs. Thank you so much!

Good to hear it’s working. I should I have been clearer, though. You don’t need to rerun the simulations. It’s only the analysis that is different (in this specific aspect).

ah ok, thanks again!