CalebBell / thermo

Thermodynamics and Phase Equilibrium component of Chemical Engineering Design Library (ChEDL)
MIT License
594 stars 114 forks source link

Chemical don't import heat of formation #14

Closed gamafreire closed 5 years ago

gamafreire commented 5 years ago

Chemical don't import heat of formation . Can it be a bug? Can someone, please, help me?

thermo==0.1.39

from thermo.chemical import Chemical thermo.datasheet.tabulate_constants('NH3',full=True)

or

NH3 = Chemical("7664-41-7") print NH3.Hf

answer > None

This happens for other cases like N2, H2!

But in local/lib/python2.7/site-packages/thermo/Heat\ Capacity/TRC\ Thermodynamics\ of\ Organic\ Compounds\ in\ the\ Gas\ State.tsv

we can see:

"CAS Chemical Hfc Gfc Sc Cpc Hfl Gfl Sfl Cpl Hfg Gfg Sfg Cpg" "7664-41-7 Ammonia -45900 -16400 192.8 35.1"

For instance Chemical('Toluene').Hf answer > 50170.0

That is quite correct because NIST Webbook lists ΔfH°gas | 50.1 ± 1.1 | kJ/mol | Review | Roux, Temprado, et al., 2008 | There are sufficient high-quality literature values to make a good evaluation with a high degree of confidence. In general, the evaluated uncertainty limits are on the order of (0.5 to 2.5) kJ/mol.;D.R. Burgess.

But in local/lib/python2.7/site-packages/thermo/Heat\ Capacity/TRC\ Thermodynamics\ of\ Organic\ Compounds\ in\ the\ Gas\ State.tsv "CASRN Chemical Tmin Tmax a0 a1 a2 a3 a4 a5 a6 a7 I J Hf" "108-88-3 Toluene 12400 157.3 50500"

and in local/lib/python2.7/site-packages/thermo/Heat\ Capacity/CRC\ Standard\ Thermodynamic\ Properties\ of\ Chemical\ Substances.tsv "CAS Chemical Hfc Gfc Sc Cpc Hfl Gfl Sfl Cpl Hfg Gfg Sfg Cpg" "108-88-3 Methylbenzene 50 1500 4 87000 204 34.095 17.743 -35740000 209 71 15.7 10.67 73300"

Filipe Gama Freire

CalebBell commented 5 years ago

Hi Dr. Freire, When I implemented the heat of formation function originally, I saw some data was only available for liquids, solids, gases, or even aqueous phases only. So I thought it would be smart to write functions for different phases. There is a Hf_l and Hf_g function in the thermo.reaction module, and I haven't worked on solids much so there's no equivalent function for solids.

In practice, it probably would have been best to provide 'Hf' as a property of chemicals in the standard gas state for all molecules - even ones which cannot be stable up to that temperature.

The Hf function, and the Hf property of chemicals, might work better in the future if it were changed to this convention. There is no timeline associated with that change.

For now, you can get the molar enthalpy of formation for chemicals in the gas phase by bypassing the Chemical interface directly:

from thermo import Chemical, Hf_g
NH3 = Chemical('ammonia')
Hf = Hf_g(NH3.CAS)

Sincerely, Caleb