From d1762919c57c87aa8f8dcce195c1bf3f15153999 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Fri, 10 Dec 2021 12:05:38 +0100 Subject: [PATCH] add option 'seqXXX' to sweep global co2 sequestration potentials (#208) * add option 'seqXXX' to sweep global co2 sequestration potentials * add release notes --- doc/release_notes.rst | 2 ++ scripts/solve_network.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/release_notes.rst b/doc/release_notes.rst index fefe68ae..d5ca8b80 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -60,6 +60,8 @@ incorporates retrofitting options to hydrogen. * Add regionalised hydrogen salt cavern storage potentials from `Technical Potential of Salt Caverns for Hydrogen Storage in Europe `_. +* Add option to sweep the global CO2 sequestration potentials with keyword ``seq200`` in the ``{sector_opts}`` wildcard (for limit of 200 Mt CO2). + **Bugfixes** * The CO2 sequestration limit implemented as GlobalConstraint (introduced in the previous version) diff --git a/scripts/solve_network.py b/scripts/solve_network.py index c7587784..e23f3437 100644 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -220,15 +220,20 @@ def add_co2_sequestration_limit(n, sns): vars_final_co2_stored = get_var(n, 'Store', 'e').loc[sns[-1], co2_stores] lhs = linexpr((1, vars_final_co2_stored)).sum() - rhs = n.config["sector"].get("co2_sequestration_potential", 200) * 1e6 + + limit = n.config["sector"].get("co2_sequestration_potential", 200) * 1e6 + for o in opts: + if not "seq" in o: continue + limit = float(o[o.find("seq")+3:]) + break name = 'co2_sequestration_limit' sense = "<=" - n.add("GlobalConstraint", name, sense=sense, constant=rhs, + n.add("GlobalConstraint", name, sense=sense, constant=limit, type=np.nan, carrier_attribute=np.nan) - define_constraints(n, lhs, sense, rhs, 'GlobalConstraint', + define_constraints(n, lhs, sense, limit, 'GlobalConstraint', 'mu', axes=pd.Index([name]), spec=name)