New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Helpful error messages when cell temperature heat transfer method is missing data #1086
Conversation
than use ambient temperature
@cpaulgilman review for error message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Here are weather files I used for testing with heat transfer cell temp model:
weather-files-for-heat-transfer-cell-temp-tests.zip
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change isnan to std::isnan throughout changes per NREL/SAM#1223
shared/lib_cec6par.cpp
Outdated
@@ -480,6 +480,11 @@ bool mcsp_celltemp_t::operator() ( pvinput_t &input, pvmodule_t &module, double | |||
|
|||
// convert to kelvin | |||
double TA = input.Tdry+273.15; | |||
if (isnan(input.Patm)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use std::isnan instead of isnan, see NREL/SAM#1223
shared/lib_cec6par.cpp
Outdated
@@ -505,6 +510,11 @@ bool mcsp_celltemp_t::operator() ( pvinput_t &input, pvmodule_t &module, double | |||
Fcs = 1. - Fcg; // !view factor between top of tilted plate and everything else (sky) | |||
Fbs = Fcg; // !view factor bewteen top and ground = bottom and sky | |||
Fbg = Fcs; // !view factor bewteen bottom and ground = top and sky | |||
if (isnan(input.Tdew)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::isnan()
ssc/cmod_pvsamv1.cpp
Outdated
@@ -2188,6 +2188,7 @@ void cm_pvsamv1::exec() | |||
tcell = Subarrays[nn]->customCellTempArray[inrec]; | |||
else { | |||
(*Subarrays[nn]->Module->cellTempModel)(in[nn], *Subarrays[nn]->Module->moduleModel, module_voltage, tcell); | |||
if (isnan(tcell)) throw exec_error("pvsamv1", Subarrays[nn]->Module->cellTempModel->error()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::isnan please...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating!
-Throw error in pvsamv1 when ambient pressure and dew point (or wet bulb) is missing from the weather file
-Make tcell nan when this happens to make sure calculation does not continue as normal
-Fixes NREL/SAM#1428