BioSTEAMDevelopmentGroup / Bioindustrial-Park

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

General updates to biorefinery models. #75

Closed yoelcortes closed 1 year ago

yoelcortes commented 1 year ago

@yalinli2, @daltonwstewart,

This pull request uses the aerobic-bioreactor branch of biosteam and the latest thermosteam. This branch fixes many minor bugs in pressure handling and elsewhere.

Several corrections were made to chemical properties for lignocellulosic components, including heats of formation, reference phases, and a few heat capacities (in part thanks to @zasddsgg. Overall, results are actually looking closer Humbird's 2011 report (now MESP is 2.16 USD/gal; previously 2.10 USD/gal). Additionally, pressure handling in the ethanol purification system distillation columns was corrected (previously the beer column was operating at a lower pressure than the next column).

The following corrections were made for the corn biorefinery:

The following updates were made for the oilcane biorefineries:

Thanks,

zasddsgg commented 1 year ago

Thanks for your fix. Regarding the pressure in the distillation tower in the corn model, the pdf report (page 122) appears to have a top pressure of 2atm and a bottom pressure of 2.1atm for D302, but it appears to be 6atm in BioSTEAM after modification? The exit pressure of P302 appears to be 6.3atm, but BioSTEAM's modification appears to be 6atm? Also, for D303, the tower top pressure for D303 appears to be 1.6 atm in the pdf report (page 123), but it appears to be 2atm after BioSTEAM's modification? Is it because BioSTEAM has something else on its mind? Finally, could I consult you why change x_bot = 1e-3 of D403 to 3.9106e-06 (where is the data source of 3.9106e-06), and k=1.25 of D303 to 1.2? Thanks a lot. Wish you a good day.

yoelcortes commented 1 year ago

@zasddsgg, thanks for the questions and for looking at the code! The ethanol purification system is modeled after a SuperPro model for sugarcane ethanol and corn ethanol (see refs in the readmes for these).

Please let me know if you have any more questions or suggestions on the code, Thanks!

zasddsgg commented 1 year ago

Thank you for your answer. On page 122 of the corn stover report by Humbird (2011) et al., where D501 refers to the beer column, the inlet flow (506) does have a pressure of 6atm, but the outlet flow (509 and 510) appears to have a pressure of 2atm (the pressure of the beer column), while 6atm was set in BioSTEAM? The outlet flow pressure of P506 in report (stream 507) (equivalent to BioSTEAM's P302) is 6.3atm, but the pressure in BioSTEAM is 6atm? On page 123, D502 is the next column, and the pressure of outlet flow (511) is 1.6atm (that is, the pressure of the next column), but it is 2atm in BioSTEAM? In addition, x_bot of beer column and the next column in BioSTEAM were both 3.9106e-06. Are both of these values from stream tables in the sugarcane biorefinery from Huang et al? Why not use stream tables in the corn stover biorefinery from Humbird (2011) et al? So could I consult you which parameters of the ethanol purification system from sugarcane biorefinery from Huang et al, which are from corn stover biorefinery from Humbird (2011) et al? Does “The k was changed from 1.25 to 1.2 is to better match utility requirements” mean maintaining the same utility as Humbird (2011) et al? Finally, in commit 121b8c5 (https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/commit/121b8c58ea797dd53c78a061ba2714b264616115), why change include_blowdown_recycle to None? Could I consult you what are the considerations behind setting udct['H401'].dT = 10, udct['D402'].k = 1.4 and udct['D403'].k = 1.4? If the parameters of ethanol purification system are from the corn stover biorefinery from Humbird (2011) et al, why purposely set udct['H401'].dT = 10, udct['D402'].k = 1.4 and udct['D403'].k = 1.4? Why don't we call the ethanol purification system directly? I'm sorry for the above problems. Thanks a lot. Wish you a good day.

yoelcortes commented 1 year ago

@zasddsgg,

BioSTEAM still cannot do pressure drops. The pressure at the bottom is higher than the top. Whether to use the outlet or inlet pressure, neither is entirely correct, nor does it matter much (for results). The inlet pressure is a conservative estimate so I went with that.

I am open to using an average column pressure as well as changing the value of x_bot for just the cornstover biorefinery to whatever value is in the stream tables in Humbird. Please feel free to work on this if you like.

The parameters of ethanol purification system are from the sugarcane and corn biorefinery (not corn stover). Any modifications such as udct['D402'].k = 1.4 should be made outside the function creator because these defaults are for the sugarcane model. This is done to be able to maintain them, keep consistent tests, and deploy them for multiple biorefineries.

Thanks,

yalinli2 commented 1 year ago

@yoelcortes, I didn't look at the codes, but the baseline results seem to be good (@emilypl2 please follow up here if using this branch will significantly change your results), the only thing is that you'll need the aerobic-bioreactor branch of biosteam, so it'll be great if updates on that branch can be merged in biosteam's master branch as well, thank you!

zasddsgg commented 1 year ago

Thank you for your answer. Could I consult you is the pressure of P302 consistent with that of P301 because the pressure of the two inlet flows of HXprocess should be kept close? I have tried to change the operating pressure of D402 from 2atm to 6atm, and the heat load of condenser has changed from -500 to -30000kJ/h. The heat load of reboiler, number of trays and reflux ratio have also changed. I believe that even if there is no pressure drop in BioSTEAM's distillation tower, it seems that the operating pressure of the distillation column should be consistent with that of the outlet stream (as with the heat exchanger), that is, the pressure seems to be set at 2atm for D402 (6atm for the inlet) and 1.6atm for D403 is more reasonable. Does "The k was changed from 1.25 to 1.2 is to better match utility requirements" mean maintaining the same utility as the sugarcane model and the corn model? In commit 121b8c5 (121b8c5), change include_blowdown_recycle to None, could I consult you what is the consideration for this change? For udct['H401'].dT = 10, udct['D402'].k = 1.4 and udct['D403'].k = 1.4, what is the basis for choosing the value 10 and 1.4? Isn't k 1.2 and dT 5? For the parameters of ethanol purification system, do the tower pressure come from the corn stover model, x_bot and the rest parameters from the sugarcane and corn model? I know that you are very busy these days, I won't bother you again when these problems are solved. Thanks a lot. Wish you a good day.

yoelcortes commented 1 year ago

@zasddsgg, thanks for your input. I looked at pressure drop heuristics in literature and it seems like the pressure drop per stage is not typically too high. It seems odd to me that the inlet pressure is so high. I'm not sure it is something special about the beer column due to high solids loading. I'll open a new issue regarding the beer column pressure and look into it later.

Regarding your other questions, I'll get back to you tomorrow.

Thanks,

zasddsgg commented 1 year ago

May I ask you some additional questions about molecular sieve and binary interaction parameters? a)For source code of molecular_sieve (https://github.com/BioSTEAMDevelopmentGroup/biosteam/blob/master/biosteam/units/molecular_sieve.py), heat_utility seems to be estimated by self.add_heat_utility(1429.65 flow, T) and self.add_heat_utility(-55.51 flow, T). I guess 1429.65 and -55.51 were calculated using the mass flow (kg/h) and heat duty (kJ/h) in corn stover's pdf report (Humbird,2011). In page 124, the heat duty of QH503, QH507 and QH509 is 2.565+0.214+5.187=7.966 Gcal/h, that is, 7.9664.18610^6 kJ/h=3.33510^7 kJ/h, then divide self._outs[1].F_mass, i.e., the mass flow rate of 514 stream in pdf (21808 kg/h), so 3.33510^7/21808=1529.26, which seems to be different from 1429.65. Also, the heat duty of QH506 is -0.301 Gcal/h. That is -0.301 4.186 10 ^ 6 kJ/h = 1.26 10 ^ 6 kJ/h, -1.26 10 ^ 6/21808 = -57.78 Could I consult you are 1429.65 and -55.51 obtained from the above methods? But in fact, H507 heats 517 stream through 514 stream, that is, the heat released by cooling 514 stream is equal to the heat absorbed by heating 517 stream, so the duty of H507 is actually 0, and H509 is H304 in the source code of ethanol systems (https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/blob/master/biorefineries/ethanol/systems.py), which is not included in the process of molecular sieve, so heat does not seem to be included, so only QH503 is present, and QH503 is actually exothermic (CWS in pdf, denotes cooling water as heat utility), so it should be -2.565 Gcal/h (2.565 is marked in pdf, but I think it should be -2.565 in BioSTEAM, because cooling water is used as heat utility), so -2.5654.18610^6/21808 is -492.35. As for QH506, which is H303 in the source code of ethanol systems, it is also not included in the process of molecular sieve, so heat seems not to be included, and QH506 uses low pressure steam as the heat utility (LP STEAM is marked in QH506 in pdf, denotes low pressure steam as heat utility), so it should be 0.301 (denotes endothermic heat) instead of -0.301 in BioSTEAM, but actually QH506 is not in the process of molecular sieve, so heat should not be included. Therefore, the heat utility in themolecular sieve process is only QH503, which is calculated as -492.35. So should we only have self.add_heat_utility(-492.35 flow, T) in the source code of molecular_sieve? b)In addition, at the lower right corner of page 124 in pdf, the mass flow of the corresponding flow entering the molecular sieve (511A stream) is 29213 kg/h, but what is given by @cost in the source code of molecular_sieve is 22687 kg/h? c)Besides, after molecular sieve process, ethanol in pdf was cooled to 38 degrees (515 stream), but in BioSTEAM it was cooled to 66.85 degrees (66.85 degrees for H304 exit stream in the source code of ethanol systems). d)The heat duty of the molecular sieve is estimated instead of calculated by Hnet, because the inlet and outlet of the molecular sieve have the same temperature and no reaction occurs, so Hnet (duty) is 0. Therefore, net_duty cannot be calculated by self.add_heat_utility(duty, T). Is that why the estimates are made for the molecular sieve’s heat_utility by the above way (self.add_heat_utility(1429.65 flow, T) and self.add_heat_utility(-55.51 * flow, T))? e)Finally, when separating any two substances by binary distillation, are the binary interaction parameters of the two substances taken into account by default when viewing the phase diagram? Are the binary interaction parameters of the two substances taken into account by default when running a binary distillation tower? f)As long as the substances in the BioSTEAM library, are the binary interaction parameters between the light and heavy key components taken into account by default when viewing the phase diagram and running the binary rectification tower? Are the binary interaction parameters between the non-key components also taken into account by default when viewing the phase diagram and running the binary rectification tower? Are the parameters of binary interactions between non-key and key components also taken into account by default when viewing phase diagrams and running binary distillation towers? g)For any two substances, is it more appropriate to look at the phase diagram and run the binary distillation column with binary interaction parameters than without? I'm very sorry for these problems again. After the above problems are solved, I won't bother you during this period. Thanks a lot. Wish you a good day.

yoelcortes commented 1 year ago

@zasddsgg,

Regarding the impact of beer column pressure on utility requirement, the heat integration reduces the impact of higher pressures so that results on the reboiler are similar:

>>> from biorefineries import cornstover as cs
>>> cs.D402.P = 6 * 101325
>>> cs.sys.simulate()
>>> cs.D402.heat_utilities
[<cooling_water: -3.62e+07 kJ/hr, 5.35e+04 kmol/hr, 0 USD/hr>,
 <low_pressure_steam: 1.46e+08 kJ/hr, 4.83e+03 kmol/hr, 0 USD/hr>]

>>> from biorefineries import cornstover as cs
>>> cs.D402.P = 2 * 101325
>>> cs.sys.simulate()
>>> cs.D402.heat_utilities
[<cooling_water: -2.69e+07 kJ/hr, 3.97e+04 kmol/hr, 0 USD/hr>,
 <low_pressure_steam: 1.32e+08 kJ/hr, 4.38e+03 kmol/hr, 0 USD/hr>]

I read some literature online and found that, although higher viscosities (from high solids loading) does increase the pressure drop, it is not too high. It is also common to have a valve at the inlet to regulate flow to the column (so a high inlet pressure in the model is fine). So I updated the pressure of the beer column and distillation column to 2.1 and 1.6 atm, respectively.

Regarding your first questions:

Regarding questions on molecular sieve, please submit them in a different issue and confirm your assertions with code (just like I did above). Comments in the code on what you expect the values should be also help (but not required). Please use triple quotes to highlight code as in https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks. Again, please open another issue instead of adding unrelated issues in this pull request.

This pdf might help answer some of your questions on BioSTEAM's VLE and binary interaction parameters: https://pubs.acs.org/doi/suppl/10.1021/acssuschemeng.9b07040/suppl_file/sc9b07040_si_001.pdf

The binary distillation column disregards non-key components (in VLE) for solving stages and reflux. However, non-key components are are taken into account in the VLE at the condenser and reboiler. Activity coefficients are always taken into account.

EDIT: If any chemical does not have interaction parameters because it is not in the database, you'll get a warning whenever the VLE algorithm runs. You can also check the functional groups (which have data on interaction parameters) with chemical.Dortmund (https://biosteam.readthedocs.io/en/latest/API/thermosteam/Chemical.html) or chemical.show().

Thanks!

zasddsgg commented 1 year ago

Thank you for your answer and suggestion. I have created a new question according to your suggestion. Could I bother you help me for that (#76 in Bioindustrial-Park issue)? Thanks a lot. Wish you a good day.