PyPSA / pypsa-eur

PyPSA-Eur: A Sector-Coupled Open Optimisation Model of the European Energy System
https://pypsa-eur.readthedocs.io/
345 stars 242 forks source link

Fix industrial demand for ammonia when endogenously modelled #1312

Closed koen-vg closed 1 month ago

koen-vg commented 1 month ago

In calculating industrial energy demand today, demand for ammonia must be resolved into just "ammonia" when endogenously modelled, or into electricity and hydrogen if not. Before this fix, energy demand for ammonia was double-counted at current and near-term planning horizons when sector['ammonia'] = True; both in terms of ammonia and in terms of electricity and hydrogen.

While not incredibly large in magnitude, hydrogen demand at 2025 planning horizon was essentially double what it should have been before this fix.

Checklist

fneum commented 1 month ago

Great! I'll do a small follow-up so that tests for Windows and MacOS run through (the snakemake object is lost in the multiprocessing). The dev test is failing because of some breaking changes in powerplantmatching that need to be addressed in PyPSA-Eur, so that's ok.