Repository navigation
Nonannual - #936
Nonannual#936jaredthomas68 wants to merge 38 commits into
Conversation
…ent schedule for non-annual simulation
| @@ -512,16 +511,35 @@ def compute(self, inputs, outputs, discrete_inputs, discrete_outputs): | |||
| ) | |||
|
|
|||
There was a problem hiding this comment.
Preliminary thoughts I wanted to share real quick (I've only looked at this file):
I've thought about how the multi-year resource could work with pysam solar when it is using lifetime outputs - and I think I attempted here. Should we enable that? Or throw an error if it's using lifetime performance (includes degradation) with multi-year resource?
Additionally, I've noticed that PySAM solar will remove a leap day even if it's included in the resource data. If the resource data includes leap day data (suppose it's 8784), then the pysam output data will be 8760. I'm curious about how this should be handled - because it someone has a simulation length of 8784 then the fraction of year simulated will be > 1, but the pysam output profile would only be 8760. Also - if pysam removes the leap day, I think we should see if it removes the actual leap day or if it removes the last day of the resource data.
| 3600, | ||
| 3600, | ||
| 900, | ||
| 14400, |
There was a problem hiding this comment.
can pysam solar really be run with 4 hour periods?
Enable non-annual solar, storage, grid, and demand simulations
Adapt the models used by the solar/battery/grid example to support sub-annual and multi-year
simulation horizons and non-hourly timesteps. The updated models explicitly declare compatible
simulation durations and use the shared annualization helpers introduced by the framework PR (#934).
PySAM solar supports timesteps from 15 minutes to 4 hours and computes projected annual
production/capacity factors for non-annual horizons without relying on PySAM's unavailable
ac_annualoutput. The existing annual-output path is retained for a nominal one-year run.Grid and demand models project annual production and capacity factors across plant life;
grid costs annualize per-timestep purchases and sales. Storage dispatch converts between rates
and stored amounts using the timestep, and storage outputs distinguish net capacity factor from
the discharge-only standard capacity factor.
Example 24 now runs three configurations and prints a comparison of energy, capacity factors,
load service, curtailment, and LCOE:
half_yearannualtwo_yearThis is PR #936, the third PR in the
nonannual-resource->nonannual-framework->nonannualstack. It depends onPR #934 and is reviewed relative to
nonannual-framework. Resource resampling belongs toPR #933; shared duration validation,
annualization helpers, and ProFAST conversions belong to #934. This PR applies those capabilities
to concrete models and demonstrates them together.
Section 1: Type of Contribution
Section 2: Draft PR Checklist
TODO:
Type of Reviewer Feedback Requested (on Draft PR)
Structural feedback:
Implementation feedback: PySAM non-annual output handling, grid costs and annual energy,
demand rated-production/zero-demand handling, and timestep-aware storage charge/discharge limits.
Other feedback: Clarity of Example 24's three variants, reported storage metrics, and the
distinction between simulated-horizon energy and projected annual financial inputs.
Section 3: General PR Checklist
docs/files are up-to-date, or added when necessary: N/A; example-led changes.CHANGELOG.md"A complete thought. [PR XYZ]((https://github.com/NatLabRockies/H2Integrate/pull/XYZ)", where
XYZshould be replaced with the actual number.New-model checklist: N/A. The checked test item refers to the local
checks in Section 7; full repository CI and remote documentation checks remain unverified.
Section 4: Related Issues
Related to #204 through concrete model
support for variable simulation durations. This PR enables the solar/battery/grid workflow;
it does not claim all models now support arbitrary durations or independent timesteps.
Depends on PR #934, which in turn depends
on PR #933.
Section 5: Impacted Areas of the Software
Section 5.1: New Files
resource_files/solar/30.6617_-101.7096_psmv3_60_2014.csv: Add hourly solar resource data forthe extended solar regression scenarios.
Section 5.2: Modified Files
examples/24_solar_battery_grid/plant_config.yaml: Update resource and simulation settingsused by the non-annual demonstration.
examples/24_solar_battery_grid/run_solar_battery_grid.py: Run half-year, annual, and two-yearvariants with isolated configuration copies and print a comparison table.
examples/test/test_all_examples.py: Extend annual storage checks and add an end-to-endnon-annual Example 24 test.
h2integrate/converters/solar/solar_pysam.py: Widen timestep/duration bounds and computenon-annual production/capacity factors using the shared framework projection.
h2integrate/converters/solar/atb_utility_pv_cost.py: Declare compatible non-annual durationsand 15-minute to 4-hour timesteps.
h2integrate/converters/solar/test/test_pysam_solar.py: Add non-annual PySAM horizon coverage.h2integrate/converters/grid/grid.py: Widen model bounds and annualize production, sales,purchase costs, and sale revenues across plant life.
h2integrate/demand/demand_baseclass.py: Use peak demand as rated production, handle zerodemand, and project annual production/capacity factors with commodity-unit conversion.
h2integrate/demand/generic_demand.py: Opt the generic demand component into non-annual runs.h2integrate/storage/storage_baseclass.py: Extend timestep bounds and project net versusdischarge-only capacity factors and annual discharge.
h2integrate/storage/storage_performance_model.py: Opt into non-annual runs and permittimesteps up to one day.
h2integrate/storage/battery/atb_battery_cost.py: Widen timestep and duration compatibilityfor the capacity/rate-based battery cost model.
h2integrate/control/control_strategies/storage/demand_openloop_storage_controller.py: Optinto non-annual runs and use timestep-aware stored amounts and charge/discharge limits.
h2integrate/transporters/cable.py: Declare non-annual duration compatibility.h2integrate/transporters/generic_combiner.py: Declare non-annual duration compatibility.h2integrate/resource/utilities/time_tools.py: Clarify explicit interpolation/aggregationmethod examples in the resampling docstring.
h2integrate/resource/utilities/test/test_time_tools.py: Extend resampling test compatibility.Section 6: Additional Supporting Information
the framework's annual-only fallback; duration support does not override timestep bounds.
inputs. Resource calendar-year length and leap-day handling remain separate concerns.
dt. Projected annual outputsuse the inherited framework helpers rather than treating the entire simulated horizon as
a single repeated year.
capacity_factorreflects net contribution, whilestandard_capacity_factorreflects discharge-only storage service.timeinterpolationfor the half-year variant and
meanaggregation for the two-year variant.Section 7: Test Results, if applicable
Local verification on
nonannual:storage performance/sizing, battery costs, open-loop storage control/integration, and
resource timestep utilities.
half_yearannualtwo_yearVerification commands:
Section 8 (Optional): New Model Checklist
N/A; existing models are adapted, with no new registered model. The checklist is retained.
docs/developer_guide/coding_guidelines.md{ModelName}Config, where{ModelName}is the complete model class name registered with@registerattrsclass to define theConfigto load in attributes for the modelBaseConfigorCostModelBaseConfiginitialize()method,setup()method,compute()methodPerformanceModelBaseClassandCostModelBaseClass__init__.pyfile so it can be imported from its subpackage@registerfromh2integrate/core/supported_models.pytest_all_examples.pydocs/section_toc.ymldocs/_static/class_hierarchy.htmlby doing one of the below options:docsfolder and runsh build_book.shgenerate_class_hierarchy.pyto update the class hierarchy diagram indocs/developer_guide/class_structure.md. You may need to delete the_autosummaryfolder before doing this.