Skip to content

Nonannual-example - #6

Open
jaredthomas68 wants to merge 28 commits into
nonannual-frameworkfrom
nonannual
Open

jaredthomas68 wants to merge 28 commits into
nonannual-frameworkfrom
nonannual

Conversation

@jaredthomas68

@jaredthomas68 jaredthomas68 commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

Apply non-annual simulation support to models and add Example 24 demo

This PR is the fourth and final in the stack enabling non-annual simulatios in H2Integrate (built on top of the framework annualization and duration-bounds checks in #, which itself builds on NatLabRockies#893, which followed on NatLabRockies#897).

Key changes:

  1. Model adoption of non-annual annualization:
    • Updates PYSAMSolarPlantPerformanceModel, GridPerformanceModel, StoragePerformanceBase, and DemandComponentBase to project annual capacity factor, annual production, and stack replacement schedules using calculate_annual_cf_and_replacement_schedule().
    • Updates GridCostModel to annualize timestep buy and sell costs using calculate_annual_varopex().
    • Updates DemandOpenLoopStorageController to handle arbitrary time steps by converting energy capacity headroom to charge/discharge rates using the timestep interval.
  2. Simulation duration bounds widening:
    • Widen _simulation_duration_bounds from annual-only to (0.0, float("inf")) on validated concrete models: PYSAMSolarPlantPerformanceModel, ATBUtilityPVCostModel, StoragePerformanceModel, ATBBatteryCostModel, DemandOpenLoopStorageController, GenericDemandComponent, GridPerformanceModel, GridCostModel, CablePerformanceModel, and GenericCombinerPerformanceModel.
  3. Example 24 demonstration & tests:
    • Updates Example 24 (solar_battery_grid) to demonstrate sub-annual (half-year at 15-min), annual (1-year at 1-hour), and multi-year (2-year at 3-hour) simulations with solar resource resampling.
    • Adds test_24_solar_battery_grid_non_annual integration regression test verifying sub-annual runs and plant-life CF projection.

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 8: New Model Checklist (if applicable)

TODO:

  • Adopt core annualization helpers across solar, grid, storage, and demand models
  • Widen _simulation_duration_bounds on validated concrete models
  • Update Example 24 runner to demonstrate half-year, annual, and two-year variants
  • Add non-annual integration test in test_all_examples.py

Type of Reviewer Feedback Requested (on Draft PR)

Implementation feedback:

  • Adoption of calculate_annual_cf_and_replacement_schedule and calculate_annual_varopex across grid, solar, storage, and demand models
  • Handling of non-hourly rate-to-amount conversions in storage open-loop controller
  • Example 24: clarity and usefulness

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)
      • Example 24 demonstrates sub-annual and multi-year simulation runs with up- and downsampling.
  • CHANGELOG.md
    • At least one complete sentence has been provided to describe the changes made in this PR
    • [.] Hyperlink provided to PR

Section 4: Related Issues

Resolves H2Integrate NatLabRockies#204

Section 5: Impacted Areas of the Software

Section 5.1: New Files

  • resource_files/solar/30.6617_-101.7096_psmv3_60_2014.csv
    • Solar resource file supporting multi-year test cases in test_pysam_solar.py.

Section 5.2: Modified Files

  • h2integrate/converters/solar/solar_pysam.py
    • Uses calculate_annual_cf_and_replacement_schedule() for non-annual horizons and widens duration bounds.
  • h2integrate/converters/solar/atb_utility_pv_cost.py
    • Widens duration and timestep bounds for duration-independent ATB PV cost model.
  • h2integrate/converters/grid/grid.py
    • Adopts calculate_annual_cf_and_replacement_schedule() and calculate_annual_varopex(); widens duration bounds.
  • h2integrate/demand/demand_baseclass.py & generic_demand.py
    • Uses annualization helper for demand commodity output; widens duration bounds on GenericDemandComponent.
  • h2integrate/storage/storage_baseclass.py & storage_performance_model.py
    • Uses annualization helper for storage net and standard capacity factors; widens duration bounds on StoragePerformanceModel.
  • h2integrate/storage/battery/atb_battery_cost.py
    • Widens duration bounds for duration-independent ATB battery cost model.
  • h2integrate/control/control_strategies/storage/demand_openloop_storage_controller.py
    • Converts headroom amounts to rates using dt_amount; widens duration bounds.
  • h2integrate/transporters/cable.py & generic_combiner.py
    • Widens duration bounds on passive electricity transport/combiner components.
  • examples/24_solar_battery_grid/ (run_solar_battery_grid.py, plant_config.yaml)
    • Configures and runs half-year (15-min), annual (1-hr), and two-year (3-hr) simulation variants.
  • examples/test/test_all_examples.py
    • Updates baseline checks for Example 24 and adds test_24_solar_battery_grid_non_annual.
  • h2integrate/converters/solar/test/test_pysam_solar.py
    • Adds test cases validating PySAM solar model behavior on non-annual horizons.

Section 6: Additional Supporting Information

Completes the non-annual simulation feature stack (NatLabRockies#897> -> NatLabRockies#893 -> # -> this PR).

Section 7: Test Results, if applicable

Targeted solar, grid, storage, demand, and example integration tests all pass.

@jaredthomas68
jaredthomas68 changed the base branch from nonannual-resource to nonannual-framework October 8, 2026 22:31
@jaredthomas68
jaredthomas68 added this pull request to stack #8 October 8, 2026 22:31
@jaredthomas68 jaredthomas68 changed the title Nonannual Nonannual-example Oct 8, 2026
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.

1 participant