Skip to content

Commit

Permalink
Check irradiance mode before using dni decomp in allen method (i.e. is
Browse files Browse the repository at this point in the history
code failing due to no dni provided)
  • Loading branch information
mjprilliman committed Feb 2, 2024
1 parent b6fa37d commit f118088
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ssc/cmod_pvsamv1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,10 @@ void cm_pvsamv1::exec()
if (!isnan(Irradiance->p_weatherFileDNI[idx])) {
PVSystem->p_DNIIndex[nn][idx] = (ssc_number_t)(Irradiance->p_weatherFileDNI[idx] / dni_cs);
}
else if (isnan(Irradiance->p_weatherFileDNI[idx]) && (radmode == irrad::DN_DF || radmode == irrad::DN_GH))
{
PVSystem->p_DNIIndex[nn][idx] = 0; //Simulation should exit when looking for DNI but no DNI found
}
else {
PVSystem->p_DNIIndex[nn][idx] = (ssc_number_t)(Irradiance->p_IrradianceCalculated[2][idx] / dni_cs);
}
Expand Down

0 comments on commit f118088

Please sign in to comment.