Hydrogen

Hydrogen can be supplied exogenously, produced from electricity, and moved across time. Hydrogen demand builders are documented on the Demand And Flexibility page.

See Component Builders for shared naming, workbook, capacity, and port conventions, and Tags And Post-Processing for tagging and reporting. Each section's diagram follows the conventions in Reading The Port Diagrams.

Purchased Hydrogen

makeflathydrogenpurchase represents an exogenous hydrogen supply. It creates fixed output capacity annual_supply / 8760 with a constant profile, so annual_supply is the total annual hydrogen-energy purchase. It reads no workbook and adds no cost. Add an explicit Nosy cost behaviour when purchases should affect the objective.

Ports of a flat hydrogen purchase component

The generated name is "$name $(n.name)".

Tags: :tech => tech, :zone => n.name, and the function tags hydrogen and purchase.

Posy2.makeflathydrogenpurchase — Function
makeflathydrogenpurchase(name::String, n::Node, annual_supply::Real, s::Snapshot;
    tech::String=name)

Build, connect and return a flat hydrogen purchase component.

Arguments:

  • name: component name prefix.
  • tech: technology label used for reporting and component queries; defaults to name.
  • n: hydrogen node to connect the component to.
  • annual_supply: Purchased hydrogen in MWh/year, converted internally to a flat hourly flow (annual_supply / 8760).
  • s: snapshot to register the component in.
source

Electrolysers

makeelectrolyser creates a converter with electricity input and hydrogen output. The output-to-input ratio is efficiency. In :excel mode, omitted values come from the electrolysis technology column. In :arguments mode, efficiency defaults to one and costs to zero; lifetime and construction data are required only for nonzero overnight cost, and the decommissioning profile only when decommissioning cost is active.

Ports of an electrolyser component

Capacity and all cost behaviours are attached to electricity input. A numeric cap fixes input power; a JuMP variable or affine expression reuses an external decision; nothing creates a new decision; and an extracted snapshot fixes capacity from the matching component. mincap and maxcap bound either variable form. grid_losses adds a proportional electricity input flow.

The generated name is "$name $(elec.name)".

Tags: :tech => tech, :zone => elec.name, and the function tags demand, electrolysis, and hydrogen. These tags allow electrical consumption to appear in demand reporting.

See the Hydrogen Production example for a complete model using this builder.

Posy2.makeelectrolyser — Function
makeelectrolyser(name::String, elec::Node, h2::Node, s::Snapshot;
    tech::String=name, tech_column::String=tech,
    cap=nothing, mincap=nothing, maxcap=nothing,
    grid_losses=0.,
    efficiency::Union{Nothing,Real}=nothing,
    overnight_cost::Union{Nothing,Real}=nothing, om_fixed_cost::Union{Nothing,Real}=nothing,
    decommissioning::Union{Nothing,Real}=nothing, lifetime::Union{Nothing,Real}=nothing, construction_profile=nothing, decommissioning_profile=nothing,
    om_var_cost::Union{Nothing,Real}=nothing,
)

Build, connect and return an electrolyser component.

Arguments:

  • name: component name prefix.

  • tech: technology label used for reporting and component queries; defaults to name.

  • tech_column: technology column name in the electrolysis tech data sheet; defaults to tech.

  • elec: electricity node to connect the component to.

  • h2: hydrogen node to connect the component to.

  • s: snapshot to register the component in.

  • cap: Electricity input capacity in MW. A number fixes capacity, a JuMP VariableRef or AffExpr reuses that expression, nothing creates a capacity decision, and an extracted Snapshot inherits the capacity of "<name> <node name>" in it.

  • mincap: Lower capacity bound in MW; checked as an assertion against a fixed or inherited one.

  • maxcap: Upper capacity bound in MW; checked as an assertion against a fixed or inherited one.

  • grid_losses: Proportional electricity-loss fraction (0 <= grid_losses < 1).

  • efficiency: Hydrogen output per unit of electricity input (dimensionless when both carriers use MWh). If nothing, read it from the workbook in :excel mode and use one in :arguments mode.

  • overnight_cost: Overnight CAPEX in currency/kW of electricity input capacity.

  • om_fixed_cost: Fixed O&M in currency/kW/year of electricity input capacity.

  • decommissioning: Decommissioning cost as a fraction of overnight CAPEX.

  • lifetime: Asset lifetime in years (> 0, integer-valued).

  • construction_profile: Dimensionless yearly construction-cost shares.

  • decommissioning_profile: Dimensionless yearly decommissioning-cost shares.

  • om_var_cost: Variable O&M in currency/MWh of electricity input.

With nothing, economic arguments use workbook values in :excel mode. In :arguments mode, costs default to zero; nonzero overnight cost requires lifetime and construction_profile, plus decommissioning_profile when decommissioning is nonzero.

source

Hydrogen Storage

makehydrogenstorage creates a simplified storage component on a hydrogen node. Capacity is attached to level, not to charge or discharge power, which are left unlimited. A numeric energy_cap fixes stored-energy capacity; a JuMP variable or affine expression reuses an external decision; nothing creates a new decision; and an extracted snapshot inherits the matching component's level capacity. energy_mincap and energy_maxcap bound either variable form.

Ports of a hydrogen storage component

In :excel mode, omitted values come from the storage technology column. In :arguments mode, roundtrip_eff defaults to one and economic terms to zero; inactive capital and decommissioning data are not required. Investment, fixed O&M, and decommissioning are attached to level. The builder intentionally adds neither a duration constraint nor a variable O&M cost, making it suitable for medium- or long-duration storage whose power is not sized separately.

The component is named "$name $(h2.name)".

Tags: :tech => tech, :zone => h2.name, and the function tags hydrogen and storage.

See the Hydrogen Production example for a complete model using this builder.

Posy2.makehydrogenstorage — Function
makehydrogenstorage(name::String, h2::Node, s::Snapshot;
    tech::String=name, tech_column::String=tech,
    energy_cap=nothing, energy_mincap=nothing, energy_maxcap=nothing,
    roundtrip_eff::Union{Nothing,Real}=nothing,
    overnight_cost::Union{Nothing,Real}=nothing, om_fixed_cost::Union{Nothing,Real}=nothing,
    decommissioning::Union{Nothing,Real}=nothing, lifetime::Union{Nothing,Real}=nothing, construction_profile=nothing, decommissioning_profile=nothing,
)

Build, connect and return a hydrogen storage component.

Arguments:

  • name: component name prefix.

  • tech: technology label used for reporting and component queries; defaults to name.

  • tech_column: technology column name in the storage tech data sheet; defaults to tech.

  • h2: hydrogen node to connect the component to.

  • s: snapshot to register the component in.

  • energy_cap: Stored-energy capacity in MWh. Charging and discharging power are left unlimited. A number fixes capacity, a JuMP VariableRef or AffExpr reuses that expression, nothing creates a capacity decision, and an extracted Snapshot inherits the capacity of "<name> <node name>" in it.

  • energy_mincap: Lower energy-capacity bound in MWh; checked as an assertion against a fixed or inherited one.

  • energy_maxcap: Upper energy-capacity bound in MWh; checked as an assertion against a fixed or inherited one.

  • roundtrip_eff: Dimensionless round-trip storage efficiency. If nothing, read it from the workbook in :excel mode and use one in :arguments mode.

  • overnight_cost: Overnight CAPEX in currency/kWh of storage capacity.

  • om_fixed_cost: Fixed O&M in currency/kWh/year of storage capacity.

  • decommissioning: Decommissioning cost as a fraction of overnight CAPEX.

  • lifetime: Asset lifetime in years (> 0, integer-valued).

  • construction_profile: Dimensionless yearly construction-cost shares.

  • decommissioning_profile: Dimensionless yearly decommissioning-cost shares.

With nothing, economic arguments use workbook values in :excel mode. In :arguments mode, costs default to zero; nonzero overnight cost requires lifetime and construction_profile, plus decommissioning_profile when decommissioning is nonzero.

source

Related demand builders: makeflathydrogendemand and makeflexhydrogendemand.