adelq / thermochem

Useful Python modules for Thermodynamics and Thermochemistry
http://thermochem.readthedocs.io
Other
30 stars 17 forks source link

NIST-JANAF: wrong unit for DeltaH #24

Closed apommel closed 2 years ago

apommel commented 2 years ago

In the documentation, it is written that the unit for the output of the method DeltaH for the JANAF database is supposed to be in kJ/mol. However, when I use it, the output is in J/mol:

>>> db = Janafdb()
>>> steam = db.getphasedata(formula='H2O', phase='g')
>>> steam.DeltaH([0, 100, 200])
array([-238921., -240083., -240900.])

If you check here, you can see that there is a 1e3 factor with the table.

Another thing would be with naming: the method is called DeltaH and in the documentation it is commented as 'Enthalpy', however I believe this is misleading as those values would be standard enthalpies of formation.

adelq commented 2 years ago

Hi Aurélien, you are correct, at some point we decided to try to convert all units to joules (74cbc5d1139309a55ba4e2320a4c887257d7c7c3), but this was inconsistently applied and documented, so I've reverted that commit and made it all consistent, I'm putting together a pull request (#25) to make those changes. Unfortunately, this will be a breaking change for users of this package, so I will be incrementing the version to indicate this.

I agree that the documentation for DeltaH should be the standard enthalpy of formation and have corrected that as well.

apommel commented 2 years ago

Hi Adel,

Having all the units in joules would indeed be fine, as long as it would be properly documented (which was not the case) and that everything would be consistent (currently JANAF hef method returns H-H°(Tr) in kJ/mol). In any case, thank you for your quick response.