Skip to content

Sam 2105 use detailed batt w pvwatts#2113

Merged
brtietz merged 12 commits into
developfrom
SAM_2105_use_detailed_batt_w_pvwatts
Sep 24, 2025
Merged

Sam 2105 use detailed batt w pvwatts#2113
brtietz merged 12 commits into
developfrom
SAM_2105_use_detailed_batt_w_pvwatts

Conversation

@brtietz

@brtietz brtietz commented Sep 19, 2025

Copy link
Copy Markdown
Collaborator

Pull Request Template

Description

Changes:

  • Convert PVWatts to run in lifetime mode (UI and defaults)
  • Swap to detailed battery model for the PVWatts-Battery Configuration
  • Add FOM configurations for PVWatts-Battery
  • Version upgrade script for the above

Two areas where I could use help:

  1. The version upgrade script doesn't seem to be interpreting the battery chemistry and battery dispatch from the old pvwatts battery mode properly. These should be 0-1, and 0-2 respectively but I'm getting 3 for dispatch in my tests?
  2. The progress bar goes from 0 - 200% for these cases.

Fixes #753 and #2105

Corresponding branches and PRs:

Just SAM, develop for other repos.

Note that #2109 will require some additional defaults changes in these new files, depending on merge order.

Unit Test Impact:

Adds new configurations. Changes to lifetime mode mean defaults in test_results_win64 are expected.

Checklist

  • requires help revision and I added that label
  • adds, removes, modifies, or deletes variables in existing compute modules
  • adds a new compute module
  • changes defaults
  • I've tagged this PR to a milestone

Reminders- this section can be deleted

[Checking for PySAM Incompatible API Changes]
(https://github.com/NREL/SAM/wiki/PySAM-Incompatible-API-Changes-&-Regenerating-PySAM-Files).

  • Adds new configurations, new files generated

[When do the PySAM files need to be regenerated?]
(https://github.com/NREL/SAM/wiki/PySAM-Incompatible-API-Changes-&-Regenerating-PySAM-Files#when-do-the-pysam-files-need-to-be-regenerated-via-export_config)

@brtietz brtietz added this to the SAM Fall 2025 Release milestone Sep 19, 2025
@brtietz brtietz added enhancement pv pvsam1, pvwatts, hcpv battery requires help revision Requires a Help revision before releasing public version labels Sep 19, 2025
Confusing for developers for this to be hidden behind `batt_bank_duration`.
Use `oldvalue()` to load simple battery inputs because those inputs are not in new detailed config.

Add message to variables that are copied from old simple battery inputs.

Set battery size units to AC to be consistent with simple battery.

Replace `batt_bank_duration` with `batt_bank_size_ui` (note confusing widget `batt_bank_duration` was hidden under `batt_bank_size_UI`in UI)

Revise message text.

@cpaulgilman cpaulgilman 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.

Please change the navigation tree label from "PV" to "PVWatts" to distinguish between Detailed PV and PVWatts models and for consistency with Hybrid configurations.

@cpaulgilman

Copy link
Copy Markdown
Collaborator

@brtietz I made some changes to the Version Upgrade script to fix the problems you described and a couple of others. Please test and let me know if you notice other issues.

One unresolved item is that opening an old PVWatts-Battery file with lead acid battery does not correctly set the battery lifetime options. I think we want to load battery defaults for the chemistry and then apply the input from the old file, but not sure of the best way to do that.

Brian Mirletz added 3 commits September 24, 2025 09:47
…hat it sets up the chemistry properly based on the previous option choses in PVWatts-Battery
@brtietz

brtietz commented Sep 24, 2025

Copy link
Copy Markdown
Collaborator Author

@cpaulgilman Thanks for those fixes and feedback!

I pulled the appropriate code from the UI forms into the version upgrade script to fully handle the chemistry transition between lead acid flooded and Li-ion NMC. This seemed better than hardcoding the variables in cmod_battwatts, and trying to force the upgrade script and UI form to work together (which resulted in "on load" overwriting user values when I tried it). Does this seem reasonable to you?

I also found and fixed an error with the exclusive forms in the dispatch upgrades, and made the nav tree change you requested.

@cpaulgilman cpaulgilman 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.

Thanks for these changes. Navigation menu looks good, and battery defaults are consistent with battery type.

@brtietz brtietz merged commit d0c70b2 into develop Sep 24, 2025
8 checks passed
@cpaulgilman cpaulgilman removed the requires help revision Requires a Help revision before releasing public version label Jun 3, 2026
cpaulgilman added a commit that referenced this pull request Jun 9, 2026
… 2026 release (#2207)

* Remove wind cost model descriptions for #2154

* Fix help build issues

* Revise PV sizing topics for new PV UI design for #2135

* Clean up battery dispatch Help topics for #2115

* Revise Help for PVWatts detailed battery for #2113

* Update Help build instructions

* Consolidate battery Help topics

* Add description of load day of week input for #2109

Also fix Belpe annual growth rate widget overlap

* Revise degradation save lifetime outputs in Help for #2087

Also fix broken references in Electricity Load topic.

* Emphasis SRW is obsolete and fix format of weather file Help topics

* Add description of calculation to capacity payment Help topic.

* Revise Help for solar resource UI updates in #2120

* Clean up misc headings and broken links in Help

* Revise Help build instructions

* Fix broken welcome page Help link

* Revise Help for IPH system control copy TOD factors for #2024

Also fix TOU output fractions widget label for IPH "turbine output" to "heat sink output".

* Custom generation Help revisions for NatLabRockies/ssc#1384

* Clean up Help rates and load topics for NatLabRockies/ssc#1352
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

battery enhancement pv pvsam1, pvwatts, hcpv

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable Lifetime Mode for PVWatts

2 participants