Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/NREL/EnergyPlus into Ste…
Browse files Browse the repository at this point in the history
…amPart1Followup
  • Loading branch information
dareumnam committed Sep 19, 2023
2 parents 1dfc9d1 + d9ae79e commit 5a963be
Show file tree
Hide file tree
Showing 12 changed files with 206 additions and 70 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ cmake_policy(SET CMP0048 NEW) # handling project_version_* variables
project(EnergyPlus)

# Raise an error if attempting to compile on macOS older than 10.15 - it does not work
if (APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.15")
message(FATAL_ERROR "The minimum required version for macOS is 10.15, however CMAKE_OSX_DEPLOYMENT_TARGET is set to ${CMAKE_OSX_DEPLOYMENT_TARGET}. Please set CMAKE_OSX_DEPLOYMENT_TARGET to 10.15 or greater and try again.")
if (APPLE)
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET not set. Please set CMAKE_OSX_DEPLOYMENT_TARGET to 10.15 or greater and try again.")
elseif (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.15")
message(FATAL_ERROR "The minimum required version for macOS is 10.15, however CMAKE_OSX_DEPLOYMENT_TARGET is set to ${CMAKE_OSX_DEPLOYMENT_TARGET}.")
endif()
endif()

if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER "3.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3341,7 +3341,7 @@ \subsubsection{Surface Inside Face Conduction Heat Loss Rate {[}W{]}}\label{surf

These ``inside face conduction'' output variables describe heat flow by conduction right at the inside face of an opaque heat transfer surface. A positive value means that the conduction is from just inside the inside face toward the inside face. A negative value means that the conduction is from the inside face into the core of the heat transfer surface.

Note that Inside Face Conduction, when positive, does \textbf{not} indicate the heat flow from the surface to the zone air, which is governed by the inside face convection coefficient and the difference in temperature between the inside face and the zone air.
Note that Inside Face Conduction, when positive, does \textbf{not} necessarily indicate the heat flow from the surface to the zone air, which is governed by the inside face convection coefficient, the difference in temperature between the inside face and the zone air, and various radiation terms due to solar, internal gains, and radiant exchange with other surfaces in the zone.

Different versions of the reports are available. The basic heat gain rate (W) and a per unit area flux (W/m\(^{2}\)) can have positive or negative values with the sign convention that positive indicates heat flowing toward the face itself. There are also directed ``gain'' and ``loss'' versions that have only positive values or zero when the heat flow direction opposes.

Expand All @@ -3359,7 +3359,9 @@ \subsubsection{Surface Outside Face Conduction Heat Loss Rate {[}W{]}}\label{sur

These ``outside face conduction'' output variables describe heat flow by conduction right at the outside face of an opaque heat transfer surface. A positive value means that the conduction is from just inside the outside face toward the outside face. A negative value means that the conduction is from the outside face into the core of the heat transfer surface.

Note that outside face conduction, when positive, does \textbf{not} indicate the heat flow from the surface to the surrounding air, which is governed by the outside face convection coefficient and the difference in temperature between the inside face and the surrounding air.
Note that outside face conduction, when positive, does \textbf{not} necessarily indicate the heat flow from the surface to the surrounding air, due to the fact that there could be various terms such as convection and/or radiation terms based on whatever is the ''outside'' environment for this surface.

When the surface in question is a partition, the output for this variable is set to zero because there is no outside face because the surface is fully exposed to the zone. When the surface is an interzone partition, the value will be non-zero because there will potentially be conduction into or out of the zone on the other side at this surface.

Different versions of the reports are available. The basic heat transfer rate (W) and a per unit area flux (W/m\(^{2}\)) can have positive or negative values with the sign convention that positive indicates heat flowing toward the face itself. There are also directed ``gain'' and ``loss'' versions that have only positive values or zero when the heat flow direction opposes.

Expand Down
2 changes: 0 additions & 2 deletions src/EnergyPlus/HeatBalanceSurfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5178,8 +5178,6 @@ void UpdateThermalHistories(EnergyPlusData &state)
state.dataHeatBalFanSys->CTFTuserConstPart(SurfNum);
}

if (surface.ExtBoundCond > 0) continue; // Don't need to evaluate outside for partitions

// Set current outside flux:
if (construct.SourceSinkPresent) {
state.dataHeatBalSurf->SurfOutsideFluxHist(1)(SurfNum) =
Expand Down
7 changes: 6 additions & 1 deletion src/EnergyPlus/OutputProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3154,6 +3154,7 @@ namespace OutputProcessor {
state.dataGlobal->DayOfSim,
state.dataEnvrn->CurEnvirNum,
state.dataGlobal->CalendarYear,
state.dataEnvrn->CurrentYearIsLeapYear,
Month,
DayOfMonth,
Hour,
Expand Down Expand Up @@ -3182,6 +3183,7 @@ namespace OutputProcessor {
state.dataGlobal->DayOfSim,
state.dataEnvrn->CurEnvirNum,
state.dataGlobal->CalendarYear,
state.dataEnvrn->CurrentYearIsLeapYear,
Month,
DayOfMonth,
Hour,
Expand All @@ -3207,6 +3209,7 @@ namespace OutputProcessor {
state.dataGlobal->DayOfSim,
state.dataEnvrn->CurEnvirNum,
state.dataGlobal->CalendarYear,
state.dataEnvrn->CurrentYearIsLeapYear,
Month,
DayOfMonth,
_,
Expand All @@ -3225,6 +3228,7 @@ namespace OutputProcessor {
state.dataGlobal->DayOfSim,
state.dataEnvrn->CurEnvirNum,
state.dataGlobal->CalendarYear,
state.dataEnvrn->CurrentYearIsLeapYear,
Month);
}
break;
Expand All @@ -3235,7 +3239,8 @@ namespace OutputProcessor {
reportID,
state.dataGlobal->DayOfSim,
state.dataEnvrn->CurEnvirNum,
state.dataGlobal->CalendarYear);
state.dataGlobal->CalendarYear,
state.dataEnvrn->CurrentYearIsLeapYear);
}
break;
default:
Expand Down
5 changes: 3 additions & 2 deletions src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3124,7 +3124,8 @@ void OpenOutputTabularFile(EnergyPlusData &state)
open_tbl_stream(state, iStyle, state.dataStrGlobals->outputTblXmlFilePath, state.files.outputControl.tabular);
tbl_stream << "<?xml version=\"1.0\"?>\n";
tbl_stream << "<EnergyPlusTabularReports>\n";
tbl_stream << " <state.dataHeatBal->BuildingName>" << state.dataHeatBal->BuildingName << "</state.dataHeatBal->BuildingName>\n";
tbl_stream << " <state.dataHeatBal->BuildingName>" << ConvertToEscaped(state.dataHeatBal->BuildingName)
<< "</state.dataHeatBal->BuildingName>\n";
tbl_stream << " <EnvironmentName>" << state.dataEnvrn->EnvironmentName << "</EnvironmentName>\n";
tbl_stream << " <WeatherFileLocationTitle>" << state.dataEnvrn->WeatherFileLocationTitle << "</WeatherFileLocationTitle>\n";
tbl_stream << " <ProgramVersion>" << state.dataStrGlobals->VerStringVar << "</ProgramVersion>\n";
Expand Down Expand Up @@ -16631,7 +16632,7 @@ void WriteReportHeaders(EnergyPlusData &state,
tbl_stream << "</" << ort->prevReportName << ">\n"; // close the last element if it was used.
}
tbl_stream << "<" << ConvertToElementTag(modifiedReportName) << ">\n";
tbl_stream << " <for>" << objectName << "</for>\n";
tbl_stream << " <for>" << ConvertToEscaped(objectName) << "</for>\n";
ort->prevReportName = ConvertToElementTag(modifiedReportName); // save the name for next time
}
}
Expand Down
6 changes: 5 additions & 1 deletion src/EnergyPlus/SQLiteProcedures.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1602,6 +1602,7 @@ void SQLite::createSQLiteTimeIndexRecord(int const reportingInterval,
int const cumlativeSimulationDays,
int const curEnvirNum,
int const simulationYear,
bool const curYearIsLeapYear,
ObjexxFCL::Optional_int_const month,
ObjexxFCL::Optional_int_const dayOfMonth,
ObjexxFCL::Optional_int_const hour,
Expand All @@ -1615,7 +1616,10 @@ void SQLite::createSQLiteTimeIndexRecord(int const reportingInterval,
int intStartMinute = 0;
int intervalInMinutes = 60;

static const std::vector<int> lastDayOfMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
static std::vector<int> lastDayOfMonth = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
if (curYearIsLeapYear) {
lastDayOfMonth[1] = 29;
}

switch (reportingInterval) {
case LocalReportEach:
Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/SQLiteProcedures.hh
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public:
int const CumlativeSimulationDays,
int const curEnvirNum,
int const simulationYear,
bool const curYearIsLeapYear,
ObjexxFCL::Optional_int_const Month = _,
ObjexxFCL::Optional_int_const DayOfMonth = _,
ObjexxFCL::Optional_int_const Hour = _,
Expand Down
26 changes: 10 additions & 16 deletions src/EnergyPlus/WeatherManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -844,16 +844,15 @@ namespace WeatherManager {
(state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodDesign)) {
std::string kindOfRunPeriod = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).cKindOfEnvrn;
state.dataEnvrn->RunPeriodEnvironment = state.dataGlobal->KindOfSim == Constant::KindOfSim::RunPeriodWeather;
Array1D_int ActEndDayOfMonth(12);
ActEndDayOfMonth = state.dataWeatherManager->EndDayOfMonth;
state.dataEnvrn->CurrentYearIsLeapYear = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).IsLeapYear;
if (state.dataEnvrn->CurrentYearIsLeapYear && state.dataWeatherManager->WFAllowsLeapYears) {
state.dataWeatherManager->LeapYearAdd = 1;
} else {
state.dataWeatherManager->LeapYearAdd = 0;
}
if (state.dataEnvrn->CurrentYearIsLeapYear) {
ActEndDayOfMonth(2) = state.dataWeatherManager->EndDayOfMonth(2) + state.dataWeatherManager->LeapYearAdd;
state.dataWeatherManager->EndDayOfMonthWithLeapDay(2) =
state.dataWeatherManager->EndDayOfMonth(2) + state.dataWeatherManager->LeapYearAdd;
}
state.dataWeatherManager->UseDaylightSaving = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseDST;
state.dataWeatherManager->UseSpecialDays = state.dataWeatherManager->Environment(state.dataWeatherManager->Envrn).UseHolidays;
Expand Down Expand Up @@ -1578,11 +1577,8 @@ namespace WeatherManager {
int ActStartDay; // Actual Start Day of Month
int ActEndMonth; // Actual End Month
int ActEndDay; // Actual End Day of Month
Array1D_int ActEndDayOfMonth(12);

bool ErrorsFound = false;
ActEndDayOfMonth = state.dataWeatherManager->EndDayOfMonth;
ActEndDayOfMonth(2) = state.dataWeatherManager->EndDayOfMonth(2) + state.dataWeatherManager->LeapYearAdd;
if (state.dataWeatherManager->DST.StDateType == DateType::MonthDay) {
ActStartMonth = state.dataWeatherManager->DST.StMon;
ActStartDay = state.dataWeatherManager->DST.StDay;
Expand All @@ -1592,7 +1588,7 @@ namespace WeatherManager {
ThisDay += 7;
}
ThisDay += 7 * (state.dataWeatherManager->DST.StDay - 1);
if (ThisDay > ActEndDayOfMonth(state.dataWeatherManager->DST.StMon)) {
if (ThisDay > state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->DST.StMon)) {
ShowSevereError(state, format("{}Determining DST: DST Start Date, Nth Day of Month, not enough Nths", RoutineName));
ErrorsFound = true;
} else {
Expand All @@ -1601,7 +1597,7 @@ namespace WeatherManager {
}
} else { // LastWeekDayInMonth
int ThisDay = state.dataWeatherManager->DST.StWeekDay - MonWeekDay(state.dataWeatherManager->DST.StMon) + 1;
while (ThisDay + 7 <= ActEndDayOfMonth(state.dataWeatherManager->DST.StMon)) {
while (ThisDay + 7 <= state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->DST.StMon)) {
ThisDay += 7;
}
ActStartMonth = state.dataWeatherManager->DST.StMon;
Expand All @@ -1617,7 +1613,7 @@ namespace WeatherManager {
ThisDay += 7;
}
ThisDay += 7 * (state.dataWeatherManager->DST.EnDay - 1);
if (ThisDay > ActEndDayOfMonth(state.dataWeatherManager->DST.EnMon)) {
if (ThisDay >> state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->DST.EnMon)) {
ActEndMonth = 0; // Suppress uninitialized warning
ActEndDay = 0; // Suppress uninitialized warning
ShowSevereError(state, format("{}Determining DST: DST End Date, Nth Day of Month, not enough Nths", RoutineName));
Expand All @@ -1628,7 +1624,7 @@ namespace WeatherManager {
}
} else { // LastWeekDayInMonth
int ThisDay = state.dataWeatherManager->DST.EnWeekDay - MonWeekDay(state.dataWeatherManager->DST.EnMon) + 1;
while (ThisDay + 7 <= ActEndDayOfMonth(state.dataWeatherManager->DST.EnMon)) {
while (ThisDay + 7 <= state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->DST.EnMon)) {
ThisDay += 7;
}
ActEndMonth = state.dataWeatherManager->DST.EnMon;
Expand Down Expand Up @@ -1674,11 +1670,8 @@ namespace WeatherManager {
static constexpr std::string_view RoutineName("SetSpecialDayDates: ");

int JDay;
Array1D_int ActEndDayOfMonth(12);

bool ErrorsFound = false;
ActEndDayOfMonth = state.dataWeatherManager->EndDayOfMonth;
ActEndDayOfMonth(2) = state.dataWeatherManager->EndDayOfMonth(2) + state.dataWeatherManager->LeapYearAdd;
state.dataWeatherManager->SpecialDayTypes = 0;
for (int i = 1; i <= state.dataWeatherManager->NumSpecialDays; ++i) {
if (state.dataWeatherManager->SpecialDays(i).WthrFile && !state.dataWeatherManager->UseSpecialDays) continue;
Expand Down Expand Up @@ -1709,7 +1702,7 @@ namespace WeatherManager {
ThisDay += 7;
}
ThisDay += 7 * (state.dataWeatherManager->SpecialDays(i).Day - 1);
if (ThisDay > ActEndDayOfMonth(state.dataWeatherManager->SpecialDays(i).Month)) {
if (ThisDay > state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->SpecialDays(i).Month)) {
ShowSevereError(state,
format("{}Special Day Date, Nth Day of Month, not enough Nths, for SpecialDay={}",
RoutineName,
Expand All @@ -1722,7 +1715,7 @@ namespace WeatherManager {
JDay = General::OrdinalDay(state.dataWeatherManager->SpecialDays(i).Month, ThisDay, state.dataWeatherManager->LeapYearAdd);
} else { // LastWeekDayInMonth
int ThisDay = state.dataWeatherManager->SpecialDays(i).WeekDay - MonWeekDay(state.dataWeatherManager->SpecialDays(i).Month) + 1;
while (ThisDay + 7 <= ActEndDayOfMonth(state.dataWeatherManager->SpecialDays(i).Month)) {
while (ThisDay + 7 <= state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataWeatherManager->SpecialDays(i).Month)) {
ThisDay += 7;
}
state.dataWeatherManager->SpecialDays(i).ActStMon = state.dataWeatherManager->SpecialDays(i).Month;
Expand Down Expand Up @@ -1894,7 +1887,7 @@ namespace WeatherManager {
}

state.dataEnvrn->EndYearFlag = false;
if (state.dataEnvrn->DayOfMonth == state.dataWeatherManager->EndDayOfMonth(state.dataEnvrn->Month)) {
if (state.dataEnvrn->DayOfMonth == state.dataWeatherManager->EndDayOfMonthWithLeapDay(state.dataEnvrn->Month)) {
state.dataEnvrn->EndMonthFlag = true;
state.dataEnvrn->EndYearFlag = (state.dataEnvrn->Month == 12);
}
Expand Down Expand Up @@ -2935,6 +2928,7 @@ namespace WeatherManager {
if (hour == 1 && CurTimeStep == 1) {
if (WMonth == 2 && WDay == 29 && (!state.dataEnvrn->CurrentYearIsLeapYear || !state.dataWeatherManager->WFAllowsLeapYears)) {
state.dataWeatherManager->EndDayOfMonth(2) = 28;
state.dataWeatherManager->EndDayOfMonthWithLeapDay(2) = 28;
SkipThisDay = true;
TryAgain = true;
ShowWarningError(state, "ReadEPlusWeatherForDay: Feb29 data encountered but will not be processed.");
Expand Down
Loading

5 comments on commit 5a963be

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

SteamPart1Followup (dareumnam) - Win64-Windows-10-VisualStudio-16: OK (2741 of 2741 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

SteamPart1Followup (dareumnam) - x86_64-MacOS-10.17-clang-14.0.0: OK (3527 of 3527 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

SteamPart1Followup (dareumnam) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3568 of 3568 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

SteamPart1Followup (dareumnam) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (1955 of 1955 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

SteamPart1Followup (dareumnam) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (789 of 789 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.