PVWatts albedo soiling checks and outputs#864
Conversation
Add albedo and soiling to time series results to facilitate troubleshooting. Fix albedo logic to correctly assign default 0.2 or 0.6 value depending on weather file albedo validity, snow model enabled, snow depth data.
Allow PySAM and SDK users to set default albedo (used when weather file and input albedo array both are invalid). Also clean up some variable meta labels.
janinefreeman
left a comment
There was a problem hiding this comment.
Having trouble compiling SAM at the moment, but have a few comments based on just reading the code. Will work on getting SAM building so I can test after you have a chance to look at these comments. Thanks again for putting this PR together!!!
| if (std::isfinite(wf.alb) && wf.alb > 0 && wf.alb < 1 && (albedo_len == 0 || use_wf_albedo)) | ||
| // check albedo is valid value between 0 and 1. if not, set to default value 0.2 | ||
| // if the snow loss model is enabled and there's valid snow depth > 0.5 cm, then set to 0.6 | ||
| if (alb <= 0 || alb >= 1) |
There was a problem hiding this comment.
If albedo_len is wrong, pvwatts will never use the snow value because the albedo default set in line 816 won't trigger this if statement. Suggest replacing line 816 with the contents of this if statement.
There was a problem hiding this comment.
Also note that there is a separate issue with the snow model: NatLabRockies/SAM#1137
|
|
||
| // conditions to use albedo from wf instead of albedo user input: | ||
| // * wf.alb exists and is valid and use_wf_albedo = 1 | ||
| // * wf.alb exists and is valid and use_wf_albedo = 0 and albedo_len = 0 |
There was a problem hiding this comment.
Is this the desired behavior? You can remind me if we discussed at a meeting and I forgot, but I would think that if use_wf_albedo = 0 and user-specified albedo is not defined, I would be expecting it to use internal defaults (or the defaults that I set via the SDK), even if albedo exists in the weather file.
There was a problem hiding this comment.
I agree with the behavior you describe. Fixed in 22acecb.
There was a problem hiding this comment.
Based on discussions at the 9/20/2022 SAM meeting, we agreed to simplify the albedo logic:
If use_wf_albedo is true, and wf albedo is available and valid, use wf albedo, otherwise use default albedo (snow or no snow, depending on snow depth and snow model enabled).
If use_wf_albedo is false, and user albedo is available and valid, use user albedo, otherwise use default albedo as above.
Fix logic so: 1. Correct default albedo (snow/no snow) is applied when albedo input array length is incorrect. 2. Default albedo is used when use_wf_albedo = 0 and albedo input is not defined: Never use weather file albedo when use_wf_albedo = 0.
sjanzou
left a comment
There was a problem hiding this comment.
Nice test addition and I could not break the logic!
Add albedo and soiling to time series results to facilitate troubleshooting.
Fix albedo logic to correctly assign default 0.2 or 0.6 value depending on weather file albedo validity, snow model enabled, snow depth data.
Goes with NatLabRockies/SAM#1136
Weather files for testing (snow/albedo, no albedo, mix of valid and invalid albedo):
albedo-test-wf.zip