Skip to content

Standard Combiner Outputs (follow-on to 463)#501

Draft
elenya-grant wants to merge 3 commits intoNatLabRockies:developfrom
elenya-grant:standard_combiner
Draft

Standard Combiner Outputs (follow-on to 463)#501
elenya-grant wants to merge 3 commits intoNatLabRockies:developfrom
elenya-grant:standard_combiner

Conversation

@elenya-grant
Copy link
Collaborator

Standardize Combiner Outputs

Added standard outputs to the combiner (rated_commodity_production and capacity_factor). This PR is intended to address a step outlined Issue #485 to eventually have finance models capture variation in lifetime performance. This PR focuses on the combiner, which is used as the commodity_stream in some examples. The main changes are that the combiner is now input rated_commodity_production and capacity_factor from each input stream, and also outputs the combined capacity factor and rated production capacity.

The combined capacity factor is calculated as:

$CF = \frac{\sum_{i=0}^{n_{comp}}(CF_{i}*S_{i})}{\sum_{i=0}^{n_{comp}}S_{i}}$
where $CF_{i}$ is the capacity factor of component $i$ and $S_{i}$ is the rated production capacity of component $i$

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 inline comments to calculations done in GenericCombinerPerformanceModel
  • (optional) update all tests in test_generic_combiner.py to test new outputs
  • add a subtest in an integration test to test the outputs of the generic combiner (test the connection in H2IntegrateModel)
  • (if wanted from preliminary review) update commodity_units to commodity_rate_units in the GenericCombinerPerformanceConfig and GenericSplitterPerformanceConfig

Type of Reviewer Feedback Requested (on Draft PR)

Structural feedback:

Implementation feedback:

  • should commodity_units in the GenericCombinerPerformanceConfig be updated to commodity_rate_units to be consistent with other naming? This would also require making this naming update in the GenericSplitterPerformanceConfig and GenericSplitterPerformanceModel

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 has been updated to describe the changes made in this PR

Section 3: Related Issues

This PR completes a necessary step outlined in Issue #485

Section 4: Impacted Areas of the Software

Section 4.1: New Files

None

Section 4.2: Modified Files

  • h2integrate/core/h2integrate_model.py
    • H2IntegrateModel.connect_technologies(): added logic to connect added inputs if combiner in dest_tech.
  • h2integrate/transporters/generic_combiner.py
    • GenericCombinerPerformanceModel
      • setup(): added inputs for rated_commodity_production and capacity_factor and outputs for the combined rated_commodity_production and capacity_factor
      • compute(): added calculations to compute the combined rated_commodity_production and capacity_factor
  • h2integrate/transporters/test/test_generic_combiner.py
    • test_generic_combiner_performance_power: added subtests to test values of additional combined outputs

Section 5: Additional Supporting Information

Section 6: Test Results, if applicable

Section 7 (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

@johnjasa
Copy link
Collaborator

johnjasa commented Feb 5, 2026

should commodity_units in the GenericCombinerPerformanceConfig be updated to commodity_rate_units to be consistent with other naming? This would also require making this naming update in the GenericSplitterPerformanceConfig and GenericSplitterPerformanceModel

Yes, I think it should be updated in all places that you mention and any others where commodity_units are actually the commodity_rate_units imo. If I'm reading this correctly, the commodity_units in the combiner and splitters equal the commodity_amount_units in other places. Changing these names would reduce confusion in a positive way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review This PR is ready for input from folks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants