Open arao53 opened 2 years ago
I've run into a similar issue in the past with an empty sum, e.g.: https://github.com/watertap-org/watertap/blob/f2cc0d18ba0290f58222daefb178722437e308a0/watertap/examples/flowsheets/lsrro/lsrro.py#L394-L402
Note that multiplying 0
times the units explicitly seems to work. Might be something in our yaml reader?
@andrewlee94 Wanted you to be aware of this
This is a known issue with Pyomo's units infrastructure: https://github.com/Pyomo/pyomo/issues/1627.
It might help to add a comment there asking for it to be fixed to try to get it pushed up in priority.
Issue: Pyomo expressions drop units when encountering a zero value in flows (e.g. electricity, chemicals, etc.). This may result in inconsistent units when evaluating system cost metrics like levelized costs. Preliminary fix: This may be avoided at the flowsheet level or in parameters sweeps by using small value (1e-XX) to approximate zero.![uniterror_pyomo](https://user-images.githubusercontent.com/59095986/174166891-e4f4fcd7-c8b0-4f7d-9fe3-85415fdb0427.png)