StorageTechnology

Overview

StorageTechnology models technologies that store and release carriers over time.

Use Cases

  • Implement storage-specific constraints and performance assumptions.

  • Define charge, discharge, and capacity-related attributes.

Examples

The code below shows an example of how to implement a subclass of the StorageTechnology abstract class. Please read the docstrings carefully as they contain detailed information on required methods and syntax.

from __future__ import annotations

from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from zen_creator.model import Model

from zen_creator.datasets.datasets import TemplateDataset
from zen_creator.datasets.datasets.metadata import MetaData, SourceInformation
from zen_creator.elements import StorageTechnology
from zen_creator.utils.attribute import Attribute


class TemplateStorageTechnology(StorageTechnology):
    """Template class for storage technologies.

    This template is designed as a starting point for users wishing to implement
    a new storage technology. Please read the docstrings and comments carefully
    for notes on how to use the template.

    All methods and properties that need to be implemented are marked with`TODO`
    comments. You can search for `TODO` in this file to quickly find all the
    places where you need to make changes.
    """

    name: str = "template_storage_technology"

    def __init__(self, model: Model, power_unit: str = "MW"):
        super().__init__(model=model, power_unit=power_unit)

    # ---------- Required methods that are called during object construction ----------

    def _set_reference_carrier(self) -> Attribute:
        """
        Return the reference carrier of the technology.

        This method is used to set the self.reference_carrier property when the
        technology is constructed.

        TODO: This method must be implemented. It should return an Attribute object
        containing the reference carrier of the technology.
        """
        return Attribute(name="reference_carrier", default_value=["heat"], element=self)

    # ---------- Required methods that are called during object build ----------

    def _set_lifetime(self) -> Attribute:
        """
        Return the lifetime of the technology.

        This method is used to set the self.lifetime property when the
        technology is built.

        TODO: This method must be implemented. It should return an Attribute object
        containing the lifetime of the technology.
        """

        attr = self._lifetime
        return attr.set_data(
            default_value=25,
            source=SourceInformation(
                description="Description of assumption.",
                metadata=MetaData(
                    name="datasource1",
                    title="Study of lifetime of template storage technology.",
                    author=["ZEN Creator"],
                    publication="ZEN Creator Journal",
                    publication_year=2026,
                    url="",
                ),
            ),
        )

    # ----Example of an optional method for creating an attribute using a dataset ------

    def _set_max_load(self) -> Attribute:
        """
        Return the max load of the technology.

        This method is used to set the self.max_load property when the
        technology is built.

        This method is an example of how to create an attribute using information from
        a dataset. It is not required for all technologies. Use this syntax
        when attributes need to be initialized with data from a dataset.

        Attributes should be returned directly from the dataset method
        "get_<attribute_name>" of the relevant dataset. In this example, we
        assume that the dataset has a method "get_max_load" which returns an
        Attribute object containing the max load of the technology.

        Data processing should be done directly in the dataset classes whenever
        possible, rather than in this method. The main purpose of this method
        is to provide an easily readable map that directs to the relevant
        datasets or datasetcollections.
        """

        attr = TemplateDataset(self.model.config.source_path).get_max_load(element=self)

        return attr

Summary

zen_creator.StorageTechnology.__init__

Initialize an Element instance.

Constructors

StorageTechnology.__init__(model: Model, power_unit: str = 'MW')

Initialize an Element instance.

Parameters:
  • model (Model) – The model this element belongs to.

  • power_unit (str) – The unit for power values. Defaults to “MW”.

Member Reference

class zen_creator.StorageTechnology(model: Model, power_unit: str = 'MW')

Bases: Technology, ABC

property capacity_addition_max_energy: Attribute
property capacity_addition_min_energy: Attribute
property capacity_existing_energy: Attribute
property capacity_investment_existing_energy: Attribute
property capacity_limit_energy: Attribute
property capex_specific_storage: Attribute
property capex_specific_storage_energy: Attribute
property efficiency_charge: Attribute
property efficiency_discharge: Attribute
property energy_to_power_ratio_max: Attribute
property energy_to_power_ratio_min: Attribute
property flow_storage_inflow: Attribute
property max_load_energy: Attribute
property min_load_energy: Attribute
name: str = 'storage_technology'
property opex_specific_fixed_energy: Attribute
property self_discharge: Attribute
set_default_values_storage_technology()

Initialize internal attributes to default values.

subpath: ClassVar[str] = 'set_storage_technologies'