Closed yoelcortes closed 3 years ago
Hi Yoel, thanks for the notice, some questions:
C_BM
is. You said:
Previously, the installed equipment cost was calculated as follows:
C_BM = C_P * F_BM
But you also said:
C_BM = C_Pb (F_BM + F_D F_P * F_M - 1)
Where:
- C_BM is the bare module cost
So is C_BM
installed cost or the bare module cost? Are they the same?
_load_capital_costs
function, can you add the reference to this equation?F_D
, F_P
, and F_M
are all >1? What if I want to use some cost from stainless steel at higher pressure to calculate cost for carbon steel at lower pressure? Will this result in negative value?Thanks!
Hi Yalin,
Here are the answers to your questions:
Check out equation 16.12 of Warren's Product and Process Design Principles:
The bare-module cost and the installed equipment cost are the same.
F_D, F_P and F_M can all be any number (less or more than 1). What is important is for what material/design/and pressure was the BM applicable. Usually BMs are given for carbon steel at low to moderate pressures (which correspond to F_M, F_D, and and F_P values of 1). Negative values are impossible as BM is always greater than 1.
Let me know if you have more questions!
This all looks good, thanks for explaining and adding the references!
Quick update; The factors are now public (so they are called F_D, F_P, and F_M now).
Cool! Is F_BM public?
@yalinli2, not yet... but yeah, I've been thinking about making the _BM
dictionary the default values for a public F_BM
dictionary that gets created with the unit instance. I think this would be better than having bare-module factors as class attributes... which leaves little room for flexibility.
What do you think? Thumbs up and I'll go ahead and fix this up over the weekend.
I'm on board! 👍 Thanks Yoel!!!
Done!
Additionally, to make it easier to understand for future new users, I renamed _BM
to _F_BM_default
. I also added equipment_lifetime
as an instance attribute and renamed the _equipment_lifetime
class attribute to _default_equipment_lifetime
(again, to make it easier to understand without necessarily reading documentation).
I added some checks for Unit subclassing to make sure '_BM' and '_equipment_lifetime' are not used anymore. All tests passed on my computer.
Hopefully it's not too much trouble to make the renames in QSDsan (just import, let it error, and rename).
Thanks!
Sounds good, thanks Yoel!!!
Previously, the installed equipment cost was calculated as follows:
C_BM = C_P * F_BM
Which only applies when the bare-module factor is for the given material, pressure, and design. Now we use the more complete formula:
C_BM = C_Pb (F_BM + F_D F_P * F_M - 1)
Where:
All previous code should still work, but if you're working with different design, pressure or material factors, you can use the new
F_D
,F_P
andF_M
dictionaries to specify them. You'll also need to add values to thebaseline_purchase_costs
dictionary (not thepurchase_costs
dictionary), then BioSTEAM will take care of calculating both the actual purchase costs (after accounting for construction material and design) and the installed equipment costs.Here is an example:
Output:
Note that adding values to the
baseline_purchase_costs
dictionary is preferable over thepurchase_costs
dictionary, regardless if you are using different material factors or not. You'll get a helpful warning if you add items to thepurchase_costs
dictionary instead of thebaseline_purchase_costs
. For more details, you can checkout the code:https://github.com/BioSTEAMDevelopmentGroup/biosteam/blob/af1faa9548521cfa3732317bb5dedbc32d0513fc/biosteam/_unit.py#L310
@yalinli2, I also made BioSTEAM spit out a warning if the BM is not included for a purchase cost item (instead of raising an error).
Hope this helps!