Calculating Mixing Enthalpy in GROMACS What is the most reliable way to calculate mixing enthalpy of binary solvent mixture using GROMACS?

[EDIT]

I have simulated two-component systems of water and organic solvent with GROMACS. In a research paper from my field of study, authors calculate 'enthalpy of mixing' with the software in order to compare it with experimental mixing enthalplies. Under the Experimental Section of the paper, authors show that they do this according to this term:



A comment added in the text says the following: 

"The internal energy, U, of the liquid mixture was obtained directly from the potential energy (see Tables S1
and S2) during the simulation, and yi is the molar fraction of component i." 

I am interested in calculating same thermodynamical properties for my systems. I am aware that I can do that with g_energy function in GROMACS, or at least some parts of it (Pressure, Volume, Potential Energy).

My question is: 
Firstly, is this an appropriate way of calculating enthalpy of mixing in GROMACS via this equation?
Secondly, how can one specify with the g_energy function which of the liquid's U(or potential energy), P and V is calculated if I initiate the function with .edr files, i.e. how can I choose to calculate i'th component's properties?

Reference for the image and quote:

Aguilera-Segura, S. M.; Di Renzo, F.; Mineva, T. Structures, Intermolecular Interactions, and Chemical Hardness of Binary Water-Organic Solvents: A Molecular Dynamics Study. J. Mol. Model. 2018, 24 (10), 292. https://doi.org/10.1007/s00894-018-3817-2.
GROMACS won't be able to calculate the enthalpy of mixing directly but using the energy function in GROMACS you will be able to get energy, pressure, and volume of the simulations. 

Going through the paper that you posted it looks like the ran multiple simulation boxes for the different components and mixtures. They did this because you will not be able to get U,P, and V for individual components in GROMACS. So in order to calculate the enthalpy of mixing for a 2 component mixture they ran 3 simulations: one of the mixture, and one of each component by themselves. 

Once you have the simulation boxes for the different components and mixtures it should be pretty straight forward to calculate the enthalpy of mixing.

Just a side note: I am always a little nervous calculating thermodynamic expressions using pressure from GROMACS because the pressure will fluctuate so wildly. So if you're going to make sure you're careful about your equilibration run and your NPT equilibration run as well. 

Below are the GROMACS manual for energy which you would use to get U,P, and V from your simulation. The next is a tutorial for an NPT run from Virginia Tech and their tutorials are really well written and should help as a starting point and finally the last is a chat between a user and GROMACS developer discussing pressure fluctuations in NPT. 

http://manual.gromacs.org/documentation/current/onlinehelp/gmx-energy.html

http://www.bevanlab.biochem.vt.edu/Pages/Personal/justin/gmx-tutorials/lysozyme/07_equil2.html

https://mailman-1.sys.kth.se/pipermail/gromacs.org_gmx-users/2011-May/061370.html