Skip to content

Converter PLM dispatch#773

Draft
jaredthomas68 wants to merge 20 commits into
NatLabRockies:developfrom
jaredthomas68:control-converter
Draft

Converter PLM dispatch#773
jaredthomas68 wants to merge 20 commits into
NatLabRockies:developfrom
jaredthomas68:control-converter

Conversation

@jaredthomas68

Copy link
Copy Markdown
Collaborator

Converter PLM control

This PR adds peak load management dispatch for converters. It handles two load profiles, one representing an upstream (grid) load and the other representing a local load that must be met. The converter will be dispatched when either of the demand profiles exceeds their respective peak limits.

Section 1: Type of Contribution

  • Feature Enhancement
    • Framework
    • New Model
    • Updated Model
    • Tools/Utilities
    • Other (please describe):
  • Bug Fix
  • Documentation Update
  • CI Changes
  • Other (please describe):

Section 2: Draft PR Checklist

  • Open draft PR
  • Describe the feature that will be added
  • Fill out TODO list steps
  • Describe requested feedback from reviewers on draft PR
  • Complete Section 7: New Model Checklist (if applicable)

TODO:

  • Add tests
  • Finish example
  • Add documentation

Type of Reviewer Feedback Requested (on Draft PR)

Structural feedback:
Looking for high-level feedback at this point from any who wish to give it.

Implementation feedback:

Other feedback:

Section 3: General PR Checklist

  • PR description thoroughly describes the new feature, bug fix, etc.
  • Added tests for new functionality or bug fixes
  • Tests pass (If not, and this is expected, please elaborate in the Section 6: Test Results)
  • Documentation
    • Docstrings are up-to-date
    • Related docs/ files are up-to-date, or added when necessary
    • Documentation has been rebuilt successfully
    • Examples have been updated (if applicable)
  • CHANGELOG.md
    • At least one complete sentence has been provided to describe the changes made in this PR
    • After the above, a hyperlink has been provided to the PR using the following format:
      "A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
      XYZ should be replaced with the actual number.

Section 4: Related Issues

Section 5: Impacted Areas of the Software

Section 5.1: New Files

  • path/to/file.extension
    • method1: What and why something was changed in one sentence or less.

Section 5.2: Modified Files

  • path/to/file.extension
    • method1: What and why something was changed in one sentence or less.

Section 6: Additional Supporting Information

Section 7: Test Results, if applicable

Section 8 (Optional): New Model Checklist

  • Model Structure:
    • Follows established naming conventions outlined in docs/developer_guide/coding_guidelines.md
    • Used attrs class to define the Config to load in attributes for the model
      • If applicable: inherit from BaseConfig or CostModelBaseConfig
    • Added: initialize() method, setup() method, compute() method
      • If applicable: inherit from CostModelBaseClass
  • Integration: Model has been properly integrated into H2Integrate
    • Added to supported_models.py
    • If a new commodity_type is added, update create_financial_model in h2integrate_model.py
  • Tests: Unit tests have been added for the new model
    • Pytest-style unit tests
    • Unit tests are in a "test" folder within the folder a new model was added to
    • If applicable add integration tests
  • Example: If applicable, a working example demonstrating the new model has been created
    • Input file comments
    • Run file comments
    • Example has been tested and runs successfully in test_all_examples.py
  • Documentation:
    • Write docstrings using the Google style
    • Model added to the main models list in docs/user_guide/model_overview.md
      • Model documentation page added to the appropriate docs/ section
      • <model_name>.md is added to the _toc.yml
    • Run generate_class_hierarchy.py to update the class hierarchy diagram in docs/developer_guide/class_structure.md

@jaredthomas68 jaredthomas68 requested a review from johnjasa May 28, 2026 21:03
@jaredthomas68 jaredthomas68 mentioned this pull request May 29, 2026
51 tasks
@jaredthomas68 jaredthomas68 requested a review from kbrunik June 1, 2026 22:01

@kbrunik kbrunik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking pretty good! Remarkable how much simpler the code is when you don't have to track state of charge! I know there was already some planned work that still needs to happen, so happy to re-review at that point

A few high-level notes for the PR:

  1. Be sure to update the changelog
  2. Add some basic tests to make sure the dispatch is occurring as expected (i.e., the tech is turns off after peak is "managed")
  3. Write a doc page for the converter PLM

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking it might be good to move this file to the resource_files folder at the top level of H2I so that it can be used in this example and 33_peak_load_management.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or the library folder at the top level of H2I instead?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking it might be good to move this file to the resource_files folder at the top level of H2I so that it can be used in this example and 33_peak_load_management.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it could be good to have both peak load management examples (storage and converter) in the same folder 33_peak_load_management and then have nested folders for each example.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's update name of this file so it's not the same as the storage PLM file.

@@ -0,0 +1,5 @@
name: driver_config
description: Driver configuration for multivariable streams example

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update description

control_parameters:
commodity: electricity
commodity_rate_units: kW
system_capacity_rate: 1000.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove from control section, example didn't run with it included.

"""
Example 33: Peak load management dispatch

This example demonstrates:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update example description based on fuel cell/converter example.

@@ -0,0 +1,65 @@
name: technology_config
description: This plant charges a battery from the grid to reduce peak demand

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update description

StorageOpenLoopControlBaseConfig
):
"""
Configuration class for the PeakLoadManagementHeuristicOpenLoopStorageController.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update docstring


"""

system_capacity_kw: int | float = field()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elenya-grant and @johnjasa, I was discussing with Jared about how to make this control strategy tech agnostic. Right now it's hardcoded to have system_capacity_kw in the config. I'm wondering if y'all have ideas of what the best path forward is for this to work with all dispatchable converters.

We have access to the standardized commodity_rate_units but there's no standardization across how we define system capacity, which makes this challenging.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well system capacity is a standard output of performance models (rated_{commodity}_production). I get confused on the order that models are added, but if the performance model is created in the tech subgroup before the controller, then the performance model would output the rated_{commodity}_production and that could then be an input to the PLM converter controller.

This is a good question though. I think the best thing (if possible) would be to have rated_{commodity}_production as an openmdao input.

Also - I don't think the capacity input in the config or the openmdao inputs should be standardized for a few reasons:

  1. In the config, it seems more acceptable to include units in config parameters to make it more clear to users what units that parameter should be in. The units are not included in OpenMDAO input names.
  2. Some technologies do not have a single capacity-related input. Some technologies have an input that would instead be a multiplier on some number of units (like number of electrolyzer clusters and cluster capacity OR number of wind turbines and wind turbine capacity).

jaredthomas68 and others added 7 commits June 9, 2026 13:15
* varopex

* refurb schedule

* update fuel cell schedule calc to allow for non-integer multiples of eol and timesteps

* extend liftime for schedule test

* Update h2integrate/converters/hydrogen/h2_fuel_cell.py

---------

Co-authored-by: Jared Thomas <jaredthomas68@gmail.com>
Co-authored-by: Jared Thomas <jaredthomas68@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants