BioSTEAMDevelopmentGroup / Bioindustrial-Park

BioSTEAM's Premier Repository for Biorefinery Models and Results
MIT License
36 stars 17 forks source link

Consultation about Flash duty #92

Closed zasddsgg closed 8 months ago

zasddsgg commented 8 months ago

Hello, when I run the following code, F1.Hnet is 1.68e+07, but the duty in F1.results() is the cooling water, which is -6.09e+06, the two value seem to be so different, could I consult you which value should I use? If I remove thermo.mixture.include_excess_energies = True, F1.Hnet and duty in F1.results() become the same. But according to https://biosteam.readthedocs.io/en/latest/API/units/compressor.html#:~:text=Simulate%20reversible%20isothermal%20compression%20of%20gaseous%20hydrogen.%20Note%20that%20we%20set%20include_excess_energies%3DTrue%20to%20correctly%20account%20for%20the%20non%2Dideal%20behavior%20of%20hydrogen%20at%20high%20pressures, It seems appropriate to add thermo.mixture.include_excess_energies = True.

The code is as follows:

from biosteam.units import Flash
import biosteam as bst
from biosteam import Stream, settings
from biorefineries import cellulosic as cs
chemicals_cs = cs.create_cellulosic_ethanol_chemicals()

thermo = bst.Thermo(chemicals_cs)
thermo.mixture.include_excess_energies = True
bst.settings.set_thermo(thermo)

feed = Stream('feed', units='kg/hr', Water=900, Ethanol=28000, T=450, P=2000000)
F1 = Flash('F1',
           ins=feed,
           P=101325, 
           T=100+273.15) 
F1.simulate()
print(F1.Hnet)
F1.results()
yoelcortes commented 8 months ago

@zasddsgg, thanks for posting this bug. Previously the heat exchanger associated with the flash was assuming constant pressure. This has been fixed in the latest commits. Tests has also been added to make sure this doesn't become an issue in the future: https://github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/tests/test_flash.py

If you use the latest github version, you should get the results you expect.

Thanks!