-
Notifications
You must be signed in to change notification settings - Fork 34
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
Implement Compressor #103
Implement Compressor #103
Conversation
Thanks for taking the initiative on this, it is always exciting to see contributions :) I went ahead and added an entropy solver in thermosteam Mixture and Stream objects, so this works now: import biosteam as bst
bst.settings.set_thermo(["H2"])
inlet= bst.Stream(H2=1, T=25 + 273.15, P=101325, phase='g')
outlet = inlet.copy()
outlet.P = 50e5
outlet.S = inlet.S
outlet.show() Output (EDITED AFTER CORRECTION IN THERMOSTEAM):
The solver takes advantage of how we know the functional form of the entropy and is the same way we solve for enthalpy. To account for phase changes, the best way to do so is by allowing VLE objects to accept S as an argument. This way, if we want to run the compressor without assuming it will remain a gas, we can set S and P then set H and P. I can try to get this done, but it would be nice if the user could assume an outlet phase too (to skip phase equilibrium calculations). For design and costing, checkout Chapter 16 (Cost Accounting and Capital Cost Estimation) of Seider's Product and Process Design Principles (2017 edition). They have a section on compressors. Please feel free to choose whichever letter (or combination of letters) for the "area naming convention" you prefer. For example, "COMP" is good too (but preferably not more than 4 letters). I'll be working on phase equilibrium tools to help with implementing the compressor, |
Update, thermosteam can now solve T-S and P-S VLE specifications: import biosteam as bst
bst.settings.set_thermo(['Ethanol', 'H2O'])
inlet= bst.Stream(Ethanol=1, H2O=1, T=25 + 273.15, P=101325, phase='g')
outlet = inlet.copy()
outlet.vle(P=2e5, S=inlet.S)
outlet.show('cwt') Output:
Hope this helps! |
Update @yoelcortes :
|
Hi Ben, Excellent work! I like For the chemical engineering price index, you can use: cost["Compressor"] = bst.CE / 509.7 * (a + b*S**n) I prefer to write all cost equations in the original CEPCI, then adjust it in the code at run time, this way it is easy to compare the code with literature and spot number typos in the code. For costing, I believe the bare module cost factor should be around 2.15. We should also add some material/design factors (they change with electric motor, steam turbine, or gas turbine). Does your reference include any of these? For the case when the power is too high, would having multiple compressors in series make sense? We can also let the user enforce a compressor type. I would be happy to implement this. At this point, I would be happy to accept the pull request. I can address whatever is left (including bare module, design, and material factors; CEPCI; and units in series). Whenever you are ready, just like my comment and I will go ahead with the pull. Thanks! |
Hi @yoelcortes, I just finished the last todos:
Open todos:
I'll mark this PR as ready for review. Feel free to merge any time :) |
Sounds good, I'll focus on costing. Once it's done I'll add the compressor to the docs API. I'll also take care of failing tests and make sure they all pass locally. Unfortunately, github has some sort of cache that makes CI tests run on old installations of thermosteam and biorefineries. So I'll need to figure out how to fix the CI for this (maybe move to another CI platform? Not sure yet). Thanks! |
This is a draft PR to implement a compressor unit in biosteam.
Questions to @yoelcortes:
Which letter for the area naming convention?Any better ideas for Tmin and Tmax in _solve_T_entropy?_compressor.solve_T_entropy should probably be moved to thermosteam.Mixture?Any ideas on _cost implementation?Current status
PR implements a new class
units.IsentropicCompressor
, which compresses agas
to target pressureP
with isentropic efficiencyeta
:Todo
_setup
,_run
and_design
_cost
MultiStream
objects thermosteam#68Related issues
MultiStream
objects thermosteam#68