Gas Storage

Graph structure

A storage for a gas commodity is represented in Macro using the following graph structure:

%%{init: { 'theme': 'base', "themeCSS": ".node circle { radius: 40 !important; }", 'themeVariables': { 'background': '#D1EBDE' } }}%% flowchart LR subgraph GasStorage direction BT B((Gas)) --Charge--> A{{..}} A --Discharge--> B C((Electricity)) --Charge--> A C --Discharge--> A A --Charge--> D[Storage] D --Discharge--> A end legend@{img: "../../images/battery.png", w: 120, h: 100, constraint: "off"} GasStorage ~~~ legend style A fill:black,stroke:black,color:black; style B r:40,fill:lightblue,stroke:black,color:black,stroke-dasharray: 3,5; style C r:40,fill:orange,stroke:black,color:black,font-size: 12, stroke-dasharray: 3,5; style D fill:lightblue,stroke:black,color:black, font-size: 12; linkStyle 0,1 stroke:lightblue, stroke-width: 3px; linkStyle 2,3 stroke:orange, stroke-width: 3px; linkStyle 4,5 stroke:lightblue, stroke-width: 3px; style legend fill:white
%%{init: { 'theme': 'base', "themeCSS": ".node circle { r: 100 !important; }", 'themeVariables': { 'background': '#D1EBDE' } }}%% flowchart LR subgraph GasPipeline direction BT B((Gas)) --Charge--> A{{..}} A --Discharge--> E((Gas)) C((Electricity)) --Charge--> A F((Electricity)) --Discharge--> A A --Charge--> D[Storage] D --Discharge--> A subgraph "Source location" B ~~~ C end subgraph "Dest location" E ~~~ F end end legend@{img: "../../images/battery.png", w: 120, h: 100, constraint: "off"} GasPipeline ~~~ legend style A fill:black,stroke:black,color:black; style B radius:50,fill:lightblue,stroke:black,color:black,font-size: 12, stroke-dasharray: 3,5; style C r:40,fill:orange,stroke:black,color:black,font-size: 12, stroke-dasharray: 3,5; style D r:40,fill:lightblue,stroke:black,color:black, font-size: 12; style E r:40,fill:lightblue,stroke:black,color:black, font-size: 12,stroke-dasharray: 3,5; style F r:40,fill:orange,stroke:black,color:black, font-size: 12,stroke-dasharray: 3,5; linkStyle 0,1 stroke:lightblue, stroke-width: 3px; linkStyle 2,3 stroke:orange, stroke-width: 3px; linkStyle 4,5 stroke:lightblue, stroke-width: 3px; style legend fill:white

A gas storage asset is made of:

  • 1 Storage component, representing the gas storage process. The gas type is set using the commodity attribute (see table below).
  • 1 Transformation component, representing the gas compressor.
  • 4 Edge components:
    • 1 incoming Electricity Edge, representing the electricity consumption for powering the compressor.
    • 1 incoming Gas Edge, representing the gas flow into the storage asset through the compressor.
    • 1 internal Gas Edge, representing the gas flow between the compressor and the storage. This can be seen as a charge edge for the storage component.
    • 1 outgoing Gas Edge, representing the discharged edge of the gas storage.

Attributes

The structure of the input file for a gas storage asset follows the graph representation. Each global_data and instance_data will look like this:

{
    "transforms":{
        // ... transformation-specific attributes ...
    },
    "edges":{
        "compressor_elec_edge": {
            // ... compressor_elec_edge-specific attributes ...
        },
        "compressor_gas_edge": {
            // ... compressor_gas_edge-specific attributes ...
        },
        "charge_edge": {
            // ... storage_gas_edge-specific attributes ...
        },
        "discharge_edge": {
            // ... discharge_gas_edge-specific attributes ...
        }
    },
    "storage":{
        // ... storage-specific attributes ...
    }
}

Transformation

The definition of the transformation object can be found here MacroEnergy.Transformation.

AttributeTypeValuesDefaultDescription
timedataStringStringRequiredTime resolution for the time series data linked to the transformation. E.g. "Hydrogen".
constraintsDict{String,Bool}Any Macro constraint type for verticesBalanceConstraintList of constraints applied to the transformation. E.g. {"BalanceConstraint": true}.
electricity_consumption $\epsilon_{elec\_consumption}$Float64Float640.0$MWh_{elec}/MWh_{gas}$

Flow equations

In the following equations, $\phi$ is the flow of the commodity and $\epsilon$ is the stoichiometric coefficient defined in the transformation table below.

GasStorage

Note: c is the type of the commodity being stored. The following equation is related to the compressor.

\[\begin{aligned} \phi_{elec} &= \phi_{c} \cdot \epsilon_{elec\_consumption} \\ \end{aligned}\]

Look also at the "Efficiency" tip below for more information on the efficiency of charging/discharging process.

Edges

All the edges are represented by the same set of attributes. The definition of the Edge object can be found here MacroEnergy.Edge.

AttributeTypeValuesDefaultDescription
typeStringAny Macro commodity type matching the commodity of the edgeRequiredCommodity of the edge. E.g. "Electricity".
start_vertexStringAny node id present in the system matching the commodity of the edgeRequiredID of the starting vertex of the edge. The node must be present in the nodes.json file. E.g. "elec_node_1".
end_vertexStringAny node id present in the system matching the commodity of the edgeRequiredID of the ending vertex of the edge. The node must be present in the nodes.json file. E.g. "elec_node_2".
constraintsDict{String,Bool}Any Macro constraint type for EdgesCheck box belowList of constraints applied to the edge. E.g. {"CapacityConstraint": true}.
availabilityDictAvailability file path and headerEmptyPath to the availability file and column name for the availability time series to link to the edge. E.g. {"timeseries": {"path": "assets/availability.csv", "header": "SE_Above_ground_storage"}}.
can_expandBoolBoolfalseWhether the edge is eligible for capacity expansion.
can_retireBoolBoolfalseWhether the edge is eligible for capacity retirement.
capacity_sizeFloat64Float641.0Size of the edge capacity.
efficiencyFloat64Number $\in$ [0,1]1.0Efficiency of the charging/discharging process.
existing_capacityFloat64Float640.0Existing capacity of the edge in MW.
fixed_om_costFloat64Float640.0Fixed operations and maintenance cost (USD/MW-year).
has_capacityBoolBoolfalseWhether capacity variables are created for the edge.
integer_decisionsBoolBoolfalseWhether capacity variables are integers.
investment_costFloat64Float640.0Annualized capacity investment cost (USD/MW-year)
loss_fractionFloat64Number $\in$ [0,1]0.0Fraction of transmission loss.
max_capacityFloat64Float64InfMaximum allowed capacity of the edge (MW). Note: add the MaxCapacityConstraint to the constraints dictionary to activate this constraint.
min_capacityFloat64Float640.0Minimum allowed capacity of the edge (MW). Note: add the MinCapacityConstraint to the constraints dictionary to activate this constraint.
min_flow_fractionFloat64Number $\in$ [0,1]0.0Minimum flow of the edge as a fraction of the total capacity. Note: add the MinFlowConstraint to the constraints dictionary to activate this constraint.
ramp_down_fractionFloat64Number $\in$ [0,1]1.0Maximum decrease in flow between two time steps, reported as a fraction of the capacity. Note: add the RampingLimitConstraint to the constraints dictionary to activate this constraint.
ramp_up_fractionFloat64Number $\in$ [0,1]1.0Maximum increase in flow between two time steps, reported as a fraction of the capacity. Note: add the RampingLimitConstraint to the constraints dictionary to activate this constraint.
variable_om_costFloat64Float640.0Variable operation and maintenance cost (USD/MWh).
Efficiency

The efficiency of the charging/discharging process can be set in the charge_edge and discharge_edge parts of the input file. These parameters are used, for example, in the Balance constraint to balance the charge and discharge flows.

Default constraints

The only default constraint for the edges of the gas storage asset is the Capacity constraint applied to both the charge and discharge edges.

Storage component

The definition of the Storage object can be found here MacroEnergy.Storage.

AttributeTypeValuesDefaultDescription
commodityStringAny Macro commodity typeRequiredCommodity being stored. E.g. "Hydrogen".
constraintsDict{String,Bool}Any Macro constraint type for storageBalanceConstraint, StorageCapacityConstraintList of constraints applied to the storage. E.g. {"BalanceConstraint": true}.
can_expandBoolBoolfalseWhether the storage is eligible for capacity expansion.
can_retireBoolBoolfalseWhether the storage is eligible for capacity retirement.
charge_discharge_ratioFloat64Float641.0Ratio between charging and discharging rates.
existing_capacity_storageFloat64Float640.0Initial installed storage capacity (MWh).
fixed_om_cost_storageFloat64Float640.0Fixed operations and maintenance cost (USD/MWh-year).
investment_cost_storageFloat64Float640.0Annualized investment cost of the energy capacity for a storage technology (USD/MWh-year).
long_durationBoolBoolfalseWhether the storage is a long-duration storage. Note: if true, the long-duration storage constraint will be applied.
max_capacity_storageFloat64Float64InfMaximum allowed storage capacity (MWh).
max_durationFloat64Float640.0Maximum ratio of installed energy to discharged capacity that can be installed (hours).
min_capacity_storageFloat64Float640.0Minimum allowed storage capacity (MWh).
min_durationFloat64Float640.0Minimum ratio of installed energy to discharged capacity that can be installed (hours).
min_outflow_fractionFloat64Float640.0Minimum outflow as a fraction of capacity.
min_storage_levelFloat64Float640.0Minimum storage level as a fraction of capacity.
max_storage_levelFloat64Float641.0Maximum storage level as a fraction of capacity.
storage_loss_fractionFloat64Number $\in$ [0,1]0.0Fraction of stored commodity lost per timestep.
Default constraints

As noted in the above table, the default constraints for the storage component of the gas storage are the following:

If the storage is a long-duration storage, the following additional constraints are applied:

Example

The following input file example shows how to create a hydrogen storage asset in each of the three zones SE, MIDAT and NE.

{
    "h2stor": [
        {
            "type": "GasStorage",
            "global_data": {
                "nodes": {},
                "transforms": {
                    "timedata": "Hydrogen",
                    "constraints": {
                        "BalanceConstraint": true
                    }
                },
                "edges": {
                    "discharge_edge": {
                        "type": "Hydrogen",
                        "unidirectional": true,
                        "can_expand": true,
                        "can_retire": false,
                        "has_capacity": true,
                        "constraints": {
                            "CapacityConstraint": true,
                            "RampingLimitConstraint": true
                        }
                    },
                    "charge_edge": {
                        "type": "Hydrogen",
                        "unidirectional": true,
                        "has_capacity": true,
                        "can_expand": true,
                        "can_retire": false,
                        "constraints": {
                            "CapacityConstraint": true
                        }
                    },
                    "compressor_elec_edge": {
                        "type": "Electricity",
                        "unidirectional": true,
                        "has_capacity": false
                    },
                    "compressor_gas_edge": {
                        "type": "Hydrogen",
                        "unidirectional": true,
                        "has_capacity": false
                    }
                },
                "storage": {
                    "commodity": "Hydrogen",
                    "can_expand": true,
                    "can_retire": false,
                    "constraints": {
                        "StorageCapacityConstraint": true,
                        "BalanceConstraint": true,
                        "MinStorageLevelConstraint": true
                    }
                }
            },
            "instance_data": [
                {
                    "id": "SE_Above_ground_storage",
                    "transforms": {
                        "electricity_consumption": 0.018029457
                    },
                    "edges": {
                        "discharge_edge": {
                            "end_vertex": "h2_SE",
                            "existing_capacity": 0,
                            "investment_cost": 0.0,
                            "fixed_om_cost": 0.0,
                            "variable_om_cost": 0.0,
                            "efficiency": 1.0,
                            "ramp_up_fraction": 1,
                            "ramp_down_fraction": 1
                        },
                        "charge_edge": {
                            "existing_capacity": 0,
                            "investment_cost": 3219.236569,
                            "fixed_om_cost": 0.0,
                            "variable_om_cost": 0.0,
                            "efficiency": 1.0
                        },
                        "compressor_gas_edge": {
                            "start_vertex": "h2_SE"
                        },
                        "compressor_elec_edge": {
                            "start_vertex": "elec_SE"
                        }
                    },
                    "storage": {
                        "investment_cost_storage": 873.013307,
                        "fixed_om_cost_storage": 28.75810056,
                        "storage_loss_fraction": 0.0,
                        "min_storage_level": 0.3
                    }
                },
                {
                    "id": "MIDAT_Above_ground_storage",
                    "transforms": {
                        "electricity_consumption": 0.018029457
                    },
                    "edges": {
                        "discharge_edge": {
                            "end_vertex": "h2_MIDAT",
                            "existing_capacity": 0,
                            "investment_cost": 0.0,
                            "fixed_om_cost": 0.0,
                            "variable_om_cost": 0.0,
                            "efficiency": 1.0,
                            "ramp_up_fraction": 1,
                            "ramp_down_fraction": 1
                        },
                        "charge_edge": {
                            "existing_capacity": 0,
                            "investment_cost": 3219.236569,
                            "fixed_om_cost": 0.0,
                            "variable_om_cost": 0.0,
                            "efficiency": 1.0
                        },
                        "compressor_gas_edge": {
                            "start_vertex": "h2_MIDAT"
                        },
                        "compressor_elec_edge": {
                            "start_vertex": "elec_MIDAT"
                        }
                    },
                    "storage": {
                        "investment_cost_storage": 873.013307,
                        "fixed_om_cost_storage": 28.75810056,
                        "storage_loss_fraction": 0.0,
                        "min_storage_level": 0.3
                    }
                },
                {
                    "id": "NE_Above_ground_storage",
                    "transforms": {
                        "electricity_consumption": 0.018029457
                    },
                    "edges": {
                        "discharge_edge": {
                            "end_vertex": "h2_NE",
                            "existing_capacity": 0,
                            "investment_cost": 0.0,
                            "fixed_om_cost": 0.0,
                            "variable_om_cost": 0.0,
                            "efficiency": 1.0,
                            "ramp_up_fraction": 1,
                            "ramp_down_fraction": 1
                        },
                        "charge_edge": {
                            "existing_capacity": 0,
                            "investment_cost": 3219.236569,
                            "fixed_om_cost": 0.0,
                            "variable_om_cost": 0.0,
                            "efficiency": 1.0
                        },
                        "compressor_gas_edge": {
                            "start_vertex": "h2_NE"
                        },
                        "compressor_elec_edge": {
                            "start_vertex": "elec_NE"
                        }
                    },
                    "storage": {
                        "investment_cost_storage": 873.013307,
                        "fixed_om_cost_storage": 28.75810056,
                        "storage_loss_fraction": 0.0,
                        "min_storage_level": 0.3
                    }
                }
            ]
        }
    ]
}