h2integrate.core.commodity_stream_definitions

h2integrate.core.commodity_stream_definitions#

Commodity stream definitions for H2Integrate.

This module contains: 1. multivariable_streams: Definitions for streams that bundle multiple related variables 2. add_multivariable_output / add_multivariable_input: Helpers to register all

constituent variables of a multivariable stream on an OpenMDAO component

  1. is_electricity_producer: Helper function to identify electricity-producing technologies

Functions

add_multivariable_input(component, ...)

Add all constituent variables of a multivariable stream as inputs.

add_multivariable_output(component, ...)

Add all constituent variables of a multivariable stream as outputs.

is_electricity_producer(tech_name)

Check if a technology is an electricity producer.

h2integrate.core.commodity_stream_definitions.add_multivariable_output(component, stream_name, n_timesteps)#

Add all constituent variables of a multivariable stream as outputs.

For each variable defined in multivariable_streams[stream_name], an output named <stream_name>:<var_name>_out is added to component.

Parameters:
  • component – An OpenMDAO component instance (must have add_output).

  • stream_name (str) – Key into multivariable_streams.

  • n_timesteps (int) – Length of the time-series dimension.

Raises:

KeyError – If stream_name is not in multivariable_streams.

Return type:

None

h2integrate.core.commodity_stream_definitions.add_multivariable_input(component, stream_name, n_timesteps)#

Add all constituent variables of a multivariable stream as inputs.

For each variable defined in multivariable_streams[stream_name], an input named <stream_name>:<var_name>_in is added to component.

Parameters:
  • component – An OpenMDAO component instance (must have add_input).

  • stream_name (str) – Key into multivariable_streams.

  • n_timesteps (int) – Length of the time-series dimension.

Raises:

KeyError – If stream_name is not in multivariable_streams.

Return type:

None

h2integrate.core.commodity_stream_definitions.is_electricity_producer(tech_name)#

Check if a technology is an electricity producer.

Parameters:

tech_name (str) – The name of the technology to check.

Returns:

True if tech_name starts with any of the known electricity producing tech prefixes (e.g., ‘wind’, ‘solar’, ‘pv’, ‘grid_buy’, etc.).

Return type:

bool

Note

This uses prefix matching, so ‘grid_buy_1’ and ‘grid_buy_2’ would both be considered electricity producers. Be careful when naming technologies to avoid unintended matches (e.g., ‘pv_battery’ would be incorrectly identified as an electricity producer).