Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Potential regression for thermal conductivity in pure components in latest update #89

Closed
Stefan-Endres opened this issue Nov 1, 2021 · 2 comments

Comments

@Stefan-Endres
Copy link

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

@yoelcortes
Copy link
Collaborator

yoelcortes commented Nov 1, 2021

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!

@Stefan-Endres
Copy link
Author

Thank you very much for the quick response. Setting the method worked for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants