Skip to content

Commit

Permalink
Define a constexpr std::string_view for the AHRI table footnotes (201…
Browse files Browse the repository at this point in the history
…7/2023)
  • Loading branch information
jmarrec committed Dec 16, 2024
1 parent 98f914a commit 7ac4834
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 91 deletions.
30 changes: 3 additions & 27 deletions src/EnergyPlus/Coils/CoilCoolingDX.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
#include <EnergyPlus/ReportCoilSelection.hh>
#include <EnergyPlus/ScheduleManager.hh>
#include <EnergyPlus/SimAirServingZones.hh>
#include <EnergyPlus/StandardRatings.hh>
#include <EnergyPlus/WaterManager.hh>

using namespace EnergyPlus;
Expand Down Expand Up @@ -1047,19 +1048,7 @@ void CoilCoolingDX::reportAllStandardRatings(EnergyPlusData &state)
} else {
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDXCoolCoilIEERIP, coil.name, "N/A");
}
OutputReportPredefined::addFootNoteSubTable(
state,
state.dataOutRptPredefined->pdstDXCoolCoil,
"ANSI/AHRI ratings account for supply air fan heat and electric power. <br/>"
"1 - EnergyPlus object type. <br/>"
"2 - Capacity less than 65K Btu/h (19050 W) - calculated as per AHRI Standard 210/240-2017. <br/>"
"&emsp;&nbsp;Capacity of 65K Btu/h (19050 W) to less than 135K Btu/h (39565 W) - calculated as per AHRI Standard 340/360-2007. "
"<br/>"
"&emsp;&nbsp;Capacity from 135K (39565 W) to 250K Btu/hr (73268 W) - calculated as per AHRI Standard 365-2009 - Ratings not yet "
"supported in EnergyPlus. <br/>"
"3 - SEER (User) is calculated using user-input PLF curve and cooling coefficient of degradation. <br/>"
"&emsp;&nbsp;SEER (Standard) is calculated using the default PLF curve and cooling coefficient of degradation"
"from the appropriate AHRI standard.");
OutputReportPredefined::addFootNoteSubTable(state, state.dataOutRptPredefined->pdstDXCoolCoil, StandardRatings::AHRI2017FOOTNOTE);

// AHRI 2023 Standard SEER2 Calculations
if (state.dataHVACGlobal->StandardRatingsMyCoolOneTimeFlag2) {
Expand Down Expand Up @@ -1125,20 +1114,7 @@ void CoilCoolingDX::reportAllStandardRatings(EnergyPlusData &state)
} else {
OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDXCoolCoilIEERIP_2023, coil.name, "N/A");
}
OutputReportPredefined::addFootNoteSubTable(
state,
state.dataOutRptPredefined->pdstDXCoolCoil_2023,
"ANSI/AHRI ratings account for supply air fan heat and electric power. <br/>"
"1 - EnergyPlus object type. <br/>"
"2 - Capacity less than 65K Btu/h (19050 W) - calculated as per AHRI Standard 210/240-2023. <br/>"
"&emsp;&nbsp;Capacity of 65K Btu/h (19050 W) to less than 135K Btu/h (39565 W) - calculated as per AHRI Standard 340/360-2022. "
"<br/>"
"&emsp;&nbsp;Capacity from 135K (39565 W) to 250K Btu/hr (73268 W) - calculated as per AHRI Standard 365-2009 - Ratings not yet "
"supported in EnergyPlus. <br/>"
"3 - SEER2 (User) is calculated using user-input PLF curve and cooling coefficient of degradation. <br/>"
"&emsp;&nbsp;SEER2 (Standard) is calculated using the default PLF curve and cooling coefficient of degradation"
"from the appropriate AHRI standard. <br/>"
"4 - Value for the Full Speed of the coil.");
OutputReportPredefined::addFootNoteSubTable(state, state.dataOutRptPredefined->pdstDXCoolCoil_2023, StandardRatings::AHRI2023FOOTNOTE);
}
}
state.dataCoilCooingDX->stillNeedToReportStandardRatings = false;
Expand Down
13 changes: 1 addition & 12 deletions src/EnergyPlus/DXCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14824,18 +14824,7 @@ void CalcTwoSpeedDXCoilStandardRating(EnergyPlusData &state, int const DXCoilNum
PreDefTableEntry(state, state.dataOutRptPredefined->pdchDXCoolCoilSEERUserIP, thisDXCoil.Name, "N/A");
PreDefTableEntry(state, state.dataOutRptPredefined->pdchDXCoolCoilSEERStandardIP, thisDXCoil.Name, "N/A");

addFootNoteSubTable(
state,
state.dataOutRptPredefined->pdstDXCoolCoil,
"ANSI/AHRI ratings account for supply air fan heat and electric power. <br/>"
"1 - EnergyPlus object type. <br/>"
"2 - Capacity less than 65K Btu/h (19050 W) - calculated as per AHRI Standard 210/240-2017. <br/>"
"&emsp;&nbsp;Capacity of 65K Btu/h (19050 W) to less than 135K Btu/h (39565 W) - calculated as per AHRI Standard 340/360-2007. <br/>"
"&emsp;&nbsp;Capacity from 135K (39565 W) to 250K Btu/hr (73268 W) - calculated as per AHRI Standard 365-2009 - Ratings not yet supported in "
"EnergyPlus. <br/>"
"3 - SEER (User) is calculated using user-input PLF curve and cooling coefficient of degradation. <br/>"
"&emsp;&nbsp;SEER (Standard) is calculated using the default PLF curve and cooling coefficient of degradation"
"from the appropriate AHRI standard.");
addFootNoteSubTable(state, state.dataOutRptPredefined->pdstDXCoolCoil, StandardRatings::AHRI2017FOOTNOTE);

PreDefTableEntry(state, state.dataOutRptPredefined->pdchVAVDXCoolCoilType, thisDXCoil.Name, "Coil:Cooling:DX:TwoSpeed");
if (thisDXCoil.RateWithInternalStaticAndFanObject) {
Expand Down
8 changes: 6 additions & 2 deletions src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17188,7 +17188,7 @@ void WriteTable(EnergyPlusData &state,
// end the table
tbl_stream << "</table>\n";
if (!footnoteText.empty()) {
tbl_stream << fmt::format("<i>{}</i>\n", footnoteText);
tbl_stream << fmt::format("<div class=\"footnote\" style=\"font-style: italic;\">{}</div>\n", footnoteText);
}
tbl_stream << "<br><br>\n";
} else if (thisStyle == TableStyle::XML) {
Expand Down Expand Up @@ -17316,7 +17316,11 @@ void WriteTable(EnergyPlusData &state,
}
}
if (!footnoteText.empty()) {
tbl_stream << fmt::format(" <footnote>{}</footnote>\n", footnoteText);
if (footnoteText.find("<br") != std::string_view::npos) {
tbl_stream << fmt::format(" <footnote><![CDATA[{}]]></footnote>\n", footnoteText);
} else {
tbl_stream << fmt::format(" <footnote>{}</footnote>\n", footnoteText);
}
}
}
} else {
Expand Down
54 changes: 4 additions & 50 deletions src/EnergyPlus/StandardRatings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6804,18 +6804,7 @@ namespace StandardRatings {
} else {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchDXCoolCoilIEERIP, CompName, "N/A");
}
addFootNoteSubTable(state,
state.dataOutRptPredefined->pdstDXCoolCoil,
"ANSI/AHRI ratings account for supply air fan heat and electric power. <br/>"
"1 - EnergyPlus object type. <br/>"
"2 - Capacity less than 65K Btu/h (19050 W) - calculated as per AHRI Standard 210/240-2017. <br/>"
"&emsp;&nbsp;Capacity of 65K Btu/h (19050 W) to less than 135K Btu/hv (39565 W) - calculated as per AHRI "
"Standard 340/360-2007. <br/>"
"&emsp;&nbsp;Capacity from 135K (39565 W) to 250K Btu/hr (73268 W) - calculated as per AHRI Standard 365-2009 - "
"Ratings not yet supported in EnergyPlus. <br/>"
"3 - SEER (User) is calculated using user-input PLF curve and cooling coefficient of degradation. <br/>"
"&emsp;&nbsp;SEER (Standard) is calculated using the default PLF curve and cooling coefficient of degradation"
"from the appropriate AHRI standard.");
addFootNoteSubTable(state, state.dataOutRptPredefined->pdstDXCoolCoil, StandardRatings::AHRI2017FOOTNOTE);
} else {
// ANSI/AHRI 210/240 Standard 2023 Ratings | SEER2
if (state.dataHVACGlobal->StandardRatingsMyCoolOneTimeFlag2) {
Expand Down Expand Up @@ -6862,19 +6851,7 @@ namespace StandardRatings {
} else {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchDXCoolCoilIEERIP_2023, CompName, "N/A");
}
addFootNoteSubTable(state,
state.dataOutRptPredefined->pdstDXCoolCoil_2023,
"ANSI/AHRI ratings account for supply air fan heat and electric power. <br/>"
"1 - EnergyPlus object type. <br/>"
"2 - Capacity less than 65K Btu/h (19050 W) - calculated as per AHRI Standard 210/240-2023. <br/>"
"&emsp;&nbsp;Capacity of 65K Btu/h (19050 W) to less than 135K Btu/h (39565 W) - calculated as per AHRI Standard "
"340/360-2022. <br/>"
"&emsp;&nbsp;Capacity from 135K (39565 W) to 250K Btu/hr (73268 W) - calculated as per AHRI Standard 365-2009 - "
"Ratings not yet supported in EnergyPlus. <br/>"
"3 - SEER2 (User) is calculated using user-input PLF curve and cooling coefficient of degradation. <br/>"
"&emsp;&nbsp;SEER2 (Standard) is calculated using the default PLF curve and cooling coefficient of degradation"
"from the appropriate AHRI standard. <br/>"
"4 - Value for the Full Speed of the coil.");
addFootNoteSubTable(state, state.dataOutRptPredefined->pdstDXCoolCoil_2023, StandardRatings::AHRI2023FOOTNOTE);
}
break;
}
Expand Down Expand Up @@ -6973,18 +6950,7 @@ namespace StandardRatings {
} else {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchDXCoolCoilIEERIP, CompName, "N/A");
}
addFootNoteSubTable(state,
state.dataOutRptPredefined->pdstDXCoolCoil,
"ANSI/AHRI ratings account for supply air fan heat and electric power. <br/>"
"1 - EnergyPlus object type. <br/>"
"2 - Capacity less than 65K Btu/h (19050 W) - calculated as per AHRI Standard 210/240-2017. <br/>"
"&emsp;&nbsp;Capacity of 65K Btu/h (19050 W) to less than 135K Btu/h (39565 W) - calculated as per AHRI Standard "
"340/360-2007. <br/>"
"&emsp;&nbsp;Capacity from 135K (39565 W) to 250K Btu/hr (73268 W) - calculated as per AHRI Standard 365-2009 - "
"Ratings not yet supported in EnergyPlus. <br/>"
"3 - SEER (User) is calculated using user-input PLF curve and cooling coefficient of degradation. <br/>"
"&emsp;&nbsp;SEER (Standard) is calculated using the default PLF curve and cooling coefficient of degradation"
"from the appropriate AHRI standard.");
addFootNoteSubTable(state, state.dataOutRptPredefined->pdstDXCoolCoil, StandardRatings::AHRI2017FOOTNOTE);
} else {
// ANSI/AHRI 210/240 Standard 2023 Ratings | SEER2
if (state.dataHVACGlobal->StandardRatingsMyCoolOneTimeFlag2) {
Expand Down Expand Up @@ -7030,19 +6996,7 @@ namespace StandardRatings {
} else {
PreDefTableEntry(state, state.dataOutRptPredefined->pdchDXCoolCoilIEERIP_2023, CompName, "N/A");
}
addFootNoteSubTable(state,
state.dataOutRptPredefined->pdstDXCoolCoil_2023,
"ANSI/AHRI ratings account for supply air fan heat and electric power. <br/>"
"1 - EnergyPlus object type. <br/>"
"2 - Capacity less than 65K Btu/h (19050 W) - calculated as per AHRI Standard 210/240-2023. <br/>"
"&emsp;&nbsp;Capacity of 65K Btu/h (19050 W) to less than 135K Btu/h (39565 W) - calculated as per AHRI Standard "
"340/360-2022. <br/>"
"&emsp;&nbsp;Capacity from 135K (39565 W) to 250K Btu/hr (73268 W) - calculated as per AHRI Standard 365-2009 - "
"Ratings not yet supported in EnergyPlus. <br/>"
"3 - SEER2 (User) is calculated using user-input PLF curve and cooling coefficient of degradation. <br/>"
"&emsp;&nbsp;SEER2 (Standard) is calculated using the default PLF curve and cooling coefficient of degradation"
"from the appropriate AHRI standard. <br/>"
"4 - Value for the Full Speed of the coil.");
addFootNoteSubTable(state, state.dataOutRptPredefined->pdstDXCoolCoil_2023, StandardRatings::AHRI2023FOOTNOTE);
}

break;
Expand Down
28 changes: 28 additions & 0 deletions src/EnergyPlus/StandardRatings.hh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
#include <EnergyPlus/EnergyPlus.hh>
#include <EnergyPlus/Plant/Enums.hh>

// C++ Headers
#include <string_view>

namespace EnergyPlus {

// Forward declarations
Expand All @@ -76,6 +79,31 @@ namespace StandardRatings {
Real64 constexpr HeatingOutdoorCoilInletAirDBTempH3Test(-8.33); // Outdoor air dry-bulb temp in degrees C (17F)
// Test H3 (low and High Speed) Std. AHRI 210/240

static constexpr std::string_view AHRI2017FOOTNOTE =
"ANSI/AHRI ratings account for supply air fan heat and electric power. <br/>"
"1 - EnergyPlus object type. <br/>"
"2 - Capacity less than 65K Btu/h (19050 W) - calculated as per AHRI Standard 210/240-2017. <br/>"
"&emsp;&nbsp;Capacity of 65K Btu/h (19050 W) to less than 135K Btu/h (39565 W) - calculated as per AHRI Standard 340/360-2007. "
"<br/>"
"&emsp;&nbsp;Capacity from 135K (39565 W) to 250K Btu/hr (73268 W) - calculated as per AHRI Standard 365-2009 - Ratings not yet "
"supported in EnergyPlus. <br/>"
"3 - SEER (User) is calculated using user-input PLF curve and cooling coefficient of degradation. <br/>"
"&emsp;&nbsp;SEER (Standard) is calculated using the default PLF curve and cooling coefficient of degradation"
"from the appropriate AHRI standard.";

static constexpr std::string_view AHRI2023FOOTNOTE =
"ANSI/AHRI ratings account for supply air fan heat and electric power. <br/>"
"1 - EnergyPlus object type. <br/>"
"2 - Capacity less than 65K Btu/h (19050 W) - calculated as per AHRI Standard 210/240-2023. <br/>"
"&emsp;&nbsp;Capacity of 65K Btu/h (19050 W) to less than 135K Btu/h (39565 W) - calculated as per AHRI Standard 340/360-2022. "
"<br/>"
"&emsp;&nbsp;Capacity from 135K (39565 W) to 250K Btu/hr (73268 W) - calculated as per AHRI Standard 365-2009 - Ratings not yet "
"supported in EnergyPlus. <br/>"
"3 - SEER2 (User) is calculated using user-input PLF curve and cooling coefficient of degradation. <br/>"
"&emsp;&nbsp;SEER2 (Standard) is calculated using the default PLF curve and cooling coefficient of degradation"
"from the appropriate AHRI standard. <br/>"
"4 - Value for the Full Speed of the coil.";

// Defrost strategy (heat pump only)
enum class DefrostStrat
{
Expand Down

0 comments on commit 7ac4834

Please sign in to comment.