-
Notifications
You must be signed in to change notification settings - Fork 389
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
Fix opaque cloud cover #8762
Fix opaque cloud cover #8762
Changes from all commits
b630b33
84bcd5f
56208ce
8252c8f
35776fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -364,6 +364,10 @@ | |
|
||
Output:Variable,*,Site Outdoor Air Drybulb Temperature,hourly; | ||
|
||
Output:Variable,*,Site Total Sky Cover,hourly; | ||
|
||
Output:Variable,*,Site Opaque Sky Cover,hourly; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally these would be added to the develop branch in a separate PR so you could see the diffs. But that's a lot of extra work, and the fix here is pretty obvious. Either way it's good to add them here at least. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks! @Myoldmopar Since the testfiles' changes are in the last two commits, I can easily revert to the commit before the one before that (actually already did it locally and ready to push if needed). Then after merging of this one I can add back the two last ones in a new PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's necessary. This is an obvious fix, and adding the output variables to the IDFs is a nice bonus over the unit test. I think this is already ready to go. CI looks good too, with just the new output variables causing "diffs". I still need to run it locally but I think it's good. |
||
Output:Variable,*,Site Daylight Saving Time Status,daily; | ||
|
||
Output:Variable,*,Site Day Type Index,daily; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1148,3 +1148,113 @@ TEST_F(EnergyPlusFixture, Add_and_InterpolateWeatherInputOutputTest) | |
Real64 expected_SkyTemp = -20.8188538296; | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowSkyTemp(2, 1), expected_SkyTemp, 1e-6); | ||
} | ||
|
||
// Test for Issue 8760: fix opaque sky cover weather values; | ||
TEST_F(EnergyPlusFixture, Fix_OpaqueSkyCover_Test) | ||
{ | ||
std::string const idf_objects = delimited_string({ | ||
"Timestep,4;" | ||
|
||
"SimulationControl,", | ||
" Yes, !- Do Zone Sizing Calculation", | ||
" Yes, !- Do System Sizing Calculation", | ||
" No, !- Do Plant Sizing Calculation", | ||
" Yes, !- Run Simulation for Sizing Periods", | ||
" No; !- Run Simulation for Weather File Run Periods", | ||
|
||
"RunPeriod,", | ||
" January, !- Name", | ||
" 1, !- Begin Month", | ||
" 1, !- Begin Day of Month", | ||
" , !- Begin Year", | ||
" 1, !- End Month", | ||
" 31, !- End Day of Month", | ||
" , !- End Year", | ||
" Tuesday, !- Day of Week for Start Day", | ||
" Yes, !- Use Weather File Holidays and Special Days", | ||
" Yes, !- Use Weather File Daylight Saving Period", | ||
" No, !- Apply Weekend Holiday Rule", | ||
" Yes, !- Use Weather File Rain Indicators", | ||
" Yes; !- Use Weather File Snow Indicators", | ||
|
||
"Site:Location,", | ||
" Univ_Of_Illinois_725315, !- Name", | ||
" 40.06, !- Latitude {deg}", | ||
" -88.37, !- Longitude {deg}", | ||
" -6.0, !- Time Zone {hr}", | ||
" 213.0; !- Elevation {m}", | ||
|
||
"Output:Variable,*,Site Total Sky Cover,Timestep;", | ||
"Output:Variable,*,Site Opaque Sky Cover,Timestep;", | ||
}); | ||
|
||
ASSERT_TRUE(process_idf(idf_objects)); | ||
|
||
SimulationManager::PostIPProcessing(*state); | ||
bool ErrorsFound(false); | ||
ErrorsFound = false; | ||
|
||
state->dataWeatherManager->WeatherFileExists = true; | ||
state->files.inputWeatherFileName.fileName = configured_source_directory() + "/weather/USA_IL_University.of.Illinois-Willard.AP.725315_TMY3.epw"; | ||
|
||
state->dataGlobal->BeginSimFlag = true; | ||
SimulationManager::GetProjectData(*state); | ||
|
||
bool Available(true); | ||
Available = true; | ||
|
||
state->dataGlobal->BeginSimFlag = true; | ||
WeatherManager::GetNextEnvironment(*state, Available, ErrorsFound); | ||
|
||
// Test get output variables for Total Sky Cover and Opaque Sky Cover | ||
EXPECT_EQ("Site Total Sky Cover", state->dataOutputProcessor->RVariableTypes(1).VarNameOnly); | ||
EXPECT_EQ("Environment:Site Total Sky Cover", state->dataOutputProcessor->RVariableTypes(1).VarName); | ||
EXPECT_EQ("Site Opaque Sky Cover", state->dataOutputProcessor->RVariableTypes(2).VarNameOnly); | ||
EXPECT_EQ("Environment:Site Opaque Sky Cover", state->dataOutputProcessor->RVariableTypes(2).VarName); | ||
|
||
EXPECT_EQ(7, state->dataOutputProcessor->RVariableTypes(1).ReportID); | ||
EXPECT_EQ(8, state->dataOutputProcessor->RVariableTypes(2).ReportID); | ||
|
||
state->dataWeatherManager->Envrn = 1; | ||
|
||
state->dataGlobal->NumOfTimeStepInHour = 4; | ||
state->dataWeatherManager->Environment.allocate(1); | ||
state->dataWeatherManager->Environment(1).SkyTempModel = EmissivityCalcType::ClarkAllenModel; | ||
state->dataWeatherManager->Environment(1).StartMonth = 1; | ||
state->dataWeatherManager->Environment(1).StartDay = 1; | ||
|
||
state->dataWeatherManager->Environment(1).UseWeatherFileHorizontalIR = false; | ||
|
||
AllocateWeatherData(*state); | ||
OpenWeatherFile(*state, ErrorsFound); | ||
ReadWeatherForDay(*state, 1, 1, true); | ||
|
||
// Test additional set of weather data on sky temp calc | ||
Real64 expected_SkyTemp = -1.7901122977770569; | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowSkyTemp(2, 1), expected_SkyTemp, 1e-6); | ||
|
||
// Test Total Sky Cover and Opaque Sky Cover | ||
Real64 expected_TSC = 9; | ||
Real64 expected_OSC = 8; | ||
|
||
EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(4, 3), expected_TSC, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(4, 3), expected_OSC, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(3, 3), 9.25, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(3, 3), 8.25, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(2, 3), 9.5, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(2, 3), 8.5, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(1, 3), 9.75, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(1, 3), 8.75, 1e-6); | ||
|
||
expected_TSC = 8; | ||
expected_OSC = 8; | ||
|
||
EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(4, 4), expected_TSC, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(4, 4), expected_OSC, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(3, 4), 8.25, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(3, 4), 8.00, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(2, 4), 8.50, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(2, 4), 8.00, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowTotalSkyCover(1, 4), 8.75, 1e-6); | ||
EXPECT_NEAR(state->dataWeatherManager->TomorrowOpaqueSkyCover(1, 4), 8.00, 1e-6); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. 👍 |
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.
Yeah great fix!