Cement plant and associated technologies - #845
Conversation
PR Reviewer Guide 🔍(Review updated until commit bf7f7bd)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to bf7f7bd Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit bf7f7bd
Suggestions up to commit 6c36ceb
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #845 +/- ##
==========================================
+ Coverage 82.02% 82.62% +0.59%
==========================================
Files 58 59 +1
Lines 9738 10229 +491
==========================================
+ Hits 7988 8452 +464
- Misses 1750 1777 +27
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Persistent review updated to latest commit bf7f7bd |
|
Persistent review updated to latest commit bf7f7bd |
maurerle
left a comment
There was a problem hiding this comment.
I left some comments for improvements of this PR
| return pyo.quicksum( | ||
| m.dsm_blocks[block].power_in[t] | ||
| for block in m.dsm_blocks | ||
| if hasattr(m.dsm_blocks[block], "power_in") |
There was a problem hiding this comment.
why is it unclear hear if power_in exists? This does not look well
| high first-step value the way it would if it were treated as a second, tighter | ||
| absolute cap alongside ``ramp_up``. | ||
| """ | ||
| ramped = getattr(model_block, quantity) |
There was a problem hiding this comment.
ramped should be passed as value (so model_block.power_in or model_block. to this helper function instead of providing a string here.
So the helper should directly have ramped = model_block.power_in as parameter when called and quantity removed.
That way, we are explicit, we know that the attribute exists and ramped is not None and are sure that this function is not called with a typo.
| - **Skip torch seeding when torch is installed but not used**: Irrelevant seeding was performed and a warning was thrown about deterministic PyTorch behavior, even though simulation does not use RL. This is fixed by only setting the PyTorch seeds when learning is active. | ||
| - **Fix bug in redispatch mechanism**: Fixed the bug in redispatch evaluation due to PyPSA's version upgrade. In ``PyPSA >= 0.35.2`` (released in February 2025) the sign of load was not taken into account correctly & since the fixed EOM dispatch was modelled as a load with positive sign which was resulting in incorrect redispatch amounts. | ||
|
|
||
| 0.6.2 - (5th August 2026) |
There was a problem hiding this comment.
This PR did add new release notes - of a release which does not exist. Why?
|
@Manish-Khanra @paragpatil39 did you look through the PR change suggestions? |
User description
Related Issue
Description
Adds a cement plant demand-side unit, modelled as a fuel-switchable kiln line, with full rolling-horizon support.
New DSM unit:
CementPlant(assume/units/cement_plant.py)ThermalProcessStagebase class + subclasses indst_components.py).ThermalStorage, newshort-term_with_generatormode) acting as an electric-heater-charged buffer (E-TES) that displaces calciner burner heat in expensive hours, the plant's main source of demand-side flexibility.GrindingMill): electric grinding steps. A cement mill attached to a kiln line grinds that line's clinker as before; either mill with no kiln line at all runs as a standalone grinding operation, where the declared demand targets that mill's own ground tonnage directly instead of clinker.CementForecaster(assume/common/forecaster.py)Rolling-horizon
min_demandstrategy detection hard-codedsteel_demand_per_timestepinstead of using the unit's own_demand_attr_suffix, so it silently fell back to the wrong (already-window-sliced) series for any non-steel-plant unit using themin_demandstrategy in rolling-horizon mode._component_power_expr()fallback so the shared flexibility measures (peak_load_shifting,renewable_utilisation, etc.) work for any DSM unit's component set, not just steel-plant-shaped ones.Bug fix: ramp constraint at the first time step (
assume/units/dst_components.py)Found while stress-testing the new unit: the first time step of every ramp-limited quantity was capped by
min(ramp_up, ramp_down)instead of justramp_up, becauseramp_down_constraint's own first-step branch also applied an absolute cap (value[0] <= ramp_down) even though there is no previous value to decrease from. A tightramp_downcould therefore artificially choke off a legitimately high first-step value.Fixed in all four places this exact pattern was duplicated: the shared
add_ramping_constraintshelper,GenericStorage's inline charge/discharge ramps,ChargingStation's inline ramps, andBoiler's natural-gas/hydrogen-gas fuel paths.ramp_down_constraintnow skips the first step entirely instead of applying a spurious cap.Tests
tests/test_cement_plant.pyChecklist
docsfolder updates, etc.)PR Type
Enhancement, Bug fix, Tests, Documentation
Description
Add fuel-switchable cement plant DSM model
Support mills, electrolyser, E-TES flexibility
Add cement forecasts and CSV loading
Cover operations with extensive tests
Diagram Walkthrough
File Walkthrough
1 files
Add comprehensive cement plant model tests4 files
Add cement components and storage generator modeAdd dedicated cement plant forecasterRegister cement plant unit typeImplement cement plant DSM unit1 files
Load cement plant forecast inputs1 files
Generalize DSM flexibility and rolling horizon3 files
Document cement plant demand-side unitAdd cement plant release notesDocument cement forecast configuration fields