Electrolyzer

Contents

Overview | Asset Structure | Flow Equations | Input File (Standard Format) | Types - Asset Structure | Constructors | Examples | Best Practices | Input File (Advanced Format)

Overview

Electrolyzer assets in Macro represent hydrogen production technologies that convert electricity into hydrogen through electrolysis. These assets are defined using either JSON or CSV input files placed in the assets directory, typically named with descriptive identifiers like electrolyzer.json or electrolyzer.csv.

Asset Structure

An electrolyzer asset consists of three main components:

  1. Transformation Component: Balances the electricity and hydrogen flows
  2. Electricity Edge: Represents the electricity consumption from the grid
  3. Hydrogen Edge: Represents the hydrogen production flow

Here is a graphical representation of the electrolyzer asset:

%%{init: {'theme': 'base', 'themeVariables': { 'background': '#D1EBDE' }}}%% flowchart LR subgraph Electrolyzer direction LR A((Electricity)) e1@--> B{{..}} B e2@--> C((Hydrogen)) e1@{ animate: true } e2@{ animate: true } end style A font-size:19px,r:55px,fill:#FFD700,stroke:black,color:black,stroke-dasharray: 3,5; style B fill:black,stroke:black,color:black; style C font-size:21px,r:55px,fill:lightblue,stroke:black,color:black,stroke-dasharray: 3,5; linkStyle 0 stroke:#FFD700, stroke-width: 2px, stroke-dasharray: 5 5; linkStyle 1 stroke:lightblue, stroke-width: 2px, stroke-dasharray: 5 5;

Flow Equations

The electrolyzer asset follows these stoichiometric relationships:

\[\begin{aligned} \phi_{h2} &= \phi_{elec} \cdot \epsilon_{efficiency\_rate} \\ \end{aligned}\]

Where:

  • $\phi$ represents the flow of each commodity
  • $\epsilon$ represents the efficiency rate defined in the table below (see Conversion Process Parameters)

Input File (Standard Format)

The easiest way to include an electrolyzer asset in a model is to create a new file (either JSON or CSV) and place it in the assets directory together with the other assets.

your_case/
├── assets/
│   ├── electrolyzer.json    # or electrolyzer.csv
│   ├── other_assets.json
│   └── ...
├── system/
├── settings/
└── ...

This file can either be created manually, or using the template_asset function, as shown in the Adding an Asset to a System section of the User Guide. The file will be automatically loaded when you run your Macro model.

The following is an example of an electrolyzer asset input file:

{
    "electrolyzer": [
        {
            "type": "Electrolyzer",
            "instance_data": [
                {
                    "id": "SE_Electrolyzer",
                    "location": "SE",
                    "capacity_size": 1.5756,
                    "investment_cost": 41139.12592,
                    "fixed_om_cost": 1174.680271,
                    "variable_om_cost": 0.0,
                    "efficiency_rate": 0.87455595,
                    "h2_constraints": {
                        "MinFlowConstraint": true,
                        "RampingLimitConstraint": true
                    },
                    "min_flow_fraction": 0.1,
                    "ramp_up_fraction": 1,
                    "ramp_down_fraction": 1
                }
            ]
        }
    ]
}
Global Data vs Instance Data

When working with JSON input files, the global_data field can be used to group data that is common to all instances of the same asset type. This is useful for setting constraints that are common to all instances of the same asset type and avoid repeating the same data for each instance. See the Examples section below for an example.

The following tables outline the attributes that can be set for an electrolyzer asset.

Essential Attributes

FieldTypeDescription
TypeStringAsset type identifier: "Electrolyzer"
idStringUnique identifier for the electrolyzer instance
locationStringGeographic location/node identifier

Conversion Process Parameters

The following set of parameters control the conversion process and stoichiometry of the electrolyzer asset (see Flow Equations for more details).

FieldTypeDescriptionUnitsDefault
efficiency_rateFloat64Electrolysis efficiency$MWh_{h2}/MWh_{elec}$0.0

Constraints configuration

Electrolyzer assets can have different constraints applied to them, and the user can configure them using the following fields:

FieldTypeDescription
transform_constraintsDict{String,Bool}List of constraints applied to the transformation component.
h2_constraintsDict{String,Bool}List of constraints applied to the hydrogen edge.
elec_constraintsDict{String,Bool}List of constraints applied to the electricity edge.

Users can refer to the Adding Asset Constraints to a System section of the User Guide for a list of all the constraints that can be applied to the different components of an electrolyzer asset.

Default constraints

To simplify the input file and the asset configuration, the following constraints are applied to the electrolyzer asset by default:

Investment Parameters

FieldTypeDescriptionUnitsDefault
can_retireBooleanWhether electrolyzer capacity can be retired-true
can_expandBooleanWhether electrolyzer capacity can be expanded-true
existing_capacityFloat64Initial installed electrolyzer capacityMW0.0
capacity_sizeFloat64Unit size for capacity decisions-1.0

Additional Investment Parameters

Maximum and minimum capacity constraints

If MaxCapacityConstraint or MinCapacityConstraint are added to the constraints dictionary for the hydrogen edge, the following parameters are used by Macro:

FieldTypeDescriptionUnitsDefault
max_capacityFloat64Maximum allowed electrolyzer capacityMWInf
min_capacityFloat64Minimum allowed electrolyzer capacityMW0.0

Economic Parameters

FieldTypeDescriptionUnitsDefault
investment_costFloat64CAPEX per unit electrolyzer capacity$/MW0.0
annualized_investment_costUnion{Nothing,Float64}Annualized CAPEX$/MW/yrcalculated
fixed_om_costFloat64Fixed O&M costs$/MW/yr0.0
variable_om_costFloat64Variable O&M costs$/MWh0.0
waccFloat64Weighted average cost of capitalfraction0.0
lifetimeIntAsset lifetime in yearsyears1
capital_recovery_periodIntInvestment recovery periodyears1
retirement_periodIntRetirement periodyears0

Operational Parameters

FieldTypeDescriptionUnitsDefault
availabilityDictPath to availability file and column name-Empty

Additional Operational Parameters

Minimum flow constraint

If MinFlowConstraint is added to the constraints dictionary for the hydrogen edge, the following parameter is used:

FieldTypeDescriptionUnitsDefault
min_flow_fractionFloat64Minimum flow as fraction of capacityfraction0.0

Ramping limit constraint

If RampingLimitConstraint is added to the constraints dictionary for the hydrogen edge, the following parameters are used:

FieldTypeDescriptionUnitsDefault
ramp_up_fractionFloat64Maximum increase in flow between timestepsfraction1.0
ramp_down_fractionFloat64Maximum decrease in flow between timestepsfraction1.0

Types - Asset Structure

The Electrolyzer asset is defined as follows:

struct Electrolyzer <: AbstractAsset
    id::AssetId
    electrolyzer_transform::Transformation
    h2_edge::Edge{<:Hydrogen}
    elec_edge::Edge{<:Electricity}
end

Constructors

Default constructor

Electrolyzer(id::AssetId, electrolyzer_transform::Transformation, h2_edge::Edge{<:Hydrogen}, elec_edge::Edge{<:Electricity})

Factory constructor

make(asset_type::Type{Electrolyzer}, data::AbstractDict{Symbol,Any}, system::System)
FieldTypeDescription
asset_typeType{Electrolyzer}Macro type of the asset
dataAbstractDict{Symbol,Any}Dictionary containing the input data for the asset
systemSystemSystem to which the asset belongs

Examples

This section contains examples of how to use the electrolyzer asset in a Macro model.

Single electrolyzer in a single zone

This example shows a single electrolyzer in a single zone, SE, with ramping limits and minimum flow constraints.

JSON Format:

{
    "electrolyzer": [
        {
            "type": "Electrolyzer",
            "instance_data": [
                {
                    "id": "SE_Electrolyzer",
                    "location": "SE",
                    "investment_cost": 41139.12592,
                    "fixed_om_cost": 1174.680271,
                    "variable_om_cost": 0.0,
                    "capacity_size": 1.5756,
                    "efficiency_rate": 0.87455595,
                    "h2_constraints": {
                        "RampingLimitConstraint": true,
                        "MinFlowConstraint": true
                    },
                    "ramp_up_fraction": 1,
                    "ramp_down_fraction": 1,
                    "min_flow_fraction": 0.1
                }
            ]
        }
    ]
}

CSV Format:

Typeidlocationinvestment_costfixed_om_costvariable_om_costefficiency_rateh2_constraints–RampingLimitConstrainth2_constraints–MinFlowConstraintcapacity_sizeramp_up_fractionramp_down_fractionmin_flow_fraction
ElectrolyzerSE_ElectrolyzerSE41139.125921174.6802710.00.87455595truetrue1.5756110.1

Multiple electrolyzers in different zones

JSON Format:

Note that the global_data field is used to set the fields and constraints that are common to all instances of the same asset type.

{
    "electrolyzer": [
        {
            "type": "Electrolyzer",
            "global_data": {
                "h2_constraints": {
                    "RampingLimitConstraint": true,
                    "MinFlowConstraint": true
                },
                "efficiency_rate": 0.87455595,
                "investment_cost": 41139.12592,
                "fixed_om_cost": 1174.680271,
                "variable_om_cost": 0.0,
                "capacity_size": 1.5756,
                "ramp_up_fraction": 1,
                "ramp_down_fraction": 1,
                "min_flow_fraction": 0.1
            },
            "instance_data": [
                {
                    "id": "SE_Electrolyzer",
                    "location": "SE"
                },
                {
                    "id": "MIDAT_Electrolyzer",
                    "location": "MIDAT"
                },
                {
                    "id": "NE_Electrolyzer",
                    "location": "NE"
                }
            ]
        }
    ]
}

CSV Format:

Typeidlocationinvestment_costfixed_om_costvariable_om_costefficiency_rateh2_constraints–RampingLimitConstrainth2_constraints–MinFlowConstraintcapacity_sizeramp_up_fractionramp_down_fractionmin_flow_fraction
ElectrolyzerSE_ElectrolyzerSE41139.125921174.6802710.00.87455595truetrue1.5756110.1
ElectrolyzerMIDAT_ElectrolyzerMIDAT41139.125921174.6802710.00.87455595truetrue1.5756110.1
ElectrolyzerNE_ElectrolyzerNE41139.125921174.6802710.00.87455595truetrue1.5756110.1

Best Practices

  1. Use global data for common fields and constraints: Use the global_data field to set the fields and constraints that are common to all instances of the same asset type.
  2. Set realistic efficiency rates: Ensure the electrolysis efficiency is accurate for the technology being modeled
  3. Use meaningful IDs: Choose descriptive identifiers that indicate location and technology type
  4. Consider operational constraints: Set appropriate ramp rates and minimum flow fractions based on technology characteristics
  5. Use constraints selectively: Only enable constraints that are necessary for your modeling needs
  6. Validate costs: Ensure investment and O&M costs are in appropriate units
  7. Test configurations: Start with simple configurations and gradually add complexity

Input File (Advanced Format)

Macro provides an advanced format for defining electrolyzer assets, offering users and modelers detailed control over asset specifications. This format builds upon the standard format and is ideal for those who need more comprehensive customization.

To understand the advanced format, consider the graph representation and the type definition of an electrolyzer asset. The input file mirrors this hierarchical structure.

An electrolyzer asset in Macro is composed of a transformation component, represented by a Transformation object, and two edges (electricity and hydrogen), each represented by an Edge object. The input file for an electrolyzer asset is therefore organized as follows:

{
    "transforms":{
        // ... transformation-specific attributes ...
    },
    "edges":{
        "elec_edge": {
            // ... elec_edge-specific attributes ...
        },
        "h2_edge": {
            // ... h2_edge-specific attributes ...
        }
    }
}

Each top-level key (e.g., "transforms" or "edges") denotes a component type. The second-level keys either specify the attributes of the component (when there is a single instance) or identify the instances of the component (e.g., "elec_edge", "h2_edge", etc.) when there are multiple instances. For multiple instances, a third-level key details the attributes for each instance.

Below is an example of an input file for an electrolyzer asset that sets up multiple electrolyzers across different regions:

{
    "electrolyzer": [
        {
            "type": "Electrolyzer",
            "global_data": {
                "transforms": {
                    "timedata": "Electricity"
                },
                "edges": {
                    "h2_edge": {
                        "commodity": "Hydrogen",
                        "unidirectional": true,
                        "has_capacity": true,
                        "can_retire": true,
                        "can_expand": true,
                        "constraints": {
                            "RampingLimitConstraint": true,
                            "MinFlowConstraint": true
                        }
                    },
                    "elec_edge": {
                        "commodity": "Electricity",
                        "unidirectional": true,
                        "has_capacity": false
                    }
                }
            },
            "instance_data": [
                {
                    "id": "SE_Electrolyzer",
                    "transforms": {
                        "efficiency_rate": 0.87455595
                    },
                    "edges": {
                        "elec_edge": {
                            "start_vertex": "elec_SE"
                        },
                        "h2_edge": {
                            "end_vertex": "h2_SE",
                            "existing_capacity": 0,
                            "investment_cost": 41139.12592,
                            "fixed_om_cost": 1174.680271,
                            "variable_om_cost": 0.0,
                            "capacity_size": 1.5756,
                            "ramp_up_fraction": 1,
                            "ramp_down_fraction": 1,
                            "min_flow_fraction": 0.1
                        }
                    }
                },
                {
                    "id": "MIDAT_Electrolyzer",
                    "transforms": {
                        "efficiency_rate": 0.87455595
                    },
                    "edges": {
                        "elec_edge": {
                            "start_vertex": "elec_MIDAT"
                        },
                        "h2_edge": {
                            "end_vertex": "h2_MIDAT",
                            "existing_capacity": 0,
                            "investment_cost": 41139.12592,
                            "fixed_om_cost": 1174.680271,
                            "variable_om_cost": 0.0,
                            "capacity_size": 1.5756,
                            "ramp_up_fraction": 1,
                            "ramp_down_fraction": 1,
                            "min_flow_fraction": 0.1
                        }
                    }
                },
                {
                    "id": "NE_Electrolyzer",
                    "transforms": {
                        "efficiency_rate": 0.87455595
                    },
                    "edges": {
                        "elec_edge": {
                            "start_vertex": "elec_NE"
                        },
                        "h2_edge": {
                            "end_vertex": "h2_NE",
                            "existing_capacity": 0,
                            "investment_cost": 41139.12592,
                            "fixed_om_cost": 1174.680271,
                            "variable_om_cost": 0.0,
                            "capacity_size": 1.5756,
                            "ramp_up_fraction": 1,
                            "ramp_down_fraction": 1,
                            "min_flow_fraction": 0.1
                        }
                    }
                }
            ]
        }
    ]
}

Key Points

  • The global_data field is utilized to define attributes and constraints that apply universally to all instances of a particular asset type.
  • The start_vertex and end_vertex fields indicate the nodes to which the edges are connected. These nodes must be defined in the nodes.json file.
  • By default, the hydrogen edge has capacity variables and can be expanded or retired (see note below).
  • For a comprehensive list of attributes that can be configured for the transformation and edge components, refer to the transformation and edges pages of the Macro manual.
The `has_capacity` Edge Attribute

The has_capacity attribute is a flag that indicates whether a specific edge of an asset has a capacity variable, allowing it to be expanded or retired. Typically, users do not need to manually adjust this flag, as the asset creators in Macro have already configured it correctly for each edge. However, advanced users can use this flag to override the default settings for each edge if needed.