Skip to content

Helpful error messages when cell temperature heat transfer method is missing data#1086

Merged
mjprilliman merged 2 commits into
developfrom
tcell-exec-error
Nov 7, 2023
Merged

Helpful error messages when cell temperature heat transfer method is missing data#1086
mjprilliman merged 2 commits into
developfrom
tcell-exec-error

Conversation

@mjprilliman

Copy link
Copy Markdown
Collaborator

-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 NatLabRockies/SAM#1428

@mjprilliman mjprilliman added the pv photovoltaic, pvsam, pvwatts label Nov 3, 2023
@mjprilliman mjprilliman added this to the SAM Fall 2023 Release milestone Nov 3, 2023
@mjprilliman mjprilliman self-assigned this Nov 3, 2023
@mjprilliman

Copy link
Copy Markdown
Collaborator Author

@cpaulgilman review for error message.
@sjanzou review on if there is a better way of handling this error?

@cpaulgilman cpaulgilman left a comment

Copy link
Copy Markdown
Collaborator

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

@sjanzou sjanzou left a comment

Copy link
Copy Markdown
Collaborator

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 NatLabRockies/SAM#1223

Comment thread shared/lib_cec6par.cpp Outdated

// convert to kelvin
double TA = input.Tdry+273.15;
if (isnan(input.Patm)) {

Copy link
Copy Markdown
Collaborator

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 NatLabRockies/SAM#1223

Comment thread shared/lib_cec6par.cpp Outdated
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)) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::isnan()

Comment thread ssc/cmod_pvsamv1.cpp Outdated
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());

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

std::isnan please...

@sjanzou sjanzou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

added to release notes pv photovoltaic, pvsam, pvwatts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cell temperature equals ambient temperature when using weather file POA

3 participants