Skip to content
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

Add capability of deriving sky temperature from weather file horizontal infrared radiation #492

Merged
merged 4 commits into from
Jul 2, 2024

Conversation

chipbarnaby
Copy link
Contributor

@chipbarnaby chipbarnaby commented Jun 4, 2024

Description

By default, CSE derives sky temperature from total sky cover, dry-bulb temperature, and dew-point temperature using the Berdahl-Martin model.

This PR adds the capability of deriving sky temperature from horizontal infrared radiation available in (some) EPW files. The capability is preliminary -- missing weatherfile IR data is not detected / diagnosed.

Added an IRHORIZ case to test file wthr01.cse.

Updated documentation.

@chipbarnaby chipbarnaby marked this pull request as draft June 4, 2024 18:45
@chipbarnaby chipbarnaby requested a review from nealkruis June 4, 2024 18:46
@chipbarnaby chipbarnaby marked this pull request as ready for review July 1, 2024 21:18
@chipbarnaby chipbarnaby marked this pull request as draft July 1, 2024 21:25
@chipbarnaby chipbarnaby marked this pull request as ready for review July 2, 2024 14:07
Copy link
Contributor

@nealkruis nealkruis left a comment

Choose a reason for hiding this comment

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

Code looks fine. Just some clean up of testing/debugging/experimenting needed.

@@ -532,6 +532,7 @@ DEFAULT, Default: tSky from weather file if available else Berdahl-Martin
BERDAHLMARTIN, Berdahl-Martin (tSky depends on dew point, cloud cover, and hour)
DRYBULB, tSky = dry-bulb temperature (for testing)
BLAST, Blast model (tSky depends on dry-bulb)
IRHORIZ, Experimental model that derives tSky for horizonal infrared data from the weather file (available on some EPW files only)
Copy link
Contributor

Choose a reason for hiding this comment

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

It's not experimental once it's merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. Reworded.
  2. I don't agree that there can be no experimental models in merged code. New stuff has to be merged to allow external users to test.

Comment on lines +387 to +406
//--------------------------------------------------------------------------
#if defined( _DEBUG)
void WDHR::wd_WriteCSV( // data writer for ad-hoc exports
int jDayST,
int iH) const
{
static FILE* pF = NULL; // file
if (!pF)
{
const char* fName = "wdhr.csv";
pF = fopen(fName, "wt");
if (pF)
fprintf(pF, "doy,hr,tdb,dni,dhi,ghi\n");
}
if (pF)
fprintf(pF, "%d,%d,%0.1f,%0.1f,%0.1f,%0.1f\n",
jDayST, iH, wd_db, wd_DNI, wd_DHI, wd_glrad);

} // WDHR::wd_WriteCSV
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Not clear what this is or if it's intended to be merged. Looks like temporary test code?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Left for possible future use.

src/wfpak.cpp Outdated
Comment on lines 3096 to 3107
#if 0
// sky temp experiment
float tSkyIR = DegRtoF(pow( IrSItoIP( irhoriz)/sigmaSB, 0.25));
float tSkyIR = DegRtoF(pow( IrSItoIP( irHoriz)/sigmaSB, 0.25));
static FILE* pF = NULL; // file
if (!pF)
{
const char* fName = "tSky.csv";
pF = fopen(fName, "wt");
fprintf(pF, "yr,mon,day,hr,osc,tsc,tSky_CSE,tSky_IR\n");
fprintf(pF, "yr,mon,day,hr,osc,tsc,tSky_CSE (F),tSky_IR (F)\n");
}
fprintf(pF, "%d,%d,%d,%d,%0.1f,%0.1f,%0.1f,%0.1f\n", yr, m, d, h, osc, tsc, wd_tSky, tSkyIR);
#endif
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this still an experiment? I imagine this can all be deleted now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated this code and left it in. We are not yet done with testing sky models.

@chipbarnaby chipbarnaby merged commit 943ca98 into main Jul 2, 2024
3 of 4 checks passed
@chipbarnaby chipbarnaby deleted the irskytemp branch July 2, 2024 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants