Skip to content

Commit

Permalink
Merge pull request #6989 from NREL/#6987-ZoneHVACEnergyRecoveryVentil…
Browse files Browse the repository at this point in the history
…ator-sizing-issue-when-using-FanSystemModel

Correct ERV sizing reports to eio file
  • Loading branch information
Myoldmopar authored Sep 27, 2018
2 parents 012cbfd + 070b9a4 commit 2ef880d
Show file tree
Hide file tree
Showing 12 changed files with 126 additions and 17,394 deletions.
1 change: 1 addition & 0 deletions src/EnergyPlus/DataSizing.cc
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,7 @@ namespace DataSizing {
ZoneEqSizing(curZoneEqNum).CoolingAirVolFlow = 0.0;
ZoneEqSizing(curZoneEqNum).HeatingAirVolFlow = 0.0;
ZoneEqSizing(curZoneEqNum).SystemAirVolFlow = 0.0;
ZoneEqSizing(curZoneEqNum).DesignSizeFromParent = false;
}

if (curSysNum > 0) {
Expand Down
245 changes: 65 additions & 180 deletions src/EnergyPlus/HVACStandAloneERV.cc

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/EnergyPlus/HVACStandAloneERV.hh
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ namespace HVACStandAloneERV {
Real64 LatHeatingRate; // rate of latent heating delivered to the zone [W]
Real64 TotHeatingEnergy; // total heating energy delivered by the ERV supply air to the zone [J]
Real64 TotHeatingRate; // rate of total heating delivered to the zone [W]
bool FirstPass; // detects first time through for resetting sizing data

// Default Constructor
StandAloneERVData()
Expand All @@ -162,7 +163,7 @@ namespace HVACStandAloneERV {
DesignEAFanMassFlowRate(0.0), AirVolFlowPerFloorArea(0.0), AirVolFlowPerOccupant(0.0), EconomizerOASchedPtr(0), FlowError(true),
AvailStatus(0), ElecUseRate(0.0), ElecUseEnergy(0.0), SensCoolingEnergy(0.0), SensCoolingRate(0.0), LatCoolingEnergy(0.0),
LatCoolingRate(0.0), TotCoolingEnergy(0.0), TotCoolingRate(0.0), SensHeatingEnergy(0.0), SensHeatingRate(0.0), LatHeatingEnergy(0.0),
LatHeatingRate(0.0), TotHeatingEnergy(0.0), TotHeatingRate(0.0)
LatHeatingRate(0.0), TotHeatingEnergy(0.0), TotHeatingRate(0.0), FirstPass(true)
{
}
};
Expand Down
16,272 changes: 0 additions & 16,272 deletions src/EnergyPlus/HVACUnitarySystem.cc

This file was deleted.

892 changes: 0 additions & 892 deletions src/EnergyPlus/HVACUnitarySystem.hh

This file was deleted.

6 changes: 0 additions & 6 deletions src/EnergyPlus/HeatRecovery.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1658,7 +1658,6 @@ namespace HeatRecovery {
if (ZoneEqSizing(CurZoneEqNum).DesignSizeFromParent) {
// Heat recovery heat exchanger in zoneHVAC equipment should have been sized to OA flow in the parent equipment
DataConstantUsedForSizing = ZoneEqSizing(CurZoneEqNum).AirVolFlow;
PrintFlag = false;
} else {
DataConstantUsedForSizing = std::max(FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow, FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow);
}
Expand All @@ -1669,16 +1668,11 @@ namespace HeatRecovery {
if (ZoneEqSizing(CurZoneEqNum).DesignSizeFromParent) {
// Heat recovery heat exchanger in zoneHVAC equipment should have been sized to OA flow in the parent equipment
DataConstantUsedForSizing = ZoneEqSizing(CurZoneEqNum).AirVolFlow;
PrintFlag = false;
} else {
DataConstantUsedForSizing =
std::max(FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow, FinalZoneSizing(CurZoneEqNum).DesHeatVolFlow);
}
DataFractionUsedForSizing = 1.0;
} else {
if (ZoneEqSizing(CurZoneEqNum).DesignSizeFromParent) {
PrintFlag = false;
}
}
}
}
Expand Down
12 changes: 8 additions & 4 deletions src/EnergyPlus/ReportSizingManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -421,9 +421,9 @@ namespace ReportSizingManager {
Real64 const RatedInletAirHumRat(0.01125); // Humidity ratio corresponding to 80F dry bulb/67F wet bulb

std::string DDNameFanPeak;
DDNameFanPeak = ""; // " test my Design Day";
DDNameFanPeak = ""; // " test my Design Day";
std::string dateTimeFanPeak;
dateTimeFanPeak = ""; // " test 1/2 00:00:00 ";
dateTimeFanPeak = ""; // " test 1/2 00:00:00 ";
Real64 DXFlowPerCapMinRatio(1.0);
Real64 DXFlowPerCapMaxRatio(1.0);

Expand Down Expand Up @@ -3430,8 +3430,12 @@ namespace ReportSizingManager {
} else {
if (DataAutosizable && AutosizeUser > 0.0 && AutosizeDes > 0.0 && PrintWarningFlag &&
!(DataScalableSizingON || DataScalableCapSizingON)) {
ReportSizingOutput(
CompType, CompName, "Design Size " + SizingString, AutosizeDes, "User-Specified " + SizingString, AutosizeUser);
if ((std::abs(AutosizeDes - AutosizeUser) / AutosizeUser) > AutoVsHardSizingThreshold) {
ReportSizingOutput(
CompType, CompName, "Design Size " + SizingString, AutosizeDes, "User-Specified " + SizingString, AutosizeUser);
} else {
ReportSizingOutput(CompType, CompName, "User-Specified " + SizingString, AutosizeUser);
}
if (DisplayExtraWarnings) {
if ((std::abs(AutosizeDes - AutosizeUser) / AutosizeUser) > AutoVsHardSizingThreshold) {
ShowMessage(CallingRoutine + ": Potential issue with equipment sizing for " + CompType + ' ' + CompName);
Expand Down
25 changes: 4 additions & 21 deletions src/EnergyPlus/SZVAVModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,6 @@ namespace SZVAVModel {
// MODULE PARAMETER DEFINITIONS
static std::string const BlankString;

// DERIVED TYPE DEFINITIONS
// na

// INTERFACE DEFINITIONS

// MODULE VARIABLE DECLARATIONS:
// na

// SUBROUTINE SPECIFICATIONS FOR MODULE General
// PUBLIC SaveCompDesWaterFlow
// PUBLIC ErfFunction

// Functions

void calcSZVAVModel(PackagedTerminalHeatPump::PTUnitData &SZVAVModel,
Expand Down Expand Up @@ -287,7 +275,7 @@ namespace SZVAVModel {
maxCoilFluidFlow, coilFluidInletNode, coilFluidOutletNode, coilLoopNum, coilLoopSide, coilBranchNum, coilCompNum);
Par(10) = maxCoilFluidFlow; // max water flow rate limited by plant

if (HeatingLoad) { // Function HVACUnitarySystem::CalcUnitarySystemToLoad, 4th and 5th arguments are CoolPLR and HeatPLR
if (HeatingLoad) { // Function UnitarySystems::calcUnitarySystemToLoad, 4th and 5th arguments are CoolPLR and HeatPLR
// set the water flow ratio so water coil gets proper flow
SZVAVModel.HeatCoilWaterFlowRatio = maxCoilFluidFlow / SZVAVModel.MaxHeatCoilFluidFlow;
}
Expand Down Expand Up @@ -414,7 +402,7 @@ namespace SZVAVModel {
maxCoilFluidFlow, coilFluidInletNode, coilFluidOutletNode, coilLoopNum, coilLoopSide, coilBranchNum, coilCompNum);
Par(10) = maxCoilFluidFlow; // max water flow rate limited by plant

if (HeatingLoad) { // Function HVACUnitarySystem::CalcUnitarySystemToLoad, 4th and 5th arguments are CoolPLR and HeatPLR
if (HeatingLoad) { // Function UnitarySystems::calcUnitarySystemToLoad, 4th and 5th arguments are CoolPLR and HeatPLR
// set the water flow ratio so water coil gets proper flow
SZVAVModel.HeatCoilWaterFlowRatio = maxCoilFluidFlow / SZVAVModel.MaxHeatCoilFluidFlow;
}
Expand Down Expand Up @@ -705,7 +693,7 @@ namespace SZVAVModel {
maxCoilFluidFlow, coilFluidInletNode, coilFluidOutletNode, coilLoopNum, coilLoopSide, coilBranchNum, coilCompNum);
Par(10) = maxCoilFluidFlow; // max water flow rate limited by plant

if (HeatingLoad) { // Function HVACUnitarySystem::CalcUnitarySystemToLoad, 4th and 5th arguments are CoolPLR and HeatPLR
if (HeatingLoad) { // Function UnitarySystems::calcUnitarySystemToLoad, 4th and 5th arguments are CoolPLR and HeatPLR
// set the water flow ratio so water coil gets proper flow
SZVAVModel.HeatCoilWaterFlowRatio = maxCoilFluidFlow / SZVAVModel.MaxHeatCoilFluidFlow;
}
Expand Down Expand Up @@ -825,7 +813,7 @@ namespace SZVAVModel {
maxCoilFluidFlow, coilFluidInletNode, coilFluidOutletNode, coilLoopNum, coilLoopSide, coilBranchNum, coilCompNum);
Par(10) = maxCoilFluidFlow; // max water flow rate limited by plant

if (HeatingLoad) { // Function HVACUnitarySystem::CalcUnitarySystemToLoad, 4th and 5th arguments are CoolPLR and HeatPLR
if (HeatingLoad) { // Function UnitarySystems::calcUnitarySystemToLoad, 4th and 5th arguments are CoolPLR and HeatPLR
// set the water flow ratio so water coil gets proper flow
SZVAVModel.HeatCoilWaterFlowRatio = maxCoilFluidFlow / SZVAVModel.MaxHeatCoilFluidFlow;
}
Expand Down Expand Up @@ -937,11 +925,6 @@ namespace SZVAVModel {
int const &CompressorONFlag)
{

// Using/Aliasing
// using HVACUnitarySystem::CalcUnitarySystemToLoad;
// using HVACUnitarySystem::CalcUnitarySystemWaterFlowResidual;
// using PlantUtilities::SetComponentFlowRate;
// using Psychrometrics::PsyHFnTdbW;
UnitarySystems::UnitarySys &thisSys = UnitarySystems::unitarySys[SysIndex];

int const MaxIter(100); // maximum number of iterations
Expand Down
16 changes: 1 addition & 15 deletions src/EnergyPlus/SZVAVModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
#include <EnergyPlus.hh>
#include <FanCoilUnits.hh>
#include <General.hh>
#include <HVACUnitarySystem.hh>
#include <PackagedTerminalHeatPump.hh>
#include <UnitarySystem.hh>

Expand Down Expand Up @@ -93,18 +92,6 @@ namespace SZVAVModel {

// Functions

void calcSZVAVModel(HVACUnitarySystem::UnitarySystemData &SZVAVModel,
int const &SysIndex,
bool const &FirstHVACIteration,
bool const &CoolingLoad,
bool const &HeatingLoad,
Real64 const &ZoneLoad,
Real64 &OnOffAirFlowRatio,
bool const &HXUnitOn,
int const &AirLoopNum,
Real64 &PartLoadFrac,
int const &CompressorONFlag);

void calcSZVAVModel(PackagedTerminalHeatPump::PTUnitData &SZVAVModel,
int const &SysIndex,
bool const &FirstHVACIteration,
Expand Down Expand Up @@ -143,8 +130,7 @@ namespace SZVAVModel {
bool const &HXUnitOn,
int const &AirLoopNum,
Real64 &PartLoadFrac,
int const &CompressorONFlag
);
int const &CompressorONFlag);

} // namespace SZVAVModel

Expand Down
2 changes: 1 addition & 1 deletion tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ TEST_F(EnergyPlusFixture, HXAssistCCUnitarySystem_VStest1)
ASSERT_EQ(1, UnitarySystems::numUnitarySystems); // only 1 unitary system above so expect 1 as number of unitary system objects

DataGlobals::SysSizingCalc =
false; // DISABLE SIZING - don't call HVACUnitarySystem::SizeUnitarySystem, much more work needed to set up sizing arrays
false; // DISABLE SIZING - don't call UnitarySystems::sizeUnitarySystem, much more work needed to set up sizing arrays

InletNode = mySys->AirInNode;
OutletNode = mySys->AirOutNode;
Expand Down
45 changes: 44 additions & 1 deletion tst/EnergyPlus/unit/HVACStandaloneERV.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,39 @@ using namespace EnergyPlus::ScheduleManager;

TEST_F(EnergyPlusFixture, HVACStandAloneERV_Test1)
{
std::string const idf_objects = delimited_string({
" Fan:OnOff,",
" ERV Supply Fan, !- Name",
" FanAndCoilAvailSched, !- Availability Schedule Name",
" 0.5, !- Fan Total Efficiency",
" 75.0, !- Pressure Rise {Pa}",
" 20000.0, !- Maximum Flow Rate {m3/s}",
" 0.9, !- Motor Efficiency",
" 1.0, !- Motor In Airstream Fraction",
" HR Supply Outlet Node, !- Air Inlet Node Name",
" Supply Fan Outlet Node; !- Air Outlet Node Name",

" Fan:OnOff,",
" ERV Exhaust Fan, !- Name",
" FanAndCoilAvailSched, !- Availability Schedule Name",
" 0.5, !- Fan Total Efficiency",
" 75.0, !- Pressure Rise {Pa}",
" 20000.0, !- Maximum Flow Rate {m3/s}",
" 0.9, !- Motor Efficiency",
" 1.0, !- Motor In Airstream Fraction",
" HR Secondary Outlet Node,!- Air Inlet Node Name",
" Exhaust Fan Outlet Node; !- Air Outlet Node Name",

" Schedule:Compact,",
" FanAndCoilAvailSched, !- Name",
" Fraction, !- Schedule Type Limits Name",
" Through: 12/31, !- Field 1",
" For: AllDays, !- Field 2",
" Until: 24:00,1.0; !- Field 3",
});

ASSERT_TRUE(process_idf(idf_objects));

ZoneEquipConfig.allocate(1);
ZoneEquipConfig(1).ZoneName = "Zone 1";
ZoneEquipConfig(1).ActualZoneNum = 1;
Expand All @@ -82,6 +115,7 @@ TEST_F(EnergyPlusFixture, HVACStandAloneERV_Test1)
Zone(1).Name = ZoneEquipConfig(1).ZoneName;
ZoneEqSizing.allocate(1);
CurZoneEqNum = 1;
DataSizing::ZoneEqSizing(CurZoneEqNum).SizingMethod.allocate(DataHVACGlobals::NumOfSizingTypes);

TotPeople = 2; // Total number of people statements
People.allocate(TotPeople);
Expand All @@ -96,15 +130,23 @@ TEST_F(EnergyPlusFixture, HVACStandAloneERV_Test1)

// size on floor area
StandAloneERV(1).SupplyAirVolFlow = AutoSize;
StandAloneERV(1).ExhaustAirVolFlow = AutoSize;
StandAloneERV(1).AirVolFlowPerFloorArea = 1.0;
StandAloneERV(1).AirVolFlowPerOccupant = 0.0;
StandAloneERV(1).SupplyAirFanType_Num = DataHVACGlobals::FanType_SimpleOnOff;
StandAloneERV(1).SupplyAirFanName = "ERV SUPPLY FAN";
StandAloneERV(1).SupplyAirFanIndex = 1;
StandAloneERV(1).ExhaustAirFanType_Num = DataHVACGlobals::FanType_SimpleOnOff;
StandAloneERV(1).ExhaustAirFanName = "ERV EXHAUST FAN";
StandAloneERV(1).ExhaustAirFanIndex = 2;
Zone(1).Multiplier = 1.0;
Zone(1).FloorArea = 1000.0;
SizeStandAloneERV(1);
EXPECT_EQ(1000.0, StandAloneERV(1).SupplyAirVolFlow);

// size on occupancy
StandAloneERV(1).SupplyAirVolFlow = AutoSize; // Need to reset this for each pass
StandAloneERV(1).ExhaustAirVolFlow = AutoSize;
StandAloneERV(1).AirVolFlowPerFloorArea = 0.0;
StandAloneERV(1).AirVolFlowPerOccupant = 10.0;
Zone(1).Multiplier = 1.0;
Expand All @@ -114,6 +156,7 @@ TEST_F(EnergyPlusFixture, HVACStandAloneERV_Test1)

// size on floor area and occupancy
StandAloneERV(1).SupplyAirVolFlow = AutoSize;
StandAloneERV(1).ExhaustAirVolFlow = AutoSize;
StandAloneERV(1).AirVolFlowPerFloorArea = 1.0;
StandAloneERV(1).AirVolFlowPerOccupant = 10.0;
Zone(1).Multiplier = 1.0;
Expand All @@ -123,6 +166,7 @@ TEST_F(EnergyPlusFixture, HVACStandAloneERV_Test1)

// size on floor area and occupancy using zone multiplier
StandAloneERV(1).SupplyAirVolFlow = AutoSize;
StandAloneERV(1).ExhaustAirVolFlow = AutoSize;
Zone(1).Multiplier = 5.0;
SizeStandAloneERV(1);
EXPECT_EQ(20000.0, StandAloneERV(1).SupplyAirVolFlow);
Expand Down Expand Up @@ -219,7 +263,6 @@ TEST_F(EnergyPlusFixture, HVACStandAloneERV_Test2)
SizeStandAloneERV(1);

EXPECT_EQ(1.0, StandAloneERV(1).SupplyAirVolFlow);
EXPECT_EQ(1.0, StandAloneERV(1).DesignHXVolFlowRate);
EXPECT_EQ(1.2, StandAloneERV(1).DesignSAFanVolFlowRate);
EXPECT_EQ(1.2, StandAloneERV(1).DesignEAFanVolFlowRate);
}
1 change: 0 additions & 1 deletion tst/EnergyPlus/unit/SZVAVModel.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#include <EnergyPlus/DataZoneEquipment.hh>
#include <EnergyPlus/FanCoilUnits.hh>
#include <EnergyPlus/Fans.hh>
#include <EnergyPlus/HVACUnitarySystem.hh>
#include <EnergyPlus/NodeInputManager.hh>
#include <EnergyPlus/OutputReportPredefined.hh>
#include <EnergyPlus/PackagedTerminalHeatPump.hh>
Expand Down

8 comments on commit 2ef880d

@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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-14.04-gcc-4.8: OK (2426 of 2426 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.

develop (Myoldmopar) - x86_64-MacOS-10.9-clang: OK (2406 of 2406 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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed, 0 test warnings)

Build 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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-UnitTestsCoverage-Debug: OK (1773 of 1773 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-14.04-custom_check: OK (0 of 0 tests passed, 0 test warnings)

Build Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - i386-Windows-7-VisualStudio-14: OK (2406 of 2406 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (Myoldmopar) - Win64-Windows-7-VisualStudio-14: OK (2406 of 2406 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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-14.04-gcc-4.8-IntegrationCoverage-Debug: OK (2409 of 2409 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.