h2integrate.control.control_rules.pyomo_rule_baseclass#

Classes

PyomoRuleBaseClass(**kwargs)

PyomoRuleBaseConfig(*, commodity_name, ...)

Configuration class for the PyomoRuleBaseConfig.

class h2integrate.control.control_rules.pyomo_rule_baseclass.PyomoRuleBaseConfig(*, commodity_name, commodity_storage_units)#

Configuration class for the PyomoRuleBaseConfig.

This class defines the parameters required to configure the PyomoRuleBaseConfig.

Parameters:
  • commodity_name (str)

  • commodity_storage_units (str)

commodity_name#

Name of the commodity being controlled (e.g., "hydrogen").

Type:

str

commodity_units#

Units of the commodity (e.g., "kg/h").

Type:

str

commodity_name: str#
commodity_storage_units: str#
class h2integrate.control.control_rules.pyomo_rule_baseclass.PyomoRuleBaseClass(**kwargs)#
initialize()#

Perform any one-time initialization run at instantiation.

setup()#

Declare inputs and outputs.

Available attributes:

name pathname comm options

compute(inputs, outputs, discrete_inputs, discrete_outputs)#

Return the Pyomo model elements for a given technology through the OpenMDAO infrastructure.

No computations are required for PyomoRuleClass children. All the work should be done in setup via the dispatch_block_rule_function() method.

dispatch_block_rule_function(pyomo_model, tech_name)#

Creates and initializes pyomo dispatch model components for a specific technology.

This method sets up all model elements (parameters, variables, constraints, and ports) associated with a technology block within the dispatch model. It is typically called in the setup_pyomo() method of the PyomoControllerBaseClass.

Parameters:
  • pyomo_model (pyo.ConcreteModel) -- The Pyomo model to which the technology components will be added.

  • tech_name (str) -- The name or key identifying the technology (e.g., "battery", "electrolyzer") for which model components are created.

_create_parameters(pyomo_model, tech_name)#

Defines technology-specific Pyomo parameters for the given model.

This abstract method should be implemented by subclasses to create and add technology-specific Pyomo parameters (e.g., efficiencies, limits, or costs) to the provided model instance.

Parameters:
  • pyomo_model -- The Pyomo model instance to which parameters will be added.

  • tech_name (str) -- The name or identifier of the technology for which parameters are defined.

Raises:

NotImplementedError -- If the method is not implemented in a subclass.

_create_variables(pyomo_model, tech_name)#

Defines technology-specific Pyomo variables for the given model.

This abstract method should be implemented by subclasses to create and add technology-specific Pyomo variables (e.g., efficiencies, limits, or costs) to the provided model instance.

Parameters:
  • pyomo_model -- The Pyomo model instance to which variables will be added.

  • tech_name (str) -- The name or identifier of the technology for which variables are defined.

Raises:

NotImplementedError -- If the method is not implemented in a subclass.

_create_constraints(pyomo_model, tech_name)#

Defines technology-specific Pyomo constraints for the given model.

This abstract method should be implemented by subclasses to create and add technology-specific Pyomo constraints (e.g., efficiencies, limits, or costs) to the provided model instance.

Parameters:
  • pyomo_model -- The Pyomo model instance to which constraints will be added.

  • tech_name (str) -- The name or identifier of the technology for which constraints are defined.

Raises:

NotImplementedError -- If the method is not implemented in a subclass.

_create_ports(pyomo_model, tech_name)#

Defines technology-specific Pyomo ports for the given model.

This abstract method should be implemented by subclasses to create and add technology-specific Pyomo ports (e.g., efficiencies, limits, or costs) to the provided model instance.

Parameters:
  • pyomo_model -- The Pyomo model instance to which ports will be added.

  • tech_name (str) -- The name or identifier of the technology for which port are defined.

Raises:

NotImplementedError -- If the method is not implemented in a subclass.