Skip to content

Commit

Permalink
make chp fuel flexible (#1392)
Browse files Browse the repository at this point in the history
* make chp flexible

* default config: add settings
prepare_sector_network: adress Fabians comments
docs: add new config settings to doc

* add release note

* fix getattr bug

* prepare_sector_network: use "fuel" intensity intensity for CC unit instead of "gas" co2 intensity
  • Loading branch information
p-glaum authored Nov 7, 2024
1 parent 2119f4c commit 35050d9
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 56 deletions.
4 changes: 3 additions & 1 deletion config/config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,9 @@ sector:
overdimension_heat_generators:
decentral: 1.1 #to cover demand peaks bigger than data
central: 1.0
chp: true
chp:
enable: true
fuel: gas # for all fuels the same techno economic data from gas CHP is taken
micro_chp: false
solar_thermal: true
solar_cf_correction: 0.788457 # = >>> 1/1.2683
Expand Down
4 changes: 3 additions & 1 deletion doc/configtables/sector.csv
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ biomass_boiler,--,"{true, false}",Add option for transforming biomass into heat
overdimension_heat_generators,,,Add option for overdimensioning heating systems by a certain factor. This allows them to cover heat demand peaks e.g. 10% higher than those in the data with a setting of 1.1.
-- decentral,--,float,The factor for overdimensioning (increasing CAPEX) decentral heating systems
-- central,--,float,The factor for overdimensioning (increasing CAPEX) central heating systems
chp,--,"{true, false}",Add option for using Combined Heat and Power (CHP)
chp,--,,
-- enable,--,"{true, false}",Add option for using Combined Heat and Power (CHP)
-- fuel,--,string or list of fuels,"Possible options are all fuels which have an exisitng bus and their CO2 intensity is given in the technology data. Currently possible are ""gas"", ""oil"", ""methanol"", ""lignite"", ""coal"". For all fuels, the techno-economic data from gas CHP is used."
micro_chp,--,"{true, false}",Add option for using Combined Heat and Power (CHP) for decentral areas.
solar_thermal,--,"{true, false}",Add option for using solar thermal to generate heat.
solar_cf_correction,--,float,The correction factor for the value provided by the solar thermal profile calculations
Expand Down
2 changes: 2 additions & 0 deletions doc/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Release Notes
Upcoming Release
================

* Feature: Allow CHPs to use different fuel sources such as gas, oil, coal, and methanol. Note that the cost assumptions are based on a gas CHP.

* Improve `sanitize_carrier`` function by filling in colors of missing carriers with colors mapped after using the function `rename_techs`.

* Bugfix: Adjusted efficiency2 (to atmosphere) for bioliquids-to-oil Link in `prepare_sector_network` to exactly offset the corresponding oil emissions.
Expand Down
114 changes: 60 additions & 54 deletions scripts/prepare_sector_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2282,62 +2282,68 @@ def add_heat(n: pypsa.Network, costs: pd.DataFrame, cop: xr.DataArray):
],
)

if options["chp"] and heat_system == HeatSystem.URBAN_CENTRAL:
if options["chp"]["enable"] and heat_system == HeatSystem.URBAN_CENTRAL:
# add gas CHP; biomass CHP is added in biomass section
n.add(
"Link",
nodes + " urban central gas CHP",
bus0=spatial.gas.df.loc[nodes, "nodes"].values,
bus1=nodes,
bus2=nodes + " urban central heat",
bus3="co2 atmosphere",
carrier="urban central gas CHP",
p_nom_extendable=True,
capital_cost=costs.at["central gas CHP", "fixed"]
* costs.at["central gas CHP", "efficiency"],
marginal_cost=costs.at["central gas CHP", "VOM"],
efficiency=costs.at["central gas CHP", "efficiency"],
efficiency2=costs.at["central gas CHP", "efficiency"]
/ costs.at["central gas CHP", "c_b"],
efficiency3=costs.at["gas", "CO2 intensity"],
lifetime=costs.at["central gas CHP", "lifetime"],
)
fuels = options["chp"]["fuel"]
fuels = np.atleast_1d(fuels)
for fuel in fuels:
fuel_nodes = getattr(spatial, fuel).df
n.add(
"Link",
nodes + f" urban central {fuel} CHP",
bus0=fuel_nodes.loc[nodes, "nodes"].values,
bus1=nodes,
bus2=nodes + " urban central heat",
bus3="co2 atmosphere",
carrier="urban central CHP",
p_nom_extendable=True,
capital_cost=costs.at["central gas CHP", "fixed"]
* costs.at["central gas CHP", "efficiency"],
marginal_cost=costs.at["central gas CHP", "VOM"],
efficiency=costs.at["central gas CHP", "efficiency"],
efficiency2=costs.at["central gas CHP", "efficiency"]
/ costs.at["central gas CHP", "c_b"],
efficiency3=costs.at[fuel, "CO2 intensity"],
lifetime=costs.at["central gas CHP", "lifetime"],
)

n.add(
"Link",
nodes + " urban central gas CHP CC",
bus0=spatial.gas.df.loc[nodes, "nodes"].values,
bus1=nodes,
bus2=nodes + " urban central heat",
bus3="co2 atmosphere",
bus4=spatial.co2.df.loc[nodes, "nodes"].values,
carrier="urban central gas CHP CC",
p_nom_extendable=True,
capital_cost=costs.at["central gas CHP", "fixed"]
* costs.at["central gas CHP", "efficiency"]
+ costs.at["biomass CHP capture", "fixed"]
* costs.at["gas", "CO2 intensity"],
marginal_cost=costs.at["central gas CHP", "VOM"],
efficiency=costs.at["central gas CHP", "efficiency"]
- costs.at["gas", "CO2 intensity"]
* (
costs.at["biomass CHP capture", "electricity-input"]
+ costs.at["biomass CHP capture", "compression-electricity-input"]
),
efficiency2=costs.at["central gas CHP", "efficiency"]
/ costs.at["central gas CHP", "c_b"]
+ costs.at["gas", "CO2 intensity"]
* (
costs.at["biomass CHP capture", "heat-output"]
+ costs.at["biomass CHP capture", "compression-heat-output"]
- costs.at["biomass CHP capture", "heat-input"]
),
efficiency3=costs.at["gas", "CO2 intensity"]
* (1 - costs.at["biomass CHP capture", "capture_rate"]),
efficiency4=costs.at["gas", "CO2 intensity"]
* costs.at["biomass CHP capture", "capture_rate"],
lifetime=costs.at["central gas CHP", "lifetime"],
)
n.add(
"Link",
nodes + f" urban central {fuel} CHP CC",
bus0=fuel_nodes.loc[nodes, "nodes"].values,
bus1=nodes,
bus2=nodes + " urban central heat",
bus3="co2 atmosphere",
bus4=spatial.co2.df.loc[nodes, "nodes"].values,
carrier="urban central CHP CC",
p_nom_extendable=True,
capital_cost=costs.at["central gas CHP", "fixed"]
* costs.at["central gas CHP", "efficiency"]
+ costs.at["biomass CHP capture", "fixed"]
* costs.at[fuel, "CO2 intensity"],
marginal_cost=costs.at["central gas CHP", "VOM"],
efficiency=costs.at["central gas CHP", "efficiency"]
- costs.at[fuel, "CO2 intensity"]
* (
costs.at["biomass CHP capture", "electricity-input"]
+ costs.at[
"biomass CHP capture", "compression-electricity-input"
]
),
efficiency2=costs.at["central gas CHP", "efficiency"]
/ costs.at["central gas CHP", "c_b"]
+ costs.at[fuel, "CO2 intensity"]
* (
costs.at["biomass CHP capture", "heat-output"]
+ costs.at["biomass CHP capture", "compression-heat-output"]
- costs.at["biomass CHP capture", "heat-input"]
),
efficiency3=costs.at[fuel, "CO2 intensity"]
* (1 - costs.at["biomass CHP capture", "capture_rate"]),
efficiency4=costs.at[fuel, "CO2 intensity"]
* costs.at["biomass CHP capture", "capture_rate"],
lifetime=costs.at["central gas CHP", "lifetime"],
)

if (
options["chp"]
Expand Down

0 comments on commit 35050d9

Please sign in to comment.