Open zasddsgg opened 1 month ago
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.
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.
a) Hello, as for the setting of
TCI_ratio
, it seems that it only applies to the unit created using thecost decorator
(https://github.com/BioSTEAMDevelopmentGroup/Bioindustrial-Park/blob/master/biorefineries/lactic/models.py#L251-L258). Why does the cost of other units (such asbst.units.Pump, bst.units.HXutility, bst.units.Flash
) remain unchanged in uncertainty analysis?b) For
BatchCrystallizer
, the code I use isBC101 = bst.units.BatchCrystallizer('BC101', inlet, outlet, tau=24, V=3000, T=30 + 273.15)
, but why does the following code returnNone
, which causes an error (TypeError: unsupported operand type(s) for /=: 'NoneType' and 'int'
) when running the codeunit.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: