Skip to content
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

Consultation about TCI_ratio in uncertainty analysis #127

Open
zasddsgg opened this issue May 9, 2024 · 2 comments
Open

Consultation about TCI_ratio in uncertainty analysis #127

zasddsgg opened this issue May 9, 2024 · 2 comments

Comments

@zasddsgg
Copy link

zasddsgg commented May 9, 2024

a) Hello, as for the setting of TCI_ratio, it seems that it only applies to the unit created using the cost decorator (https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/blob/master/biorefineries/lactic/models.py#L251-L258). Why does the cost of other units (such as bst.units.Pump, bst.units.HXutility, bst.units.Flash) remain unchanged in uncertainty analysis?

b) For BatchCrystallizer, the code I use is BC101 = bst.units.BatchCrystallizer('BC101', inlet, outlet, tau=24, V=3000, T=30 + 273.15),
but why does the following code return None, which causes an error (TypeError: unsupported operand type(s) for /=: 'NoneType' and 'int') when running the code unit.cost_items[item].cost /= old_ratio (https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/blob/master/biorefineries/lactic/models.py#L251-L258)?
The code is as follows:

import biosteam as bst
from biorefineries import cellulosic
cs = cellulosic.Biorefinery('corn stover ethanol')
inlet = cs.cornstover
BC101 = bst.units.BatchCrystallizer('BC101', inlet, 'outlet', tau=24, V=3000, T=30 + 273.15)
for item in BC101.cost_items:
    print(BC101.cost_items[item].cost)
@yalinli2
Copy link
Member

yalinli2 commented May 9, 2024

TCI_ratio is just a factor we added considering we are not sure of the actual cost of the equipment. It can be applied to any unit, just a matter of how you add it. You need to understand how biosteam calculate the cost for a unit (which is described in detail in the tutorials) to write the code for your specific case. We unfortunately don't have the manpower/resources to help other people write their codes, we make biosteam open-source so other people can look at the codes and figure it out themselves, there is no mystery on how biosteam works.

@zasddsgg
Copy link
Author

zasddsgg commented May 9, 2024

But code if hasattr(unit, 'cost_items') seems to decide that only units with cost_items will execute the following unit.cost_items[item].cost /= old_ratio. For units created via bst.units.Pump, bst.units.HXutility, bst.units.Flash, it will report AttributeError: 'HXutility' object has no attribute 'cost_items', so the cost of it will not change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants