Improved Power Plant Costing Methods#978
Conversation
Adding cost of electricity and cost of capture to report method
Fixing units of cost of electricity
* Sphinx Documentation Build Issue (IDAES#890) * switch lang flag to 'en' * Flag formatting * Update path reference * updating power plant capcost and QGESS tests to run as expected * bring over MEA_CCS updates and tests * running black on costing/ directory * move custom dicts to new file * fix some spacing causing doc build errors * Replace method calls with UnitModelCostingBlocks * Running black on the entire repo (IDAES#894) * Running black on the entire repo * Add pinned requirement for Black stable version * Add CI check to ensure code is Black-formatted Co-authored-by: Ludovico Bianchi <[email protected]> * Fix PySMO tests (IDAES#903) * Minor change to trigger tests * Added abs to tolerance check * Run black * Remove string comparison * Tighten tolerance * Fixed kriging test by removing variable dependence * bring in report method updates * bring in more MEA CCS updates * Add check on total TPC * final formatting fixes * Update report method Adding cost of electricity and cost of capture to report method * Black reformatting * Update report method Fixing units of cost of electricity Co-authored-by: Keith Beattie <[email protected]> Co-authored-by: Ludovico Bianchi <[email protected]> Co-authored-by: OOAmusat <[email protected]> Co-authored-by: Daison2102 <[email protected]>
idaes/models_extra/power_generation/costing/power_plant_capcost.py
Outdated
Show resolved
Hide resolved
idaes/models_extra/power_generation/costing/power_plant_capcost.py
Outdated
Show resolved
Hide resolved
idaes/models_extra/power_generation/costing/power_plant_capcost.py
Outdated
Show resolved
Hide resolved
idaes/models_extra/power_generation/costing/power_plant_capcost.py
Outdated
Show resolved
Hide resolved
idaes/models_extra/power_generation/costing/power_plant_capcost.py
Outdated
Show resolved
Hide resolved
idaes/models_extra/power_generation/costing/power_plant_capcost.py
Outdated
Show resolved
Hide resolved
idaes/models_extra/power_generation/costing/power_plant_capcost.py
Outdated
Show resolved
Hide resolved
idaes/models_extra/power_generation/costing/power_plant_capcost.py
Outdated
Show resolved
Hide resolved
andrewlee94
left a comment
There was a problem hiding this comment.
In addition to my request to move the definition of the new costing units from costing_base.py, I also saw a few cases where you have code that executes as the module level which needs to be addressed (just wrap it all in a simple method).
idaes/models_extra/power_generation/costing/costing_dictionaries.py
Outdated
Show resolved
Hide resolved
idaes/models_extra/power_generation/costing/generic_ccs_capcost_custom_dict.py
Outdated
Show resolved
Hide resolved
andrewlee94
left a comment
There was a problem hiding this comment.
Almost there - I just have a couple more comments, tow of which are commented code I saw whilst going through.
The more significant one however involves the tests - it looks like one of the tests deletes existing files in the main package so that you can test recreating these files. This is not good practice, and runs against what tests should do. If you need to test creating files, you should be creating them in a temporary directory for the tests and cleaning up afterwards, not deleting files in the main package.
idaes/models_extra/power_generation/costing/power_plant_costing.py
Outdated
Show resolved
Hide resolved
idaes/models_extra/power_generation/costing/tests/test_CCS_capcost.py
Outdated
Show resolved
Hide resolved
idaes/models_extra/power_generation/costing/costing_dictionaries.py
Outdated
Show resolved
Hide resolved
andrewlee94
left a comment
There was a problem hiding this comment.
One more relatively simple request - could you do at least some minimal check of the files that are generated by load_generic_ccs_costing_dictionary (at least check that they were created).
Fixes
Summary/Motivation:
Changes proposed in this PR:
UnitModelCostingBlocksyntaxSome other changes:
Combines costing parameter and exponent dictionaries, and adds bare erected cost currency units for a specific reference year and prefix. For example, dictionaries containing
"BEC_units": "K$2018"will tell the costing methods to import the reference costs inkUSD_2018(Pyomo unit container). Results are reported inMUSD_year, whereyearis the base year chosen by users.Similarly, scaled parameters now automatically get variable units and reference parameter accounts units must use correct Pyomo units syntax.
Finally, the tests were updated, including the ones using the old costing methods. We will remove those in a future update.
This will break the current NGCC SOEC example. A fix for this exists in Update NGCC SOEC example for new costing methods examples-pse#151 and should be merged ASAP after merging this PR.
Legal Acknowledgement
By contributing to this software project, I agree to the following terms and conditions for my contribution: