Skip to content

Ssc 1300 wind lifetime mode#1386

Open
brtietz wants to merge 2 commits intossc_1378_custom_generation_lifetimefrom
ssc_1300_wind_lifetime_mode
Open

Ssc 1300 wind lifetime mode#1386
brtietz wants to merge 2 commits intossc_1378_custom_generation_lifetimefrom
ssc_1300_wind_lifetime_mode

Conversation

@brtietz
Copy link
Copy Markdown
Collaborator

@brtietz brtietz commented Apr 11, 2026

Pull Request Template

Description

Adds lifetime mode to windpower. In addition to the obvious for loops, required updating the data provider with a rewind function. This reads in the file at the start of the simulation and references arrays, more similar to PV. AI disclosure: Claude Sonnet assisted with the rewind function.

Note that the weather file mode for wind is slower by a linear factor of analysis period length. Open to changing that prior to merging if we prefer a different approach to applying degradation. This would impact year 1 vs lifetime outputs.

Fixes #1300

Corresponding branches and PRs:

SAM PR tbd. Develop of other repos.

Unit Test Impact:

New wind lifetime tests. No other changes 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).

[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)

@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 24285419571

Coverage increased (+0.007%) to 56.282%

Details

  • Coverage increased (+0.007%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 101 coverage regressions across 2 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

101 previously-covered lines in 2 files lost coverage.

File Lines Losing Coverage Coverage
ssc/ssc/cmod_windpower.cpp 53 86.87%
ssc/shared/lib_windfile.cpp 48 62.07%

Coverage Stats

Coverage Status
Relevant Lines: 121196
Covered Lines: 68212
Line Coverage: 56.28%
Coverage Strength: 3479920.55 hits per line

💛 - Coveralls

Copy link
Copy Markdown
Collaborator

@cpaulgilman cpaulgilman left a comment

Choose a reason for hiding this comment

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

Degradation does not appear to be applied correctly.

Results for default Wind Power / Single Owner case with 5% AC degradation rate lifetime simulation:

Image

Compare to SAM 2025.4.15 r1 single year simulation:

Image

@brtietz
Copy link
Copy Markdown
Collaborator Author

brtietz commented Apr 13, 2026

Degradation does not appear to be applied correctly.

Thanks for flagging this. I grabbed the code from PVWatts, which applies the degradation linearly:

degradationFactor.push_back(1.0 - (ac_degradation[0] * y) / 100.0);

The code in the released version applies degradation exponentially:

for (i = 1; i <= nyears; i++) cf.at(CF_degradation, i) = pow((1.0 - degrad[0] / 100.0), i - 1);

Looks like I used the exponential convention for custom generation profile as well:

sys_degradation.push_back((ssc_number_t)pow((1.0 - (double)degrad[0] / 100.0), i));

Just to confirm/establish a convention here: DC degradation for PV is linear, but for all other models AC degradation is exponential. Is that what we want? (if so I'll want to adjust some version upgrade messaging around the PVWatts changes for this version)

@brtietz
Copy link
Copy Markdown
Collaborator Author

brtietz commented Apr 13, 2026

I pulled up some papers to help inform this decision. The curves in https://www.sciencedirect.com/science/article/pii/S0360544225017840 and https://papers.phmsociety.org/index.php/phme/article/download/3328/1939 look pretty linear. ATB assumes that O&M will counteract degradation, which is unhelpful here.

@janinefreeman is there an NLR wind person you'd recommend asking about this?

@janinefreeman
Copy link
Copy Markdown
Collaborator

I've messaged a wind person to ask for the right name and I'll send you a Teams message. It does seem weird to me that DC degradation would be linear but it also rings a bell, is there an old issue that might illuminate that decision somewhere?

@brtietz
Copy link
Copy Markdown
Collaborator Author

brtietz commented Apr 15, 2026

I've messaged a wind person to ask for the right name and I'll send you a Teams message. It does seem weird to me that DC degradation would be linear but it also rings a bell, is there an old issue that might illuminate that decision somewhere?

Thanks! See #503 for some of the PV background.

@cpaulgilman
Copy link
Copy Markdown
Collaborator

I've messaged a wind person to ask for the right name and I'll send you a Teams message. It does seem weird to me that DC degradation would be linear but it also rings a bell, is there an old issue that might illuminate that decision somewhere?

Thanks! See #503 for some of the PV background.

Regarding PV degradation, I did a quick search on the PVPMC Modeling Steps and pvlib websites and did not see mention of annual DC degradation there.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants