(How) Does StratifiedThermalStorage work?

Hello all,

I am trying to model a pit thermal storage filled with water which I assumed would be be modeled using a StratifiedThermalStorage from oemof.thermal.

In the documentation here I find the following:

Collapsible code block
from oemof.solph import Bus
from oemof.thermal.facades import StratifiedThermalStorage

bus_heat = Bus('heat')

thermal_storage = StratifiedThermalStorage(
    label='thermal_storage',
    bus=bus_heat,
    diameter=2,
    height=5,
    temp_h=95,
    temp_c=60,
    temp_env=10,
    u_value=u_value,
    min_storage_level=0.05,
    max_storage_level=0.95,
    capacity=1,
    efficiency=0.9,
    marginal_cost=0.0001
)

which contains the parameters volume and min and max temperature which I wanted to use.
However, when I use

Collapsible code block
from oemof.thermal.facades import StratifiedThermalStorage

energysystem.add(StratifiedThermalStorage(
    label='PTES',
))

I get the following (conflicting) documentation info in PyCharm:

Meaning, I cannot use most of the relevant parameters mentioned in the Stratified thermal storage documentation. When I try using e.g. ‘volume’ or ‘temp_h’, I get error messages:

Error message

Traceback (most recent call last):
File “C:\Users\xxx”, line 203, in
energysystem.add(StratifiedThermalStorage(
^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\oemof\thermal\facades.py”, line 242, in init
Facade.init(
File “C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\site-packages\oemof\thermal\facades.py”, line 79, in init
super().init(*args, **kwargs)
TypeError: Node.init() got an unexpected keyword argument ‘volume’

If I cannot use the temperature and volume parameters, what is the point of using StratifiedThermalStorage instead of GenericStorage? And does anyone know what the problem here may be?

I use oemoph.solph version 0.5.2 and oemof.thermal version 0.0.6

Thanks and best regards,
Ella

I fear that oemof.thermal is currently not fully compatible to solph v0.5. However, it is possible to use functions like calculate_capacities and calculate_losses to calculate parameters for a GenericStorage in solph.

That is unfortunate but good to know, thank you. Is the current oemof.thermal version fully compatible with oemof.solph version 0.4.0?

I think, I made a mistake. The latest release named at GitHub war v0.0.5, and that one is not compatible to solph v0.5. If version 0.0.6 of thermal also does not work, that’s a bug not known so far. I hope to find some time to look into this the next days.

(Solph v0.4 should work, though. The version was current when thermal was developed.)

Update: Just checked, omeof.thermal hands unexpected arguments to oemof.network.Node. In old versions of oemof.network, this was just silently ignored but as of today, it is treated as an error. You should indeed be able to workaround this problem by using solph v0.4.x.

Update 2: I am working on the issue. If you like, you can test Fix/setup by p-snft · Pull Request #187 · oemof/oemof-thermal · GitHub.

1 Like