BUG: Potential regression for thermal conductivity in pure components in latest update
Stefan-Endres opened this issue · 2 comments
After updating to the latest version of the thermo
package, the Chemical class is missing thermal conductivity for some pure components which were previously present. Potentially related to #52.
Minimal working examples:
Previous behaviour:
$ pip show thermo
Name: thermo
Version: 0.1.40
>>> from thermo.chemical import Chemical
>>> fuel_name = "Ethanol" # Similar for "Water"
>>> fuel = Chemical(fuel_name, T=303.15)
>>> print(fuel.kg)
0.01164343539939321
After updating:
$ pip show thermo
Name: thermo
Version: 0.2.10
>>> from thermo.chemical import Chemical
>>> fuel_name = "Ethanol" # Similar for "Water"
>>> fuel = Chemical(fuel_name, T=303.15)
>>> print(fuel.kg)
None
Accessing other properties still work as expected:
>>> print(fuel.Cp)
2477.71998173878
>>> print(fuel.alpha)
8.443183815819819e-08
Hi Stefan,
Thanks for reporting this! I believe this is because the previous behavior of chemicals would cycle through methods until one would work. This behavior has been deprecated in favor of extrapolation, which helps keep properties continuous and consistent, but there are still a few issues with this...
The gas thermal conductivity method depends on the gas molar volume method (Vmg). The default method for Vmg is 'EOS', which fails at that temperature and pressure. To fix your issue, you can change the method for Vmg:
>>> from thermo.chemical import Chemical
>>> fuel_name = "Ethanol" # Similar for "Water"
>>> fuel = Chemical(fuel_name, T=303.15)
>>> fuel.VolumeGas.method_P= 'TSONOPOULOS_EXTENDED'
>>> print(fuel.kg)
0.011656785631933345
@CalebBell, let me know if I missed anything here.
Thanks!
Thank you very much for the quick response. Setting the method worked for me.