From 9646be1bd6cd4f153460851b9fa74194b9a9733d Mon Sep 17 00:00:00 2001 From: Brent Griffith Date: Thu, 3 Oct 2024 09:48:43 -0600 Subject: [PATCH 1/2] Fix DOAS system sizing and add reporting --- src/EnergyPlus/AirLoopHVACDOAS.cc | 45 ++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/src/EnergyPlus/AirLoopHVACDOAS.cc b/src/EnergyPlus/AirLoopHVACDOAS.cc index b382733e760..b4ee4f7edf1 100644 --- a/src/EnergyPlus/AirLoopHVACDOAS.cc +++ b/src/EnergyPlus/AirLoopHVACDOAS.cc @@ -50,6 +50,7 @@ // EnergyPlus Headers #include +#include #include #include #include @@ -980,32 +981,35 @@ namespace AirLoopHVACDOAS { void AirLoopDOAS::SizingAirLoopDOAS(EnergyPlusData &state) { - Real64 sizingMassFlow = 0; + Real64 sizingVolumeFlow = 0; for (int AirLoop = 1; AirLoop <= this->NumOfAirLoops; AirLoop++) { int AirLoopNum = this->m_AirLoopNum[AirLoop - 1]; this->m_OACtrlNum.push_back(state.dataAirLoop->AirLoopControlInfo(AirLoopNum).OACtrlNum); if (this->m_OACtrlNum[AirLoop - 1] > 0) { - sizingMassFlow += state.dataMixedAir->OAController(this->m_OACtrlNum[AirLoop - 1]).MaxOA; + sizingVolumeFlow += + state.dataMixedAir->OAController(this->m_OACtrlNum[AirLoop - 1]).MaxOA; // this is a volume flow rate not a mass flow rate } } - this->SizingMassFlow = sizingMassFlow; + this->SizingMassFlow = sizingVolumeFlow * state.dataEnvrn->StdRhoAir; + + BaseSizer::reportSizerOutput(state, "AirLoopHVAC:DedicatedOutdoorAirSystem", this->Name, "Design Volume Flow Rate [m3/s]", sizingVolumeFlow); this->GetDesignDayConditions(state); - if (this->m_FanIndex > 0 && this->m_FanTypeNum == SimAirServingZones::CompType::Fan_System_Object) { - state.dataFans->fans(this->m_FanIndex)->maxAirFlowRate = sizingMassFlow / state.dataEnvrn->StdRhoAir; - state.dataLoopNodes->Node(this->m_FanInletNodeNum).MassFlowRateMaxAvail = sizingMassFlow; - state.dataLoopNodes->Node(this->m_FanOutletNodeNum).MassFlowRateMaxAvail = sizingMassFlow; - state.dataLoopNodes->Node(this->m_FanOutletNodeNum).MassFlowRateMax = sizingMassFlow; + if (this->m_FanIndex > -1 && this->m_FanTypeNum == SimAirServingZones::CompType::Fan_System_Object) { + state.dataFans->fans(this->m_FanIndex)->maxAirFlowRate = sizingVolumeFlow; + state.dataLoopNodes->Node(this->m_FanInletNodeNum).MassFlowRateMaxAvail = this->SizingMassFlow; + state.dataLoopNodes->Node(this->m_FanOutletNodeNum).MassFlowRateMaxAvail = this->SizingMassFlow; + state.dataLoopNodes->Node(this->m_FanOutletNodeNum).MassFlowRateMax = this->SizingMassFlow; } if (this->m_FanIndex > 0 && this->m_FanTypeNum == SimAirServingZones::CompType::Fan_ComponentModel) { - state.dataFans->fans(this->m_FanIndex)->maxAirFlowRate = sizingMassFlow / state.dataEnvrn->StdRhoAir; + state.dataFans->fans(this->m_FanIndex)->maxAirFlowRate = sizingVolumeFlow; state.dataFans->fans(this->m_FanIndex)->minAirFlowRate = 0.0; - state.dataFans->fans(this->m_FanIndex)->maxAirMassFlowRate = sizingMassFlow; - state.dataLoopNodes->Node(this->m_FanInletNodeNum).MassFlowRateMaxAvail = sizingMassFlow; - state.dataLoopNodes->Node(this->m_FanOutletNodeNum).MassFlowRateMaxAvail = sizingMassFlow; - state.dataLoopNodes->Node(this->m_FanOutletNodeNum).MassFlowRateMax = sizingMassFlow; + state.dataFans->fans(this->m_FanIndex)->maxAirMassFlowRate = this->SizingMassFlow; + state.dataLoopNodes->Node(this->m_FanInletNodeNum).MassFlowRateMaxAvail = this->SizingMassFlow; + state.dataLoopNodes->Node(this->m_FanOutletNodeNum).MassFlowRateMaxAvail = this->SizingMassFlow; + state.dataLoopNodes->Node(this->m_FanOutletNodeNum).MassFlowRateMax = this->SizingMassFlow; } state.dataSize->CurSysNum = state.dataHVACGlobal->NumPrimaryAirSys + this->m_AirLoopDOASNum + 1; @@ -1044,6 +1048,21 @@ namespace AirLoopHVACDOAS { } } } + + BaseSizer::reportSizerOutput( + state, "AirLoopHVAC:DedicatedOutdoorAirSystem", this->Name, "Design Cooling Outdoor Air Temperature [C]", this->SizingCoolOATemp); + BaseSizer::reportSizerOutput(state, + "AirLoopHVAC:DedicatedOutdoorAirSystem", + this->Name, + "Design Cooling Outdoor Air Humidity Ratio [kgWater/kgDryAir]", + this->SizingCoolOAHumRat); + BaseSizer::reportSizerOutput( + state, "AirLoopHVAC:DedicatedOutdoorAirSystem", this->Name, "Design Heating Outdoor Air Temperature [C]", this->HeatOutTemp); + BaseSizer::reportSizerOutput(state, + "AirLoopHVAC:DedicatedOutdoorAirSystem", + this->Name, + "Design Heating Outdoor Air Humidity Ratio [kgWater/kgDryAir]", + this->HeatOutHumRat); } void CheckConvergence(EnergyPlusData &state) From 2004713c327580f993bcd260183e4b3334f52a62 Mon Sep 17 00:00:00 2001 From: Brent Griffith Date: Wed, 23 Oct 2024 09:18:29 -0600 Subject: [PATCH 2/2] fix unit test in AirLoopDOAS --- tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc b/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc index ea744bf82c8..fb6b8cdcc7c 100644 --- a/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc +++ b/tst/EnergyPlus/unit/AirLoopHVACDOAS.unit.cc @@ -10069,9 +10069,9 @@ TEST_F(EnergyPlusFixture, AirLoopHVACDOAS_TestFanHeatAddeToCoolingCoilSize) SimulationManager::ManageSimulation(*state); // run the design day over the warmup period (24 hrs, 25 days) // OA flow rate - EXPECT_NEAR(state->dataUnitarySystems->unitarySys[0].m_MaxCoolAirVolFlow, 0.55713, 0.001); + EXPECT_NEAR(state->dataUnitarySystems->unitarySys[0].m_MaxCoolAirVolFlow, 0.65598, 0.001); // Cooling capacity - EXPECT_NEAR(state->dataUnitarySystems->unitarySys[0].m_DesignCoolingCapacity, 21135.6226, 0.01); + EXPECT_NEAR(state->dataUnitarySystems->unitarySys[0].m_DesignCoolingCapacity, 24885.6323, 0.01); } TEST_F(EnergyPlusFixture, AirLoopHVACDOAS_TestOACompConnectionError)