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

Set default value for OpaqueSkyCover when missing #8612

Merged
merged 5 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/EnergyPlus/HeatBalanceKivaManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,20 @@ namespace EnergyPlus::HeatBalanceKivaManager {
Albedo,
LiquidPrecip);

// Checks for missing value
if (DryBulb >= 99.9) {
DryBulb = state.dataWeatherManager->Missing.DryBulb;
}
if (DewPoint >= 99.9) {
DewPoint = state.dataWeatherManager->Missing.DewPoint;
}
if (WindSpeed >= 999.0) {
WindSpeed = state.dataWeatherManager->Missing.WindSpd;
}
if (OpaqueSkyCover >= 99.0) {
OpaqueSkyCover = state.dataWeatherManager->Missing.OpaqSkyCvr;
}

Copy link
Member

Choose a reason for hiding this comment

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

No problem setting these to the predefined missing values.

kivaWeather.dryBulb.push_back(DryBulb);
kivaWeather.windSpeed.push_back(WindSpeed);

Expand Down
20 changes: 20 additions & 0 deletions tst/EnergyPlus/unit/HeatBalanceKivaManager.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

// EnergyPlus Headers
#include "Fixtures/EnergyPlusFixture.hh"
#include <EnergyPlus/ConfiguredFunctions.hh>
#include <EnergyPlus/Data/EnergyPlusData.hh>
#include <EnergyPlus/DataEnvironment.hh>
#include <EnergyPlus/DataGlobals.hh>
Expand All @@ -64,6 +65,7 @@
#include <EnergyPlus/HeatBalanceManager.hh>
#include <EnergyPlus/IOFiles.hh>
#include <EnergyPlus/ScheduleManager.hh>
#include <EnergyPlus/WeatherManager.hh>
#include <EnergyPlus/ZoneTempPredictorCorrector.hh>

namespace EnergyPlus {
Expand Down Expand Up @@ -257,4 +259,22 @@ TEST_F(EnergyPlusFixture, HeatBalanceKiva_SetInitialBCs)
EXPECT_NEAR(expectedResult4, zoneAssumedTemperature4 + DataGlobalConstants::KelvinConv, 0.001);
}

TEST_F(EnergyPlusFixture, OpaqueSkyCover_InterpretWeatherMissingOpaqueSkyCover) {

// DERIVED TYPE DEFINITIONS:
// SUBROUTINE LOCAL VARIABLE DECLARATIONS:

state->files.inputWeatherFileName.fileName = configured_source_directory() + "/tst/EnergyPlus/unit/Resources/HeatBalanceKivaManagerOSkyTest.epw";
state->dataWeatherManager->Missing.OpaqSkyCvr = 5;

HeatBalanceKivaManager::KivaManager km;
km.readWeatherData(*state);

Real64 TDewK = 264.25;
Real64 expected_OSky = 5;
Real64 expected_ESky = (0.787 + 0.764 * std::log(TDewK / DataGlobalConstants::KelvinConv)) * (1.0 + 0.0224 * expected_OSky - 0.0035 * pow_2(expected_OSky) + 0.00028 * pow_3(expected_OSky));;

EXPECT_NEAR(expected_ESky, km.kivaWeather.skyEmissivity[0], 0.01);
}
Copy link
Member

Choose a reason for hiding this comment

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

👍


} // namespace EnergyPlus
Loading