Closed caseyzak24 closed 4 years ago
@caseyzak24 thanks for bringing this up. I think I noticed this same issue in some other work I was doing on a branch called "seedldrd" and fixed this already- I can make sure to merge that in for our next release so this can be taken care of. If you get a chance to take a look at this file on that branch and confirm that it fixes the problem, that would be great, if not, no worries.
Thanks!
@janinefreeman thanks for the quick response. I took a look at that branch and unless I am mistaken nrec
would still remain zero if only POA is provided, which is the cause of the error. In the conditional that handles the POA-only scenario there needs to be some sort of statement like the nrec = value->num.length();
that is in the other conditionals because nrec
determines the number of rows/records that are pulled from the given data container
When providing weather data to an ssc container via the
solar_resource_data
variable, the simulation will fail if the only irradiance data provided is POA. This is particularly problematic because when trying to model real-system performance, POA may be the only irradiance component available.Based on the fact that I can successfully use the SAM UI to model a system with POA data, I don't think
solar_resource_file
experiences the same issue.To Reproduce Using PySSC we created a data container,
wfd
, with the following columns:We assigned this container to our simulation container along with additional pertinent parameters:
The simulation fails with the following:
I've tracked down the issue to a poorly designed conditional in
weatherdata
incommon.cpp
(~line 776):If one of the typical irradiance components isn't present (GHI, DNI, DHI), the variable
nrec
remains zero and causes the error.I'm happy to submit a PR for this but it will be a while before I get to it and I wanted to bring it up in case someone else can take it on
WORKAROUND PRIOR TO FIX If you need to use POA data, make sure that your weather container has a
gh
array (it can be an array of zeros) and the simulation will work as expected.