Endogenize steel and cement production and add existing industry sites - #1719
toniseibold wants to merge 34 commits into
Conversation
d46d609 to
643fcc9
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…nfig for existing cement and steel plants
for more information, see https://pre-commit.ci
|
Updated branch to master, including removal of doctables, moved to schema setup, see #1912 |
…O: Create new TD release for final merge.
for more information, see https://pre-commit.ci
bobbyxng
left a comment
There was a problem hiding this comment.
Thanks @toniseibold for this super extensive PR! I have now been able to go through the code base and have primarily focused on consistency, there are still a few changes, proposals and some questions wrt. my personal understanding. In summary:
- Allow for toggling endogenisation via an enable or empty list
- Please double-check units, efficiency and cost calculations/normalisations, both in
add_existing_baseyearandprepare_sector_network - Please double-check that all arguments, params are passed to all functions and add correct docstring/typing to all functions
- Consider for some parameters to be moved to config or technolog-data
- Please open a PR on data when the PR is ready @lkstrp
Could you also do a comparison plot for energy use and/or regional distribution with and without endogenisation, e.g. weekly/24-hourly resolution.
Thanks a lot :)
|
Also please merge with latest master and double-check compatibility with the new schema |
- `pixi run sync-locks` - `pixi run generate-config`
- `pixi run sync-locks` - `pixi run generate-config`
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
I did a couple of checks to make sure the extension works as intended (however low temporal resolution runs) Cement and Steel DemandExogenous by multiplying sector_ratios with production levels for steel and cement
*coke: 1.366 x coal Endogenous Demand for Steel and Cement Production
Commodity Prices (low resolution excluding carbon price for meoh)
I spotted one weirdness: |
Merges upstream/industry_plants (PyPSA#1719, toniseibold): adds fossil-vs-green route competition for steel (H2-DRI vs gas-DRI into a shared reduction bus, same competing-Links-into-one-bus pattern already used for shipping/industry heat) and cement, plus existing- plant brownfield handling via a new industry_plants resource. Also re-adds methanol-to-olefins/aromatics (add_meoh_to_oa, gated by methanol.meoh_to_oa) -- removed upstream in PyPSA#1299 for lacking a proper HVC bus; still routes into the shared spatial.oil.naphtha pool, so the original blend-accounting concern isn't actually fixed, just reinstated as-is from upstream. Conflicts (4 files, all mechanical -- independent insertions at the same anchor point, no shared logic rewritten by both sides): - rules/build_sector.smk, rules/solve_myopic.smk, rules/solve_perfect.smk: both sides added independent params/inputs to the same rule blocks; resolved by keeping both. - scripts/prepare_sector_network.py: this fork's add_rock_weathering and upstream's new add_meoh_to_oa both landed immediately before add_dac (pure coincidence); this fork's entire add_low/medium/ high_t_industry + add_exogen_t_industry block and upstream's new adjust_industry_demand both landed immediately before add_industry. Reconstructed both pairs intact rather than trusting git's interleaving. Kept this fork's add_dac(n, costs, spatial) signature (both branches were internally self-consistent; call site already passes spatial explicitly throughout this fork). No manual demand-routing fix was needed: add_industry already routes adjust_industry_demand()'s steel/cement-excluded remaining_demand into industrial_demand before it reaches add_low/medium/high_t_industry when endogenous_sectors.enable is true, auto-merged correctly since neither branch touched that exact span. sector.endogenous_sectors.enable defaults to false (upstream default, unchanged) -- steel/cement endogenization is opt-in. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KkHwmFFdgK5T1XFbFHA5SA
…ssignment np.searchsorted(grouping_years, valid_years, side="right") returns len(grouping_years) for any build_year past the last grouping boundary (e.g. built 2025-2029 with baseyear=2030 and grouping_years_industry ending at 2025) -- np.array(grouping_years)[indices] then raises IndexError. Clip into the last bucket instead. Found running the merged PR PyPSA#1719 steel/cement endogenization against this fork's data (a real existing plant built in that window), not caused by the merge itself. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KkHwmFFdgK5T1XFbFHA5SA

Closes # (if applicable).
PyPSA/pypsa-de#8
Dependencies
Changes proposed in this Pull Request
This PR endogenizes the production of steel and cement and for brownfield optimizations adds the existing plants for steel, cement, ammonia and methanol.
This PR uses the dataset provided by Neuwirth et al. to add existing industry sites.
Where necessary this dataset is complemented with other datasets since it's limited to EU27 countries only.
Ammonia
As soon as the config setting
config["sector"]["ammonia"]is eitherTrueorregionaland the optimization runs withperfectormyopicforesight, ammonia plant capacities are added inadd_existing_baseyear.Switching existing Haber-Bosch capacities from natural gas to hydrogen is not permitted since it's associated with retrofitting costs and there are only few Examples.
Comparison of eurostat demand vs. database installed capacity shows a high degree of agreement.
Methanol
Existing methanol capacities are added as methanol plants. It is implemented as a green methanolisation, since grey and blue are already indirectly included with SMR and SMR CC hydrogen production.
Steel
There are two routes for steel making implemented. The BF-BOF uses coal to reduce iron ore and produce steel in one process. On the other hand, natural gas or hydrogen direct reduced iron processes reduce iron to hot briquetted iron (HBI). The last step is to produce iron via an electric arc furnace (EAF).
EAF are also necessary to recycle secondary steel however this is still hidden in the electricity for industry load.
Cement
Cement production consists of two processes, clinker production and cement production.
For clinker production, the raw material is fed into a cement kiln, and under high temperature heat the clinker is burnt.
The heat for clinker production can either be supplied via biomass, waste or natural gas - additional to those specific emissions, there is carbon from the raw material oxidizing which contributes to the specific emissions.
The clinker is then ground with gypsum to get cement.
Installed Capacities
In general, the production capacities mostly agree with the demand from the JRC-IDEES database. The methanol capacities do not match the naphtha for industry demand since that one is met via oil based routes currently.
In bus regions where the demand is higher than the brownfield capacities, new plants can be built from links added in
prepare_sector_network.Open ToDos
data_retrieval.rsttechnology-dataAdding Grey Methanolisation technology-data#248
plotting.default.yamlthat actually make senseChecklist
pixi.toml(usingpixi add <dependency-name>). not applicableconfig/config.default.yaml.doc/configtables/*.csv.doc/release_notes.rstis added.