Fix wind adjustment factor double-counting#1284
Conversation
Improve error messages
Time series adjustment factors (haf) are no longer limited to hourly.
There was a problem hiding this comment.
This works but the cmod_windpower compute module is extremely confusing... why is there a return statement in and if block on line 424? Seems like the Weibull model and the Wake model should be separated with an if else structure for easier debugging.
Also, the error message when using the 15min resource file and the hourly adjustment factors is a little confusing

Would it be clearer to use "resource file time steps" (for resource file inputs (wind_resource_model_choice = 0) instead of "simulation time steps"?
Also, same issue with the "wind resource probability table" case in the supplied "windpower-adj-test.sam" file:

There is an explicit simulation time steps of 8760 using the wind resource probability table option (wind_resource_model_choice = 2) on line 488 after the adjustment factors are setup:

For the Weibull resource input option (wind_resource_model_choice = 1), the nsteps is explicitly set to 8760 on line 394 in cmod_windpower:

I agree. I implemented this solution in a way that did not require restructuring the compute module. I think the double-counting of adjustment factors was originally caused by the confusing structure. |
|
All scenarios work well for me. Agree with @sjanzou that changing the error label to "resource file time steps" might be helpful, but not totally opposed to keeping "simulation time steps" in those error messages. @sjanzou agree that the wind compute module can be confusing and might do good with a refactor, but unfortunately we don't have funding for that right now. I think the return in the if chunk on line 424 can stay for now. ;) |
Yes. The number of time steps is set in several places and determined from the weather file in other places. Some functions appear to require 8760 time steps (e.g., Weibull distribution and wind resource probability table and possibly some wake model options), and others work with either hourly or subhourly time steps. The compute module should be restructured so that all functions support subhourly time steps to work with hourly and subhourly adjustment losses, and to work with subhourly financial model features like market prices, etc. |
I'll revise them to make them less confusing for users. |
Fix #1283
To test, run a default Wind / No Financial case with and without time series adjustment factors. The difference between the two runs should be the adjustment factor applied once, not twice as reported in #1283.
The adjustment factors should work correctly for the following combinations:
A simulation error should be generated with the wrong combination of wind data time step and loss time step.
The attached file has .sam file with cases set up for these tests and a 15-minute wind file:
windpower-adj-test.zip
This PR also fixes time series adjustment losses (
haf) indexed tohrinstead of time stepi: Subhourly loss supported as of NatLabRockies/SAM#1164.