CalebBell / thermo

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

tabulate_solid generates an exception #55

Closed jckantor closed 3 years ago

jckantor commented 3 years ago

import thermo from thermo.chemical import Chemical

H2 = Chemical('hydrogen') thermo.datasheet.tabulate_solid(H2.CAS)

generates an exception


Exception Traceback (most recent call last)

in () 3 4 H2 = Chemical('hydrogen') ----> 5 thermo.datasheet.tabulate_solid(H2.CAS) 2 frames /usr/local/lib/python3.6/dist-packages/thermo/datasheet.py in tabulate_solid(chemical, Tmin, Tmax, pts) 49 Ts = np.linspace(Tmin, Tmax, pts) 50 for T in Ts: ---> 51 chem = Chemical(chemical, T=T) 52 rhos.append(chem.rhos) 53 Cps.append(chem.Cps) /usr/local/lib/python3.6/dist-packages/thermo/chemical.py in __init__(self, ID, T, P) 554 if self.CAS in _chemical_cache and caching: 555 self.__dict__.update(_chemical_cache[self.CAS].__dict__) --> 556 self.calculate(T, P) 557 else: 558 if not isinstance(ID, dict): /usr/local/lib/python3.6/dist-packages/thermo/chemical.py in calculate(self, T, P) 587 if T: 588 if T < 0: --> 589 raise Exception('Negative value specified for Chemical temperature - aborting!') 590 self.T = T 591 if P: Exception: Negative value specified for Chemical temperature - aborting!
CalebBell commented 3 years ago

Hi Dr. Kantor, I'm a big fan of your work. Thanks for the bug report. I don't do a whole lot of solid modeling, and I wouldn't expect very accurate results for and solid properties of hydrogen. I pushed a fix to the issue, it will be in the next release. Sincerely, Caleb