quintel / etengine

Calculation engine for the Energy Transition Model
https://energytransitionmodel.com/
MIT License
14 stars 7 forks source link

Fix cutoff COP behaviour of hybrid heat pumps #1398

Closed mabijkerk closed 3 months ago

mabijkerk commented 5 months ago

Background The mechanical turk spec hybrid_heatpump_spec.rb tests the behaviour of hybrid heat pumps. One part of the spec tests whether an increase in insulation i.e., a decrease in useful space heating demand, results in changed input shares for network_gas, ambient_heat and electricity.

expect(@scenario.turk_hhp_network_gas_input_share.increase).to be_within(1.0E-12).of -0.0005791348178179612
# then the ambient_heat and electricity share grow by this value, distributed in agreement with the COP
# the small window of 1.0E-12 is there because of the COP calculation
expect(@scenario.turk_hhp_electricity_input_share.increase).to be_within(1.0E-12).of 0.0002160631521914147
expect(@scenario.turk_hhp_ambient_heat_input_share.increase).to be_within(1.0E-12).of 0.0004036111028738465

According to this spec, a reduced heat demand therefore decreases the share of network_gas. Reproducing the scenario on production, we can verify that this is the case. Comparing a scenario without any changes, with a scenario with the changes indicated in the spec, a 2% increase of insulation:

EACH(
  V(households_space_heater_hybrid_heatpump_air_water_electricity,network_gas_input_conversion),
  V(households_space_heater_hybrid_heatpump_air_water_electricity,electricity_input_conversion),
  V(households_space_heater_hybrid_heatpump_air_water_electricity,ambient_heat_input_conversion)
)

Present:

[
  0.158836612133303,
  0.152938797793945,
  0.688224590072752,
]

Future (no changes):

[
  0.3465453982236986,
  0.22287045724654836,
  0.40632596665409415,
]

Future (insulation set):

[
  0.34596626340588066,
  0.22308652039873886,
  0.4067295777569689,
]

The input conversion of network_gas shows a (very) small decrease.

Issue If I try to reproduce the behaviour on master, the demand decreases much in the same way, but the distribution of input carriers does not change. Comparing a scenario without any changes, with a scenario with the changes indicated in the spec, a 2% increase of insulation:

Future (no changes):

[
  0.41527148880985193,
  0.19900281843047687,
  0.3566566885429816,
]

Future (insulation set):

[
  0.41527148880985193,
  0.1990028184304767,
  0.3566566885429817,
]

The input conversion of each carrier remains the same.

Solution The goal here is to understand how changes in insulation (effectively decreasing demand) should affect the behaviour of (hybrid) heat pumps. Then we can investigate why this behaviour no longer occurs properly on master, fix the behaviour and the spec.

mabijkerk commented 4 months ago

Another interesting dynamic plays out on production for the hybrid heat pump on gas. In a blank scenario for nl2019, the heat pump initialises with a 101.11% useable_heat output efficiency in the present, which is interesting in itself:

Screenshot 2024-02-15 at 13 43 31

For the future it looks like this:

Screenshot 2024-02-15 at 13 43 51

When the cutoff COP for space heating is moved from the 2.6 default to 5.0, around 7% of energy input 'appears' out of nowhere. Note, this behaviour occurs on production before any of the changes of heat modelling in the built environment:

Screenshot 2024-02-15 at 13 45 16

noracato commented 4 months ago

Your link for the scenario with changes on beta points to pro, could you update that one please?

I'd like to see what slider settings would reflect these old ones for the new modelling. If I randomly pull the new sliders on the insulation slide a bit back, I do see some tiny changes in the shares between the carriers.

mabijkerk commented 4 months ago

Thanks for the headsup. I updated the link in the original issue description.

noracato commented 4 months ago

Could it have to do with the change in calculation of the future COP?

These are all scenarios with the changes in insulation.

branch COP future FLH present FLH future
pro 2.93 2,039.5 1,993.2
master 2.94 2,033.1 1,992.4
heat-final-fixes 2.9 1,950 1,911
noracato commented 4 months ago

Second theory:

We used to mix the demand curves of the households based on the insulation settings. This means that the shape of the curves would change according to the insulation settings.

With the new modeling, we don't mix the curves anymore, we just change the demand. So the shapes always stay the same. Could that explain the difference that the mix of inputs also stays the same?

mabijkerk commented 4 months ago

I think you second theory is very likely to be the cause of this. I'll see if I can replicate the behaviour in the new heat modelling to verify this theory.

mabijkerk commented 4 months ago

I created a scenario with all household heating demand either in a node with the insulation_mid curve or all household heating demand in a node with the insulation_high curve (by demolishing all other residences). In both cases I made sure that the useable heat demand was roughly the same. The share of the hybrid heat pump is set to 100%.

As becomes clear in the screenshots below, the input shares do change. This confirms your second theory @noracato! The issue with the cutoff COP remains and I renamed the issue accordingly.

Screenshot 2024-02-20 at 14 33 54

Screenshot 2024-02-20 at 14 34 45

KoenvanB commented 3 months ago

When the cutoff COP for space heating is moved from the 2.6 default to 5.0, around 7% of energy input 'appears' out of nowhere. Note, this behaviour occurs on production before any of the changes of heat modelling in the built environment

According to the hhp_adapter description in ETEngine, the output of a hybrid heatpump is always set to 100%:

Since the efficiencies and shares of carriers may change by the Fever calculation, it is not possible to set an output conversion on the node other than 1.0. If half of the input energy for the node were to come from the primary component, and half from the secondary, setting an output conversion of 1.03 would result in inaccurate input of the primary component carriers. To that end, the node will be hard-coded to an output conversion of 1.0, and the input shares will be adjusted to ensure the flow of energy into the node is correct.

Energy appearing out of nowhere results from the >100% efficiency of the gas heater part of the hybrid heat pump. The efficiency of a gas boiler is 107% (because efficiency calculations in the EU are based on the lower heating value). Because the output is fixed at 100%, the input from the gas heater must be less than that by a factor of 1/1.07 = 93.46%.

Conversely, for hybrid heat pumps with a heater part that has an efficiency below 100%, the input will be higher than 100%. However, contrary to normal procedures, because the output is fixed at 100%, by definition there are 0% losses. As a result, energy will seem to disappear between input and output.

mabijkerk commented 3 months ago

Nice summary @KoenvanB, glad we clarified this!