Comments (3)
Hi Ben,
To include pure component excess energies, set thermo.mixture.include_excess_energies = True
. Unfortunately, it looks like thermo fails to calculate excess enthalpy/entropy at P=350e5, T=298.15
.
import thermosteam as tmo
thermo = tmo.Thermo(['H2'])
thermo.mixture.include_excess_energies = True
tmo.settings.set_thermo(thermo)
T = 298.15
feed = tmo.Stream(H2=1, T=T, P=20e5, phase='g')
S0 = feed.S # This works
H0 = feed.H # This works
feed.P = 350e5
feed.T = T
S = feed.S # This fails
H = feed.H # This also fails
I think Caleb might be able to help you out further on this. You can post an issue in thermo that the following fails:
from thermo.eos import IG, PR
PR(T=298.15, P=350e5, Tc=33.2, Pc=1296960.0, omega=-0.22).S_dep_g # AttributeError: 'PR' object has no attribute 'S_dep_g'
If you'd like to use coolprop for all thermodyamic properties, one potential solution is to create your own Mixture object that interfaces with coolprop (instead of the default one created by thermosteam):
https://biosteam.readthedocs.io/en/latest/API/thermosteam/mixture/Mixture.html
Hope this helps,
Thanks!
from thermosteam.
Hi Ben,
I saw the issue on CalebBell/thermo#118, thanks for posting! Here are the new results with the fallback when phase identification suggests another phase (which doesn't actually matter since it is supercritical).
import thermosteam as tmo
import thermo as tm
thermo = tmo.Thermo([tmo.Chemical('H2', eos=tm.SRK)])
thermo.mixture.include_excess_energies = True
tmo.settings.set_thermo(thermo)
T = 298.15
feed = tmo.Stream(H2=1, T=T, P=20e5, phase='g')
S0 = feed.S # This works
H0 = feed.H # This works
feed.P = 350e5
feed.T = T
S = feed.S
H = feed.H
power_cp = H-H0 - T*(S-S0) # 7596 kJ/hr in coolprop
print(f"T*dS: {T*(S-S0):.2f}, dH: {H-H0:.2f}, power_cp: {power_cp:.2f}") # T*dS: -7214.74, dH: 381.30 in coolprop
Output
T*dS: -7261.40, dH: 307.44, power_cp: 7568.85
Note that I'm using SRK, which is the closest we can get to coolprop's HEOS. I'm not sure which one is more accurate (you may need to check literature), but both seem quite close.
EDIT: The calculation of S and H also depends on the Cp model used, so that might also play a role if you see any deviations from literature.
Hope this helps!
from thermosteam.
Hi @yoelcortes,
I think they are close enough. Thank you very much for your help! 😃
I will now close this issue.
from thermosteam.
Related Issues (20)
- Issue with ternary HOT 1
- [Feature request] auto-determine phases when creating `Stream` objects HOT 5
- Error when creating Stream with three chemicals and `vlle=True` HOT 5
- Consider phases in reaction enthalpy calculation HOT 7
- Account for phase changes in adiabatic reactions HOT 1
- `_chemical.Tsat()` returns boiling point > T critical HOT 3
- `Mixture.solve_T_at_SP` returns incorrect results HOT 1
- Entropy setter sometimes does not work on `MultiStream` objects HOT 3
- Cache is (still) broken HOT 3
- Proper way to set Cn methods? HOT 1
- Redirect previous thermosteam docs domain to biosteam docs domain HOT 2
- Bug in copying `ChemicalIndexer` HOT 2
- Thermosteam is no long Python 3.8-compatible HOT 2
- units_of_measure importing error due to pint verion HOT 3
- Python 3.8 no longer supported (only Python>=3.9 is supported)
- TypeError: 'NoneType' Object is not callable HOT 2
- Use pint.get_application_registry() rather than creating one with UnitRegistry() HOT 1
- Save report bug HOT 4
- Creating a Stream object with mass flows for isomer chemicals (acetic acid & glycolaldehyde) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from thermosteam.