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

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.

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