Closed yalinli2 closed 1 year ago
@yalinli2,
The temporary fix confuses the solver. I added some code to handle this special case. I am not able to test it, but I believe it should fix your issue:
Thanks,
lol I know my two-second fix would be problematic, I think your fix works, thank you!
@emilypl2 I didn't test all the way through, feel free to reopen this issue and follow up if you run into future problems!
@emilypl2 and I ran into a problem when running the lactic acid module with biosteam's
BoilerTurbogenerator
. Essentially a very small negative value (to 10-15) was calculated forH_electricity
: https://github.com/BioSTEAMDevelopmentGroup/biosteam/blob/e2db47535d594f9010e6a3094737b817c837ff44/biosteam/facilities/_boiler_turbogenerator.py#L334which led to negative work and error in decorated cost calculation: https://github.com/BioSTEAMDevelopmentGroup/biosteam/blob/e2db47535d594f9010e6a3094737b817c837ff44/biosteam/units/decorators/_cost.py#L152
I locally inserted a line
H_electricity = 0 if abs(H_electricity)<1e-6 else H_electricity
to temporarily fix it for now, but not sure if it's good for a permanent fix, thanks!