# Calculating internal energy of formation

I'm working on some code to simulate combustion at constant volume instead of constant pressure and I need to calculate the internal energy of formation for the species involved because I can only find the enthalpy of formation. I'm thinking of doing it this way:

1. Simulate the formation reaction at constant pressure in whichever direction is exothermic and let it expand.
2. Use the isentropic relations to compress the products back to the original volume isentropically.
3. Find the internal energy of the products by integrating $$C_V$$ numerically from $$298~\mathrm{K}$$ to whatever temperature results from the isentropic compression.

Is this the right way to do this and/or is there a simpler way? I'm doing this all numerically so I can account for changing specific heats. Thanks.

In your combustion reaction, if you are assuming that the reactants and products are ideal gases, you can calculate the change in enthalpy at constant temperature and pressure from the heats of formation. Now, if you compress the products at constant temperature down to the same volume as the reactants, the change in enthalpy will be zero (because the enthalpy of an ideal gas mixture is pressure independent). So this is also the enthalpy change for the reaction carried out at constant temperature and volume (again, for an ideal gas mixture). To get $\Delta U$ at constant temperature and volume, you just subtract $\Delta (PV)=RT\Delta n$.