From c5c0d201ae4cb4ef147d6463109b1936ee87045c Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Mon, 24 Apr 2023 15:27:45 -0500 Subject: [PATCH 001/164] Add NFP --- design/FY2023/ImprovedErrorHandling.md | 89 ++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 design/FY2023/ImprovedErrorHandling.md diff --git a/design/FY2023/ImprovedErrorHandling.md b/design/FY2023/ImprovedErrorHandling.md new file mode 100644 index 00000000000..57418f14d44 --- /dev/null +++ b/design/FY2023/ImprovedErrorHandling.md @@ -0,0 +1,89 @@ +# Modern Error Reporting + +One feature request pretty much summarizes the issue and solution for our error reporting: + +> "The current solution of writing out the error file to a text file without establishing a standard procedure makes it difficult for third-party vendors to translate the content. + We would prefer to start establishing a standard template for warnings/error records with unique IDs being written to the JSON files. " + +OK, so the big picture is we want an error file in JSON format with some form of ID associated with the error messages. +A nice side benefit of this would be that we could generate a bit of documentation that cross references the ID. +The documentation could be built up over time with additions like typical causes, tips and tricks for fixing or working around, etc. + +## Detailed task list + +To meet this need, I think development would follow something like this: + +- Analyze existing structure, figuring out a feasible plan for refactoring error message calls +- Create a new error manager in EnergyPlus that tracks errors in a nice structure +- Refactor calls to error message routines to use a vector of strings rather than individual calls to *Continue* +- Refactor the error message routines to not just emit to the err file but also add them to the new error manager + - (at this point I should be able to get no diffs) +- Try to find "nearly" identical error messages and bring them together + - I would expect this to cause valid diffs in the err file as minor wording changes are collected together +- Create a set of ID categories, and modify the error emission to report the error ID +- Use the error manager to generate the JSON error file +- Create an auto-generated document for the different error message IDs + +## Error File Contents + +I would start creating the error file with something like this, but am totally open to feedback, and it also may naturally change as development commences: + +```json +{ + "summary": { + "outcome": "fatal", + "num_severe": 2, + "num_warnings": 1, + "runtime": 210.2, + "timestamp": "2023-04-24T13:05:30Z" + }, + "fatal": { + "id": "F1000", + "summary": "EnergyPlus failed because of a Meta-reason", + }, + "severe": [ + { + "id": "S1021", + "synopsis": "Flow controller did not converge", + "extra_info": "Air loop 'AirLoop' diverged with oscillating flow rate. Flow controller 'ControlStrategy' is set to 'InverseMobiusStrip', which only exists in hyper dimensional systems. Choose a more appropriate option." + }, + { + "id": "S3001", + "synopsis": "Encountered meta-building in the input file", + "extra_info": "Building 'MetaBuilding' was declared with meta-latitude '\\342\\200\\234' and meta-longitude '\\742\\234\\876', which are not supported in this version of EnergyPlus" + } + ], + "warnings": [ + { + "id": "W4040", + "synopsis": "Timestep is set to 3600 seconds, which is incompatible with some cool short time step model, suggest setting it to 3599 or less.", + "extra_info": "" + } + ], + "information": [ + "Testing Individual Branch Integrity", + "All Branches passed integrity testing", + "Testing Individual Supply Air Path Integrity", + "All Supply Air Paths passed integrity testing", + "Testing Individual Return Air Path Integrity", + "All Return Air Paths passed integrity testing", + "No node connection errors were found.", + "Beginning Simulation", + "EnergyPlus Completed Successfully" + ] +} +``` + +We'll need to keep in mind how new errors can be introduced into the category system to future proof it. +Many tools do something like: A001, A002, B001, B002, so I would probably start by doing something similar. + +Things I still need to solve: +- Should I include timestamp info for every single warning? +- Add structure for recurring +- Add extra flag for whether warmup, sizing, or kickoff were true + +## Current questions for dev team + +- What should we name this JSON based error file? +- Do we just keep a list of message string templates in a single dedicated file, and use these in calls to errors? +- Anyone have strong feelings on the ID or JSON form? From 89671cc497fbe427a0b3396afe01b4dfc03f02e8 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Thu, 21 Dec 2023 19:27:19 -0800 Subject: [PATCH 002/164] consider cycling in VRF fan power calculation --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index d0e65502f05..58e120ba353 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12492,6 +12492,15 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) this->ElecHeatingPower = 0; } this->VRFCondRTF = VRFRTF; + // consider cycling in fan calculation + for (int TUListNum = 1; TUListNum <= state.dataHVACVarRefFlow->NumVRFTULists; ++TUListNum) { + auto &thisTUList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum); + for (int TUNum = 1; TUNum <= thisTUList.NumTUInList; ++TUNum) { + auto &fan = state.dataFans->Fan(state.dataHVACVarRefFlow->VRFTU(TUNum).FanIndex); + fan.FanPower *= state.dataHVACVarRefFlow->VRF(VRFCond).VRFCondCyclingRatio; + fan.FanEnergy = fan.FanPower * state.dataHVACGlobal->TimeStepSysSec; + } + } // Calculate CrankCaseHeaterPower: VRF Heat Pump Crankcase Heater Electric Power [W] if (this->MaxOATCCHeater > OutdoorDryBulb) { From 5a00a65b7e1b3e66987566f90156d47534b3a1f3 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 3 Jan 2024 09:25:08 -0800 Subject: [PATCH 003/164] multiply by coil runtime fraction not VRF RTF --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 58e120ba353..d2be1586450 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12497,8 +12497,17 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) auto &thisTUList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum); for (int TUNum = 1; TUNum <= thisTUList.NumTUInList; ++TUNum) { auto &fan = state.dataFans->Fan(state.dataHVACVarRefFlow->VRFTU(TUNum).FanIndex); - fan.FanPower *= state.dataHVACVarRefFlow->VRF(VRFCond).VRFCondCyclingRatio; - fan.FanEnergy = fan.FanPower * state.dataHVACGlobal->TimeStepSysSec; + int heatingCoilNum = state.dataHVACVarRefFlow->VRFTU(TUNum).HeatCoilIndex; + int coolingCoilNum = state.dataHVACVarRefFlow->VRFTU(TUNum).CoolCoilIndex; + auto &heatingCoil = state.dataDXCoils->DXCoil(heatingCoilNum); + auto &coolingCoil = state.dataDXCoils->DXCoil(coolingCoilNum); + // only deal with cooling for now. heating RTF might have some issue + if (heatingCoil.HeatingCoilRuntimeFraction == 0.0) { // in cooling mode + // here coolingCoil.CoolingCoilRuntimeFraction equals state.dataHVACVarRefFlow->VRF(VRFCond).VRFCondCyclingRatio + // this is not the case for heating + fan.FanPower *= coolingCoil.CoolingCoilRuntimeFraction; + fan.FanEnergy = fan.FanPower * state.dataHVACGlobal->TimeStepSysSec; + } } } From 9a0cc0b04d3fce88039a34e863372806ced642e3 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 24 Jan 2024 15:55:06 -0800 Subject: [PATCH 004/164] add fan heat gain adjustment --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index d2be1586450..1ee5604a95c 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12507,6 +12507,7 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) // this is not the case for heating fan.FanPower *= coolingCoil.CoolingCoilRuntimeFraction; fan.FanEnergy = fan.FanPower * state.dataHVACGlobal->TimeStepSysSec; + fan.PowerLossToAir *= coolingCoil.CoolingCoilRuntimeFraction; } } } From 89019063a8782ace88a8aa41dc12bd41d1a7d8f2 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Thu, 1 Feb 2024 17:23:15 -0800 Subject: [PATCH 005/164] Consider run time fraction in OU fan power --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index d63c5096f74..5c7a11b0d5f 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -11721,7 +11721,7 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) // Key outputs of this subroutine this->CompActSpeed = max(CompSpdActual, 0.0); this->Ncomp = max(Ncomp, 0.0) / this->EffCompInverter; // 0.95 is the efficiency of the compressor inverter, can come from IDF //@minor - this->OUFanPower = this->RatedOUFanPower; //@ * pow_3( CondFlowRatio ) + this->OUFanPower = this->RatedOUFanPower * CyclingRatio; //@ * pow_3( CondFlowRatio ) this->VRFCondCyclingRatio = CyclingRatio; // report variable for cycling rate Tdischarge = this->CondensingTemp; // outdoor unit condensing temperature @@ -11934,7 +11934,7 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) // Key outputs of this subroutine this->CompActSpeed = max(CompSpdActual, 0.0); this->Ncomp = max(Ncomp, 0.0) / this->EffCompInverter; - this->OUFanPower = this->RatedOUFanPower; + this->OUFanPower = this->RatedOUFanPower * CyclingRatio; this->VRFCondCyclingRatio = CyclingRatio; Tsuction = this->EvaporatingTemp; // Outdoor unit evaporating temperature From 7c1a00884f5cce2a1e80c92f0fac1443b0797e20 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Thu, 1 Feb 2024 17:24:03 -0800 Subject: [PATCH 006/164] clang-format --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 5c7a11b0d5f..9c19c040ac7 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -11720,9 +11720,9 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) // Key outputs of this subroutine this->CompActSpeed = max(CompSpdActual, 0.0); - this->Ncomp = max(Ncomp, 0.0) / this->EffCompInverter; // 0.95 is the efficiency of the compressor inverter, can come from IDF //@minor - this->OUFanPower = this->RatedOUFanPower * CyclingRatio; //@ * pow_3( CondFlowRatio ) - this->VRFCondCyclingRatio = CyclingRatio; // report variable for cycling rate + this->Ncomp = max(Ncomp, 0.0) / this->EffCompInverter; // 0.95 is the efficiency of the compressor inverter, can come from IDF //@minor + this->OUFanPower = this->RatedOUFanPower * CyclingRatio; //@ * pow_3( CondFlowRatio ) + this->VRFCondCyclingRatio = CyclingRatio; // report variable for cycling rate Tdischarge = this->CondensingTemp; // outdoor unit condensing temperature this->CoolingCapacity = From 5fcc817265e39220a045e7e251bb32487cbc4dfe Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Fri, 2 Feb 2024 16:31:48 -0800 Subject: [PATCH 007/164] Add check of fan index before accessing dataFans->Fan(.) --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 9c19c040ac7..8c17f4c469b 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12485,15 +12485,17 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) for (int TUListNum = 1; TUListNum <= state.dataHVACVarRefFlow->NumVRFTULists; ++TUListNum) { auto &thisTUList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum); for (int TUNum = 1; TUNum <= thisTUList.NumTUInList; ++TUNum) { - auto &fan = state.dataFans->Fan(state.dataHVACVarRefFlow->VRFTU(TUNum).FanIndex); int heatingCoilNum = state.dataHVACVarRefFlow->VRFTU(TUNum).HeatCoilIndex; int coolingCoilNum = state.dataHVACVarRefFlow->VRFTU(TUNum).CoolCoilIndex; auto &heatingCoil = state.dataDXCoils->DXCoil(heatingCoilNum); auto &coolingCoil = state.dataDXCoils->DXCoil(coolingCoilNum); + int fanIndex = state.dataHVACVarRefFlow->VRFTU(TUNum).FanIndex; // only deal with cooling for now. heating RTF might have some issue - if (heatingCoil.HeatingCoilRuntimeFraction == 0.0) { // in cooling mode + // does Fan:SystemModel need adjustment as well? if so consider 0-indexing and it's in state.dataHVACFan->fanObjs vector + if (fanIndex > 0 && heatingCoil.HeatingCoilRuntimeFraction == 0.0) { // in cooling mode // here coolingCoil.CoolingCoilRuntimeFraction equals state.dataHVACVarRefFlow->VRF(VRFCond).VRFCondCyclingRatio // this is not the case for heating + auto &fan = state.dataFans->Fan(fanIndex); fan.FanPower *= coolingCoil.CoolingCoilRuntimeFraction; fan.FanEnergy = fan.FanPower * state.dataHVACGlobal->TimeStepSysSec; fan.PowerLossToAir *= coolingCoil.CoolingCoilRuntimeFraction; From 026be04bf4919a0fa0231ad3450806b560d9e3ff Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Fri, 2 Feb 2024 16:32:12 -0800 Subject: [PATCH 008/164] fix unit test uninitialized cycling ratio --- tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 98f3b25a4db..2628b2c847a 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -13192,6 +13192,8 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) Real64 OAUCoilOutTemp = 0.0; bool ZoneEquipment = true; + // add VRF cycling ratio initialization. Since TU's are simulated first, if there's no initialization, the coil runtime fraction will be zero + state->dataHVACVarRefFlow->VRF(1).VRFCondCyclingRatio = 1.0; SimulateVRF(*state, state->dataHVACVarRefFlow->VRFTU(VRFTUNum).Name, FirstHVACIteration, @@ -13219,7 +13221,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) EXPECT_EQ(0.0, thisVRFTU.NoCoolHeatOutAirMassFlow); EXPECT_NEAR(5125.0840, thisDXCoolingCoil.TotalCoolingEnergyRate, 0.0001); EXPECT_NEAR(4999.8265, thisVRFTU.TotalCoolingRate, 0.0001); - EXPECT_NEAR(125.2573, thisFan.FanPower, 0.0001); + EXPECT_NEAR(125.2573 * thisDXCoolingCoil.CoolingCoilRuntimeFraction, thisFan.FanPower, 0.0001); EXPECT_NEAR(thisDXCoolingCoil.TotalCoolingEnergyRate, (thisVRFTU.TotalCoolingRate + thisFan.FanPower), 0.0001); } From b9c6bff967469f657cccd826f8481dcd3e387b8d Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Fri, 2 Feb 2024 16:33:16 -0800 Subject: [PATCH 009/164] clang-format --- .../unit/HVACVariableRefrigerantFlow.unit.cc | 468 +++++++++--------- 1 file changed, 235 insertions(+), 233 deletions(-) diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 2628b2c847a..c6f2b82fc46 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -2487,109 +2487,109 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Compressor) } // Run and Check: VRFOU_CompSpd - {// Test the method VRFOU_CompSpd, which calculates the compressor speed at given - // operational conditions to meet the evaporator or condenser capacity provided. + { // Test the method VRFOU_CompSpd, which calculates the compressor speed at given + // operational conditions to meet the evaporator or condenser capacity provided. - {// a. Evaporator + { // a. Evaporator - // Inputs_condition - Real64 constexpr Q_req = 6971; // Required capacity [W] - Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] - Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] - Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] - Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] - Real64 CompSpdActual; // Actual compressor running speed [rps] + // Inputs_condition + Real64 constexpr Q_req = 6971; // Required capacity [W] + Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] + Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] + Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] + Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] + Real64 CompSpdActual; // Actual compressor running speed [rps] - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( - *state, Q_req, HXOpMode::EvapMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( + *state, Q_req, HXOpMode::EvapMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); - // Test - EXPECT_NEAR(1295, CompSpdActual, 5); -} + // Test + EXPECT_NEAR(1295, CompSpdActual, 5); + } -{ - // b. Condenser - - // Inputs_condition - Real64 constexpr Q_req = 6953; // Required capacity [W] - Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] - Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] - Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] - Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] - Real64 CompSpdActual; // Actual compressor running speed [rps] - - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( - *state, Q_req, HXOpMode::CondMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); - - // Test - EXPECT_NEAR(950, CompSpdActual, 5); -} -} // namespace EnergyPlus + { + // b. Condenser -// Run and Check: VRFOU_CompCap -{ - // Test the method VRFOU_CompCap, which calculates the compressor performance (power and capacity) - // at given compressor speed and operational conditions. - - // Inputs_condition - Real64 constexpr CompSpdActual = 1298; // Actual compressor running speed [rps] - Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] - Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] - Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] - Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] - Real64 Q_c_tot; // Compressor evaporative capacity [W] - Real64 Ncomp; // Compressor power [W] - - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompCap(*state, CompSpdActual, T_suction, T_discharge, h_IU_evap_in, h_comp_in, Q_c_tot, Ncomp); - - // Test - EXPECT_NEAR(6990, Q_c_tot, 10); - EXPECT_NEAR(1601, Ncomp, 10); -} + // Inputs_condition + Real64 constexpr Q_req = 6953; // Required capacity [W] + Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] + Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] + Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] + Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] + Real64 CompSpdActual; // Actual compressor running speed [rps] -// Run and Check: VRFOU_CalcComp -{ - // Test the method VRFOU_CalcCompH, which simulates the compressor performance at given oprtaional conditions. More specifically, it - // sepcifies the compressor speed to provide sufficient evaporative capacity, and calculate the power of the compressor running at the - // specified speed. Note that it may be needed to manipulate the operational conditions to further adjust system capacity at low load - // conditions. The low load modification logics are different for cooling mode and heating mode. - - // Inputs_condition - Real64 TU_load = 6006; // Indoor unit cooling load [W] - Real64 T_suction = 8.86; // Compressor suction temperature Te' [C] - Real64 T_discharge = 40.26; // Compressor discharge temperature Tc' [C] - Real64 Pipe_h_out_ave = 233428; // Average Enthalpy of the refrigerant leaving IUs [kJ/kg] - Real64 IUMaxCondTemp = 36; // VRV IU condensing temperature, max among all indoor units [C] - Real64 MinOutdoorUnitTe = -72; // The minimum temperature that OU Te can be at cooling mode (only used for calculating Min capacity) - Real64 Tfs = 10.90; // Temperature of the air at the OU evaporator coil surface [C]] - Real64 Pipe_Q = 162.67; // Piping Loss Algorithm Parameter: Heat loss [W] - Real64 OUEvapHeatExtract = 5110.40; // Evaporator heat extract [W] - Real64 Ncomp = 1058; // Compressor power [W] - Real64 CompSpdActual; // Actual compressor running speed [rps] - - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CalcCompH(*state, - TU_load, - T_suction, - T_discharge, - Pipe_h_out_ave, - IUMaxCondTemp, - MinOutdoorUnitTe, - Tfs, - Pipe_Q, - OUEvapHeatExtract, - CompSpdActual, - Ncomp); - - // Test - EXPECT_NEAR(5110, OUEvapHeatExtract, 1); - EXPECT_NEAR(1500, CompSpdActual, 1); - EXPECT_NEAR(2080, Ncomp, 1); - EXPECT_EQ(state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRFTU(1).VRFTUInletNodeNum).MassFlowRate, 0.0); -} + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( + *state, Q_req, HXOpMode::CondMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); + + // Test + EXPECT_NEAR(950, CompSpdActual, 5); + } + } // namespace EnergyPlus + + // Run and Check: VRFOU_CompCap + { + // Test the method VRFOU_CompCap, which calculates the compressor performance (power and capacity) + // at given compressor speed and operational conditions. + + // Inputs_condition + Real64 constexpr CompSpdActual = 1298; // Actual compressor running speed [rps] + Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] + Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] + Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] + Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] + Real64 Q_c_tot; // Compressor evaporative capacity [W] + Real64 Ncomp; // Compressor power [W] + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompCap(*state, CompSpdActual, T_suction, T_discharge, h_IU_evap_in, h_comp_in, Q_c_tot, Ncomp); + + // Test + EXPECT_NEAR(6990, Q_c_tot, 10); + EXPECT_NEAR(1601, Ncomp, 10); + } + + // Run and Check: VRFOU_CalcComp + { + // Test the method VRFOU_CalcCompH, which simulates the compressor performance at given oprtaional conditions. More specifically, it + // sepcifies the compressor speed to provide sufficient evaporative capacity, and calculate the power of the compressor running at the + // specified speed. Note that it may be needed to manipulate the operational conditions to further adjust system capacity at low load + // conditions. The low load modification logics are different for cooling mode and heating mode. + + // Inputs_condition + Real64 TU_load = 6006; // Indoor unit cooling load [W] + Real64 T_suction = 8.86; // Compressor suction temperature Te' [C] + Real64 T_discharge = 40.26; // Compressor discharge temperature Tc' [C] + Real64 Pipe_h_out_ave = 233428; // Average Enthalpy of the refrigerant leaving IUs [kJ/kg] + Real64 IUMaxCondTemp = 36; // VRV IU condensing temperature, max among all indoor units [C] + Real64 MinOutdoorUnitTe = -72; // The minimum temperature that OU Te can be at cooling mode (only used for calculating Min capacity) + Real64 Tfs = 10.90; // Temperature of the air at the OU evaporator coil surface [C]] + Real64 Pipe_Q = 162.67; // Piping Loss Algorithm Parameter: Heat loss [W] + Real64 OUEvapHeatExtract = 5110.40; // Evaporator heat extract [W] + Real64 Ncomp = 1058; // Compressor power [W] + Real64 CompSpdActual; // Actual compressor running speed [rps] + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CalcCompH(*state, + TU_load, + T_suction, + T_discharge, + Pipe_h_out_ave, + IUMaxCondTemp, + MinOutdoorUnitTe, + Tfs, + Pipe_Q, + OUEvapHeatExtract, + CompSpdActual, + Ncomp); + + // Test + EXPECT_NEAR(5110, OUEvapHeatExtract, 1); + EXPECT_NEAR(1500, CompSpdActual, 1); + EXPECT_NEAR(2080, Ncomp, 1); + EXPECT_EQ(state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRFTU(1).VRFTUInletNodeNum).MassFlowRate, 0.0); + } } TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Coil) @@ -2632,163 +2632,165 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Coil) InitializePsychRoutines(*state); // Run and Check: VRFOU_Cap - { // Test the method VRFOU_Cap, which determines the VRF OU heat transfer rate, given refrigerant side temperature, - // i.e., condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. - {// a. Condenser - - // Inputs_condition - m_air = 3.6; - OutDryBulbTemp = 28; - OutHumRat = 0.0146; - SC = 1; - Tdischarge = 36; - - // Run - Q_h_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::CondMode, Tdischarge, SC, m_air, OutDryBulbTemp, OutHumRat); - - // Test - EXPECT_NEAR(27551, Q_h_OU, 10); -} - -{ - // b. Evaporator - - // Inputs_condition - m_air = 3.6; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - SH = 1; - Tsuction = -3; - - // Run - Q_c_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::EvapMode, Tsuction, SH, m_air, OutDryBulbTemp, OutHumRat); - - // Test - EXPECT_NEAR(24456, Q_c_OU, 10); -} -} // namespace EnergyPlus - -// Run and Check: VRFOU_FlowRate -{ // Test the method VRFOU_Cap, which calculates the outdoor unit fan flow rate, given VRF OU load and refrigerant side temperature, i.e., - // condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. - {// a. Condenser + { // Test the method VRFOU_Cap, which determines the VRF OU heat transfer rate, given refrigerant side temperature, + // i.e., condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. + { // a. Condenser + + // Inputs_condition + m_air = 3.6; + OutDryBulbTemp = 28; + OutHumRat = 0.0146; + SC = 1; + Tdischarge = 36; + + // Run + Q_h_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::CondMode, Tdischarge, SC, m_air, OutDryBulbTemp, OutHumRat); + + // Test + EXPECT_NEAR(27551, Q_h_OU, 10); + } - // Inputs_condition - Q_h_OU = 27551; -OutDryBulbTemp = 28; -OutHumRat = 0.0146; -SC = 1; -Tdischarge = 36; + { + // b. Evaporator -// Run -m_air = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::CondMode, Tdischarge, SC, Q_h_OU, OutDryBulbTemp, OutHumRat); + // Inputs_condition + m_air = 3.6; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + SH = 1; + Tsuction = -3; -// Test -EXPECT_NEAR(3.6, m_air, 0.01); -} + // Run + Q_c_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::EvapMode, Tsuction, SH, m_air, OutDryBulbTemp, OutHumRat); -{ - // b. Evaporator + // Test + EXPECT_NEAR(24456, Q_c_OU, 10); + } + } // namespace EnergyPlus + + // Run and Check: VRFOU_FlowRate + { // Test the method VRFOU_Cap, which calculates the outdoor unit fan flow rate, given VRF OU load and refrigerant side temperature, i.e., + // condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. + { // a. Condenser + + // Inputs_condition + Q_h_OU = 27551; + OutDryBulbTemp = 28; + OutHumRat = 0.0146; + SC = 1; + Tdischarge = 36; + + // Run + m_air = + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::CondMode, Tdischarge, SC, Q_h_OU, OutDryBulbTemp, OutHumRat); + + // Test + EXPECT_NEAR(3.6, m_air, 0.01); + } - // Inputs_condition - Q_c_OU = 24456; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - SH = 1; - Tsuction = -3; + { + // b. Evaporator - // Run - m_air = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::EvapMode, Tsuction, SH, Q_c_OU, OutDryBulbTemp, OutHumRat); + // Inputs_condition + Q_c_OU = 24456; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + SH = 1; + Tsuction = -3; - // Test - EXPECT_NEAR(3.6, m_air, 0.01); -} -} + // Run + m_air = + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::EvapMode, Tsuction, SH, Q_c_OU, OutDryBulbTemp, OutHumRat); -// Run and Check: VRFOU_TeTc -{ // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature - // at cooling mode, or evaporating temperature at heating mode, given the coil heat - // release/extract amount and air side parameters. - {// a. Condenser - - // Inputs_condition - m_air = 3.6; -Q_h_OU = 27551; -OutDryBulbTemp = 28; -OutHumRat = 0.0146; -SC = 1; - -// Run -state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( - *state, HXOpMode::CondMode, Q_h_OU, SC, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tdischarge); - -// Test -EXPECT_NEAR(36, Tdischarge, 0.05); -} + // Test + EXPECT_NEAR(3.6, m_air, 0.01); + } + } -{ - // b. Evaporator - - // Inputs_condition - m_air = 3.6; - Q_c_OU = 24456; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - SH = 1; - Tsuction = -3; - - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( - *state, HXOpMode::EvapMode, Q_c_OU, SH, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tsuction); - - // Test - EXPECT_NEAR(-3, Tsuction, 0.05); -} -} + // Run and Check: VRFOU_TeTc + { // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature + // at cooling mode, or evaporating temperature at heating mode, given the coil heat + // release/extract amount and air side parameters. + { // a. Condenser + + // Inputs_condition + m_air = 3.6; + Q_h_OU = 27551; + OutDryBulbTemp = 28; + OutHumRat = 0.0146; + SC = 1; + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( + *state, HXOpMode::CondMode, Q_h_OU, SC, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tdischarge); + + // Test + EXPECT_NEAR(36, Tdischarge, 0.05); + } -// Run and Check: VRFOU_SCSH -{ - // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature - // at cooling mode, or evaporating temperature at heating mode, given the coil heat - // release/extract amount and air side parameters. - { - // a. Condenser + { + // b. Evaporator - // Inputs_condition - m_air = 3.6; - Q_h_OU = 27551; - OutDryBulbTemp = 28; - OutHumRat = 0.0146; - Tdischarge = 36; + // Inputs_condition + m_air = 3.6; + Q_c_OU = 24456; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + SH = 1; + Tsuction = -3; - // Run - SC = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( - *state, HXOpMode::CondMode, Q_h_OU, Tdischarge, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( + *state, HXOpMode::EvapMode, Q_c_OU, SH, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tsuction); - // Test - EXPECT_NEAR(1, SC, 0.01); + // Test + EXPECT_NEAR(-3, Tsuction, 0.05); + } } + // Run and Check: VRFOU_SCSH { - // b. Evaporator + // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature + // at cooling mode, or evaporating temperature at heating mode, given the coil heat + // release/extract amount and air side parameters. + { + // a. Condenser + + // Inputs_condition + m_air = 3.6; + Q_h_OU = 27551; + OutDryBulbTemp = 28; + OutHumRat = 0.0146; + Tdischarge = 36; + + // Run + SC = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( + *state, HXOpMode::CondMode, Q_h_OU, Tdischarge, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); + + // Test + EXPECT_NEAR(1, SC, 0.01); + } - // Inputs_condition - m_air = 3.6; - Q_c_OU = 24456; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - Tsuction = -3; + { + // b. Evaporator - // Run - SH = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( - *state, HXOpMode::EvapMode, Q_c_OU, Tsuction, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); + // Inputs_condition + m_air = 3.6; + Q_c_OU = 24456; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + Tsuction = -3; - // Test - EXPECT_NEAR(1, SH, 0.01); + // Run + SH = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( + *state, HXOpMode::EvapMode, Q_c_OU, Tsuction, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); + + // Test + EXPECT_NEAR(1, SH, 0.01); + } } -} -// Clean up -state->dataHVACVarRefFlow->VRF.deallocate(); + // Clean up + state->dataHVACVarRefFlow->VRF.deallocate(); } TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_GetCoilInput) From 7d79eaca627af62fbe29b2acd5557fff8c3de7e3 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Mon, 26 Feb 2024 11:34:37 -0800 Subject: [PATCH 010/164] Move cycling ratio to inside compressor spd calc for heating after multiplying cycling ratio to the outdoor unit, some super large COP appeared in some timesteps. This is probably due to the cycling ratio calculation, moving it to inside the compressor speed calculation fixed this problem. --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 134 ++++++++---------- src/EnergyPlus/HVACVariableRefrigerantFlow.hh | 3 +- .../unit/HVACVariableRefrigerantFlow.unit.cc | 4 +- 3 files changed, 65 insertions(+), 76 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 8c17f4c469b..b3d786b84c0 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -11856,80 +11856,61 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) CapMinTe + 8, this->IUCondensingTemp - 5); - if ((Q_c_OU * C_cap_operation) <= CompEvaporatingCAPSpdMin) { - // Required heating load is smaller than the min heating capacity - - if (Q_c_OU == 0) { - // Q_h_TU_PL is less than or equal to CompEvaporatingPWRSpdMin - CyclingRatio = Q_h_TU_PL / CompEvaporatingPWRSpdMin; - this->EvaporatingTemp = OutdoorDryBulb; - } else { - // Q_h_TU_PL is greater than CompEvaporatingPWRSpdMin - CyclingRatio = Q_c_OU * C_cap_operation / CompEvaporatingCAPSpdMin; - this->EvaporatingTemp = max(CapMinTe, RefTLow); - } - - double CyclingRatioFrac = 0.85 + 0.15 * CyclingRatio; - double HPRTF = CyclingRatio / CyclingRatioFrac; - Ncomp = CompEvaporatingPWRSpdMin * HPRTF; - CompSpdActual = this->CompressorSpeed(1); - - } else { - // Required heating load is greater than or equal to the min heating capacity - - // Iteration_Ncomp: Perform iterations to calculate Ncomp (Label20) - Counter = 1; - Label20:; - Ncomp_new = Ncomp; - Q_c_OU = max(0.0, Q_h_TU_PL - Ncomp); - - // *VRF OU Te calculations - m_air = this->OUAirFlowRate * RhoAir; - SH_OU = this->SH; - this->VRFOU_TeTc( - state, HXOpMode::EvapMode, Q_c_OU, SH_OU, m_air, OutdoorDryBulb, OutdoorHumRat, OutdoorPressure, Tfs, this->EvaporatingTemp); - this->SH = SH_OU; - - // *VRF OU Compressor Simulation at heating mode: Specify the compressor speed and power consumption - this->VRFOU_CalcCompH(state, - TU_HeatingLoad, - this->EvaporatingTemp, - Tdischarge, - h_IU_cond_out_ave, - this->IUCondensingTemp, - CapMinTe, - Tfs, - Pipe_Q_h, - Q_c_OU, - CompSpdActual, - Ncomp_new); - - if ((std::abs(Ncomp_new - Ncomp) > (Tolerance * Ncomp)) && (Counter < 30)) { - Ncomp = Ncomp_new; - Counter = Counter + 1; - goto Label20; - } + // Required heating load is greater than or equal to the min heating capacity + + // Iteration_Ncomp: Perform iterations to calculate Ncomp (Label20) + Counter = 1; + Label20:; + Ncomp_new = Ncomp; + Q_c_OU = max(0.0, Q_h_TU_PL - Ncomp); + + // *VRF OU Te calculations + m_air = this->OUAirFlowRate * RhoAir; + SH_OU = this->SH; + this->VRFOU_TeTc(state, HXOpMode::EvapMode, Q_c_OU, SH_OU, m_air, OutdoorDryBulb, OutdoorHumRat, OutdoorPressure, Tfs, this->EvaporatingTemp); + this->SH = SH_OU; + + Real64 CyclingRatio = 1.0; + // *VRF OU Compressor Simulation at heating mode: Specify the compressor speed and power consumption + this->VRFOU_CalcCompH(state, + TU_HeatingLoad, + this->EvaporatingTemp, + Tdischarge, + h_IU_cond_out_ave, + this->IUCondensingTemp, + CapMinTe, + Tfs, + Pipe_Q_h, + Q_c_OU, + CompSpdActual, + Ncomp_new, + CyclingRatio); + + if ((std::abs(Ncomp_new - Ncomp) > (Tolerance * Ncomp)) && (Counter < 30)) { + Ncomp = Ncomp_new; + Counter = Counter + 1; + goto Label20; + } - // Update h_comp_out in iteration Label23 - P_comp_in = GetSatPressureRefrig(state, this->RefrigerantName, this->EvaporatingTemp, RefrigerantIndex, RoutineName); - RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(P_comp_in, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); - h_comp_in_new = GetSupHeatEnthalpyRefrig(state, - this->RefrigerantName, - max(RefTSat, this->SH + this->EvaporatingTemp), - max(min(P_comp_in, RefPHigh), RefPLow), - RefrigerantIndex, - RoutineName); - h_comp_out_new = Ncomp_new / m_ref_IU_cond + h_comp_in_new; + // Update h_comp_out in iteration Label23 + P_comp_in = GetSatPressureRefrig(state, this->RefrigerantName, this->EvaporatingTemp, RefrigerantIndex, RoutineName); + RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(P_comp_in, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + h_comp_in_new = GetSupHeatEnthalpyRefrig(state, + this->RefrigerantName, + max(RefTSat, this->SH + this->EvaporatingTemp), + max(min(P_comp_in, RefPHigh), RefPLow), + RefrigerantIndex, + RoutineName); + h_comp_out_new = Ncomp_new / m_ref_IU_cond + h_comp_in_new; - if ((std::abs(h_comp_out - h_comp_out_new) > Tolerance * h_comp_out) && (h_IU_cond_in < h_IU_cond_in_up)) { - h_IU_cond_in = h_IU_cond_in + 0.1 * (h_IU_cond_in_up - h_IU_cond_in_low); - goto Label23; - } - if (h_IU_cond_in > h_IU_cond_in_up) { - h_IU_cond_in = 0.5 * (h_IU_cond_in_up + h_IU_cond_in_low); - } - Ncomp = Ncomp_new; + if ((std::abs(h_comp_out - h_comp_out_new) > Tolerance * h_comp_out) && (h_IU_cond_in < h_IU_cond_in_up)) { + h_IU_cond_in = h_IU_cond_in + 0.1 * (h_IU_cond_in_up - h_IU_cond_in_low); + goto Label23; } + if (h_IU_cond_in > h_IU_cond_in_up) { + h_IU_cond_in = 0.5 * (h_IU_cond_in_up + h_IU_cond_in_low); + } + Ncomp = Ncomp_new; // Key outputs of this subroutine this->CompActSpeed = max(CompSpdActual, 0.0); @@ -14487,7 +14468,8 @@ void VRFCondenserEquipment::VRFOU_CalcCompH( Real64 Pipe_Q, // Piping Loss Algorithm Parameter: Heat loss [W] Real64 &OUEvapHeatExtract, // Condenser heat release (cooling mode) [W] Real64 &CompSpdActual, // Actual compressor running speed [rps] - Real64 &Ncomp // Compressor power [W] + Real64 &Ncomp, // Compressor power [W] + Real64 &CyclingRatio // Compressor cycling ratio ) { @@ -14651,9 +14633,13 @@ void VRFCondenserEquipment::VRFOU_CalcCompH( NumIteCcap = NumIteCcap + 1; goto Label19; } - if (CapDiff > (Tolerance * Cap_Eva0)) NumIteCcap = 999; + if (CapDiff > (Tolerance * Cap_Eva0)) { + NumIteCcap = 999; + CyclingRatio = (TU_load + Pipe_Q) * C_cap_operation / Cap_Eva1; + } - Ncomp = this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(CounterCompSpdTemp), T_discharge, T_suction); + Ncomp = this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(CounterCompSpdTemp), T_discharge, T_suction) * CyclingRatio; + OUEvapHeatExtract = CompEvaporatingCAPSpd(1) * CyclingRatio; break; // EXIT DoName2 diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh index 4cd628289b2..4a0f0478ff0 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh @@ -530,7 +530,8 @@ namespace HVACVariableRefrigerantFlow { Real64 Pipe_Q, // Piping Loss Algorithm Parameter: Heat loss [W] Real64 &OUEvapHeatExtract, // Condenser heat release (cooling mode) [W] Real64 &CompSpdActual, // Actual compressor running speed [rps] - Real64 &Ncomp // Compressor power [W] + Real64 &Ncomp, // Compressor power [W] + Real64 &CyclingRatio // Compressor cycling ratio ); void VRFHR_OU_HR_Mode(EnergyPlusData &state, diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index c6f2b82fc46..dfd5bcf9a05 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -2570,6 +2570,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Compressor) Real64 Ncomp = 1058; // Compressor power [W] Real64 CompSpdActual; // Actual compressor running speed [rps] + Real64 CyclingRatio = 1.0; // Run state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CalcCompH(*state, TU_load, @@ -2582,7 +2583,8 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Compressor) Pipe_Q, OUEvapHeatExtract, CompSpdActual, - Ncomp); + Ncomp, + CyclingRatio); // Test EXPECT_NEAR(5110, OUEvapHeatExtract, 1); From aee8c4a2512524aabc95bd119a98f7a9db1667e3 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Tue, 27 Feb 2024 16:14:28 -0800 Subject: [PATCH 011/164] Revert "Move cycling ratio to inside compressor spd calc for heating" This reverts commit 7d79eaca627af62fbe29b2acd5557fff8c3de7e3. --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 134 ++++++++++-------- src/EnergyPlus/HVACVariableRefrigerantFlow.hh | 3 +- .../unit/HVACVariableRefrigerantFlow.unit.cc | 4 +- 3 files changed, 76 insertions(+), 65 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index b3d786b84c0..8c17f4c469b 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -11856,61 +11856,80 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) CapMinTe + 8, this->IUCondensingTemp - 5); - // Required heating load is greater than or equal to the min heating capacity - - // Iteration_Ncomp: Perform iterations to calculate Ncomp (Label20) - Counter = 1; - Label20:; - Ncomp_new = Ncomp; - Q_c_OU = max(0.0, Q_h_TU_PL - Ncomp); - - // *VRF OU Te calculations - m_air = this->OUAirFlowRate * RhoAir; - SH_OU = this->SH; - this->VRFOU_TeTc(state, HXOpMode::EvapMode, Q_c_OU, SH_OU, m_air, OutdoorDryBulb, OutdoorHumRat, OutdoorPressure, Tfs, this->EvaporatingTemp); - this->SH = SH_OU; - - Real64 CyclingRatio = 1.0; - // *VRF OU Compressor Simulation at heating mode: Specify the compressor speed and power consumption - this->VRFOU_CalcCompH(state, - TU_HeatingLoad, - this->EvaporatingTemp, - Tdischarge, - h_IU_cond_out_ave, - this->IUCondensingTemp, - CapMinTe, - Tfs, - Pipe_Q_h, - Q_c_OU, - CompSpdActual, - Ncomp_new, - CyclingRatio); - - if ((std::abs(Ncomp_new - Ncomp) > (Tolerance * Ncomp)) && (Counter < 30)) { - Ncomp = Ncomp_new; - Counter = Counter + 1; - goto Label20; - } + if ((Q_c_OU * C_cap_operation) <= CompEvaporatingCAPSpdMin) { + // Required heating load is smaller than the min heating capacity - // Update h_comp_out in iteration Label23 - P_comp_in = GetSatPressureRefrig(state, this->RefrigerantName, this->EvaporatingTemp, RefrigerantIndex, RoutineName); - RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(P_comp_in, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); - h_comp_in_new = GetSupHeatEnthalpyRefrig(state, - this->RefrigerantName, - max(RefTSat, this->SH + this->EvaporatingTemp), - max(min(P_comp_in, RefPHigh), RefPLow), - RefrigerantIndex, - RoutineName); - h_comp_out_new = Ncomp_new / m_ref_IU_cond + h_comp_in_new; + if (Q_c_OU == 0) { + // Q_h_TU_PL is less than or equal to CompEvaporatingPWRSpdMin + CyclingRatio = Q_h_TU_PL / CompEvaporatingPWRSpdMin; + this->EvaporatingTemp = OutdoorDryBulb; + } else { + // Q_h_TU_PL is greater than CompEvaporatingPWRSpdMin + CyclingRatio = Q_c_OU * C_cap_operation / CompEvaporatingCAPSpdMin; + this->EvaporatingTemp = max(CapMinTe, RefTLow); + } - if ((std::abs(h_comp_out - h_comp_out_new) > Tolerance * h_comp_out) && (h_IU_cond_in < h_IU_cond_in_up)) { - h_IU_cond_in = h_IU_cond_in + 0.1 * (h_IU_cond_in_up - h_IU_cond_in_low); - goto Label23; - } - if (h_IU_cond_in > h_IU_cond_in_up) { - h_IU_cond_in = 0.5 * (h_IU_cond_in_up + h_IU_cond_in_low); + double CyclingRatioFrac = 0.85 + 0.15 * CyclingRatio; + double HPRTF = CyclingRatio / CyclingRatioFrac; + Ncomp = CompEvaporatingPWRSpdMin * HPRTF; + CompSpdActual = this->CompressorSpeed(1); + + } else { + // Required heating load is greater than or equal to the min heating capacity + + // Iteration_Ncomp: Perform iterations to calculate Ncomp (Label20) + Counter = 1; + Label20:; + Ncomp_new = Ncomp; + Q_c_OU = max(0.0, Q_h_TU_PL - Ncomp); + + // *VRF OU Te calculations + m_air = this->OUAirFlowRate * RhoAir; + SH_OU = this->SH; + this->VRFOU_TeTc( + state, HXOpMode::EvapMode, Q_c_OU, SH_OU, m_air, OutdoorDryBulb, OutdoorHumRat, OutdoorPressure, Tfs, this->EvaporatingTemp); + this->SH = SH_OU; + + // *VRF OU Compressor Simulation at heating mode: Specify the compressor speed and power consumption + this->VRFOU_CalcCompH(state, + TU_HeatingLoad, + this->EvaporatingTemp, + Tdischarge, + h_IU_cond_out_ave, + this->IUCondensingTemp, + CapMinTe, + Tfs, + Pipe_Q_h, + Q_c_OU, + CompSpdActual, + Ncomp_new); + + if ((std::abs(Ncomp_new - Ncomp) > (Tolerance * Ncomp)) && (Counter < 30)) { + Ncomp = Ncomp_new; + Counter = Counter + 1; + goto Label20; + } + + // Update h_comp_out in iteration Label23 + P_comp_in = GetSatPressureRefrig(state, this->RefrigerantName, this->EvaporatingTemp, RefrigerantIndex, RoutineName); + RefTSat = GetSatTemperatureRefrig(state, this->RefrigerantName, max(min(P_comp_in, RefPHigh), RefPLow), RefrigerantIndex, RoutineName); + h_comp_in_new = GetSupHeatEnthalpyRefrig(state, + this->RefrigerantName, + max(RefTSat, this->SH + this->EvaporatingTemp), + max(min(P_comp_in, RefPHigh), RefPLow), + RefrigerantIndex, + RoutineName); + h_comp_out_new = Ncomp_new / m_ref_IU_cond + h_comp_in_new; + + if ((std::abs(h_comp_out - h_comp_out_new) > Tolerance * h_comp_out) && (h_IU_cond_in < h_IU_cond_in_up)) { + h_IU_cond_in = h_IU_cond_in + 0.1 * (h_IU_cond_in_up - h_IU_cond_in_low); + goto Label23; + } + if (h_IU_cond_in > h_IU_cond_in_up) { + h_IU_cond_in = 0.5 * (h_IU_cond_in_up + h_IU_cond_in_low); + } + Ncomp = Ncomp_new; } - Ncomp = Ncomp_new; // Key outputs of this subroutine this->CompActSpeed = max(CompSpdActual, 0.0); @@ -14468,8 +14487,7 @@ void VRFCondenserEquipment::VRFOU_CalcCompH( Real64 Pipe_Q, // Piping Loss Algorithm Parameter: Heat loss [W] Real64 &OUEvapHeatExtract, // Condenser heat release (cooling mode) [W] Real64 &CompSpdActual, // Actual compressor running speed [rps] - Real64 &Ncomp, // Compressor power [W] - Real64 &CyclingRatio // Compressor cycling ratio + Real64 &Ncomp // Compressor power [W] ) { @@ -14633,13 +14651,9 @@ void VRFCondenserEquipment::VRFOU_CalcCompH( NumIteCcap = NumIteCcap + 1; goto Label19; } - if (CapDiff > (Tolerance * Cap_Eva0)) { - NumIteCcap = 999; - CyclingRatio = (TU_load + Pipe_Q) * C_cap_operation / Cap_Eva1; - } + if (CapDiff > (Tolerance * Cap_Eva0)) NumIteCcap = 999; - Ncomp = this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(CounterCompSpdTemp), T_discharge, T_suction) * CyclingRatio; - OUEvapHeatExtract = CompEvaporatingCAPSpd(1) * CyclingRatio; + Ncomp = this->RatedCompPower * CurveValue(state, this->OUCoolingPWRFT(CounterCompSpdTemp), T_discharge, T_suction); break; // EXIT DoName2 diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh index 4a0f0478ff0..4cd628289b2 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh @@ -530,8 +530,7 @@ namespace HVACVariableRefrigerantFlow { Real64 Pipe_Q, // Piping Loss Algorithm Parameter: Heat loss [W] Real64 &OUEvapHeatExtract, // Condenser heat release (cooling mode) [W] Real64 &CompSpdActual, // Actual compressor running speed [rps] - Real64 &Ncomp, // Compressor power [W] - Real64 &CyclingRatio // Compressor cycling ratio + Real64 &Ncomp // Compressor power [W] ); void VRFHR_OU_HR_Mode(EnergyPlusData &state, diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index dfd5bcf9a05..c6f2b82fc46 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -2570,7 +2570,6 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Compressor) Real64 Ncomp = 1058; // Compressor power [W] Real64 CompSpdActual; // Actual compressor running speed [rps] - Real64 CyclingRatio = 1.0; // Run state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CalcCompH(*state, TU_load, @@ -2583,8 +2582,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Compressor) Pipe_Q, OUEvapHeatExtract, CompSpdActual, - Ncomp, - CyclingRatio); + Ncomp); // Test EXPECT_NEAR(5110, OUEvapHeatExtract, 1); From 97349228502d8300d10345c019d2dbd9356db2b5 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 28 Feb 2024 16:13:09 -0800 Subject: [PATCH 012/164] move fan mult RTF to after OU update, as other branch updates RTF --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 8c17f4c469b..b1cad9c5de0 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -283,6 +283,29 @@ void SimulateVRF(EnergyPlusData &state, if (state.dataHVACVarRefFlow->VRF(VRFCondenser).CondenserType == DataHeatBalance::RefrigCondenserType::Water) UpdateVRFCondenser(state, VRFCondenser); } + if (state.dataHVACVarRefFlow->VRF(VRFCondenser).VRFAlgorithmType == AlgorithmType::FluidTCtrl) { + // consider cycling in fan calculation + for (int TUListNum = 1; TUListNum <= state.dataHVACVarRefFlow->NumVRFTULists; ++TUListNum) { + auto &thisTUList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum); + for (int TUNum = 1; TUNum <= thisTUList.NumTUInList; ++TUNum) { + int heatingCoilNum = state.dataHVACVarRefFlow->VRFTU(TUNum).HeatCoilIndex; + int coolingCoilNum = state.dataHVACVarRefFlow->VRFTU(TUNum).CoolCoilIndex; + auto &heatingCoil = state.dataDXCoils->DXCoil(heatingCoilNum); + auto &coolingCoil = state.dataDXCoils->DXCoil(coolingCoilNum); + int fanIndex = state.dataHVACVarRefFlow->VRFTU(TUNum).FanIndex; + // only deal with cooling for now. heating RTF might have some issue + // does Fan:SystemModel need adjustment as well? if so consider 0-indexing and it's in state.dataHVACFan->fanObjs vector + if (fanIndex > 0 && heatingCoil.HeatingCoilRuntimeFraction == 0.0) { // in cooling mode + // here coolingCoil.CoolingCoilRuntimeFraction equals state.dataHVACVarRefFlow->VRF(VRFCond).VRFCondCyclingRatio + // this is not the case for heating + auto &fan = state.dataFans->Fan(fanIndex); + fan.FanPower *= coolingCoil.CoolingCoilRuntimeFraction; + fan.FanEnergy = fan.FanPower * state.dataHVACGlobal->TimeStepSysSec; + fan.PowerLossToAir *= coolingCoil.CoolingCoilRuntimeFraction; + } + } + } + } } PlantComponent *VRFCondenserEquipment::factory(EnergyPlusData &state, std::string const &objectName) @@ -12481,27 +12504,6 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) this->ElecHeatingPower = 0; } this->VRFCondRTF = VRFRTF; - // consider cycling in fan calculation - for (int TUListNum = 1; TUListNum <= state.dataHVACVarRefFlow->NumVRFTULists; ++TUListNum) { - auto &thisTUList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum); - for (int TUNum = 1; TUNum <= thisTUList.NumTUInList; ++TUNum) { - int heatingCoilNum = state.dataHVACVarRefFlow->VRFTU(TUNum).HeatCoilIndex; - int coolingCoilNum = state.dataHVACVarRefFlow->VRFTU(TUNum).CoolCoilIndex; - auto &heatingCoil = state.dataDXCoils->DXCoil(heatingCoilNum); - auto &coolingCoil = state.dataDXCoils->DXCoil(coolingCoilNum); - int fanIndex = state.dataHVACVarRefFlow->VRFTU(TUNum).FanIndex; - // only deal with cooling for now. heating RTF might have some issue - // does Fan:SystemModel need adjustment as well? if so consider 0-indexing and it's in state.dataHVACFan->fanObjs vector - if (fanIndex > 0 && heatingCoil.HeatingCoilRuntimeFraction == 0.0) { // in cooling mode - // here coolingCoil.CoolingCoilRuntimeFraction equals state.dataHVACVarRefFlow->VRF(VRFCond).VRFCondCyclingRatio - // this is not the case for heating - auto &fan = state.dataFans->Fan(fanIndex); - fan.FanPower *= coolingCoil.CoolingCoilRuntimeFraction; - fan.FanEnergy = fan.FanPower * state.dataHVACGlobal->TimeStepSysSec; - fan.PowerLossToAir *= coolingCoil.CoolingCoilRuntimeFraction; - } - } - } // Calculate CrankCaseHeaterPower: VRF Heat Pump Crankcase Heater Electric Power [W] if (this->MaxOATCCHeater > OutdoorDryBulb) { From 740bd9274ed6e9d96de530ff8229b8a7069c77f6 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 6 Mar 2024 15:28:55 -0800 Subject: [PATCH 013/164] add test for OU fan power change --- tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index c6f2b82fc46..ab63d1169a7 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -13225,6 +13225,10 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) EXPECT_NEAR(4999.8265, thisVRFTU.TotalCoolingRate, 0.0001); EXPECT_NEAR(125.2573 * thisDXCoolingCoil.CoolingCoilRuntimeFraction, thisFan.FanPower, 0.0001); EXPECT_NEAR(thisDXCoolingCoil.TotalCoolingEnergyRate, (thisVRFTU.TotalCoolingRate + thisFan.FanPower), 0.0001); + EXPECT_NEAR(0.8930, state->dataHVACVarRefFlow->VRF(1).VRFCondCyclingRatio, 0.0001); + EXPECT_NEAR(state->dataHVACVarRefFlow->VRF(1).OUFanPower, + state->dataHVACVarRefFlow->VRF(1).RatedOUFanPower * state->dataHVACVarRefFlow->VRF(1).VRFCondCyclingRatio, + 0.0001); } // Test for #7648: HREIRFTHeat wrongly used HRCAPFTHeatConst. Occurs only if you have Heat Recovery From 902baeac0014b622ffe8d7b26c1c93378ad9d12c Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Fri, 8 Mar 2024 11:45:18 -0800 Subject: [PATCH 014/164] clang-format --- .../unit/HVACVariableRefrigerantFlow.unit.cc | 468 +++++++++--------- 1 file changed, 233 insertions(+), 235 deletions(-) diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index ab63d1169a7..a8498472a93 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -2487,109 +2487,109 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Compressor) } // Run and Check: VRFOU_CompSpd - { // Test the method VRFOU_CompSpd, which calculates the compressor speed at given - // operational conditions to meet the evaporator or condenser capacity provided. + {// Test the method VRFOU_CompSpd, which calculates the compressor speed at given + // operational conditions to meet the evaporator or condenser capacity provided. - { // a. Evaporator + {// a. Evaporator - // Inputs_condition - Real64 constexpr Q_req = 6971; // Required capacity [W] - Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] - Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] - Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] - Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] - Real64 CompSpdActual; // Actual compressor running speed [rps] + // Inputs_condition + Real64 constexpr Q_req = 6971; // Required capacity [W] + Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] + Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] + Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] + Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] + Real64 CompSpdActual; // Actual compressor running speed [rps] - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( - *state, Q_req, HXOpMode::EvapMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( + *state, Q_req, HXOpMode::EvapMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); - // Test - EXPECT_NEAR(1295, CompSpdActual, 5); - } - - { - // b. Condenser - - // Inputs_condition - Real64 constexpr Q_req = 6953; // Required capacity [W] - Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] - Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] - Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] - Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] - Real64 CompSpdActual; // Actual compressor running speed [rps] - - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( - *state, Q_req, HXOpMode::CondMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); - - // Test - EXPECT_NEAR(950, CompSpdActual, 5); - } - } // namespace EnergyPlus - - // Run and Check: VRFOU_CompCap - { - // Test the method VRFOU_CompCap, which calculates the compressor performance (power and capacity) - // at given compressor speed and operational conditions. - - // Inputs_condition - Real64 constexpr CompSpdActual = 1298; // Actual compressor running speed [rps] - Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] - Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] - Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] - Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] - Real64 Q_c_tot; // Compressor evaporative capacity [W] - Real64 Ncomp; // Compressor power [W] - - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompCap(*state, CompSpdActual, T_suction, T_discharge, h_IU_evap_in, h_comp_in, Q_c_tot, Ncomp); - - // Test - EXPECT_NEAR(6990, Q_c_tot, 10); - EXPECT_NEAR(1601, Ncomp, 10); - } - - // Run and Check: VRFOU_CalcComp - { - // Test the method VRFOU_CalcCompH, which simulates the compressor performance at given oprtaional conditions. More specifically, it - // sepcifies the compressor speed to provide sufficient evaporative capacity, and calculate the power of the compressor running at the - // specified speed. Note that it may be needed to manipulate the operational conditions to further adjust system capacity at low load - // conditions. The low load modification logics are different for cooling mode and heating mode. + // Test + EXPECT_NEAR(1295, CompSpdActual, 5); +} - // Inputs_condition - Real64 TU_load = 6006; // Indoor unit cooling load [W] - Real64 T_suction = 8.86; // Compressor suction temperature Te' [C] - Real64 T_discharge = 40.26; // Compressor discharge temperature Tc' [C] - Real64 Pipe_h_out_ave = 233428; // Average Enthalpy of the refrigerant leaving IUs [kJ/kg] - Real64 IUMaxCondTemp = 36; // VRV IU condensing temperature, max among all indoor units [C] - Real64 MinOutdoorUnitTe = -72; // The minimum temperature that OU Te can be at cooling mode (only used for calculating Min capacity) - Real64 Tfs = 10.90; // Temperature of the air at the OU evaporator coil surface [C]] - Real64 Pipe_Q = 162.67; // Piping Loss Algorithm Parameter: Heat loss [W] - Real64 OUEvapHeatExtract = 5110.40; // Evaporator heat extract [W] - Real64 Ncomp = 1058; // Compressor power [W] - Real64 CompSpdActual; // Actual compressor running speed [rps] +{ + // b. Condenser + + // Inputs_condition + Real64 constexpr Q_req = 6953; // Required capacity [W] + Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] + Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] + Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] + Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] + Real64 CompSpdActual; // Actual compressor running speed [rps] + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompSpd( + *state, Q_req, HXOpMode::CondMode, T_suction, T_discharge, h_IU_evap_in, h_comp_in, CompSpdActual); + + // Test + EXPECT_NEAR(950, CompSpdActual, 5); +} +} // namespace EnergyPlus - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CalcCompH(*state, - TU_load, - T_suction, - T_discharge, - Pipe_h_out_ave, - IUMaxCondTemp, - MinOutdoorUnitTe, - Tfs, - Pipe_Q, - OUEvapHeatExtract, - CompSpdActual, - Ncomp); +// Run and Check: VRFOU_CompCap +{ + // Test the method VRFOU_CompCap, which calculates the compressor performance (power and capacity) + // at given compressor speed and operational conditions. + + // Inputs_condition + Real64 constexpr CompSpdActual = 1298; // Actual compressor running speed [rps] + Real64 constexpr T_suction = -13.35; // Compressor suction temperature Te' [C] + Real64 constexpr T_discharge = 36.37; // Compressor discharge temperature Tc' [C] + Real64 constexpr h_IU_evap_in = 225016; // Enthalpy of IU at inlet, for C_cap_operation calculation [kJ/kg] + Real64 constexpr h_comp_in = 429529; // Enthalpy after piping loss (compressor inlet), for C_cap_operation calculation [kJ/kg] + Real64 Q_c_tot; // Compressor evaporative capacity [W] + Real64 Ncomp; // Compressor power [W] + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CompCap(*state, CompSpdActual, T_suction, T_discharge, h_IU_evap_in, h_comp_in, Q_c_tot, Ncomp); + + // Test + EXPECT_NEAR(6990, Q_c_tot, 10); + EXPECT_NEAR(1601, Ncomp, 10); +} - // Test - EXPECT_NEAR(5110, OUEvapHeatExtract, 1); - EXPECT_NEAR(1500, CompSpdActual, 1); - EXPECT_NEAR(2080, Ncomp, 1); - EXPECT_EQ(state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRFTU(1).VRFTUInletNodeNum).MassFlowRate, 0.0); - } +// Run and Check: VRFOU_CalcComp +{ + // Test the method VRFOU_CalcCompH, which simulates the compressor performance at given oprtaional conditions. More specifically, it + // sepcifies the compressor speed to provide sufficient evaporative capacity, and calculate the power of the compressor running at the + // specified speed. Note that it may be needed to manipulate the operational conditions to further adjust system capacity at low load + // conditions. The low load modification logics are different for cooling mode and heating mode. + + // Inputs_condition + Real64 TU_load = 6006; // Indoor unit cooling load [W] + Real64 T_suction = 8.86; // Compressor suction temperature Te' [C] + Real64 T_discharge = 40.26; // Compressor discharge temperature Tc' [C] + Real64 Pipe_h_out_ave = 233428; // Average Enthalpy of the refrigerant leaving IUs [kJ/kg] + Real64 IUMaxCondTemp = 36; // VRV IU condensing temperature, max among all indoor units [C] + Real64 MinOutdoorUnitTe = -72; // The minimum temperature that OU Te can be at cooling mode (only used for calculating Min capacity) + Real64 Tfs = 10.90; // Temperature of the air at the OU evaporator coil surface [C]] + Real64 Pipe_Q = 162.67; // Piping Loss Algorithm Parameter: Heat loss [W] + Real64 OUEvapHeatExtract = 5110.40; // Evaporator heat extract [W] + Real64 Ncomp = 1058; // Compressor power [W] + Real64 CompSpdActual; // Actual compressor running speed [rps] + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_CalcCompH(*state, + TU_load, + T_suction, + T_discharge, + Pipe_h_out_ave, + IUMaxCondTemp, + MinOutdoorUnitTe, + Tfs, + Pipe_Q, + OUEvapHeatExtract, + CompSpdActual, + Ncomp); + + // Test + EXPECT_NEAR(5110, OUEvapHeatExtract, 1); + EXPECT_NEAR(1500, CompSpdActual, 1); + EXPECT_NEAR(2080, Ncomp, 1); + EXPECT_EQ(state->dataLoopNodes->Node(state->dataHVACVarRefFlow->VRFTU(1).VRFTUInletNodeNum).MassFlowRate, 0.0); +} } TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Coil) @@ -2632,165 +2632,163 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_VRFOU_Coil) InitializePsychRoutines(*state); // Run and Check: VRFOU_Cap - { // Test the method VRFOU_Cap, which determines the VRF OU heat transfer rate, given refrigerant side temperature, - // i.e., condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. - { // a. Condenser - - // Inputs_condition - m_air = 3.6; - OutDryBulbTemp = 28; - OutHumRat = 0.0146; - SC = 1; - Tdischarge = 36; - - // Run - Q_h_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::CondMode, Tdischarge, SC, m_air, OutDryBulbTemp, OutHumRat); - - // Test - EXPECT_NEAR(27551, Q_h_OU, 10); - } + { // Test the method VRFOU_Cap, which determines the VRF OU heat transfer rate, given refrigerant side temperature, + // i.e., condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. + {// a. Condenser + + // Inputs_condition + m_air = 3.6; + OutDryBulbTemp = 28; + OutHumRat = 0.0146; + SC = 1; + Tdischarge = 36; + + // Run + Q_h_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::CondMode, Tdischarge, SC, m_air, OutDryBulbTemp, OutHumRat); + + // Test + EXPECT_NEAR(27551, Q_h_OU, 10); +} - { - // b. Evaporator +{ + // b. Evaporator - // Inputs_condition - m_air = 3.6; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - SH = 1; - Tsuction = -3; + // Inputs_condition + m_air = 3.6; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + SH = 1; + Tsuction = -3; - // Run - Q_c_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::EvapMode, Tsuction, SH, m_air, OutDryBulbTemp, OutHumRat); + // Run + Q_c_OU = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_Cap(*state, HXOpMode::EvapMode, Tsuction, SH, m_air, OutDryBulbTemp, OutHumRat); - // Test - EXPECT_NEAR(24456, Q_c_OU, 10); - } - } // namespace EnergyPlus - - // Run and Check: VRFOU_FlowRate - { // Test the method VRFOU_Cap, which calculates the outdoor unit fan flow rate, given VRF OU load and refrigerant side temperature, i.e., - // condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. - { // a. Condenser - - // Inputs_condition - Q_h_OU = 27551; - OutDryBulbTemp = 28; - OutHumRat = 0.0146; - SC = 1; - Tdischarge = 36; - - // Run - m_air = - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::CondMode, Tdischarge, SC, Q_h_OU, OutDryBulbTemp, OutHumRat); - - // Test - EXPECT_NEAR(3.6, m_air, 0.01); - } + // Test + EXPECT_NEAR(24456, Q_c_OU, 10); +} +} // namespace EnergyPlus - { - // b. Evaporator +// Run and Check: VRFOU_FlowRate +{ // Test the method VRFOU_Cap, which calculates the outdoor unit fan flow rate, given VRF OU load and refrigerant side temperature, i.e., + // condensing temperature and SC for condenser, or evaporating temperature and SH for evaporator. + {// a. Condenser - // Inputs_condition - Q_c_OU = 24456; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - SH = 1; - Tsuction = -3; + // Inputs_condition + Q_h_OU = 27551; +OutDryBulbTemp = 28; +OutHumRat = 0.0146; +SC = 1; +Tdischarge = 36; - // Run - m_air = - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::EvapMode, Tsuction, SH, Q_c_OU, OutDryBulbTemp, OutHumRat); +// Run +m_air = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::CondMode, Tdischarge, SC, Q_h_OU, OutDryBulbTemp, OutHumRat); - // Test - EXPECT_NEAR(3.6, m_air, 0.01); - } - } +// Test +EXPECT_NEAR(3.6, m_air, 0.01); +} - // Run and Check: VRFOU_TeTc - { // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature - // at cooling mode, or evaporating temperature at heating mode, given the coil heat - // release/extract amount and air side parameters. - { // a. Condenser - - // Inputs_condition - m_air = 3.6; - Q_h_OU = 27551; - OutDryBulbTemp = 28; - OutHumRat = 0.0146; - SC = 1; - - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( - *state, HXOpMode::CondMode, Q_h_OU, SC, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tdischarge); - - // Test - EXPECT_NEAR(36, Tdischarge, 0.05); - } +{ + // b. Evaporator - { - // b. Evaporator + // Inputs_condition + Q_c_OU = 24456; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + SH = 1; + Tsuction = -3; - // Inputs_condition - m_air = 3.6; - Q_c_OU = 24456; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - SH = 1; - Tsuction = -3; + // Run + m_air = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_FlowRate(*state, HXOpMode::EvapMode, Tsuction, SH, Q_c_OU, OutDryBulbTemp, OutHumRat); + + // Test + EXPECT_NEAR(3.6, m_air, 0.01); +} +} - // Run - state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( - *state, HXOpMode::EvapMode, Q_c_OU, SH, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tsuction); +// Run and Check: VRFOU_TeTc +{ // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature + // at cooling mode, or evaporating temperature at heating mode, given the coil heat + // release/extract amount and air side parameters. + {// a. Condenser + + // Inputs_condition + m_air = 3.6; +Q_h_OU = 27551; +OutDryBulbTemp = 28; +OutHumRat = 0.0146; +SC = 1; + +// Run +state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( + *state, HXOpMode::CondMode, Q_h_OU, SC, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tdischarge); + +// Test +EXPECT_NEAR(36, Tdischarge, 0.05); +} - // Test - EXPECT_NEAR(-3, Tsuction, 0.05); - } - } +{ + // b. Evaporator + + // Inputs_condition + m_air = 3.6; + Q_c_OU = 24456; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + SH = 1; + Tsuction = -3; + + // Run + state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_TeTc( + *state, HXOpMode::EvapMode, Q_c_OU, SH, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress, temp, Tsuction); + + // Test + EXPECT_NEAR(-3, Tsuction, 0.05); +} +} - // Run and Check: VRFOU_SCSH +// Run and Check: VRFOU_SCSH +{ + // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature + // at cooling mode, or evaporating temperature at heating mode, given the coil heat + // release/extract amount and air side parameters. { - // Test the method VRFOU_Cap, which calculates the VRF OU refrigerant side temperature, i.e., condensing temperature - // at cooling mode, or evaporating temperature at heating mode, given the coil heat - // release/extract amount and air side parameters. - { - // a. Condenser - - // Inputs_condition - m_air = 3.6; - Q_h_OU = 27551; - OutDryBulbTemp = 28; - OutHumRat = 0.0146; - Tdischarge = 36; - - // Run - SC = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( - *state, HXOpMode::CondMode, Q_h_OU, Tdischarge, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); - - // Test - EXPECT_NEAR(1, SC, 0.01); - } + // a. Condenser + + // Inputs_condition + m_air = 3.6; + Q_h_OU = 27551; + OutDryBulbTemp = 28; + OutHumRat = 0.0146; + Tdischarge = 36; - { - // b. Evaporator + // Run + SC = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( + *state, HXOpMode::CondMode, Q_h_OU, Tdischarge, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); - // Inputs_condition - m_air = 3.6; - Q_c_OU = 24456; - OutDryBulbTemp = 7; - OutHumRat = 0.0019; - Tsuction = -3; + // Test + EXPECT_NEAR(1, SC, 0.01); + } - // Run - SH = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( - *state, HXOpMode::EvapMode, Q_c_OU, Tsuction, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); + { + // b. Evaporator - // Test - EXPECT_NEAR(1, SH, 0.01); - } + // Inputs_condition + m_air = 3.6; + Q_c_OU = 24456; + OutDryBulbTemp = 7; + OutHumRat = 0.0019; + Tsuction = -3; + + // Run + SH = state->dataHVACVarRefFlow->VRF(VRFCond).VRFOU_SCSH( + *state, HXOpMode::EvapMode, Q_c_OU, Tsuction, m_air, OutDryBulbTemp, OutHumRat, OutBaroPress); + + // Test + EXPECT_NEAR(1, SH, 0.01); } - // Clean up - state->dataHVACVarRefFlow->VRF.deallocate(); +} +// Clean up +state->dataHVACVarRefFlow->VRF.deallocate(); } TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_GetCoilInput) From c4c306708224a2f51d142eaf032425cd20cd2474 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Fri, 10 May 2024 18:11:43 -0700 Subject: [PATCH 015/164] Use OnOffFanPartLoadFraction to control fan power response to this comment https://github.com/NREL/EnergyPlus/pull/10341#discussion_r1586858043 accumulated coil runtime fraction to the OnOffFanPartLoadFraction variable and accessed in SimVariableVolumeFan Not sure if it's good, might affect other models. --- src/EnergyPlus/DXCoils.cc | 2 +- src/EnergyPlus/Fans.cc | 1 + src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 23 ------------------- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index e8170e723bb..a4cb24464a8 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -16932,7 +16932,7 @@ void CalcVRFCoolingCoil_FluidTCtrl(EnergyPlusData &state, } // If cycling fan, send coil part-load fraction to on/off fan via HVACDataGlobals - if (FanOpMode == CycFanCycCoil) state.dataHVACGlobal->OnOffFanPartLoadFraction = PLF; + if (FanOpMode == CycFanCycCoil) state.dataHVACGlobal->OnOffFanPartLoadFraction = thisDXCoil.CoolingCoilRuntimeFraction; // Check for saturation error and modify temperature at constant enthalpy if (OutletAirTemp < PsyTsatFnHPb(state, OutletAirEnthalpy, OutdoorPressure)) { diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 6c86e82c2af..4b9c22ba014 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -1773,6 +1773,7 @@ void SimVariableVolumeFan(EnergyPlusData &state, int const FanNum, ObjexxFCL::Op fan.MassFlowRateMaxAvail = 0.0; fan.MassFlowRateMinAvail = 0.0; } + fan.FanPower *= state.dataHVACGlobal->OnOffFanPartLoadFraction; } void SimOnOffFan(EnergyPlusData &state, int const FanNum, ObjexxFCL::Optional SpeedRatio) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index b1cad9c5de0..e33e2531001 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -283,29 +283,6 @@ void SimulateVRF(EnergyPlusData &state, if (state.dataHVACVarRefFlow->VRF(VRFCondenser).CondenserType == DataHeatBalance::RefrigCondenserType::Water) UpdateVRFCondenser(state, VRFCondenser); } - if (state.dataHVACVarRefFlow->VRF(VRFCondenser).VRFAlgorithmType == AlgorithmType::FluidTCtrl) { - // consider cycling in fan calculation - for (int TUListNum = 1; TUListNum <= state.dataHVACVarRefFlow->NumVRFTULists; ++TUListNum) { - auto &thisTUList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum); - for (int TUNum = 1; TUNum <= thisTUList.NumTUInList; ++TUNum) { - int heatingCoilNum = state.dataHVACVarRefFlow->VRFTU(TUNum).HeatCoilIndex; - int coolingCoilNum = state.dataHVACVarRefFlow->VRFTU(TUNum).CoolCoilIndex; - auto &heatingCoil = state.dataDXCoils->DXCoil(heatingCoilNum); - auto &coolingCoil = state.dataDXCoils->DXCoil(coolingCoilNum); - int fanIndex = state.dataHVACVarRefFlow->VRFTU(TUNum).FanIndex; - // only deal with cooling for now. heating RTF might have some issue - // does Fan:SystemModel need adjustment as well? if so consider 0-indexing and it's in state.dataHVACFan->fanObjs vector - if (fanIndex > 0 && heatingCoil.HeatingCoilRuntimeFraction == 0.0) { // in cooling mode - // here coolingCoil.CoolingCoilRuntimeFraction equals state.dataHVACVarRefFlow->VRF(VRFCond).VRFCondCyclingRatio - // this is not the case for heating - auto &fan = state.dataFans->Fan(fanIndex); - fan.FanPower *= coolingCoil.CoolingCoilRuntimeFraction; - fan.FanEnergy = fan.FanPower * state.dataHVACGlobal->TimeStepSysSec; - fan.PowerLossToAir *= coolingCoil.CoolingCoilRuntimeFraction; - } - } - } - } } PlantComponent *VRFCondenserEquipment::factory(EnergyPlusData &state, std::string const &objectName) From 154343d15f1d23ee6693bdf6b89222c354cb8dec Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Mon, 13 May 2024 09:51:32 -0700 Subject: [PATCH 016/164] resolve merge conflict --- src/EnergyPlus/Fans.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 6df784cc36b..2db5a325677 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -1866,7 +1866,6 @@ void FanComponent::simulateVAV(EnergyPlusData &state, ObjexxFCL::OptionalOnOffFanPartLoadFraction; -} } // FanComponent::SimVAV() void FanComponent::simulateOnOff(EnergyPlusData &state, ObjexxFCL::Optional _speedRatio) From cf886aa43523f04d29d21ef7e1dcbaa72f88950b Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 22 May 2024 13:51:53 -0700 Subject: [PATCH 017/164] move fan power mod out of SimulateVAV resolving regression diffs --- src/EnergyPlus/Fans.cc | 1 - src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 2db5a325677..39b2e5a5040 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -1865,7 +1865,6 @@ void FanComponent::simulateVAV(EnergyPlusData &state, ObjexxFCL::OptionalOnOffFanPartLoadFraction; } // FanComponent::SimVAV() void FanComponent::simulateOnOff(EnergyPlusData &state, ObjexxFCL::Optional _speedRatio) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index ed63ece2202..457b5c767dd 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12841,6 +12841,10 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state, } } + if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).OpMode == HVAC::CycFanCycCoil && + state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType == HVAC::FanType::VAV) { + state.dataFans->fans(this->FanIndex)->totalPower *= state.dataHVACGlobal->OnOffFanPartLoadFraction; + } // track fan power per terminal unit for calculating COP this->FanPower = state.dataFans->fans(this->FanIndex)->totalPower; From aef9b67a9e13566756946fc590596ae0c627fa03 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 22 May 2024 14:23:22 -0700 Subject: [PATCH 018/164] resolve unit test by init compressor cycling ratio now the compressor cycling ratio is needed in the calculation as it affects the OnOffFanPartLoadFraction value, which affects fan power --- tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 8961567353e..ad1eaded23a 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -18155,6 +18155,9 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_SupplementalHtgCoilTest) GetVRFInput(*state); state->dataHVACVarRefFlow->GetVRFInputFlag = false; + state->dataHVACGlobal->OnOffFanPartLoadFraction = 1.0; + state->dataHVACVarRefFlow->VRF(VRFCond).VRFCondCyclingRatio = 1.0; + state->dataScheduleMgr->Schedule(state->dataHVACVarRefFlow->VRF(VRFCond).SchedPtr).CurrentValue = 1.0; VRFTUNum = zone_num_TU1; state->dataScheduleMgr->Schedule(state->dataHVACVarRefFlow->VRFTU(VRFTUNum).SchedPtr).CurrentValue = 1.0; @@ -20268,6 +20271,9 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_offSupplementalHtgCoilTest) GetVRFInput(*state); state->dataHVACVarRefFlow->GetVRFInputFlag = false; + state->dataHVACGlobal->OnOffFanPartLoadFraction = 1.0; + state->dataHVACVarRefFlow->VRF(VRFCond).VRFCondCyclingRatio = 1.0; + state->dataScheduleMgr->Schedule(state->dataHVACVarRefFlow->VRF(VRFCond).SchedPtr).CurrentValue = 1.0; VRFTUNum = zone_num_TU1; state->dataScheduleMgr->Schedule(state->dataHVACVarRefFlow->VRFTU(VRFTUNum).SchedPtr).CurrentValue = 1.0; From 26414a6f897d99351d7718b3d44a49cadfbfb148 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 29 May 2024 18:06:40 -0700 Subject: [PATCH 019/164] resolve build error from merge --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 577724b440c..fcb718818ef 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12852,7 +12852,7 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state, } } - if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).OpMode == HVAC::CycFanCycCoil && + if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanOp == HVAC::FanOp::Cycling && state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType == HVAC::FanType::VAV) { state.dataFans->fans(this->FanIndex)->totalPower *= state.dataHVACGlobal->OnOffFanPartLoadFraction; } From 9de83a18a2dc02f4b9a180a76a45fd3f5dda19bd Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 12 Jun 2024 14:20:42 -0700 Subject: [PATCH 020/164] use optional arg in SimulateVAV to control for cycling --- src/EnergyPlus/Fans.cc | 8 +++++-- src/EnergyPlus/Fans.hh | 22 +++++++++++-------- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 11 +++++----- 3 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 948c3084e3a..c5972d085a8 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -103,6 +103,7 @@ void FanBase::simulate(EnergyPlusData &state, // the legacy speed ratio that was used with SimulateFanComponents. ObjexxFCL::Optional _pressureRise, // Pressure difference to use for DeltaPress, for rating DX coils at a ObjexxFCL::Optional _flowFraction, // when used, this directs the fan to set the flow at this flow fraction + ObjexxFCL::Optional _onOffFanPartLoadFraction, // to control for cycling in VAV fan in VRFFluidTCtrl // different pressure without entire duct system ObjexxFCL::Optional _massFlowRate1, // Mass flow rate in operating mode 1 [kg/s] ObjexxFCL::Optional _runTimeFraction1, // Run time fraction in operating mode 1 @@ -138,7 +139,7 @@ void FanBase::simulate(EnergyPlusData &state, _thisFan->simulateConstant(state); } break; case HVAC::FanType::VAV: { - _thisFan->simulateVAV(state, _pressureRise); + _thisFan->simulateVAV(state, _pressureRise, _onOffFanPartLoadFraction); } break; case HVAC::FanType::OnOff: { _thisFan->simulateOnOff(state, _speedRatio); @@ -1700,7 +1701,9 @@ void FanComponent::simulateConstant(EnergyPlusData &state) } } // FanComponent::simulateConstant -void FanComponent::simulateVAV(EnergyPlusData &state, ObjexxFCL::Optional _pressureRise) +void FanComponent::simulateVAV(EnergyPlusData &state, + ObjexxFCL::Optional _pressureRise, + ObjexxFCL::Optional _onOffFanPartLoadFraction) { // SUBROUTINE INFORMATION: @@ -1866,6 +1869,7 @@ void FanComponent::simulateVAV(EnergyPlusData &state, ObjexxFCL::Optional _speedRatio) diff --git a/src/EnergyPlus/Fans.hh b/src/EnergyPlus/Fans.hh index 9c47a241c84..fb4de15706a 100644 --- a/src/EnergyPlus/Fans.hh +++ b/src/EnergyPlus/Fans.hh @@ -97,14 +97,15 @@ namespace Fans { virtual void init(EnergyPlusData &state) = 0; virtual void simulate(EnergyPlusData &state, bool const FirstHVACIteration, - ObjexxFCL::Optional speedRatio = _, // Flow fraction in operating mode 1 - ObjexxFCL::Optional pressureRise = _, // Pressure difference to use for DeltaPress - ObjexxFCL::Optional flowFraction = _, // Flow fraction in operating mode 1 - ObjexxFCL::Optional massFlowRate1 = _, // Mass flow rate in operating mode 1 [kg/s] - ObjexxFCL::Optional runTimeFraction1 = _, // Run time fraction in operating mode 1 - ObjexxFCL::Optional massFlowRate2 = _, // Mass flow rate in operating mode 2 [kg/s] - ObjexxFCL::Optional runTimeFraction2 = _, // Run time fraction in operating mode 2 - ObjexxFCL::Optional pressureRise2 = _ // Pressure difference to use for operating mode 2 + ObjexxFCL::Optional speedRatio = _, // Flow fraction in operating mode 1 + ObjexxFCL::Optional pressureRise = _, // Pressure difference to use for DeltaPress + ObjexxFCL::Optional flowFraction = _, // Flow fraction in operating mode 1 + ObjexxFCL::Optional onOffFanPartLoadFraction = 1.0, // to control for cycling in VAV fan in VRFFluidTCtrl + ObjexxFCL::Optional massFlowRate1 = _, // Mass flow rate in operating mode 1 [kg/s] + ObjexxFCL::Optional runTimeFraction1 = _, // Run time fraction in operating mode 1 + ObjexxFCL::Optional massFlowRate2 = _, // Mass flow rate in operating mode 2 [kg/s] + ObjexxFCL::Optional runTimeFraction2 = _, // Run time fraction in operating mode 2 + ObjexxFCL::Optional pressureRise2 = _ // Pressure difference to use for operating mode 2 ); virtual void update(EnergyPlusData &state) = 0; @@ -226,7 +227,10 @@ namespace Fans { void simulateConstant(EnergyPlusData &state); - void simulateVAV(EnergyPlusData &state, ObjexxFCL::Optional PressureRise = _); + void simulateVAV(EnergyPlusData &state, + ObjexxFCL::Optional PressureRise = _, + // to control for cycling in VAV fan in VRFFluidTCtrl + ObjexxFCL::Optional OnOffFanPartLoadFraction = 1.0); void simulateOnOff(EnergyPlusData &state, ObjexxFCL::Optional SpeedRatio = _); diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index fcb718818ef..47d251dd90f 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12838,6 +12838,11 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state, state.dataHVACVarRefFlow->LoopDXHeatCoilRTF = 0.0; } + Real64 OnOffFanPartLoadFraction = 1.0; + if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanOp == HVAC::FanOp::Cycling && + state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType == HVAC::FanType::VAV) { + OnOffFanPartLoadFraction = state.dataHVACGlobal->OnOffFanPartLoadFraction; + } // if draw through, simulate coils then fan if (this->fanPlace == HVAC::FanPlace::DrawThru) { auto *fan = state.dataFans->fans(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).FanIndex); @@ -12848,14 +12853,10 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state, fan->simulate(state, FirstHVACIteration, _, _, PartLoadRatio); } } else { - fan->simulate(state, FirstHVACIteration, state.dataHVACVarRefFlow->FanSpeedRatio); + fan->simulate(state, FirstHVACIteration, state.dataHVACVarRefFlow->FanSpeedRatio, _, _, OnOffFanPartLoadFraction); } } - if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanOp == HVAC::FanOp::Cycling && - state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType == HVAC::FanType::VAV) { - state.dataFans->fans(this->FanIndex)->totalPower *= state.dataHVACGlobal->OnOffFanPartLoadFraction; - } // track fan power per terminal unit for calculating COP this->FanPower = state.dataFans->fans(this->FanIndex)->totalPower; From 5bb21f0b853489ac315df1d16d35666107a9ea6d Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Thu, 13 Jun 2024 10:16:15 -0700 Subject: [PATCH 021/164] fix unit and integration tests from optional arg addition --- src/EnergyPlus/Fans.cc | 4 +++- tst/EnergyPlus/unit/HVACFan.unit.cc | 30 ++++++++++++++--------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index c5972d085a8..bc337c1cb8e 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -1869,7 +1869,9 @@ void FanComponent::simulateVAV(EnergyPlusData &state, massFlowRateMaxAvail = 0.0; massFlowRateMinAvail = 0.0; } - totalPower *= _onOffFanPartLoadFraction; + if (present(_onOffFanPartLoadFraction)) { + totalPower *= _onOffFanPartLoadFraction; + } } // FanComponent::SimVAV() void FanComponent::simulateOnOff(EnergyPlusData &state, ObjexxFCL::Optional _speedRatio) diff --git a/tst/EnergyPlus/unit/HVACFan.unit.cc b/tst/EnergyPlus/unit/HVACFan.unit.cc index 2e485829db9..8f4fa6c1fb3 100644 --- a/tst/EnergyPlus/unit/HVACFan.unit.cc +++ b/tst/EnergyPlus/unit/HVACFan.unit.cc @@ -345,7 +345,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc3) Real64 massFlow2 = designMassFlowRate; Real64 runTimeFrac1 = 0.5; Real64 runTimeFrac2 = 0.5; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); Real64 locFanElecPower = fanSystem->totalPower; Real64 locExpectPower = (runTimeFrac1 * 0.125 * 100.0) + (runTimeFrac2 * 1.0 * 100.0); EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -355,7 +355,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc3) massFlow2 = 0.75 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; // locExpectPower expect the same power as the previous case EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -365,7 +365,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc3) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; locExpectPower = fanSystem->designElecPower; // expect full power EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -375,13 +375,13 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc3) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 0.85; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; locExpectPower = 0.85 * fanSystem->designElecPower; // expect 85% of full power EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); // reverse the 1 and 2 arguments, expect the same result - fanSystem->simulate(*state, false, _, _, _, massFlow2, runTimeFrac2, massFlow1, runTimeFrac1); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow2, runTimeFrac2, massFlow1, runTimeFrac1); locFanElecPower = fanSystem->totalPower; EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); } @@ -445,7 +445,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc4) Real64 massFlow2 = designMassFlowRate; Real64 runTimeFrac1 = 0.5; Real64 runTimeFrac2 = 0.5; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); Real64 locFanElecPower = fanSystem->totalPower; Real64 locExpectPower = (0.5 * pow(0.5, 3) + 0.5 * 1.0) * fanSystem->designElecPower; EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -455,7 +455,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc4) massFlow2 = 0.75 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; locExpectPower = pow(0.75, 3) * fanSystem->designElecPower; EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -465,7 +465,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc4) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; locExpectPower = fanSystem->designElecPower; // expect full power EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -475,7 +475,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc4) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 0.85; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; locExpectPower = 0.85 * fanSystem->designElecPower; // expect 85% of full power EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -536,7 +536,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_noPowerFFlowCurve) Real64 massFlow2 = designMassFlowRate; Real64 runTimeFrac1 = 0.5; Real64 runTimeFrac2 = 0.5; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); Real64 locFanElecPower = fanSystem->totalPower; // uses flow weighted power calculation. 50% of time at 50% flow and 50% of time at 100% flow Real64 locExpectPower = (0.5 * 0.5 + 0.5 * 1.0) * fanSystem->designElecPower; // expect 75% of power @@ -547,7 +547,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_noPowerFFlowCurve) massFlow2 = 0.75 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; // uses flow weighted power calculation. 0% of time at 0% flow and 100% of time at 75% flow locExpectPower = (0.0 * 0.0 + 1.0 * 0.75) * fanSystem->designElecPower; // expect 75% of power @@ -558,7 +558,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_noPowerFFlowCurve) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; // uses flow weighted power calculation. 0% of time at 0% flow and 100% of time at 100% flow locExpectPower = (0.0 * 0.0 + 1.0 * 1.0) * fanSystem->designElecPower; // expect full power @@ -569,7 +569,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_noPowerFFlowCurve) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 0.85; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; // uses flow weighted power calculation. 0% of time at 0% flow and 85% of time at 100% flow locExpectPower = (0.0 * 0.25 + 0.85 * 1.0) * fanSystem->designElecPower; // expect 85% of full power @@ -642,7 +642,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_EMSPressureRiseResetTest) Real64 massFlow2 = designMassFlowRate; Real64 runTimeFrac1 = 0.5; Real64 runTimeFrac2 = 0.5; - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); Real64 locFanElecPower = fanSystem->totalPower; // uses flow weighted power calculation. 50% of time at 50% flow and 50% of time at 100% flow Real64 locExpectPower = (0.5 * 0.5 + 0.5 * 1.0) * fanSystem->designElecPower; // expect 75% of power @@ -654,7 +654,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_EMSPressureRiseResetTest) EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); // simulate the fan with -100.0 Pa fan pressure rise - fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; // negative fan pressure rise results in zero fan power locExpectPower = 0.0; From 8338dcb66d42d37bab9e55a36ffb02a78f0b2825 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Mon, 17 Jun 2024 15:26:37 -0500 Subject: [PATCH 022/164] Space IV-Initial NFP --- .../FY2024/NFP-Space Sizing and HVAC-Part4.md | 191 ++++++++++++++++++ design/FY2024/SpaceHVACSchematic.png | Bin 0 -> 36414 bytes 2 files changed, 191 insertions(+) create mode 100644 design/FY2024/NFP-Space Sizing and HVAC-Part4.md create mode 100644 design/FY2024/SpaceHVACSchematic.png diff --git a/design/FY2024/NFP-Space Sizing and HVAC-Part4.md b/design/FY2024/NFP-Space Sizing and HVAC-Part4.md new file mode 100644 index 00000000000..5f6aef92e27 --- /dev/null +++ b/design/FY2024/NFP-Space Sizing and HVAC-Part4.md @@ -0,0 +1,191 @@ +Extend Spaces to Sizing and HVAC - Part 4 +================ + +**Michael J. Witte, GARD Analytics, Inc.** + + - Original June 17, 2024 + +## Table of Contents ## + +[E-mail and Conference Call Conclusions](#e-mail-and-conference-call-conclusions) + +[Background and Overiew](#background-and-overview) + +[Approach](#approach) + +[Testing/Validation/Data Sources](#testingvalidationdata-sources) + +[Input Description](#input-description) + +[Outputs Description](#outputs-description) + +[Engineering Reference](#engineering-reference) + +[Example File and Transition Changes](#example-file-and-transition-changes) + +[Design](#design) + +## E-mail and Conference Call Conclusions ## + + +## Background and Overview ## + +Space was added as a new concept in v9.6. Each EnergyPlus Zone contains one or more Spaces which are used for: + + * assigning and allocating internal gains + * specifying enclosure boundaries, + * reporting inputs grouped by space types, and + * reporting select output grouped by space types. + +For the zone heat balance each thermal Zone is composed of one or more Spaces controlled by a single thermostat or HVAC system control point such as a VAV terminal unit. + +In version 23.1 options were added to perform the air heat balance for each Space or each Zone, and space-level heat balance output variables were added. + +In version 23.2, the following capabilities were added: + + * When ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Sizing" = Yes, zone sizing is also done for all spaces. The HVAC Sizing Summary table report will include subtables for Space Sensible Cooling and Heating as well as for Zone Sensible Cooling and Heating. Space Sizing will also be reported to the eio output. The space sizing results are reported, but not used. + + * Three new objects, SpaceHVAC:EquipmentConnections, SpaceHVAC:ZoneEquipmentSplitter, and SpaceHVAC:ZoneEquipmentMixer allow one or more zones to be simulated at the space level for HVAC, leading to independent air temperature and humidity in each space. + + * For zone equipment serving multiple spaces, three thermostat control options (SingleSpace, Ideal, and Maximum). + +This NFP proposes additional optional capabilities: + + * Use the Space-level (room-by-room) sizing results to size Zone-level equipment to either the coincident or non-coincident peak across the Spaces (rooms). + + * Refine existing Space-level HVAC simulation. + + * Extend space HVAC to support more special objects (e.g. ZoneThermalChimney, if budget allows). + + + +## Approach ## +### Sizing +* Currently zone sizing is independent of space sizing, essentially sizing all zone equipment to the coincident space peak. A new input will be added to Sizing:Zone to allow zone sizing using the non-coincident space peaks. + +### HVAC +* Calculate return flows at the Space level. Currently, space return nodes can be specified, but there is no flow assigned to them. All return flow is lumped at the zone level. + + +![SpaceHVACSchematic](SpaceHVACSchematic.png) + + + +## Testing/Validation/Data Sources ## + +Compare Space vs Zone-level results. + +## Input Description ## +Some new objects and some changes to existing objects are proposed. + +### Sizing:Zone +* *New field:"* +``` + A??, \field Type of Space Sum to Use + \type choice + \key Coincident + \key NonCoincident + \default Coincident +``` +### ZoneRefrigerationDoorMixing +(If budget allows, otherwise limit these to single-space zones.) +* *Change field "Zone 1 Name" to "Zone or Space Name 1."* + +* *Change field "Zone 2 Name" to "Zone or Space Name 2."* + +### ZoneCoolTower:Shower +(If budget allows, otherwise limit these to single-space zones.) +* *Change field "Zone Name" to "Zone or Space Name."* + +### ZoneThermalChimney +(If budget allows, otherwise limit these to single-space zones.) +* *Change field "Zone N Name" to "Inlet Zone or Space Name N."* + +### idf Example + + +## Outputs Description ## + + +## Engineering Reference ## + + +## Example File and Transition Changes ## + +* Transition may be required for idf Sizing:Zone if the new field is placed in the middle of the object. + +* Field name changes may be required for epJSON inputs for ZoneRefrigerationDoorMixing, ZoneCoolTower:Shower, and/or ZoneThermalChimney. + +* The existing example file 5ZoneAirCooledWithSpaces will be copied to a new example file that uses the new Sizing:Zone Conincident Space sum option. + + +## Design ## + +### Sizing ### + +When Space sizing is requested, the following arrays are created for Spaces. + +``` + Array2D SpaceSizing; // Data for space sizing (all data, all design) + EPVector FinalSpaceSizing; // Final data for space sizing including effects + Array2D CalcSpaceSizing; // Data for space sizing (all data) + EPVector CalcFinalSpaceSizing; // Final data for space sizing (calculated only) +``` + +The main calculation flow for Zone sizing is: + +* `SizingManager::ManageSizing` + * Get sizing inputs (`GetOARequirements . . . GetPlantSizingInput`). + * Loop over sizing environments and days + ``` + UpdateZoneSizing(state, Constant::CallIndicator::BeginDay); + Loop over hours and timesteps + ManageWeather(state); + UpdateSysSizing(state, Constant::CallIndicator::DuringDay); + ManageHeatBalance(state); + UpdateZoneSizing(state, Constant::CallIndicator::EndDay); + UpdateZoneSizing(state, Constant::CallIndicator::EndZoneSizingCalc); + ``` + * Repeat (with a pulse) if zone component loads report is requested. + * `ZoneEquipmentManager::UpdateZoneSizing` (where all the work is done.) + * `case Constant::CallIndicator::BeginDay:` + * Do some initializations on `CalcZoneSizing` + * `case Constant::CallIndicator::DuringDay:` + * Called from `HVACManager` + * save the results of the ideal zone component calculation in the CalcZoneSizing sequence variables + * Works on `ZoneSizing` and `CalcZoneSizing` + * `case Constant::CallIndicator::EndDay:` + * Compute moving averages + * Save values at peak heating and cooling + * Works on `CalcZoneSizing` and `CalcFinalZoneSizing` + * *In this function add the zone sizing coincident/non-coincident option and calculations.* + + * `case Constant::CallIndicator::EndZoneSizingCalc:` + * Apply EMS overrides + * Output sizing results from `CalcFinalZoneSizing` + * Move sizing data into final sizing array according to sizing method + * Works on `CalcZoneSizing`, `CalcFinalZoneSizing`, `ZoneSizing`, and `FinalZoneSizing` + * Lots going on in here. + +### HVAC ### + +The main calculation flow for Zone and Space HVAC in `HVACManager:ManageHVAC` is as follows, with notes about changes required for Space-HVAC. + +* `ZoneTempPredictorCorrector::ManageZoneAirUpdates(... GetZoneSetPoints)` + * `CalcZoneAirTempSetPoints` +* `ZoneTempPredictorCorrector::ManageZoneAirUpdates(... PredictStep)` + * `PredictSystemLoads` +* `SimHVAC` + * `SetPointManager::ManageSetPoints(state);` + * `SimSelectedEquipment` + * `SimAirServingZones::ManageAirLoops` + * `ZoneEquipmentManager::ManageZoneEquipment` + * `CalcZoneReturnFlows`* + * *Add space return flow calculations here.* + * *Likely refactor this function to be callable for either zone or space.* + * `PlantManager::ManagePlantLoops` +* `ZoneTempPredictorCorrector::ManageZoneAirUpdates(... CorrectStep)` + * `correctZoneAirTemps` + + + diff --git a/design/FY2024/SpaceHVACSchematic.png b/design/FY2024/SpaceHVACSchematic.png new file mode 100644 index 0000000000000000000000000000000000000000..5a294f7b29d8faa9d2c7ac6906d8705216f206db GIT binary patch literal 36414 zcmce-byQV<^eqYqN{4i(0!nuy-7O*|NF#OVkWi444(V>B`vB4@NOzag-Oc+P{r>K| z_b>Tqy~{%~;cYRHelmF+ol zPVf)Bqq>YZT`WEHYO)2 z_S)^;-W|q|*QQMm53Id|v@a!xTLSSgkOoJ3C6U+>rR1p!9EaHuxvA~o&KTU#QB~VW zk-6145$!6TzLxyChVcPDIGO>~Z1EOpTtePkcplk88{wwTVCr4^Knq=f}z7 zi<2Yh+qx<QI`~>{_lDep1P{+f0ya}@$jDh z&-ba3{QuY2W&gLYk4B!-(9oD#{F1n9=f}a3%i79kLf?>-?2Gpmhy6!TMkEV^q-3;Q z`U*`n-nPhda1r*27Dq)54*K`WiTwNBztK==3J|0iE(9Ltml%+Rhf z)7G6T)$eGEv0Up8YrEP=H@NXs7Tl|bgn;`J{d-LlUaP56jE!jX$zpA>o^WzMUArc3 zJzPXeuTwQXdhkrrf2SZS77VAPs;OC{ODg0BfyzWq|01Ed=#8TF8%X92v;s3mhx>0t zI=Ax~bHAH|mZgEZ4-+q-+uw`kJx3#P#+$uv4A*}pwp|{rb<}{7pUV83U6cR}Qi4IG zw(&v@Kd3SmUfQ%WWn+&jKI@M)=) z##*Q>evESx@CkE9QVr3qKvR;yD|*jPG5J~J{v8kh8|JHeDvIK3zCD>(S)~c+jy}ser*7A)?Z<4U|ZyjCOf!WUgHxTN` z#7@ncK;`*;`95pQtpi_O{}1<*_Ij$##ioyZ@uHQVLK}j>jKu!WkZXkT zX4Mte`jw9{NM4hcXAYkfYgf$+EesL$Ee1s7XE;Sr2+w;;q`1sluIMdGzdQ*{&p%gd z@xGhC``;&)2GQ}heZT}=3QbU#mQ5m+S~SMucW;#KT=UJoZnBN!@MgH+KI8<$c|ucb z0#i#RqtJ0gVw+G=)bu?Rtf5@i5ClgK)%5>oIDrAv{}rqTzJK>W0qAG> z7Z&A;{(|DD-;@_gdR>t0vte^+5S>5R4(jJlM&E2L?;fUh-bvEcpAxgs$Yt&u!^Vbv z7;_Y+$>g*TCg|UY>O7Yv@=8i2x5+_4uOI(k;QSx@_etyV;&XG?99z-Q zs1yI6QQ)a93^=QXM0WCWVNf*nH!#p8!X9P(13=8dundLzhGkzg-!$Qm4VH{Hi$7+# zqr|`N*l; zcRJB;a6*|Z)h7)l*BEXurYGB+3IDoqsKqQx9Tx zwA$4cO3dk7Vchc=79`jl*A)pp>vt>r+nZdeq2h366W=vUS#ZQMDTF<~=vrYzR*0-7 zi&5Tr9!c>=FlyvM=S0q@jctW(ZZD5)=gPd#Uh)q33kT#X#7|Q6?5{QKlsaliJjeS? zMS*q}>=rJx-{$wEapUrIOeOH+S6Eb+eFj^k9127Ulv2l0;eZ+8- zI*@ENFLD263^W68p&eW6Wl$(}L-foEz#}!N6jB$<|XKJdlPs19R zIs&n~*!^K9rVkBgN5IMf8r#^PJ`YK>>2 zjxrM1%D4xl(I!fsx!j~Y%o@OV$MhAZ$ zh5UHIX-uhY!F7pzx9MVWMJH;NZ!0HeJ~pZyIZaY6eq+Ww9V0%vP%4DLRz4t7^i=5N zWPJcF9(D-6*qZRpLnIC_*CIf=6RjXdEl0MEoa%Y}lSN)-iapAR*2-*uzP_}Tv#kDP zNVKIE*%2gPe&>60Px|AS(Jqvqr_mynx`!_`I6Ds6w0}W?Wm~SKxr&l~OO8XrgnCXR zQu~}=yD!$kZY%ma=oad+nHlJ7=e46-8XSbD-srOTVF&H*533K#)K|I~U-4*$H*Yl=g}@pH;Wg(Xska}&;03* zk~Dn^c(?K!oV$WZIkf3MjONJgbH~)$8mBC?XjgVRCnpQJI~*Q%U_EK_IFtXqWZ345 z=A~)LVGa!0Ay1RT_Wv4h{MPcc=FqFvIW1275fpc5IQikYp*FvAj z8Jg!dz&-WF>IGIh@x$HH13Ad%2JV77uMpn3tswD!Yu5&0n9XT(7{a)4d%(2lN1p-_ zKOC>s^(8jHXPKwvCpk{-V%rP-_3e#B06GdL-}0yB>zy*JDOq;a@9!V(F0>ZJ&LU9WKhsn-bIzG)uoRy|FzRAWY-1f`2M6H zd$n_V>j31syv*6LQBUgb4==6<6YrT8N-jTgs?%PG30$-1+jH?(k@&{+WK1g zUN3C~dVKU}gY?b70hAbJfzJG?AFT&zS#ds`WliTvA1S-`)_6YzsyPO_Z)2xAPinWZ z_mHiT=nsHQrfI>p!+tAk{hKfd_uX0v_IAA6~b{&6Cfq*iR= zO{U~c?+;;imiY%v>;~7P@p^`v^NvH#GYQdx_qOYCy0$1AF0RX;pENK!3!zbuedHK_bw_ z)JvR4sincxcGD7#*4oT{+Sl;3Yks)DS&4Jom7(oVy1+j%AwDu*xV<{julVpF!@G|1 z19Cigr>bH+UH+cMjmv(ub9t)e-Wh6+alT<+E_y`UJ&kIhvN$sG!WE|eBl@1mGaM(!el%9uT7xzZ;hXIB| zc0M@+xjrbN#< z1+P&FH;ml!ut5JrdrAEIlD!XWE=28RkTIuX(V6k?aHb#Whok~i zvdO9i3ak=?7VmvNwKrP98|{u4c0G5U3(_t<@eBr%T6*?U(C6fQ?nAsK?3M$DQ zAyrE@ph$D+S5(&Ap!^uC=Y49$lxW0QkIk-(G=4~&L*@aKm$|9K$pCL7^>$g~egh=T zMBEIUSlk32hp2tX=iZSwtkTK~je@uc1F_*5=McARUYa~cTaA!Ca_I`cNEi{q4o4SX zknyx}RZpjb9tLfQ*CCnZ{az4vY}US-n4kEq8Zz97bLgplz=v8IpTsP0C)Vt%-7o$I z@dfLHlu=pg_i}Q^N0dJ+dLH~jMt7F4My6hew4etv)(u=7rha_`W>^+hv?;b z8~r$IH-*7o@VeWPl%o)e!3y^?lvU5$f8{qPv-219Az_1@=W|bF)phc`&jq$*DVx^M zlH%KG5;$CT-@2wbv>_2fchfe~eMF26En4o*L6vv4t<|!fXL2ZM9||(B`cP^sHN+sM zsvs)W=Vbl9auGtuvZ=z8G)hWK+Sh}90RsFc7V4fltJ()NXvf$@t2)V6 zCs0I;#@g`5#x{voN3aCS%BFPU;dVo`@hq&%cts~oQO5|0fOpxxGCV_xi%k;pHESBN z$xUc?$k-_HY~(lgjq-DzR|iDfC-$WG6rO>O$rjdG!>A;9m91F%J&ImxE!N06*spb} z%))j=-xlx^s0rWGGQaAuw?r@bd54p;DmrsWsYJqQHkh(Sfpv3|5XYjwO_L%t31vu| z(5k#y;Q?uh^PKnfSh`s#OCGu1;Yvr~ld*giSG(})V8Qo-ht7V-OE9=sl`ZpUgQQ}n7lGdMy;42V9 zNFg>VOrH~cAKZeUV5iWCyh>>`A`*JOioBd)&kh&jHGKymRVY6)#_dua&WOb5aQ&Mp z23;S?{KPx!4?s>lQ)8tIU_^p{($dPEsFb7PSCAt7&R72jk(x5*bi zOA(aG3}zg1ZNB2?GHb!oGEb`>sIKcavRw}rSM*j6`GR+k(n;?k5FStvePA^Suh)8_ z`TY2S)xpi6Yx7#3y%?)<`|7Y4hQGW`5#2ZrjRu2_^A}GHV$%}pI!pODjP?A_+jO)| zr%6**@4gN-7<8G!c>xM#WuB$1<-Q@=WoL3g>8KM|11QwqVXKZSw*9Vy^PR>r?jr|5?xc?u4Kpc?;Sdc(VQamvO-Kb7HS{!Wbe&~w+A!`5+hLfVA7zS&l(>Hp#0kf z+4Ee41XMJwnhc52il~K#V$?TJ>2-rd?7XY+$^#_tPzSt&`^*v1(3F3i&sy2)Aj^@) zRpMPHtA2^F^|Hi7PSo3BtWX)P{4QHZ2Uie-eze8S8nn}%5%-bSLgFwmNmOs#p1m)2 zWr1;AE^?i8=~8;{K43SqpS5LvA$*SQ8N?A}(v!pji@v;0)U*X1{+Kt8x`I8GUX~Jp zn9e&s7mZ8x2C{oc5KoHyy&hTf`FLTMaD_FI%WrXOH$4O6Za(&ulc6mv`z{}@>Z(CB z{Ovnrf*@g{#gp^OJ-1>}DkDId%l6ez;^C&^LaT$>phQ4rRVJ^u`|9{Jp)1*B8oiWN z4Wd_S4J>$vZ9LWJ8H1!RUNz%6M^oE_<+MyuU~S@p z9{0V}k1yk0@*JCBF_AY6Bza{W(Q#20meXg0{Iueie_6x{L%1cf6QRyDVYy(zyXeK;HJ)AJh^a%`#~jW8KkU+yz3+Am zTr~{zE-Y8^+uJcrrG#^$-$+tJqQdnKo{j&WNFyQfN{vetZ3lbCUW8ZgBIfu$p zBV`|N`6ce`?H(Od%9`5k(8|JXfJ)m{jQZs%;yq_EE2ZYZ9nG5`L`)?~4{SyGlG1n` zJ)cGVL2YBVcQ?KEJ0Umd_8B~}cu<!(S6JXj=|(@>gCz0&@ZG(2HPtD5%4 z$$vE|vDG;5fUJQfW{nzVVLw4}at{d$3oPH1XB^z@s`Fx}ML%-WgpqvfW1KqN2O zoUA<(TBMc;fF?W<(|q9Pcr8pDBV`OnKnmAZX;oU^J%F1G1w@oyS<&Vlp^g}b|E_4i z`q#C?Co5R5#)r;X2^uPoD9LTk#gy>v5X2?#&OsGCyZ7s4)i7D}`tfH9Qt7k@lXqmh zL*oeI))55LkB1UVKe&j_ci)c%6DbU^KJ|pptuJ@-+6)x2o-UuwAZ`(QcC<=_QP0Q1 z>v@PfTssuY=jmRdVk{%REOObBXWG~ju&huAkgN0?=>xY<`=P{H5+P1h5;yE~H@UTH+t9rAm2BwuQK;g6`nl+sKD%eM`nSGPn87$c(UejW0S3F>W!SN_k96 z;+9UTL1>g|TxyNbjG%)a(ff+zQJINDI!lqA7V|N^nfu!(IP<|gFB@dLF>$0hzPhQ+ zy4=&g-7v=@zV{2JdsLy8ymCZ*bgJTDWT+}nMbGsNKiz5nhyD`;GHvJ`}7$YA=imP%{;#N7SN^fku-1HufC?8f3#BvIbLlFC} zxW7&A`&sUZ#O2_4ynsha@p-sedU7%E7;!_bK&R!DsD4rLYxI=3bl>AYz2N56E7 zhB||B7g#mA$l6}zu=na{01EKoISob+_b_4eq5pEe=$$20I%kW4;Wb_2wJ_j;8Ar#7 zx7B?pa zjs|4~5ANzT2Wmzz7+&P6R;*D(bsX2JXg(J6h&|F5x&fjtn51PZEB^sg&567|wE9(T z)Y3+RJD`&Rp?nV|pkb5btppS`x86%jPCx+?@*2**1|(iIwS=#LIH7@O#Wu3sHV*c& z=q(D}oGjYTRGF&=V83t*_0Z)V?#`x)nj^Uwk^FN^o~xwoN`E63_Hcqq(=`b=Z{rQ_ zIgG2x)Ng@09Popdzo(dBeCX118h4b!8gNi5c_ zV@bh<5p41@+Mhw3;Dm1FCAV|akGw|x@>Ao@exs(0>x%ZEO zOjI@4Jnm=3B4F0RE5%{N08ds>9FFau3s8=%6ko13Mnz;s$$ThnFV7x;-$q^_r8hMB zFC}W?01LweY4?Ea0RmtbUP++3Q5$ehN|q> z00D6m)Tn24>T;O;zatI1Ly2wEM3%_~UC^)3b~a{#%Cj?xQ=Ta5(>#~|mT7rBSAo!V zsYJKVrGEzS<3;Bcql)tauw`H@0n|E&#o`ZlHb4wO!es4%R4Y|s*oH8H6a7{CmD%2G zOWeXMNC{9#c46hl{I-bcTSKmM6AGrgDjNW3d)&|H%e?r>`U^)tm z-0LKfj-MZ9>K)CYbpGwV1AlosSUtE2q*v&hoWmqKjouHofFo3;G32`|z~f1i~2H4J!~@ocCtAp&*6Z89$BfW^`8# zdJx*SQ*|^3;2^ft?4|D-0ysv|&6%qF{`RQfNr3npF4b=|1eD+k32d@~m^$TiH|0|w zWj!Q#@B^acVLemXr9=$%Px#!0LG;UX9%_$N=qG1{`Z=$S#G$|K2cm(%hfSDFU_~eA=J>t58jKZ( z;aUO&o<$`|`M~xubdz?hL(865Ea<1cV7pH%<=V@?vq<7%m99(VvC(03*`0>i2z@{w z$z{?IGgoiwWuZwh2_gt5;~zz01nlYSDQ=A2{$cNtR$NPC72&hkem#%dqn-uqZApqY zwEa;9R%fx7#u5E3b`)qh3ese==ILJZ0>=95M41+Vdt90A6Z`V5eH4I+JsXJ4kPBz-a5z=XmVCOSkL1Vh{IsR!@po z`7ubi7@+spJNnw>!`$H%yh_n@5~>BU>w~HN6UA1X=7Z={-9`6U_BWaj6&>8pT{cDc zj~dTldd}GP17e-ZSx6i6*qag^{C$1Dy?dMKc<1@aI9}^%?0xbF=ywAqTk;{+zBJCB zGRa3zFpEiG07%!>ZN+FKJrwbP9_b{z^U(6{f`;bjx4fal?T|Hy@>ke{?$5r&*lkF& zjMcA;pcEC+)9^E$bi5lBs@ogQ4bj~&Xmk`F;t9cl2*p_f3q;8Ry@#N|JWt%7n_|7) zen*-gdCc_ZE)r;%Fs2UI8#UBt2O`p^#n%zP*MDxlN93sdh^jA~5=43-v5q++$l z%_)UcKkzG&bDyJ8)79iAbmKFDI&WZ zwf~;BYq@iQ@<2|Uq}J+3A1b1U^S=p*pZraM}50^fGm1!uXRABh_ z90m2Wh_hrTjJ>(nAda%`jig3GLuY65z+=U{e{=|AJqych=4wIl9Z2C(kgOAyY0ZSY zwUwXlqA~56i$N>vG7P94{gxhROU=KNk2eYIAseVF>A=|0mTcEdTw0>1*MiHM@mVr- zvFYPM97OC5CI#@j#4G*gMI)NAFz%Xc`gj3hp&*tYY5gWlX+)PhX(C1~u}z@HfmVRYZ&Xd;eD#s3I zp^8LO=*fjrNRwqa8nYzh7qV^J_q@+*NZ|r6&b3ZbTzv!FHXOm-KQXq_x<73 z%52hEakl2eMu3%7fWt{3akVH3I-fgM)e4ho3RZ*JzdLl&0 zw0y^dba0`k#{JY|e$shs^x64!vXxuuffoT~P&fT>twR{M>_wpq<3q3m3 z7ArI!CX3a!3$s$A7NJ6B9ep?`TqbBy_I@x9#S3V6+gVm|M=>Zk!T~u|H!C7RWDb<^ z?>sD_TKZ%$J<`9U=E{Gq{drq&c72#YtQ>9&nU8a7w!kT*s}vAN7hVDx1*GKPZsz*d zfhGE*_Ry&im65jw=rx5dzwIjRTF(Tg7Gv#JW_)Ocl_C?3r925JT)d}aMw7QEwe5G{stH*p;BZc_q&_%YIPm68QQ$!kNA!bvxJv)U@Tfc< zkU}iSYA6>Lw2#Fa{rvI?W9s~Et#x9uuZIN8=n~GqP83gNB$X$3OvQt}H!4LH%=e{> zBw@eh;eKWE)) zOf{L!w2%8J0A`8>#7(Kfxc{2>a)b)=RIjM0KU))cxCZ_HZY@n&LiHw54>$;Kw(hlG5bZt z`y&&7`9HWnmcm&N#-)Gr+KZa8^lK3#oxj+tpw?lSEL|GqkeMV7yM;Q-YmEY-k+n4i zgKKq2KXcs|E6LTun}l7n^W7Psk)r9mckuwzYtMk3uVm_Kp5|@_+dflB0g|f) zHwk>ai*Cj+?G!PDkhPRNjM=i6qTy^(*RRHE>bb}7y6Z!$pvBt1^MaXFc|$ZKL1joc z!=KU5+LU+~es3c`@tr}|hG+b>t=7NSSrJ;mE zarM?Ly>7|7anKuP41xBr%ty3DsB6NE5R&o-!1LxT`j}HToYg~FB_wUiaes&#Zs+a} zYJ+#NcF^JQbR;Y^YYd%%4pbQoe?Z|w8#c1RRS0(fdLE#{oHaV0@KRpK8TAo9Y0I`S z3_61qE*j^wP%e{RY(hj1Ps`KY8O{VjSKGa#OHJ|5f5T_gD771~4)SU7WXVKO0H~vc z@aJ#nEe=lcyKejtAt72#f_eICZtR(Cch-_V-&9y3<}uN;vpKcGKY_Lm^KYcAr3K2C zY!lYyjDw=9=rJbQTW*ijO^6bQrqAYB{P*wIk3{t}jK>SqY`tRl4DQ}<#@UGK@)R2z zXxu$pIX`38Zy4X}seZkh76U^WSq+QHUz&7`g}}1eoz~*mJXp&xSuwzNz)I`!Zm2># z{GIW1jifrvQ>h75d(?Qz@85xK%P59k#YLm?OY|@AXMB6rW9{7BX`ncp&Kf(-?E>`I za^CaVz2fT-8aJ4MMW{s@TTS%-a&4g!#z8Ke0!N19-_jR{k)rZ*8gN!D^hr-&dFYK; zf}0;un4JYFp8i-Y#fQNMFZUC2r^w`PXKn>w%7@FIw$D!}h+rOy6%v>mPyK6i-6?%; zxN5XEFPk)N2(A`nR^;%c0!IHoI~zaHP+b03#K`+q;-vV=^h*<=&0elfPM8CKhHanM z)y9J!79IIQFLLPu$R5C;oM2E3;2L64VEE~u+xA2|Z*}xJi?1DgTEO8B$`x}`?mq{w z|F=SD^^h-rGt{|$^?r5mfm7dyuC3*^zXkdUTeMsh9MlyZIbiux??zQH@I2}gD|^?} zUh^{+{Mpu6euM&Zm<|jor8UH=DiB=4uEhVI@~D87o<->DXaE(4wlK`+Iknp^Q2PhB zw;~!h>`JUYg&YvZENqf1TPh+~bbxGleI!QhOXU=k#AT_@1_Pj>2D%rWho5gT{yV5K zilG#*#?yYKDzY@4s`H-7kkB>;vBp@>NF_o5(6gf(DCb1|^D-Uj`P`k^CKXyEmNs91 zxX3OS9VMEPD(;Wd#|v!5g=dhaJh$JKC-zF9oN;GC49KwBi2eRuHMF>^KnHLWbw!wz zHgaV4J1c>dF5gxYc{)$G#)@Dta?c~zgN$JRP&S#B{rHl3O093UCzPk#CcEclO&(O` zFM99|$a7u4JtY&GRh+*Pm_ig8JgHARoN<=OvqG{OnbY(IDV!ELVAC30lo>BDOYb8} z878H^H*XpOQ?DOLPy!Twww}=RDb-@>w}OK~WcxE*KpeQ#98~Y}AVa#*A-{4^J?CIA zDvQ8vwA#!i{ ze8nLp8hpF@^<^pK-(kVQ`CnhmJ^dL&AE>Y;b$S9g7OeXXpZlJ(yWay;-^3Ed|AHqA zIHr0HE~QcDzcNA88W|d?G#(8lJO{u}H1E*QY+E2!NCy1sIUNasFN~qOz=f3rbK#U$ zGBW)A!^{j-e|`Pvd#M+1MHpUvt8PUp^v-FN8oRqC|P|_|IG`^9cg+t_i$VQ62+~dL@n3F2y5@2dM$ajI!UWT_IKm1UJ zhh{F2!MvH(f;1rFJ_|4}woo4OG_P}QEx!#w6FK&S(x+Be1RUFi%D;oWeqIWHYXu*C z0gN+m&%{>d2 zJa$UjW^1hcV20Y2QSwF+O5|kiQ<)l zz~D!aWoODyOU3nJyg-0*9gUEMsc1PA7#pirL(hwfbQ+R^WcgPb;DA@xevH9`X!*y< zprgjmf!&#^1@1|3B5_KixYYAhQPs3I!BjbIIo0FgTcM^z0!!SKmuy!i4|WUUp;cR@ zX}_=iTDQNhuRsfWr|AvEy7}$j6e0qI0J*wFh~B8i+GLq_)pNb?H$_OdbNGXqaJ7Q-;FbWCF%{fo0IRsEEy4Cg{pn0j&%WC3otOKt*br z1Ig9k$(~>{T%{Dg5v36R_SUm0gM&(Mx6tl&X6K3WrRfUej%PSg$9d=gmKe26?jid= zb2fGURv+}d&L(WVSh&AT2clD!viH&mh?4bo5B{kSc-!b=a|lH1deg}Fok#WQ3=bYu zuwrq2tbQYn^uK4xCMC{}R%@--i^A*+zP~9jsm) z)yOtLxWBfJD64S01uLD$h@|Th4`xeU)DG!OXU@^b=NhR`<(fgiOMqi;?!K}AT6&{Q zqsP@VQa*!?C$rWIJ)u5cD|WQ9lCKzaj;R|&JcOg@ru1F)VLr}Abs8E~kj6og`G8Gy z0SPWq;!mH*p`|Aguc>O#oVihtrfNa?C<$I92{5j+{y9+=f7L7cIZz*4b|v@dV?f3* zh-efna=C6m$HB*Y@mc+`e^x)DRqu7hP_dq$IDuZJ6&kLV-T38=G^K|6aK~yW=OA(% ztHFL+1oF5S(;vR04TMjb+w}|#TAl?bZ94|oCK6HgMynNve{gN&Zj7*T2zN=YZMEOpZqWddX*e2fFmx@(b-f-CEbYQGpO2GP~fSHaLl>a zTCtE)GD3o6uiu^%iV_$C?~85H%gT^fk%4fyiBc}MOO37vDL!A6Nf5+or9&Y#rc$0D zUT}I{JGrv6d0rkul*XvbJIdNcSWs8JQK*{6M5e_cA-#3!6greFEQh~1hoFT&tJBbM z_j#|25DXLvVxQtLy2>FVU%~u@z_92^G1mpJ(JWzM?}vAo`hL#x-Zf}NuxE+hBW3d( zY7D}({jl?NrKbZkn+>1VMw0KoNja0x4Ov|!*2s`ot<2C}%$JRtsdpcd;`Lp$q0%OV zK%TX*%NS205A8&Y*Bc7J=FpuqDGd_=j^big2r>j$JBd(J$|0;>~;15VE3T4w|G^Nj`eFH zj5c<2>@T=dKfre8Do8#Nn;^FL21vImTHqh&2R?E@cTI`Xaw zNpWlVSkp&WUT(nFIgg#~Of?q5DvP-a#)A)8Nf_0WSX^aa3hFn)d2IGSFf5#UFl|4le#|z23vgYaq_K$I;Fi~-0jjxJx z4By_sB^f0LtVuUU9NllYc)L*Ds3|5HhmvsjEntZ~?`XE?4hNZ*{1&h@Ko+`@k)3y^ z+4WvVrvhs^evLm-gW4J3QlfL!Ild4f?E*UJ`&jB&!zb;Go=6mvGw%dx85CndF)Be! z0y80s+88yHxvR9_?4aR_>luPLOyu>|Q09O3k66ih2XozNu&_vu z?t;cXd%^%bt#$E8Mq)&J(6S=U^JuQPoH-FOPQTUuZ6MIM>TPNx420s{eda*#ABF9V z|6EmS;gAnHSq}woPw>7~uUpW^aPK!?Vq4^QI0#A}#WKUK9T1iX%3%LoQvMVu&65!^ zcXcySrw^amxBQU)T~iuYE++l{G{5byUJMdxomQd?L+*CkpPw;h z!sepZ$N-+K(qxpa`jJ*_qy%OvNiziJU>=*<*McTB&OhmvIUIh=@-6`ZG5#kT=>Ic> zS^I(Wf5EfpP05Ek4A4nf*E$@>th=ok_CUmknTX*+w$DjIWR$oY1e8taE=n3L_iMNC zd6sLkTp>-Jzv5bDGN-xn;jjc&VR$505Lgi0B33TXO9*~i+&DFn190;~m(h`?e=<>N zd?KL*5{pw?Jj`7-|B=x5C8D9*P^9H6RR#e89C*TTvAi~r-EXe51F6n+u7~2|uaf*Q zO3_7|n~5^-KY8`#J*^gUE@X`nfd3j)!bns_^mStzr(fkihCacf*iEDLN6Y=eNCm3f zXqGZi{@IXIdmSi9fD^_~tKgftt!W@T8eoVlhEr*tg_JK7O0<%P7_=$`svYf+*SHxK z#;xh}a1$*)51=!0P~^s%_n9suC0P%av^^yv6q(?PX&T@8uZ#^?srlD^8cC1DCsSYQ z7=!veXA}p!0j4a~*2%(d=uXTB$w0$oWTUfeXJvEyzc;-^>mQmmlqs(Is`FI4=#@}$ z1Z>Ki4GmG2$o0i=e32w!)rpX1zEXmXzuF_%hZDpV3nrPDg%5g|08ISAKTwH-j!^Tt zU;x*K>g0KFaW@X~V>O?kR#sTYi&Wrl+;P??K&i=I&%+u@fT*w~4+a5EilbCcGAlHa zpz{GET;$qfo^7n_yVfDq5BFaTk6d*7HR-IcGgg88=8ar{?hei z-MkI7DQNrvX5G(Th0!~Jck2dCLnNlxr(3oHmZNmM_=S=t1HV!Qr|{kK7BRbSi;+3$ zD*+LP1x^9MeyXC7465D0Eb`9v;eU<>(5TY95b8n!$HnuPpB z?~fwd-UpHskO5~43)OLm!7Yu|)SA4-T2F-Q5}^+e)D}+GuUdf7%eHg&;kxX>Azj

7wENMPWpzV zMX%)iC1)5Aw9;!?UqW!3hwD|N+AGjn0p?HV8mXiS&6Jp@h1l0V!>K9gJIXQc48qxu z@3Q#R!}deSpc_$XSF6__jj&-(szRl9b&M=YNh}sjv$^=7K|6|E3S_1R7kCqz>33&uFQp8ZSN4Z zWt3n8D~h18=s-wD2etHua)Q$+wVFNs^h?USrE!Cd*`;SF#Nvq9B_n5%#hktpCI>_a zq1N=v326OH#}QE&3)K7~Vgp7$W8Gt!3v_Kyg*D=vY)@pBS&Gij#am8J|fpl2dzEw@6wWw`}P4>;7IdtMe z`?+{f9MnDl-p0HfY@8_%Vlsg(MC}*=7iN%=ctv@)DbvPWH@~{S(T>LI^vDbQ zRc3Q*OM&((CR{DG-y~rI9?s-^)GJ#XwJy)+0rcSdwh&JXh+VBMt5LE-Ru;^;Ed3 z(IQSx#AbWEkR?GJgPg;r_cFM@FOwMI)sNc0O*I#$A7(gO?)L1gF6b>fD^TwBKwG%& zcxDu>%%oZS(abWX&tMAwzCDCVkSASieyI+8clOTBGo`Fz2_$`6U`A%*?_f>2p^36* z+~EVpaE~}7>rTk_*rT6y3Y_S&Ds@1~h`;@<3FcDyTe{;g3W0#I%*RhG z;t3U`jtp3_i)YlJiOKPj(`9~Eo=D<@rz+1T%z@r9meeAzcbB{feY++9_W;N zq?hqrr>r+FJ5df%6Xt51Dm>}1e`^k7aCrZSWIw{6R-J-%4$N~IcuKGNqOm|ONKJ?A z0QqH$O7WHUbi4&&j4nUg4fT$~XoU{S+EC|JBN+j}q2G(K?AWpsCC z-&Ll>#ubuAf|r+}pLRCbxn+L$S-)YF4QOySZY}> zrT|5fb&p{6neqb$@qT)bq9KD0eQ=Mt&lBkf+T}A?Rr*I9pwdc}*T62m zKE?`X$8+Q^pjG4b#s0zqR}zkx76~P>beEg;bs8guuLPn*uSFG$srR}HPa*<8;s>`> z1Bai_+E{(A`ezAh-gi9a9r!~t>ML%-ebtjwfoX7m9KXP&HO{r>j5lFw1uF*n&n*0*IVht7v`#)bh*&DiQ(7*1a}KPZx{} zg#Wk_kIG4VY#|EX*9>t)QxH{J6ZMA&ODuQZD?24_&s3R@RJyKqBH5xo+jlQEXc0-V zA_2=Wa1rX<^0goC`gcr{^{b_wvX=ckShcMIcsX2K`Sn+|7udG~5@)8f)5c#vl3meA z1fgkzoWV7V`>W?JTEpvZq%365%#p*Xwz$%rrf_^7Y{d>681IUY@oS1iKxQdXB-!Fdz8IVROV6 zSDhQ^QL0oa+RU#V`irzgOd3(A4!dbgDw0PdU5IhIg2lClra=p)ie9V_$Hn>Y`+j!N zeyZOC&qpk$*QihbB2!3aN`g=G&j0p|kZLwA+J8x&`AJ5_GLg$OP1@7{GSDRbM6KY_ zwyqC9w&ZlYkP3mYy32H#R8h*!fGna+2W1y-g8pg*?rRe25^?=`rcLN3{&siuhfDEr z5<(#FCX2Br9#VL*C-{>2TJVwuHQ~SQ(VPodL<0H9<>%nzy_gl zYGCl>1yQw|qBUXLp^4c-tqU=wEwMwTXhZK5WnK+|zY?)k*HF^fhYC_*M)pno8*h03 z1Tf{jE=d`F`ON%x?!Kn=NSO6c1D;wIWOGmd{_NU+JSOkEw(nbgqFp9dBL8}SnteQP zbUZd+RWx+igFTm6<+%J>x2!5Y-TUihOdtwP?2}j5yw4O7w0PB8?Ofjh7$&{4BL=4@ z;WP}#5GLN}nMCZ7^Le=BE_6&EG#n5bWbu!sxz5EL-Q~O!J!0{WZsd00nPeTM(|1K0 z2EBeBh+^&)7d?k3P6dh_Gf!{UEc3?c1H$48F6-NU;nyqP*g2;U?biierlXQ6f9GVh zGBUTyw#N#+u(Zd!>MjNG796vA)Oaa?*`D#o$&@xsbDk-2yojYr7@caPgp2&}Dyzzv zy=uS2%z2KO+v9sGY0+FQ0d#U!++~S{V{tLVv3oWITQ=#m*~UeGorO!&(j#sG&9l#N z_4aHrjoi$h-rG~p_7UBKurhOvim|2WZ%|?uQ!{z8Pi2VfmN}enb@W^195v+P21bo-)NEizR)DdlkkpVVSIn1a_Q~4 z^e6LLCHFwj5v!R)`*mMl)pw|gjGF^}f;ruT_zHRV4+ihJT_kixd%Yfjh`WC0dkN_o z-_MlT)$y+C83D&O!YlvPpT(kOl2lDbxU&1`2uTvy!gIF1{>X{4FpR&GWqf?==>;g? zy(0@<5RlMjrrAHX!QCgvvAbfDZQv91(52)aNm$PFuUqoj8M?NoZ|Dl?BzKxIGCEZO zexjz(K!M@7;_eDm<{Uu|lE5gXR24CaYdu$SI$pq=eKM;ZC*_gH`auC(nGiOiKpxUv zHfm8UjTxD%8H=syn$8w;Ytil?Nk3u37+>TLt_-skJCpT19}^MLo1wV~9T?N7$NFlP;fXXj%^3L&qf)ysY%*+&-w^kdtGBI? znsj`^W0WdiyXx&(By&A%q-m&q4I>g#*jxK%3Gp1Hrn$%mvua2o8h6t=YEZ1>l=cXl zG|!w&p@Ig8pfJHi8$C*d7tX{=9bmU5XLlg`8rD3aEdSIOo-E44p}RA^;!B7FApf^(1mZ?c^Vc zNjDc2>Eb>hEFf3TOo)p^oYj*PAqCAjbQ-`ZeODSK@_UntRs7=@gW+(Dr9rONF?7`g zsu~#Mwa-n35m#_QWpQHWvd#=2mVe;Z-6>O z5&WPVY!bmB4+E*-*EP6wf_M@%KQ&T1QQ1pNlCbaV+b}M7dTIjFi%l}5$C=U<;*t%( zl(2taa;TQl_rBH4e<}r~8c%~#0VIgu`kuHg$(w)70I1JoqTjEm+~ocne-(YKKO%t) zZgi3EN6~1ToPwwvBBD$>evOc;L6ogjTyg_nN-P@2w66vo=>;-@gpA_74HucGHU^fO zp6ZRKo-Lc<`W)L>9u{2APFxVwM}uVOgd8+oU-JvtUWT=wvX?n)MRHIjQH)o={r@sQ zv}i!)r{}G0O!-)&lKx*L|F>0?z;x~a&QxN@R68n zY}km~rQxP@O8R?nadyRqCe)eDexOv+2_v(hi<(h|FJ|}VomL5pVmVQnAZb#GF*|?L z6zMAj~21>r@`y~Q!#Vb{qa9w42xVvJD>(~YoLzQ$WW;q8N@aX+$uAfj&Js|I#ll@trW(K-`x>qPSi~Wzh_nmJBO_}d z9q{|+X+@L?m@{I;Lsw;Z`o>Apu(qKK;8Jp`mFoojhW6EbM1^ZA?mAd@GL>Q49(Uq3 z{KMHh^F@_7P^kL7ku^!S~i(tT7NXg+M zuCvt)>zm#ReR=X2a@Kw@ry1V9Dl9{F%E_#_ie+)&P4=0)SBF97F)E9aUY+goBQQph zq>`_=|1*^&b$@ATxPvT9&fJybIpR02ShkhnM6S+37t-&WzTb56d5X4Vr|3+tshJ0n?9vw;VW$?bQ-x!n)r39WS=>*e4syOpZUjF@-FDg z^05mY4``o?po4|`r5(C6CVm%`9N&jHz3P`={pyRAyjuQH6x0&W#b#z#> z!sVs08&2}~HmH#DSube>IcghOs%(!%UKer-bc4_`Q|pfp z%&3^~TxW}1<=bSdr?}`$SaR`usNq5wnV8sGtd5v{}dL%ciAb{TfFWA#C%_j-q3+61qEVr_75| z@#frcdu2Exs85l8|8HagznaqATz1THU=Uq;`6}Q5O&&juxNs?IwYC~fc z|Cn_z#m{}r!TxKUS7hj32&|wl%)~OEJuXbJ`KvpRukrokf4Nl1#Eyor)kge~6nm&B z*E+o@Q7v3=51S?zhxF%!!7f;JcRZhay z|Ei&!`BhWJQu7M`BjwC6qcWSzh+wY2`~})q&bO>+cgfdf`u)kvT~{eol{3Aci`zat zbGoF*NSFcmep2S)&1)qs58` zht+UUAd@q(WX+X=(5E+pi36KtJLRmS>VNL9^+|C*oV2&pBWpg~> zuQHDm1oa0$xvq&}-T4@jgtzFfj5Z2zJF*9eXoK*9%NrbGru3H;4xxOXfQA|`I783K zcQFFrG-vhs+g=o2?Y3jw{W%F!wNIBTN@Hqbpotiv`8)1}8fOu^+xs4pkUTR@nJb8a zRKO9Q>a*3-1_Ll_E%g`L+rJT%ja}TkY5jiOJoP5rAfU$Ca1i!rOBT0x$4M>A0pb~g& z3<~#^@5iwO67Y%LSy?X$l;3KVsn@&Mm0+8UF!tcA_p}|C1?6@y1Q1nOUy-8O2ZR&Y zt`vI;&12&Vn(HQ{dpQBB*GnsI2ODlpAX8&s0Cf$<wfRivUTE+F|c|~SRAZd1VbUX#*!w8Ta???hB3%mvOuA2=@K&> ztDw}sWQi&4D&JFAFzGe@Xnzt6Dffpj%&0+Sj&C&&kz0`@WQyW4;x|lvazz5+YZbpk z=#HVW!luo4hbsaIzR!4jA)LCvA>n>Ncf=;`jHAMDz@Bb=y=m_J8V_U~e* z&lM03O@7xoP+G(|Fnc6P@z`XY8gy!R112QX=7pbu^Do5M1|$Br38$@kJ*jcwdc)9@2Z z+1&ik8|kBZK5D*zGnRjy*u&*_|$MmNw7+#ZQ|iZ*ZOD;{&OS6*>$CH za=;^l@qW|#_gdNa)7g;`0(xt!XO>o@eTaQnuvo};@~HQ9z1dt&k=u;6G|Dt7Qgj38N0Q!BGGQ2!P^Nv@{bR)%$9xw}QgYmI+f$lE`1=&Ot)hD9y1 zUb}bb({jrEG?ud;SN9 zDnOUVo3p?JCq`|Zv z>3$h)o6Id_rRaBWvjov=>6Jxme(&!1K~m(ru&KvgF*mgih-J>In^Zq1Lz;za~8MYcl@iRooNsU)TKvC;T~L zgI7A#h%a$O&7rbzXJz`M%0Iru5$S2g#t`y`eHmeI5XN}kHi?8;P?{t$ByN=h( zBc1ibCh(rf7DHVTNl2sX=72SgpGk)(f=#7g+;kh|-d*}a2tI1!tHKmQ_&ji@?oItZ$hbKxMfc9#f#dIn3b;-TJ9zK1xMW-rA;08y477Uy&3FF;9z>U z18r9F8$$aQ+Xs72^Qxl{zAH*iGmAnDpL(TSK^U7f5TFt*l z)GW74JP1Bel|&}fqKcz!)#@*lbP7wmy`Lv?K$derW9SE zc36S-LHN~~;DbPOviDqf%vN?{!}OFiuPh?E6L2kYAg%2~_j5a$GM9MBbNVBwCZ0ZH z+BTGiWXEYMb9e+VbD+1l1NW9DvKX*qHsvinwTBCswcW~j{e>I=u} zyRZ-gt$Ay(3k%5WrN*N)-rqpqTkBXo<M1%}s~6+8A`gAg5<;K(%JvYrubO4T8(+fx zqQWq4`vIFnv1_s<@q?-=K^{r>38l&<2sBR(a}A{9 z8@?i5?3nTA$?8l;cA99gw5dqlI_>kTD!gTR_#q-*n>x`r1|aNJ{#+Kh(b@V_>mTMd zrcUzm`~a2a=7;LhLBg?p!oyANUW6-O`=Zs8aoIjFea<6mc=~aioekNGJ5!P6s$W1n zHG1L+`o>}g!g(MFNaXW2Wrk%GtO&nKrT?6+IR3@pJORi@l+f1yg-FOL4NJ^9myG?n z?#}UUa`+d&koEEG3IGJblAD<4kG6r?PT$g!a!6qN_Upj;ccIcuP0h1;JA%aDWlS7r z*~FV$!99Y7J2)p=k3DyBjPsLc!W*Oxp}i*(<|3pu3dyA0b)n@u20Qg z({7)=X8gZBcLTK#A;pGJJG?K6yE=Zbzd4G;P_vlRe0;S7{^5~m!k}_r<8~ZL&_KAX zs_(_b69{P=uO9HK#2Z{Hl;ytUzuk#`TNv4W2<2DiLW%C)t#O}J>93L}I)PJ#q}9G^ z6J2P}jaJK_S53L#l{@SUEuv~i1(6liez8@=<)_W=Dc-3r#@r)U3=$Dy2#2XFCC}Ex z~qx{zl;gI|kb{^70P3mNC%*DvmS9XmeQ?xQ*c>B8h=kKg&P`i#L> zN+6RN^?pKGPnbWG|H7k{b%~53t)R$yAAlB~feic7`}>j%X4gp3ZB)@1XH5pW%ak2Q zJeAXaSAb%!mlW41P02XeX1#GCAHw{Ex^e z2EvD_@8e07@82KonEi@jjMq0Ibm=aoo=)0@L^ILZX7s~D85{`_`thYBr^lmA(D8dw zbDllL>;1UR0t-cb{zxKTBWhk;7LNhGCTjcfgn(iFR0Nyzq^aF5Pj``t z%qCY(0jr|WeZug#?|fTAWJe$I=$-BQHvvhW!<*xQiX++R;q-vTfrkC{5VzeDE$M3zQ1#Y^jj>6}E0j{BkcK)2He>mb^FCSc$Y7 zdag{xqob7PdTk29_4P_esf{*4IhTi~LGsd|dMSwq`4tawZr6SFHzcpxw5F_v?So#B zao_LO_Bv6giDo{#IdTe#jDXpTh=Ko@PyYzz5m;t0AKuPl&wU}#bLX5Ir?>7ddAMPJ zn|NZOqrkfww$&j%-DU^dP^Vt$sdDZavT&Do;^rpQ2x8nFUp13xVk(nY6;Nn=QyjHI z?37ohdX~$H_75As5`%o$_eFnT?u@!3g?B%8%vFu!UHI_>MEqI=f`(roG-AW?n?Ovh z@Kto$jQzE`yV_M-?8fn|krqFL1s?3H0BCY9`Ex;4uGUqeXWhH*=z3DtFxyv%($&`_ z&hA{WC*tnB8r=}{;%y^NIq?EA1SFxZ=sWZJ3{l(3sCIvP3>WxDKAT7&XJ0`rORttKo^KJFMn&$`@g%9^0EV;V8x@Vlbgxj9-+6ZIE zxF?Ab+mX9d0o}yfPjrLdvbmSml<#f$gU^6)WGXJYAWf8#2LSCrzi%`OTaDUHga^Y6 zIc0Gtse|N9>B9?R+95_#T5W~rpn8fJ)@?(7M9ktd9PC+wA1trXc>2FE_u#$Hm$&+V0X1UuPol?bgyQ6r|g8SFXaS6Y2Xu8CWt+ zJWSnZAg-gD{mmx?>)b~hsz2rx3&}t)5FRO`B=E4!MV3uBZ2wI05%(<&!l$20J2QHu zU1%i7zh`cD8LIIqAf#-w7Q^Ldon4mpNm7i%*tFI>8r;|26r+nnWnE+v z-ijzNP+_7mCQpsHbk6fwAL8f5>?7^*(RVC`XBrWsbFRlBa>Fr~E=_>-^hwo-O~!S- z^VM(c%o;_yt?#%Q*Ky|(hwO@6s8}6)H~oMoCT6etg@sJSk=XCUQ-4ZdY?is6>IlVO z&);3(F~3P{D0JVVlZcmV7GlFu$$rb&7edTg0np!f-?TORG}k%f7T&N>S#p2o4CbN> zq9&awO9NxUy8WOOu|f2rbLcC$_!C1u9$z%HrdhD9kELh_B5Pf9Tc>|idtQ7z8Ke1A zX1Zh;ZW&X*^OOQ&^tlanyxNc+sw>VH>d-Ej;yZ7;Sl~1)la%5PulvVP>k2Jyta61* z7HC*&qr(v~uEl7z<)h=FW)4hq?TMXkO=l?V&xj^yJ*B4=?~zp+M2YTWu}a|4*j*&P z;{aMZs?EHn#ofK%!{+ToyymJ{U)qvaa}nk<5f5l%>IRaO*WVl=W0gs4GDt_3cwng@ zsUl)b`c0w7yabi;Y-f>6gANuTF3wD`L%3Zv!uZl@b#|gbQ{z$ow0UUe+;q#;7qlP@ z^^Zt?%L7z^W2^rq!9?C4WI@k&%-Wv&4JuFe7E!tZFW~}To@&Pru#@DC!nXyEYEu(2 z*Tfk6qKqj;3>FgEs1hB26fEysG7}AUw}dLuY@Ya18c{~cTEJ|Dk1;17@HW zi2qGR*VfTWp))LW`_Uv>2#{Dl4fKe69SWbmZ$6CBG)qFMFcFvW#1tLvfE0Zco&)#T`^!mZfE899uzY3IL~T#k-I|r^ZS?wR88E&;TnP}xm1}hoA|}50Q9K|=~O?- zdEVpv4W%Wv6dv~j2TN1u_pbf{k#>uc<;i1%$`kV4K=B|Y3EmQM*5v20B6+#DF2{6c zp-XhxJEqK)r(3o3(VmNZ`F$YXtf(?e_910$Z-T+Z$oMmV_79_dJ#7o9<^cwlzmfz9q?{##~ypw`-R*@2}%+K+Iayv$!n{*3X1r5}i1CNlM!7 zj*6Juqd@Hi3r`hiEf+{Io#h?OKQ;Wd}> z)lU*+?0ZFeO%+s3V%Lwu5?SEtSqc@h{B%zUJP-Q{2J0c^-Cn+nf zQ>I~CTZU$A*oM|45A#}b6r z`o-X&tt?!qO^4|BoX2!3h|8Be2wn0{jSq;>Mm7L?Sjv@iOSirJ=lQXP!MqpL>xh^7 zUnS$rI5HcjWX`X+;q!Yb+e*d>2<0m288TdoMs7sb%nL>sAEycp|^)up0h3+=n`92|qm}#>5B43jJT?D+37=$CbIATTv>djkNQH>`Bhw z*}twE#6}1_77xu4J1uXZ3HLu$4ViYDTy+JOWi*ML_T}PQsaTTAc9|A$nGHEs^N)~$ zrdmAD&WrhT5^iUch1Y-|h3uZ5FSK}7C&-vY%3MFc?JP|fM;IyeSCG%cDfXuG@_cj- z@7GNZX55d2y5>1d?X5{De8tb~Txi8&SMV6T?9a3O?gvvU9Nq|D%@0C)b?8hr5D+KW^!G41cG9sXeEa*H%Sp zv>xF5j9Y0TRw_E>)mHPgr>f|%=6)>BSt(*~;FYPE75yn*Qx@iCkbEva?h?`n^C#RW zd=ALKoACrkDsvftlNc(A(IEDNK^3Y71=~*vIJ@IeTCZ)7}4xX2v6Yf{+f#Hnd1)h8dG%lbI2JT19@@(zTJCpe%lk@bmj zEmD< zWcc3N99?mHr+Cz^wT)LBZ+O*o*K;v`Q-eE6;xRB^Xl|)C|4W+u@ZPwA?k$R7HYH+Q zG)@&^%`A*G=cZH9> zK6Nlu7Lsr_f&HRmXCG9gbWe#AQy$mzikQ$HS?o>Djf}_%I;gg9;v!H*7u!2^*ieX- zARQ9TBquE;@`bKNEd!EpV8qRrg%yT%L*r>yM`JfxrJ^(0)jG|EUpM2KZNZ5j_OyeG zg|*2I772^<%WhS3F=LPMAL`{aYD-`%{_YyZb;^L04qqPN*h46tMFlp@O?R~J2eKM} zM!cQ~uH%KZ-IUwr=4L-Wa=70u>Eq&jrPkEOx{06%;nqdy$2Zsc_Ji_V_R)@tM;eqY zhCXM)hR$Pp2F{8pwi}OAl5Cbv%s*u#75aQg_g_;bAv5rPS)CpcFES2EHi$Pt_PjSD z_WuP|_7Ta486B|z_e4eorL|G9OMiB?#=s9YH@2}@=M2d2w*H4Z0RdY#>M~VJP4r|EZ%PhFu#xNSZnjXh(J}% zlJw!h&EfeL@E-Bh{O)G~;J)_xn~FFMU+#6@2`hqUAaISSF|~`*m8Mi1NlHb$&3miQ zk5Q@53;fwySawH<1P}T_VKSX4F}bedOB)2L*-C~+t+Nb)wG9mo3OXb8|HrQx0`Lp_ zQu)RGYrBcU28XNw)qVs;h)l>ioD^6+eNp&{*6{iMf<+1@9oMmnW(}UV)4fZxiBQEe z?^T;bi5GkHJcjO0wPXCixgojms#%REU#F(99pULAS6eQX<_b$_!9t>Q>#r2Z72J!l zJyQtd%{S>{HPf5Ueo%RwAaEfnl9YNxiSD#94t}*_(x$l`E_R=6a?&ExYH=2%?P2)W z_7r|_2nhsn3JN%7r2OIjOf zqz{;Xf+bWm^(q(o^K=?_(ZE87h{6Bs(wsjkh&?;^z2KR%M`flh{b)>F+myQt>KLp) zzN4QXw&2)^&rQW%P_-mYE$!aDt9qIFSqmfez9dsqhE|}3a5N~<&m%S2pSdf+%AcrU zUD03dB3ayRFAFM#g<{Bs*Tl`NwekJD{!io-HbJ_JvjpB>@m1wwRhOtAI7@06dZ;Gj z8iCL;ht%rzNrIzon~i+6I8djUK4x_=k_1FOtz$Tab~h06=(671S)WW5APUMrBsCD` z7>Yt$Dmj{)T)YQu&BRmYgKdl;rKGBEj7xz=Iq7YoDP-7?*++8_qE8N)wfSbCBLY|| zfuD93Z>#*Tsx5sBk=423UB%6K3>YF7Ifj>lWd+$~FjSjDa%p~Gv2^B6A5E9PDV*9$ z95zS)lbIXsBig0~ECZj+Pf`w7iujEtejJ+TR3hp(5v#&j!+(X%Z$0OHL4$oQ>}u_R zSkZi{r2Iwy$IdizD-Y(Ku8Ph9>gBr3n-HYA#nauqEt7ta*nhW>#{}O?q0Qch?1FKm zeB_5dOndjGLg=^NBJ}ayB5wwU{w7l-`E17IdK%E`w9K2qI&+y?8>pcV|-C z)KufBJh6RM)ho;~BG!lfW!xk#+a$FtLA+d>4~UN9pdi_+aIRLd@A9OSfT#@-uXt$k zX%=D~{W-S8B6dDy^@F{}dq?_O5V;kGt*GG}EtZsi^K#=)(BSxXWVF)Gi`@CBAT3be zg}UKEWIleVYsS*u#Wahp3df$+4)6JRXVmBmbkE{El}qv1oX|&dcC4zFV>o3dh?-2j zVCI{E+hENjj~*GYj52rMewPer(H=8KiL9>(-%=r|%%8kebVO>Dv5MM&-ID;$<>Q+} zClaO*Dq-(bFqU#7)89>)Al({eOcrc87IW*B*8HX?3XA%Bi5MP5Vr@%^K! zHWIWfr{S9EXcf|JO@y3eH?Or}7<9cuvvRBK!Lj9YV+>R#T^skqVmAk!6NK@Tciulf zmd7@xI>M}cWP^8teY57LG_jhiqGI06^ab~OX$*v(D(X#>@s(|TE?9E2En&Y&I6KeO zdLhjAU?9QAm&?uob*a?#%j*L@%*%*`@~d1sI_}NF*Fvt&1W|Fq7>X)Wgp6veLab9o z{sVV@=|fEMO`Gpq%sHlW@$#Z~RwhQ#qQ7oQLm^rgZ_SN%I(7vyVq;#!(A-67tUrp- zI1&}rtJNlX0nt0ZAGIH`7O?DviklyisgA|jnXR4nmgnI+B;T$L%Gb8yRG0)FT4zT- zl|7?*IyexO#ANfzSR?uRV_197vB-KmR9(N7q|mIcmbJTVnzH$-k9?PQArl&Oqvg*m zu!DPd>y?{F)g(vt8B!)G%1Yd(ZZd7m3H@aO0h|0r*^<4PM_=N zE3dxNc`=d@6|f37OU*AZjQ>Dg=^-r(^=z>&KgZZ$tVF(XXPS#YkZdp6{C>3!mEJN0 zZE?FF1NISZY(zq>N`RpU2Tq=8<+hVqyMsb)*HCok?-M&88RN@bhP z_sP}PSTKNXKdtztT3~(h=_NQI{m!iM%8G?+MaJ?O4!N}1wLAS>8}dun9-V!{Ycr^_ z%MW=>>*r5Rq8QG)v@SK_+x#i+?AiWl319iRsPas&Do zUaKGIlSclOy9%4=%dk@u^^A-m+ zDbgX2u-Er)FXg`MhQ6E3%*{xleFes^iC^0*w}3|sV=lu^Z(h`S1S5-9iINmoB!V0k z><3k_eY7L>lkXusokj{;>IuSSBZv{(^?lG$n6pLl%EEuevucvsLo!)S?E!+oOOtfVg zv0vEx-ozl$^o6X%dno-qE;%?F? z8IjN#@h^LH-hezauJYRxr@nmc?d@OH*EB93%`Wj!lsw}!0?v96cIhM9HZ?W!9bKhl z%a{|%6@|Q%Y+~g+J&@5NlWjGN$$vZ$;eIHLmtyy!V$2kDP|f&=QPqvGr0dwvGcPSR zmVWdWo~v+>Jt_e1?wxPM9f}*@=7ywUaUQVh)m$dQj_4cz36)s}ke4@bP>VeeDY zzZ7$Yzw9A7-_vh5ufBY&kQk|P@=5Ddj^3+qzDLW z0Xdc@GQhDS{V)kSA>_)c+S^ygz~$txXL5#(1vQLVQ|AJ(mJvJ*q2FD(o$PuTSpZ=f z=c#d|t<%Dx)W5>mjF*zp*!^%!wlK>>?cry!l6CKVPi7yv7~0K@AmStY0p6A2HeT;T z@zKk~93MuvDO9Lq8R5bY1gtpE2{P<%G>?%hZvpp@uR1)szCnCDak=9Vw}LNTNTd0ZcQ@c`9zZ*})%B`#x2IV+c#Y z89Zx~PF_ko9YwW3&>y=`7xqZR&WcKEXyU#~TG zLry#Tu0F20a2T}XizAGT8MzzXz_CY0riM8qG|c2g5?{+ztY}-G*oWs|hVLeG3*Zj# z6k)^mpiIz2RXYY4D;P>ZJgtnm5*vZ)WlS_YC|SyR1l#xMvlFG*^|}V` zN7h#`TPErU*q%Osfx0i-3|4tqi#qp-Z2H@Ey#!s>(rU7Z1l&yeZzdk6ZyzmSw;4CU zZi)?vBg($~JE?iYWLe|qGhbmeFAP<PGA4H0u7!$=rIE@YvQ;eR!fNxLN-9^3csrWTKfu!5tmM15;Je z3JwLvPPojB7HhSAIC%w}dZM84Y#5C~pr6f23`!zNvO7$MzBVbQ zUW*x2XBmE8IoshHus@E&bNCgS#%Xu6yvN+x)5O9FQknK@6n7xsp{LsTlcZ9_B`&k4 z#qP8|0wg|VfJ@Hb-@i2~1<1Y&O%S)6`eyR-NA|m|dBt?8)D-Rzh5}ajm2;K!1I)48 zGw#KI(oNv0-R5bup8X>^fBGj`)UFScoE5t=qI=0%C?9$2Q@Z|5ds2VW{cl&OGD2^s zyQO+08-j+WDv#-r3S{6iQg~uMZK~z&F+Kgvb>k%Mhk8jY(E&2SeMv8PugX2Mj}&jM zh~}ztl`ORyct&{=ZG_NL{dzuF|2!X!Wl$GwL*J=d$?Eye`;8<9PQ!&^YqFSM$TX$Z zR`iFetx2n>Y0vu&1E-lyM-m%O3~v!^?_raSXn!3hQejg*Z~K{Vg!krkcz_NXr_^sv zz4nuS&xM{Tf!*Z(&W#%u#Mf_FL|3&UpqYjS?p4fv#9t}x$$(CAdZSfpXW!dVT&>q()cCf!oP= z;tf_Uc9@7;<;$!P>~e3!J|yrSAvGGywJpxsrO@x7w;%AMqrr8}%lPZn^hp3m1Fo{q z@uKfS-cWtOz3<>f`8kBtr(Yie{NQws7a($u*I=wOgwf*Fzd_nu2x)O0q0{af%oz&K0Im&=?U$nm z!*QXu#;2+gWo1gd_Jm?g*d6<6=cfJdCERq5Y~DWQE-DI@=;|NzGRv!PPlNV}vvYB( zV!i%jc#s==@7FH5K-w&swe~5$O{eBbWq<%AkIu6(}woW*M*3Y|5CnF-S%!PKC zL))D_Zq`KJ-TfshUq`TS#2jd#(cgRlcre8F7^I}-CqK*O@l ziEMkgih4e)G8DF8{f(-;gN~oyn=C5p*^7a1GFEh4&D-cMil5j&Z`68F9ji?>F4b>3 z?WC`JJt=@(Qr+2tcJ4uXkuzv;&aeUY*E?r3soC2@7m#B?!FACSkMqu5v-bQHQ}7V%jF!iccaLY~e^*D;hD z@qJIDLlKkGPe{-`pGva_Xs3oQ0NY3Cn2Sw1(sa7{P( z0sWw|^w2Ysv@xG{?h zv#4Tck9ec?3Ji;1v;zji{5OuO^m3h6Q;O(6R>Ev919O3Ft|ssN4u)YXdD51u8@Z1P z+h&=JQxY97yUQ2fb1B}{;?g*?s`zY6?17TP<}>P;NZyt01>*GdL6kXcJS}!aJgOOZ zl!Bzm%@o$_b&5^A;t?ZdgqxuBtRLUTO^luBCpmB%UJBJ<|AaOrA2J$cuLi|BO@9%C4+j7OwEPD8r3mpcB5=8}{qo9Bb2B z3$v7v=*K)mVxvO3-N}%&s7HVq3cp9v1VrA^geW?k2J!8IaU8P(?n3X6Nz{Wq2N8yM ze~yZ}*e69Db2_0nkQ|T%Gv=#M-KLGS8Iw~H_{MtQIJF+bbh8zA?h3_6{%GF;yX@G> zoF_V-UE!_^`02@Q&&*z0xl2pI7Tw2;2B&AN&J_321@Z6amfqFcc)pi-wnOM)e+zZg zen*|o^{bjWztj}Z%s0=HjXH0quDNyCQzU6Xd9|29vf{Ij+WZ^aq1IWkq*RWWX||;p z^jq)jq7wE2goKVnhzW+djdVm@^K2km5*C?jUWDYYp)=ncsGNfgk zCX*LPX}CV0n!_M-H(>ANxq-BnHb-UvT2k=3-XU+aatGH`^wydc(^2s|>fum8wb{D* zrK(G2-~bZyfE z1(+XJaLtPmqh$pY!0LWOu<5mkSYW;bSm@UJX2U_N`}y@X_Zf3vCS=Em!b zY|nDYvZM8`C$p(|vlb*!W&Z1qf8Ej>fTVB@vA9&1x<_*--X2SA-+5yz4wG-8GIt`{ z98SZTQ*?``?TnQYr9Mh`FqQ4O7>`22A6K=~P&h8%w10M(MCM$zz}Ad}b@0i8S+axL zUtcU&#}%l27e=_2gr9~S+}sZwAKeNg9HhPRP9+@7`ZUffo3%n#1|3%N1)~-6&nBX6 zMn}k*c&t8QA)SqTsPwZNQJxkeUV^`y+D(1e4!r~qi!aYOj4gO6cgUNNovrVdJ)dEF zkD2&4vIq5j%CbmOhlwpnEJ8_%-@48E({&Kk0*VF^BD`gxA_i?ZxiJ3%@N|fX+Tg7( z9vZ2HRckWf7D5MvMQNf%IHtpGpI6S9;#BaQex{2ne?dXvWF&axJa~9*HLjc)ml#n@kcru>oT=k>i4wz-^cuN+WZ!ZJI1hNvRE|T5&uv z6cNb%dug)5W<|O2R*RQ*>&*l$W0q#iLdY3IJO2AE@jOg&e_tiisZHS3YM(2^ zY5&iQ{sT%jDVEcQhzF;-0Pt6o8n(O5=d9O17YDpupMIUh&y&uNs{f=26{+zk&lW-4 zO_`7SGALN|!&o|v0EP*(ZK5=#dw3q*Rv3a-KPjzhj|oD!>4qZ5&}VLN20frzEj>a< z?ef+i*)RUR^i{Azg0kFjYE?j(?@gfHz0KWm#0tuX2lrjwBk~nF>WXfH2i^FHhg!yv+#%m+#3?2U6H^i=4O!|{iTw8ij;WM}PsF@wq%{CTi|xEDDKqWsvEu)I uu2FO&e~v0jmmi@W-c^ciSO!rH?tsRSFyB@<5+HO0UYFH%)QVLsasLatu;Fk3 literal 0 HcmV?d00001 From dd05f9b3b03e4550de434b40c68d09e936dc3ea2 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Tue, 18 Jun 2024 19:08:46 -0500 Subject: [PATCH 023/164] sizing Concurrence enum --- src/EnergyPlus/DataSizing.hh | 89 ++++++++++++++++----------- src/EnergyPlus/OutputReportTabular.cc | 2 +- src/EnergyPlus/ReportCoilSelection.cc | 66 +++++++++----------- src/EnergyPlus/ReportCoilSelection.hh | 5 +- src/EnergyPlus/SimAirServingZones.cc | 20 +++--- src/EnergyPlus/SizingManager.cc | 11 ++-- 6 files changed, 103 insertions(+), 90 deletions(-) diff --git a/src/EnergyPlus/DataSizing.hh b/src/EnergyPlus/DataSizing.hh index e8084964c3a..394c973082e 100644 --- a/src/EnergyPlus/DataSizing.hh +++ b/src/EnergyPlus/DataSizing.hh @@ -117,11 +117,28 @@ namespace DataSizing { Num }; - // parameters for sizing + // parameters for sizing (keept this for now to avoid plant sizing output changes) constexpr int NonCoincident(1); constexpr int Coincident(2); constexpr int Combination(3); + // parameters for sizing concurrence method + enum class Concurrence + { + Invalid = -1, + NonCoincident, + Coincident, + Combination, + NA, + Num + }; + + constexpr std::array(Concurrence::Num)> ConcurrenceMethodNamesUC{ + "NonCoincident", "Coincident", "Combination", "NA"}; + + constexpr std::array(Concurrence::Num)> ConcurrenceMethodNames{ + "Non-Coincident", "Coincident", "Combination", "N/A"}; + // parameters for Cooling Peak Load Type enum class PeakLoad { @@ -767,23 +784,23 @@ namespace DataSizing { struct SystemSizingInputData { // Members - std::string AirPriLoopName; // name of an AirLoopHVAC object - int AirLoopNum = 0; // index number of air loop - LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on sensible, latent, total, ventilation - int SizingOption = 0; // 1 = noncoincident, 2 = coincident - OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing - OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing - Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] - Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio - bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input - Real64 PreheatTemp = 0.0; // preheat design set temperature [C] - Real64 PrecoolTemp = 0.0; // precool design set temperature [C] - Real64 PreheatHumRat = 0.0; // preheat design humidity ratio [kg water/kg dry air] - Real64 PrecoolHumRat = 0.0; // precool design humidity ratio [kg water/kg dry air] - Real64 CoolSupTemp = 0.0; // cooling design supply air temperature [C] - Real64 HeatSupTemp = 0.0; // heating design supply air temperature [C] - Real64 CoolSupHumRat = 0.0; // cooling design supply air humidity ratio [kg water/kg dry air] - Real64 HeatSupHumRat = 0.0; // heating design supply air humidity ratio [kg water/kg dry air] + std::string AirPriLoopName; // name of an AirLoopHVAC object + int AirLoopNum = 0; // index number of air loop + LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on sensible, latent, total, ventilation + DataSizing::Concurrence concurrenceMethod = DataSizing::Concurrence::Invalid; // noncoincident, coincident + OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing + OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing + Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] + Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio + bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input + Real64 PreheatTemp = 0.0; // preheat design set temperature [C] + Real64 PrecoolTemp = 0.0; // precool design set temperature [C] + Real64 PreheatHumRat = 0.0; // preheat design humidity ratio [kg water/kg dry air] + Real64 PrecoolHumRat = 0.0; // precool design humidity ratio [kg water/kg dry air] + Real64 CoolSupTemp = 0.0; // cooling design supply air temperature [C] + Real64 HeatSupTemp = 0.0; // heating design supply air temperature [C] + Real64 CoolSupHumRat = 0.0; // cooling design supply air humidity ratio [kg water/kg dry air] + Real64 HeatSupHumRat = 0.0; // heating design supply air humidity ratio [kg water/kg dry air] AirflowSizingMethod CoolAirDesMethod = AirflowSizingMethod::Invalid; // choice of how to get system cooling design air flow rates; // 1 = calc from des day simulation; 2=m3/s per system, user input Real64 DesCoolAirFlow = 0.0; // design system supply air flow rate for cooling[m3/s] @@ -819,24 +836,24 @@ namespace DataSizing { struct SystemSizingData // Contains data for system sizing { // Members - std::string AirPriLoopName; // name of an AirLoopHVAC object - std::string CoolDesDay; // name of a cooling design day - std::string HeatDesDay; // name of a heating design day - LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on Sensible, Latent, Total, Ventilation - int SizingOption = 0; // 1 = noncoincident, 2 = coincident. - OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing - OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing - Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] - Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio - bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input - Real64 PreheatTemp = 0.0; // preheat design set temperature - Real64 PrecoolTemp = 0.0; // precool design set temperature [C] - Real64 PreheatHumRat = 0.0; // preheat design humidity ratio [kg water/kg dry air] - Real64 PrecoolHumRat = 0.0; // precool design humidity ratio [kg water/kg dry air] - Real64 CoolSupTemp = 0.0; // cooling design supply air temperature [C] - Real64 HeatSupTemp = 0.0; // heating design supply air temperature[C] - Real64 CoolSupHumRat = 0.0; // cooling design supply air humidity ratio [kg water/kg dry air] - Real64 HeatSupHumRat = 0.0; // heating design supply air humidity ratio [kg water/kg dry air] + std::string AirPriLoopName; // name of an AirLoopHVAC object + std::string CoolDesDay; // name of a cooling design day + std::string HeatDesDay; // name of a heating design day + LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on Sensible, Latent, Total, Ventilation + DataSizing::Concurrence concurrenceMethod = DataSizing::Concurrence::Invalid; // noncoincident, coincident. + OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing + OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing + Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] + Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio + bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input + Real64 PreheatTemp = 0.0; // preheat design set temperature + Real64 PrecoolTemp = 0.0; // precool design set temperature [C] + Real64 PreheatHumRat = 0.0; // preheat design humidity ratio [kg water/kg dry air] + Real64 PrecoolHumRat = 0.0; // precool design humidity ratio [kg water/kg dry air] + Real64 CoolSupTemp = 0.0; // cooling design supply air temperature [C] + Real64 HeatSupTemp = 0.0; // heating design supply air temperature[C] + Real64 CoolSupHumRat = 0.0; // cooling design supply air humidity ratio [kg water/kg dry air] + Real64 HeatSupHumRat = 0.0; // heating design supply air humidity ratio [kg water/kg dry air] AirflowSizingMethod CoolAirDesMethod = AirflowSizingMethod::Invalid; // choice of how to get system design cooling air flow rates; // 1 = calc from des day simulation; 2=m3/s per system, user input AirflowSizingMethod HeatAirDesMethod = AirflowSizingMethod::Invalid; // choice of how to get system design heating air flow rates; diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 0e7af812b51..54bec06f4ea 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -15351,7 +15351,7 @@ void WriteLoadComponentSummaryTables(EnergyPlusData &state) } for (int SysSizIndex = 1; SysSizIndex <= state.dataSize->NumSysSizInput; ++SysSizIndex) { if (state.dataSize->SysSizInput(SysSizIndex).AirLoopNum != iAirLoop) continue; - if (state.dataSize->SysSizInput(SysSizIndex).SizingOption == DataSizing::Coincident) { + if (state.dataSize->SysSizInput(SysSizIndex).concurrenceMethod == DataSizing::Concurrence::Coincident) { airLoopCoolTable.peakDesSensLoad = finalSysSizing.SysCoolCoinSpaceSens; airLoopCoolTable.designPeakLoad = finalSysSizing.SysDesCoolLoad; diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index 183aa090711..64eaa9d801b 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -81,20 +81,20 @@ void createCoilSelectionReportObj(EnergyPlusData &state) CoilSelectionData::CoilSelectionData( // constructor std::string const &coilName) : isCooling(false), isHeating(false), coilNum(-999), airloopNum(-999), oaControllerNum(-999), zoneEqNum(-999), oASysNum(-999), zoneHVACTypeNum(0), - zoneHVACIndex(0), typeof_Coil(-999), coilSizingMethodConcurrence(-999), coilSizingMethodCapacity(-999), coilSizingMethodAirFlow(-999), - isCoilSizingForTotalLoad(false), capIsAutosized(false), volFlowIsAutosized(false), coilWaterFlowUser(-999.0), oaPretreated(false), - isSupplementalHeater(false), coilTotCapFinal(-999.0), coilSensCapFinal(-999.0), coilRefAirVolFlowFinal(-999.0), - coilRefWaterVolFlowFinal(-999.0), coilTotCapAtPeak(-999.0), coilSensCapAtPeak(-999.0), coilDesMassFlow(-999.0), coilDesVolFlow(-999.0), - coilDesEntTemp(-999.0), coilDesEntWetBulb(-999.0), coilDesEntHumRat(-999.0), coilDesEntEnth(-999.0), coilDesLvgTemp(-999.0), - coilDesLvgWetBulb(-999.0), coilDesLvgHumRat(-999.0), coilDesLvgEnth(-999.0), coilDesWaterMassFlow(-999.0), coilDesWaterEntTemp(-999.0), - coilDesWaterLvgTemp(-999.0), coilDesWaterTempDiff(-999.0), pltSizNum(-999), waterLoopNum(-999), oaPeakTemp(-999.00), oaPeakHumRat(-999.0), - oaPeakWetBulb(-999.0), oaPeakVolFlow(-999.0), oaPeakVolFrac(-999.0), oaDoaTemp(-999.0), oaDoaHumRat(-999.0), raPeakTemp(-999.0), - raPeakHumRat(-999.0), rmPeakTemp(-999.0), rmPeakHumRat(-999.0), rmPeakRelHum(-999.0), rmSensibleAtPeak(-999.0), rmLatentAtPeak(0.0), - coilIdealSizCapOverSimPeakCap(-999.0), coilIdealSizCapUnderSimPeakCap(-999.0), reheatLoadMult(-999.0), minRatio(-999.0), maxRatio(-999.0), - cpMoistAir(-999.0), cpDryAir(-999.0), rhoStandAir(-999.0), rhoFluid(-999.0), cpFluid(-999.0), coilCapFTIdealPeak(1.0), coilRatedTotCap(-999.0), - coilRatedSensCap(-999.0), ratedAirMassFlow(-999.0), ratedCoilInDb(-999.0), ratedCoilInWb(-999.0), ratedCoilInHumRat(-999.0), - ratedCoilInEnth(-999.0), ratedCoilOutDb(-999.0), ratedCoilOutWb(-999.0), ratedCoilOutHumRat(-999.0), ratedCoilOutEnth(-999.0), - ratedCoilEff(-999.0), ratedCoilBpFactor(-999.0), ratedCoilAppDewPt(-999.0), ratedCoilOadbRef(-999.0), ratedCoilOawbRef(-999.0), + zoneHVACIndex(0), typeof_Coil(-999), coilSizingMethodCapacity(-999), coilSizingMethodAirFlow(-999), isCoilSizingForTotalLoad(false), + capIsAutosized(false), volFlowIsAutosized(false), coilWaterFlowUser(-999.0), oaPretreated(false), isSupplementalHeater(false), + coilTotCapFinal(-999.0), coilSensCapFinal(-999.0), coilRefAirVolFlowFinal(-999.0), coilRefWaterVolFlowFinal(-999.0), coilTotCapAtPeak(-999.0), + coilSensCapAtPeak(-999.0), coilDesMassFlow(-999.0), coilDesVolFlow(-999.0), coilDesEntTemp(-999.0), coilDesEntWetBulb(-999.0), + coilDesEntHumRat(-999.0), coilDesEntEnth(-999.0), coilDesLvgTemp(-999.0), coilDesLvgWetBulb(-999.0), coilDesLvgHumRat(-999.0), + coilDesLvgEnth(-999.0), coilDesWaterMassFlow(-999.0), coilDesWaterEntTemp(-999.0), coilDesWaterLvgTemp(-999.0), coilDesWaterTempDiff(-999.0), + pltSizNum(-999), waterLoopNum(-999), oaPeakTemp(-999.00), oaPeakHumRat(-999.0), oaPeakWetBulb(-999.0), oaPeakVolFlow(-999.0), + oaPeakVolFrac(-999.0), oaDoaTemp(-999.0), oaDoaHumRat(-999.0), raPeakTemp(-999.0), raPeakHumRat(-999.0), rmPeakTemp(-999.0), + rmPeakHumRat(-999.0), rmPeakRelHum(-999.0), rmSensibleAtPeak(-999.0), rmLatentAtPeak(0.0), coilIdealSizCapOverSimPeakCap(-999.0), + coilIdealSizCapUnderSimPeakCap(-999.0), reheatLoadMult(-999.0), minRatio(-999.0), maxRatio(-999.0), cpMoistAir(-999.0), cpDryAir(-999.0), + rhoStandAir(-999.0), rhoFluid(-999.0), cpFluid(-999.0), coilCapFTIdealPeak(1.0), coilRatedTotCap(-999.0), coilRatedSensCap(-999.0), + ratedAirMassFlow(-999.0), ratedCoilInDb(-999.0), ratedCoilInWb(-999.0), ratedCoilInHumRat(-999.0), ratedCoilInEnth(-999.0), + ratedCoilOutDb(-999.0), ratedCoilOutWb(-999.0), ratedCoilOutHumRat(-999.0), ratedCoilOutEnth(-999.0), ratedCoilEff(-999.0), + ratedCoilBpFactor(-999.0), ratedCoilAppDewPt(-999.0), ratedCoilOadbRef(-999.0), ratedCoilOawbRef(-999.0), supFanType(HVAC::FanType::Invalid), supFanNum(0), fanSizeMaxAirVolumeFlow(-999.0), fanSizeMaxAirMassFlow(-999.0), fanHeatGainIdealPeak(-999.0), coilAndFanNetTotalCapacityIdealPeak(-999.0), plantDesMaxMassFlowRate(-999.0), plantDesRetTemp(-999.0), plantDesSupTemp(-999.0), @@ -734,15 +734,7 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) c->oaPeakVolFrac = -999.0; } - if (c->coilSizingMethodConcurrence == DataSizing::NonCoincident) { - c->coilSizingMethodConcurrenceName = "Non-Coincident"; - } else if (c->coilSizingMethodConcurrence == DataSizing::Coincident) { - c->coilSizingMethodConcurrenceName = "Coincident"; - } else if (c->coilSizingMethodConcurrence == DataSizing::Combination) { - c->coilSizingMethodConcurrenceName = "Combination"; - } else { - c->coilSizingMethodConcurrenceName = "N/A"; - } + c->coilSizingMethodConcurrenceName = DataSizing::ConcurrenceMethodNames[(int)c->coilSizingMethodConcurrence]; if (c->coilSizingMethodCapacity == DataSizing::CoolingDesignCapacity) { c->coilSizingMethodCapacityName = "CoolingDesignCapacity"; @@ -1272,7 +1264,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->oaPeakHumRat = finalSysSizing.OutHumRatAtCoolPeak; c->raPeakTemp = finalSysSizing.RetTempAtCoolPeak; c->raPeakHumRat = finalSysSizing.RetHumRatAtCoolPeak; - c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; + c->coilSizingMethodConcurrence = finalSysSizing.concurrenceMethod; c->coilSizingMethodCapacity = finalSysSizing.CoolingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleCoolSAFMethod; // DesOutAirVolFlow @@ -1331,9 +1323,9 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->rmPeakRelHum = -999.0; } - if (c->coilSizingMethodConcurrence == DataSizing::Coincident) { + if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::Coincident) { c->rmSensibleAtPeak = finalSysSizing.SysCoolCoinSpaceSens; - } else if (c->coilSizingMethodConcurrence == DataSizing::NonCoincident) { + } else if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::NonCoincident) { c->rmSensibleAtPeak = sumSensLoad; } else { // DataSizing::Combination or other c->rmSensibleAtPeak = sumSensLoad; @@ -1478,14 +1470,14 @@ void ReportCoilSelection::setCoilCoolingCapacity( state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } - int sizMethod = 0; + DataSizing::Concurrence sizMethod = DataSizing::Concurrence::Invalid; bool sizMethodsAreTheSame = true; for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; if (airLoopNum == 0) { - sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; + sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod; } else { - if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { + if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod) { sizMethodsAreTheSame = false; } } @@ -1493,7 +1485,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( if (sizMethodsAreTheSame) { c->coilSizingMethodConcurrence = sizMethod; } else { - c->coilSizingMethodConcurrence = DataSizing::Combination; + c->coilSizingMethodConcurrence = DataSizing::Concurrence::Combination; } } } else { @@ -1541,7 +1533,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow; c->raPeakTemp = finalSysSizing.HeatRetTemp; c->raPeakHumRat = finalSysSizing.HeatRetHumRat; - c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; + c->coilSizingMethodConcurrence = finalSysSizing.concurrenceMethod; c->coilSizingMethodCapacity = finalSysSizing.HeatingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleHeatSAFMethod; @@ -1596,9 +1588,9 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->rmPeakRelHum = -999.0; } - if (c->coilSizingMethodConcurrence == DataSizing::Coincident) { + if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::Coincident) { c->rmSensibleAtPeak = finalSysSizing.SysHeatCoinSpaceSens; - } else if (c->coilSizingMethodConcurrence == DataSizing::NonCoincident) { + } else if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::NonCoincident) { c->rmSensibleAtPeak = sumLoad; } @@ -1775,14 +1767,14 @@ void ReportCoilSelection::setCoilHeatingCapacity( state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } - int sizMethod = 0; + DataSizing::Concurrence sizMethod = DataSizing::Concurrence::Invalid; bool sizMethodsAreTheSame = true; for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; if (airLoopNum == 0) { - sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; + sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod; } else { - if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { + if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod) { sizMethodsAreTheSame = false; } } @@ -1790,7 +1782,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( if (sizMethodsAreTheSame) { c->coilSizingMethodConcurrence = sizMethod; } else { - c->coilSizingMethodConcurrence = DataSizing::Combination; + c->coilSizingMethodConcurrence = DataSizing::Concurrence::Combination; } } } else { diff --git a/src/EnergyPlus/ReportCoilSelection.hh b/src/EnergyPlus/ReportCoilSelection.hh index 105b82899f7..d15bf87a2e0 100644 --- a/src/EnergyPlus/ReportCoilSelection.hh +++ b/src/EnergyPlus/ReportCoilSelection.hh @@ -56,6 +56,7 @@ // EnergyPlus Headers #include #include +#include #include namespace EnergyPlus { @@ -98,8 +99,8 @@ public: // data int typeof_Coil; // type of coil, e.g., PlantEquipmentType::CoilWaterSimpleHeating, PlantEquipmentType::CoilWaterDetailedFlatCooling, // PlantEquipmentType::CoilWaterCooling - int coilSizingMethodConcurrence; // 1 = noncoincident, 2 = coincident - std::string coilSizingMethodConcurrenceName; // string name of sizing method for concurrence + DataSizing::Concurrence coilSizingMethodConcurrence = DataSizing::Concurrence::NA; // non-coincident, coincident, combination, n/a + std::string coilSizingMethodConcurrenceName; // string name of sizing method for concurrence int coilSizingMethodCapacity; // 8=CoolingDesignCapacity, 9=HeatingDesignCapacity, 10=CapacityPerFloorArea, 11=FractionOfAutosizedCoolingCapacity, // 12=FractionOfAutosizedHeatingCapacity diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index d4f4fb9436e..20acbda6bee 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -4162,7 +4162,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) sysSizing.HeatSupTemp = sysSizInput.HeatSupTemp; sysSizing.CoolSupHumRat = sysSizInput.CoolSupHumRat; sysSizing.HeatSupHumRat = sysSizInput.HeatSupHumRat; - sysSizing.SizingOption = sysSizInput.SizingOption; + sysSizing.concurrenceMethod = sysSizInput.concurrenceMethod; if (primaryAirSystems.isAllOA) { sysSizing.CoolOAOption = OAControl::AllOA; sysSizing.HeatOAOption = OAControl::AllOA; @@ -4223,7 +4223,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) finalSysSizing.HeatSupTemp = sysSizInput.HeatSupTemp; finalSysSizing.CoolSupHumRat = sysSizInput.CoolSupHumRat; finalSysSizing.HeatSupHumRat = sysSizInput.HeatSupHumRat; - finalSysSizing.SizingOption = sysSizInput.SizingOption; + finalSysSizing.concurrenceMethod = sysSizInput.concurrenceMethod; finalSysSizing.CoolAirDesMethod = sysSizInput.CoolAirDesMethod; finalSysSizing.HeatAirDesMethod = sysSizInput.HeatAirDesMethod; finalSysSizing.ScaleCoolSAFMethod = sysSizInput.ScaleCoolSAFMethod; @@ -4270,7 +4270,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) calcSysSizing.HeatSupTemp = sysSizInput.HeatSupTemp; calcSysSizing.CoolSupHumRat = sysSizInput.CoolSupHumRat; calcSysSizing.HeatSupHumRat = sysSizInput.HeatSupHumRat; - calcSysSizing.SizingOption = sysSizInput.SizingOption; + calcSysSizing.concurrenceMethod = sysSizInput.concurrenceMethod; calcSysSizing.CoolAirDesMethod = sysSizInput.CoolAirDesMethod; calcSysSizing.HeatAirDesMethod = sysSizInput.HeatAirDesMethod; calcSysSizing.ScaleCoolSAFMethod = sysSizInput.ScaleCoolSAFMethod; @@ -5509,8 +5509,8 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn int NumZonesHeated = state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; auto &sysSizing = state.dataSize->SysSizing(state.dataSize->CurOverallSimDay, AirLoopNum); - switch (sysSizing.SizingOption) { - case Coincident: { + switch (sysSizing.concurrenceMethod) { + case DataSizing::Concurrence::Coincident: { if (finalSysSizing.SystemOAMethod == SysOAMethod::ZoneSum) { sysSizing.DesCoolVolFlow = sysSizing.CoinCoolMassFlow / state.dataEnvrn->StdRhoAir; sysSizing.DesHeatVolFlow = sysSizing.CoinHeatMassFlow / state.dataEnvrn->StdRhoAir; @@ -5841,7 +5841,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn sysSizing.DesMainVolFlow = max(sysSizing.DesCoolVolFlow, sysSizing.DesHeatVolFlow); // this should also be as least as big as is needed for Vot } break; - case NonCoincident: { + case DataSizing::Concurrence::NonCoincident: { if (finalSysSizing.SystemOAMethod == SysOAMethod::ZoneSum) { sysSizing.DesCoolVolFlow = sysSizing.NonCoinCoolMassFlow / state.dataEnvrn->StdRhoAir; sysSizing.DesHeatVolFlow = sysSizing.NonCoinHeatMassFlow / state.dataEnvrn->StdRhoAir; @@ -6540,7 +6540,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn } // move the noncoincident results into the system sizing array - if (state.dataSize->CalcSysSizing(AirLoopNum).SizingOption == NonCoincident) { + if (state.dataSize->CalcSysSizing(AirLoopNum).concurrenceMethod == DataSizing::Concurrence::NonCoincident) { // But first check to see if the noncoincident result is actually bigger than the coincident (for 100% outside air) if (!(state.dataSize->FinalSysSizing(AirLoopNum).CoolOAOption == OAControl::AllOA && SysSensCoolCap <= 0.0)) { // CoolOAOption = Yes 100% OA @@ -6761,7 +6761,8 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn ZoneOARatio = 0.0; } state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).scaleZoneCooling(ZoneOARatio); - } else if ((SysCoolSizingRat > 1.0) || (SysCoolSizingRat < 1.0 && finalSysSizing.SizingOption == NonCoincident)) { + } else if ((SysCoolSizingRat > 1.0) || + (SysCoolSizingRat < 1.0 && finalSysSizing.concurrenceMethod == DataSizing::Concurrence::NonCoincident)) { // size on user input system design flows state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).scaleZoneCooling(SysCoolSizingRat); } @@ -6821,7 +6822,8 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn ZoneOARatio = termUnitFinalZoneSizing.MinOA / max(termUnitFinalZoneSizing.DesHeatVolFlow, termUnitFinalZoneSizing.MinOA); ZoneOARatio *= (1.0 + state.dataSize->TermUnitSizing(TermUnitSizingIndex).InducRat); termUnitFinalZoneSizing.scaleZoneHeating(ZoneOARatio); - } else if ((SysHeatSizingRat > 1.0) || (SysHeatSizingRat < 1.0 && finalSysSizing.SizingOption == NonCoincident)) { + } else if ((SysHeatSizingRat > 1.0) || + (SysHeatSizingRat < 1.0 && finalSysSizing.concurrenceMethod == DataSizing::Concurrence::NonCoincident)) { // size on user input system design flows termUnitFinalZoneSizing.scaleZoneHeating(SysHeatSizingRat); } diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 9d2c1b6f5f4..330dd875faa 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -1115,8 +1115,9 @@ void ManageSystemSizingAdjustments(EnergyPlusData &state) if (allocated(FinalSysSizing)) { // correct sizing design heating volume flow rate based on finalized air terminal unit operation - if (FinalSysSizing(AirLoopNum).SizingOption == - NonCoincident) { // If non-coincident sizing method for this air loop, the we can use these sum's from air terminals directly + if (FinalSysSizing(AirLoopNum).concurrenceMethod == + DataSizing::Concurrence::NonCoincident) { // If non-coincident sizing method for this air loop, the we can use these sum's from + // air terminals directly FinalSysSizing(AirLoopNum).DesHeatVolFlow = max(airLoopHeatingMaximumFlowRateSum, FinalSysSizing(AirLoopNum).DesHeatVolFlow); FinalSysSizing(AirLoopNum).DesMainVolFlow = max(airLoopMaxFlowRateSum, FinalSysSizing(AirLoopNum).DesMainVolFlow); if (FinalSysSizing(AirLoopNum).sysSizeCoolingDominant) { @@ -1126,7 +1127,7 @@ void ManageSystemSizingAdjustments(EnergyPlusData &state) FinalSysSizing(AirLoopNum).DesCoolVolFlow = max(airLoopHeatingMinimumFlowRateSum, FinalSysSizing(AirLoopNum).DesCoolVolFlow); FinalSysSizing(AirLoopNum).MassFlowAtCoolPeak = FinalSysSizing(AirLoopNum).DesCoolVolFlow * state.dataEnvrn->StdRhoAir; } - } else if (FinalSysSizing(AirLoopNum).SizingOption == Coincident) { + } else if (FinalSysSizing(AirLoopNum).concurrenceMethod == DataSizing::Concurrence::Coincident) { if (FinalSysSizing(AirLoopNum).sysSizeCoolingDominant) { // use minimum heating flow sum from air terminals // know that minimum heating flow is a hard minimum regardless of concurrence situation, so make sure that design is at @@ -3578,9 +3579,9 @@ void GetSystemSizingInput(EnergyPlusData &state) { std::string const &sizingOption = state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum); if (sizingOption == "COINCIDENT") { - SysSizInput(SysSizIndex).SizingOption = Coincident; + SysSizInput(SysSizIndex).concurrenceMethod = DataSizing::Concurrence::Coincident; } else if (sizingOption == "NONCOINCIDENT") { - SysSizInput(SysSizIndex).SizingOption = NonCoincident; + SysSizInput(SysSizIndex).concurrenceMethod = DataSizing::Concurrence::NonCoincident; } else { ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum))); ShowContinueError(state, From c8aa4b3c68c71bd64660884af62175b6c451b9b4 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 19 Jun 2024 08:06:43 -0500 Subject: [PATCH 024/164] Fix and rollback --- src/EnergyPlus/DataSizing.hh | 30 +++++++++---------- src/EnergyPlus/OutputReportTabular.cc | 2 +- src/EnergyPlus/ReportCoilSelection.cc | 12 ++++---- src/EnergyPlus/SimAirServingZones.cc | 14 ++++----- src/EnergyPlus/SizingManager.cc | 8 ++--- .../unit/DesiccantDehumidifiers.unit.cc | 2 +- .../unit/OutputReportTabular.unit.cc | 7 ++--- 7 files changed, 36 insertions(+), 39 deletions(-) diff --git a/src/EnergyPlus/DataSizing.hh b/src/EnergyPlus/DataSizing.hh index 394c973082e..63d7d2a9e56 100644 --- a/src/EnergyPlus/DataSizing.hh +++ b/src/EnergyPlus/DataSizing.hh @@ -784,13 +784,13 @@ namespace DataSizing { struct SystemSizingInputData { // Members - std::string AirPriLoopName; // name of an AirLoopHVAC object - int AirLoopNum = 0; // index number of air loop - LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on sensible, latent, total, ventilation - DataSizing::Concurrence concurrenceMethod = DataSizing::Concurrence::Invalid; // noncoincident, coincident - OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing - OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing - Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] + std::string AirPriLoopName; // name of an AirLoopHVAC object + int AirLoopNum = 0; // index number of air loop + LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on sensible, latent, total, ventilation + DataSizing::Concurrence SizingOption = DataSizing::Concurrence::NonCoincident; // noncoincident, coincident + OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing + OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing + Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input Real64 PreheatTemp = 0.0; // preheat design set temperature [C] @@ -836,14 +836,14 @@ namespace DataSizing { struct SystemSizingData // Contains data for system sizing { // Members - std::string AirPriLoopName; // name of an AirLoopHVAC object - std::string CoolDesDay; // name of a cooling design day - std::string HeatDesDay; // name of a heating design day - LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on Sensible, Latent, Total, Ventilation - DataSizing::Concurrence concurrenceMethod = DataSizing::Concurrence::Invalid; // noncoincident, coincident. - OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing - OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing - Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] + std::string AirPriLoopName; // name of an AirLoopHVAC object + std::string CoolDesDay; // name of a cooling design day + std::string HeatDesDay; // name of a heating design day + LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on Sensible, Latent, Total, Ventilation + DataSizing::Concurrence SizingOption = DataSizing::Concurrence::NonCoincident; // noncoincident, coincident. + OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing + OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing + Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input Real64 PreheatTemp = 0.0; // preheat design set temperature diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 54bec06f4ea..821fc171110 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -15351,7 +15351,7 @@ void WriteLoadComponentSummaryTables(EnergyPlusData &state) } for (int SysSizIndex = 1; SysSizIndex <= state.dataSize->NumSysSizInput; ++SysSizIndex) { if (state.dataSize->SysSizInput(SysSizIndex).AirLoopNum != iAirLoop) continue; - if (state.dataSize->SysSizInput(SysSizIndex).concurrenceMethod == DataSizing::Concurrence::Coincident) { + if (state.dataSize->SysSizInput(SysSizIndex).SizingOption == DataSizing::Concurrence::Coincident) { airLoopCoolTable.peakDesSensLoad = finalSysSizing.SysCoolCoinSpaceSens; airLoopCoolTable.designPeakLoad = finalSysSizing.SysDesCoolLoad; diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index 64eaa9d801b..50841801321 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -1264,7 +1264,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->oaPeakHumRat = finalSysSizing.OutHumRatAtCoolPeak; c->raPeakTemp = finalSysSizing.RetTempAtCoolPeak; c->raPeakHumRat = finalSysSizing.RetHumRatAtCoolPeak; - c->coilSizingMethodConcurrence = finalSysSizing.concurrenceMethod; + c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; c->coilSizingMethodCapacity = finalSysSizing.CoolingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleCoolSAFMethod; // DesOutAirVolFlow @@ -1475,9 +1475,9 @@ void ReportCoilSelection::setCoilCoolingCapacity( for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; if (airLoopNum == 0) { - sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod; + sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; } else { - if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod) { + if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { sizMethodsAreTheSame = false; } } @@ -1533,7 +1533,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow; c->raPeakTemp = finalSysSizing.HeatRetTemp; c->raPeakHumRat = finalSysSizing.HeatRetHumRat; - c->coilSizingMethodConcurrence = finalSysSizing.concurrenceMethod; + c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; c->coilSizingMethodCapacity = finalSysSizing.HeatingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleHeatSAFMethod; @@ -1772,9 +1772,9 @@ void ReportCoilSelection::setCoilHeatingCapacity( for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; if (airLoopNum == 0) { - sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod; + sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; } else { - if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).concurrenceMethod) { + if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { sizMethodsAreTheSame = false; } } diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 20acbda6bee..494351d0478 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -4162,7 +4162,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) sysSizing.HeatSupTemp = sysSizInput.HeatSupTemp; sysSizing.CoolSupHumRat = sysSizInput.CoolSupHumRat; sysSizing.HeatSupHumRat = sysSizInput.HeatSupHumRat; - sysSizing.concurrenceMethod = sysSizInput.concurrenceMethod; + sysSizing.SizingOption = sysSizInput.SizingOption; if (primaryAirSystems.isAllOA) { sysSizing.CoolOAOption = OAControl::AllOA; sysSizing.HeatOAOption = OAControl::AllOA; @@ -4223,7 +4223,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) finalSysSizing.HeatSupTemp = sysSizInput.HeatSupTemp; finalSysSizing.CoolSupHumRat = sysSizInput.CoolSupHumRat; finalSysSizing.HeatSupHumRat = sysSizInput.HeatSupHumRat; - finalSysSizing.concurrenceMethod = sysSizInput.concurrenceMethod; + finalSysSizing.SizingOption = sysSizInput.SizingOption; finalSysSizing.CoolAirDesMethod = sysSizInput.CoolAirDesMethod; finalSysSizing.HeatAirDesMethod = sysSizInput.HeatAirDesMethod; finalSysSizing.ScaleCoolSAFMethod = sysSizInput.ScaleCoolSAFMethod; @@ -4270,7 +4270,7 @@ void SetUpSysSizingArrays(EnergyPlusData &state) calcSysSizing.HeatSupTemp = sysSizInput.HeatSupTemp; calcSysSizing.CoolSupHumRat = sysSizInput.CoolSupHumRat; calcSysSizing.HeatSupHumRat = sysSizInput.HeatSupHumRat; - calcSysSizing.concurrenceMethod = sysSizInput.concurrenceMethod; + calcSysSizing.SizingOption = sysSizInput.SizingOption; calcSysSizing.CoolAirDesMethod = sysSizInput.CoolAirDesMethod; calcSysSizing.HeatAirDesMethod = sysSizInput.HeatAirDesMethod; calcSysSizing.ScaleCoolSAFMethod = sysSizInput.ScaleCoolSAFMethod; @@ -5509,7 +5509,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn int NumZonesHeated = state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumZonesHeated; auto &sysSizing = state.dataSize->SysSizing(state.dataSize->CurOverallSimDay, AirLoopNum); - switch (sysSizing.concurrenceMethod) { + switch (sysSizing.SizingOption) { case DataSizing::Concurrence::Coincident: { if (finalSysSizing.SystemOAMethod == SysOAMethod::ZoneSum) { sysSizing.DesCoolVolFlow = sysSizing.CoinCoolMassFlow / state.dataEnvrn->StdRhoAir; @@ -6540,7 +6540,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn } // move the noncoincident results into the system sizing array - if (state.dataSize->CalcSysSizing(AirLoopNum).concurrenceMethod == DataSizing::Concurrence::NonCoincident) { + if (state.dataSize->CalcSysSizing(AirLoopNum).SizingOption == DataSizing::Concurrence::NonCoincident) { // But first check to see if the noncoincident result is actually bigger than the coincident (for 100% outside air) if (!(state.dataSize->FinalSysSizing(AirLoopNum).CoolOAOption == OAControl::AllOA && SysSensCoolCap <= 0.0)) { // CoolOAOption = Yes 100% OA @@ -6762,7 +6762,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn } state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).scaleZoneCooling(ZoneOARatio); } else if ((SysCoolSizingRat > 1.0) || - (SysCoolSizingRat < 1.0 && finalSysSizing.concurrenceMethod == DataSizing::Concurrence::NonCoincident)) { + (SysCoolSizingRat < 1.0 && finalSysSizing.SizingOption == DataSizing::Concurrence::NonCoincident)) { // size on user input system design flows state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).scaleZoneCooling(SysCoolSizingRat); } @@ -6823,7 +6823,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn ZoneOARatio *= (1.0 + state.dataSize->TermUnitSizing(TermUnitSizingIndex).InducRat); termUnitFinalZoneSizing.scaleZoneHeating(ZoneOARatio); } else if ((SysHeatSizingRat > 1.0) || - (SysHeatSizingRat < 1.0 && finalSysSizing.concurrenceMethod == DataSizing::Concurrence::NonCoincident)) { + (SysHeatSizingRat < 1.0 && finalSysSizing.SizingOption == DataSizing::Concurrence::NonCoincident)) { // size on user input system design flows termUnitFinalZoneSizing.scaleZoneHeating(SysHeatSizingRat); } diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 330dd875faa..8d5234b82bf 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -1115,7 +1115,7 @@ void ManageSystemSizingAdjustments(EnergyPlusData &state) if (allocated(FinalSysSizing)) { // correct sizing design heating volume flow rate based on finalized air terminal unit operation - if (FinalSysSizing(AirLoopNum).concurrenceMethod == + if (FinalSysSizing(AirLoopNum).SizingOption == DataSizing::Concurrence::NonCoincident) { // If non-coincident sizing method for this air loop, the we can use these sum's from // air terminals directly FinalSysSizing(AirLoopNum).DesHeatVolFlow = max(airLoopHeatingMaximumFlowRateSum, FinalSysSizing(AirLoopNum).DesHeatVolFlow); @@ -1127,7 +1127,7 @@ void ManageSystemSizingAdjustments(EnergyPlusData &state) FinalSysSizing(AirLoopNum).DesCoolVolFlow = max(airLoopHeatingMinimumFlowRateSum, FinalSysSizing(AirLoopNum).DesCoolVolFlow); FinalSysSizing(AirLoopNum).MassFlowAtCoolPeak = FinalSysSizing(AirLoopNum).DesCoolVolFlow * state.dataEnvrn->StdRhoAir; } - } else if (FinalSysSizing(AirLoopNum).concurrenceMethod == DataSizing::Concurrence::Coincident) { + } else if (FinalSysSizing(AirLoopNum).SizingOption == DataSizing::Concurrence::Coincident) { if (FinalSysSizing(AirLoopNum).sysSizeCoolingDominant) { // use minimum heating flow sum from air terminals // know that minimum heating flow is a hard minimum regardless of concurrence situation, so make sure that design is at @@ -3579,9 +3579,9 @@ void GetSystemSizingInput(EnergyPlusData &state) { std::string const &sizingOption = state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum); if (sizingOption == "COINCIDENT") { - SysSizInput(SysSizIndex).concurrenceMethod = DataSizing::Concurrence::Coincident; + SysSizInput(SysSizIndex).SizingOption = DataSizing::Concurrence::Coincident; } else if (sizingOption == "NONCOINCIDENT") { - SysSizInput(SysSizIndex).concurrenceMethod = DataSizing::Concurrence::NonCoincident; + SysSizInput(SysSizIndex).SizingOption = DataSizing::Concurrence::NonCoincident; } else { ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum))); ShowContinueError(state, diff --git a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc index 7b11550948c..56544d221fa 100644 --- a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc +++ b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc @@ -2898,7 +2898,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_OnOASystemTest) auto &finalSysSizing = state->dataSize->FinalSysSizing(1); auto &sysSizPeakDDNum = state->dataSize->SysSizPeakDDNum(1); EXPECT_ENUM_EQ(finalSysSizing.coolingPeakLoad, DataSizing::PeakLoad::SensibleCooling); - EXPECT_EQ(finalSysSizing.SizingOption, DataSizing::NonCoincident); + EXPECT_ENUM_EQ(finalSysSizing.SizingOption, DataSizing::Concurrence::NonCoincident); EXPECT_EQ(sysSizPeakDDNum.SensCoolPeakDD, coolPeakDD); int timeStepIndexAtPeakCoolLoad = sysSizPeakDDNum.TimeStepAtSensCoolPk(coolPeakDD); EXPECT_EQ(sysSizPeakDDNum.TimeStepAtTotCoolPk(coolPeakDD), timeStepIndexAtPeakCoolLoad); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 8f97d12ae42..122a0ec7450 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -7233,11 +7233,8 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo state->dataSize->NumSysSizInput = 1; state->dataSize->SysSizInput.allocate(state->dataSize->NumSysSizInput); state->dataSize->SysSizInput(1).AirLoopNum = 1; - state->dataSize->SysSizInput(1).SizingOption = DataSizing::NonCoincident; - auto degC_to_F = [](Real64 celsius) constexpr - { - return celsius * (9.0 / 5.0) + 32.0; - }; + state->dataSize->SysSizInput(1).SizingOption = DataSizing::Concurrence::NonCoincident; + auto degC_to_F = [](Real64 celsius) constexpr { return celsius * (9.0 / 5.0) + 32.0; }; constexpr Real64 coolMixTempSys = 26.2; constexpr Real64 coolMixTempSysIP = degC_to_F(coolMixTempSys); constexpr Real64 heatMixTempSys = -1.7; From 4449ccb435fc1f3c1a8ce7502a6cd553a93285fa Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 19 Jun 2024 08:19:12 -0500 Subject: [PATCH 025/164] Revert format disagreement --- tst/EnergyPlus/unit/OutputReportTabular.unit.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 122a0ec7450..31a772385eb 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -7234,7 +7234,10 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo state->dataSize->SysSizInput.allocate(state->dataSize->NumSysSizInput); state->dataSize->SysSizInput(1).AirLoopNum = 1; state->dataSize->SysSizInput(1).SizingOption = DataSizing::Concurrence::NonCoincident; - auto degC_to_F = [](Real64 celsius) constexpr { return celsius * (9.0 / 5.0) + 32.0; }; + auto degC_to_F = [](Real64 celsius) constexpr + { + return celsius * (9.0 / 5.0) + 32.0; + }; constexpr Real64 coolMixTempSys = 26.2; constexpr Real64 coolMixTempSysIP = degC_to_F(coolMixTempSys); constexpr Real64 heatMixTempSys = -1.7; From 62ef539ffebca1bff76224dfbff2e31f5c43114d Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 19 Jun 2024 09:06:58 -0500 Subject: [PATCH 026/164] Space IV-New Sizing:Zone coincidence input --- .../src/overview/group-design-objects.tex | 25 +++++++++++-------- idd/Energy+.idd.in | 8 +++++- src/EnergyPlus/DataSizing.hh | 8 +++--- src/EnergyPlus/SizingManager.cc | 2 ++ 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-design-objects.tex b/doc/input-output-reference/src/overview/group-design-objects.tex index 0f96917a7b1..3160a6e470b 100644 --- a/doc/input-output-reference/src/overview/group-design-objects.tex +++ b/doc/input-output-reference/src/overview/group-design-objects.tex @@ -1287,11 +1287,15 @@ \subsubsection{Inputs}\label{inputs-4-008} Sizing Method = Sensible Load Only No Latent Load or a zone humidistat is present. A default of 50.0 will be used if no schedule is provided and no humidistat is associated with this zone. +\paragraph{Field: Type of Space Sum to Use}\label{field-type-of-space-sum-to-use} + +If the input is \emph{coincident} the zone equipment will be sized on the coincident zone load across all spaces in the zone. If the input is \emph{noncoincident} the zone equipment will be sized on the sum of the noncoincident space loads. The default is \emph{coincident}. This field is ignored unless \hyperref[zoneairheatbalancealgorithm]{ZoneAirHeatBalanceAlgorithm} ``Do Space Heat Balance for Sizing'' is Yes. + An IDF example: \begin{lstlisting} -Sizing:Zone, + Sizing:Zone, SPACE5-1, !- Name of a zone 14., !- Zone cooling design supply air temperature {C} 50., !- Zone heating design supply air temperature {C} @@ -1323,16 +1327,17 @@ \subsubsection{Inputs}\label{inputs-4-008} , !- Zone Humidification Design Supply Air Humidity Ratio 0.005, !- Zone Heating Design Supply Air Humidity Ratio Difference , !- Zone Humidistat Dehumidification Set Point Schedule Name - ; !- Zone Humidistat Humidification Set Point Schedule Name - + , !- Zone Humidistat Humidification Set Point Schedule Name + Coincident; !- Type of Space Sum to Use + DesignSpecification:OutdoorAir, - DSOA1, !- Name - SUM, !- Outdoor Air Method - 0.00236, !- Outdoor Air Flow per Person - 0.000305, !- Outdoor Air Flow per Zone Floor Area - 0.0, !- Outdoor Air Flow per Zone - 0.0, !- Outdoor Air Flow Air Changes per Hour - ; !- Outdoor Air Flow Rate Fraction Schedule Name + DSOA1, !- Name + SUM, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person + 0.000305, !- Outdoor Air Flow per Zone Floor Area + 0.0, !- Outdoor Air Flow per Zone + 0.0, !- Outdoor Air Flow Air Changes per Hour + ; !- Outdoor Air Flow Rate Fraction Schedule Name DesignSpecification:ZoneAirDistribution, DSZADO1, !- Name diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 466fc0a596b..85a5dfe2eb8 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -34374,7 +34374,7 @@ Sizing:Zone, \note no humidistat is associated with this zone. \type alpha \units percent - A14;\field Zone Humidistat Humidification Set Point Schedule Name + A14,\field Zone Humidistat Humidification Set Point Schedule Name \note Enter the zone relative humidity schedule used for zone latent \note heating calculations. \note A zone humidistat will take priority over this input. @@ -34384,6 +34384,12 @@ Sizing:Zone, \note no humidistat is associated with this zone. \type alpha \units percent + A15;\field Type of Space Sum to Use + \note NonCoincident is available only if Do Space Heat Balance for Sizing=Yes in ZoneAirHeatBalanceAlgorithm. + \type choice + \key Coincident + \key NonCoincident + \default Coincident DesignSpecification:ZoneHVAC:Sizing, \min-fields 1 diff --git a/src/EnergyPlus/DataSizing.hh b/src/EnergyPlus/DataSizing.hh index 63d7d2a9e56..a3c32ce7391 100644 --- a/src/EnergyPlus/DataSizing.hh +++ b/src/EnergyPlus/DataSizing.hh @@ -333,6 +333,7 @@ namespace DataSizing { DOASControl DOASControlStrategy = DOASControl::Invalid; // 0=neutral ventilation air; 1=neutral dehumidified ventilation air, 2 = cooled air; Real64 DOASLowSetpoint = 0.0; // Dedicated Outside Air Low Setpoint for Design [C] Real64 DOASHighSetpoint = 0.0; // Dedicated Outside Air High Setpoint for Design [C] + DataSizing::Concurrence spaceConcurrence = DataSizing::Concurrence::Coincident; // coincident or noncoincident space loads // zone latent sizing inputs bool zoneLatentSizing = false; @@ -458,9 +459,10 @@ namespace DataSizing { bool AccountForDOAS = false; // False: do nothing; True: calculate the effect of a DOA system on the zone sizing arrays DOASControl DOASControlStrategy = DOASControl::Invalid; // 0=neutral ventilation air; 1=neutral dehumidified ventilation air, 2 = cooled air; // 3=supply cold ventilation air - Real64 DOASLowSetpoint = 0.0; // Dedicated Outside Air Low Setpoint for Design [C] - Real64 DOASHighSetpoint = 0.0; // Dedicated Outside Air High Setpoint for Design [C] - bool EMSOverrideDesHeatMassOn = false; // true if EMS is acting on this structure + Real64 DOASLowSetpoint = 0.0; // Dedicated Outside Air Low Setpoint for Design [C] + Real64 DOASHighSetpoint = 0.0; // Dedicated Outside Air High Setpoint for Design [C] + DataSizing::Concurrence spaceConcurrence = DataSizing::Concurrence::Coincident; // coincident or noncoincident space loads + bool EMSOverrideDesHeatMassOn = false; // true if EMS is acting on this structure Real64 EMSValueDesHeatMassFlow = 0.0; // Value EMS directing to use for Design Heating air mass flow [kg/s] bool EMSOverrideDesCoolMassOn = false; // true if EMS is acting on this structure Real64 EMSValueDesCoolMassFlow = 0.0; // Value EMS directing to use for Design Cooling air mass flow [kg/s] diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 8d5234b82bf..25d2294a30f 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -3280,6 +3280,8 @@ void GetZoneSizingInput(EnergyPlusData &state) ErrorsFound = true; } } + zoneSizingIndex.spaceConcurrence = + static_cast(getEnumValue(DataSizing::ConcurrenceMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10))); zoneSizingIndex.zoneSizingMethod = static_cast(getEnumValue(DataSizing::ZoneSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10))); if (zoneSizingIndex.zoneSizingMethod != ZoneSizing::SensibleOnly) { From a93dc1cd2b0f73386b39174cb7e3d642fd8e7f4a Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 19 Jun 2024 09:24:23 -0500 Subject: [PATCH 027/164] Space IV-Revert scope creep --- src/EnergyPlus/DataSizing.hh | 2 +- src/EnergyPlus/ReportCoilSelection.cc | 66 +++++++++++++++------------ src/EnergyPlus/ReportCoilSelection.hh | 5 +- 3 files changed, 40 insertions(+), 33 deletions(-) diff --git a/src/EnergyPlus/DataSizing.hh b/src/EnergyPlus/DataSizing.hh index a3c32ce7391..2427fe288f7 100644 --- a/src/EnergyPlus/DataSizing.hh +++ b/src/EnergyPlus/DataSizing.hh @@ -117,7 +117,7 @@ namespace DataSizing { Num }; - // parameters for sizing (keept this for now to avoid plant sizing output changes) + // parameters for sizing (keep this for now to avoid plant sizing and coil selection output changes) constexpr int NonCoincident(1); constexpr int Coincident(2); constexpr int Combination(3); diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index 50841801321..506bc1325cc 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -81,20 +81,20 @@ void createCoilSelectionReportObj(EnergyPlusData &state) CoilSelectionData::CoilSelectionData( // constructor std::string const &coilName) : isCooling(false), isHeating(false), coilNum(-999), airloopNum(-999), oaControllerNum(-999), zoneEqNum(-999), oASysNum(-999), zoneHVACTypeNum(0), - zoneHVACIndex(0), typeof_Coil(-999), coilSizingMethodCapacity(-999), coilSizingMethodAirFlow(-999), isCoilSizingForTotalLoad(false), - capIsAutosized(false), volFlowIsAutosized(false), coilWaterFlowUser(-999.0), oaPretreated(false), isSupplementalHeater(false), - coilTotCapFinal(-999.0), coilSensCapFinal(-999.0), coilRefAirVolFlowFinal(-999.0), coilRefWaterVolFlowFinal(-999.0), coilTotCapAtPeak(-999.0), - coilSensCapAtPeak(-999.0), coilDesMassFlow(-999.0), coilDesVolFlow(-999.0), coilDesEntTemp(-999.0), coilDesEntWetBulb(-999.0), - coilDesEntHumRat(-999.0), coilDesEntEnth(-999.0), coilDesLvgTemp(-999.0), coilDesLvgWetBulb(-999.0), coilDesLvgHumRat(-999.0), - coilDesLvgEnth(-999.0), coilDesWaterMassFlow(-999.0), coilDesWaterEntTemp(-999.0), coilDesWaterLvgTemp(-999.0), coilDesWaterTempDiff(-999.0), - pltSizNum(-999), waterLoopNum(-999), oaPeakTemp(-999.00), oaPeakHumRat(-999.0), oaPeakWetBulb(-999.0), oaPeakVolFlow(-999.0), - oaPeakVolFrac(-999.0), oaDoaTemp(-999.0), oaDoaHumRat(-999.0), raPeakTemp(-999.0), raPeakHumRat(-999.0), rmPeakTemp(-999.0), - rmPeakHumRat(-999.0), rmPeakRelHum(-999.0), rmSensibleAtPeak(-999.0), rmLatentAtPeak(0.0), coilIdealSizCapOverSimPeakCap(-999.0), - coilIdealSizCapUnderSimPeakCap(-999.0), reheatLoadMult(-999.0), minRatio(-999.0), maxRatio(-999.0), cpMoistAir(-999.0), cpDryAir(-999.0), - rhoStandAir(-999.0), rhoFluid(-999.0), cpFluid(-999.0), coilCapFTIdealPeak(1.0), coilRatedTotCap(-999.0), coilRatedSensCap(-999.0), - ratedAirMassFlow(-999.0), ratedCoilInDb(-999.0), ratedCoilInWb(-999.0), ratedCoilInHumRat(-999.0), ratedCoilInEnth(-999.0), - ratedCoilOutDb(-999.0), ratedCoilOutWb(-999.0), ratedCoilOutHumRat(-999.0), ratedCoilOutEnth(-999.0), ratedCoilEff(-999.0), - ratedCoilBpFactor(-999.0), ratedCoilAppDewPt(-999.0), ratedCoilOadbRef(-999.0), ratedCoilOawbRef(-999.0), + zoneHVACIndex(0), typeof_Coil(-999), coilSizingMethodConcurrence(-999), coilSizingMethodCapacity(-999), coilSizingMethodAirFlow(-999), + isCoilSizingForTotalLoad(false), capIsAutosized(false), volFlowIsAutosized(false), coilWaterFlowUser(-999.0), oaPretreated(false), + isSupplementalHeater(false), coilTotCapFinal(-999.0), coilSensCapFinal(-999.0), coilRefAirVolFlowFinal(-999.0), + coilRefWaterVolFlowFinal(-999.0), coilTotCapAtPeak(-999.0), coilSensCapAtPeak(-999.0), coilDesMassFlow(-999.0), coilDesVolFlow(-999.0), + coilDesEntTemp(-999.0), coilDesEntWetBulb(-999.0), coilDesEntHumRat(-999.0), coilDesEntEnth(-999.0), coilDesLvgTemp(-999.0), + coilDesLvgWetBulb(-999.0), coilDesLvgHumRat(-999.0), coilDesLvgEnth(-999.0), coilDesWaterMassFlow(-999.0), coilDesWaterEntTemp(-999.0), + coilDesWaterLvgTemp(-999.0), coilDesWaterTempDiff(-999.0), pltSizNum(-999), waterLoopNum(-999), oaPeakTemp(-999.00), oaPeakHumRat(-999.0), + oaPeakWetBulb(-999.0), oaPeakVolFlow(-999.0), oaPeakVolFrac(-999.0), oaDoaTemp(-999.0), oaDoaHumRat(-999.0), raPeakTemp(-999.0), + raPeakHumRat(-999.0), rmPeakTemp(-999.0), rmPeakHumRat(-999.0), rmPeakRelHum(-999.0), rmSensibleAtPeak(-999.0), rmLatentAtPeak(0.0), + coilIdealSizCapOverSimPeakCap(-999.0), coilIdealSizCapUnderSimPeakCap(-999.0), reheatLoadMult(-999.0), minRatio(-999.0), maxRatio(-999.0), + cpMoistAir(-999.0), cpDryAir(-999.0), rhoStandAir(-999.0), rhoFluid(-999.0), cpFluid(-999.0), coilCapFTIdealPeak(1.0), coilRatedTotCap(-999.0), + coilRatedSensCap(-999.0), ratedAirMassFlow(-999.0), ratedCoilInDb(-999.0), ratedCoilInWb(-999.0), ratedCoilInHumRat(-999.0), + ratedCoilInEnth(-999.0), ratedCoilOutDb(-999.0), ratedCoilOutWb(-999.0), ratedCoilOutHumRat(-999.0), ratedCoilOutEnth(-999.0), + ratedCoilEff(-999.0), ratedCoilBpFactor(-999.0), ratedCoilAppDewPt(-999.0), ratedCoilOadbRef(-999.0), ratedCoilOawbRef(-999.0), supFanType(HVAC::FanType::Invalid), supFanNum(0), fanSizeMaxAirVolumeFlow(-999.0), fanSizeMaxAirMassFlow(-999.0), fanHeatGainIdealPeak(-999.0), coilAndFanNetTotalCapacityIdealPeak(-999.0), plantDesMaxMassFlowRate(-999.0), plantDesRetTemp(-999.0), plantDesSupTemp(-999.0), @@ -734,7 +734,15 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) c->oaPeakVolFrac = -999.0; } - c->coilSizingMethodConcurrenceName = DataSizing::ConcurrenceMethodNames[(int)c->coilSizingMethodConcurrence]; + if (c->coilSizingMethodConcurrence == DataSizing::NonCoincident) { + c->coilSizingMethodConcurrenceName = "Non-Coincident"; + } else if (c->coilSizingMethodConcurrence == DataSizing::Coincident) { + c->coilSizingMethodConcurrenceName = "Coincident"; + } else if (c->coilSizingMethodConcurrence == DataSizing::Combination) { + c->coilSizingMethodConcurrenceName = "Combination"; + } else { + c->coilSizingMethodConcurrenceName = "N/A"; + } if (c->coilSizingMethodCapacity == DataSizing::CoolingDesignCapacity) { c->coilSizingMethodCapacityName = "CoolingDesignCapacity"; @@ -1264,7 +1272,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->oaPeakHumRat = finalSysSizing.OutHumRatAtCoolPeak; c->raPeakTemp = finalSysSizing.RetTempAtCoolPeak; c->raPeakHumRat = finalSysSizing.RetHumRatAtCoolPeak; - c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; + c->coilSizingMethodConcurrence = (int)finalSysSizing.SizingOption; c->coilSizingMethodCapacity = finalSysSizing.CoolingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleCoolSAFMethod; // DesOutAirVolFlow @@ -1323,9 +1331,9 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->rmPeakRelHum = -999.0; } - if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::Coincident) { + if (c->coilSizingMethodConcurrence == DataSizing::Coincident) { c->rmSensibleAtPeak = finalSysSizing.SysCoolCoinSpaceSens; - } else if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::NonCoincident) { + } else if (c->coilSizingMethodConcurrence == DataSizing::NonCoincident) { c->rmSensibleAtPeak = sumSensLoad; } else { // DataSizing::Combination or other c->rmSensibleAtPeak = sumSensLoad; @@ -1470,14 +1478,14 @@ void ReportCoilSelection::setCoilCoolingCapacity( state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } - DataSizing::Concurrence sizMethod = DataSizing::Concurrence::Invalid; + int sizMethod = 0; bool sizMethodsAreTheSame = true; for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; if (airLoopNum == 0) { - sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; + sizMethod = (int)state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; } else { - if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { + if (sizMethod != (int)state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { sizMethodsAreTheSame = false; } } @@ -1485,7 +1493,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( if (sizMethodsAreTheSame) { c->coilSizingMethodConcurrence = sizMethod; } else { - c->coilSizingMethodConcurrence = DataSizing::Concurrence::Combination; + c->coilSizingMethodConcurrence = DataSizing::Combination; } } } else { @@ -1533,7 +1541,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow; c->raPeakTemp = finalSysSizing.HeatRetTemp; c->raPeakHumRat = finalSysSizing.HeatRetHumRat; - c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; + c->coilSizingMethodConcurrence = (int)finalSysSizing.SizingOption; c->coilSizingMethodCapacity = finalSysSizing.HeatingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleHeatSAFMethod; @@ -1588,9 +1596,9 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->rmPeakRelHum = -999.0; } - if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::Coincident) { + if (c->coilSizingMethodConcurrence == DataSizing::Coincident) { c->rmSensibleAtPeak = finalSysSizing.SysHeatCoinSpaceSens; - } else if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::NonCoincident) { + } else if (c->coilSizingMethodConcurrence == DataSizing::NonCoincident) { c->rmSensibleAtPeak = sumLoad; } @@ -1767,14 +1775,14 @@ void ReportCoilSelection::setCoilHeatingCapacity( state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } - DataSizing::Concurrence sizMethod = DataSizing::Concurrence::Invalid; + int sizMethod = 0; bool sizMethodsAreTheSame = true; for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; if (airLoopNum == 0) { - sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; + sizMethod = (int)state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; } else { - if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { + if (sizMethod != (int)state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { sizMethodsAreTheSame = false; } } @@ -1782,7 +1790,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( if (sizMethodsAreTheSame) { c->coilSizingMethodConcurrence = sizMethod; } else { - c->coilSizingMethodConcurrence = DataSizing::Concurrence::Combination; + c->coilSizingMethodConcurrence = DataSizing::Combination; } } } else { diff --git a/src/EnergyPlus/ReportCoilSelection.hh b/src/EnergyPlus/ReportCoilSelection.hh index d15bf87a2e0..105b82899f7 100644 --- a/src/EnergyPlus/ReportCoilSelection.hh +++ b/src/EnergyPlus/ReportCoilSelection.hh @@ -56,7 +56,6 @@ // EnergyPlus Headers #include #include -#include #include namespace EnergyPlus { @@ -99,8 +98,8 @@ public: // data int typeof_Coil; // type of coil, e.g., PlantEquipmentType::CoilWaterSimpleHeating, PlantEquipmentType::CoilWaterDetailedFlatCooling, // PlantEquipmentType::CoilWaterCooling - DataSizing::Concurrence coilSizingMethodConcurrence = DataSizing::Concurrence::NA; // non-coincident, coincident, combination, n/a - std::string coilSizingMethodConcurrenceName; // string name of sizing method for concurrence + int coilSizingMethodConcurrence; // 1 = noncoincident, 2 = coincident + std::string coilSizingMethodConcurrenceName; // string name of sizing method for concurrence int coilSizingMethodCapacity; // 8=CoolingDesignCapacity, 9=HeatingDesignCapacity, 10=CapacityPerFloorArea, 11=FractionOfAutosizedCoolingCapacity, // 12=FractionOfAutosizedHeatingCapacity From 1e66702a60b0f4d3e6a193bbbb3635ca2074eb97 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 19 Jun 2024 10:39:32 -0500 Subject: [PATCH 028/164] Revert "Space IV-Revert scope creep" This reverts commit a93dc1cd2b0f73386b39174cb7e3d642fd8e7f4a. --- src/EnergyPlus/DataSizing.hh | 2 +- src/EnergyPlus/ReportCoilSelection.cc | 66 ++++++++++++--------------- src/EnergyPlus/ReportCoilSelection.hh | 5 +- 3 files changed, 33 insertions(+), 40 deletions(-) diff --git a/src/EnergyPlus/DataSizing.hh b/src/EnergyPlus/DataSizing.hh index 2427fe288f7..a3c32ce7391 100644 --- a/src/EnergyPlus/DataSizing.hh +++ b/src/EnergyPlus/DataSizing.hh @@ -117,7 +117,7 @@ namespace DataSizing { Num }; - // parameters for sizing (keep this for now to avoid plant sizing and coil selection output changes) + // parameters for sizing (keept this for now to avoid plant sizing output changes) constexpr int NonCoincident(1); constexpr int Coincident(2); constexpr int Combination(3); diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index 506bc1325cc..50841801321 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -81,20 +81,20 @@ void createCoilSelectionReportObj(EnergyPlusData &state) CoilSelectionData::CoilSelectionData( // constructor std::string const &coilName) : isCooling(false), isHeating(false), coilNum(-999), airloopNum(-999), oaControllerNum(-999), zoneEqNum(-999), oASysNum(-999), zoneHVACTypeNum(0), - zoneHVACIndex(0), typeof_Coil(-999), coilSizingMethodConcurrence(-999), coilSizingMethodCapacity(-999), coilSizingMethodAirFlow(-999), - isCoilSizingForTotalLoad(false), capIsAutosized(false), volFlowIsAutosized(false), coilWaterFlowUser(-999.0), oaPretreated(false), - isSupplementalHeater(false), coilTotCapFinal(-999.0), coilSensCapFinal(-999.0), coilRefAirVolFlowFinal(-999.0), - coilRefWaterVolFlowFinal(-999.0), coilTotCapAtPeak(-999.0), coilSensCapAtPeak(-999.0), coilDesMassFlow(-999.0), coilDesVolFlow(-999.0), - coilDesEntTemp(-999.0), coilDesEntWetBulb(-999.0), coilDesEntHumRat(-999.0), coilDesEntEnth(-999.0), coilDesLvgTemp(-999.0), - coilDesLvgWetBulb(-999.0), coilDesLvgHumRat(-999.0), coilDesLvgEnth(-999.0), coilDesWaterMassFlow(-999.0), coilDesWaterEntTemp(-999.0), - coilDesWaterLvgTemp(-999.0), coilDesWaterTempDiff(-999.0), pltSizNum(-999), waterLoopNum(-999), oaPeakTemp(-999.00), oaPeakHumRat(-999.0), - oaPeakWetBulb(-999.0), oaPeakVolFlow(-999.0), oaPeakVolFrac(-999.0), oaDoaTemp(-999.0), oaDoaHumRat(-999.0), raPeakTemp(-999.0), - raPeakHumRat(-999.0), rmPeakTemp(-999.0), rmPeakHumRat(-999.0), rmPeakRelHum(-999.0), rmSensibleAtPeak(-999.0), rmLatentAtPeak(0.0), - coilIdealSizCapOverSimPeakCap(-999.0), coilIdealSizCapUnderSimPeakCap(-999.0), reheatLoadMult(-999.0), minRatio(-999.0), maxRatio(-999.0), - cpMoistAir(-999.0), cpDryAir(-999.0), rhoStandAir(-999.0), rhoFluid(-999.0), cpFluid(-999.0), coilCapFTIdealPeak(1.0), coilRatedTotCap(-999.0), - coilRatedSensCap(-999.0), ratedAirMassFlow(-999.0), ratedCoilInDb(-999.0), ratedCoilInWb(-999.0), ratedCoilInHumRat(-999.0), - ratedCoilInEnth(-999.0), ratedCoilOutDb(-999.0), ratedCoilOutWb(-999.0), ratedCoilOutHumRat(-999.0), ratedCoilOutEnth(-999.0), - ratedCoilEff(-999.0), ratedCoilBpFactor(-999.0), ratedCoilAppDewPt(-999.0), ratedCoilOadbRef(-999.0), ratedCoilOawbRef(-999.0), + zoneHVACIndex(0), typeof_Coil(-999), coilSizingMethodCapacity(-999), coilSizingMethodAirFlow(-999), isCoilSizingForTotalLoad(false), + capIsAutosized(false), volFlowIsAutosized(false), coilWaterFlowUser(-999.0), oaPretreated(false), isSupplementalHeater(false), + coilTotCapFinal(-999.0), coilSensCapFinal(-999.0), coilRefAirVolFlowFinal(-999.0), coilRefWaterVolFlowFinal(-999.0), coilTotCapAtPeak(-999.0), + coilSensCapAtPeak(-999.0), coilDesMassFlow(-999.0), coilDesVolFlow(-999.0), coilDesEntTemp(-999.0), coilDesEntWetBulb(-999.0), + coilDesEntHumRat(-999.0), coilDesEntEnth(-999.0), coilDesLvgTemp(-999.0), coilDesLvgWetBulb(-999.0), coilDesLvgHumRat(-999.0), + coilDesLvgEnth(-999.0), coilDesWaterMassFlow(-999.0), coilDesWaterEntTemp(-999.0), coilDesWaterLvgTemp(-999.0), coilDesWaterTempDiff(-999.0), + pltSizNum(-999), waterLoopNum(-999), oaPeakTemp(-999.00), oaPeakHumRat(-999.0), oaPeakWetBulb(-999.0), oaPeakVolFlow(-999.0), + oaPeakVolFrac(-999.0), oaDoaTemp(-999.0), oaDoaHumRat(-999.0), raPeakTemp(-999.0), raPeakHumRat(-999.0), rmPeakTemp(-999.0), + rmPeakHumRat(-999.0), rmPeakRelHum(-999.0), rmSensibleAtPeak(-999.0), rmLatentAtPeak(0.0), coilIdealSizCapOverSimPeakCap(-999.0), + coilIdealSizCapUnderSimPeakCap(-999.0), reheatLoadMult(-999.0), minRatio(-999.0), maxRatio(-999.0), cpMoistAir(-999.0), cpDryAir(-999.0), + rhoStandAir(-999.0), rhoFluid(-999.0), cpFluid(-999.0), coilCapFTIdealPeak(1.0), coilRatedTotCap(-999.0), coilRatedSensCap(-999.0), + ratedAirMassFlow(-999.0), ratedCoilInDb(-999.0), ratedCoilInWb(-999.0), ratedCoilInHumRat(-999.0), ratedCoilInEnth(-999.0), + ratedCoilOutDb(-999.0), ratedCoilOutWb(-999.0), ratedCoilOutHumRat(-999.0), ratedCoilOutEnth(-999.0), ratedCoilEff(-999.0), + ratedCoilBpFactor(-999.0), ratedCoilAppDewPt(-999.0), ratedCoilOadbRef(-999.0), ratedCoilOawbRef(-999.0), supFanType(HVAC::FanType::Invalid), supFanNum(0), fanSizeMaxAirVolumeFlow(-999.0), fanSizeMaxAirMassFlow(-999.0), fanHeatGainIdealPeak(-999.0), coilAndFanNetTotalCapacityIdealPeak(-999.0), plantDesMaxMassFlowRate(-999.0), plantDesRetTemp(-999.0), plantDesSupTemp(-999.0), @@ -734,15 +734,7 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) c->oaPeakVolFrac = -999.0; } - if (c->coilSizingMethodConcurrence == DataSizing::NonCoincident) { - c->coilSizingMethodConcurrenceName = "Non-Coincident"; - } else if (c->coilSizingMethodConcurrence == DataSizing::Coincident) { - c->coilSizingMethodConcurrenceName = "Coincident"; - } else if (c->coilSizingMethodConcurrence == DataSizing::Combination) { - c->coilSizingMethodConcurrenceName = "Combination"; - } else { - c->coilSizingMethodConcurrenceName = "N/A"; - } + c->coilSizingMethodConcurrenceName = DataSizing::ConcurrenceMethodNames[(int)c->coilSizingMethodConcurrence]; if (c->coilSizingMethodCapacity == DataSizing::CoolingDesignCapacity) { c->coilSizingMethodCapacityName = "CoolingDesignCapacity"; @@ -1272,7 +1264,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->oaPeakHumRat = finalSysSizing.OutHumRatAtCoolPeak; c->raPeakTemp = finalSysSizing.RetTempAtCoolPeak; c->raPeakHumRat = finalSysSizing.RetHumRatAtCoolPeak; - c->coilSizingMethodConcurrence = (int)finalSysSizing.SizingOption; + c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; c->coilSizingMethodCapacity = finalSysSizing.CoolingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleCoolSAFMethod; // DesOutAirVolFlow @@ -1331,9 +1323,9 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->rmPeakRelHum = -999.0; } - if (c->coilSizingMethodConcurrence == DataSizing::Coincident) { + if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::Coincident) { c->rmSensibleAtPeak = finalSysSizing.SysCoolCoinSpaceSens; - } else if (c->coilSizingMethodConcurrence == DataSizing::NonCoincident) { + } else if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::NonCoincident) { c->rmSensibleAtPeak = sumSensLoad; } else { // DataSizing::Combination or other c->rmSensibleAtPeak = sumSensLoad; @@ -1478,14 +1470,14 @@ void ReportCoilSelection::setCoilCoolingCapacity( state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } - int sizMethod = 0; + DataSizing::Concurrence sizMethod = DataSizing::Concurrence::Invalid; bool sizMethodsAreTheSame = true; for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; if (airLoopNum == 0) { - sizMethod = (int)state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; + sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; } else { - if (sizMethod != (int)state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { + if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { sizMethodsAreTheSame = false; } } @@ -1493,7 +1485,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( if (sizMethodsAreTheSame) { c->coilSizingMethodConcurrence = sizMethod; } else { - c->coilSizingMethodConcurrence = DataSizing::Combination; + c->coilSizingMethodConcurrence = DataSizing::Concurrence::Combination; } } } else { @@ -1541,7 +1533,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow; c->raPeakTemp = finalSysSizing.HeatRetTemp; c->raPeakHumRat = finalSysSizing.HeatRetHumRat; - c->coilSizingMethodConcurrence = (int)finalSysSizing.SizingOption; + c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; c->coilSizingMethodCapacity = finalSysSizing.HeatingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleHeatSAFMethod; @@ -1596,9 +1588,9 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->rmPeakRelHum = -999.0; } - if (c->coilSizingMethodConcurrence == DataSizing::Coincident) { + if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::Coincident) { c->rmSensibleAtPeak = finalSysSizing.SysHeatCoinSpaceSens; - } else if (c->coilSizingMethodConcurrence == DataSizing::NonCoincident) { + } else if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::NonCoincident) { c->rmSensibleAtPeak = sumLoad; } @@ -1775,14 +1767,14 @@ void ReportCoilSelection::setCoilHeatingCapacity( state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } - int sizMethod = 0; + DataSizing::Concurrence sizMethod = DataSizing::Concurrence::Invalid; bool sizMethodsAreTheSame = true; for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; if (airLoopNum == 0) { - sizMethod = (int)state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; + sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; } else { - if (sizMethod != (int)state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { + if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { sizMethodsAreTheSame = false; } } @@ -1790,7 +1782,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( if (sizMethodsAreTheSame) { c->coilSizingMethodConcurrence = sizMethod; } else { - c->coilSizingMethodConcurrence = DataSizing::Combination; + c->coilSizingMethodConcurrence = DataSizing::Concurrence::Combination; } } } else { diff --git a/src/EnergyPlus/ReportCoilSelection.hh b/src/EnergyPlus/ReportCoilSelection.hh index 105b82899f7..d15bf87a2e0 100644 --- a/src/EnergyPlus/ReportCoilSelection.hh +++ b/src/EnergyPlus/ReportCoilSelection.hh @@ -56,6 +56,7 @@ // EnergyPlus Headers #include #include +#include #include namespace EnergyPlus { @@ -98,8 +99,8 @@ public: // data int typeof_Coil; // type of coil, e.g., PlantEquipmentType::CoilWaterSimpleHeating, PlantEquipmentType::CoilWaterDetailedFlatCooling, // PlantEquipmentType::CoilWaterCooling - int coilSizingMethodConcurrence; // 1 = noncoincident, 2 = coincident - std::string coilSizingMethodConcurrenceName; // string name of sizing method for concurrence + DataSizing::Concurrence coilSizingMethodConcurrence = DataSizing::Concurrence::NA; // non-coincident, coincident, combination, n/a + std::string coilSizingMethodConcurrenceName; // string name of sizing method for concurrence int coilSizingMethodCapacity; // 8=CoolingDesignCapacity, 9=HeatingDesignCapacity, 10=CapacityPerFloorArea, 11=FractionOfAutosizedCoolingCapacity, // 12=FractionOfAutosizedHeatingCapacity From 5ffdf05e5737f0e79c0ab759f8b6df647ae43a60 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 19 Jun 2024 11:24:23 -0500 Subject: [PATCH 029/164] Space IV-YetAnotherEnum attempt --- src/EnergyPlus/DataSizing.hh | 103 ++++++++++-------- src/EnergyPlus/OutputReportTabular.cc | 2 +- src/EnergyPlus/ReportCoilSelection.cc | 26 ++--- src/EnergyPlus/ReportCoilSelection.hh | 5 +- src/EnergyPlus/SimAirServingZones.cc | 10 +- src/EnergyPlus/SizingManager.cc | 15 +-- .../unit/DesiccantDehumidifiers.unit.cc | 2 +- .../unit/OutputReportTabular.unit.cc | 2 +- 8 files changed, 87 insertions(+), 78 deletions(-) diff --git a/src/EnergyPlus/DataSizing.hh b/src/EnergyPlus/DataSizing.hh index a3c32ce7391..813ff4a4972 100644 --- a/src/EnergyPlus/DataSizing.hh +++ b/src/EnergyPlus/DataSizing.hh @@ -117,13 +117,23 @@ namespace DataSizing { Num }; - // parameters for sizing (keept this for now to avoid plant sizing output changes) + // parameters for sizing (keep this for now to avoid plant sizing output changes) constexpr int NonCoincident(1); constexpr int Coincident(2); - constexpr int Combination(3); - // parameters for sizing concurrence method - enum class Concurrence + // parameters for zone and system sizing concurrence method + enum class SizingConcurrence + { + Invalid = -1, + NonCoincident, + Coincident, + Num + }; + + constexpr std::array(SizingConcurrence::Num)> SizingConcurrenceNamesUC{"NonCoincident", "Coincident"}; + + // parameters for coil sizing concurrence method + enum class CoilSizingConcurrence { Invalid = -1, NonCoincident, @@ -133,10 +143,7 @@ namespace DataSizing { Num }; - constexpr std::array(Concurrence::Num)> ConcurrenceMethodNamesUC{ - "NonCoincident", "Coincident", "Combination", "NA"}; - - constexpr std::array(Concurrence::Num)> ConcurrenceMethodNames{ + constexpr std::array(CoilSizingConcurrence::Num)> CoilSizingConcurrenceNames{ "Non-Coincident", "Coincident", "Combination", "N/A"}; // parameters for Cooling Peak Load Type @@ -333,7 +340,7 @@ namespace DataSizing { DOASControl DOASControlStrategy = DOASControl::Invalid; // 0=neutral ventilation air; 1=neutral dehumidified ventilation air, 2 = cooled air; Real64 DOASLowSetpoint = 0.0; // Dedicated Outside Air Low Setpoint for Design [C] Real64 DOASHighSetpoint = 0.0; // Dedicated Outside Air High Setpoint for Design [C] - DataSizing::Concurrence spaceConcurrence = DataSizing::Concurrence::Coincident; // coincident or noncoincident space loads + DataSizing::SizingConcurrence spaceConcurrence = DataSizing::SizingConcurrence::Coincident; // coincident or noncoincident space loads // zone latent sizing inputs bool zoneLatentSizing = false; @@ -459,10 +466,10 @@ namespace DataSizing { bool AccountForDOAS = false; // False: do nothing; True: calculate the effect of a DOA system on the zone sizing arrays DOASControl DOASControlStrategy = DOASControl::Invalid; // 0=neutral ventilation air; 1=neutral dehumidified ventilation air, 2 = cooled air; // 3=supply cold ventilation air - Real64 DOASLowSetpoint = 0.0; // Dedicated Outside Air Low Setpoint for Design [C] - Real64 DOASHighSetpoint = 0.0; // Dedicated Outside Air High Setpoint for Design [C] - DataSizing::Concurrence spaceConcurrence = DataSizing::Concurrence::Coincident; // coincident or noncoincident space loads - bool EMSOverrideDesHeatMassOn = false; // true if EMS is acting on this structure + Real64 DOASLowSetpoint = 0.0; // Dedicated Outside Air Low Setpoint for Design [C] + Real64 DOASHighSetpoint = 0.0; // Dedicated Outside Air High Setpoint for Design [C] + DataSizing::SizingConcurrence spaceConcurrence = DataSizing::SizingConcurrence::Coincident; // coincident or noncoincident space loads + bool EMSOverrideDesHeatMassOn = false; // true if EMS is acting on this structure Real64 EMSValueDesHeatMassFlow = 0.0; // Value EMS directing to use for Design Heating air mass flow [kg/s] bool EMSOverrideDesCoolMassOn = false; // true if EMS is acting on this structure Real64 EMSValueDesCoolMassFlow = 0.0; // Value EMS directing to use for Design Cooling air mass flow [kg/s] @@ -786,23 +793,23 @@ namespace DataSizing { struct SystemSizingInputData { // Members - std::string AirPriLoopName; // name of an AirLoopHVAC object - int AirLoopNum = 0; // index number of air loop - LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on sensible, latent, total, ventilation - DataSizing::Concurrence SizingOption = DataSizing::Concurrence::NonCoincident; // noncoincident, coincident - OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing - OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing - Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] - Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio - bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input - Real64 PreheatTemp = 0.0; // preheat design set temperature [C] - Real64 PrecoolTemp = 0.0; // precool design set temperature [C] - Real64 PreheatHumRat = 0.0; // preheat design humidity ratio [kg water/kg dry air] - Real64 PrecoolHumRat = 0.0; // precool design humidity ratio [kg water/kg dry air] - Real64 CoolSupTemp = 0.0; // cooling design supply air temperature [C] - Real64 HeatSupTemp = 0.0; // heating design supply air temperature [C] - Real64 CoolSupHumRat = 0.0; // cooling design supply air humidity ratio [kg water/kg dry air] - Real64 HeatSupHumRat = 0.0; // heating design supply air humidity ratio [kg water/kg dry air] + std::string AirPriLoopName; // name of an AirLoopHVAC object + int AirLoopNum = 0; // index number of air loop + LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on sensible, latent, total, ventilation + DataSizing::SizingConcurrence SizingOption = DataSizing::SizingConcurrence::NonCoincident; // noncoincident, coincident + OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing + OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing + Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] + Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio + bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input + Real64 PreheatTemp = 0.0; // preheat design set temperature [C] + Real64 PrecoolTemp = 0.0; // precool design set temperature [C] + Real64 PreheatHumRat = 0.0; // preheat design humidity ratio [kg water/kg dry air] + Real64 PrecoolHumRat = 0.0; // precool design humidity ratio [kg water/kg dry air] + Real64 CoolSupTemp = 0.0; // cooling design supply air temperature [C] + Real64 HeatSupTemp = 0.0; // heating design supply air temperature [C] + Real64 CoolSupHumRat = 0.0; // cooling design supply air humidity ratio [kg water/kg dry air] + Real64 HeatSupHumRat = 0.0; // heating design supply air humidity ratio [kg water/kg dry air] AirflowSizingMethod CoolAirDesMethod = AirflowSizingMethod::Invalid; // choice of how to get system cooling design air flow rates; // 1 = calc from des day simulation; 2=m3/s per system, user input Real64 DesCoolAirFlow = 0.0; // design system supply air flow rate for cooling[m3/s] @@ -838,24 +845,24 @@ namespace DataSizing { struct SystemSizingData // Contains data for system sizing { // Members - std::string AirPriLoopName; // name of an AirLoopHVAC object - std::string CoolDesDay; // name of a cooling design day - std::string HeatDesDay; // name of a heating design day - LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on Sensible, Latent, Total, Ventilation - DataSizing::Concurrence SizingOption = DataSizing::Concurrence::NonCoincident; // noncoincident, coincident. - OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing - OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing - Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] - Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio - bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input - Real64 PreheatTemp = 0.0; // preheat design set temperature - Real64 PrecoolTemp = 0.0; // precool design set temperature [C] - Real64 PreheatHumRat = 0.0; // preheat design humidity ratio [kg water/kg dry air] - Real64 PrecoolHumRat = 0.0; // precool design humidity ratio [kg water/kg dry air] - Real64 CoolSupTemp = 0.0; // cooling design supply air temperature [C] - Real64 HeatSupTemp = 0.0; // heating design supply air temperature[C] - Real64 CoolSupHumRat = 0.0; // cooling design supply air humidity ratio [kg water/kg dry air] - Real64 HeatSupHumRat = 0.0; // heating design supply air humidity ratio [kg water/kg dry air] + std::string AirPriLoopName; // name of an AirLoopHVAC object + std::string CoolDesDay; // name of a cooling design day + std::string HeatDesDay; // name of a heating design day + LoadSizing loadSizingType = LoadSizing::Invalid; // type of load to size on Sensible, Latent, Total, Ventilation + DataSizing::SizingConcurrence SizingOption = DataSizing::SizingConcurrence::NonCoincident; // noncoincident, coincident. + OAControl CoolOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for cooling sizing + OAControl HeatOAOption = OAControl::Invalid; // 1 = use 100% outside air; 2 = use min OA; for heating sizing + Real64 DesOutAirVolFlow = 0.0; // design (minimum) outside air flow rate [m3/s] + Real64 SysAirMinFlowRat = 0.0; // minimum system air flow ratio for heating, Central Heating Maximum System Air Flow Ratio + bool SysAirMinFlowRatWasAutoSized = false; // true if central heating maximum system air flow ratio was autosize on input + Real64 PreheatTemp = 0.0; // preheat design set temperature + Real64 PrecoolTemp = 0.0; // precool design set temperature [C] + Real64 PreheatHumRat = 0.0; // preheat design humidity ratio [kg water/kg dry air] + Real64 PrecoolHumRat = 0.0; // precool design humidity ratio [kg water/kg dry air] + Real64 CoolSupTemp = 0.0; // cooling design supply air temperature [C] + Real64 HeatSupTemp = 0.0; // heating design supply air temperature[C] + Real64 CoolSupHumRat = 0.0; // cooling design supply air humidity ratio [kg water/kg dry air] + Real64 HeatSupHumRat = 0.0; // heating design supply air humidity ratio [kg water/kg dry air] AirflowSizingMethod CoolAirDesMethod = AirflowSizingMethod::Invalid; // choice of how to get system design cooling air flow rates; // 1 = calc from des day simulation; 2=m3/s per system, user input AirflowSizingMethod HeatAirDesMethod = AirflowSizingMethod::Invalid; // choice of how to get system design heating air flow rates; diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 821fc171110..5b494d61448 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -15351,7 +15351,7 @@ void WriteLoadComponentSummaryTables(EnergyPlusData &state) } for (int SysSizIndex = 1; SysSizIndex <= state.dataSize->NumSysSizInput; ++SysSizIndex) { if (state.dataSize->SysSizInput(SysSizIndex).AirLoopNum != iAirLoop) continue; - if (state.dataSize->SysSizInput(SysSizIndex).SizingOption == DataSizing::Concurrence::Coincident) { + if (state.dataSize->SysSizInput(SysSizIndex).SizingOption == DataSizing::SizingConcurrence::Coincident) { airLoopCoolTable.peakDesSensLoad = finalSysSizing.SysCoolCoinSpaceSens; airLoopCoolTable.designPeakLoad = finalSysSizing.SysDesCoolLoad; diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index 50841801321..b3033365723 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -734,7 +734,7 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) c->oaPeakVolFrac = -999.0; } - c->coilSizingMethodConcurrenceName = DataSizing::ConcurrenceMethodNames[(int)c->coilSizingMethodConcurrence]; + c->coilSizingMethodConcurrenceName = DataSizing::CoilSizingConcurrenceNames[(int)c->coilSizingMethodConcurrence]; if (c->coilSizingMethodCapacity == DataSizing::CoolingDesignCapacity) { c->coilSizingMethodCapacityName = "CoolingDesignCapacity"; @@ -1264,7 +1264,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->oaPeakHumRat = finalSysSizing.OutHumRatAtCoolPeak; c->raPeakTemp = finalSysSizing.RetTempAtCoolPeak; c->raPeakHumRat = finalSysSizing.RetHumRatAtCoolPeak; - c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; + c->coilSizingMethodConcurrence = static_cast(finalSysSizing.SizingOption); c->coilSizingMethodCapacity = finalSysSizing.CoolingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleCoolSAFMethod; // DesOutAirVolFlow @@ -1323,9 +1323,9 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->rmPeakRelHum = -999.0; } - if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::Coincident) { + if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::Coincident) { c->rmSensibleAtPeak = finalSysSizing.SysCoolCoinSpaceSens; - } else if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::NonCoincident) { + } else if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::NonCoincident) { c->rmSensibleAtPeak = sumSensLoad; } else { // DataSizing::Combination or other c->rmSensibleAtPeak = sumSensLoad; @@ -1470,7 +1470,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } - DataSizing::Concurrence sizMethod = DataSizing::Concurrence::Invalid; + DataSizing::SizingConcurrence sizMethod = DataSizing::SizingConcurrence::Invalid; bool sizMethodsAreTheSame = true; for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; @@ -1483,9 +1483,9 @@ void ReportCoilSelection::setCoilCoolingCapacity( } } if (sizMethodsAreTheSame) { - c->coilSizingMethodConcurrence = sizMethod; + c->coilSizingMethodConcurrence = static_cast(sizMethod); } else { - c->coilSizingMethodConcurrence = DataSizing::Concurrence::Combination; + c->coilSizingMethodConcurrence = DataSizing::CoilSizingConcurrence::Combination; } } } else { @@ -1533,7 +1533,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow; c->raPeakTemp = finalSysSizing.HeatRetTemp; c->raPeakHumRat = finalSysSizing.HeatRetHumRat; - c->coilSizingMethodConcurrence = finalSysSizing.SizingOption; + c->coilSizingMethodConcurrence = static_cast(finalSysSizing.SizingOption); c->coilSizingMethodCapacity = finalSysSizing.HeatingCapMethod; c->coilSizingMethodAirFlow = finalSysSizing.ScaleHeatSAFMethod; @@ -1588,9 +1588,9 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->rmPeakRelHum = -999.0; } - if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::Coincident) { + if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::Coincident) { c->rmSensibleAtPeak = finalSysSizing.SysHeatCoinSpaceSens; - } else if (c->coilSizingMethodConcurrence == DataSizing::Concurrence::NonCoincident) { + } else if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::NonCoincident) { c->rmSensibleAtPeak = sumLoad; } @@ -1767,7 +1767,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } - DataSizing::Concurrence sizMethod = DataSizing::Concurrence::Invalid; + DataSizing::SizingConcurrence sizMethod = DataSizing::SizingConcurrence::Invalid; bool sizMethodsAreTheSame = true; for (int airLoopNum = 0; airLoopNum < state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].NumOfAirLoops; ++airLoopNum) { int actualAirLoopNum = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].m_AirLoopNum[airLoopNum]; @@ -1780,9 +1780,9 @@ void ReportCoilSelection::setCoilHeatingCapacity( } } if (sizMethodsAreTheSame) { - c->coilSizingMethodConcurrence = sizMethod; + c->coilSizingMethodConcurrence = static_cast(sizMethod); } else { - c->coilSizingMethodConcurrence = DataSizing::Concurrence::Combination; + c->coilSizingMethodConcurrence = DataSizing::CoilSizingConcurrence::Combination; } } } else { diff --git a/src/EnergyPlus/ReportCoilSelection.hh b/src/EnergyPlus/ReportCoilSelection.hh index d15bf87a2e0..b68d1b2c477 100644 --- a/src/EnergyPlus/ReportCoilSelection.hh +++ b/src/EnergyPlus/ReportCoilSelection.hh @@ -99,8 +99,9 @@ public: // data int typeof_Coil; // type of coil, e.g., PlantEquipmentType::CoilWaterSimpleHeating, PlantEquipmentType::CoilWaterDetailedFlatCooling, // PlantEquipmentType::CoilWaterCooling - DataSizing::Concurrence coilSizingMethodConcurrence = DataSizing::Concurrence::NA; // non-coincident, coincident, combination, n/a - std::string coilSizingMethodConcurrenceName; // string name of sizing method for concurrence + DataSizing::CoilSizingConcurrence coilSizingMethodConcurrence = + DataSizing::CoilSizingConcurrence::NA; // non-coincident, coincident, combination, n/a + std::string coilSizingMethodConcurrenceName; // string name of sizing method for concurrence int coilSizingMethodCapacity; // 8=CoolingDesignCapacity, 9=HeatingDesignCapacity, 10=CapacityPerFloorArea, 11=FractionOfAutosizedCoolingCapacity, // 12=FractionOfAutosizedHeatingCapacity diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 494351d0478..7281b4e9abf 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -5510,7 +5510,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn auto &sysSizing = state.dataSize->SysSizing(state.dataSize->CurOverallSimDay, AirLoopNum); switch (sysSizing.SizingOption) { - case DataSizing::Concurrence::Coincident: { + case DataSizing::SizingConcurrence::Coincident: { if (finalSysSizing.SystemOAMethod == SysOAMethod::ZoneSum) { sysSizing.DesCoolVolFlow = sysSizing.CoinCoolMassFlow / state.dataEnvrn->StdRhoAir; sysSizing.DesHeatVolFlow = sysSizing.CoinHeatMassFlow / state.dataEnvrn->StdRhoAir; @@ -5841,7 +5841,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn sysSizing.DesMainVolFlow = max(sysSizing.DesCoolVolFlow, sysSizing.DesHeatVolFlow); // this should also be as least as big as is needed for Vot } break; - case DataSizing::Concurrence::NonCoincident: { + case DataSizing::SizingConcurrence::NonCoincident: { if (finalSysSizing.SystemOAMethod == SysOAMethod::ZoneSum) { sysSizing.DesCoolVolFlow = sysSizing.NonCoinCoolMassFlow / state.dataEnvrn->StdRhoAir; sysSizing.DesHeatVolFlow = sysSizing.NonCoinHeatMassFlow / state.dataEnvrn->StdRhoAir; @@ -6540,7 +6540,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn } // move the noncoincident results into the system sizing array - if (state.dataSize->CalcSysSizing(AirLoopNum).SizingOption == DataSizing::Concurrence::NonCoincident) { + if (state.dataSize->CalcSysSizing(AirLoopNum).SizingOption == DataSizing::SizingConcurrence::NonCoincident) { // But first check to see if the noncoincident result is actually bigger than the coincident (for 100% outside air) if (!(state.dataSize->FinalSysSizing(AirLoopNum).CoolOAOption == OAControl::AllOA && SysSensCoolCap <= 0.0)) { // CoolOAOption = Yes 100% OA @@ -6762,7 +6762,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn } state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).scaleZoneCooling(ZoneOARatio); } else if ((SysCoolSizingRat > 1.0) || - (SysCoolSizingRat < 1.0 && finalSysSizing.SizingOption == DataSizing::Concurrence::NonCoincident)) { + (SysCoolSizingRat < 1.0 && finalSysSizing.SizingOption == DataSizing::SizingConcurrence::NonCoincident)) { // size on user input system design flows state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).scaleZoneCooling(SysCoolSizingRat); } @@ -6823,7 +6823,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn ZoneOARatio *= (1.0 + state.dataSize->TermUnitSizing(TermUnitSizingIndex).InducRat); termUnitFinalZoneSizing.scaleZoneHeating(ZoneOARatio); } else if ((SysHeatSizingRat > 1.0) || - (SysHeatSizingRat < 1.0 && finalSysSizing.SizingOption == DataSizing::Concurrence::NonCoincident)) { + (SysHeatSizingRat < 1.0 && finalSysSizing.SizingOption == DataSizing::SizingConcurrence::NonCoincident)) { // size on user input system design flows termUnitFinalZoneSizing.scaleZoneHeating(SysHeatSizingRat); } diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 25d2294a30f..2cd8bedbaed 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -1116,8 +1116,9 @@ void ManageSystemSizingAdjustments(EnergyPlusData &state) // correct sizing design heating volume flow rate based on finalized air terminal unit operation if (FinalSysSizing(AirLoopNum).SizingOption == - DataSizing::Concurrence::NonCoincident) { // If non-coincident sizing method for this air loop, the we can use these sum's from - // air terminals directly + DataSizing::SizingConcurrence::NonCoincident) { // If non-coincident sizing method for this air loop, the we can use these sum's + // from + // air terminals directly FinalSysSizing(AirLoopNum).DesHeatVolFlow = max(airLoopHeatingMaximumFlowRateSum, FinalSysSizing(AirLoopNum).DesHeatVolFlow); FinalSysSizing(AirLoopNum).DesMainVolFlow = max(airLoopMaxFlowRateSum, FinalSysSizing(AirLoopNum).DesMainVolFlow); if (FinalSysSizing(AirLoopNum).sysSizeCoolingDominant) { @@ -1127,7 +1128,7 @@ void ManageSystemSizingAdjustments(EnergyPlusData &state) FinalSysSizing(AirLoopNum).DesCoolVolFlow = max(airLoopHeatingMinimumFlowRateSum, FinalSysSizing(AirLoopNum).DesCoolVolFlow); FinalSysSizing(AirLoopNum).MassFlowAtCoolPeak = FinalSysSizing(AirLoopNum).DesCoolVolFlow * state.dataEnvrn->StdRhoAir; } - } else if (FinalSysSizing(AirLoopNum).SizingOption == DataSizing::Concurrence::Coincident) { + } else if (FinalSysSizing(AirLoopNum).SizingOption == DataSizing::SizingConcurrence::Coincident) { if (FinalSysSizing(AirLoopNum).sysSizeCoolingDominant) { // use minimum heating flow sum from air terminals // know that minimum heating flow is a hard minimum regardless of concurrence situation, so make sure that design is at @@ -3280,8 +3281,8 @@ void GetZoneSizingInput(EnergyPlusData &state) ErrorsFound = true; } } - zoneSizingIndex.spaceConcurrence = - static_cast(getEnumValue(DataSizing::ConcurrenceMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10))); + zoneSizingIndex.spaceConcurrence = static_cast( + getEnumValue(DataSizing::SizingConcurrenceNamesUC, state.dataIPShortCut->cAlphaArgs(10))); zoneSizingIndex.zoneSizingMethod = static_cast(getEnumValue(DataSizing::ZoneSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10))); if (zoneSizingIndex.zoneSizingMethod != ZoneSizing::SensibleOnly) { @@ -3581,9 +3582,9 @@ void GetSystemSizingInput(EnergyPlusData &state) { std::string const &sizingOption = state.dataIPShortCut->cAlphaArgs(iSizingOptionAlphaNum); if (sizingOption == "COINCIDENT") { - SysSizInput(SysSizIndex).SizingOption = DataSizing::Concurrence::Coincident; + SysSizInput(SysSizIndex).SizingOption = DataSizing::SizingConcurrence::Coincident; } else if (sizingOption == "NONCOINCIDENT") { - SysSizInput(SysSizIndex).SizingOption = DataSizing::Concurrence::NonCoincident; + SysSizInput(SysSizIndex).SizingOption = DataSizing::SizingConcurrence::NonCoincident; } else { ShowSevereError(state, format("{}=\"{}\", invalid data.", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(iNameAlphaNum))); ShowContinueError(state, diff --git a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc index 56544d221fa..ab90e93809e 100644 --- a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc +++ b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc @@ -2898,7 +2898,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_OnOASystemTest) auto &finalSysSizing = state->dataSize->FinalSysSizing(1); auto &sysSizPeakDDNum = state->dataSize->SysSizPeakDDNum(1); EXPECT_ENUM_EQ(finalSysSizing.coolingPeakLoad, DataSizing::PeakLoad::SensibleCooling); - EXPECT_ENUM_EQ(finalSysSizing.SizingOption, DataSizing::Concurrence::NonCoincident); + EXPECT_ENUM_EQ(finalSysSizing.SizingOption, DataSizing::SizingConcurrence::NonCoincident); EXPECT_EQ(sysSizPeakDDNum.SensCoolPeakDD, coolPeakDD); int timeStepIndexAtPeakCoolLoad = sysSizPeakDDNum.TimeStepAtSensCoolPk(coolPeakDD); EXPECT_EQ(sysSizPeakDDNum.TimeStepAtTotCoolPk(coolPeakDD), timeStepIndexAtPeakCoolLoad); diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index 31a772385eb..688f439840a 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -7233,7 +7233,7 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo state->dataSize->NumSysSizInput = 1; state->dataSize->SysSizInput.allocate(state->dataSize->NumSysSizInput); state->dataSize->SysSizInput(1).AirLoopNum = 1; - state->dataSize->SysSizInput(1).SizingOption = DataSizing::Concurrence::NonCoincident; + state->dataSize->SysSizInput(1).SizingOption = DataSizing::SizingConcurrence::NonCoincident; auto degC_to_F = [](Real64 celsius) constexpr { return celsius * (9.0 / 5.0) + 32.0; From 1c11d8931a7fd104bc315c0f7acd69ae64324add Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Fri, 28 Jun 2024 17:30:39 -0500 Subject: [PATCH 030/164] Streamline sizing peak timestamps plus etc --- src/EnergyPlus/ZoneEquipmentManager.cc | 62 +++++++++++++++----------- src/EnergyPlus/ZoneEquipmentManager.hh | 5 ++- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index cb1ea30e0f9..9c795aee378 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -1178,6 +1178,7 @@ void fillZoneSizingFromInput(EnergyPlusData &state, zoneSizing.DOASControlStrategy = zoneSizingInput.DOASControlStrategy; zoneSizing.DOASLowSetpoint = zoneSizingInput.DOASLowSetpoint; zoneSizing.DOASHighSetpoint = zoneSizingInput.DOASHighSetpoint; + zoneSizing.spaceConcurrence = zoneSizingInput.spaceConcurrence; zoneSizing.zoneSizingMethod = zoneSizingInput.zoneSizingMethod; zoneSizing.zoneLatentSizing = zoneSizingInput.zoneLatentSizing; zoneSizing.zoneRHDehumidifySetPoint = zoneSizingInput.zoneRHDehumidifySetPoint; @@ -1210,6 +1211,7 @@ void fillZoneSizingFromInput(EnergyPlusData &state, calcZoneSizing.DOASControlStrategy = zoneSizingInput.DOASControlStrategy; calcZoneSizing.DOASLowSetpoint = zoneSizingInput.DOASLowSetpoint; calcZoneSizing.DOASHighSetpoint = zoneSizingInput.DOASHighSetpoint; + calcZoneSizing.spaceConcurrence = zoneSizingInput.spaceConcurrence; calcZoneSizing.zoneSizingMethod = zoneSizingInput.zoneSizingMethod; calcZoneSizing.zoneLatentSizing = zoneSizingInput.zoneLatentSizing; calcZoneSizing.zoneRHDehumidifySetPoint = zoneSizingInput.zoneRHDehumidifySetPoint; @@ -1262,6 +1264,7 @@ void fillZoneSizingFromInput(EnergyPlusData &state, zsFinalSizing.ZoneADEffHeating = zoneSizingInput.ZoneADEffHeating; zsFinalSizing.ZoneSecondaryRecirculation = zoneSizingInput.ZoneSecondaryRecirculation; zsFinalSizing.ZoneVentilationEff = zoneSizingInput.ZoneVentilationEff; + zsFinalSizing.spaceConcurrence = zoneSizingInput.spaceConcurrence; zsFinalSizing.zoneSizingMethod = zoneSizingInput.zoneSizingMethod; zsFinalSizing.zoneLatentSizing = zoneSizingInput.zoneLatentSizing; zsFinalSizing.zoneRHDehumidifySetPoint = zoneSizingInput.zoneRHDehumidifySetPoint; @@ -1302,6 +1305,7 @@ void fillZoneSizingFromInput(EnergyPlusData &state, zsCalcFinalSizing.DOASHighSetpoint = zoneSizingInput.DOASHighSetpoint; zsCalcFinalSizing.ZoneADEffCooling = zoneSizingInput.ZoneADEffCooling; zsCalcFinalSizing.ZoneADEffHeating = zoneSizingInput.ZoneADEffHeating; + zsCalcFinalSizing.spaceConcurrence = zoneSizingInput.spaceConcurrence; zsCalcFinalSizing.zoneSizingMethod = zoneSizingInput.zoneSizingMethod; zsCalcFinalSizing.zoneLatentSizing = zoneSizingInput.zoneLatentSizing; zsCalcFinalSizing.zoneRHDehumidifySetPoint = zoneSizingInput.zoneRHDehumidifySetPoint; @@ -1958,21 +1962,27 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, DataSizing::ZoneS } } -void updateZoneSizingEndZoneSizingCalc2(DataSizing::ZoneSizingData &zsCalcSizing, int const timeStepIndex, int const hourPrint, int const minutes) +void updateZoneSizingEndZoneSizingCalc2(EnergyPlusData &state, DataSizing::ZoneSizingData &zsCalcSizing) { - // SpaceSizing TODO: There's gotta be a better place to set these timestamps - if (timeStepIndex == zsCalcSizing.TimeStepNumAtHeatMax) { - zsCalcSizing.HeatPeakDateHrMin = zsCalcSizing.cHeatDDDate + ' ' + format(PeakHrMinFmt, hourPrint, minutes); - } - if (timeStepIndex == zsCalcSizing.TimeStepNumAtCoolMax) { - zsCalcSizing.CoolPeakDateHrMin = zsCalcSizing.cCoolDDDate + ' ' + format(PeakHrMinFmt, hourPrint, minutes); - } - if (timeStepIndex == zsCalcSizing.TimeStepNumAtLatentHeatMax) { - zsCalcSizing.LatHeatPeakDateHrMin = zsCalcSizing.cLatentHeatDDDate + ' ' + format(PeakHrMinFmt, hourPrint, minutes); - } - if (timeStepIndex == zsCalcSizing.TimeStepNumAtLatentCoolMax) { - zsCalcSizing.LatCoolPeakDateHrMin = zsCalcSizing.cLatentCoolDDDate + ' ' + format(PeakHrMinFmt, hourPrint, minutes); - } + zsCalcSizing.HeatPeakDateHrMin = zsCalcSizing.cHeatDDDate + ' ' + sizingPeakTimeStamp(state, zsCalcSizing.TimeStepNumAtHeatMax); + + zsCalcSizing.CoolPeakDateHrMin = zsCalcSizing.cCoolDDDate + ' ' + sizingPeakTimeStamp(state, zsCalcSizing.TimeStepNumAtCoolMax); + + zsCalcSizing.LatHeatPeakDateHrMin = zsCalcSizing.cLatentHeatDDDate + ' ' + sizingPeakTimeStamp(state, zsCalcSizing.TimeStepNumAtLatentHeatMax); + + zsCalcSizing.LatCoolPeakDateHrMin = zsCalcSizing.cLatentCoolDDDate + ' ' + sizingPeakTimeStamp(state, zsCalcSizing.TimeStepNumAtLatentCoolMax); +} + +std::string sizingPeakTimeStamp(EnergyPlusData &state, int timeStepIndex) +{ + int constexpr minToSec = 60; + int hour = 0; + int minute = 0; + Real64 second = 0; + + Real64 timeInSeconds = timeStepIndex * state.dataGlobal->MinutesPerTimeStep * minToSec; + General::ParseTime(timeInSeconds, hour, minute, second); + return format(PeakHrMinFmt, hour, minute); } void updateZoneSizingEndZoneSizingCalc3(DataSizing::ZoneSizingData &zsCalcFinalSizing, @@ -2096,6 +2106,7 @@ void updateZoneSizingEndZoneSizingCalc3(DataSizing::ZoneSizingData &zsCalcFinalS } void updateZoneSizingEndZoneSizingCalc4(DataSizing::ZoneSizingData &zsSizing, DataSizing::ZoneSizingData const &zsCalcSizing) { + // Move data from Calc arrays to user modified arrays zsSizing.CoolDesDay = zsCalcSizing.CoolDesDay; zsSizing.HeatDesDay = zsCalcSizing.HeatDesDay; zsSizing.DesHeatDens = zsCalcSizing.DesHeatDens; @@ -2131,6 +2142,7 @@ void updateZoneSizingEndZoneSizingCalc4(DataSizing::ZoneSizingData &zsSizing, Da void updateZoneSizingEndZoneSizingCalc5(DataSizing::ZoneSizingData &zsFinalSizing, DataSizing::ZoneSizingData const &zsCalcFinalSizing) { + // Move data from CalcFinal arrays to user modified final arrays // SpaceSizing TODO: This is essentially the same as updateZoneSizingEndZoneSizingCalc4, except there are two extra fields copied here zsFinalSizing.CoolDesDay = zsCalcFinalSizing.CoolDesDay; zsFinalSizing.HeatDesDay = zsCalcFinalSizing.HeatDesDay; @@ -2765,6 +2777,16 @@ void UpdateZoneSizing(EnergyPlusData &state, Constant::CallIndicator const CallI ":Cooling Zone Relative Humidity [%]"); } + for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) { + if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) continue; + updateZoneSizingEndZoneSizingCalc2(state, state.dataSize->CalcFinalZoneSizing(CtrlZoneNum)); + if (state.dataHeatBal->doSpaceHeatBalanceSizing) { + for (int spaceNum : state.dataHeatBal->Zone(CtrlZoneNum).spaceIndexes) { + updateZoneSizingEndZoneSizingCalc2(state, state.dataSize->CalcFinalSpaceSizing(spaceNum)); + } + } + } + print(state.files.zsz, "\n"); // HourFrac = 0.0 int Minutes = 0; @@ -2778,16 +2800,6 @@ void UpdateZoneSizing(EnergyPlusData &state, Constant::CallIndicator const CallI Minutes = 0; HourPrint = HourCounter; } - for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) { - if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) continue; - updateZoneSizingEndZoneSizingCalc2(state.dataSize->CalcFinalZoneSizing(CtrlZoneNum), TimeStepIndex, HourPrint, Minutes); - if (state.dataHeatBal->doSpaceHeatBalanceSizing) { - for (int spaceNum : state.dataHeatBal->Zone(CtrlZoneNum).spaceIndexes) { - updateZoneSizingEndZoneSizingCalc2(state.dataSize->CalcFinalSpaceSizing(spaceNum), TimeStepIndex, HourPrint, Minutes); - } - } - } - static constexpr std::string_view ZSizeFmt20("{:02}:{:02}:00"); print(state.files.zsz, ZSizeFmt20, HourPrint, Minutes); for (int I = 1; I <= state.dataGlobal->NumOfZones; ++I) { @@ -2986,7 +2998,7 @@ void UpdateZoneSizing(EnergyPlusData &state, Constant::CallIndicator const CallI for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) { if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) continue; - // Yes, call updateZoneSizingEndZoneSizingCalc6 again here to copyd the same fields + // Yes, call updateZoneSizingEndZoneSizingCalc6 again here to copy the same fields updateZoneSizingEndZoneSizingCalc6(state.dataSize->FinalZoneSizing(CtrlZoneNum), state.dataSize->CalcFinalZoneSizing(CtrlZoneNum), state.dataZoneEquipmentManager->NumOfTimeStepInDay); diff --git a/src/EnergyPlus/ZoneEquipmentManager.hh b/src/EnergyPlus/ZoneEquipmentManager.hh index a58db51063a..16c53a10bc9 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.hh +++ b/src/EnergyPlus/ZoneEquipmentManager.hh @@ -142,8 +142,9 @@ namespace ZoneEquipmentManager { void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, DataSizing::ZoneSizingData const &zsCalcSizing); - void - updateZoneSizingEndZoneSizingCalc2(DataSizing::ZoneSizingData &zsCalcSizing, int const timeStepIndex, int const hourPrint, int const minutes); + void updateZoneSizingEndZoneSizingCalc2(EnergyPlusData &state, DataSizing::ZoneSizingData &zsCalcSizing); + + std::string sizingPeakTimeStamp(EnergyPlusData &state, int timeStepIndex); void updateZoneSizingEndZoneSizingCalc3(DataSizing::ZoneSizingData &zsCalcFinalSizing, Array2D &zsCalcSizing, From d68a756e5c840259db0649c9c82ab018dc093433 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Tue, 2 Jul 2024 16:58:50 -0500 Subject: [PATCH 031/164] Space IV-Add Spsz output --- idd/Energy+.idd.in | 51 +- scripts/RunEPlus.bat | 10 + src/EnergyPlus/CommandLineInterface.cc | 7 + src/EnergyPlus/Data/EnergyPlusData.cc | 1 + src/EnergyPlus/DataZoneEquipment.hh | 2 +- src/EnergyPlus/IOFiles.cc | 4 + src/EnergyPlus/IOFiles.hh | 6 + src/EnergyPlus/SizingManager.cc | 9 + src/EnergyPlus/ZoneEquipmentManager.cc | 473 +++++++++--------- src/EnergyPlus/ZoneEquipmentManager.hh | 7 + ...iumOfficeNew2004_Chicago_OutputControl.idf | 1 + .../unit/Fixtures/EnergyPlusFixture.cc | 2 + tst/EnergyPlus/unit/OutputFiles.unit.cc | 51 +- 13 files changed, 350 insertions(+), 274 deletions(-) diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 6b3564b981a..f1fac315215 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -107173,117 +107173,122 @@ OutputControl:Files, \key Yes \key No \default Yes - A9 , \field Output Zone Sizing + A9 , \field Output Space Sizing \type choice \key Yes \key No \default Yes - A10, \field Output System Sizing + A10, \field Output Zone Sizing \type choice \key Yes \key No \default Yes - A11, \field Output DXF + A11, \field Output System Sizing \type choice \key Yes \key No \default Yes - A12, \field Output BND + A12, \field Output DXF \type choice \key Yes \key No \default Yes - A13, \field Output RDD + A13, \field Output BND \type choice \key Yes \key No \default Yes - A14, \field Output MDD + A14, \field Output RDD \type choice \key Yes \key No \default Yes - A15, \field Output MTD + A15, \field Output MDD \type choice \key Yes \key No \default Yes - A16, \field Output END + A16, \field Output MTD \type choice \key Yes \key No \default Yes - A17, \field Output SHD + A17, \field Output END \type choice \key Yes \key No \default Yes - A18, \field Output DFS + A18, \field Output SHD \type choice \key Yes \key No \default Yes - A19, \field Output GLHE + A19, \field Output DFS \type choice \key Yes \key No \default Yes - A20, \field Output DelightIn + A20, \field Output GLHE \type choice \key Yes \key No \default Yes - A21, \field Output DelightELdmp + A21, \field Output DelightIn \type choice \key Yes \key No \default Yes - A22, \field Output DelightDFdmp + A22, \field Output DelightELdmp \type choice \key Yes \key No \default Yes - A23, \field Output EDD + A23, \field Output DelightDFdmp \type choice \key Yes \key No \default Yes - A24, \field Output DBG + A24, \field Output EDD \type choice \key Yes \key No \default Yes - A25, \field Output PerfLog + A25, \field Output DBG \type choice \key Yes \key No \default Yes - A26, \field Output SLN + A26, \field Output PerfLog \type choice \key Yes \key No \default Yes - A27, \field Output SCI + A27, \field Output SLN \type choice \key Yes \key No \default Yes - A28, \field Output WRL + A28, \field Output SCI \type choice \key Yes \key No \default Yes - A29, \field Output Screen + A29, \field Output WRL \type choice \key Yes \key No \default Yes - A30, \field Output ExtShd + A30, \field Output Screen \type choice \key Yes \key No \default Yes - A31; \field Output Tarcog + A31, \field Output ExtShd + \type choice + \key Yes + \key No + \default Yes + A32; \field Output Tarcog \note Not Implemented Yet \type choice \key Yes diff --git a/scripts/RunEPlus.bat b/scripts/RunEPlus.bat index 142c045ea0b..8ec74d1a27a 100644 --- a/scripts/RunEPlus.bat +++ b/scripts/RunEPlus.bat @@ -86,6 +86,9 @@ IF EXIST eplusout.sln DEL eplusout.sln IF EXIST epluszsz.csv DEL epluszsz.csv IF EXIST epluszsz.tab DEL epluszsz.tab IF EXIST epluszsz.txt DEL epluszsz.txt +IF EXIST eplusspsz.csv DEL eplusspsz.csv +IF EXIST eplusspsz.tab DEL eplusspsz.tab +IF EXIST eplusspsz.txt DEL eplusspsz.txt IF EXIST eplusssz.csv DEL eplusssz.csv IF EXIST eplusssz.tab DEL eplusssz.tab IF EXIST eplusssz.txt DEL eplusssz.txt @@ -157,6 +160,10 @@ IF EXIST "%output_path%%~1.Zsz" DEL "%output_path%%~1.Zsz" IF EXIST "%output_path%%~1Zsz.csv" DEL "%output_path%%~1Zsz.csv" IF EXIST "%output_path%%~1Zsz.tab" DEL "%output_path%%~1Zsz.tab" IF EXIST "%output_path%%~1Zsz.txt" DEL "%output_path%%~1Zsz.txt" +IF EXIST "%output_path%%~1.Spsz" DEL "%output_path%%~1.Spsz" +IF EXIST "%output_path%%~1Spsz.csv" DEL "%output_path%%~1Spsz.csv" +IF EXIST "%output_path%%~1Spsz.tab" DEL "%output_path%%~1Spsz.tab" +IF EXIST "%output_path%%~1Spsz.txt" DEL "%output_path%%~1Spsz.txt" IF EXIST "%output_path%%~1.ssz" DEL "%output_path%%~1.ssz" IF EXIST "%output_path%%~1Ssz.csv" DEL "%output_path%%~1Ssz.csv" IF EXIST "%output_path%%~1Ssz.tab" DEL "%output_path%%~1Ssz.tab" @@ -339,6 +346,9 @@ IF EXIST eplusout.bnd %post_proc%HVAC-Diagram.exe IF EXIST epluszsz.csv MOVE epluszsz.csv "%output_path%%~1Zsz.csv" IF EXIST epluszsz.tab MOVE epluszsz.tab "%output_path%%~1Zsz.tab" IF EXIST epluszsz.txt MOVE epluszsz.txt "%output_path%%~1Zsz.txt" + IF EXIST eplusspsz.csv MOVE eplusspsz.csv "%output_path%%~1Spsz.csv" + IF EXIST eplusspsz.tab MOVE eplusspsz.tab "%output_path%%~1Spsz.tab" + IF EXIST eplusspsz.txt MOVE eplusspsz.txt "%output_path%%~1Spsz.txt" IF EXIST eplusssz.csv MOVE eplusssz.csv "%output_path%%~1Ssz.csv" IF EXIST eplusssz.tab MOVE eplusssz.tab "%output_path%%~1Ssz.tab" IF EXIST eplusssz.txt MOVE eplusssz.txt "%output_path%%~1Ssz.txt" diff --git a/src/EnergyPlus/CommandLineInterface.cc b/src/EnergyPlus/CommandLineInterface.cc index e54680f8a5b..d39a29a79b7 100644 --- a/src/EnergyPlus/CommandLineInterface.cc +++ b/src/EnergyPlus/CommandLineInterface.cc @@ -335,6 +335,7 @@ state.dataStrGlobals->inputFilePath='{}', std::string tableSuffix; std::string mapSuffix; std::string zszSuffix; + std::string spszSuffix; std::string sszSuffix; std::string meterSuffix; std::string sqliteSuffix; @@ -352,6 +353,7 @@ state.dataStrGlobals->inputFilePath='{}', tableSuffix = "tbl"; mapSuffix = "map"; zszSuffix = "zsz"; + spszSuffix = "spsz"; sszSuffix = "ssz"; meterSuffix = "mtr"; sqliteSuffix = "sqlite"; @@ -365,6 +367,7 @@ state.dataStrGlobals->inputFilePath='{}', tableSuffix = "-table"; mapSuffix = "-map"; zszSuffix = "-zsz"; + spszSuffix = "-spsz"; sszSuffix = "-ssz"; meterSuffix = "-meter"; sqliteSuffix = "-sqlite"; @@ -378,6 +381,7 @@ state.dataStrGlobals->inputFilePath='{}', tableSuffix = "Table"; mapSuffix = "Map"; zszSuffix = "Zsz"; + spszSuffix = "Spsz"; sszSuffix = "Ssz"; meterSuffix = "Meter"; sqliteSuffix = "Sqlite"; @@ -456,6 +460,9 @@ state.dataStrGlobals->inputFilePath='{}', state.files.outputZszCsvFilePath = composePath(zszSuffix + ".csv"); state.files.outputZszTabFilePath = composePath(zszSuffix + ".tab"); state.files.outputZszTxtFilePath = composePath(zszSuffix + ".txt"); + state.files.outputSpszCsvFilePath = composePath(spszSuffix + ".csv"); + state.files.outputSpszTabFilePath = composePath(spszSuffix + ".tab"); + state.files.outputSpszTxtFilePath = composePath(spszSuffix + ".txt"); state.files.outputSszCsvFilePath = composePath(sszSuffix + ".csv"); state.files.outputSszTabFilePath = composePath(sszSuffix + ".tab"); state.files.outputSszTxtFilePath = composePath(sszSuffix + ".txt"); diff --git a/src/EnergyPlus/Data/EnergyPlusData.cc b/src/EnergyPlus/Data/EnergyPlusData.cc index 03b30e7bfbb..28766d0df1d 100644 --- a/src/EnergyPlus/Data/EnergyPlusData.cc +++ b/src/EnergyPlus/Data/EnergyPlusData.cc @@ -566,6 +566,7 @@ void EnergyPlusData::clear_state() this->files.shade.close(); this->files.ssz.close(); this->files.zsz.close(); + this->files.spsz.close(); } void EnergyPlusData::init_state(EnergyPlusData &state) diff --git a/src/EnergyPlus/DataZoneEquipment.hh b/src/EnergyPlus/DataZoneEquipment.hh index 9688bf24682..a9621bd2b9f 100644 --- a/src/EnergyPlus/DataZoneEquipment.hh +++ b/src/EnergyPlus/DataZoneEquipment.hh @@ -614,7 +614,7 @@ struct DataZoneEquipmentData : BaseGlobalStruct int NumOfZoneEquipLists = 0; Array1D ZoneEquipAvail; Array1D ZoneEquipConfig; - EPVector spaceEquipConfig; + Array1D spaceEquipConfig; std::unordered_set UniqueZoneEquipListNames; Array1D ZoneEquipList; Array1D SupplyAirPath; diff --git a/src/EnergyPlus/IOFiles.cc b/src/EnergyPlus/IOFiles.cc index 614a27abcfd..d1be5d2e20c 100644 --- a/src/EnergyPlus/IOFiles.cc +++ b/src/EnergyPlus/IOFiles.cc @@ -376,6 +376,9 @@ void IOFiles::OutputControl::getInput(EnergyPlusData &state) { // "output_audit" audit = boolean_choice(find_input(fields, "output_audit")); } + { // "output_space_sizing" + spsz = boolean_choice(find_input(fields, "output_space_sizing")); + } { // "output_zone_sizing" zsz = boolean_choice(find_input(fields, "output_zone_sizing")); } @@ -484,6 +487,7 @@ void IOFiles::flushAll() eio.flush(); eso.flush(); zsz.flush(); + spsz.flush(); ssz.flush(); map.flush(); mtr.flush(); diff --git a/src/EnergyPlus/IOFiles.hh b/src/EnergyPlus/IOFiles.hh index d93b8b67978..c2ea2bc6dec 100644 --- a/src/EnergyPlus/IOFiles.hh +++ b/src/EnergyPlus/IOFiles.hh @@ -680,6 +680,7 @@ public: bool eso = true; bool eio = true; bool audit = true; + bool spsz = true; bool zsz = true; bool ssz = true; bool dxf = true; @@ -719,6 +720,11 @@ public: fs::path outputZszTabFilePath{"epluszsz.tab"}; fs::path outputZszTxtFilePath{"epluszsz.txt"}; + InputOutputFile spsz{""}; + fs::path outputSpszCsvFilePath{"eplusspsz.csv"}; + fs::path outputSpszTabFilePath{"eplusspsz.tab"}; + fs::path outputSpszTxtFilePath{"eplusspsz.txt"}; + InputOutputFile ssz{""}; fs::path outputSszCsvFilePath{"eplusssz.csv"}; fs::path outputSszTabFilePath{"eplusssz.tab"}; diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 2cd8bedbaed..e728c220fbf 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -240,7 +240,16 @@ void ManageSizing(EnergyPlusData &state) state.files.zsz.filePath = state.files.outputZszTxtFilePath; } + if (state.dataSize->SizingFileColSep == CharComma) { + state.files.spsz.filePath = state.files.outputSpszCsvFilePath; + } else if (state.dataSize->SizingFileColSep == CharTab) { + state.files.spsz.filePath = state.files.outputSpszTabFilePath; + } else { + state.files.spsz.filePath = state.files.outputSpszTxtFilePath; + } + state.files.zsz.ensure_open(state, "ManageSizing", state.files.outputControl.zsz); + state.files.spsz.ensure_open(state, "ManageSizing", state.files.outputControl.spsz); ShowMessage(state, "Beginning Zone Sizing Calculations"); diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 9c795aee378..80cb482861e 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -1985,6 +1985,239 @@ std::string sizingPeakTimeStamp(EnergyPlusData &state, int timeStepIndex) return format(PeakHrMinFmt, hour, minute); } +void writeZszSpsz(EnergyPlusData &state, + EnergyPlus::InputOutputFile &outputFile, + int const numSpacesOrZones, + Array1D const zsEquipConfig, + EPVector const &zsCalcFinalSizing, + Array2D const &zsCalcSizing) +{ + char const colSep = state.dataSize->SizingFileColSep; + print(outputFile, "Time"); + for (int i = 1; i <= numSpacesOrZones; ++i) { + if (!zsEquipConfig(i).IsControlled) continue; + auto &thisCalcFS = zsCalcFinalSizing(i); + + static constexpr std::string_view ZSizeFmt11("{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{" + "}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}"); + print(outputFile, + ZSizeFmt11, + colSep, + thisCalcFS.ZoneName, + thisCalcFS.HeatDesDay, + ":Des Heat Load [W]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.CoolDesDay, + ":Des Sens Cool Load [W]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.HeatDesDay, + ":Des Heat Mass Flow [kg/s]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.CoolDesDay, + ":Des Cool Mass Flow [kg/s]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.LatHeatDesDay, + ":Des Latent Heat Load [W]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.LatCoolDesDay, + ":Des Latent Cool Load [W]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.LatHeatDesDay, + ":Des Latent Heat Mass Flow [kg/s]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.LatCoolDesDay, + ":Des Latent Cool Mass Flow [kg/s]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.HeatNoDOASDesDay, + ":Des Heat Load No DOAS [W]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.CoolNoDOASDesDay, + ":Des Sens Cool Load No DOAS [W]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.LatHeatNoDOASDesDay, + ":Des Latent Heat Load No DOAS [W]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.LatCoolNoDOASDesDay, + ":Des Latent Cool Load No DOAS [W]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.HeatDesDay, + ":Heating Zone Temperature [C]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.HeatDesDay, + ":Heating Zone Relative Humidity [%]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.CoolDesDay, + ":Cooling Zone Temperature [C]", + colSep, + thisCalcFS.ZoneName, + thisCalcFS.CoolDesDay, + ":Cooling Zone Relative Humidity [%]"); + } + print(outputFile, "\n"); + // HourFrac = 0.0 + int Minutes = 0; + int TimeStepIndex = 0; + for (int HourCounter = 1; HourCounter <= 24; ++HourCounter) { + for (int TimeStepCounter = 1; TimeStepCounter <= state.dataGlobal->NumOfTimeStepInHour; ++TimeStepCounter) { + ++TimeStepIndex; + Minutes += state.dataGlobal->MinutesPerTimeStep; + int HourPrint = HourCounter - 1; + if (Minutes == 60) { + Minutes = 0; + HourPrint = HourCounter; + } + static constexpr std::string_view ZSizeFmt20("{:02}:{:02}:00"); + print(outputFile, ZSizeFmt20, HourPrint, Minutes); + for (int i = 1; i <= numSpacesOrZones; ++i) { + if (!zsEquipConfig(i).IsControlled) continue; + auto &thisCalcFS = zsCalcFinalSizing(i); + static constexpr std::string_view ZSizeFmt21("{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12." + "6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}"); + Real64 ZoneRHHeat = 0.0; + Real64 ZoneRHCool = 0.0; + Real64 ZoneTHeat = 0.0; + Real64 ZoneTCool = 0.0; + if (thisCalcFS.HeatDDNum > 0) { + ZoneTHeat = zsCalcSizing(thisCalcFS.HeatDDNum, i).HeatZoneTempSeq(TimeStepIndex); + ZoneRHHeat = Psychrometrics::PsyRhFnTdbWPb(state, + zsCalcSizing(thisCalcFS.HeatDDNum, i).HeatZoneTempSeq(TimeStepIndex), + zsCalcSizing(thisCalcFS.HeatDDNum, i).HeatZoneHumRatSeq(TimeStepIndex), + state.dataEnvrn->OutBaroPress) * + 100.0; + } + if (thisCalcFS.CoolDDNum > 0) { + ZoneTCool = zsCalcSizing(thisCalcFS.CoolDDNum, i).CoolZoneTempSeq(TimeStepIndex); + ZoneRHCool = Psychrometrics::PsyRhFnTdbWPb(state, + zsCalcSizing(thisCalcFS.CoolDDNum, i).CoolZoneTempSeq(TimeStepIndex), + zsCalcSizing(thisCalcFS.CoolDDNum, i).CoolZoneHumRatSeq(TimeStepIndex), + state.dataEnvrn->OutBaroPress) * + 100.0; + } + print(outputFile, + ZSizeFmt21, + colSep, + thisCalcFS.HeatLoadSeq(TimeStepIndex), + colSep, + thisCalcFS.CoolLoadSeq(TimeStepIndex), + colSep, + thisCalcFS.HeatFlowSeq(TimeStepIndex), + colSep, + thisCalcFS.CoolFlowSeq(TimeStepIndex), + colSep, + thisCalcFS.LatentHeatLoadSeq(TimeStepIndex), + colSep, + thisCalcFS.LatentCoolLoadSeq(TimeStepIndex), + colSep, + thisCalcFS.LatentHeatFlowSeq(TimeStepIndex), + colSep, + thisCalcFS.LatentCoolFlowSeq(TimeStepIndex), + colSep, + thisCalcFS.HeatLoadNoDOASSeq(TimeStepIndex), + colSep, + thisCalcFS.CoolLoadNoDOASSeq(TimeStepIndex), + colSep, + thisCalcFS.HeatLatentLoadNoDOASSeq(TimeStepIndex), + colSep, + thisCalcFS.CoolLatentLoadNoDOASSeq(TimeStepIndex), + colSep, + ZoneTHeat, + colSep, + ZoneRHHeat, + colSep, + ZoneTCool, + colSep, + ZoneRHCool); + } + print(outputFile, "\n"); + } + } + print(outputFile, "Peak"); + + for (int i = 1; i <= numSpacesOrZones; ++i) { + if (!zsEquipConfig(i).IsControlled) continue; + auto &thisCalcFS = zsCalcFinalSizing(i); + + static constexpr std::string_view ZSizeFmt31("{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12." + "6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{}{}{}"); + print(outputFile, + ZSizeFmt31, + colSep, + thisCalcFS.DesHeatLoad, + colSep, + thisCalcFS.DesCoolLoad, + colSep, + thisCalcFS.DesHeatMassFlow, + colSep, + thisCalcFS.DesCoolMassFlow, + colSep, + thisCalcFS.DesLatentHeatLoad, + colSep, + thisCalcFS.DesLatentCoolLoad, + colSep, + thisCalcFS.DesLatentHeatMassFlow, + colSep, + thisCalcFS.DesLatentCoolMassFlow, + colSep, + thisCalcFS.DesHeatLoadNoDOAS, + colSep, + thisCalcFS.DesCoolLoadNoDOAS, + colSep, + thisCalcFS.DesLatentHeatLoadNoDOAS, + colSep, + thisCalcFS.DesLatentCoolLoadNoDOAS, + colSep, + colSep, + colSep, + colSep); + } + print(outputFile, "\n"); + + print(outputFile, "\nPeak Vol Flow (m3/s)"); + for (int i = 1; i <= numSpacesOrZones; ++i) { + if (!zsEquipConfig(i).IsControlled) continue; + auto &thisCalcFS = zsCalcFinalSizing(i); + static constexpr std::string_view ZSizeFmt41("{}{}{}{:12.6E}{}{:12.6E}{}{}{}{:12.6E}{}{:12.6E}{}{}{}{}{}{}{}{}"); + print(outputFile, + ZSizeFmt41, + colSep, + colSep, + colSep, + thisCalcFS.DesHeatVolFlow, + colSep, + thisCalcFS.DesCoolVolFlow, + colSep, + colSep, + colSep, + thisCalcFS.DesLatentHeatVolFlow, + colSep, + thisCalcFS.DesLatentCoolVolFlow, + colSep, + colSep, + colSep, + colSep, + colSep, + colSep, + colSep, + colSep); + } + print(outputFile, "\n"); + outputFile.close(); +} + void updateZoneSizingEndZoneSizingCalc3(DataSizing::ZoneSizingData &zsCalcFinalSizing, Array2D &zsCalcSizing, bool &anyLatentLoad, @@ -2701,82 +2934,6 @@ void UpdateZoneSizing(EnergyPlusData &state, Constant::CallIndicator const CallI } } - // SpaceSizing TODO: For now only write zone-level zsz - print(state.files.zsz, "Time"); - for (int I = 1; I <= state.dataGlobal->NumOfZones; ++I) { - if (!state.dataZoneEquip->ZoneEquipConfig(I).IsControlled) continue; - auto &calcFinalZoneSizing = state.dataSize->CalcFinalZoneSizing(I); - - static constexpr std::string_view ZSizeFmt11("{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{" - "}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}"); - print(state.files.zsz, - ZSizeFmt11, - state.dataSize->SizingFileColSep, - state.dataSize->CalcFinalZoneSizing(I).ZoneName, - state.dataSize->CalcFinalZoneSizing(I).HeatDesDay, - ":Des Heat Load [W]", - state.dataSize->SizingFileColSep, - state.dataSize->CalcFinalZoneSizing(I).ZoneName, - state.dataSize->CalcFinalZoneSizing(I).CoolDesDay, - ":Des Sens Cool Load [W]", - state.dataSize->SizingFileColSep, - state.dataSize->CalcFinalZoneSizing(I).ZoneName, - state.dataSize->CalcFinalZoneSizing(I).HeatDesDay, - ":Des Heat Mass Flow [kg/s]", - state.dataSize->SizingFileColSep, - state.dataSize->CalcFinalZoneSizing(I).ZoneName, - state.dataSize->CalcFinalZoneSizing(I).CoolDesDay, - ":Des Cool Mass Flow [kg/s]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.LatHeatDesDay, - ":Des Latent Heat Load [W]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.LatCoolDesDay, - ":Des Latent Cool Load [W]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.LatHeatDesDay, - ":Des Latent Heat Mass Flow [kg/s]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.LatCoolDesDay, - ":Des Latent Cool Mass Flow [kg/s]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.HeatNoDOASDesDay, - ":Des Heat Load No DOAS [W]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.CoolNoDOASDesDay, - ":Des Sens Cool Load No DOAS [W]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.LatHeatNoDOASDesDay, - ":Des Latent Heat Load No DOAS [W]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.LatCoolNoDOASDesDay, - ":Des Latent Cool Load No DOAS [W]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.HeatDesDay, - ":Heating Zone Temperature [C]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.HeatDesDay, - ":Heating Zone Relative Humidity [%]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.CoolDesDay, - ":Cooling Zone Temperature [C]", - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.ZoneName, - calcFinalZoneSizing.CoolDesDay, - ":Cooling Zone Relative Humidity [%]"); - } - for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) { if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) continue; updateZoneSizingEndZoneSizingCalc2(state, state.dataSize->CalcFinalZoneSizing(CtrlZoneNum)); @@ -2787,158 +2944,20 @@ void UpdateZoneSizing(EnergyPlusData &state, Constant::CallIndicator const CallI } } - print(state.files.zsz, "\n"); - // HourFrac = 0.0 - int Minutes = 0; - int TimeStepIndex = 0; - for (int HourCounter = 1; HourCounter <= 24; ++HourCounter) { - for (int TimeStepCounter = 1; TimeStepCounter <= state.dataGlobal->NumOfTimeStepInHour; ++TimeStepCounter) { - ++TimeStepIndex; - Minutes += state.dataGlobal->MinutesPerTimeStep; - int HourPrint = HourCounter - 1; - if (Minutes == 60) { - Minutes = 0; - HourPrint = HourCounter; - } - static constexpr std::string_view ZSizeFmt20("{:02}:{:02}:00"); - print(state.files.zsz, ZSizeFmt20, HourPrint, Minutes); - for (int I = 1; I <= state.dataGlobal->NumOfZones; ++I) { - if (!state.dataZoneEquip->ZoneEquipConfig(I).IsControlled) continue; - auto &calcFinalZoneSizing = state.dataSize->CalcFinalZoneSizing(I); - static constexpr std::string_view ZSizeFmt21( - "{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12." - "6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}"); - Real64 ZoneRHHeat = 0.0; - Real64 ZoneRHCool = 0.0; - Real64 ZoneTHeat = 0.0; - Real64 ZoneTCool = 0.0; - if (calcFinalZoneSizing.HeatDDNum > 0) { - ZoneTHeat = state.dataSize->CalcZoneSizing(calcFinalZoneSizing.HeatDDNum, I).HeatZoneTempSeq(TimeStepIndex); - ZoneRHHeat = Psychrometrics::PsyRhFnTdbWPb( - state, - state.dataSize->CalcZoneSizing(calcFinalZoneSizing.HeatDDNum, I).HeatZoneTempSeq(TimeStepIndex), - state.dataSize->CalcZoneSizing(calcFinalZoneSizing.HeatDDNum, I).HeatZoneHumRatSeq(TimeStepIndex), - state.dataEnvrn->OutBaroPress) * - 100.0; - } - if (calcFinalZoneSizing.CoolDDNum > 0) { - ZoneTCool = state.dataSize->CalcZoneSizing(calcFinalZoneSizing.CoolDDNum, I).CoolZoneTempSeq(TimeStepIndex); - ZoneRHCool = Psychrometrics::PsyRhFnTdbWPb( - state, - state.dataSize->CalcZoneSizing(calcFinalZoneSizing.CoolDDNum, I).CoolZoneTempSeq(TimeStepIndex), - state.dataSize->CalcZoneSizing(calcFinalZoneSizing.CoolDDNum, I).CoolZoneHumRatSeq(TimeStepIndex), - state.dataEnvrn->OutBaroPress) * - 100.0; - } - print(state.files.zsz, - ZSizeFmt21, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.HeatLoadSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.CoolLoadSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.HeatFlowSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.CoolFlowSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.LatentHeatLoadSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.LatentCoolLoadSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.LatentHeatFlowSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.LatentCoolFlowSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.HeatLoadNoDOASSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.CoolLoadNoDOASSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.HeatLatentLoadNoDOASSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.CoolLatentLoadNoDOASSeq(TimeStepIndex), - state.dataSize->SizingFileColSep, - ZoneTHeat, - state.dataSize->SizingFileColSep, - ZoneRHHeat, - state.dataSize->SizingFileColSep, - ZoneTCool, - state.dataSize->SizingFileColSep, - ZoneRHCool); - } - print(state.files.zsz, "\n"); - } + writeZszSpsz(state, + state.files.zsz, + state.dataGlobal->NumOfZones, + state.dataZoneEquip->ZoneEquipConfig, + state.dataSize->CalcFinalZoneSizing, + state.dataSize->CalcZoneSizing); + if (state.dataHeatBal->doSpaceHeatBalanceSizing) { + writeZszSpsz(state, + state.files.spsz, + state.dataGlobal->numSpaces, + state.dataZoneEquip->spaceEquipConfig, + state.dataSize->CalcFinalSpaceSizing, + state.dataSize->CalcSpaceSizing); } - print(state.files.zsz, "Peak"); - - for (int I = 1; I <= state.dataGlobal->NumOfZones; ++I) { - if (!state.dataZoneEquip->ZoneEquipConfig(I).IsControlled) continue; - auto &calcFinalZoneSizing = state.dataSize->CalcFinalZoneSizing(I); - - static constexpr std::string_view ZSizeFmt31("{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12." - "6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{}{}{}"); - print(state.files.zsz, - ZSizeFmt31, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesHeatLoad, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesCoolLoad, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesHeatMassFlow, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesCoolMassFlow, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesLatentHeatLoad, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesLatentCoolLoad, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesLatentHeatMassFlow, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesLatentCoolMassFlow, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesHeatLoadNoDOAS, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesCoolLoadNoDOAS, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesLatentHeatLoadNoDOAS, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesLatentCoolLoadNoDOAS, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep); - } - print(state.files.zsz, "\n"); - - print(state.files.zsz, "\nPeak Vol Flow (m3/s)"); - for (int I = 1; I <= state.dataGlobal->NumOfZones; ++I) { - if (!state.dataZoneEquip->ZoneEquipConfig(I).IsControlled) continue; - auto &calcFinalZoneSizing = state.dataSize->CalcFinalZoneSizing(I); - static constexpr std::string_view ZSizeFmt41("{}{}{}{:12.6E}{}{:12.6E}{}{}{}{:12.6E}{}{:12.6E}{}{}{}{}{}{}{}{}"); - print(state.files.zsz, - ZSizeFmt41, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesHeatVolFlow, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesCoolVolFlow, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesLatentHeatVolFlow, - state.dataSize->SizingFileColSep, - calcFinalZoneSizing.DesLatentCoolVolFlow, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep, - state.dataSize->SizingFileColSep); - } - print(state.files.zsz, "\n"); - state.files.zsz.close(); } if (!state.dataGlobal->isPulseZoneSizing) { diff --git a/src/EnergyPlus/ZoneEquipmentManager.hh b/src/EnergyPlus/ZoneEquipmentManager.hh index 16c53a10bc9..563cba75d07 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.hh +++ b/src/EnergyPlus/ZoneEquipmentManager.hh @@ -144,6 +144,13 @@ namespace ZoneEquipmentManager { void updateZoneSizingEndZoneSizingCalc2(EnergyPlusData &state, DataSizing::ZoneSizingData &zsCalcSizing); + void writeZszSpsz(EnergyPlusData &state, + EnergyPlus::InputOutputFile &outputFile, + int const numSpacesOrZones, + Array1D const zsEquipConfig, + EPVector const &zsCalcFinalSizing, + Array2D const &zsCalcSizing); + std::string sizingPeakTimeStamp(EnergyPlusData &state, int timeStepIndex); void updateZoneSizingEndZoneSizingCalc3(DataSizing::ZoneSizingData &zsCalcFinalSizing, diff --git a/testfiles/RefBldgMediumOfficeNew2004_Chicago_OutputControl.idf b/testfiles/RefBldgMediumOfficeNew2004_Chicago_OutputControl.idf index b7a0ca050ce..b89feeb9c58 100644 --- a/testfiles/RefBldgMediumOfficeNew2004_Chicago_OutputControl.idf +++ b/testfiles/RefBldgMediumOfficeNew2004_Chicago_OutputControl.idf @@ -7875,6 +7875,7 @@ No, !- Output SQLite No, !- Output JSON No, !- Output AUDIT + No, !- Output Space Sizing No, !- Output Zone Sizing No, !- Output System Sizing No, !- Output DXF diff --git a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc index 43e61139917..be2ba42c515 100644 --- a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc +++ b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc @@ -90,6 +90,7 @@ void EnergyPlusFixture::openOutputFiles(EnergyPlusData &state) state.files.mtd.open_as_stringstream(); state.files.edd.open_as_stringstream(); state.files.zsz.open_as_stringstream(); + state.files.spsz.open_as_stringstream(); state.files.ssz.open_as_stringstream(); } @@ -130,6 +131,7 @@ void EnergyPlusFixture::TearDown() state->files.eio.del(); state->files.debug.del(); state->files.zsz.del(); + state->files.spsz.del(); state->files.ssz.del(); state->files.mtr.del(); state->files.bnd.del(); diff --git a/tst/EnergyPlus/unit/OutputFiles.unit.cc b/tst/EnergyPlus/unit/OutputFiles.unit.cc index 6d04767db4b..f2c56dd994f 100644 --- a/tst/EnergyPlus/unit/OutputFiles.unit.cc +++ b/tst/EnergyPlus/unit/OutputFiles.unit.cc @@ -294,6 +294,7 @@ OutputControl:Files, {sqlite}, !- Output SQLite {json}, !- Output JSON {audit}, !- Output AUDIT + {spsz}, !- Output Space Sizing {zsz}, !- Output Zone Sizing {ssz}, !- Output System Sizing {dxf}, !- Output DXF @@ -330,29 +331,30 @@ OutputControl:Files, bool sqlite = (i == 5); bool json = (i == 6); bool audit = (i == 7); - bool zsz = (i == 8); - bool ssz = (i == 9); - bool dxf = (i == 10); - bool bnd = (i == 11); - bool rdd = (i == 12); - bool mdd = (i == 13); - bool mtd = (i == 14); - bool end = (i == 15); - bool shd = (i == 16); - bool dfs = (i == 17); - bool glhe = (i == 18); - bool delightin = (i == 19); - bool delighteldmp = (i == 20); - bool delightdfdmp = (i == 21); - bool edd = (i == 22); - bool dbg = (i == 23); - bool perflog = (i == 24); - bool sln = (i == 25); - bool sci = (i == 26); - bool wrl = (i == 27); - bool screen = (i == 28); - bool extshd = (i == 29); - bool tarcog = (i == 30); + bool spsz = (i == 8); + bool zsz = (i == 9); + bool ssz = (i == 10); + bool dxf = (i == 11); + bool bnd = (i == 12); + bool rdd = (i == 13); + bool mdd = (i == 14); + bool mtd = (i == 15); + bool end = (i == 16); + bool shd = (i == 17); + bool dfs = (i == 18); + bool glhe = (i == 19); + bool delightin = (i == 20); + bool delighteldmp = (i == 21); + bool delightdfdmp = (i == 22); + bool edd = (i == 23); + bool dbg = (i == 24); + bool perflog = (i == 25); + bool sln = (i == 26); + bool sci = (i == 27); + bool wrl = (i == 28); + bool screen = (i == 29); + bool extshd = (i == 30); + bool tarcog = (i == 31); std::string const idf_objects = fmt::format(idf_objects_fmt, fmt::arg("csv", boolToString(csv)), @@ -363,6 +365,7 @@ OutputControl:Files, fmt::arg("sqlite", boolToString(sqlite)), fmt::arg("json", boolToString(json)), fmt::arg("audit", boolToString(audit)), + fmt::arg("spsz", boolToString(spsz)), fmt::arg("zsz", boolToString(zsz)), fmt::arg("ssz", boolToString(ssz)), fmt::arg("dxf", boolToString(dxf)), @@ -399,6 +402,7 @@ OutputControl:Files, EXPECT_EQ(sqlite, state->files.outputControl.sqlite); EXPECT_EQ(json, state->files.outputControl.json); EXPECT_EQ(audit, state->files.outputControl.audit); + EXPECT_EQ(spsz, state->files.outputControl.spsz); EXPECT_EQ(zsz, state->files.outputControl.zsz); EXPECT_EQ(ssz, state->files.outputControl.ssz); EXPECT_EQ(dxf, state->files.outputControl.dxf); @@ -433,6 +437,7 @@ OutputControl:Files, state->files.outputControl.sqlite = false; state->files.outputControl.json = false; state->files.outputControl.audit = false; + state->files.outputControl.spsz = false; state->files.outputControl.zsz = false; state->files.outputControl.ssz = false; state->files.outputControl.dxf = false; From 1a07c51671bdd3b9b668a114e40efab4714f6016 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Mon, 8 Jul 2024 11:24:25 -0700 Subject: [PATCH 032/164] change varname to fanRunTimeFraction, add comments to this arg this argument is only used in VRFFluidTCtrl model, not regular VAV --- src/EnergyPlus/Fans.cc | 14 +++++++++----- src/EnergyPlus/Fans.hh | 24 +++++++++++++----------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index bc337c1cb8e..3f5cca1da63 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -103,7 +103,9 @@ void FanBase::simulate(EnergyPlusData &state, // the legacy speed ratio that was used with SimulateFanComponents. ObjexxFCL::Optional _pressureRise, // Pressure difference to use for DeltaPress, for rating DX coils at a ObjexxFCL::Optional _flowFraction, // when used, this directs the fan to set the flow at this flow fraction - ObjexxFCL::Optional _onOffFanPartLoadFraction, // to control for cycling in VAV fan in VRFFluidTCtrl + ObjexxFCL::Optional + _fanRunTimeFraction, // This argument is only used in the variable volume fan in + // VRFFluidTCtrl model to control for fan cycling. Please do not use it in normal VAV model. // different pressure without entire duct system ObjexxFCL::Optional _massFlowRate1, // Mass flow rate in operating mode 1 [kg/s] ObjexxFCL::Optional _runTimeFraction1, // Run time fraction in operating mode 1 @@ -139,7 +141,7 @@ void FanBase::simulate(EnergyPlusData &state, _thisFan->simulateConstant(state); } break; case HVAC::FanType::VAV: { - _thisFan->simulateVAV(state, _pressureRise, _onOffFanPartLoadFraction); + _thisFan->simulateVAV(state, _pressureRise, _fanRunTimeFraction); } break; case HVAC::FanType::OnOff: { _thisFan->simulateOnOff(state, _speedRatio); @@ -1703,7 +1705,9 @@ void FanComponent::simulateConstant(EnergyPlusData &state) void FanComponent::simulateVAV(EnergyPlusData &state, ObjexxFCL::Optional _pressureRise, - ObjexxFCL::Optional _onOffFanPartLoadFraction) + // This argument is only used in the variable volume fan in + // VRFFluidTCtrl model to control for fan cycling. Please do not use it in normal VAV model. + ObjexxFCL::Optional _fanRunTimeFraction) { // SUBROUTINE INFORMATION: @@ -1869,8 +1873,8 @@ void FanComponent::simulateVAV(EnergyPlusData &state, massFlowRateMaxAvail = 0.0; massFlowRateMinAvail = 0.0; } - if (present(_onOffFanPartLoadFraction)) { - totalPower *= _onOffFanPartLoadFraction; + if (present(_fanRunTimeFraction)) { + totalPower *= _fanRunTimeFraction; } } // FanComponent::SimVAV() diff --git a/src/EnergyPlus/Fans.hh b/src/EnergyPlus/Fans.hh index a84ec8d1af5..9086cadde83 100644 --- a/src/EnergyPlus/Fans.hh +++ b/src/EnergyPlus/Fans.hh @@ -97,15 +97,16 @@ namespace Fans { virtual void init(EnergyPlusData &state) = 0; virtual void simulate(EnergyPlusData &state, bool const FirstHVACIteration, - ObjexxFCL::Optional speedRatio = _, // Flow fraction in operating mode 1 - ObjexxFCL::Optional pressureRise = _, // Pressure difference to use for DeltaPress - ObjexxFCL::Optional flowFraction = _, // Flow fraction in operating mode 1 - ObjexxFCL::Optional onOffFanPartLoadFraction = 1.0, // to control for cycling in VAV fan in VRFFluidTCtrl - ObjexxFCL::Optional massFlowRate1 = _, // Mass flow rate in operating mode 1 [kg/s] - ObjexxFCL::Optional runTimeFraction1 = _, // Run time fraction in operating mode 1 - ObjexxFCL::Optional massFlowRate2 = _, // Mass flow rate in operating mode 2 [kg/s] - ObjexxFCL::Optional runTimeFraction2 = _, // Run time fraction in operating mode 2 - ObjexxFCL::Optional pressureRise2 = _ // Pressure difference to use for operating mode 2 + ObjexxFCL::Optional speedRatio = _, // Flow fraction in operating mode 1 + ObjexxFCL::Optional pressureRise = _, // Pressure difference to use for DeltaPress + ObjexxFCL::Optional flowFraction = _, // Flow fraction in operating mode 1 + ObjexxFCL::Optional fanRuntimeFraction = 1.0, // This argument is only used in the variable volume fan in + // VRFFluidTCtrl model to control for fan cycling. Please do not use it in normal VAV model. + ObjexxFCL::Optional massFlowRate1 = _, // Mass flow rate in operating mode 1 [kg/s] + ObjexxFCL::Optional runTimeFraction1 = _, // Run time fraction in operating mode 1 + ObjexxFCL::Optional massFlowRate2 = _, // Mass flow rate in operating mode 2 [kg/s] + ObjexxFCL::Optional runTimeFraction2 = _, // Run time fraction in operating mode 2 + ObjexxFCL::Optional pressureRise2 = _ // Pressure difference to use for operating mode 2 ); virtual void update(EnergyPlusData &state) = 0; @@ -229,8 +230,9 @@ namespace Fans { void simulateVAV(EnergyPlusData &state, ObjexxFCL::Optional PressureRise = _, - // to control for cycling in VAV fan in VRFFluidTCtrl - ObjexxFCL::Optional OnOffFanPartLoadFraction = 1.0); + // This argument is only used in the variable volume fan in + // VRFFluidTCtrl model to control for fan cycling. Please do not use it in normal VAV model. + ObjexxFCL::Optional fanRuntimeFraction = 1.0); void simulateOnOff(EnergyPlusData &state, ObjexxFCL::Optional SpeedRatio = _); From ce8b8513273f75f72f1b8fd403ba0f61b4ceff6a Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 12 Jul 2024 17:06:25 -0500 Subject: [PATCH 033/164] Add core new error message utility functions --- src/EnergyPlus/UtilityRoutines.cc | 35 +++++++++++++++++++++++++++++++ src/EnergyPlus/UtilityRoutines.hh | 5 +++++ 2 files changed, 40 insertions(+) diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc index dd63a95befb..a405f27c9b5 100644 --- a/src/EnergyPlus/UtilityRoutines.cc +++ b/src/EnergyPlus/UtilityRoutines.cc @@ -866,6 +866,41 @@ bool env_var_on(std::string const &env_var_str) return ((!env_var_str.empty()) && is_any_of(env_var_str[0], "YyTt")); } +void emitErrorMessage(EnergyPlusData &state, int idOne, std::string const &msg, bool shouldFatal) { + (void)idOne; + if (!shouldFatal) { + ShowSevereError(state, msg); + } else { // should fatal + ShowFatalError(state, msg); + } +} +void emitErrorMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs, bool shouldFatal) { + (void)idOne; + for (auto msg = msgs.begin(); msg != msgs.end(); ++msg) { + if (msg == msgs.begin()) { + ShowSevereError(state, *msg); + } else if (std::next(msg) == msgs.end() && shouldFatal) { + ShowFatalError(state, *msg); + } else { // should be an intermediate message, or a final one where there is no fatal + ShowContinueError(state, *msg); + } + } +} +void emitWarningMessage(EnergyPlusData &state, int idOne, std::string const &msg) { + (void)idOne; + ShowWarningMessage(state, msg); +} +void emitWarningMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs) { + (void)idOne; + for (auto msg = msgs.begin(); msg != msgs.end(); ++msg) { + if (msg == msgs.begin()) { + ShowWarningMessage(state, *msg); + } else { + ShowContinueError(state, *msg); + } + } +} + void ShowFatalError(EnergyPlusData &state, std::string const &ErrorMessage, OptionalOutputFileRef OutUnit1, OptionalOutputFileRef OutUnit2) { diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index 6017ba557b2..1e6eae6943f 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -132,6 +132,11 @@ bool env_var_on(std::string const &env_var_str); using OptionalOutputFileRef = std::optional>; +void emitErrorMessage(EnergyPlusData &state, int idOne, std::string const &msg, bool shouldFatal); +void emitErrorMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs, bool shouldFatal); +void emitWarningMessage(EnergyPlusData &state, int idOne, std::string const &msg); +void emitWarningMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs); + void ShowFatalError(EnergyPlusData &state, std::string const &ErrorMessage, OptionalOutputFileRef OutUnit1 = {}, OptionalOutputFileRef OutUnit2 = {}); void ShowSevereError(EnergyPlusData &state, From ac8afa945f0190c4a032e2a650a0a7ec6fc15d93 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 12 Jul 2024 17:06:47 -0500 Subject: [PATCH 034/164] Fix WarningError usage in OP --- src/EnergyPlus/OutputProcessor.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 11f04dd6102..2621522031a 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -3647,13 +3647,13 @@ void GenOutputVariablesAuditReport(EnergyPlusData &state) if (reqVar->key.empty()) reqVar->key = "*"; if (has(reqVar->name, "OPAQUE SURFACE INSIDE FACE CONDUCTION") && !state.dataGlobal->DisplayAdvancedReportVariables && !state.dataOutputProcessor->OpaqSurfWarned) { - ShowWarningError(state, R"(Variables containing "Opaque Surface Inside Face Conduction" are now "advanced" variables.)"); + ShowWarningMessage(state, R"(Variables containing "Opaque Surface Inside Face Conduction" are now "advanced" variables.)"); ShowContinueError(state, "You must enter the \"Output:Diagnostics,DisplayAdvancedReportVariables;\" statement to view."); ShowContinueError(state, "First, though, read cautionary statements in the \"InputOutputReference\" document."); state.dataOutputProcessor->OpaqSurfWarned = true; } if (!state.dataOutputProcessor->Rept) { - ShowWarningError(state, "The following Report Variables were requested but not generated -- check.rdd file"); + ShowWarningMessage(state, "The following Report Variables were requested but not generated -- check.rdd file"); ShowContinueError(state, "Either the IDF did not contain these elements, the variable name is misspelled,"); ShowContinueError(state, "or the requested variable is an advanced output which requires Output : Diagnostics, DisplayAdvancedReportVariables;"); From 83eaf59f17458017e9c66ad50c0f94878484f660 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Mon, 15 Jul 2024 14:00:00 -0500 Subject: [PATCH 035/164] Tweak one output processor call to WarningError, adjust unit test --- src/EnergyPlus/OutputProcessor.cc | 2 +- src/EnergyPlus/UtilityRoutines.cc | 16 ++++++++++------ tst/EnergyPlus/unit/OutputProcessor.unit.cc | 6 +++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/EnergyPlus/OutputProcessor.cc b/src/EnergyPlus/OutputProcessor.cc index 2621522031a..1289731590f 100644 --- a/src/EnergyPlus/OutputProcessor.cc +++ b/src/EnergyPlus/OutputProcessor.cc @@ -1572,7 +1572,7 @@ namespace OutputProcessor { // write(outputfiledebug,*) 'resourcetype=',TRIM(resourcetype) // write(outputfiledebug,*) 'ipunits type=',CodeForIPUnits if (units != Constant::Units::kg && units != Constant::Units::J && units != Constant::Units::m3 && units != Constant::Units::L) { - ShowWarningError( + ShowWarningMessage( state, format("DetermineMeterIPUnits: Meter units not recognized for IP Units conversion=[{}].", Constant::unitNames[(int)units])); ErrorsFound = true; } diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc index a405f27c9b5..499a4c6477d 100644 --- a/src/EnergyPlus/UtilityRoutines.cc +++ b/src/EnergyPlus/UtilityRoutines.cc @@ -866,31 +866,35 @@ bool env_var_on(std::string const &env_var_str) return ((!env_var_str.empty()) && is_any_of(env_var_str[0], "YyTt")); } -void emitErrorMessage(EnergyPlusData &state, int idOne, std::string const &msg, bool shouldFatal) { +void emitErrorMessage(EnergyPlusData &state, int idOne, std::string const &msg, bool shouldFatal) +{ (void)idOne; if (!shouldFatal) { ShowSevereError(state, msg); - } else { // should fatal + } else { // should fatal ShowFatalError(state, msg); } } -void emitErrorMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs, bool shouldFatal) { +void emitErrorMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs, bool shouldFatal) +{ (void)idOne; for (auto msg = msgs.begin(); msg != msgs.end(); ++msg) { if (msg == msgs.begin()) { ShowSevereError(state, *msg); } else if (std::next(msg) == msgs.end() && shouldFatal) { ShowFatalError(state, *msg); - } else { // should be an intermediate message, or a final one where there is no fatal + } else { // should be an intermediate message, or a final one where there is no fatal ShowContinueError(state, *msg); } } } -void emitWarningMessage(EnergyPlusData &state, int idOne, std::string const &msg) { +void emitWarningMessage(EnergyPlusData &state, int idOne, std::string const &msg) +{ (void)idOne; ShowWarningMessage(state, msg); } -void emitWarningMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs) { +void emitWarningMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs) +{ (void)idOne; for (auto msg = msgs.begin(); msg != msgs.end(); ++msg) { if (msg == msgs.begin()) { diff --git a/tst/EnergyPlus/unit/OutputProcessor.unit.cc b/tst/EnergyPlus/unit/OutputProcessor.unit.cc index 44ae8837d37..effaeb282d0 100644 --- a/tst/EnergyPlus/unit/OutputProcessor.unit.cc +++ b/tst/EnergyPlus/unit/OutputProcessor.unit.cc @@ -1315,9 +1315,9 @@ namespace OutputProcessor { ASSERT_EQ(2ul, errorData.size()); std::vector errorData0{ - "1", "1", "0", "DetermineMeterIPUnits: Meter units not recognized for IP Units conversion=[unknown].", "1"}; + "1", "1", "0", "DetermineMeterIPUnits: Meter units not recognized for IP Units conversion=[unknown].", "0"}; std::vector errorData1{ - "2", "1", "0", "DetermineMeterIPUnits: Meter units not recognized for IP Units conversion=[unknown].", "1"}; + "2", "1", "0", "DetermineMeterIPUnits: Meter units not recognized for IP Units conversion=[unknown].", "0"}; EXPECT_EQ(errorData0, errorData[0]); EXPECT_EQ(errorData1, errorData[1]); } @@ -2140,7 +2140,7 @@ namespace OutputProcessor { "0", "DetermineMeterIPUnits: Meter units not recognized for IP Units conversion=[unknown]. ..on " "Meter=\"testMeter2\". ..requests for IP units from this meter will be ignored.", - "1"}; + "0"}; EXPECT_EQ(errorData0, errorData[0]); ASSERT_EQ(2ul, op->meters.size()); From 7941a368fb204fed55c13578b7aeb04bdf7e2343 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Mon, 15 Jul 2024 17:21:03 -0500 Subject: [PATCH 036/164] Add countAsError arg to warning utility methods --- src/EnergyPlus/UtilityRoutines.cc | 16 ++++++++++++---- src/EnergyPlus/UtilityRoutines.hh | 4 ++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc index 499a4c6477d..0bc9d71a941 100644 --- a/src/EnergyPlus/UtilityRoutines.cc +++ b/src/EnergyPlus/UtilityRoutines.cc @@ -888,17 +888,25 @@ void emitErrorMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs) +void emitWarningMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs, bool const countAsError) { (void)idOne; for (auto msg = msgs.begin(); msg != msgs.end(); ++msg) { if (msg == msgs.begin()) { - ShowWarningMessage(state, *msg); + if (countAsError) { // ideally this path goes away and we just have distinct warnings and errors + ShowWarningError(state, *msg); + } else { + ShowWarningMessage(state, *msg); + } } else { ShowContinueError(state, *msg); } diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index 1e6eae6943f..29ef3e4335e 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -134,8 +134,8 @@ using OptionalOutputFileRef = std::optional const &msgs, bool shouldFatal); -void emitWarningMessage(EnergyPlusData &state, int idOne, std::string const &msg); -void emitWarningMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs); +void emitWarningMessage(EnergyPlusData &state, int idOne, std::string const &msg, bool countAsError = false); +void emitWarningMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs, bool countAsError = false); void ShowFatalError(EnergyPlusData &state, std::string const &ErrorMessage, OptionalOutputFileRef OutUnit1 = {}, OptionalOutputFileRef OutUnit2 = {}); From 733ec7ea190a9a1e1a77627869a667f293748fad Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Mon, 15 Jul 2024 17:44:28 -0700 Subject: [PATCH 037/164] use SystemModel for fan object in VRFFluidTCtrl TU --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 5 +- ...US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf | 64 ++++++++++++++----- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 79e475f5dfb..c2fd71961dd 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12865,8 +12865,7 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state, } Real64 OnOffFanPartLoadFraction = 1.0; - if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanOp == HVAC::FanOp::Cycling && - state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType == HVAC::FanType::VAV) { + if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanOp == HVAC::FanOp::Cycling) { OnOffFanPartLoadFraction = state.dataHVACGlobal->OnOffFanPartLoadFraction; } // if draw through, simulate coils then fan @@ -12874,7 +12873,7 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state, auto *fan = state.dataFans->fans(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).FanIndex); if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType == HVAC::FanType::SystemModel) { if (OnOffAirFlowRatio > 0.0) { - fan->simulate(state, FirstHVACIteration, _, _); + fan->simulate(state, FirstHVACIteration, _, _, _, _, fan->inletAirMassFlowRate, OnOffFanPartLoadFraction, 0, 0, _); } else { fan->simulate(state, FirstHVACIteration, _, _, PartLoadRatio); } diff --git a/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf b/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf index 91ddad35a01..3a82696c3c0 100644 --- a/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf +++ b/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf @@ -482,7 +482,7 @@ 0, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanModeSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU1 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU1 OA Mixer, !- Outside Air Mixer Object Name @@ -530,25 +530,57 @@ OutdoorAir:NodeList, Outside Air Inlet Node 1;!- Node or NodeList Name 1 - Fan:VariableVolume, + !- Fan:VariableVolume, + !- TU1 VRF Supply Fan, !- Name + !- VRFAvailSched, !- Availability Schedule Name + !- 0.5, !- Fan Total Efficiency + !- 400, !- Pressure Rise {Pa} + !- 0.595, !- Maximum Flow Rate {m3/s} + !- FixedFlowRate, !- Fan Power Minimum Flow Rate Input Method + !- 0, !- Fan Power Minimum Flow Fraction + !- 0.415, !- Fan Power Minimum Air Flow Rate {m3/s} + !- 0.9, !- Motor Efficiency + !- 1, !- Motor In Airstream Fraction + !- 0.09, !- Fan Power Coefficient 1 + !- 0, !- Fan Power Coefficient 2 + !- 0, !- Fan Power Coefficient 3 + !- 0.91, !- Fan Power Coefficient 4 + !- 0, !- Fan Power Coefficient 5 + !- TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name + !- TU1 VRF Fan Outlet Node, !- Air Outlet Node Name + !- General; !- End-Use Subcategory + + Fan:SystemModel, TU1 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.5, !- Fan Total Efficiency - 400, !- Pressure Rise {Pa} - 0.595, !- Maximum Flow Rate {m3/s} - FixedFlowRate, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0.415, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.09, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.91, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU1 VRF Fan Outlet Node, !- Air Outlet Node Name - General; !- End-Use Subcategory + 0.595, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.415, !- Electric Power Minimum Flow Rate Fraction + 400, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1.0, !- Motor In Air Stream Fraction + 476, !- Design Electric Power Consumption {W} + , !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.5, !- Fan Total Efficiency + Fan Power Curve; !- Electric Power Function of Flow Fraction Curve Name + + Curve:Quartic, + Fan Power Curve , !- Name + 0.09, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.91, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 1.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type !- =========== ALL OBJECTS IN CLASS: COIL:COOLING:DX:VARIABLEREFRIGERANTFLOW:FLUIDTEMPERATURECONTROL =========== From 63196565209945f5565c6e5f2fc8629df2875d1f Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Mon, 15 Jul 2024 18:01:20 -0700 Subject: [PATCH 038/164] relax curve output range and fix min x Fan:SystemModel --- testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf b/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf index 3a82696c3c0..09900d222ef 100644 --- a/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf +++ b/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf @@ -575,10 +575,10 @@ 0, !- Coefficient3 x**2 0.91, !- Coefficient4 x**3 0, !- Coefficient5 x**4 - 0.0, !- Minimum Value of x + 0.6975, !- Minimum Value of x 1.0, !- Maximum Value of x 0.0, !- Minimum Curve Output - 1.0, !- Maximum Curve Output + 5.0, !- Maximum Curve Output Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type From 324f1fc796f7f6f7286920b3fe85faefa25ca809 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Tue, 16 Jul 2024 09:33:05 -0500 Subject: [PATCH 039/164] Space IV-Non-coincident 1 --- src/EnergyPlus/ZoneEquipmentManager.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 80cb482861e..7410d7ba8e9 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -1865,6 +1865,12 @@ void updateZoneSizingEndDay(DataSizing::ZoneSizingData &zsCalcSizing, } void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, DataSizing::ZoneSizingData const &zsCalcSizing) +{ + // Use this to set or override finalzonesizing data for non-coincident sizing + return; +} + +void updateZoneSizingEndZoneSizingCalc2(EnergyPlusData &state, DataSizing::ZoneSizingData &zsCalcSizing) { if (std::abs(zsCalcSizing.DesCoolLoad) <= 1.e-8) { ShowWarningError(state, format("Calculated design cooling load for zone={} is zero.", zsCalcSizing.ZoneName)); @@ -1960,10 +1966,6 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, DataSizing::ZoneS "flow calculations"); } } -} - -void updateZoneSizingEndZoneSizingCalc2(EnergyPlusData &state, DataSizing::ZoneSizingData &zsCalcSizing) -{ zsCalcSizing.HeatPeakDateHrMin = zsCalcSizing.cHeatDDDate + ' ' + sizingPeakTimeStamp(state, zsCalcSizing.TimeStepNumAtHeatMax); zsCalcSizing.CoolPeakDateHrMin = zsCalcSizing.cCoolDDDate + ' ' + sizingPeakTimeStamp(state, zsCalcSizing.TimeStepNumAtCoolMax); From 79a0810cd1bdbac5be8e46045d98910f7dbb1cbe Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 17 Jul 2024 10:24:50 -0700 Subject: [PATCH 040/164] transition code Fan:VariableVolume to Fan:SystemModel --- .../CreateNewIDFUsingRulesV24_2_0.f90 | 156 ++++++++++++++++++ .../InputRulesFiles/Rules24-1-0-to-24-2-0.md | 8 + 2 files changed, 164 insertions(+) diff --git a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 index 78900861161..9fc4ceeb14a 100644 --- a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 @@ -124,6 +124,40 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile ! I N S E R T L O C A L V A R I A B L E S H E R E ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! used in transition code for changing fan in ZoneHVAC:TerminalUnit:VariableRefrigerantFlow from VariableVolume to SystemModel + LOGICAL :: isVariableVolume + REAL :: fanTotalEff + REAL :: pressureRise + REAL :: maxAirFlow + REAL :: minAirFlowFrac + REAL :: fanPowerMinAirFlow + INTEGER :: NumFanVariableVolume = 0 + INTEGER :: NumOldFanVO = 0 + INTEGER :: Num3 + CHARACTER(len=MaxNameLength) :: sysFanName + CHARACTER(len=MaxNameLength) :: vavFanName + + TYPE FanVOTransitionInfo + CHARACTER(len=MaxNameLength) :: oldFanName + CHARACTER(len=MaxNameLength) :: availSchedule + CHARACTER(len=MaxNameLength) :: fanTotalEff_str + CHARACTER(len=MaxNameLength) :: pressureRise_str + CHARACTER(len=MaxNameLength) :: maxAirFlow_str + CHARACTER(len=MaxNameLength) :: minFlowInputMethod + CHARACTER(len=MaxNameLength) :: minAirFlowFrac_str + CHARACTER(len=MaxNameLength) :: fanPowerMinAirFlow_str + CHARACTER(len=MaxNameLength) :: motorEfficiency + CHARACTER(len=MaxNameLength) :: motorInAirStreamFrac + CHARACTER(len=MaxNameLength) :: coeff1 !- Coefficient1 Constant + CHARACTER(len=MaxNameLength) :: coeff2 !- Coefficient2 x + CHARACTER(len=MaxNameLength) :: coeff3 !- Coefficient3 x**2 + CHARACTER(len=MaxNameLength) :: coeff4 !- Coefficient4 x**3 + CHARACTER(len=MaxNameLength) :: coeff5 !- Coefficient5 x**4 + CHARACTER(len=MaxNameLength) :: inletAirNodeName + CHARACTER(len=MaxNameLength) :: outletAirNodeName + CHARACTER(len=MaxNameLength) :: endUseSubCat + END TYPE FanVOTransitionInfo + TYPE(FanVOTransitionInfo), ALLOCATABLE, DIMENSION(:) :: OldFanVO INTEGER :: TotSPMs = 0 INTEGER :: spmNum = 0 @@ -317,6 +351,37 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile ENDDO ENDDO + ! accumulate info on VAV fans + NumFanVariableVolume = GetNumObjectsFound('FAN:VARIABLEVOLUME') + IF (ALLOCATED(OldFanVO)) DEALLOCATE(OldFanVO) + ALLOCATE(OldFanVO(NumFanVariableVolume)) + NumOldFanVO = 0 + DO Num = 1, NumIDFRecords + SELECT CASE (MakeUPPERCase(IDFRecords(Num)%Name)) + CASE ('FAN:VARIABLEVOLUME') + NumOldFanVO = NumOldFanVO + 1 + ! debug print + PRINT *, "Alphas", TRIM(IDFRecords(Num)%Alphas(1)), TRIM(IDFRecords(Num)%Alphas(6)) + OldFanVO(NumOldFanVO)%oldFanName = TRIM(IDFRecords(Num)%Alphas(1)) + OldFanVO(NumOldFanVO)%availSchedule = TRIM(IDFRecords(Num)%Alphas(2)) + OldFanVO(NumOldFanVO)%fanTotalEff_str = TRIM(IDFRecords(Num)%Numbers(1)) + OldFanVO(NumOldFanVO)%pressureRise_str = TRIM(IDFRecords(Num)%Numbers(2)) + OldFanVO(NumOldFanVO)%maxAirFlow_str = TRIM(IDFRecords(Num)%Numbers(3)) + OldFanVO(NumOldFanVO)%minFlowInputMethod = TRIM(IDFRecords(Num)%Alphas(3)) + OldFanVO(NumOldFanVO)%minAirFlowFrac_str = TRIM(IDFRecords(Num)%Numbers(4)) + OldFanVO(NumOldFanVO)%fanPowerMinAirFlow_str = TRIM(IDFRecords(Num)%Numbers(5)) + OldFanVO(NumOldFanVO)%motorEfficiency = TRIM(IDFRecords(Num)%Numbers(6)) + OldFanVO(NumOldFanVO)%motorInAirStreamFrac = TRIM(IDFRecords(Num)%Numbers(7)) + OldFanVO(NumOldFanVO)%coeff1 = TRIM(IDFRecords(Num)%Numbers(8)) !- Coefficient1 Constant + OldFanVO(NumOldFanVO)%coeff2 = TRIM(IDFRecords(Num)%Numbers(9)) !- Coefficient2 x + OldFanVO(NumOldFanVO)%coeff3 = TRIM(IDFRecords(Num)%Numbers(10)) !- Coefficient3 x**2 + OldFanVO(NumOldFanVO)%coeff4 = TRIM(IDFRecords(Num)%Numbers(11)) !- Coefficient4 x**3 + OldFanVO(NumOldFanVO)%coeff5 = TRIM(IDFRecords(Num)%Numbers(12)) !- Coefficient5 x**4 + OldFanVO(NumOldFanVO)%inletAirNodeName = TRIM(IDFRecords(Num)%Alphas(4)) + OldFanVO(NumOldFanVO)%outletAirNodeName = TRIM(IDFRecords(Num)%Alphas(5)) + OldFanVO(NumOldFanVO)%endUseSubCat = TRIM(IDFRecords(Num)%Alphas(6)) + END SELECT + END DO !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! P R O C E S S I N G ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -485,6 +550,97 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile ! If your original object starts with Z, insert the rules here +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + CASE('ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW') + isVariableVolume = .FALSE. + CALL GetNewObjectDefInIDD(ObjectName, NwNumArgs, NwAorN, NwReqFld, NwObjMinFlds, NwFldNames, NwFldDefaults, NwFldUnits) + nodiff = .false. + OutArgs(1:13) = InArgs(1:13) + IF (SameString(InArgs(14), 'FAN:VARIABLEVOLUME')) THEN + isVariableVolume = .TRUE. + OutArgs(14) = 'FAN:SYSTEMMODEL' + ! create a new fan object with a new name + OutArgs(15) = TRIM(InArgs(15)) // '_sysModel' + sysFanName = TRIM(InArgs(15)) // '_sysModel' + vavFanName = TRIM(InArgs(15)) + ELSE + OutArgs(14:15) = InArgs(14:15) + ENDIF + OutArgs(16:CurArgs) = InArgs(16:CurArgs) + CALL WriteOutIDFLines(DifLfn, 'ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW', CurArgs, OutArgs, NwFldNames, NwFldUnits) + + IF (isVariableVolume) THEN + ! create fan system model object + ObjectName = 'Fan:SystemModel' + DO Num3 = 1, NumFanVariableVolume + IF (SameString(OldFanVO(Num3)%oldFanName, vavFanName)) THEN + CALL GetNewObjectDefInIDD(ObjectName, NwNumArgs, NwAorN, NwReqFld, NwObjMinFlds, NwFldNames, NwFldDefaults, NwFldUnits) + OutArgs(1) = TRIM(sysFanName) + OutArgs(2) = OldFanVO(Num3)%availSchedule + OutArgs(3) = OldFanVO(Num3)%inletAirNodeName + OutArgs(4) = OldFanVO(Num3)%outletAirNodeName + OutArgs(5) = OldFanVO(Num3)%maxAirFlow_str + OutArgs(6) = 'Continuous' !- Speed Control Method + IF (SameString(OldFanVO(Num3)%minFlowInputMethod, "FixedFlowRate")) THEN + OutArgs(7) = OldFanVO(Num3)%maxAirFlow_str + ELSE ! input method is "Fraction" + READ(OldFanVO(Num3)%minAirFlowFrac_str, '(F15.5)') minAirFlowFrac + IF (minAirFlowFrac == 0.0) THEN + OutArgs(7) = '0.0' + ELSE + IF (.NOT. SameString(OldFanVO(Num3)%maxAirFlow_str, "AUTOSIZE")) THEN + READ(OldFanVO(Num3)%maxAirFlow_str, '(F15.5)') maxAirFlow + WRITE(OutArgs(7), '(F15.5)') (maxAirFlow * minAirFlowFrac) + ELSE ! don't know how to multiply fraction with autosize + OutArgs(7) = '' + ENDIF + ENDIF + ENDIF + OutArgs(8) = OldFanVO(Num3)%pressureRise_str !- Design Pressure Rise {Pa} + OutArgs(9) = OldFanVO(Num3)%motorEfficiency !- Motor Efficiency + OutArgs(10) = OldFanVO(Num3)%motorInAirStreamFrac !- Motor In Air Stream Fraction + IF (.NOT. SameString(OldFanVO(Num3)%maxAirFlow_str, "AUTOSIZE")) THEN + READ(OldFanVO(Num3)%maxAirFlow_str, '(F15.5)') maxAirFlow + READ(OldFanVO(Num3)%pressureRise_str, '(F15.5)') pressureRise + READ(OldFanVO(Num3)%fanTotalEff_str, '(F15.5)') fanTotalEff + WRITE(OutArgs(11), '(F15.5)') (maxAirFlow * pressureRise / fanTotalEff) !- Design Electric Power Consumption {W} + ELSE + OutArgs(11) = 'autosize' + OutArgs(12) = 'TotalEfficiencyAndPressure' ! chose this becuase power per flow or per pressure are unknown + ENDIF + OutArgs(13) = '' !- Electric Power Per Unit Flow Rate {W/(m3/s)} + OutArgs(14) = '' !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + OutArgs(15) = OldFanVO(Num3)%fanTotalEff_str !- Fan Total Efficiency + OutArgs(16) = TRIM(sysFanName) // '_curve' !- Electric Power Function of Flow Fraction Curve Name + OutArgs(17) = '' + OutArgs(18) = '' + OutArgs(19) = '' + OutArgs(20) = '' + OutArgs(21) = OldFanVO(Num3)%endUseSubCat !- End-Use Subcategory + CurArgs = 21 !- Design Electric Power Consumption {W} + CALL WriteOutIDFLines(DifLfn, ObjectName, CurArgs, OutArgs, NwFldNames, NwFldUnits) + + ! create curve object + ObjectName = 'Curve:Quartic' + CALL GetNewObjectDefInIDD(ObjectName, NwNumArgs, NwAorN, NwReqFld, NwObjMinFlds, NwFldNames, NwFldDefaults, NwFldUnits) + OutArgs(1) = TRIM(sysFanName) // '_curve' + OutArgs(2) = OldFanVO(Num3)%coeff1 !- Coefficient1 Constant + OutArgs(3) = OldFanVO(Num3)%coeff2 !- Coefficient2 x + OutArgs(4) = OldFanVO(Num3)%coeff3 !- Coefficient3 x**2 + OutArgs(5) = OldFanVO(Num3)%coeff4 !- Coefficient4 x**3 + OutArgs(6) = OldFanVO(Num3)%coeff5 !- Coefficient5 x**4 + READ(OldFanVO(Num3)%fanPowerMinAirFlow_str, '(F15.5)') fanPowerMinAirFlow + WRITE(OutArgs(7), '(F10.7)') (fanPowerMinAirFlow / maxAirFlow) !- Minimum Value of x + OutArgs(8) = '1.0' !- Maximum Value of x + OutArgs(9) = '0.0' !- Minimum Curve Output + OutArgs(10) = '5.0' !- Maximum Curve Output + OutArgs(11) = 'Dimensionless' !- Input Unit Type for X + OutArgs(12) = 'Dimensionless' !- Output Unit Type + CurArgs = 12 + ENDIF + ENDDO + ENDIF + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! Changes for report variables, meters, tables -- update names ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md b/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md index dd4cf24cda0..073f46274a4 100644 --- a/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md +++ b/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md @@ -73,3 +73,11 @@ There are three new optional heat recovery fields at the end which transition wi # Object Change: ObjectStartsWithY # Object Change: ObjectStartsWithZ +## "ZoneHVAC:TerminalUnit:VariableRefrigerantFlow" +If field "Supply Air Fan Object Type" (A7, the 14th field) in +"ZoneHVAC:TerminalUnit:VariableRefrigerantFlow" is "Fan:VariableVolume", it +needs to be changed to "Fan:SystemModel". A "Fan:SystemModel" object need to be +created based on the former "Fan:VariableVolume" object. A fan power curve will +be created as well that holds the "Fan Power Coefficient i" in Fan:VariableVolume. + +See PR https://github.com/NREL/EnergyPlus/pull/10341 From d614e021d37fc9a6625e9a8dbd9bcf4674d57608 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Wed, 17 Jul 2024 12:28:16 -0500 Subject: [PATCH 041/164] Alter arg type for error message to be enum category --- src/EnergyPlus/UtilityRoutines.cc | 18 +++++++++-------- src/EnergyPlus/UtilityRoutines.hh | 32 +++++++++++++++++++++++++++---- 2 files changed, 38 insertions(+), 12 deletions(-) diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc index 0bc9d71a941..57c40b441ee 100644 --- a/src/EnergyPlus/UtilityRoutines.cc +++ b/src/EnergyPlus/UtilityRoutines.cc @@ -866,18 +866,19 @@ bool env_var_on(std::string const &env_var_str) return ((!env_var_str.empty()) && is_any_of(env_var_str[0], "YyTt")); } -void emitErrorMessage(EnergyPlusData &state, int idOne, std::string const &msg, bool shouldFatal) +void emitErrorMessage(EnergyPlusData &state, [[maybe_unused]] ErrorMessageCategory category, std::string const &msg, bool shouldFatal) { - (void)idOne; if (!shouldFatal) { ShowSevereError(state, msg); } else { // should fatal ShowFatalError(state, msg); } } -void emitErrorMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs, bool shouldFatal) +void emitErrorMessages(EnergyPlusData &state, + [[maybe_unused]] ErrorMessageCategory category, + std::initializer_list const &msgs, + bool shouldFatal) { - (void)idOne; for (auto msg = msgs.begin(); msg != msgs.end(); ++msg) { if (msg == msgs.begin()) { ShowSevereError(state, *msg); @@ -888,18 +889,19 @@ void emitErrorMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs, bool const countAsError) +void emitWarningMessages(EnergyPlusData &state, + [[maybe_unused]] ErrorMessageCategory category, + std::initializer_list const &msgs, + bool const countAsError) { - (void)idOne; for (auto msg = msgs.begin(); msg != msgs.end(); ++msg) { if (msg == msgs.begin()) { if (countAsError) { // ideally this path goes away and we just have distinct warnings and errors diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index 29ef3e4335e..e08fe31d4eb 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -132,10 +132,34 @@ bool env_var_on(std::string const &env_var_str); using OptionalOutputFileRef = std::optional>; -void emitErrorMessage(EnergyPlusData &state, int idOne, std::string const &msg, bool shouldFatal); -void emitErrorMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs, bool shouldFatal); -void emitWarningMessage(EnergyPlusData &state, int idOne, std::string const &msg, bool countAsError = false); -void emitWarningMessages(EnergyPlusData &state, int idOne, std::initializer_list const &msgs, bool countAsError = false); +enum class ErrorMessageCategory +{ + Invalid = -1, + Unclassified, + Input_invalid, + Input_field_not_found, + Input_field_blank, + Input_object_not_found, + Input_cannot_find_object, + Input_topology_problem, + Input_unused, + Input_fatal, + Runtime_general, + Runtime_flow_out_of_range, + Runtime_temp_out_of_range, + Runtime_airflow_network, + Fatal_general, + Developer_general, + Developer_invalid_index, + Num +}; +void emitErrorMessage(EnergyPlusData &state, ErrorMessageCategory category, std::string const &msg, bool shouldFatal); +void emitErrorMessages(EnergyPlusData &state, ErrorMessageCategory category, std::initializer_list const &msgs, bool shouldFatal); +void emitWarningMessage(EnergyPlusData &state, ErrorMessageCategory category, std::string const &msg, bool countAsError = false); +void emitWarningMessages(EnergyPlusData &state, + ErrorMessageCategory category, + std::initializer_list const &msgs, + bool countAsError = false); void ShowFatalError(EnergyPlusData &state, std::string const &ErrorMessage, OptionalOutputFileRef OutUnit1 = {}, OptionalOutputFileRef OutUnit2 = {}); From 289d5cc4642f0d7c04c52ea817423bc86e9b58d6 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 17 Jul 2024 14:44:32 -0700 Subject: [PATCH 042/164] update idd and doc to remove vav fan Fan:VariableVolume is not allowed in the ZoneHVAC:TerminalUnit:VariableRefrigerantFlow any more. The previous VariableVolume one used in the FluidTCtrl model is converted to Fan:SystemModel --- .../src/overview/group-zone-forced-air-units.tex | 2 +- idd/Energy+.idd.in | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-zone-forced-air-units.tex b/doc/input-output-reference/src/overview/group-zone-forced-air-units.tex index 2daad751ecc..43f2e9f2f5e 100644 --- a/doc/input-output-reference/src/overview/group-zone-forced-air-units.tex +++ b/doc/input-output-reference/src/overview/group-zone-forced-air-units.tex @@ -4060,7 +4060,7 @@ \subsubsection{Inputs}\label{inputs-14-018} \paragraph{Field: Supply Air Fan Object Type}\label{field-supply-air-fan-object-type-8} -This choice field contains the identifying type of supply air fan specified for the furnace. Fan type must be \textit{\hyperref[fanonoff]{Fan:OnOff}}, \textit{\hyperref[fanconstantvolume]{Fan:ConstantVolume}}, \textit{\hyperref[fansystemmodel]{Fan:SystemModel}} or \textit{\hyperref[fanvariablevolume]{Fan:VariableVolume}}. The Supply Air Fan Object Type must be \hyperref[fansystemmodel]{Fan:SystemModel}, \hyperref[fanonoff]{Fan:OnOff}, or \hyperref[fanconstantvolume]{Fan:ConstantVolume} if \hyperref[airconditionervariablerefrigerantflow]{AirConditioner:VariableRefrigerantFlow} is used to model the VRF outdoor unit. The Supply Air Fan Object Type must be \hyperref[fansystemmodel]{Fan:SystemModel} or \hyperref[fanvariablevolume]{Fan:VariableVolume} if AirConditioner:VariableRefrigerantFlow:\-FluidTemperatureControl or AirConditioner:VariableRefrigerantFlow:\-FluidTemperatureControl:HR is used to model the VRF outdoor unit. +This choice field contains the identifying type of supply air fan specified for the furnace. Fan type must be \textit{\hyperref[fanonoff]{Fan:OnOff}}, \textit{\hyperref[fanconstantvolume]{Fan:ConstantVolume}}, \textit{\hyperref[fansystemmodel]{Fan:SystemModel}}. The Supply Air Fan Object Type must be \hyperref[fansystemmodel]{Fan:SystemModel}, \hyperref[fanonoff]{Fan:OnOff}, or \hyperref[fanconstantvolume]{Fan:ConstantVolume} if \hyperref[airconditionervariablerefrigerantflow]{AirConditioner:VariableRefrigerantFlow} is used to model the VRF outdoor unit. The Supply Air Fan Object Type must be \hyperref[fansystemmodel]{Fan:SystemModel} if AirConditioner:VariableRefrigerantFlow:\-FluidTemperatureControl or AirConditioner:VariableRefrigerantFlow:\-FluidTemperatureControl:HR is used to model the VRF outdoor unit. \hyperref[fanconstantvolume]{Fan:ConstantVolume} is used when the Supply Air Fan Operating Mode Schedule values are never 0 and the fan operates continuously. \hyperref[fanonoff]{Fan:OnOff} is used when the fan cycles on and off with the cooling or heating coil (i.e.~Supply Air Fan Operating Mode Schedule values are at times 0). The \hyperref[fansystemmodel]{Fan:SystemModel} may be used to model either of these fan operating characteristics. diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 0193d450215..8ecca331289 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -42464,11 +42464,10 @@ ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, \key Fan:SystemModel \key Fan:OnOff \key Fan:ConstantVolume - \key Fan:VariableVolume \default Fan:ConstantVolume \note Supply Air Fan Object Type must be Fan:SystemModel, Fan:OnOff, or Fan:ConstantVolume \note if AirConditioner:VariableRefrigerantFlow is used to model VRF outdoor unit - \note Supply Air Fan Object Type must be Fan:SystemModel or Fan:VariableVolume if + \note Supply Air Fan Object Type must be Fan:SystemModel if \note AirConditioner:VariableRefrigerantFlow:FluidTemperatureControl or \note AirConditioner:VariableRefrigerantFlow:FluidTemperatureControl:HR \note is used to model VRF outdoor unit From 4f6b6777e65b25497972eeec9469674ba9edb1c9 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Wed, 17 Jul 2024 17:32:17 -0500 Subject: [PATCH 043/164] Space IV-Non-coincident 2 --- src/EnergyPlus/ZoneEquipmentManager.cc | 221 +++++++++++++++++++++++-- src/EnergyPlus/ZoneEquipmentManager.hh | 2 +- 2 files changed, 211 insertions(+), 12 deletions(-) diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 7410d7ba8e9..997ce4ab31d 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -1864,9 +1864,212 @@ void updateZoneSizingEndDay(DataSizing::ZoneSizingData &zsCalcSizing, } } -void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, DataSizing::ZoneSizingData const &zsCalcSizing) +void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum) { - // Use this to set or override finalzonesizing data for non-coincident sizing + // Set or override finalzonesizing data for non-coincident sizing + auto &zoneCFS = state.dataSize->CalcFinalZoneSizing(zoneNum); + if (zoneCFS.spaceConcurrence == DataSizing::SizingConcurrence::Coincident) return; + // Zero out simple sums and averages + zoneCFS.DesHeatVolFlow = 0.0; + zoneCFS.DesHeatLoad = 0.0; + zoneCFS.DesHeatMassFlow = 0.0; + zoneCFS.DesHeatLoadNoDOAS = 0.0; + zoneCFS.DesCoolVolFlow = 0.0; + zoneCFS.DesCoolLoad = 0.0; + zoneCFS.DesCoolMassFlow = 0.0; + zoneCFS.DesCoolLoadNoDOAS = 0.0; + + // Weighted averages + zoneCFS.DesHeatDens = 0.0; + zoneCFS.ZoneTempAtHeatPeak = 0.0; + zoneCFS.OutTempAtHeatPeak = 0.0; + zoneCFS.ZoneRetTempAtHeatPeak = 0.0; + zoneCFS.ZoneHumRatAtHeatPeak = 0.0; + zoneCFS.OutHumRatAtHeatPeak = 0.0; + zoneCFS.DesHeatCoilInTemp = 0.0; + zoneCFS.DesHeatCoilInHumRat = 0.0; + zoneCFS.DesCoolDens = 0.0; + zoneCFS.ZoneTempAtCoolPeak = 0.0; + zoneCFS.OutTempAtCoolPeak = 0.0; + zoneCFS.ZoneRetTempAtCoolPeak = 0.0; + zoneCFS.ZoneHumRatAtCoolPeak = 0.0; + zoneCFS.OutHumRatAtCoolPeak = 0.0; + zoneCFS.DesCoolCoilInTemp = 0.0; + zoneCFS.DesCoolCoilInHumRat = 0.0; + + // Zero out ime-series sums + for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { + zoneCFS.HeatFlowSeq(ts) = 0.0; + zoneCFS.HeatLoadSeq(ts) = 0.0; + zoneCFS.HeatZoneTempSeq(ts) = 0.0; + zoneCFS.HeatOutTempSeq(ts) = 0.0; + zoneCFS.HeatZoneRetTempSeq(ts) = 0.0; + zoneCFS.HeatZoneHumRatSeq(ts) = 0.0; + zoneCFS.HeatOutHumRatSeq(ts) = 0.0; + zoneCFS.HeatLoadNoDOASSeq(ts) = 0.0; + zoneCFS.CoolFlowSeq(ts) = 0.0; + zoneCFS.CoolLoadSeq(ts) = 0.0; + zoneCFS.CoolZoneTempSeq(ts) = 0.0; + zoneCFS.CoolOutTempSeq(ts) = 0.0; + zoneCFS.CoolZoneRetTempSeq(ts) = 0.0; + zoneCFS.CoolZoneHumRatSeq(ts) = 0.0; + zoneCFS.CoolOutHumRatSeq(ts) = 0.0; + zoneCFS.CoolLoadNoDOASSeq(ts) = 0.0; + } + if (zoneCFS.zoneLatentSizing) { + // Simple sums + zoneCFS.DesLatentHeatVolFlow = 0.0; + zoneCFS.DesLatentHeatMassFlow = 0.0; + zoneCFS.DesLatentHeatLoad = 0.0; + zoneCFS.DesLatentHeatLoadNoDOAS = 0.0; + zoneCFS.DesLatentCoolVolFlow = 0.0; + zoneCFS.DesLatentCoolMassFlow = 0.0; + zoneCFS.DesLatentCoolLoad = 0.0; + zoneCFS.DesLatentCoolLoadNoDOAS = 0.0; + + // Weighted averages + zoneCFS.ZoneTempAtLatentHeatPeak = 0.0; + zoneCFS.ZoneHumRatAtLatentHeatPeak = 0.0; + zoneCFS.ZoneRetTempAtLatentHeatPeak = 0.0; + zoneCFS.DesLatentHeatCoilInTemp = 0.0; + zoneCFS.DesLatentHeatCoilInHumRat = 0.0; + zoneCFS.ZoneTempAtLatentCoolPeak = 0.0; + zoneCFS.ZoneHumRatAtLatentCoolPeak = 0.0; + zoneCFS.ZoneRetTempAtLatentCoolPeak = 0.0; + zoneCFS.DesLatentCoolCoilInTemp = 0.0; + zoneCFS.DesLatentCoolCoilInHumRat = 0.0; + + // Time-series sums + for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { + zoneCFS.LatentHeatLoadSeq(ts) = 0.0; + zoneCFS.LatentHeatFlowSeq(ts) = 0.0; + zoneCFS.HeatLatentLoadNoDOASSeq(ts) = 0.0; + zoneCFS.LatentCoolLoadSeq(ts) = 0.0; + zoneCFS.LatentCoolFlowSeq(ts) = 0.0; + zoneCFS.CoolLatentLoadNoDOASSeq(ts) = 0.0; + } + } + + int numSpaces = 0; // Track this for averages later + for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) { + auto &spaceCFS = state.dataSize->CalcFinalSpaceSizing(spaceNum); + if (!state.dataZoneEquip->spaceEquipConfig(spaceNum).IsControlled) continue; + ++numSpaces; + + // Simple sums + zoneCFS.DesHeatVolFlow += spaceCFS.DesHeatVolFlow; + zoneCFS.DesHeatLoad += spaceCFS.DesHeatLoad; + zoneCFS.DesHeatMassFlow += spaceCFS.DesHeatMassFlow; + zoneCFS.DesHeatLoadNoDOAS += spaceCFS.DesHeatLoadNoDOAS; + zoneCFS.DesCoolVolFlow += spaceCFS.DesCoolVolFlow; + zoneCFS.DesCoolLoad += spaceCFS.DesCoolLoad; + zoneCFS.DesCoolMassFlow += spaceCFS.DesCoolMassFlow; + zoneCFS.DesCoolLoadNoDOAS += spaceCFS.DesCoolLoadNoDOAS; + + // Weighted averages + zoneCFS.DesHeatDens += spaceCFS.DesHeatDens; + zoneCFS.ZoneTempAtHeatPeak += spaceCFS.ZoneTempAtHeatPeak; + zoneCFS.OutTempAtHeatPeak += spaceCFS.OutTempAtHeatPeak; + zoneCFS.ZoneRetTempAtHeatPeak += spaceCFS.ZoneRetTempAtHeatPeak; + zoneCFS.ZoneHumRatAtHeatPeak += spaceCFS.ZoneHumRatAtHeatPeak; + zoneCFS.OutHumRatAtHeatPeak += spaceCFS.OutHumRatAtHeatPeak; + zoneCFS.DesHeatCoilInTemp += spaceCFS.DesHeatCoilInTemp; + zoneCFS.DesHeatCoilInHumRat += spaceCFS.DesHeatCoilInHumRat; + zoneCFS.DesCoolDens += spaceCFS.DesCoolDens; + zoneCFS.ZoneTempAtCoolPeak += spaceCFS.ZoneTempAtCoolPeak; + zoneCFS.OutTempAtCoolPeak += spaceCFS.OutTempAtCoolPeak; + zoneCFS.ZoneRetTempAtCoolPeak += spaceCFS.ZoneRetTempAtCoolPeak; + zoneCFS.ZoneHumRatAtCoolPeak += spaceCFS.ZoneHumRatAtCoolPeak; + zoneCFS.OutHumRatAtCoolPeak += spaceCFS.OutHumRatAtCoolPeak; + zoneCFS.DesCoolCoilInTemp += spaceCFS.DesCoolCoilInTemp; + zoneCFS.DesCoolCoilInHumRat += spaceCFS.DesCoolCoilInHumRat; + + // Time-series sums + for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { + zoneCFS.HeatFlowSeq(ts) += spaceCFS.HeatFlowSeq(ts); + zoneCFS.HeatLoadSeq(ts) += spaceCFS.HeatLoadSeq(ts); + zoneCFS.HeatZoneTempSeq(ts) += spaceCFS.HeatZoneTempSeq(ts); + zoneCFS.HeatOutTempSeq(ts) += spaceCFS.HeatOutTempSeq(ts); + zoneCFS.HeatZoneRetTempSeq(ts) += spaceCFS.HeatZoneRetTempSeq(ts); + zoneCFS.HeatZoneHumRatSeq(ts) += spaceCFS.HeatZoneHumRatSeq(ts); + zoneCFS.HeatOutHumRatSeq(ts) += spaceCFS.HeatOutHumRatSeq(ts); + zoneCFS.HeatLoadNoDOASSeq(ts) += spaceCFS.HeatLoadNoDOASSeq(ts); + zoneCFS.CoolFlowSeq(ts) += spaceCFS.CoolFlowSeq(ts); + zoneCFS.CoolLoadSeq(ts) += spaceCFS.CoolLoadSeq(ts); + zoneCFS.CoolZoneTempSeq(ts) += spaceCFS.CoolZoneTempSeq(ts); + zoneCFS.CoolOutTempSeq(ts) += spaceCFS.CoolOutTempSeq(ts); + zoneCFS.CoolZoneRetTempSeq(ts) += spaceCFS.CoolZoneRetTempSeq(ts); + zoneCFS.CoolZoneHumRatSeq(ts) += spaceCFS.CoolZoneHumRatSeq(ts); + zoneCFS.CoolOutHumRatSeq(ts) += spaceCFS.CoolOutHumRatSeq(ts); + zoneCFS.CoolLoadNoDOASSeq(ts) += spaceCFS.CoolLoadNoDOASSeq(ts); + } + + // Other + // zoneCFS.HeatDesDay = spaceCFS.HeatDesDay; + // zoneCFS.HeatDDNum = spaceCFS.HeatDDNum; + // zoneCFS.cHeatDDDate = desDayWeath.DateString; + // zoneCFS.TimeStepNumAtHeatMax = spaceCFS.TimeStepNumAtHeatMax; + // zoneCFS.HeatNoDOASDDNum = spaceCFS.HeatNoDOASDDNum; + // zoneCFS.HeatNoDOASDesDay = spaceCFS.HeatNoDOASDesDay; + // zoneCFS.TimeStepNumAtHeatNoDOASMax = spaceCFS.TimeStepNumAtHeatNoDOASMax; + // zoneCFS.LatentHeatNoDOASDDNum = spaceCFS.LatentHeatNoDOASDDNum; + // zoneCFS.LatHeatNoDOASDesDay = spaceCFS.LatHeatNoDOASDesDay; + // zoneCFS.TimeStepNumAtLatentHeatNoDOASMax = spaceCFS.TimeStepNumAtLatentHeatNoDOASMax; + // zoneCFS.CoolDesDay = spaceCFS.CoolDesDay; + // zoneCFS.CoolDDNum = spaceCFS.CoolDDNum; + // zoneCFS.cCoolDDDate = desDayWeath.DateString; + // zoneCFS.TimeStepNumAtCoolMax = spaceCFS.TimeStepNumAtCoolMax; + + if (spaceCFS.zoneLatentSizing) { + // Simple sums + zoneCFS.DesLatentHeatVolFlow += spaceCFS.DesLatentHeatVolFlow; + zoneCFS.DesLatentHeatMassFlow += spaceCFS.ZoneHeatLatentMassFlow; + zoneCFS.DesLatentHeatLoad += spaceCFS.DesLatentHeatLoad; + zoneCFS.DesLatentHeatLoadNoDOAS += spaceCFS.DesLatentHeatLoadNoDOAS; + zoneCFS.DesLatentCoolVolFlow += spaceCFS.DesLatentCoolVolFlow; + zoneCFS.DesLatentCoolMassFlow += spaceCFS.DesLatentCoolMassFlow; + zoneCFS.DesLatentCoolLoad += spaceCFS.DesLatentCoolLoad; + zoneCFS.DesLatentCoolLoadNoDOAS += spaceCFS.DesLatentCoolLoadNoDOAS; + + // Weighted averages + zoneCFS.ZoneTempAtLatentHeatPeak += spaceCFS.ZoneTempAtLatentHeatPeak; + zoneCFS.ZoneHumRatAtLatentHeatPeak += spaceCFS.ZoneHumRatAtLatentHeatPeak; + zoneCFS.ZoneRetTempAtLatentHeatPeak += spaceCFS.ZoneRetTempAtLatentHeatPeak; + zoneCFS.DesLatentHeatCoilInTemp += spaceCFS.DesLatentHeatCoilInTemp; + zoneCFS.DesLatentHeatCoilInHumRat += spaceCFS.DesLatentHeatCoilInHumRat; + zoneCFS.ZoneTempAtLatentCoolPeak += spaceCFS.ZoneTempAtLatentCoolPeak; + zoneCFS.ZoneHumRatAtLatentCoolPeak += spaceCFS.ZoneHumRatAtLatentCoolPeak; + zoneCFS.ZoneRetTempAtLatentCoolPeak += spaceCFS.ZoneRetTempAtLatentCoolPeak; + zoneCFS.DesLatentCoolCoilInTemp += spaceCFS.DesLatentCoolCoilInTemp; + zoneCFS.DesLatentCoolCoilInHumRat += spaceCFS.DesLatentCoolCoilInHumRat; + + // Other + // zoneCFS.LatHeatDesDay = spaceCFS.LatHeatDesDay; + // zoneCFS.cLatentHeatDDDate = desDayWeath.DateString; + // zoneCFS.LatentHeatDDNum = spaceCFS.LatentHeatDDNum; + // zoneCFS.TimeStepNumAtLatentHeatMax = spaceCFS.TimeStepNumAtLatentHeatMax; + // zoneCFS.LatCoolDesDay = spaceCFS.LatCoolDesDay; + // zoneCFS.cLatentCoolDDDate = desDayWeath.DateString; + // zoneCFS.LatentCoolDDNum = spaceCFS.LatentCoolDDNum; + // zoneCFS.TimeStepNumAtLatentCoolMax = spaceCFS.TimeStepNumAtLatentCoolMax; + // zoneCFS.CoolNoDOASDDNum = spaceCFS.CoolNoDOASDDNum; + // zoneCFS.CoolNoDOASDesDay = spaceCFS.CoolNoDOASDesDay; + // zoneCFS.TimeStepNumAtCoolNoDOASMax = spaceCFS.TimeStepNumAtCoolNoDOASMax; + // zoneCFS.LatentCoolNoDOASDDNum = spaceCFS.LatentCoolNoDOASDDNum; + // zoneCFS.LatCoolNoDOASDesDay = spaceCFS.LatCoolNoDOASDesDay; + // zoneCFS.TimeStepNumAtLatentCoolNoDOASMax = spaceCFS.TimeStepNumAtLatentCoolNoDOASMax; + + // Time-series sums + for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { + zoneCFS.LatentHeatLoadSeq(ts) += spaceCFS.LatentHeatLoadSeq(ts); + zoneCFS.LatentHeatFlowSeq(ts) += spaceCFS.LatentHeatFlowSeq(ts); + zoneCFS.HeatLatentLoadNoDOASSeq(ts) += spaceCFS.HeatLatentLoadNoDOASSeq(ts); + zoneCFS.LatentCoolLoadSeq(ts) += spaceCFS.LatentCoolLoadSeq(ts); + zoneCFS.LatentCoolFlowSeq(ts) += spaceCFS.LatentCoolFlowSeq(ts); + zoneCFS.CoolLatentLoadNoDOASSeq(ts) += spaceCFS.CoolLatentLoadNoDOASSeq(ts); + } + } + } return; } @@ -2926,13 +3129,11 @@ void UpdateZoneSizing(EnergyPlusData &state, Constant::CallIndicator const CallI if (!state.dataGlobal->isPulseZoneSizing) { - for (int CtrlZoneNum = 1; CtrlZoneNum <= state.dataGlobal->NumOfZones; ++CtrlZoneNum) { - if (!state.dataZoneEquip->ZoneEquipConfig(CtrlZoneNum).IsControlled) continue; - updateZoneSizingEndZoneSizingCalc1(state, state.dataSize->CalcFinalZoneSizing(CtrlZoneNum)); - if (state.dataHeatBal->doSpaceHeatBalanceSizing) { - for (int spaceNum : state.dataHeatBal->Zone(CtrlZoneNum).spaceIndexes) { - updateZoneSizingEndZoneSizingCalc1(state, state.dataSize->CalcFinalSpaceSizing(spaceNum)); - } + // Apply non-coincident zone sizing - only if space sizing is active + if (state.dataHeatBal->doSpaceHeatBalanceSizing) { + for (int ctrlZoneNum = 1; ctrlZoneNum <= state.dataGlobal->NumOfZones; ++ctrlZoneNum) { + if (!state.dataZoneEquip->ZoneEquipConfig(ctrlZoneNum).IsControlled) continue; + updateZoneSizingEndZoneSizingCalc1(state, ctrlZoneNum); } } @@ -2960,9 +3161,7 @@ void UpdateZoneSizing(EnergyPlusData &state, Constant::CallIndicator const CallI state.dataSize->CalcFinalSpaceSizing, state.dataSize->CalcSpaceSizing); } - } - if (!state.dataGlobal->isPulseZoneSizing) { // Move sizing data into final sizing array according to sizing method for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { if (!state.dataZoneEquip->ZoneEquipConfig(zoneNum).IsControlled) continue; diff --git a/src/EnergyPlus/ZoneEquipmentManager.hh b/src/EnergyPlus/ZoneEquipmentManager.hh index 563cba75d07..25e10c8b2f2 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.hh +++ b/src/EnergyPlus/ZoneEquipmentManager.hh @@ -140,7 +140,7 @@ namespace ZoneEquipmentManager { DataSizing::DesDayWeathData const &desDayWeath, Real64 const stdRhoAir); - void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, DataSizing::ZoneSizingData const &zsCalcSizing); + void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum); void updateZoneSizingEndZoneSizingCalc2(EnergyPlusData &state, DataSizing::ZoneSizingData &zsCalcSizing); From 6e791434c07e09590fbf3b7a7084ca7f16320b52 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 17 Jul 2024 18:02:51 -0700 Subject: [PATCH 044/164] add transition to delete old VAV fan objects --- .../CreateNewIDFUsingRulesV24_2_0.f90 | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 index 9fc4ceeb14a..e158c7eac6b 100644 --- a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 @@ -131,11 +131,14 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile REAL :: maxAirFlow REAL :: minAirFlowFrac REAL :: fanPowerMinAirFlow - INTEGER :: NumFanVariableVolume = 0 - INTEGER :: NumOldFanVO = 0 - INTEGER :: Num3 + INTEGER :: NumFanVariableVolume + INTEGER :: NumOldFanVO = 1 + INTEGER :: NumVRFTU = 1 + INTEGER :: Num3 = 1 + INTEGER :: VRFTU_i = 1 CHARACTER(len=MaxNameLength) :: sysFanName CHARACTER(len=MaxNameLength) :: vavFanName + CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: vavFanNameToDelete TYPE FanVOTransitionInfo CHARACTER(len=MaxNameLength) :: oldFanName @@ -351,17 +354,30 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile ENDDO ENDDO + ! collect old VAV fans to be deleted + NumVRFTU = GetNumObjectsFound('ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW') + IF(ALLOCATED(vavFanNameToDelete)) DEALLOCATE(vavFanNameToDelete) + ALLOCATE(vavFanNameToDelete(NumVRFTU)) + DO Num = 1, NumIDFRecords + SELECT CASE (MakeUPPERCase(IDFRecords(Num)%Name)) + CASE('ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW') + IF (SameString(TRIM(IDFRecords(Num)%Alphas(7)), 'FAN:VARIABLEVOLUME')) THEN + vavFanNameToDelete(VRFTU_i) =TRIM(IDFRecords(Num)%Alphas(8)) + ELSE + vavFanNameToDelete(VRFTU_i) = '' + ENDIF + VRFTU_i = VRFTU_i + 1 + END SELECT + END DO + ! accumulate info on VAV fans NumFanVariableVolume = GetNumObjectsFound('FAN:VARIABLEVOLUME') IF (ALLOCATED(OldFanVO)) DEALLOCATE(OldFanVO) ALLOCATE(OldFanVO(NumFanVariableVolume)) - NumOldFanVO = 0 + NumOldFanVO = 1 DO Num = 1, NumIDFRecords SELECT CASE (MakeUPPERCase(IDFRecords(Num)%Name)) CASE ('FAN:VARIABLEVOLUME') - NumOldFanVO = NumOldFanVO + 1 - ! debug print - PRINT *, "Alphas", TRIM(IDFRecords(Num)%Alphas(1)), TRIM(IDFRecords(Num)%Alphas(6)) OldFanVO(NumOldFanVO)%oldFanName = TRIM(IDFRecords(Num)%Alphas(1)) OldFanVO(NumOldFanVO)%availSchedule = TRIM(IDFRecords(Num)%Alphas(2)) OldFanVO(NumOldFanVO)%fanTotalEff_str = TRIM(IDFRecords(Num)%Numbers(1)) @@ -380,8 +396,13 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile OldFanVO(NumOldFanVO)%inletAirNodeName = TRIM(IDFRecords(Num)%Alphas(4)) OldFanVO(NumOldFanVO)%outletAirNodeName = TRIM(IDFRecords(Num)%Alphas(5)) OldFanVO(NumOldFanVO)%endUseSubCat = TRIM(IDFRecords(Num)%Alphas(6)) + IF (FindItemInList(TRIM(IDFRecords(Num)%Alphas(1)), vavFanNameToDelete, NumVRFTU) /= 0) THEN + DeleteThisRecord(Num) = .TRUE. + ENDIF + NumOldFanVO = NumOldFanVO + 1 END SELECT END DO + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! P R O C E S S I N G ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! From f0a18f4051758dd1b71a9aafd2d5133ba2740c46 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 17 Jul 2024 18:08:40 -0700 Subject: [PATCH 045/164] Revert "change varname to fanRunTimeFraction, add comments to this arg" This reverts commit 1a07c51671bdd3b9b668a114e40efab4714f6016. --- src/EnergyPlus/Fans.cc | 14 +++++--------- src/EnergyPlus/Fans.hh | 24 +++++++++++------------- 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index e1a0ff5fae0..1e4a4c2f15c 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -104,9 +104,7 @@ void FanBase::simulate(EnergyPlusData &state, // the legacy speed ratio that was used with SimulateFanComponents. ObjexxFCL::Optional _pressureRise, // Pressure difference to use for DeltaPress, for rating DX coils at a ObjexxFCL::Optional _flowFraction, // when used, this directs the fan to set the flow at this flow fraction - ObjexxFCL::Optional - _fanRunTimeFraction, // This argument is only used in the variable volume fan in - // VRFFluidTCtrl model to control for fan cycling. Please do not use it in normal VAV model. + ObjexxFCL::Optional _onOffFanPartLoadFraction, // to control for cycling in VAV fan in VRFFluidTCtrl // different pressure without entire duct system ObjexxFCL::Optional _massFlowRate1, // Mass flow rate in operating mode 1 [kg/s] ObjexxFCL::Optional _runTimeFraction1, // Run time fraction in operating mode 1 @@ -142,7 +140,7 @@ void FanBase::simulate(EnergyPlusData &state, _thisFan->simulateConstant(state); } break; case HVAC::FanType::VAV: { - _thisFan->simulateVAV(state, _pressureRise, _fanRunTimeFraction); + _thisFan->simulateVAV(state, _pressureRise, _onOffFanPartLoadFraction); } break; case HVAC::FanType::OnOff: { _thisFan->simulateOnOff(state, _speedRatio); @@ -1716,9 +1714,7 @@ void FanComponent::simulateConstant(EnergyPlusData &state) void FanComponent::simulateVAV(EnergyPlusData &state, ObjexxFCL::Optional _pressureRise, - // This argument is only used in the variable volume fan in - // VRFFluidTCtrl model to control for fan cycling. Please do not use it in normal VAV model. - ObjexxFCL::Optional _fanRunTimeFraction) + ObjexxFCL::Optional _onOffFanPartLoadFraction) { // SUBROUTINE INFORMATION: @@ -1884,8 +1880,8 @@ void FanComponent::simulateVAV(EnergyPlusData &state, massFlowRateMaxAvail = 0.0; massFlowRateMinAvail = 0.0; } - if (present(_fanRunTimeFraction)) { - totalPower *= _fanRunTimeFraction; + if (present(_onOffFanPartLoadFraction)) { + totalPower *= _onOffFanPartLoadFraction; } } // FanComponent::SimVAV() diff --git a/src/EnergyPlus/Fans.hh b/src/EnergyPlus/Fans.hh index 411dd9093eb..fce7296764e 100644 --- a/src/EnergyPlus/Fans.hh +++ b/src/EnergyPlus/Fans.hh @@ -97,16 +97,15 @@ namespace Fans { virtual void init(EnergyPlusData &state) = 0; virtual void simulate(EnergyPlusData &state, bool const FirstHVACIteration, - ObjexxFCL::Optional speedRatio = _, // Flow fraction in operating mode 1 - ObjexxFCL::Optional pressureRise = _, // Pressure difference to use for DeltaPress - ObjexxFCL::Optional flowFraction = _, // Flow fraction in operating mode 1 - ObjexxFCL::Optional fanRuntimeFraction = 1.0, // This argument is only used in the variable volume fan in - // VRFFluidTCtrl model to control for fan cycling. Please do not use it in normal VAV model. - ObjexxFCL::Optional massFlowRate1 = _, // Mass flow rate in operating mode 1 [kg/s] - ObjexxFCL::Optional runTimeFraction1 = _, // Run time fraction in operating mode 1 - ObjexxFCL::Optional massFlowRate2 = _, // Mass flow rate in operating mode 2 [kg/s] - ObjexxFCL::Optional runTimeFraction2 = _, // Run time fraction in operating mode 2 - ObjexxFCL::Optional pressureRise2 = _ // Pressure difference to use for operating mode 2 + ObjexxFCL::Optional speedRatio = _, // Flow fraction in operating mode 1 + ObjexxFCL::Optional pressureRise = _, // Pressure difference to use for DeltaPress + ObjexxFCL::Optional flowFraction = _, // Flow fraction in operating mode 1 + ObjexxFCL::Optional onOffFanPartLoadFraction = 1.0, // to control for cycling in VAV fan in VRFFluidTCtrl + ObjexxFCL::Optional massFlowRate1 = _, // Mass flow rate in operating mode 1 [kg/s] + ObjexxFCL::Optional runTimeFraction1 = _, // Run time fraction in operating mode 1 + ObjexxFCL::Optional massFlowRate2 = _, // Mass flow rate in operating mode 2 [kg/s] + ObjexxFCL::Optional runTimeFraction2 = _, // Run time fraction in operating mode 2 + ObjexxFCL::Optional pressureRise2 = _ // Pressure difference to use for operating mode 2 ); virtual void update(EnergyPlusData &state) = 0; @@ -231,9 +230,8 @@ namespace Fans { void simulateVAV(EnergyPlusData &state, ObjexxFCL::Optional PressureRise = _, - // This argument is only used in the variable volume fan in - // VRFFluidTCtrl model to control for fan cycling. Please do not use it in normal VAV model. - ObjexxFCL::Optional fanRuntimeFraction = 1.0); + // to control for cycling in VAV fan in VRFFluidTCtrl + ObjexxFCL::Optional OnOffFanPartLoadFraction = 1.0); void simulateOnOff(EnergyPlusData &state, ObjexxFCL::Optional SpeedRatio = _); From b5fa9ea8ed4e826f36a363feef24a83f303689cd Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 17 Jul 2024 18:09:41 -0700 Subject: [PATCH 046/164] Revert "fix unit and integration tests from optional arg addition" This reverts commit 5bb21f0b853489ac315df1d16d35666107a9ea6d. --- src/EnergyPlus/Fans.cc | 4 +--- tst/EnergyPlus/unit/HVACFan.unit.cc | 30 ++++++++++++++--------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 1e4a4c2f15c..45da3b366f7 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -1880,9 +1880,7 @@ void FanComponent::simulateVAV(EnergyPlusData &state, massFlowRateMaxAvail = 0.0; massFlowRateMinAvail = 0.0; } - if (present(_onOffFanPartLoadFraction)) { - totalPower *= _onOffFanPartLoadFraction; - } + totalPower *= _onOffFanPartLoadFraction; } // FanComponent::SimVAV() void FanComponent::simulateOnOff(EnergyPlusData &state, ObjexxFCL::Optional _speedRatio) diff --git a/tst/EnergyPlus/unit/HVACFan.unit.cc b/tst/EnergyPlus/unit/HVACFan.unit.cc index 19d6712f71c..5303e1b3be6 100644 --- a/tst/EnergyPlus/unit/HVACFan.unit.cc +++ b/tst/EnergyPlus/unit/HVACFan.unit.cc @@ -345,7 +345,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc3) Real64 massFlow2 = designMassFlowRate; Real64 runTimeFrac1 = 0.5; Real64 runTimeFrac2 = 0.5; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); Real64 locFanElecPower = fanSystem->totalPower; Real64 locExpectPower = (runTimeFrac1 * 0.125 * 100.0) + (runTimeFrac2 * 1.0 * 100.0); EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -355,7 +355,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc3) massFlow2 = 0.75 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; // locExpectPower expect the same power as the previous case EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -365,7 +365,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc3) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; locExpectPower = fanSystem->designElecPower; // expect full power EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -375,13 +375,13 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc3) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 0.85; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; locExpectPower = 0.85 * fanSystem->designElecPower; // expect 85% of full power EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); // reverse the 1 and 2 arguments, expect the same result - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow2, runTimeFrac2, massFlow1, runTimeFrac1); + fanSystem->simulate(*state, false, _, _, _, massFlow2, runTimeFrac2, massFlow1, runTimeFrac1); locFanElecPower = fanSystem->totalPower; EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); } @@ -445,7 +445,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc4) Real64 massFlow2 = designMassFlowRate; Real64 runTimeFrac1 = 0.5; Real64 runTimeFrac2 = 0.5; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); Real64 locFanElecPower = fanSystem->totalPower; Real64 locExpectPower = (0.5 * pow(0.5, 3) + 0.5 * 1.0) * fanSystem->designElecPower; EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -455,7 +455,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc4) massFlow2 = 0.75 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; locExpectPower = pow(0.75, 3) * fanSystem->designElecPower; EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -465,7 +465,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc4) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; locExpectPower = fanSystem->designElecPower; // expect full power EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -475,7 +475,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_TwoSpeedFanPowerCalc4) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 0.85; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; locExpectPower = 0.85 * fanSystem->designElecPower; // expect 85% of full power EXPECT_NEAR(locFanElecPower, locExpectPower, 0.01); @@ -606,7 +606,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_noPowerFFlowCurve) Real64 massFlow2 = designMassFlowRate; Real64 runTimeFrac1 = 0.5; Real64 runTimeFrac2 = 0.5; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); Real64 locFanElecPower = fanSystem->totalPower; // uses flow weighted power calculation. 50% of time at 50% flow and 50% of time at 100% flow Real64 locExpectPower = (0.5 * 0.5 + 0.5 * 1.0) * fanSystem->designElecPower; // expect 75% of power @@ -617,7 +617,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_noPowerFFlowCurve) massFlow2 = 0.75 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; // uses flow weighted power calculation. 0% of time at 0% flow and 100% of time at 75% flow locExpectPower = (0.0 * 0.0 + 1.0 * 0.75) * fanSystem->designElecPower; // expect 75% of power @@ -628,7 +628,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_noPowerFFlowCurve) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 1.0; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; // uses flow weighted power calculation. 0% of time at 0% flow and 100% of time at 100% flow locExpectPower = (0.0 * 0.0 + 1.0 * 1.0) * fanSystem->designElecPower; // expect full power @@ -639,7 +639,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_noPowerFFlowCurve) massFlow2 = 1.0 * designMassFlowRate; runTimeFrac1 = 0.0; runTimeFrac2 = 0.85; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; // uses flow weighted power calculation. 0% of time at 0% flow and 85% of time at 100% flow locExpectPower = (0.0 * 0.25 + 0.85 * 1.0) * fanSystem->designElecPower; // expect 85% of full power @@ -712,7 +712,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_EMSPressureRiseResetTest) Real64 massFlow2 = designMassFlowRate; Real64 runTimeFrac1 = 0.5; Real64 runTimeFrac2 = 0.5; - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); Real64 locFanElecPower = fanSystem->totalPower; // uses flow weighted power calculation. 50% of time at 50% flow and 50% of time at 100% flow Real64 locExpectPower = (0.5 * 0.5 + 0.5 * 1.0) * fanSystem->designElecPower; // expect 75% of power @@ -724,7 +724,7 @@ TEST_F(EnergyPlusFixture, SystemFanObj_DiscreteMode_EMSPressureRiseResetTest) EMSManager::ManageEMS(*state, EMSManager::EMSCallFrom::BeginTimestepBeforePredictor, anyRan, ObjexxFCL::Optional_int_const()); EXPECT_TRUE(anyRan); // simulate the fan with -100.0 Pa fan pressure rise - fanSystem->simulate(*state, false, _, _, _, 1.0, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); + fanSystem->simulate(*state, false, _, _, _, massFlow1, runTimeFrac1, massFlow2, runTimeFrac2); locFanElecPower = fanSystem->totalPower; // negative fan pressure rise results in zero fan power locExpectPower = 0.0; From 340cc89e8b4a3da6f460523ac76bf0a815f6c8b4 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Thu, 18 Jul 2024 10:15:47 -0500 Subject: [PATCH 047/164] Space IV-Non-coincident 3 repairs --- src/EnergyPlus/DataSizing.hh | 2 +- src/EnergyPlus/SizingManager.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/DataSizing.hh b/src/EnergyPlus/DataSizing.hh index 4bc28877441..ef4f8e2e07f 100644 --- a/src/EnergyPlus/DataSizing.hh +++ b/src/EnergyPlus/DataSizing.hh @@ -130,7 +130,7 @@ namespace DataSizing { Num }; - constexpr std::array(SizingConcurrence::Num)> SizingConcurrenceNamesUC{"NonCoincident", "Coincident"}; + constexpr std::array(SizingConcurrence::Num)> SizingConcurrenceNamesUC{"NONCOINCIDENT", "COINCIDENT"}; // parameters for coil sizing concurrence method enum class CoilSizingConcurrence diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 1af5dc10eab..9c830da768a 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -3291,7 +3291,7 @@ void GetZoneSizingInput(EnergyPlusData &state) } } zoneSizingIndex.spaceConcurrence = static_cast( - getEnumValue(DataSizing::SizingConcurrenceNamesUC, state.dataIPShortCut->cAlphaArgs(10))); + getEnumValue(DataSizing::SizingConcurrenceNamesUC, state.dataIPShortCut->cAlphaArgs(15))); zoneSizingIndex.zoneSizingMethod = static_cast(getEnumValue(DataSizing::ZoneSizingMethodNamesUC, state.dataIPShortCut->cAlphaArgs(10))); if (zoneSizingIndex.zoneSizingMethod != ZoneSizing::SensibleOnly) { From 4c834c7d0e172287608dd9e022071dab4dc38ba6 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Thu, 18 Jul 2024 10:16:29 -0700 Subject: [PATCH 048/164] Revert "use optional arg in SimulateVAV to control for cycling" This reverts commit 9de83a18a2dc02f4b9a180a76a45fd3f5dda19bd. also resolves conflicts fan->simulate(state, FirstHVACIteration, _, _, _, fan->inletAirMassFlowRate, OnOffFanPartLoadFraction, 0, 0, _); --- src/EnergyPlus/Fans.cc | 8 ++----- src/EnergyPlus/Fans.hh | 22 ++++++++----------- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 4 ++-- 3 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 45da3b366f7..7b2e137eea4 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -104,7 +104,6 @@ void FanBase::simulate(EnergyPlusData &state, // the legacy speed ratio that was used with SimulateFanComponents. ObjexxFCL::Optional _pressureRise, // Pressure difference to use for DeltaPress, for rating DX coils at a ObjexxFCL::Optional _flowFraction, // when used, this directs the fan to set the flow at this flow fraction - ObjexxFCL::Optional _onOffFanPartLoadFraction, // to control for cycling in VAV fan in VRFFluidTCtrl // different pressure without entire duct system ObjexxFCL::Optional _massFlowRate1, // Mass flow rate in operating mode 1 [kg/s] ObjexxFCL::Optional _runTimeFraction1, // Run time fraction in operating mode 1 @@ -140,7 +139,7 @@ void FanBase::simulate(EnergyPlusData &state, _thisFan->simulateConstant(state); } break; case HVAC::FanType::VAV: { - _thisFan->simulateVAV(state, _pressureRise, _onOffFanPartLoadFraction); + _thisFan->simulateVAV(state, _pressureRise); } break; case HVAC::FanType::OnOff: { _thisFan->simulateOnOff(state, _speedRatio); @@ -1712,9 +1711,7 @@ void FanComponent::simulateConstant(EnergyPlusData &state) } } // FanComponent::simulateConstant -void FanComponent::simulateVAV(EnergyPlusData &state, - ObjexxFCL::Optional _pressureRise, - ObjexxFCL::Optional _onOffFanPartLoadFraction) +void FanComponent::simulateVAV(EnergyPlusData &state, ObjexxFCL::Optional _pressureRise) { // SUBROUTINE INFORMATION: @@ -1880,7 +1877,6 @@ void FanComponent::simulateVAV(EnergyPlusData &state, massFlowRateMaxAvail = 0.0; massFlowRateMinAvail = 0.0; } - totalPower *= _onOffFanPartLoadFraction; } // FanComponent::SimVAV() void FanComponent::simulateOnOff(EnergyPlusData &state, ObjexxFCL::Optional _speedRatio) diff --git a/src/EnergyPlus/Fans.hh b/src/EnergyPlus/Fans.hh index fce7296764e..e78811ef0b3 100644 --- a/src/EnergyPlus/Fans.hh +++ b/src/EnergyPlus/Fans.hh @@ -97,15 +97,14 @@ namespace Fans { virtual void init(EnergyPlusData &state) = 0; virtual void simulate(EnergyPlusData &state, bool const FirstHVACIteration, - ObjexxFCL::Optional speedRatio = _, // Flow fraction in operating mode 1 - ObjexxFCL::Optional pressureRise = _, // Pressure difference to use for DeltaPress - ObjexxFCL::Optional flowFraction = _, // Flow fraction in operating mode 1 - ObjexxFCL::Optional onOffFanPartLoadFraction = 1.0, // to control for cycling in VAV fan in VRFFluidTCtrl - ObjexxFCL::Optional massFlowRate1 = _, // Mass flow rate in operating mode 1 [kg/s] - ObjexxFCL::Optional runTimeFraction1 = _, // Run time fraction in operating mode 1 - ObjexxFCL::Optional massFlowRate2 = _, // Mass flow rate in operating mode 2 [kg/s] - ObjexxFCL::Optional runTimeFraction2 = _, // Run time fraction in operating mode 2 - ObjexxFCL::Optional pressureRise2 = _ // Pressure difference to use for operating mode 2 + ObjexxFCL::Optional speedRatio = _, // Flow fraction in operating mode 1 + ObjexxFCL::Optional pressureRise = _, // Pressure difference to use for DeltaPress + ObjexxFCL::Optional flowFraction = _, // Flow fraction in operating mode 1 + ObjexxFCL::Optional massFlowRate1 = _, // Mass flow rate in operating mode 1 [kg/s] + ObjexxFCL::Optional runTimeFraction1 = _, // Run time fraction in operating mode 1 + ObjexxFCL::Optional massFlowRate2 = _, // Mass flow rate in operating mode 2 [kg/s] + ObjexxFCL::Optional runTimeFraction2 = _, // Run time fraction in operating mode 2 + ObjexxFCL::Optional pressureRise2 = _ // Pressure difference to use for operating mode 2 ); virtual void update(EnergyPlusData &state) = 0; @@ -228,10 +227,7 @@ namespace Fans { void simulateConstant(EnergyPlusData &state); - void simulateVAV(EnergyPlusData &state, - ObjexxFCL::Optional PressureRise = _, - // to control for cycling in VAV fan in VRFFluidTCtrl - ObjexxFCL::Optional OnOffFanPartLoadFraction = 1.0); + void simulateVAV(EnergyPlusData &state, ObjexxFCL::Optional PressureRise = _); void simulateOnOff(EnergyPlusData &state, ObjexxFCL::Optional SpeedRatio = _); diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index d68031510f1..e63773481b7 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12865,12 +12865,12 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state, auto *fan = state.dataFans->fans(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).FanIndex); if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType == HVAC::FanType::SystemModel) { if (OnOffAirFlowRatio > 0.0) { - fan->simulate(state, FirstHVACIteration, _, _, _, _, fan->inletAirMassFlowRate, OnOffFanPartLoadFraction, 0, 0, _); + fan->simulate(state, FirstHVACIteration, _, _, _, fan->inletAirMassFlowRate, OnOffFanPartLoadFraction, 0, 0, _); } else { fan->simulate(state, FirstHVACIteration, _, _, PartLoadRatio); } } else { - fan->simulate(state, FirstHVACIteration, state.dataHVACVarRefFlow->FanSpeedRatio, _, _, OnOffFanPartLoadFraction); + fan->simulate(state, FirstHVACIteration, state.dataHVACVarRefFlow->FanSpeedRatio); } } From 49e82a05736544a82477aa013286b0d5e1f924b4 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Thu, 18 Jul 2024 10:41:54 -0700 Subject: [PATCH 049/164] use old fan name in transition after VAV fans are deleted --- src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 index e158c7eac6b..9a8a0a90218 100644 --- a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 @@ -137,7 +137,6 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile INTEGER :: Num3 = 1 INTEGER :: VRFTU_i = 1 CHARACTER(len=MaxNameLength) :: sysFanName - CHARACTER(len=MaxNameLength) :: vavFanName CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: vavFanNameToDelete TYPE FanVOTransitionInfo @@ -580,10 +579,8 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile IF (SameString(InArgs(14), 'FAN:VARIABLEVOLUME')) THEN isVariableVolume = .TRUE. OutArgs(14) = 'FAN:SYSTEMMODEL' - ! create a new fan object with a new name - OutArgs(15) = TRIM(InArgs(15)) // '_sysModel' - sysFanName = TRIM(InArgs(15)) // '_sysModel' - vavFanName = TRIM(InArgs(15)) + OutArgs(15) = TRIM(InArgs(15)) + sysFanName = TRIM(InArgs(15)) ELSE OutArgs(14:15) = InArgs(14:15) ENDIF @@ -594,7 +591,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile ! create fan system model object ObjectName = 'Fan:SystemModel' DO Num3 = 1, NumFanVariableVolume - IF (SameString(OldFanVO(Num3)%oldFanName, vavFanName)) THEN + IF (SameString(OldFanVO(Num3)%oldFanName, sysFanName)) THEN CALL GetNewObjectDefInIDD(ObjectName, NwNumArgs, NwAorN, NwReqFld, NwObjMinFlds, NwFldNames, NwFldDefaults, NwFldUnits) OutArgs(1) = TRIM(sysFanName) OutArgs(2) = OldFanVO(Num3)%availSchedule From 6e5166afb792aec3d65ffb9c3abffcfee75dd191 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Thu, 18 Jul 2024 11:22:35 -0700 Subject: [PATCH 050/164] remove unused inititialization --- tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc | 3 --- 1 file changed, 3 deletions(-) diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 6e719d90e3e..b392f7abf46 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -18163,9 +18163,6 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_SupplementalHtgCoilTest) GetVRFInput(*state); state->dataHVACVarRefFlow->GetVRFInputFlag = false; - state->dataHVACGlobal->OnOffFanPartLoadFraction = 1.0; - state->dataHVACVarRefFlow->VRF(VRFCond).VRFCondCyclingRatio = 1.0; - state->dataScheduleMgr->Schedule(state->dataHVACVarRefFlow->VRF(VRFCond).SchedPtr).CurrentValue = 1.0; VRFTUNum = zone_num_TU1; state->dataScheduleMgr->Schedule(state->dataHVACVarRefFlow->VRFTU(VRFTUNum).SchedPtr).CurrentValue = 1.0; From 0c5b4ba06195b3e1463ce9d45a2729d69d433fac Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Thu, 18 Jul 2024 15:20:18 -0500 Subject: [PATCH 051/164] Space IV-Non-coincident 4 --- src/EnergyPlus/ZoneEquipmentManager.cc | 153 +++++++++++++++++-------- 1 file changed, 106 insertions(+), 47 deletions(-) diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 997ce4ab31d..b459e11ae07 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -1869,7 +1869,7 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum // Set or override finalzonesizing data for non-coincident sizing auto &zoneCFS = state.dataSize->CalcFinalZoneSizing(zoneNum); if (zoneCFS.spaceConcurrence == DataSizing::SizingConcurrence::Coincident) return; - // Zero out simple sums and averages + // Zero out simple sums zoneCFS.DesHeatVolFlow = 0.0; zoneCFS.DesHeatLoad = 0.0; zoneCFS.DesHeatMassFlow = 0.0; @@ -1879,7 +1879,7 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.DesCoolMassFlow = 0.0; zoneCFS.DesCoolLoadNoDOAS = 0.0; - // Weighted averages + // Zero out weighted averages zoneCFS.DesHeatDens = 0.0; zoneCFS.ZoneTempAtHeatPeak = 0.0; zoneCFS.OutTempAtHeatPeak = 0.0; @@ -1897,7 +1897,7 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.DesCoolCoilInTemp = 0.0; zoneCFS.DesCoolCoilInHumRat = 0.0; - // Zero out ime-series sums + // Zero out time-series sums and averages for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { zoneCFS.HeatFlowSeq(ts) = 0.0; zoneCFS.HeatLoadSeq(ts) = 0.0; @@ -1917,7 +1917,7 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.CoolLoadNoDOASSeq(ts) = 0.0; } if (zoneCFS.zoneLatentSizing) { - // Simple sums + // Zero out latent simple sums zoneCFS.DesLatentHeatVolFlow = 0.0; zoneCFS.DesLatentHeatMassFlow = 0.0; zoneCFS.DesLatentHeatLoad = 0.0; @@ -1927,7 +1927,7 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.DesLatentCoolLoad = 0.0; zoneCFS.DesLatentCoolLoadNoDOAS = 0.0; - // Weighted averages + // Zero out latent weighted averages zoneCFS.ZoneTempAtLatentHeatPeak = 0.0; zoneCFS.ZoneHumRatAtLatentHeatPeak = 0.0; zoneCFS.ZoneRetTempAtLatentHeatPeak = 0.0; @@ -1939,7 +1939,7 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.DesLatentCoolCoilInTemp = 0.0; zoneCFS.DesLatentCoolCoilInHumRat = 0.0; - // Time-series sums + // Zero out latent time-series sums for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { zoneCFS.LatentHeatLoadSeq(ts) = 0.0; zoneCFS.LatentHeatFlowSeq(ts) = 0.0; @@ -1953,7 +1953,6 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum int numSpaces = 0; // Track this for averages later for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) { auto &spaceCFS = state.dataSize->CalcFinalSpaceSizing(spaceNum); - if (!state.dataZoneEquip->spaceEquipConfig(spaceNum).IsControlled) continue; ++numSpaces; // Simple sums @@ -1967,41 +1966,43 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.DesCoolLoadNoDOAS += spaceCFS.DesCoolLoadNoDOAS; // Weighted averages - zoneCFS.DesHeatDens += spaceCFS.DesHeatDens; - zoneCFS.ZoneTempAtHeatPeak += spaceCFS.ZoneTempAtHeatPeak; - zoneCFS.OutTempAtHeatPeak += spaceCFS.OutTempAtHeatPeak; - zoneCFS.ZoneRetTempAtHeatPeak += spaceCFS.ZoneRetTempAtHeatPeak; - zoneCFS.ZoneHumRatAtHeatPeak += spaceCFS.ZoneHumRatAtHeatPeak; - zoneCFS.OutHumRatAtHeatPeak += spaceCFS.OutHumRatAtHeatPeak; - zoneCFS.DesHeatCoilInTemp += spaceCFS.DesHeatCoilInTemp; - zoneCFS.DesHeatCoilInHumRat += spaceCFS.DesHeatCoilInHumRat; - zoneCFS.DesCoolDens += spaceCFS.DesCoolDens; - zoneCFS.ZoneTempAtCoolPeak += spaceCFS.ZoneTempAtCoolPeak; - zoneCFS.OutTempAtCoolPeak += spaceCFS.OutTempAtCoolPeak; - zoneCFS.ZoneRetTempAtCoolPeak += spaceCFS.ZoneRetTempAtCoolPeak; - zoneCFS.ZoneHumRatAtCoolPeak += spaceCFS.ZoneHumRatAtCoolPeak; - zoneCFS.OutHumRatAtCoolPeak += spaceCFS.OutHumRatAtCoolPeak; - zoneCFS.DesCoolCoilInTemp += spaceCFS.DesCoolCoilInTemp; - zoneCFS.DesCoolCoilInHumRat += spaceCFS.DesCoolCoilInHumRat; - - // Time-series sums + zoneCFS.DesHeatDens += spaceCFS.DesHeatDens * spaceCFS.DesHeatMassFlow; + zoneCFS.ZoneTempAtHeatPeak += spaceCFS.ZoneTempAtHeatPeak * spaceCFS.DesHeatMassFlow; + zoneCFS.OutTempAtHeatPeak += spaceCFS.OutTempAtHeatPeak * spaceCFS.DesHeatMassFlow; + zoneCFS.ZoneRetTempAtHeatPeak += spaceCFS.ZoneRetTempAtHeatPeak * spaceCFS.DesHeatMassFlow; + zoneCFS.ZoneHumRatAtHeatPeak += spaceCFS.ZoneHumRatAtHeatPeak * spaceCFS.DesHeatMassFlow; + zoneCFS.OutHumRatAtHeatPeak += spaceCFS.OutHumRatAtHeatPeak * spaceCFS.DesHeatMassFlow; + zoneCFS.DesHeatCoilInTemp += spaceCFS.DesHeatCoilInTemp * spaceCFS.DesHeatMassFlow; + zoneCFS.DesHeatCoilInHumRat += spaceCFS.DesHeatCoilInHumRat * spaceCFS.DesHeatMassFlow; + zoneCFS.DesCoolDens += spaceCFS.DesCoolDens * spaceCFS.DesCoolMassFlow; + zoneCFS.ZoneTempAtCoolPeak += spaceCFS.ZoneTempAtCoolPeak * spaceCFS.DesCoolMassFlow; + zoneCFS.OutTempAtCoolPeak += spaceCFS.OutTempAtCoolPeak * spaceCFS.DesCoolMassFlow; + zoneCFS.ZoneRetTempAtCoolPeak += spaceCFS.ZoneRetTempAtCoolPeak * spaceCFS.DesCoolMassFlow; + zoneCFS.ZoneHumRatAtCoolPeak += spaceCFS.ZoneHumRatAtCoolPeak * spaceCFS.DesCoolMassFlow; + zoneCFS.OutHumRatAtCoolPeak += spaceCFS.OutHumRatAtCoolPeak * spaceCFS.DesCoolMassFlow; + zoneCFS.DesCoolCoilInTemp += spaceCFS.DesCoolCoilInTemp * spaceCFS.DesCoolMassFlow; + zoneCFS.DesCoolCoilInHumRat += spaceCFS.DesCoolCoilInHumRat * spaceCFS.DesCoolMassFlow; + for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { + // Time-series sums zoneCFS.HeatFlowSeq(ts) += spaceCFS.HeatFlowSeq(ts); zoneCFS.HeatLoadSeq(ts) += spaceCFS.HeatLoadSeq(ts); - zoneCFS.HeatZoneTempSeq(ts) += spaceCFS.HeatZoneTempSeq(ts); - zoneCFS.HeatOutTempSeq(ts) += spaceCFS.HeatOutTempSeq(ts); - zoneCFS.HeatZoneRetTempSeq(ts) += spaceCFS.HeatZoneRetTempSeq(ts); - zoneCFS.HeatZoneHumRatSeq(ts) += spaceCFS.HeatZoneHumRatSeq(ts); - zoneCFS.HeatOutHumRatSeq(ts) += spaceCFS.HeatOutHumRatSeq(ts); zoneCFS.HeatLoadNoDOASSeq(ts) += spaceCFS.HeatLoadNoDOASSeq(ts); zoneCFS.CoolFlowSeq(ts) += spaceCFS.CoolFlowSeq(ts); zoneCFS.CoolLoadSeq(ts) += spaceCFS.CoolLoadSeq(ts); - zoneCFS.CoolZoneTempSeq(ts) += spaceCFS.CoolZoneTempSeq(ts); - zoneCFS.CoolOutTempSeq(ts) += spaceCFS.CoolOutTempSeq(ts); - zoneCFS.CoolZoneRetTempSeq(ts) += spaceCFS.CoolZoneRetTempSeq(ts); - zoneCFS.CoolZoneHumRatSeq(ts) += spaceCFS.CoolZoneHumRatSeq(ts); - zoneCFS.CoolOutHumRatSeq(ts) += spaceCFS.CoolOutHumRatSeq(ts); zoneCFS.CoolLoadNoDOASSeq(ts) += spaceCFS.CoolLoadNoDOASSeq(ts); + + // Time-series weighted averages + zoneCFS.HeatZoneTempSeq(ts) += spaceCFS.HeatZoneTempSeq(ts) * spaceCFS.HeatFlowSeq(ts); + zoneCFS.HeatOutTempSeq(ts) += spaceCFS.HeatOutTempSeq(ts) * spaceCFS.HeatFlowSeq(ts); + zoneCFS.HeatZoneRetTempSeq(ts) += spaceCFS.HeatZoneRetTempSeq(ts) * spaceCFS.HeatFlowSeq(ts); + zoneCFS.HeatZoneHumRatSeq(ts) += spaceCFS.HeatZoneHumRatSeq(ts) * spaceCFS.HeatFlowSeq(ts); + zoneCFS.HeatOutHumRatSeq(ts) += spaceCFS.HeatOutHumRatSeq(ts) * spaceCFS.HeatFlowSeq(ts); + zoneCFS.CoolZoneTempSeq(ts) += spaceCFS.CoolZoneTempSeq(ts) * spaceCFS.CoolFlowSeq(ts); + zoneCFS.CoolOutTempSeq(ts) += spaceCFS.CoolOutTempSeq(ts) * spaceCFS.CoolFlowSeq(ts); + zoneCFS.CoolZoneRetTempSeq(ts) += spaceCFS.CoolZoneRetTempSeq(ts) * spaceCFS.CoolFlowSeq(ts); + zoneCFS.CoolZoneHumRatSeq(ts) += spaceCFS.CoolZoneHumRatSeq(ts) * spaceCFS.CoolFlowSeq(ts); + zoneCFS.CoolOutHumRatSeq(ts) += spaceCFS.CoolOutHumRatSeq(ts) * spaceCFS.CoolFlowSeq(ts); } // Other @@ -2020,7 +2021,7 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum // zoneCFS.cCoolDDDate = desDayWeath.DateString; // zoneCFS.TimeStepNumAtCoolMax = spaceCFS.TimeStepNumAtCoolMax; - if (spaceCFS.zoneLatentSizing) { + if (zoneCFS.zoneLatentSizing) { // Simple sums zoneCFS.DesLatentHeatVolFlow += spaceCFS.DesLatentHeatVolFlow; zoneCFS.DesLatentHeatMassFlow += spaceCFS.ZoneHeatLatentMassFlow; @@ -2032,16 +2033,16 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.DesLatentCoolLoadNoDOAS += spaceCFS.DesLatentCoolLoadNoDOAS; // Weighted averages - zoneCFS.ZoneTempAtLatentHeatPeak += spaceCFS.ZoneTempAtLatentHeatPeak; - zoneCFS.ZoneHumRatAtLatentHeatPeak += spaceCFS.ZoneHumRatAtLatentHeatPeak; - zoneCFS.ZoneRetTempAtLatentHeatPeak += spaceCFS.ZoneRetTempAtLatentHeatPeak; - zoneCFS.DesLatentHeatCoilInTemp += spaceCFS.DesLatentHeatCoilInTemp; - zoneCFS.DesLatentHeatCoilInHumRat += spaceCFS.DesLatentHeatCoilInHumRat; - zoneCFS.ZoneTempAtLatentCoolPeak += spaceCFS.ZoneTempAtLatentCoolPeak; - zoneCFS.ZoneHumRatAtLatentCoolPeak += spaceCFS.ZoneHumRatAtLatentCoolPeak; - zoneCFS.ZoneRetTempAtLatentCoolPeak += spaceCFS.ZoneRetTempAtLatentCoolPeak; - zoneCFS.DesLatentCoolCoilInTemp += spaceCFS.DesLatentCoolCoilInTemp; - zoneCFS.DesLatentCoolCoilInHumRat += spaceCFS.DesLatentCoolCoilInHumRat; + zoneCFS.ZoneTempAtLatentHeatPeak += spaceCFS.ZoneTempAtLatentHeatPeak * spaceCFS.ZoneHeatLatentMassFlow; + zoneCFS.ZoneHumRatAtLatentHeatPeak += spaceCFS.ZoneHumRatAtLatentHeatPeak * spaceCFS.ZoneHeatLatentMassFlow; + zoneCFS.ZoneRetTempAtLatentHeatPeak += spaceCFS.ZoneRetTempAtLatentHeatPeak * spaceCFS.ZoneHeatLatentMassFlow; + zoneCFS.DesLatentHeatCoilInTemp += spaceCFS.DesLatentHeatCoilInTemp * spaceCFS.ZoneHeatLatentMassFlow; + zoneCFS.DesLatentHeatCoilInHumRat += spaceCFS.DesLatentHeatCoilInHumRat * spaceCFS.ZoneHeatLatentMassFlow; + zoneCFS.ZoneTempAtLatentCoolPeak += spaceCFS.ZoneTempAtLatentCoolPeak * spaceCFS.DesLatentCoolVolFlow; + zoneCFS.ZoneHumRatAtLatentCoolPeak += spaceCFS.ZoneHumRatAtLatentCoolPeak * spaceCFS.DesLatentCoolVolFlow; + zoneCFS.ZoneRetTempAtLatentCoolPeak += spaceCFS.ZoneRetTempAtLatentCoolPeak * spaceCFS.DesLatentCoolVolFlow; + zoneCFS.DesLatentCoolCoilInTemp += spaceCFS.DesLatentCoolCoilInTemp * spaceCFS.DesLatentCoolVolFlow; + zoneCFS.DesLatentCoolCoilInHumRat += spaceCFS.DesLatentCoolCoilInHumRat * spaceCFS.DesLatentCoolVolFlow; // Other // zoneCFS.LatHeatDesDay = spaceCFS.LatHeatDesDay; @@ -2070,6 +2071,63 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum } } } + + // Compute weighted averages + if (zoneCFS.DesHeatMassFlow > 0) { + zoneCFS.DesHeatDens /= zoneCFS.DesHeatMassFlow; + zoneCFS.ZoneTempAtHeatPeak /= zoneCFS.DesHeatMassFlow; + zoneCFS.OutTempAtHeatPeak /= zoneCFS.DesHeatMassFlow; + zoneCFS.ZoneRetTempAtHeatPeak /= zoneCFS.DesHeatMassFlow; + zoneCFS.ZoneHumRatAtHeatPeak /= zoneCFS.DesHeatMassFlow; + zoneCFS.OutHumRatAtHeatPeak /= zoneCFS.DesHeatMassFlow; + zoneCFS.DesHeatCoilInTemp /= zoneCFS.DesHeatMassFlow; + zoneCFS.DesHeatCoilInHumRat /= zoneCFS.DesHeatMassFlow; + } + if (zoneCFS.DesCoolMassFlow > 0) { + zoneCFS.DesCoolDens /= zoneCFS.DesCoolMassFlow; + zoneCFS.ZoneTempAtCoolPeak /= zoneCFS.DesCoolMassFlow; + zoneCFS.OutTempAtCoolPeak /= zoneCFS.DesCoolMassFlow; + zoneCFS.ZoneRetTempAtCoolPeak /= zoneCFS.DesCoolMassFlow; + zoneCFS.ZoneHumRatAtCoolPeak /= zoneCFS.DesCoolMassFlow; + zoneCFS.OutHumRatAtCoolPeak /= zoneCFS.DesCoolMassFlow; + zoneCFS.DesCoolCoilInTemp /= zoneCFS.DesCoolMassFlow; + zoneCFS.DesCoolCoilInHumRat /= zoneCFS.DesCoolMassFlow; + } + for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { + if (zoneCFS.HeatFlowSeq(ts) > 0) { + zoneCFS.HeatZoneTempSeq(ts) /= zoneCFS.HeatFlowSeq(ts); + zoneCFS.HeatOutTempSeq(ts) /= zoneCFS.HeatFlowSeq(ts); + zoneCFS.HeatZoneRetTempSeq(ts) /= zoneCFS.HeatFlowSeq(ts); + zoneCFS.HeatZoneHumRatSeq(ts) /= zoneCFS.HeatFlowSeq(ts); + zoneCFS.HeatOutHumRatSeq(ts) /= zoneCFS.HeatFlowSeq(ts); + zoneCFS.HeatLoadNoDOASSeq(ts) /= zoneCFS.HeatFlowSeq(ts); + } + if (zoneCFS.CoolFlowSeq(ts) > 0) { + zoneCFS.CoolZoneTempSeq(ts) /= zoneCFS.CoolFlowSeq(ts); + zoneCFS.CoolOutTempSeq(ts) /= zoneCFS.CoolFlowSeq(ts); + zoneCFS.CoolZoneRetTempSeq(ts) /= zoneCFS.CoolFlowSeq(ts); + zoneCFS.CoolZoneHumRatSeq(ts) /= zoneCFS.CoolFlowSeq(ts); + zoneCFS.CoolOutHumRatSeq(ts) /= zoneCFS.CoolFlowSeq(ts); + zoneCFS.CoolLoadNoDOASSeq(ts) /= zoneCFS.CoolFlowSeq(ts); + } + } + if (zoneCFS.zoneLatentSizing) { + if (zoneCFS.DesLatentHeatMassFlow > 0) { + zoneCFS.ZoneTempAtLatentHeatPeak /= zoneCFS.DesLatentHeatMassFlow; + zoneCFS.ZoneHumRatAtLatentHeatPeak /= zoneCFS.DesLatentHeatMassFlow; + zoneCFS.ZoneRetTempAtLatentHeatPeak /= zoneCFS.DesLatentHeatMassFlow; + zoneCFS.DesLatentHeatCoilInTemp /= zoneCFS.DesLatentHeatMassFlow; + zoneCFS.DesLatentHeatCoilInHumRat /= zoneCFS.DesLatentHeatMassFlow; + } + if (zoneCFS.DesLatentCoolMassFlow > 0) { + zoneCFS.ZoneTempAtLatentCoolPeak /= zoneCFS.DesLatentCoolMassFlow; + zoneCFS.ZoneHumRatAtLatentCoolPeak /= zoneCFS.DesLatentCoolMassFlow; + zoneCFS.ZoneRetTempAtLatentCoolPeak /= zoneCFS.DesLatentCoolMassFlow; + zoneCFS.DesLatentCoolCoilInTemp /= zoneCFS.DesLatentCoolMassFlow; + zoneCFS.DesLatentCoolCoilInHumRat /= zoneCFS.DesLatentCoolMassFlow; + } + } + return; } @@ -3129,10 +3187,11 @@ void UpdateZoneSizing(EnergyPlusData &state, Constant::CallIndicator const CallI if (!state.dataGlobal->isPulseZoneSizing) { - // Apply non-coincident zone sizing - only if space sizing is active + // Apply non-coincident zone sizing - only if space sizing is active, and only if there is more than one space in the zone if (state.dataHeatBal->doSpaceHeatBalanceSizing) { for (int ctrlZoneNum = 1; ctrlZoneNum <= state.dataGlobal->NumOfZones; ++ctrlZoneNum) { if (!state.dataZoneEquip->ZoneEquipConfig(ctrlZoneNum).IsControlled) continue; + if (state.dataHeatBal->Zone(ctrlZoneNum).numSpaces == 1) continue; updateZoneSizingEndZoneSizingCalc1(state, ctrlZoneNum); } } From c1a23960ed169e3191ed260194e6c6e15f21f7f1 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Thu, 18 Jul 2024 15:56:11 -0500 Subject: [PATCH 052/164] Add API endpoints to access EMS global variables --- src/EnergyPlus/api/datatransfer.cc | 44 +++++++++++++++ src/EnergyPlus/api/datatransfer.h | 36 +++++++++++- src/EnergyPlus/api/datatransfer.py | 88 ++++++++++++++++++++++++++++-- 3 files changed, 161 insertions(+), 7 deletions(-) diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index 196f1e2b406..fd8a303e07d 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -573,6 +573,50 @@ Real64 getInternalVariableValue(EnergyPlusState state, int handle) return 0; } +int getEMSGlobalVariableHandle(EnergyPlusState state, const char *name) +{ + auto *thisState = static_cast(state); + int index = 0; + for (auto const &erlVar : thisState->dataRuntimeLang->ErlVariable) { + index++; + if (EnergyPlus::Util::SameString(name, erlVar.Name)) { + return index; + } + } + return 0; +} + +Real64 getEMSGlobalVariableValue(EnergyPlusState state, int handle) +{ + auto *thisState = static_cast(state); + if (handle < 0 || handle > thisState->dataRuntimeLang->NumErlVariables) { + // need to fatal out once the process is done + // throw an error, set the fatal flag, and then return 0 + EnergyPlus::ShowSevereError( + *thisState, fmt::format("Data Exchange API: Problem -- index error in getEMSGlobalVariableValue; received handle: {}", handle)); + EnergyPlus::ShowContinueError( + *thisState, "The getEMSGlobalVariableValue function will return 0 for now to allow the process to finish, then EnergyPlus will abort"); + thisState->dataPluginManager->apiErrorFlag = true; + return 0; + } + return thisState->dataRuntimeLang->ErlVariable(handle).Value.Number; +} + +void setEMSGlobalVariableValue(EnergyPlusState state, int handle, Real64 value) +{ + auto *thisState = static_cast(state); + if (handle < 0 || handle > thisState->dataRuntimeLang->NumErlVariables) { + // need to fatal out once the plugin is done + // throw an error, set the fatal flag, and then return + EnergyPlus::ShowSevereError( + *thisState, fmt::format("Data Exchange API: Problem -- index error in setEMSGlobalVariableValue; received handle: {}", handle)); + EnergyPlus::ShowContinueError(*thisState, + "The setEMSGlobalVariableValue function will return to allow the plugin to finish, then EnergyPlus will abort"); + thisState->dataPluginManager->apiErrorFlag = true; + } + thisState->dataRuntimeLang->ErlVariable(handle).Value.Number = value; +} + int getPluginGlobalVariableHandle(EnergyPlusState state, const char *name) { auto *thisState = static_cast(state); diff --git a/src/EnergyPlus/api/datatransfer.h b/src/EnergyPlus/api/datatransfer.h index ae45b8fc5c8..11bee4ce75b 100644 --- a/src/EnergyPlus/api/datatransfer.h +++ b/src/EnergyPlus/api/datatransfer.h @@ -149,7 +149,7 @@ ENERGYPLUSLIB_API void freeAPIData(const struct APIDataEntry *data, unsigned int ENERGYPLUSLIB_API char **getObjectNames(EnergyPlusState state, const char *objectType, unsigned int *resultingSize); /// \brief Clears an object names array allocation /// \details This function frees an instance of the object names array, which is returned from getObjectNames -/// \param[in] data An array (pointer) of const char * as returned from the getObjectNames function +/// \param[in] objectNames An array (pointer) of char * as returned from the getObjectNames function /// \param[in] arraySize The size of the object name array, which is known after the call to getObjectNames. /// \return Nothing, this simply frees the memory ENERGYPLUSLIB_API void freeObjectNames(char **objectNames, unsigned int arraySize); @@ -297,6 +297,40 @@ ENERGYPLUSLIB_API int getInternalVariableHandle(EnergyPlusState state, const cha /// \see getInternalVariableHandle ENERGYPLUSLIB_API Real64 getInternalVariableValue(EnergyPlusState state, int handle); +// ----- FUNCTIONS RELATED TO EMS GLOBAL VARIABLES (FOR CORNER CASES WHERE PLUGIN/API BLENDS WITH EMS PROGRAMS) +/// \brief Gets a handle to an EMS "Global" variable +/// \details When using EMS, it is sometimes necessary to share data between programs. +/// EMS global variables are declared in the input file and used in EMS programs. +/// EMS global variables are identified by name only. This function returns -1 if a match is not found. +/// \param[in] state An active EnergyPlusState instance created with `stateNew`. +/// \param[in] name The name of the EMS global variable, which is declared in the EnergyPlus input file +/// \return The integer handle to an EMS global variable, or -1 if a match is not found. +/// \remark The behavior of this function is not well-defined until the `apiDataFullyReady` function returns true. +/// \see apiDataFullyReady +ENERGYPLUSLIB_API int getEMSGlobalVariableHandle(EnergyPlusState state, const char *name); +/// \brief Gets the current value of an EMS "Global" variable +/// \details When using EMS, the value of the shared "global" variables can change at any time. +/// This function returns the current value of the variable. +/// \param[in] state An active EnergyPlusState instance created with `stateNew`. +/// \param[in] handle The handle id to an EMS "Global" variable, which can be retrieved using the `getEMSGlobalVariableHandle` function. +/// \remark The behavior of this function is not well-defined until the `apiDataFullyReady` function returns true. +/// \return The current value of the variable, in floating point form, or zero if a handle problem is encountered. If a zero +/// is returned, use the `apiErrorFlag` function to disambiguate the return value. +/// \see apiDataFullyReady +/// \see getEMSGlobalVariableHandle +ENERGYPLUSLIB_API Real64 getEMSGlobalVariableValue(EnergyPlusState state, int handle); +/// \brief Sets the value of an EMS "Global" variable +/// \details When using EMS, the value of the shared "global" variables can change at any time. +/// This function sets the variable to a new value. +/// \param[in] state An active EnergyPlusState instance created with `stateNew`. +/// \param[in] handle The handle id to an EMS "Global" variable, which can be retrieved using the `getEMSGlobalVariableHandle` function. +/// \param[in] value The floating point value to be assigned to the global variable +/// \remark The behavior of this function is not well-defined until the `apiDataFullyReady` function returns true. +/// \remark A handle index or other problem will return 0 and set a flag to cause EnergyPlus to terminate once Python completes. +/// \see apiDataFullyReady +/// \see getEMSGlobalVariableHandle +ENERGYPLUSLIB_API void setEMSGlobalVariableValue(EnergyPlusState state, int handle, Real64 value); + // ----- FUNCTIONS RELATED TO PYTHON PLUGIN GLOBAL VARIABLES (ONLY USED FOR PYTHON PLUGIN SYSTEM) /// \brief Gets a handle to a Python Plugin "Global" variable diff --git a/src/EnergyPlus/api/datatransfer.py b/src/EnergyPlus/api/datatransfer.py index 3b154108d38..bee6023f1f9 100644 --- a/src/EnergyPlus/api/datatransfer.py +++ b/src/EnergyPlus/api/datatransfer.py @@ -201,6 +201,12 @@ def __init__(self, api: cdll, running_as_python_plugin: bool = False): self.api.currentEnvironmentNum.restype = c_int self.api.warmupFlag.argtypes = [c_void_p] self.api.warmupFlag.restype = c_int + self.api.getEMSGlobalVariableHandle.argtypes = [c_void_p, c_char_p] + self.api.getEMSGlobalVariableHandle.restype = c_int + self.api.getEMSGlobalVariableValue.argtypes = [c_void_p, c_int] + self.api.getEMSGlobalVariableValue.restype = RealEP + self.api.setEMSGlobalVariableValue.argtypes = [c_void_p, c_int, RealEP] + self.api.setEMSGlobalVariableValue.restype = c_void_p self.api.getPluginGlobalVariableHandle.argtypes = [c_void_p, c_char_p] self.api.getPluginGlobalVariableHandle.restype = c_int self.api.getPluginGlobalVariableValue.argtypes = [c_void_p, c_int] @@ -698,6 +704,82 @@ def get_construction_handle(self, state: c_void_p, var_name: Union[str, bytes]) "'{}'".format(var_name)) return self.api.getConstructionHandle(state, var_name) + def get_ems_global_handle(self, state: c_void_p, var_name: Union[str, bytes]) -> int: + """ + Get a handle to an EMS global variable in a running simulation. + + EMS global variables are used as a way to share data between running EMS programs. First a global variable must + be declared in the input file using the EnergyManagementSystem:GlobalVariable object. Once a name has been + declared, it can be accessed by EMS programs by name, and through the Python API. For API usage, the client + should get a handle to the variable using this get_global_handle function, then + using the get_ems_global_value and set_ems_global_value functions as needed. Note all global variables are + floating point values. + + The arguments passed into this function do not need to be a particular case, as the EnergyPlus API + automatically converts values to upper-case when finding matches to internal variables in the simulation. + + Note also that the arguments passed in here can be either strings or bytes, as this wrapper handles conversion + as needed. + + :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. + :param var_name: The name of the EMS global variable to retrieve, this name must be listed in an IDF object: + `EnergyManagementSystem:GlobalVariable` + :return: An integer ID for this EMS global variable, or -1 if one could not be found. + """ + if isinstance(var_name, str): + var_name = var_name.encode('utf-8') + elif not isinstance(var_name, bytes): + raise EnergyPlusException( + "`get_ems_global_handle` expects `component_type` as a `str` or UTF-8 encoded `bytes`, not " + "'{}'".format(var_name)) + return self.api.getEMSGlobalVariableHandle(state, var_name) + + def get_ems_global_value(self, state: c_void_p, handle: int) -> float: + """ + Get the current value of an EMS global variable in a running simulation. + + EMS global variables are used as a way to share data between running EMS programs. First a global variable must + be declared in the input file using the EnergyManagementSystem:GlobalVariable object. Once a name has been + declared, it can be accessed by EMS programs by name, and through the Python API. For API usage, the client + should get a handle to the variable using this get_global_handle function, then + using the get_ems_global_value and set_ems_global_value functions as needed. Note all global variables are + floating point values. + + :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. + :param handle: An integer returned from the `get_ems_global_handle` function. + :return: Floating point representation of the EMS global variable value + """ + if not is_number(handle): + raise EnergyPlusException( + "`get_ems_global_value` expects `handle` as an `int`, not " + "'{}'".format(handle)) + return self.api.getEMSGlobalVariableValue(state, handle) + + def set_ems_global_value(self, state: c_void_p, handle: int, value: float) -> None: + """ + Set the current value of an EMS global variable in a running simulation. + + EMS global variables are used as a way to share data between running EMS programs. First a global variable must + be declared in the input file using the EnergyManagementSystem:GlobalVariable object. Once a name has been + declared, it can be accessed by EMS programs by name, and through the Python API. For API usage, the client + should get a handle to the variable using this get_global_handle function, then + using the get_ems_global_value and set_ems_global_value functions as needed. Note all global variables are + floating point values. + + :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. + :param handle: An integer returned from the `get_ems_global_handle` function. + :param value: Floating point value to assign to the EMS global variable + """ + if not is_number(handle): + raise EnergyPlusException( + "`set_ems_global_value` expects `variable_handle` as an `int`, not " + "'{}'".format(handle)) + if not is_number(value): + raise EnergyPlusException( + "`set_ems_global_value` expects `value` as a `float`, not " + "'{}'".format(value)) + self.api.setEMSGlobalVariableValue(state, handle, value) + def get_global_handle(self, state: c_void_p, var_name: Union[str, bytes]) -> int: """ Get a handle to a global variable in a running simulation. This is only used for Python Plugin applications! @@ -740,12 +822,6 @@ def get_global_value(self, state: c_void_p, handle: int) -> float: using this get_global_value and the set_global_value functions as needed. Note all global variables are floating point values. - The arguments passed into this function do not need to be a particular case, as the EnergyPlus API - automatically converts values to upper-case when finding matches to internal variables in the simulation. - - Note also that the arguments passed in here can be either strings or bytes, as this wrapper handles conversion - as needed. - :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. :param handle: An integer returned from the `get_global_handle` function. :return: Floating point representation of the global variable value From 5d4c91148c2dae1ef5467eb8c29746ee9e32cd7b Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 19 Jul 2024 12:46:21 -0500 Subject: [PATCH 053/164] Add API endpoint for accecssing the specified IDF path --- src/EnergyPlus/api/datatransfer.cc | 9 +++++++++ src/EnergyPlus/api/datatransfer.h | 6 ++++++ src/EnergyPlus/api/datatransfer.py | 13 +++++++++++++ tst/EnergyPlus/api/TestDataTransfer.c | 7 ++++++- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index fd8a303e07d..fa6d83bdad3 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -239,6 +240,14 @@ void resetErrorFlag(EnergyPlusState state) thisState->dataPluginManager->apiErrorFlag = false; } +char *inputFilePath(EnergyPlusState state) +{ + const auto *thisState = static_cast(state); + char *p = new char[std::strlen(thisState->dataStrGlobals->inputFilePath.c_str()) + 1]; + std::strcpy(p, thisState->dataStrGlobals->inputFilePath.c_str()); + return p; +} + char **getObjectNames(EnergyPlusState state, const char *objectType, unsigned int *resultingSize) { const auto *thisState = static_cast(state); diff --git a/src/EnergyPlus/api/datatransfer.h b/src/EnergyPlus/api/datatransfer.h index 11bee4ce75b..6ab69306286 100644 --- a/src/EnergyPlus/api/datatransfer.h +++ b/src/EnergyPlus/api/datatransfer.h @@ -121,6 +121,12 @@ ENERGYPLUSLIB_API int apiErrorFlag(EnergyPlusState state); /// a calculation to continue, this function can reset the flag. /// \param[in] state An active EnergyPlusState instance created with `stateNew`. ENERGYPLUSLIB_API void resetErrorFlag(EnergyPlusState state); +/// \brief Provides the input file path back to the user +/// \details In most circumstances the client will know the path to the input file, but there are some cases where code +/// is generalized in unexpected workflows. Users have requested a way to get the input file path back from the running instance. +/// \param[in] state An active EnergyPlusState instance created with `stateNew`. +/// \return A char * of the input file path. This allocates a new char *, and calling clients must free this when done with it! +ENERGYPLUSLIB_API char *inputFilePath(EnergyPlusState state); // ----- DATA TRANSFER HELPER FUNCTIONS diff --git a/src/EnergyPlus/api/datatransfer.py b/src/EnergyPlus/api/datatransfer.py index bee6023f1f9..312da6c0a3b 100644 --- a/src/EnergyPlus/api/datatransfer.py +++ b/src/EnergyPlus/api/datatransfer.py @@ -139,6 +139,8 @@ def __init__(self, api: cdll, running_as_python_plugin: bool = False): self.api.apiErrorFlag.restype = c_int self.api.resetErrorFlag.argtypes = [c_void_p] self.api.resetErrorFlag.restype = c_void_p + self.api.inputFilePath.argtypes = [c_void_p] + self.api.inputFilePath.restype = c_char_p self.api.requestVariable.argtypes = [c_void_p, c_char_p, c_char_p] self.api.getNumNodesInCondFDSurfaceLayer.argtypes = [c_void_p, c_char_p, c_char_p] self.api.requestVariable.restype = c_void_p @@ -359,6 +361,17 @@ def reset_api_error_flag(self, state: c_void_p) -> None: """ self.api.resetErrorFlag(state) + def get_input_file_path(self, state: c_void_p) -> bytes: + """ + Provides the input file path back to the client. In most circumstances the client will know the path to the + input file, but there are some cases where code is generalized in unexpected workflows. Users have requested + a way to get the input file path back from the running instance. + + :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. + :return: Returns a raw bytes representation of the input file path + """ + return self.api.inputFilePath(state) + def get_object_names(self, state: c_void_p, object_type_name: Union[str, bytes]) -> List[str]: """ Gets the instance names for a given object type in the current input file diff --git a/tst/EnergyPlus/api/TestDataTransfer.c b/tst/EnergyPlus/api/TestDataTransfer.c index 3980ba06440..ccd767010b0 100644 --- a/tst/EnergyPlus/api/TestDataTransfer.c +++ b/tst/EnergyPlus/api/TestDataTransfer.c @@ -95,7 +95,7 @@ void afterZoneTimeStepHandler(EnergyPlusState state) freeAPIData(data, arraySize); freeObjectNames(surfaceNames, arraySize); - printf("Got handles %d, %d, %d, %d, %d, %d", + printf("Got handles %d, %d, %d, %d, %d, %d\n", outdoorDewPointActuator, outdoorTempSensor, outdoorDewPointSensor, @@ -106,6 +106,11 @@ void afterZoneTimeStepHandler(EnergyPlusState state) wallConstruction == -1 || floorConstruction == -1) { exit(1); } + + char * filePath = inputFilePath(state); + printf("Input file path accessed via API: %s\n", filePath); + free(filePath); + handlesRetrieved = 1; } setActuatorValue(state, outdoorDewPointActuator, -25.0); From ed60e42189a70e59c6a3d2eeeb8f4c521d5d341d Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Mon, 22 Jul 2024 11:09:10 -0500 Subject: [PATCH 054/164] Tweak bad error message patterns to help refactoring --- src/EnergyPlus/Boilers.cc | 4 +-- src/EnergyPlus/ChillerExhaustAbsorption.cc | 2 +- src/EnergyPlus/DElightManagerF.cc | 36 +++++++++---------- src/EnergyPlus/DataSurfaceLists.cc | 12 +++++-- src/EnergyPlus/DesiccantDehumidifiers.cc | 4 +-- src/EnergyPlus/FluidProperties.cc | 17 ++++----- src/EnergyPlus/FuelCellElectricGenerator.cc | 4 +-- src/EnergyPlus/Furnaces.cc | 10 +++--- src/EnergyPlus/HVACControllers.cc | 11 +++--- src/EnergyPlus/HeatBalanceManager.cc | 2 +- src/EnergyPlus/Humidifiers.cc | 2 +- src/EnergyPlus/Material.cc | 4 +-- .../MicroturbineElectricGenerator.cc | 6 ++-- src/EnergyPlus/MixedAir.cc | 4 +-- src/EnergyPlus/MoistureBalanceEMPDManager.cc | 4 +-- src/EnergyPlus/PlantChillers.cc | 6 ++-- src/EnergyPlus/SurfaceGeometry.cc | 6 ++-- src/EnergyPlus/ThermalComfort.cc | 2 +- src/EnergyPlus/UnitarySystem.cc | 6 ++-- src/EnergyPlus/WeatherManager.cc | 4 +-- 20 files changed, 77 insertions(+), 69 deletions(-) diff --git a/src/EnergyPlus/Boilers.cc b/src/EnergyPlus/Boilers.cc index d76186b5476..dd0e9e9d5a0 100644 --- a/src/EnergyPlus/Boilers.cc +++ b/src/EnergyPlus/Boilers.cc @@ -225,7 +225,7 @@ void GetBoilerInput(EnergyPlusData &state) ShowSevereError( state, fmt::format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, format("Invalid {}={:.3R}", state.dataIPShortCut->cNumericFieldNames(2), state.dataIPShortCut->rNumericArgs(2))); - ShowSevereError(state, format("...{} must be greater than 0.0", state.dataIPShortCut->cNumericFieldNames(2))); + ShowContinueError(state, format("...{} must be greater than 0.0", state.dataIPShortCut->cNumericFieldNames(2))); ErrorsFound = true; } else if (state.dataIPShortCut->rNumericArgs(2) > 1.0) { ShowWarningError(state, @@ -288,7 +288,7 @@ void GetBoilerInput(EnergyPlusData &state) ShowSevereError(state, fmt::format("{}{}=\"{}\"", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ShowContinueError(state, format("Invalid {}={}", state.dataIPShortCut->cAlphaFieldNames(4), state.dataIPShortCut->cAlphaArgs(4))); - ShowSevereError(state, format("...{} not found.", state.dataIPShortCut->cAlphaFieldNames(4))); + ShowContinueError(state, format("...{} not found.", state.dataIPShortCut->cAlphaFieldNames(4))); ErrorsFound = true; } thisBoiler.VolFlowRate = state.dataIPShortCut->rNumericArgs(3); diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index e29f2a10fbf..bdf19121c02 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -1362,7 +1362,7 @@ void ExhaustAbsorberSpecs::size(EnergyPlusData &state) if (this->CondVolFlowRateWasAutoSized) { if (state.dataPlnt->PlantFirstSizesOkayToFinalize) { ShowSevereError(state, format("SizeExhaustAbsorber: ChillerHeater:Absorption:DoubleEffect=\"{}\", autosize error.", this->Name)); - ShowSevereError(state, "Autosizing of Exhaust Fired Absorption Chiller condenser flow rate requires a condenser"); + ShowContinueError(state, "Autosizing of Exhaust Fired Absorption Chiller condenser flow rate requires a condenser"); ShowContinueError(state, "loop Sizing:Plant object."); ErrorsFound = true; } diff --git a/src/EnergyPlus/DElightManagerF.cc b/src/EnergyPlus/DElightManagerF.cc index 2f44b1390c5..a7d4d7fcfd6 100644 --- a/src/EnergyPlus/DElightManagerF.cc +++ b/src/EnergyPlus/DElightManagerF.cc @@ -604,34 +604,34 @@ namespace DElightManagerF { // Validate that Reference Point coordinates are within the host Zone if (RefPt_WCS_Coord.x < thisZone.MinimumX || RefPt_WCS_Coord.x > thisZone.MaximumX) { - ShowWarningError( - state, format("DElightInputGenerator:Reference point X Value outside Zone Min/Max X, Zone={}", zn.Name)); ShowSevereError(state, - format("...X Reference Point= {:.2R}, Zone Minimum X= {:.2R}, Zone Maximum X= {:.2R}", - thisZone.MinimumX, - RefPt_WCS_Coord.x, - thisZone.MaximumX)); + format("DElightInputGenerator:Reference point X Value outside Zone Min/Max X, Zone={}", zn.Name)); + ShowContinueError(state, + format("...X Reference Point= {:.2R}, Zone Minimum X= {:.2R}, Zone Maximum X= {:.2R}", + thisZone.MinimumX, + RefPt_WCS_Coord.x, + thisZone.MaximumX)); ErrorsFound = true; } if (RefPt_WCS_Coord.y < thisZone.MinimumY || RefPt_WCS_Coord.y > thisZone.MaximumY) { - ShowWarningError( - state, format("DElightInputGenerator:Reference point Y Value outside Zone Min/Max Y, Zone={}", zn.Name)); ShowSevereError(state, - format("...Y Reference Point= {:.2R}, Zone Minimum Y= {:.2R}, Zone Maximum Y= {:.2R}", - thisZone.MinimumY, - RefPt_WCS_Coord.y, - thisZone.MaximumY)); + format("DElightInputGenerator:Reference point Y Value outside Zone Min/Max Y, Zone={}", zn.Name)); + ShowContinueError(state, + format("...Y Reference Point= {:.2R}, Zone Minimum Y= {:.2R}, Zone Maximum Y= {:.2R}", + thisZone.MinimumY, + RefPt_WCS_Coord.y, + thisZone.MaximumY)); ErrorsFound = true; } if (RefPt_WCS_Coord.z < state.dataHeatBal->Zone(izone).MinimumZ || RefPt_WCS_Coord.z > thisZone.MaximumZ) { - ShowWarningError( + ShowSevereError( state, format("DElightInputGenerator:Reference point Z Value outside Zone Min/Max Z, Zone={}", thisZone.Name)); - ShowSevereError(state, - format("...Z Reference Point= {:.2R}, Zone Minimum Z= {:.2R}, Zone Maximum Z= {:.2R}", - thisZone.MinimumZ, - RefPt_WCS_Coord.z, - thisZone.MaximumZ)); + ShowContinueError(state, + format("...Z Reference Point= {:.2R}, Zone Minimum Z= {:.2R}, Zone Maximum Z= {:.2R}", + thisZone.MinimumZ, + RefPt_WCS_Coord.z, + thisZone.MaximumZ)); ErrorsFound = true; } diff --git a/src/EnergyPlus/DataSurfaceLists.cc b/src/EnergyPlus/DataSurfaceLists.cc index 124ca4dfeff..142d1ac06d4 100644 --- a/src/EnergyPlus/DataSurfaceLists.cc +++ b/src/EnergyPlus/DataSurfaceLists.cc @@ -224,7 +224,9 @@ void GetSurfaceListsInputs(EnergyPlusData &state) cNumericFields.deallocate(); lNumericBlanks.deallocate(); - if (ErrorsFound) ShowSevereError(state, format("{}{}", CurrentModuleObject1, " errors found getting input. Program will terminate.")); + if (ErrorsFound) { + ShowSevereError(state, format("{}{}", CurrentModuleObject1, " errors found getting input. Program will terminate.")); + } } if (NumOfSurfListVentSlab > 0) { @@ -329,10 +331,14 @@ void GetSurfaceListsInputs(EnergyPlusData &state) cNumericFields.deallocate(); lNumericBlanks.deallocate(); - if (ErrorsFound) ShowSevereError(state, format("{}{}", CurrentModuleObject2, " errors found getting input. Program will terminate.")); + if (ErrorsFound) { + ShowSevereError(state, format("{}{}", CurrentModuleObject2, " errors found getting input. Program will terminate.")); + } } - if (ErrorsFound) ShowFatalError(state, "GetSurfaceListsInputs: Program terminates due to preceding conditions."); + if (ErrorsFound) { + ShowFatalError(state, "GetSurfaceListsInputs: Program terminates due to preceding conditions."); + } } int GetNumberOfSurfaceLists(EnergyPlusData &state) diff --git a/src/EnergyPlus/DesiccantDehumidifiers.cc b/src/EnergyPlus/DesiccantDehumidifiers.cc index a9a3aafc4e0..6825198c6a7 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -774,8 +774,8 @@ namespace DesiccantDehumidifiers { DataLoopNode::ObjectIsNotParent); if (desicDehum.ControlNodeNum == 0) { - ShowContinueError(state, format("{} = \"{}\"", desicDehum.DehumType, desicDehum.Name)); - ShowSevereError(state, format("{} must be specified.", cAlphaFields(5))); + ShowSevereError(state, format("{} = \"{}\"", desicDehum.DehumType, desicDehum.Name)); + ShowContinueError(state, format("{} must be specified.", cAlphaFields(5))); ErrorsFoundGeneric = true; } diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index c63f0b6fc95..836b1187794 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -939,10 +939,11 @@ namespace FluidProperties { if (NumNumbers != state.dataFluidProps->RefrigData(Loop).NumHPoints) { ShowSevereError( state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); - ShowSevereError(state, - format("Temperature Name={}, Temperature array and saturated fluid enthalpy array must have the same " - "number of points", - TempsName)); + ShowContinueError( + state, + format("Temperature Name={}, Temperature array and saturated fluid enthalpy array must have the same " + "number of points", + TempsName)); ShowContinueError(state, format("Temperature # points={} whereas {} # points={}", NumNumbers, @@ -1105,7 +1106,7 @@ namespace FluidProperties { if (NumNumbers != state.dataFluidProps->RefrigData(Loop).NumCpPoints) { ShowSevereError( state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); - ShowSevereError( + ShowContinueError( state, format("Temperature Name={}, Temperature array and saturated fluid Cp array must have the same number of points", TempsName)); @@ -1395,7 +1396,7 @@ namespace FluidProperties { // If it made it all the way to the last input occurrence and didn't find a match, then no sat f/g density data found if (InData == NumOfSatFluidPropArrays) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); - ShowSevereError( + ShowContinueError( state, format(R"(No Saturated Gas/Fluid Density found. Need properties to be entered with {}="Density" and {}="FluidGas".)", cAlphaFieldNames(2), @@ -1767,12 +1768,12 @@ namespace FluidProperties { if (NumOfPressPts == 0) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); - ShowSevereError(state, "No pressure data found for superheated density"); + ShowContinueError(state, "No pressure data found for superheated density"); ErrorsFound = true; } if (NumOfPressPts != state.dataFluidProps->RefrigData(Loop).NumSuperPressPts) { ShowSevereError(state, format("{}{} Name={}", RoutineName, CurrentModuleObject, state.dataFluidProps->RefrigData(Loop).Name)); - ShowSevereError(state, "Number of pressure points for superheated data different for enthalpy and density"); + ShowContinueError(state, "Number of pressure points for superheated data different for enthalpy and density"); ErrorsFound = true; } diff --git a/src/EnergyPlus/FuelCellElectricGenerator.cc b/src/EnergyPlus/FuelCellElectricGenerator.cc index 47a55dcc2b1..c2a50442c7f 100644 --- a/src/EnergyPlus/FuelCellElectricGenerator.cc +++ b/src/EnergyPlus/FuelCellElectricGenerator.cc @@ -448,7 +448,7 @@ namespace FuelCellElectricGenerator { DataGenerators::AirSupRateMode::QuadraticFuncofPel)) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), AlphArray(5))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); - ShowSevereError(state, "Curve name was not found"); + ShowContinueError(state, "Curve name was not found"); ErrorsFound = true; } @@ -460,7 +460,7 @@ namespace FuelCellElectricGenerator { DataGenerators::AirSupRateMode::QuadraticFuncofNdot)) { ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(6), AlphArray(6))); ShowContinueError(state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, AlphArray(1))); - ShowSevereError(state, "Curve name was not found"); + ShowContinueError(state, "Curve name was not found"); ErrorsFound = true; } diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 1f456af1569..4824c68a9e0 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -937,7 +937,7 @@ namespace Furnaces { } if (!AirNodeFound) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); - ShowSevereError(state, "Did not find Air Node (Zone with Thermostat)."); + ShowContinueError(state, "Did not find Air Node (Zone with Thermostat)."); ShowContinueError(state, format("Specified {} = {}", cAlphaFields(6), Alphas(6))); ShowContinueError( state, "Both a ZoneHVAC:EquipmentConnections object and a ZoneControl:Thermostat object must be specified for this zone."); @@ -945,7 +945,7 @@ namespace Furnaces { } if (!AirLoopFound) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); - ShowSevereError(state, "Did not find correct Primary Air Loop."); + ShowContinueError(state, "Did not find correct Primary Air Loop."); ShowContinueError(state, format("Specified {} = {} is not served by this AirLoopHVAC equipment.", cAlphaFields(6), Alphas(6))); ErrorsFound = true; } @@ -1478,7 +1478,7 @@ namespace Furnaces { } if (!AirLoopFound) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); - ShowSevereError(state, "Did not find correct AirLoopHVAC."); + ShowContinueError(state, "Did not find correct AirLoopHVAC."); ShowContinueError(state, format("Specified {} = {}", cAlphaFields(6), Alphas(6))); ErrorsFound = true; } @@ -2759,7 +2759,7 @@ namespace Furnaces { } if (!AirLoopFound) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); - ShowSevereError(state, "Did not find correct AirLoopHVAC."); + ShowContinueError(state, "Did not find correct AirLoopHVAC."); ShowContinueError(state, format("Specified {} = {}", cAlphaFields(5), Alphas(5))); ErrorsFound = true; } @@ -3680,7 +3680,7 @@ namespace Furnaces { } if (!AirLoopFound) { ShowSevereError(state, format("{} = {}", CurrentModuleObject, Alphas(1))); - ShowSevereError(state, "Did not find correct AirLoopHVAC."); + ShowContinueError(state, "Did not find correct AirLoopHVAC."); ShowContinueError(state, format("Specified {} = {}", cAlphaFields(5), Alphas(5))); ErrorsFound = true; } diff --git a/src/EnergyPlus/HVACControllers.cc b/src/EnergyPlus/HVACControllers.cc index a0a1ba563e2..18614ac6d3a 100644 --- a/src/EnergyPlus/HVACControllers.cc +++ b/src/EnergyPlus/HVACControllers.cc @@ -481,17 +481,18 @@ void GetControllerInput(EnergyPlusData &state) controllerProps.ControlVar = static_cast(getEnumValue(ctrlVarNamesUC, AlphArray(2))); if (controllerProps.ControlVar == HVACControllers::CtrlVarType::Invalid) { ShowSevereError(state, format("{}{}=\"{}\".", RoutineName, CurrentModuleObject, AlphArray(1))); - ShowSevereError(state, - format("...Invalid {}=\"{}\", must be Temperature, HumidityRatio, or TemperatureAndHumidityRatio.", - cAlphaFields(2), - AlphArray(2))); + ShowContinueError(state, + format("...Invalid {}=\"{}\", must be Temperature, HumidityRatio, or TemperatureAndHumidityRatio.", + cAlphaFields(2), + AlphArray(2))); ErrorsFound = true; } controllerProps.Action = static_cast(getEnumValue(actionNamesUC, AlphArray(3))); if (controllerProps.Action == ControllerAction::Invalid) { ShowSevereError(state, format("{}{}=\"{}\".", RoutineName, CurrentModuleObject, AlphArray(1))); - ShowSevereError(state, format("...Invalid {}=\"{}{}", cAlphaFields(3), AlphArray(3), R"(", must be "Normal", "Reverse" or blank.)")); + ShowContinueError(state, + format("...Invalid {}=\"{}{}", cAlphaFields(3), AlphArray(3), R"(", must be "Normal", "Reverse" or blank.)")); ErrorsFound = true; } diff --git a/src/EnergyPlus/HeatBalanceManager.cc b/src/EnergyPlus/HeatBalanceManager.cc index 5f791ee9e1a..0fe4ce6137a 100644 --- a/src/EnergyPlus/HeatBalanceManager.cc +++ b/src/EnergyPlus/HeatBalanceManager.cc @@ -1622,7 +1622,7 @@ namespace HeatBalanceManager { ShowSevereError( state, format("Invalid material layer type in window {} = {}", state.dataHeatBalMgr->CurrentModuleObject, thisConstruct.Name)); - ShowSevereError( + ShowContinueError( state, format("Equivalent Layer material type = {} is allowed only in Construction:WindowEquivalentLayer window object.", ConstructAlphas(Layer))); diff --git a/src/EnergyPlus/Humidifiers.cc b/src/EnergyPlus/Humidifiers.cc index 640fe85053c..272bb4ca2a1 100644 --- a/src/EnergyPlus/Humidifiers.cc +++ b/src/EnergyPlus/Humidifiers.cc @@ -417,7 +417,7 @@ namespace Humidifiers { } else if (!lAlphaBlanks(3)) { ShowSevereError(state, format("{}{}=\"{}\",", RoutineName, CurrentModuleObject, Alphas(1))); ShowContinueError(state, format("Invalid {}={}", cAlphaFields(3), Alphas(3))); - ShowSevereError(state, format("...{} not found.", cAlphaFields(3))); + ShowContinueError(state, format("...{} not found.", cAlphaFields(3))); ErrorsFound = true; } diff --git a/src/EnergyPlus/Material.cc b/src/EnergyPlus/Material.cc index 1fe530d141c..3ef174f1191 100644 --- a/src/EnergyPlus/Material.cc +++ b/src/EnergyPlus/Material.cc @@ -1802,7 +1802,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if if (matScreen->TransThermal + matScreen->AbsorpThermal >= 1.0) { ErrorsFound = true; ShowSevereError(state, state.dataHeatBalMgr->CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Illegal value combination."); - ShowSevereError(state, "Thermal hemispherical emissivity plus open area fraction (1-diameter/spacing)**2 not < 1.0"); + ShowContinueError(state, "Thermal hemispherical emissivity plus open area fraction (1-diameter/spacing)**2 not < 1.0"); } } @@ -1933,7 +1933,7 @@ void GetMaterialData(EnergyPlusData &state, bool &ErrorsFound) // set to true if if (matScreen->TransThermal + matScreen->AbsorpThermal >= 1.0) { ErrorsFound = true; ShowSevereError(state, state.dataHeatBalMgr->CurrentModuleObject + "=\"" + MaterialNames(1) + "\", Illegal value combination."); - ShowSevereError(state, "Thermal hemispherical emissivity plus open area fraction (1-diameter/spacing)**2 not < 1.0"); + ShowContinueError(state, "Thermal hemispherical emissivity plus open area fraction (1-diameter/spacing)**2 not < 1.0"); } } // TotScreensEQL loop diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index 7fec013cf98..22791b28da1 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -289,7 +289,7 @@ void GetMTGeneratorInput(EnergyPlusData &state) if (state.dataMircoturbElectGen->MTGenerator(GeneratorNum).ElecEffFTempCurveNum == 0) { ShowSevereError( state, format("{} \"{}\"", state.dataIPShortCut->cCurrentModuleObject, state.dataMircoturbElectGen->MTGenerator(GeneratorNum).Name)); - ShowSevereError(state, format("{} not found = {}", state.dataIPShortCut->cAlphaFieldNames(3), AlphArray(3))); + ShowContinueError(state, format("{} not found = {}", state.dataIPShortCut->cAlphaFieldNames(3), AlphArray(3))); ErrorsFound = true; } else { // Verify curve object, only legal types are Quadratic and Cubic @@ -319,7 +319,7 @@ void GetMTGeneratorInput(EnergyPlusData &state) if (state.dataMircoturbElectGen->MTGenerator(GeneratorNum).ElecEffFPLRCurveNum == 0) { ShowSevereError( state, format("{} \"{}\"", state.dataIPShortCut->cCurrentModuleObject, state.dataMircoturbElectGen->MTGenerator(GeneratorNum).Name)); - ShowSevereError(state, format("{} not found = {}", state.dataIPShortCut->cAlphaFieldNames(4), AlphArray(4))); + ShowContinueError(state, format("{} not found = {}", state.dataIPShortCut->cAlphaFieldNames(4), AlphArray(4))); ErrorsFound = true; } else { // Verify curve object, only legal types are Quadratic and Cubic @@ -352,7 +352,7 @@ void GetMTGeneratorInput(EnergyPlusData &state) if (state.dataMircoturbElectGen->MTGenerator(GeneratorNum).FuelType == Constant::eFuel::Invalid) { ShowSevereError( state, format("{} \"{}\"", state.dataIPShortCut->cCurrentModuleObject, state.dataMircoturbElectGen->MTGenerator(GeneratorNum).Name)); - ShowSevereError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), AlphArray(5))); + ShowContinueError(state, format("Invalid {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), AlphArray(5))); ErrorsFound = true; } diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index 473cef9deff..dd162c8c8a1 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -2543,7 +2543,7 @@ void InitOAController(EnergyPlusData &state, int const OAControllerNum, bool con if (state.dataLoopNodes->Node(MixedAirNode).TempSetPoint == SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { ShowSevereError(state, format("MixedAir: Missing temperature setpoint for economizer controller {}", thisOAController.Name)); - ShowSevereError(state, format("Node Referenced (by Controller)={}", state.dataLoopNodes->NodeID(MixedAirNode))); + ShowContinueError(state, format("Node Referenced (by Controller)={}", state.dataLoopNodes->NodeID(MixedAirNode))); ShowContinueError( state, " use a Setpoint Manager with Control Variable = \"Temperature\" to establish a setpoint at the mixed air node."); state.dataHVACGlobal->SetPointErrorFlag = true; @@ -2554,7 +2554,7 @@ void InitOAController(EnergyPlusData &state, int const OAControllerNum, bool con if (state.dataHVACGlobal->SetPointErrorFlag) { ShowSevereError(state, format("MixedAir: Missing temperature setpoint for economizer controller {}", thisOAController.Name)); - ShowSevereError(state, format("Node Referenced (by Controller)={}", state.dataLoopNodes->NodeID(MixedAirNode))); + ShowContinueError(state, format("Node Referenced (by Controller)={}", state.dataLoopNodes->NodeID(MixedAirNode))); ShowContinueError(state, " use a Setpoint Manager with Control Variable = \"Temperature\" to establish a setpoint at the " "mixed air node."); diff --git a/src/EnergyPlus/MoistureBalanceEMPDManager.cc b/src/EnergyPlus/MoistureBalanceEMPDManager.cc index c3957c87ec6..2930c76a51c 100644 --- a/src/EnergyPlus/MoistureBalanceEMPDManager.cc +++ b/src/EnergyPlus/MoistureBalanceEMPDManager.cc @@ -218,8 +218,8 @@ void GetMoistureBalanceEMPDInput(EnergyPlusData &state) if (material->ROnly) { // CALL ShowSevereError('EMPD base material = "'//TRIM(dataMaterial.Material(MaterNum)%Name)// & // '" was Material:NoMass. It cannot be used for EMPD calculations.') - ShowContinueError(state, "..Only Material base materials are allowed to have EMPD properties."); - ShowSevereError( + ShowSevereError(state, "..Only Material base materials are allowed to have EMPD properties."); + ShowContinueError( state, format("{}: Reference Material is not appropriate type for EMPD properties, material={}, must have regular properties (L,Cp,K,D)", cCurrentModuleObject, diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index a51e5cbca6c..975ae7dbca0 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -496,7 +496,7 @@ namespace PlantChillers { if (thisChiller.CondVolFlowRate <= 0.0) { ShowSevereError( state, format("Invalid {}={:.6R}", state.dataIPShortCut->cNumericFieldNames(10), state.dataIPShortCut->rNumericArgs(10))); - ShowSevereError(state, "Condenser fluid flow rate must be specified for Heat Reclaim applications."); + ShowContinueError(state, "Condenser fluid flow rate must be specified for Heat Reclaim applications."); ShowContinueError( state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ErrorsFound = true; @@ -2543,7 +2543,7 @@ namespace PlantChillers { if (thisChiller.CondVolFlowRate <= 0.0) { ShowSevereError( state, format("Invalid {}={:.6R}", state.dataIPShortCut->cNumericFieldNames(10), state.dataIPShortCut->rNumericArgs(10))); - ShowSevereError(state, "Condenser fluid flow rate must be specified for Heat Reclaim applications."); + ShowContinueError(state, "Condenser fluid flow rate must be specified for Heat Reclaim applications."); ShowContinueError( state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ErrorsFound = true; @@ -4555,7 +4555,7 @@ namespace PlantChillers { if (thisChiller.CondVolFlowRate <= 0.0) { ShowSevereError( state, format("Invalid {}={:.6R}", state.dataIPShortCut->cNumericFieldNames(10), state.dataIPShortCut->rNumericArgs(10))); - ShowSevereError(state, "Condenser fluid flow rate must be specified for Heat Reclaim applications."); + ShowContinueError(state, "Condenser fluid flow rate must be specified for Heat Reclaim applications."); ShowContinueError( state, format("Entered in {}={}", state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); ErrorsFound = true; diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index c8191fa36c2..9787f72bb95 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -10644,7 +10644,7 @@ namespace SurfaceGeometry { auto const &surf = state.dataSurface->Surface(SurfNum); if (surf.Class != SurfaceClass::Window || surf.ExtBoundCond != 0) { ShowSevereError(state, format("{}=\"{}\"", cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1))); - ShowSevereError(state, format("cannot be used with surface={}", surf.Name)); + ShowContinueError(state, format("cannot be used with surface={}", surf.Name)); ShowContinueError(state, "because that surface is not an exterior window."); ErrorsFound = true; } @@ -12172,10 +12172,10 @@ namespace SurfaceGeometry { (MaterialLayerGroup == Material::Group::ScreenEquivalentLayer) || (MaterialLayerGroup == Material::Group::GapEquivalentLayer)) { ShowSevereError(state, format("Invalid movable insulation material for {}:", cCurrentModuleObject)); - ShowSevereError( + ShowContinueError( state, format("...Movable insulation material type specified = {}", cMaterialGroupType(static_cast(MaterialLayerGroup)))); - ShowSevereError(state, format("...Movable insulation material name specified = {}", state.dataIPShortCut->cAlphaArgs(3))); + ShowContinueError(state, format("...Movable insulation material name specified = {}", state.dataIPShortCut->cAlphaArgs(3))); ErrorsFound = true; } if (SchNum == 0) { diff --git a/src/EnergyPlus/ThermalComfort.cc b/src/EnergyPlus/ThermalComfort.cc index e876addcda6..c46a47475ec 100644 --- a/src/EnergyPlus/ThermalComfort.cc +++ b/src/EnergyPlus/ThermalComfort.cc @@ -2013,7 +2013,7 @@ namespace ThermalComfort { int WhichAFList = thisPeople.AngleFactorListPtr; if (WhichAFList == 0 && (thisPeople.Fanger || thisPeople.Pierce || thisPeople.KSU)) { ShowSevereError(state, format("{}{}=\"{}\", invalid", routineName, cCurrentModuleObject, thisPeople.AngleFactorListName)); - ShowSevereError(state, format("... Angle Factor List Name not found for PEOPLE=\"{}\"", thisPeople.Name)); + ShowContinueError(state, format("... Angle Factor List Name not found for PEOPLE=\"{}\"", thisPeople.Name)); ErrorsFound = true; } else { auto &thisAngFacList = state.dataThermalComforts->AngleFactorList(WhichAFList); diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 29cf56ad968..3b376b07df3 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -5368,7 +5368,7 @@ namespace UnitarySystems { this->m_SuppHeatCoilIndex = SteamCoils::GetSteamCoilIndex(state, "COIL:HEATING:STEAM", this->m_SuppHeatCoilName, errFlag); if (errFlag) { ShowSevereError(state, format("{} = {}", cCurrentModuleObject, thisObjectName)); - ShowSevereError(state, format("Illegal Supplemental Heating Coil Name = {}", this->m_SuppHeatCoilName)); + ShowContinueError(state, format("Illegal Supplemental Heating Coil Name = {}", this->m_SuppHeatCoilName)); errorsFound = true; errFlag = false; } else { @@ -5403,7 +5403,7 @@ namespace UnitarySystems { state, this->m_SuppHeatCoilName, this->m_SuppHeatCoilIndex, errFlag, cCurrentModuleObject); if (errFlag) { ShowSevereError(state, format("{} = {}", cCurrentModuleObject, thisObjectName)); - ShowSevereError(state, format("Illegal Supplemental Heating Coil Name = {}", this->m_SuppHeatCoilName)); + ShowContinueError(state, format("Illegal Supplemental Heating Coil Name = {}", this->m_SuppHeatCoilName)); errorsFound = true; errFlag = false; } else { @@ -5417,7 +5417,7 @@ namespace UnitarySystems { } else { // Illegal reheating coil type ShowSevereError(state, format("{} = {}", cCurrentModuleObject, thisObjectName)); - ShowSevereError(state, format("Illegal Supplemental Heating Coil Type = {}", this->m_SuppHeatCoilTypeName)); + ShowContinueError(state, format("Illegal Supplemental Heating Coil Type = {}", this->m_SuppHeatCoilTypeName)); errorsFound = true; } // IF (this->SuppHeatCoilType_Num == Coil_HeatingGasOrOtherFuel .OR. &, etc. diff --git a/src/EnergyPlus/WeatherManager.cc b/src/EnergyPlus/WeatherManager.cc index 6b267eaf01a..edca51ffa12 100644 --- a/src/EnergyPlus/WeatherManager.cc +++ b/src/EnergyPlus/WeatherManager.cc @@ -6002,7 +6002,7 @@ namespace Weather { if (!ScheduleManager::CheckDayScheduleValueMinMax(state, desDayInput.TempRangeSchPtr, 0.0, false)) { ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); ShowContinueError(state, format("..invalid field: {}=\"{}\".", ipsc->cAlphaFieldNames(4), ipsc->cAlphaArgs(4))); - ShowSevereError(state, "Some [Schedule] Dry-bulb Range Difference Values are < 0.0 [would make max larger]."); + ShowContinueError(state, "Some [Schedule] Dry-bulb Range Difference Values are < 0.0 [would make max larger]."); ErrorsFound = true; } } @@ -6211,7 +6211,7 @@ namespace Weather { if (!ScheduleManager::CheckDayScheduleValueMinMax(state, desDayInput.HumIndSchPtr, 0.0, false)) { ShowSevereError(state, format("{}=\"{}\", invalid data.", ipsc->cCurrentModuleObject, desDayInput.Title)); ShowContinueError(state, format("..invalid field: {}=\"{}\".", ipsc->cAlphaFieldNames(6), ipsc->cAlphaArgs(6))); - ShowSevereError(state, "Some [Schedule] Wet-bulb Profile Difference Values are < 0.0 [would make max larger]."); + ShowContinueError(state, "Some [Schedule] Wet-bulb Profile Difference Values are < 0.0 [would make max larger]."); ErrorsFound = true; } } break; From cf3b3c52b2b7bd228a0dd41a52ed8a27d29056ca Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Mon, 22 Jul 2024 16:30:35 -0700 Subject: [PATCH 055/164] transition testfiles to use Fan:SystemModel --- ...riableRefrigerantFlow_FluidTCtrl_5Zone.idf | 235 ++++++++++++------ ...bleRefrigerantFlow_FluidTCtrl_HR_5Zone.idf | 235 ++++++++++++------ ...erantFlow_FluidTCtrl_wSuppHeater_5Zone.idf | 235 ++++++++++++------ 3 files changed, 480 insertions(+), 225 deletions(-) diff --git a/testfiles/VariableRefrigerantFlow_FluidTCtrl_5Zone.idf b/testfiles/VariableRefrigerantFlow_FluidTCtrl_5Zone.idf index d766ef40844..877b1e884fa 100644 --- a/testfiles/VariableRefrigerantFlow_FluidTCtrl_5Zone.idf +++ b/testfiles/VariableRefrigerantFlow_FluidTCtrl_5Zone.idf @@ -320,7 +320,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU1 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU1 OA Mixer, !- Outside Air Mixer Object Name @@ -351,7 +351,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU2 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU2 OA Mixer, !- Outside Air Mixer Object Name @@ -382,7 +382,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU3 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU3 OA Mixer, !- Outside Air Mixer Object Name @@ -413,7 +413,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU4 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU4 OA Mixer, !- Outside Air Mixer Object Name @@ -444,7 +444,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU5 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU5 OA Mixer, !- Outside Air Mixer Object Name @@ -505,106 +505,191 @@ Relief Air Outlet Node 5,!- Relief Air Stream Node Name TU5 Inlet Node; !- Return Air Stream Node Name - Fan:VariableVolume, + Fan:SystemModel, TU1 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU1 Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU1 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU1 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU2 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU2 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU2 Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU2 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU2 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU3 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU3 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU3 Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU3 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU3 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU4 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU4 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU4 Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU4 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU4 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU5 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU5 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU5 Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU5 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory + Curve:Quartic, + TU5 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + !- =========== ALL OBJECTS IN CLASS: COIL:COOLING:DX:VARIABLEREFRIGERANTFLOW:FLUIDTEMPERATURECONTROL =========== Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, diff --git a/testfiles/VariableRefrigerantFlow_FluidTCtrl_HR_5Zone.idf b/testfiles/VariableRefrigerantFlow_FluidTCtrl_HR_5Zone.idf index 31458c8e19f..423639c97d9 100644 --- a/testfiles/VariableRefrigerantFlow_FluidTCtrl_HR_5Zone.idf +++ b/testfiles/VariableRefrigerantFlow_FluidTCtrl_HR_5Zone.idf @@ -339,7 +339,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU1 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU1 OA Mixer, !- Outside Air Mixer Object Name @@ -370,7 +370,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU2 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU2 OA Mixer, !- Outside Air Mixer Object Name @@ -401,7 +401,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU3 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU3 OA Mixer, !- Outside Air Mixer Object Name @@ -432,7 +432,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU4 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU4 OA Mixer, !- Outside Air Mixer Object Name @@ -463,7 +463,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU5 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU5 OA Mixer, !- Outside Air Mixer Object Name @@ -524,106 +524,191 @@ Relief Air Outlet Node 5,!- Relief Air Stream Node Name TU5 Inlet Node; !- Return Air Stream Node Name - Fan:VariableVolume, + Fan:SystemModel, TU1 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU1 Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU1 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU1 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU2 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU2 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU2 Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU2 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU2 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU3 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU3 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU3 Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU3 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU3 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU4 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU4 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU4 Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU4 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU4 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU5 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU5 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU5 Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU5 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory + Curve:Quartic, + TU5 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + !- =========== ALL OBJECTS IN CLASS: COIL:COOLING:DX:VARIABLEREFRIGERANTFLOW:FLUIDTEMPERATURECONTROL =========== Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, diff --git a/testfiles/VariableRefrigerantFlow_FluidTCtrl_wSuppHeater_5Zone.idf b/testfiles/VariableRefrigerantFlow_FluidTCtrl_wSuppHeater_5Zone.idf index d5a19ad2e8d..611e87422c2 100644 --- a/testfiles/VariableRefrigerantFlow_FluidTCtrl_wSuppHeater_5Zone.idf +++ b/testfiles/VariableRefrigerantFlow_FluidTCtrl_wSuppHeater_5Zone.idf @@ -2207,7 +2207,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU1 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU1 OA Mixer, !- Outside Air Mixer Object Name @@ -2238,7 +2238,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU2 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU2 OA Mixer, !- Outside Air Mixer Object Name @@ -2269,7 +2269,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU3 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU3 OA Mixer, !- Outside Air Mixer Object Name @@ -2300,7 +2300,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU4 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU4 OA Mixer, !- Outside Air Mixer Object Name @@ -2331,7 +2331,7 @@ autosize, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:VariableVolume, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU5 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU5 OA Mixer, !- Outside Air Mixer Object Name @@ -2444,106 +2444,191 @@ !- =========== ALL OBJECTS IN CLASS: FAN:VARIABLEVOLUME =========== - Fan:VariableVolume, + Fan:SystemModel, TU1 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU1 VRF Fan Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU1 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU1 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU2 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU2 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU2 VRF Fan Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU2 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU2 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU3 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU3 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU3 VRF Fan Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU3 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU3 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU4 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU4 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU4 VRF Fan Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU4 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory - Fan:VariableVolume, + Curve:Quartic, + TU4 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + + Fan:SystemModel, TU5 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name - 0.7, !- Fan Total Efficiency - 600, !- Pressure Rise {Pa} - autosize, !- Maximum Flow Rate {m3/s} - Fraction, !- Fan Power Minimum Flow Rate Input Method - 0, !- Fan Power Minimum Flow Fraction - 0, !- Fan Power Minimum Air Flow Rate {m3/s} - 0.9, !- Motor Efficiency - 1, !- Motor In Airstream Fraction - 0.059, !- Fan Power Coefficient 1 - 0, !- Fan Power Coefficient 2 - 0, !- Fan Power Coefficient 3 - 0.928, !- Fan Power Coefficient 4 - 0, !- Fan Power Coefficient 5 TU5 VRF DX HCoil Outlet Node, !- Air Inlet Node Name TU5 VRF Fan Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU5 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction General; !- End-Use Subcategory + Curve:Quartic, + TU5 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type + !- =========== ALL OBJECTS IN CLASS: COIL:COOLING:DX:VARIABLEREFRIGERANTFLOW:FLUIDTEMPERATURECONTROL =========== Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, From a944b98c281b6c519e356a8ce03521def5bd69fe Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Tue, 23 Jul 2024 09:11:23 -0500 Subject: [PATCH 056/164] Add timestamp index argument to error message functions --- src/EnergyPlus/UtilityRoutines.cc | 7 ++++++- src/EnergyPlus/UtilityRoutines.hh | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/UtilityRoutines.cc b/src/EnergyPlus/UtilityRoutines.cc index 57c40b441ee..3d939da6a60 100644 --- a/src/EnergyPlus/UtilityRoutines.cc +++ b/src/EnergyPlus/UtilityRoutines.cc @@ -877,9 +877,14 @@ void emitErrorMessage(EnergyPlusData &state, [[maybe_unused]] ErrorMessageCatego void emitErrorMessages(EnergyPlusData &state, [[maybe_unused]] ErrorMessageCategory category, std::initializer_list const &msgs, - bool shouldFatal) + bool const shouldFatal, + int const zeroBasedTimeStampIndex) { for (auto msg = msgs.begin(); msg != msgs.end(); ++msg) { + if (msg - msgs.begin() == zeroBasedTimeStampIndex) { + ShowContinueErrorTimeStamp(state, *msg); + continue; + } if (msg == msgs.begin()) { ShowSevereError(state, *msg); } else if (std::next(msg) == msgs.end() && shouldFatal) { diff --git a/src/EnergyPlus/UtilityRoutines.hh b/src/EnergyPlus/UtilityRoutines.hh index e08fe31d4eb..4e8d5751ca2 100644 --- a/src/EnergyPlus/UtilityRoutines.hh +++ b/src/EnergyPlus/UtilityRoutines.hh @@ -154,7 +154,11 @@ enum class ErrorMessageCategory Num }; void emitErrorMessage(EnergyPlusData &state, ErrorMessageCategory category, std::string const &msg, bool shouldFatal); -void emitErrorMessages(EnergyPlusData &state, ErrorMessageCategory category, std::initializer_list const &msgs, bool shouldFatal); +void emitErrorMessages(EnergyPlusData &state, + ErrorMessageCategory category, + std::initializer_list const &msgs, + bool shouldFatal, + int zeroBasedTimeStampIndex = -1); void emitWarningMessage(EnergyPlusData &state, ErrorMessageCategory category, std::string const &msg, bool countAsError = false); void emitWarningMessages(EnergyPlusData &state, ErrorMessageCategory category, From 7dd6720cd02f6a8dd88c27f5f9113a74f84eb3df Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Tue, 23 Jul 2024 08:27:51 -0700 Subject: [PATCH 057/164] change all-upper case to pascal-case --- src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 index 9a8a0a90218..59fbe7b5d11 100644 --- a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 @@ -578,14 +578,14 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile OutArgs(1:13) = InArgs(1:13) IF (SameString(InArgs(14), 'FAN:VARIABLEVOLUME')) THEN isVariableVolume = .TRUE. - OutArgs(14) = 'FAN:SYSTEMMODEL' + OutArgs(14) = 'Fan:SystemModel' OutArgs(15) = TRIM(InArgs(15)) sysFanName = TRIM(InArgs(15)) ELSE OutArgs(14:15) = InArgs(14:15) ENDIF OutArgs(16:CurArgs) = InArgs(16:CurArgs) - CALL WriteOutIDFLines(DifLfn, 'ZONEHVAC:TERMINALUNIT:VARIABLEREFRIGERANTFLOW', CurArgs, OutArgs, NwFldNames, NwFldUnits) + CALL WriteOutIDFLines(DifLfn, 'ZoneHVAC:TerminalUnit:VariableRefrigerantFlow', CurArgs, OutArgs, NwFldNames, NwFldUnits) IF (isVariableVolume) THEN ! create fan system model object From ec58bb0790f8e437dbed7093b877400b05ad81ac Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Tue, 23 Jul 2024 11:44:51 -0500 Subject: [PATCH 058/164] Remove unnecessary namespace specifier in API implementation code --- src/EnergyPlus/api/EnergyPlusPgm.cc | 4 +- src/EnergyPlus/api/datatransfer.cc | 221 ++++++++++++++-------------- 2 files changed, 110 insertions(+), 115 deletions(-) diff --git a/src/EnergyPlus/api/EnergyPlusPgm.cc b/src/EnergyPlus/api/EnergyPlusPgm.cc index a86e8c1a94e..f674a18e3cb 100644 --- a/src/EnergyPlus/api/EnergyPlusPgm.cc +++ b/src/EnergyPlus/api/EnergyPlusPgm.cc @@ -413,7 +413,7 @@ int RunEnergyPlus(EnergyPlus::EnergyPlusData &state, std::string const &filepath } catch (const EnergyPlus::FatalError &e) { return EnergyPlus::AbortEnergyPlus(state); } catch (const std::exception &e) { - EnergyPlus::ShowSevereError(state, e.what()); + ShowSevereError(state, e.what()); return EnergyPlus::AbortEnergyPlus(state); } return wrapUpEnergyPlus(state); @@ -459,7 +459,7 @@ int runEnergyPlusAsLibrary(EnergyPlus::EnergyPlusData &state, const std::vector< } catch (const EnergyPlus::FatalError &e) { return EnergyPlus::AbortEnergyPlus(state); } catch (const std::exception &e) { - EnergyPlus::ShowSevereError(state, e.what()); + ShowSevereError(state, e.what()); return EnergyPlus::AbortEnergyPlus(state); } return wrapUpEnergyPlus(state); diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index 196f1e2b406..f8c8449427c 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -336,9 +336,9 @@ Real64 getVariableValue(EnergyPlusState state, const int handle) } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return zero - EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: Error in getVariableValue; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getVariableValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, fmt::format("Data Exchange API: Error in getVariableValue; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getVariableValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); } thisState->dataPluginManager->apiErrorFlag = true; return 0; @@ -349,9 +349,9 @@ Real64 getVariableValue(EnergyPlusState state, const int handle) } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return zero - EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: Index error in getVariableValue; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getVariableValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, fmt::format("Data Exchange API: Index error in getVariableValue; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getVariableValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); } thisState->dataPluginManager->apiErrorFlag = true; return 0; @@ -380,9 +380,8 @@ Real64 getMeterValue(EnergyPlusState state, int handle) } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return zero - EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: Index error in getMeterValue; received handle: {}", handle)); - EnergyPlus::ShowContinueError(*thisState, - "The getMeterValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, fmt::format("Data Exchange API: Index error in getMeterValue; received handle: {}", handle)); + ShowContinueError(*thisState, "The getMeterValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); } thisState->dataPluginManager->apiErrorFlag = true; return 0; @@ -407,29 +406,28 @@ int getActuatorHandle(EnergyPlusState state, const char *componentType, const ch bool foundActuator = false; for (auto const &usedActuator : thisState->dataRuntimeLang->EMSActuatorUsed) { if (usedActuator.ActuatorVariableNum == handle) { - EnergyPlus::ShowWarningError( + ShowWarningError( *thisState, "Data Exchange API: An EnergyManagementSystem:Actuator seems to be already defined in the EnergyPlus File and named '" + usedActuator.Name + "'."); - EnergyPlus::ShowContinueError( + ShowContinueError( *thisState, fmt::format("Occurred for componentType='{}', controlType='{}', uniqueKey='{}'.", typeUC, controlUC, keyUC)); - EnergyPlus::ShowContinueError(*thisState, - fmt::format("The getActuatorHandle function will still return the handle (= {}) but caller " - "should take note that there is a risk of overwritting.", - handle)); + ShowContinueError(*thisState, + fmt::format("The getActuatorHandle function will still return the handle (= {}) but caller " + "should take note that there is a risk of overwritting.", + handle)); foundActuator = true; break; } } if (!foundActuator) { - EnergyPlus::ShowWarningError(*thisState, - "Data Exchange API: You seem to already have tried to get an Actuator Handle on this one."); - EnergyPlus::ShowContinueError( - *thisState, fmt::format("Occurred for componentType='{}', controlType='{}', uniqueKey='{}'.", typeUC, controlUC, keyUC)); - EnergyPlus::ShowContinueError(*thisState, - fmt::format("The getActuatorHandle function will still return the handle (= {}) but caller should " - "take note that there is a risk of overwritting.", - handle)); + ShowWarningError(*thisState, "Data Exchange API: You seem to already have tried to get an Actuator Handle on this one."); + ShowContinueError(*thisState, + fmt::format("Occurred for componentType='{}', controlType='{}', uniqueKey='{}'.", typeUC, controlUC, keyUC)); + ShowContinueError(*thisState, + fmt::format("The getActuatorHandle function will still return the handle (= {}) but caller should " + "take note that there is a risk of overwritting.", + handle)); } } ++availActuator.handleCount; @@ -453,9 +451,8 @@ void resetActuator(EnergyPlusState state, int handle) } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: index error in resetActuator; received handle: {}", handle)); - EnergyPlus::ShowContinueError(*thisState, - "The resetActuator function will return to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, fmt::format("Data Exchange API: index error in resetActuator; received handle: {}", handle)); + ShowContinueError(*thisState, "The resetActuator function will return to allow the plugin to finish, then EnergyPlus will abort"); } thisState->dataPluginManager->apiErrorFlag = true; } @@ -483,9 +480,8 @@ void setActuatorValue(EnergyPlusState state, const int handle, const Real64 valu } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: index error in setActuatorValue; received handle: {}", handle)); - EnergyPlus::ShowContinueError(*thisState, - "The setActuatorValue function will return to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, fmt::format("Data Exchange API: index error in setActuatorValue; received handle: {}", handle)); + ShowContinueError(*thisState, "The setActuatorValue function will return to allow the plugin to finish, then EnergyPlus will abort"); } thisState->dataPluginManager->apiErrorFlag = true; } @@ -514,9 +510,9 @@ Real64 getActuatorValue(EnergyPlusState state, const int handle) } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return 0 - EnergyPlus::ShowSevereError(*thisState, fmt::format("Data Exchange API: index error in getActuatorValue; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getActuatorValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, fmt::format("Data Exchange API: index error in getActuatorValue; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getActuatorValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); } thisState->dataPluginManager->apiErrorFlag = true; return 0; @@ -564,10 +560,9 @@ Real64 getInternalVariableValue(EnergyPlusState state, int handle) } else { // must be running from python plugin, need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return 0 - EnergyPlus::ShowSevereError(*thisState, - fmt::format("Data Exchange API: index error in getInternalVariableValue; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getInternalVariableValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, fmt::format("Data Exchange API: index error in getInternalVariableValue; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getInternalVariableValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); } thisState->dataPluginManager->apiErrorFlag = true; return 0; @@ -585,9 +580,9 @@ Real64 getPluginGlobalVariableValue(EnergyPlusState state, int handle) if (handle < 0 || handle > thisState->dataPluginManager->pluginManager->maxGlobalVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return 0 - EnergyPlus::ShowSevereError( - *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginGlobalVariableValue; received handle: {}", handle)); - EnergyPlus::ShowContinueError( + ShowSevereError(*thisState, + fmt::format("Data Exchange API: Problem -- index error in getPluginGlobalVariableValue; received handle: {}", handle)); + ShowContinueError( *thisState, "The getPluginGlobalVariableValue function will return 0 for now to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; @@ -601,10 +596,10 @@ void setPluginGlobalVariableValue(EnergyPlusState state, int handle, Real64 valu if (handle < 0 || handle > thisState->dataPluginManager->pluginManager->maxGlobalVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( - *thisState, fmt::format("Data Exchange API: Problem -- index error in setPluginGlobalVariableValue; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginGlobalVariableValue function will return to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, + fmt::format("Data Exchange API: Problem -- index error in setPluginGlobalVariableValue; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getPluginGlobalVariableValue function will return to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; } thisState->dataPluginManager->pluginManager->setGlobalVariableValue(*thisState, handle, value); @@ -622,22 +617,22 @@ Real64 getPluginTrendVariableValue(EnergyPlusState state, int handle, int timeIn if (handle < 0 || handle > thisState->dataPluginManager->pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( - *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableValue; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableValue function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, + fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableValue; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getPluginTrendVariableValue function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } if (timeIndex < 1 || timeIndex > EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(*thisState, handle)) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( + ShowSevereError( *thisState, fmt::format("Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableValue; received value: {}", timeIndex)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableValue function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowContinueError(*thisState, + "The getPluginTrendVariableValue function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } @@ -650,23 +645,23 @@ Real64 getPluginTrendVariableAverage(EnergyPlusState state, int handle, int coun if (handle < 0 || handle > thisState->dataPluginManager->pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( - *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableAverage; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableAverage function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, + fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableAverage; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getPluginTrendVariableAverage function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } if (count < 2 || count > EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(*thisState, handle)) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( + ShowSevereError( *thisState, fmt::format( "Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableAverage; received value: {}", count)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableAverage function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowContinueError(*thisState, + "The getPluginTrendVariableAverage function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } @@ -679,22 +674,22 @@ Real64 getPluginTrendVariableMin(EnergyPlusState state, int handle, int count) if (handle < 0 || handle > thisState->dataPluginManager->pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( - *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableMin; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableMin function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, + fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableMin; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getPluginTrendVariableMin function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } if (count < 2 || count > EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(*thisState, handle)) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( + ShowSevereError( *thisState, fmt::format("Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableMin; received value: {}", count)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableMin function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowContinueError(*thisState, + "The getPluginTrendVariableMin function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } @@ -707,22 +702,22 @@ Real64 getPluginTrendVariableMax(EnergyPlusState state, int handle, int count) if (handle < 0 || handle > thisState->dataPluginManager->pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( - *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableMax; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableMax function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, + fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableMax; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getPluginTrendVariableMax function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } if (count < 2 || count > EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(*thisState, handle)) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( + ShowSevereError( *thisState, fmt::format("Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableMax; received value: {}", count)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableMax function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowContinueError(*thisState, + "The getPluginTrendVariableMax function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } @@ -735,22 +730,22 @@ Real64 getPluginTrendVariableSum(EnergyPlusState state, int handle, int count) if (handle < 0 || handle > thisState->dataPluginManager->pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( - *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableSum; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableSum function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, + fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableSum; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getPluginTrendVariableSum function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } if (count < 2 || count > EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(*thisState, handle)) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( + ShowSevereError( *thisState, fmt::format("Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableSum; received value: {}", count)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableSum function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowContinueError(*thisState, + "The getPluginTrendVariableSum function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } @@ -763,23 +758,23 @@ Real64 getPluginTrendVariableDirection(EnergyPlusState state, int handle, int co if (handle < 0 || handle > thisState->dataPluginManager->pluginManager->maxTrendVariableIndex) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( - *thisState, fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableDirection; received handle: {}", handle)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableDirection function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowSevereError(*thisState, + fmt::format("Data Exchange API: Problem -- index error in getPluginTrendVariableDirection; received handle: {}", handle)); + ShowContinueError(*thisState, + "The getPluginTrendVariableDirection function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } if (count < 2 || count > EnergyPlus::PluginManagement::PluginManager::getTrendVariableHistorySize(*thisState, handle)) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return - EnergyPlus::ShowSevereError( + ShowSevereError( *thisState, fmt::format( "Data Exchange API: Problem -- trend history count argument out of range in getPluginTrendVariableDirection; received value: {}", count)); - EnergyPlus::ShowContinueError( - *thisState, "The getPluginTrendVariableDirection function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); + ShowContinueError(*thisState, + "The getPluginTrendVariableDirection function will return 0 to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; return 0; } @@ -958,7 +953,7 @@ int todayWeatherIsRainAtTime(EnergyPlusState state, int hour, int timeStepNum) (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return (int)thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).IsRain; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0; } @@ -972,7 +967,7 @@ int todayWeatherIsSnowAtTime(EnergyPlusState state, int hour, int timeStepNum) (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return (int)thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).IsSnow; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0; } @@ -986,7 +981,7 @@ Real64 todayWeatherOutDryBulbAtTime(EnergyPlusState state, int hour, int timeSte (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).OutDryBulbTemp; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -999,7 +994,7 @@ Real64 todayWeatherOutDewPointAtTime(EnergyPlusState state, int hour, int timeSt (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).OutDewPointTemp; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1012,7 +1007,7 @@ Real64 todayWeatherOutBarometricPressureAtTime(EnergyPlusState state, int hour, (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).OutBaroPress; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1025,7 +1020,7 @@ Real64 todayWeatherOutRelativeHumidityAtTime(EnergyPlusState state, int hour, in (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).OutRelHum; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1038,7 +1033,7 @@ Real64 todayWeatherWindSpeedAtTime(EnergyPlusState state, int hour, int timeStep (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).WindSpeed; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1051,7 +1046,7 @@ Real64 todayWeatherWindDirectionAtTime(EnergyPlusState state, int hour, int time (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).WindDir; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1064,7 +1059,7 @@ Real64 todayWeatherSkyTemperatureAtTime(EnergyPlusState state, int hour, int tim (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).SkyTemp; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1077,7 +1072,7 @@ Real64 todayWeatherHorizontalIRSkyAtTime(EnergyPlusState state, int hour, int ti (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).HorizIRSky; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1090,7 +1085,7 @@ Real64 todayWeatherBeamSolarRadiationAtTime(EnergyPlusState state, int hour, int (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).BeamSolarRad; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1103,7 +1098,7 @@ Real64 todayWeatherDiffuseSolarRadiationAtTime(EnergyPlusState state, int hour, (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).DifSolarRad; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1116,7 +1111,7 @@ Real64 todayWeatherAlbedoAtTime(EnergyPlusState state, int hour, int timeStepNum (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).Albedo; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1129,7 +1124,7 @@ Real64 todayWeatherLiquidPrecipitationAtTime(EnergyPlusState state, int hour, in (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsToday(timeStepNum, iHour).LiquidPrecip; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1142,7 +1137,7 @@ int tomorrowWeatherIsRainAtTime(EnergyPlusState state, int hour, int timeStepNum (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).IsRain; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0; } @@ -1155,7 +1150,7 @@ int tomorrowWeatherIsSnowAtTime(EnergyPlusState state, int hour, int timeStepNum (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return (int)thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).IsSnow; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0; } @@ -1168,7 +1163,7 @@ Real64 tomorrowWeatherOutDryBulbAtTime(EnergyPlusState state, int hour, int time (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).OutDryBulbTemp; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1181,7 +1176,7 @@ Real64 tomorrowWeatherOutDewPointAtTime(EnergyPlusState state, int hour, int tim (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).OutDewPointTemp; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1194,7 +1189,7 @@ Real64 tomorrowWeatherOutBarometricPressureAtTime(EnergyPlusState state, int hou (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).OutBaroPress; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1207,7 +1202,7 @@ Real64 tomorrowWeatherOutRelativeHumidityAtTime(EnergyPlusState state, int hour, (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).OutRelHum; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1220,7 +1215,7 @@ Real64 tomorrowWeatherWindSpeedAtTime(EnergyPlusState state, int hour, int timeS (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).WindSpeed; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1233,7 +1228,7 @@ Real64 tomorrowWeatherWindDirectionAtTime(EnergyPlusState state, int hour, int t (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).WindDir; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1246,7 +1241,7 @@ Real64 tomorrowWeatherSkyTemperatureAtTime(EnergyPlusState state, int hour, int (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).SkyTemp; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1259,7 +1254,7 @@ Real64 tomorrowWeatherHorizontalIRSkyAtTime(EnergyPlusState state, int hour, int (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).HorizIRSky; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1272,7 +1267,7 @@ Real64 tomorrowWeatherBeamSolarRadiationAtTime(EnergyPlusState state, int hour, (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).BeamSolarRad; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1285,7 +1280,7 @@ Real64 tomorrowWeatherDiffuseSolarRadiationAtTime(EnergyPlusState state, int hou (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).DifSolarRad; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1298,7 +1293,7 @@ Real64 tomorrowWeatherAlbedoAtTime(EnergyPlusState state, int hour, int timeStep (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).Albedo; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } @@ -1311,7 +1306,7 @@ Real64 tomorrowWeatherLiquidPrecipitationAtTime(EnergyPlusState state, const int (timeStepNum <= thisState->dataGlobal->NumOfTimeStepInHour)) { return thisState->dataWeather->wvarsHrTsTomorrow(timeStepNum, iHour).LiquidPrecip; } - EnergyPlus::ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); + ShowSevereError(*thisState, "Invalid return from weather lookup, check hour and time step argument values are in range."); thisState->dataPluginManager->apiErrorFlag = true; return 0.0; } From 9cfd98853b4581ace4c67fdbf88d9078f72fbda6 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Tue, 23 Jul 2024 15:33:05 -0500 Subject: [PATCH 059/164] Use fs::path::string method to get windows compiling --- src/EnergyPlus/api/datatransfer.cc | 2 +- tst/EnergyPlus/api/TestDataTransfer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index fa6d83bdad3..ff98d413d0e 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -243,7 +243,7 @@ void resetErrorFlag(EnergyPlusState state) char *inputFilePath(EnergyPlusState state) { const auto *thisState = static_cast(state); - char *p = new char[std::strlen(thisState->dataStrGlobals->inputFilePath.c_str()) + 1]; + char *p = new char[std::strlen(thisState->dataStrGlobals->inputFilePath.string().c_str()) + 1]; std::strcpy(p, thisState->dataStrGlobals->inputFilePath.c_str()); return p; } diff --git a/tst/EnergyPlus/api/TestDataTransfer.c b/tst/EnergyPlus/api/TestDataTransfer.c index ccd767010b0..5544756772d 100644 --- a/tst/EnergyPlus/api/TestDataTransfer.c +++ b/tst/EnergyPlus/api/TestDataTransfer.c @@ -107,7 +107,7 @@ void afterZoneTimeStepHandler(EnergyPlusState state) exit(1); } - char * filePath = inputFilePath(state); + char *filePath = inputFilePath(state); printf("Input file path accessed via API: %s\n", filePath); free(filePath); From 125f244fa66e4e1b8424a9885afd0407de341d80 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Wed, 24 Jul 2024 08:18:02 -0500 Subject: [PATCH 060/164] Add string() method on fs::path, location 2 --- src/EnergyPlus/api/datatransfer.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index ff98d413d0e..066e0ccfb6e 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -244,7 +244,7 @@ char *inputFilePath(EnergyPlusState state) { const auto *thisState = static_cast(state); char *p = new char[std::strlen(thisState->dataStrGlobals->inputFilePath.string().c_str()) + 1]; - std::strcpy(p, thisState->dataStrGlobals->inputFilePath.c_str()); + std::strcpy(p, thisState->dataStrGlobals->inputFilePath.string().c_str()); return p; } From 24f42e182df08b096064b0fc77bfc2dad738298b Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Wed, 24 Jul 2024 09:01:06 -0500 Subject: [PATCH 061/164] Cleanup in plugin manager mostly --- src/EnergyPlus/PluginManager.cc | 330 ++++++++++++++-------------- src/EnergyPlus/PluginManager.hh | 34 +-- src/EnergyPlus/api/EnergyPlusPgm.cc | 4 +- src/EnergyPlus/api/datatransfer.cc | 2 + 4 files changed, 181 insertions(+), 189 deletions(-) diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 73f2b98fb99..3013431f0a0 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -59,41 +59,39 @@ #if LINK_WITH_PYTHON #include -namespace fmt { -template <> struct formatter +template <> struct fmt::formatter { // parse is inherited from formatter. - constexpr auto parse(format_parse_context &ctx) -> format_parse_context::iterator + static constexpr auto parse(const format_parse_context &ctx) -> format_parse_context::iterator { return ctx.begin(); } - auto format(const PyStatus &status, format_context &ctx) const -> format_context::iterator + static auto format(const PyStatus &status, format_context &ctx) -> format_context::iterator { if (!PyStatus_Exception(status)) { return ctx.out(); } if (PyStatus_IsExit(status)) { - return fmt::format_to(ctx.out(), "Exited with code {}", status.exitcode); + return format_to(ctx.out(), "Exited with code {}", status.exitcode); } if (PyStatus_IsError(status)) { auto it = ctx.out(); - it = fmt::format_to(it, "Fatal Python error: "); + it = format_to(it, "Fatal Python error: "); if (status.func) { - it = fmt::format_to(it, "{}: ", status.func); + it = format_to(it, "{}: ", status.func); } - it = fmt::format_to(it, "{}", status.err_msg); + it = format_to(it, "{}", status.err_msg); return it; } return ctx.out(); } -}; -} // namespace fmt +}; // namespace fmt #endif namespace EnergyPlus::PluginManagement { -PluginTrendVariable::PluginTrendVariable(EnergyPlusData &state, std::string _name, int _numValues, int _indexOfPluginVariable) +PluginTrendVariable::PluginTrendVariable(const EnergyPlusData &state, std::string _name, int const _numValues, int const _indexOfPluginVariable) : name(std::move(_name)), numValues(_numValues), indexOfPluginVariable(_indexOfPluginVariable) { // initialize the deque, so it can be queried immediately, even with just zeroes @@ -103,19 +101,19 @@ PluginTrendVariable::PluginTrendVariable(EnergyPlusData &state, std::string _nam } } -void registerNewCallback(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, const std::function &f) +void registerNewCallback(const EnergyPlusData &state, EMSManager::EMSCallFrom const iCalledFrom, const std::function &f) { state.dataPluginManager->callbacks[iCalledFrom].push_back(f); } -void registerUserDefinedCallback(EnergyPlusData &state, const std::function &f, const std::string &programNameInInputFile) +void registerUserDefinedCallback(const EnergyPlusData &state, const std::function &f, const std::string &programNameInInputFile) { // internally, E+ will UPPER the program name; we should upper the passed in registration name so it matches state.dataPluginManager->userDefinedCallbackNames.push_back(Util::makeUPPER(programNameInInputFile)); state.dataPluginManager->userDefinedCallbacks.push_back(f); } -void onBeginEnvironment(EnergyPlusData &state) +void onBeginEnvironment(const EnergyPlusData &state) { // reset vars and trends -- sensors and actuators are reset by EMS for (auto &v : state.dataPluginManager->globalVariableValues) { @@ -127,33 +125,32 @@ void onBeginEnvironment(EnergyPlusData &state) } } -int PluginManager::numActiveCallbacks(EnergyPlusData &state) +int PluginManager::numActiveCallbacks(const EnergyPlusData &state) { - return (int)state.dataPluginManager->callbacks.size() + (int)state.dataPluginManager->userDefinedCallbacks.size(); + return static_cast(state.dataPluginManager->callbacks.size() + state.dataPluginManager->userDefinedCallbacks.size()); } -void runAnyRegisteredCallbacks(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, bool &anyRan) +void runAnyRegisteredCallbacks(EnergyPlusData &state, EMSManager::EMSCallFrom const iCalledFrom, bool &anyRan) { if (state.dataGlobal->KickOffSimulation) return; for (auto const &cb : state.dataPluginManager->callbacks[iCalledFrom]) { if (iCalledFrom == EMSManager::EMSCallFrom::UserDefinedComponentModel) { continue; // these are called -intentionally- using the runSingleUserDefinedCallback method } - cb((void *)&state); + cb(&state); anyRan = true; } #if LINK_WITH_PYTHON for (auto &plugin : state.dataPluginManager->plugins) { if (plugin.runDuringWarmup || !state.dataGlobal->WarmupFlag) { - bool const didOneRun = plugin.run(state, iCalledFrom); - if (didOneRun) anyRan = true; + if (plugin.run(state, iCalledFrom)) anyRan = true; } } #endif } #if LINK_WITH_PYTHON -std::string pythonStringForUsage(EnergyPlusData &state) +std::string pythonStringForUsage(const EnergyPlusData &state) { if (state.dataGlobal->errorCallback) { return "Python Version not accessible during API calls"; @@ -171,12 +168,12 @@ std::string pythonStringForUsage([[maybe_unused]] EnergyPlusData &state) } #endif -void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) +void PluginManager::setupOutputVariables(EnergyPlusData &state) { #if LINK_WITH_PYTHON // with the PythonPlugin:Variables all set in memory, we can now set them up as outputs as needed std::string const sOutputVariable = "PythonPlugin:OutputVariable"; - int outputVarInstances = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, sOutputVariable); + int const outputVarInstances = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, sOutputVariable); if (outputVarInstances > 0) { auto const instances = state.dataInputProcessing->inputProcessor->epJSON.find(sOutputVariable); if (instances == state.dataInputProcessing->inputProcessor->epJSON.end()) { @@ -201,10 +198,10 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) // call setup output variable - variable TYPE is "PythonPlugin:OutputVariable" int variableHandle = EnergyPlus::PluginManagement::PluginManager::getGlobalVariableHandle(state, varName); if (variableHandle == -1) { - EnergyPlus::ShowSevereError(state, "Failed to match Python Plugin Output Variable"); - EnergyPlus::ShowContinueError(state, format("Trying to create output instance for variable name \"{}\"", varName)); - EnergyPlus::ShowContinueError(state, "No match found, make sure variable is listed in PythonPlugin:Variables object"); - EnergyPlus::ShowFatalError(state, "Python Plugin Output Variable problem causes program termination"); + ShowSevereError(state, "Failed to match Python Plugin Output Variable"); + ShowContinueError(state, format("Trying to create output instance for variable name \"{}\"", varName)); + ShowContinueError(state, "No match found, make sure variable is listed in PythonPlugin:Variables object"); + ShowFatalError(state, "Python Plugin Output Variable problem causes program termination"); } bool isMetered = false; OutputProcessor::StoreType sAvgOrSum = OutputProcessor::StoreType::Average; @@ -258,14 +255,13 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) // We are doing a metered type, we need to get the extra stuff // Resource Type if (fields.find("resource_type") == fields.end()) { - EnergyPlus::ShowSevereError(state, format("Input error on PythonPlugin:OutputVariable = {}", thisObjectName)); - EnergyPlus::ShowContinueError(state, "The variable was marked as metered, but did not define a resource type"); - EnergyPlus::ShowContinueError(state, - "For metered variables, the resource type, group type, and end use category must be defined"); - EnergyPlus::ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); + ShowSevereError(state, format("Input error on PythonPlugin:OutputVariable = {}", thisObjectName)); + ShowContinueError(state, "The variable was marked as metered, but did not define a resource type"); + ShowContinueError(state, "For metered variables, the resource type, group type, and end use category must be defined"); + ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); } std::string const resourceType = EnergyPlus::Util::makeUPPER(fields.at("resource_type").get()); - Constant::eResource resource = static_cast(getEnumValue(Constant::eResourceNamesUC, resourceType)); + Constant::eResource resource; if (resourceType == "WATERUSE") { resource = Constant::eResource::Water; } else if (resourceType == "ONSITEWATERPRODUCED") { @@ -292,14 +288,13 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) // Group Type if (fields.find("group_type") == fields.end()) { - EnergyPlus::ShowSevereError(state, format("Input error on PythonPlugin:OutputVariable = {}", thisObjectName)); - EnergyPlus::ShowContinueError(state, "The variable was marked as metered, but did not define a group type"); - EnergyPlus::ShowContinueError(state, - "For metered variables, the resource type, group type, and end use category must be defined"); - EnergyPlus::ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); + ShowSevereError(state, format("Input error on PythonPlugin:OutputVariable = {}", thisObjectName)); + ShowContinueError(state, "The variable was marked as metered, but did not define a group type"); + ShowContinueError(state, "For metered variables, the resource type, group type, and end use category must be defined"); + ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); } std::string const groupType = EnergyPlus::Util::makeUPPER(fields.at("group_type").get()); - OutputProcessor::Group group = static_cast(getEnumValue(OutputProcessor::groupNamesUC, groupType)); + auto group = static_cast(getEnumValue(OutputProcessor::groupNamesUC, groupType)); if (group == OutputProcessor::Group::Invalid) { ShowSevereError(state, format("Invalid input for PythonPlugin:OutputVariable, unexpected Group Type = {}", groupType)); ShowFatalError(state, "Python plugin output variable input problem causes program termination"); @@ -307,15 +302,13 @@ void PluginManager::setupOutputVariables([[maybe_unused]] EnergyPlusData &state) // End Use Type if (fields.find("end_use_category") == fields.end()) { - EnergyPlus::ShowSevereError(state, format("Input error on PythonPlugin:OutputVariable = {}", thisObjectName)); - EnergyPlus::ShowContinueError(state, "The variable was marked as metered, but did not define an end-use category"); - EnergyPlus::ShowContinueError(state, - "For metered variables, the resource type, group type, and end use category must be defined"); - EnergyPlus::ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); + ShowSevereError(state, format("Input error on PythonPlugin:OutputVariable = {}", thisObjectName)); + ShowContinueError(state, "The variable was marked as metered, but did not define an end-use category"); + ShowContinueError(state, "For metered variables, the resource type, group type, and end use category must be defined"); + ShowFatalError(state, "Input error on PythonPlugin:OutputVariable causes program termination"); } std::string const endUse = EnergyPlus::Util::makeUPPER(fields.at("end_use_category").get()); - OutputProcessor::EndUseCat endUseCat = - static_cast(getEnumValue(OutputProcessor::endUseCatNamesUC, endUse)); + auto endUseCat = static_cast(getEnumValue(OutputProcessor::endUseCatNamesUC, endUse)); if (endUseCat == OutputProcessor::EndUseCat::Invalid) { ShowSevereError(state, format("Invalid input for PythonPlugin:OutputVariable, unexpected End-use Subcategory = {}", endUse)); @@ -400,8 +393,10 @@ void initPython(EnergyPlusData &state, fs::path const &pathToPythonPackages) ShowFatalError(state, fmt::format("Could not read back the PyConfig... {}", status)); } + // ReSharper disable once CppRedundantTypenameKeyword if constexpr (std::is_same_v) { // PyConfig_SetString copies the wide character string str into *config_str. + // ReSharper disable once CppDFAUnreachableCode std::wstring const ws = pathToPythonPackages.generic_wstring(); const wchar_t *wcharPath = ws.c_str(); @@ -462,8 +457,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s // Now read all the actual plugins and interpret them // IMPORTANT -- DO NOT CALL setup() UNTIL ALL INSTANCES ARE DONE std::string const sPlugins = "PythonPlugin:Instance"; - int pluginInstances = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, sPlugins); - if (pluginInstances == 0) { + if (state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, sPlugins) == 0) { return; } @@ -486,7 +480,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s PyRun_SimpleString("import sys"); // allows us to report sys.path later // we also need to set an extra import path to find some dynamic library loading stuff, again make it relative to the binary - PluginManager::addToPythonPath(state, programDir / "python_standard_lib/lib-dynload", false); + addToPythonPath(state, programDir / "python_standard_lib/lib-dynload", false); // now for additional paths: // we'll always want to add the program executable directory to PATH so that Python can find the installed pyenergyplus package @@ -495,7 +489,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s // we will then optionally add any additional paths the user specifies on the search paths object // so add the executable directory here - PluginManager::addToPythonPath(state, programDir, false); + addToPythonPath(state, programDir, false); // Read all the additional search paths next std::string const sPaths = "PythonPlugin:SearchPaths"; @@ -515,26 +509,26 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s std::string workingDirFlagUC = "YES"; try { workingDirFlagUC = EnergyPlus::Util::makeUPPER(fields.at("add_current_working_directory_to_search_path").get()); - } catch (nlohmann::json::out_of_range &e) { + } catch ([[maybe_unused]] nlohmann::json::out_of_range &e) { // defaulted to YES } if (workingDirFlagUC == "YES") { - PluginManager::addToPythonPath(state, ".", false); + addToPythonPath(state, ".", false); } std::string inputFileDirFlagUC = "YES"; try { inputFileDirFlagUC = EnergyPlus::Util::makeUPPER(fields.at("add_input_file_directory_to_search_path").get()); - } catch (nlohmann::json::out_of_range &e) { + } catch ([[maybe_unused]] nlohmann::json::out_of_range &e) { // defaulted to YES } if (inputFileDirFlagUC == "YES") { - PluginManager::addToPythonPath(state, state.dataStrGlobals->inputDirPath, false); + addToPythonPath(state, state.dataStrGlobals->inputDirPath, false); } std::string epInDirFlagUC = "YES"; try { epInDirFlagUC = EnergyPlus::Util::makeUPPER(fields.at("add_epin_environment_variable_to_search_path").get()); - } catch (nlohmann::json::out_of_range &e) { + } catch ([[maybe_unused]] nlohmann::json::out_of_range &e) { // defaulted to YES } if (epInDirFlagUC == "YES") { @@ -542,17 +536,17 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s get_environment_variable("epin", epin_path); fs::path const epinPathObject = fs::path(epin_path); if (epinPathObject.empty()) { - EnergyPlus::ShowWarningMessage( + ShowWarningMessage( state, "PluginManager: Search path inputs requested adding epin variable to Python path, but epin variable was empty, skipping."); } else { fs::path const epinRootDir = FileSystem::getParentDirectoryPath(fs::path(epinPathObject)); if (FileSystem::pathExists(epinRootDir)) { - PluginManager::addToPythonPath(state, epinRootDir, true); + addToPythonPath(state, epinRootDir, true); } else { - EnergyPlus::ShowWarningMessage(state, - "PluginManager: Search path inputs requested adding epin variable to Python path, but epin " - "variable value is not a valid existent path, skipping."); + ShowWarningMessage(state, + "PluginManager: Search path inputs requested adding epin variable to Python path, but epin " + "variable value is not a valid existent path, skipping."); } } } @@ -561,20 +555,20 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s auto const &vars = fields.at("py_search_paths"); for (const auto &var : vars) { try { - PluginManager::addToPythonPath(state, fs::path(var.at("search_path").get()), true); - } catch (nlohmann::json::out_of_range &e) { + addToPythonPath(state, fs::path(var.at("search_path").get()), true); + } catch ([[maybe_unused]] nlohmann::json::out_of_range &e) { // empty entry } } - } catch (nlohmann::json::out_of_range &e) { + } catch ([[maybe_unused]] nlohmann::json::out_of_range &e) { // catch when no paths are passed // nothing to do here } } } else { // no search path objects in the IDF, just do the default behavior: add the current working dir and the input file dir, + epin env var - PluginManager::addToPythonPath(state, ".", false); - PluginManager::addToPythonPath(state, state.dataStrGlobals->inputDirPath, false); + addToPythonPath(state, ".", false); + addToPythonPath(state, state.dataStrGlobals->inputDirPath, false); std::string epin_path; // NOLINT(misc-const-correctness) get_environment_variable("epin", epin_path); @@ -582,7 +576,7 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s if (!epinPathObject.empty()) { fs::path const epinRootDir = FileSystem::getParentDirectoryPath(fs::path(epinPathObject)); if (FileSystem::pathExists(epinRootDir)) { - PluginManager::addToPythonPath(state, epinRootDir, true); + addToPythonPath(state, epinRootDir, true); } } } @@ -687,8 +681,7 @@ PluginManager::~PluginManager() { #if LINK_WITH_PYTHON if (!this->eplusRunningViaPythonAPI) { - bool alreadyInitialized = (Py_IsInitialized() != 0); - if (alreadyInitialized) { + if (Py_IsInitialized() != 0) { if (Py_FinalizeEx() < 0) { exit(120); } @@ -712,8 +705,8 @@ void PluginInstance::reportPythonError([[maybe_unused]] EnergyPlusData &state) Py_DECREF(str_exc_value); char *strExcValue = PyBytes_AsString(pyStr2); // NOLINT(hicpp-signed-bitwise) Py_DECREF(pyStr2); - EnergyPlus::ShowContinueError(state, "Python error description follows: "); - EnergyPlus::ShowContinueError(state, strExcValue); + ShowContinueError(state, "Python error description follows: "); + ShowContinueError(state, strExcValue); // See if we can get a full traceback. // Calls into python, and does the same as capturing the exception in `e` @@ -723,7 +716,7 @@ void PluginInstance::reportPythonError([[maybe_unused]] EnergyPlusData &state) Py_DECREF(pModuleName); if (pyth_module == nullptr) { - EnergyPlus::ShowContinueError(state, "Cannot find 'traceback' module in reportPythonError(), this is weird"); + ShowContinueError(state, "Cannot find 'traceback' module in reportPythonError(), this is weird"); return; } @@ -736,19 +729,18 @@ void PluginInstance::reportPythonError([[maybe_unused]] EnergyPlusData &state) // traceback.format_exception returns a list, so iterate on that if (!pyth_val || !PyList_Check(pyth_val)) { // NOLINT(hicpp-signed-bitwise) - EnergyPlus::ShowContinueError(state, "In reportPythonError(), traceback.format_exception did not return a list."); + ShowContinueError(state, "In reportPythonError(), traceback.format_exception did not return a list."); return; } Py_ssize_t numVals = PyList_Size(pyth_val); if (numVals == 0) { - EnergyPlus::ShowContinueError(state, "No traceback available"); + ShowContinueError(state, "No traceback available"); return; } - EnergyPlus::ShowContinueError(state, "Python traceback follows: "); - - EnergyPlus::ShowContinueError(state, "```"); + ShowContinueError(state, "Python traceback follows: "); + ShowContinueError(state, "```"); for (Py_ssize_t itemNum = 0; itemNum < numVals; itemNum++) { PyObject *item = PyList_GetItem(pyth_val, itemNum); @@ -757,12 +749,12 @@ void PluginInstance::reportPythonError([[maybe_unused]] EnergyPlusData &state) if (!traceback_line.empty() && traceback_line[traceback_line.length() - 1] == '\n') { traceback_line.erase(traceback_line.length() - 1); } - EnergyPlus::ShowContinueError(state, format(" >>> {}", traceback_line)); + ShowContinueError(state, format(" >>> {}", traceback_line)); } // PyList_GetItem returns a borrowed reference, do not decrement } - EnergyPlus::ShowContinueError(state, "```"); + ShowContinueError(state, "```"); // PyList_Size returns a borrowed reference, do not decrement Py_DECREF(pyth_val); // PyObject_CallFunction returns new reference, decrement @@ -777,8 +769,10 @@ void PluginInstance::setup([[maybe_unused]] EnergyPlusData &state) // this first section is really all about just ultimately getting a full Python class instance // this answer helped with a few things: https://ru.stackoverflow.com/a/785927 - PyObject *pModuleName = nullptr; + PyObject *pModuleName; + // ReSharper disable once CppRedundantTypenameKeyword if constexpr (std::is_same_v) { + // ReSharper disable once CppDFAUnreachableCode const std::wstring ws = this->modulePath.generic_wstring(); pModuleName = PyUnicode_FromWideChar(ws.c_str(), static_cast(ws.size())); // New reference } else { @@ -786,31 +780,31 @@ void PluginInstance::setup([[maybe_unused]] EnergyPlusData &state) pModuleName = PyUnicode_FromString(s.c_str()); // New reference } if (pModuleName == nullptr) { - EnergyPlus::ShowFatalError(state, format("Failed to convert the Module Path \"{}\" for import", this->modulePath.generic_string())); + ShowFatalError(state, format("Failed to convert the Module Path \"{}\" for import", this->modulePath.generic_string())); } this->pModule = PyImport_Import(pModuleName); Py_DECREF(pModuleName); if (!this->pModule) { - EnergyPlus::ShowSevereError(state, format("Failed to import module \"{}\"", this->modulePath.generic_string())); - EnergyPlus::ShowContinueError(state, format("Current sys.path={}", PluginManager::currentPythonPath())); + ShowSevereError(state, format("Failed to import module \"{}\"", this->modulePath.generic_string())); + ShowContinueError(state, format("Current sys.path={}", PluginManager::currentPythonPath())); // ONLY call PyErr_Print if PyErr has occurred, otherwise it will cause other problems if (PyErr_Occurred()) { - PluginInstance::reportPythonError(state); + reportPythonError(state); } else { - EnergyPlus::ShowContinueError(state, "It could be that the module could not be found, or that there was an error in importing"); + ShowContinueError(state, "It could be that the module could not be found, or that there was an error in importing"); } - EnergyPlus::ShowFatalError(state, "Python import error causes program termination"); + ShowFatalError(state, "Python import error causes program termination"); } PyObject *pModuleDict = PyModule_GetDict(this->pModule); if (!pModuleDict) { - EnergyPlus::ShowSevereError(state, format("Failed to read module dictionary from module \"{}\"", this->modulePath.generic_string())); + ShowSevereError(state, format("Failed to read module dictionary from module \"{}\"", this->modulePath.generic_string())); if (PyErr_Occurred()) { - PluginInstance::reportPythonError(state); + reportPythonError(state); } else { - EnergyPlus::ShowContinueError(state, "It could be that the module was empty"); + ShowContinueError(state, "It could be that the module was empty"); } - EnergyPlus::ShowFatalError(state, "Python module error causes program termination"); + ShowFatalError(state, "Python module error causes program termination"); } std::string fileVarName = "__file__"; PyObject *pFullPath = PyDict_GetItemString(pModuleDict, fileVarName.c_str()); @@ -826,33 +820,33 @@ void PluginInstance::setup([[maybe_unused]] EnergyPlusData &state) PyObject *pClass = PyDict_GetItemString(pModuleDict, className.c_str()); // Py_DECREF(pModuleDict); // PyModule_GetDict returns a borrowed reference, DO NOT decrement if (!pClass) { - EnergyPlus::ShowSevereError(state, format(R"(Failed to get class type "{}" from module "{}")", className, modulePath.generic_string())); + ShowSevereError(state, format(R"(Failed to get class type "{}" from module "{}")", className, modulePath.generic_string())); if (PyErr_Occurred()) { - PluginInstance::reportPythonError(state); + reportPythonError(state); } else { - EnergyPlus::ShowContinueError(state, "It could be the class name is misspelled or missing."); + ShowContinueError(state, "It could be the class name is misspelled or missing."); } - EnergyPlus::ShowFatalError(state, "Python class import error causes program termination"); + ShowFatalError(state, "Python class import error causes program termination"); } if (!PyCallable_Check(pClass)) { - EnergyPlus::ShowSevereError(state, format("Got class type \"{}\", but it cannot be called/instantiated", className)); + ShowSevereError(state, format("Got class type \"{}\", but it cannot be called/instantiated", className)); if (PyErr_Occurred()) { - PluginInstance::reportPythonError(state); + reportPythonError(state); } else { - EnergyPlus::ShowContinueError(state, "Is it possible the class name is actually just a variable?"); + ShowContinueError(state, "Is it possible the class name is actually just a variable?"); } - EnergyPlus::ShowFatalError(state, "Python class check error causes program termination"); + ShowFatalError(state, "Python class check error causes program termination"); } this->pClassInstance = PyObject_CallObject(pClass, nullptr); // Py_DECREF(pClass); // PyDict_GetItemString returns a borrowed reference, DO NOT decrement if (!this->pClassInstance) { - EnergyPlus::ShowSevereError(state, format("Something went awry calling class constructor for class \"{}\"", className)); + ShowSevereError(state, format("Something went awry calling class constructor for class \"{}\"", className)); if (PyErr_Occurred()) { - PluginInstance::reportPythonError(state); + reportPythonError(state); } else { - EnergyPlus::ShowContinueError(state, "It is possible the plugin class constructor takes extra arguments - it shouldn't."); + ShowContinueError(state, "It is possible the plugin class constructor takes extra arguments - it shouldn't."); } - EnergyPlus::ShowFatalError(state, "Python class constructor error causes program termination"); + ShowFatalError(state, "Python class constructor error causes program termination"); } // PyObject_CallObject returns a new reference, that we need to manage // I think we need to keep it around in memory though so the class methods can be called later on, @@ -863,38 +857,38 @@ void PluginInstance::setup([[maybe_unused]] EnergyPlusData &state) std::string const detectOverriddenFunctionName = "_detect_overridden"; PyObject *detectFunction = PyObject_GetAttrString(this->pClassInstance, detectOverriddenFunctionName.c_str()); if (!detectFunction || !PyCallable_Check(detectFunction)) { - EnergyPlus::ShowSevereError(state, - format(R"(Could not find or call function "{}" on class "{}.{}")", - detectOverriddenFunctionName, - this->modulePath.generic_string(), - this->className)); + ShowSevereError(state, + format(R"(Could not find or call function "{}" on class "{}.{}")", + detectOverriddenFunctionName, + this->modulePath.generic_string(), + this->className)); if (PyErr_Occurred()) { - PluginInstance::reportPythonError(state); + reportPythonError(state); } else { - EnergyPlus::ShowContinueError(state, "This function should be available on the base class, so this is strange."); + ShowContinueError(state, "This function should be available on the base class, so this is strange."); } - EnergyPlus::ShowFatalError(state, "Python _detect_overridden() function error causes program termination"); + ShowFatalError(state, "Python _detect_overridden() function error causes program termination"); } PyObject *pFunctionResponse = PyObject_CallFunction(detectFunction, nullptr); Py_DECREF(detectFunction); // PyObject_GetAttrString returns a new reference, decrement it if (!pFunctionResponse) { - EnergyPlus::ShowSevereError(state, format("Call to _detect_overridden() on {} failed!", this->stringIdentifier)); + ShowSevereError(state, format("Call to _detect_overridden() on {} failed!", this->stringIdentifier)); if (PyErr_Occurred()) { - PluginInstance::reportPythonError(state); + reportPythonError(state); } else { - EnergyPlus::ShowContinueError(state, "This is available on the base class and should not be overridden...strange."); + ShowContinueError(state, "This is available on the base class and should not be overridden...strange."); } - EnergyPlus::ShowFatalError(state, format("Program terminates after call to _detect_overridden() on {} failed!", this->stringIdentifier)); + ShowFatalError(state, format("Program terminates after call to _detect_overridden() on {} failed!", this->stringIdentifier)); } if (!PyList_Check(pFunctionResponse)) { // NOLINT(hicpp-signed-bitwise) - EnergyPlus::ShowFatalError(state, format("Invalid return from _detect_overridden() on class \"{}\", this is weird", this->stringIdentifier)); + ShowFatalError(state, format("Invalid return from _detect_overridden() on class \"{}\", this is weird", this->stringIdentifier)); } Py_ssize_t numVals = PyList_Size(pFunctionResponse); // at this point we know which base class methods are being overridden by the derived class // we can loop over them and based on the name check the appropriate flag and assign the function pointer if (numVals == 0) { - EnergyPlus::ShowFatalError( - state, format("Python plugin \"{}\" did not override any base class methods; must override at least one", this->stringIdentifier)); + ShowFatalError(state, + format("Python plugin \"{}\" did not override any base class methods; must override at least one", this->stringIdentifier)); } for (Py_ssize_t itemNum = 0; itemNum < numVals; itemNum++) { PyObject *item = PyList_GetItem(pFunctionResponse, itemNum); @@ -1099,20 +1093,19 @@ bool PluginInstance::run(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledF // then call the main function // static const PyObject oneArgObjFormat = Py_BuildValue)("O"); - PyObject *pStateInstance = PyLong_FromVoidPtr((void *)&state); + PyObject *pStateInstance = PyLong_FromVoidPtr(&state); PyObject *pFunctionResponse = PyObject_CallMethodObjArgs(this->pClassInstance, pFunctionName, pStateInstance, nullptr); Py_DECREF(pStateInstance); if (!pFunctionResponse) { std::string const functionNameAsString(functionName); // only convert to string if an error occurs - EnergyPlus::ShowSevereError(state, format("Call to {}() on {} failed!", functionNameAsString, this->stringIdentifier)); + ShowSevereError(state, format("Call to {}() on {} failed!", functionNameAsString, this->stringIdentifier)); if (PyErr_Occurred()) { - PluginInstance::reportPythonError(state); + reportPythonError(state); } else { - EnergyPlus::ShowContinueError(state, "This could happen for any number of reasons, check the plugin code."); + ShowContinueError(state, "This could happen for any number of reasons, check the plugin code."); } PyGILState_Release(gil); - EnergyPlus::ShowFatalError(state, - format("Program terminates after call to {}() on {} failed!", functionNameAsString, this->stringIdentifier)); + ShowFatalError(state, format("Program terminates after call to {}() on {} failed!", functionNameAsString, this->stringIdentifier)); } if (PyLong_Check(pFunctionResponse)) { // NOLINT(hicpp-signed-bitwise) long exitCode = PyLong_AsLong(pFunctionResponse); @@ -1120,12 +1113,12 @@ bool PluginInstance::run(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledF // success } else if (exitCode == 1) { PyGILState_Release(gil); - EnergyPlus::ShowFatalError(state, format("Python Plugin \"{}\" returned 1 to indicate EnergyPlus should abort", this->stringIdentifier)); + ShowFatalError(state, format("Python Plugin \"{}\" returned 1 to indicate EnergyPlus should abort", this->stringIdentifier)); } } else { std::string const functionNameAsString(functionName); // only convert to string if an error occurs PyGILState_Release(gil); - EnergyPlus::ShowFatalError( + ShowFatalError( state, format("Invalid return from {}() on class \"{}, make sure it returns an integer exit code, either zero (success) or one (failure)", functionNameAsString, @@ -1134,7 +1127,7 @@ bool PluginInstance::run(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledF Py_DECREF(pFunctionResponse); // PyObject_CallFunction returns new reference, decrement if (state.dataPluginManager->apiErrorFlag) { PyGILState_Release(gil); - EnergyPlus::ShowFatalError(state, "API problems encountered while running plugin cause program termination."); + ShowFatalError(state, "API problems encountered while running plugin cause program termination."); } PyGILState_Release(gil); return true; @@ -1168,8 +1161,10 @@ void PluginManager::addToPythonPath(EnergyPlusData &state, const fs::path &inclu // We use generic_string / generic_wstring here, which will always use a forward slash as directory separator even on windows // This doesn't handle the (very strange, IMHO) case were on unix you have backlashes (which are VALID filenames on Unix!) // Could use FileSystem::makeNativePath first to convert the backslashes to forward slashes on Unix - PyObject *unicodeIncludePath = nullptr; + PyObject *unicodeIncludePath; + // ReSharper disable once CppRedundantTypenameKeyword if constexpr (std::is_same_v) { + // ReSharper disable once CppDFAUnreachableCode const std::wstring ws = includePath.generic_wstring(); unicodeIncludePath = PyUnicode_FromWideChar(ws.c_str(), static_cast(ws.size())); // New reference } else { @@ -1177,8 +1172,7 @@ void PluginManager::addToPythonPath(EnergyPlusData &state, const fs::path &inclu unicodeIncludePath = PyUnicode_FromString(s.c_str()); // New reference } if (unicodeIncludePath == nullptr) { - EnergyPlus::ShowFatalError(state, - format("ERROR converting the path \"{}\" for addition to the sys.path in Python", includePath.generic_string())); + ShowFatalError(state, format("ERROR converting the path \"{}\" for addition to the sys.path in Python", includePath.generic_string())); } PyObject *sysPath = PySys_GetObject("path"); // Borrowed reference @@ -1189,11 +1183,11 @@ void PluginManager::addToPythonPath(EnergyPlusData &state, const fs::path &inclu if (PyErr_Occurred()) { PluginInstance::reportPythonError(state); } - EnergyPlus::ShowFatalError(state, format("ERROR adding \"{}\" to the sys.path in Python", includePath.generic_string())); + ShowFatalError(state, format("ERROR adding \"{}\" to the sys.path in Python", includePath.generic_string())); } if (userDefinedPath) { - EnergyPlus::ShowMessage(state, format("Successfully added path \"{}\" to the sys.path in Python", includePath.generic_string())); + ShowMessage(state, format("Successfully added path \"{}\" to the sys.path in Python", includePath.generic_string())); } // PyRun_SimpleString)("print(' EPS : ' + str(sys.path))"); @@ -1211,7 +1205,7 @@ void PluginManager::addToPythonPath([[maybe_unused]] EnergyPlusData &state, #endif #if LINK_WITH_PYTHON -void PluginManager::addGlobalVariable(EnergyPlusData &state, const std::string &name) +void PluginManager::addGlobalVariable(const EnergyPlusData &state, const std::string &name) { std::string const varNameUC = EnergyPlus::Util::makeUPPER(name); state.dataPluginManager->globalVariableNames.push_back(varNameUC); @@ -1232,19 +1226,17 @@ int PluginManager::getGlobalVariableHandle(EnergyPlusData &state, const std::str auto const it = std::find(gVarNames.begin(), gVarNames.end(), varNameUC); if (it != gVarNames.end()) { return static_cast(std::distance(gVarNames.begin(), it)); - } else { - if (suppress_warning) { - return -1; - } else { - EnergyPlus::ShowSevereError(state, "Tried to retrieve handle for a nonexistent plugin global variable"); - EnergyPlus::ShowContinueError(state, format("Name looked up: \"{}\", available names: ", varNameUC)); - for (auto const &gvName : gVarNames) { - EnergyPlus::ShowContinueError(state, format(" \"{}\"", gvName)); - } - EnergyPlus::ShowFatalError(state, "Plugin global variable problem causes program termination"); - return -1; // hush the compiler warning - } } + if (suppress_warning) { + return -1; + } + ShowSevereError(state, "Tried to retrieve handle for a nonexistent plugin global variable"); + ShowContinueError(state, format("Name looked up: \"{}\", available names: ", varNameUC)); + for (auto const &gvName : gVarNames) { + ShowContinueError(state, format(" \"{}\"", gvName)); + } + ShowFatalError(state, "Plugin global variable problem causes program termination"); + return -1; // hush the compiler warning } #else int PluginManager::getGlobalVariableHandle([[maybe_unused]] EnergyPlusData &state, @@ -1256,9 +1248,9 @@ int PluginManager::getGlobalVariableHandle([[maybe_unused]] EnergyPlusData &stat #endif #if LINK_WITH_PYTHON -int PluginManager::getTrendVariableHandle(EnergyPlusData &state, const std::string &name) +int PluginManager::getTrendVariableHandle(const EnergyPlusData &state, const std::string &name) { - std::string const varNameUC = EnergyPlus::Util::makeUPPER(name); + std::string const varNameUC = Util::makeUPPER(name); for (size_t i = 0; i < state.dataPluginManager->trends.size(); i++) { auto &thisTrend = state.dataPluginManager->trends[i]; if (thisTrend.name == varNameUC) { @@ -1275,7 +1267,7 @@ int PluginManager::getTrendVariableHandle([[maybe_unused]] EnergyPlusData &state #endif #if LINK_WITH_PYTHON -Real64 PluginManager::getTrendVariableValue(EnergyPlusData &state, int handle, int timeIndex) +Real64 PluginManager::getTrendVariableValue(const EnergyPlusData &state, int handle, int timeIndex) { return state.dataPluginManager->trends[handle].values[timeIndex]; } @@ -1287,7 +1279,7 @@ Real64 PluginManager::getTrendVariableValue([[maybe_unused]] EnergyPlusData &sta #endif #if LINK_WITH_PYTHON -Real64 PluginManager::getTrendVariableAverage(EnergyPlusData &state, int handle, int count) +Real64 PluginManager::getTrendVariableAverage(const EnergyPlusData &state, int handle, int count) { Real64 sum = 0; for (int i = 0; i < count; i++) { @@ -1303,7 +1295,7 @@ Real64 PluginManager::getTrendVariableAverage([[maybe_unused]] EnergyPlusData &s #endif #if LINK_WITH_PYTHON -Real64 PluginManager::getTrendVariableMin(EnergyPlusData &state, int handle, int count) +Real64 PluginManager::getTrendVariableMin(const EnergyPlusData &state, int handle, int count) { Real64 minimumValue = 9999999999999; for (int i = 0; i < count; i++) { @@ -1321,7 +1313,7 @@ Real64 PluginManager::getTrendVariableMin([[maybe_unused]] EnergyPlusData &state #endif #if LINK_WITH_PYTHON -Real64 PluginManager::getTrendVariableMax(EnergyPlusData &state, int handle, int count) +Real64 PluginManager::getTrendVariableMax(const EnergyPlusData &state, int handle, int count) { Real64 maximumValue = -9999999999999; for (int i = 0; i < count; i++) { @@ -1339,7 +1331,7 @@ Real64 PluginManager::getTrendVariableMax([[maybe_unused]] EnergyPlusData &state #endif #if LINK_WITH_PYTHON -Real64 PluginManager::getTrendVariableSum(EnergyPlusData &state, int handle, int count) +Real64 PluginManager::getTrendVariableSum(const EnergyPlusData &state, int handle, int count) { Real64 sum = 0.0; for (int i = 0; i < count; i++) { @@ -1355,7 +1347,7 @@ Real64 PluginManager::getTrendVariableSum([[maybe_unused]] EnergyPlusData &state #endif #if LINK_WITH_PYTHON -Real64 PluginManager::getTrendVariableDirection(EnergyPlusData &state, int handle, int count) +Real64 PluginManager::getTrendVariableDirection(const EnergyPlusData &state, int handle, int count) { auto &trend = state.dataPluginManager->trends[handle]; Real64 timeSum = 0.0; @@ -1380,7 +1372,7 @@ Real64 PluginManager::getTrendVariableDirection([[maybe_unused]] EnergyPlusData #endif #if LINK_WITH_PYTHON -size_t PluginManager::getTrendVariableHistorySize(EnergyPlusData &state, int handle) +size_t PluginManager::getTrendVariableHistorySize(const EnergyPlusData &state, int handle) { return state.dataPluginManager->trends[handle].values.size(); } @@ -1395,7 +1387,7 @@ void PluginManager::updatePluginValues([[maybe_unused]] EnergyPlusData &state) { #if LINK_WITH_PYTHON for (auto &trend : state.dataPluginManager->trends) { - Real64 newVarValue = PluginManager::getGlobalVariableValue(state, trend.indexOfPluginVariable); + Real64 newVarValue = getGlobalVariableValue(state, trend.indexOfPluginVariable); trend.values.push_front(newVarValue); trend.values.pop_back(); } @@ -1406,17 +1398,16 @@ void PluginManager::updatePluginValues([[maybe_unused]] EnergyPlusData &state) Real64 PluginManager::getGlobalVariableValue(EnergyPlusData &state, int handle) { if (state.dataPluginManager->globalVariableValues.empty()) { - EnergyPlus::ShowFatalError( + ShowFatalError( state, "Tried to access plugin global variable but it looks like there aren't any; use the PythonPlugin:Variables object to declare them."); } try { return state.dataPluginManager->globalVariableValues[handle]; // TODO: This won't be caught as an exception I think } catch (...) { - EnergyPlus::ShowSevereError(state, format("Tried to access plugin global variable value at index {}", handle)); - EnergyPlus::ShowContinueError(state, - format("Available handles range from 0 to {}", state.dataPluginManager->globalVariableValues.size() - 1)); - EnergyPlus::ShowFatalError(state, "Plugin global variable problem causes program termination"); + ShowSevereError(state, format("Tried to access plugin global variable value at index {}", handle)); + ShowContinueError(state, format("Available handles range from 0 to {}", state.dataPluginManager->globalVariableValues.size() - 1)); + ShowFatalError(state, "Plugin global variable problem causes program termination"); } return 0.0; } @@ -1431,17 +1422,16 @@ Real64 PluginManager::getGlobalVariableValue([[maybe_unused]] EnergyPlusData &st void PluginManager::setGlobalVariableValue(EnergyPlusData &state, int handle, Real64 value) { if (state.dataPluginManager->globalVariableValues.empty()) { - EnergyPlus::ShowFatalError(state, - "Tried to set plugin global variable but it looks like there aren't any; use the PythonPlugin:GlobalVariables " - "object to declare them."); + ShowFatalError(state, + "Tried to set plugin global variable but it looks like there aren't any; use the PythonPlugin:GlobalVariables " + "object to declare them."); } try { state.dataPluginManager->globalVariableValues[handle] = value; // TODO: This won't be caught as an exception I think } catch (...) { - EnergyPlus::ShowSevereError(state, format("Tried to set plugin global variable value at index {}", handle)); - EnergyPlus::ShowContinueError(state, - format("Available handles range from 0 to {}", state.dataPluginManager->globalVariableValues.size() - 1)); - EnergyPlus::ShowFatalError(state, "Plugin global variable problem causes program termination"); + ShowSevereError(state, format("Tried to set plugin global variable value at index {}", handle)); + ShowContinueError(state, format("Available handles range from 0 to {}", state.dataPluginManager->globalVariableValues.size() - 1)); + ShowFatalError(state, "Plugin global variable problem causes program termination"); } } #else @@ -1451,7 +1441,7 @@ void PluginManager::setGlobalVariableValue([[maybe_unused]] EnergyPlusData &stat #endif #if LINK_WITH_PYTHON -int PluginManager::getLocationOfUserDefinedPlugin(EnergyPlusData &state, std::string const &_programName) +int PluginManager::getLocationOfUserDefinedPlugin(const EnergyPlusData &state, std::string const &_programName) { for (size_t handle = 0; handle < state.dataPluginManager->plugins.size(); handle++) { auto const &thisPlugin = state.dataPluginManager->plugins[handle]; @@ -1479,9 +1469,9 @@ void PluginManager::runSingleUserDefinedPlugin([[maybe_unused]] EnergyPlusData & } #endif -int PluginManager::getUserDefinedCallbackIndex(EnergyPlusData &state, const std::string &callbackProgramName) +int PluginManager::getUserDefinedCallbackIndex(const EnergyPlusData &state, const std::string &callbackProgramName) { - for (int i = 0; i < (int)state.dataPluginManager->userDefinedCallbackNames.size(); i++) { + for (int i = 0; i < static_cast(state.dataPluginManager->userDefinedCallbackNames.size()); i++) { if (state.dataPluginManager->userDefinedCallbackNames[i] == callbackProgramName) { return i; } @@ -1491,8 +1481,8 @@ int PluginManager::getUserDefinedCallbackIndex(EnergyPlusData &state, const std: void PluginManager::runSingleUserDefinedCallback(EnergyPlusData &state, int index) { - if (state.dataGlobal->KickOffSimulation) return; // Maybe? - state.dataPluginManager->userDefinedCallbacks[index]((void *)&state); // Check Index first + if (state.dataGlobal->KickOffSimulation) return; // Maybe? + state.dataPluginManager->userDefinedCallbacks[index](&state); // Check Index first } #if LINK_WITH_PYTHON diff --git a/src/EnergyPlus/PluginManager.hh b/src/EnergyPlus/PluginManager.hh index ceb84bb5bfd..7e1b9c978ae 100644 --- a/src/EnergyPlus/PluginManager.hh +++ b/src/EnergyPlus/PluginManager.hh @@ -82,12 +82,12 @@ namespace PluginManagement { constexpr const char *programName = "python"; - void registerNewCallback(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, const std::function &f); - void registerUserDefinedCallback(EnergyPlusData &state, const std::function &f, const std::string &programNameInInputFile); + void registerNewCallback(const EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, const std::function &f); + void registerUserDefinedCallback(const EnergyPlusData &state, const std::function &f, const std::string &programNameInInputFile); void runAnyRegisteredCallbacks(EnergyPlusData &state, EMSManager::EMSCallFrom iCalledFrom, bool &anyRan); - void onBeginEnvironment(EnergyPlusData &state); - std::string pythonStringForUsage(EnergyPlusData &state); + void onBeginEnvironment(const EnergyPlusData &state); + std::string pythonStringForUsage(const EnergyPlusData &state); void clear_state(); @@ -185,30 +185,30 @@ namespace PluginManagement { explicit PluginManager(EnergyPlusData &state); ~PluginManager(); - static int numActiveCallbacks(EnergyPlusData &state); + static int numActiveCallbacks(const EnergyPlusData &state); static void addToPythonPath(EnergyPlusData &state, const fs::path &includePath, bool userDefinedPath); static void setupOutputVariables(EnergyPlusData &state); int maxGlobalVariableIndex = -1; - void addGlobalVariable(EnergyPlusData &state, const std::string &name); + void addGlobalVariable(const EnergyPlusData &state, const std::string &name); static int getGlobalVariableHandle(EnergyPlusData &state, const std::string &name, bool suppress_warning = false); static Real64 getGlobalVariableValue(EnergyPlusData &state, int handle); static void setGlobalVariableValue(EnergyPlusData &state, int handle, Real64 value); int maxTrendVariableIndex = -1; - static int getTrendVariableHandle(EnergyPlusData &state, const std::string &name); - static Real64 getTrendVariableValue(EnergyPlusData &state, int handle, int timeIndex); - static size_t getTrendVariableHistorySize(EnergyPlusData &state, int handle); - static Real64 getTrendVariableAverage(EnergyPlusData &state, int handle, int count); - static Real64 getTrendVariableMin(EnergyPlusData &state, int handle, int count); - static Real64 getTrendVariableMax(EnergyPlusData &state, int handle, int count); - static Real64 getTrendVariableSum(EnergyPlusData &state, int handle, int count); - static Real64 getTrendVariableDirection(EnergyPlusData &state, int handle, int count); + static int getTrendVariableHandle(const EnergyPlusData &state, const std::string &name); + static Real64 getTrendVariableValue(const EnergyPlusData &state, int handle, int timeIndex); + static size_t getTrendVariableHistorySize(const EnergyPlusData &state, int handle); + static Real64 getTrendVariableAverage(const EnergyPlusData &state, int handle, int count); + static Real64 getTrendVariableMin(const EnergyPlusData &state, int handle, int count); + static Real64 getTrendVariableMax(const EnergyPlusData &state, int handle, int count); + static Real64 getTrendVariableSum(const EnergyPlusData &state, int handle, int count); + static Real64 getTrendVariableDirection(const EnergyPlusData &state, int handle, int count); static void updatePluginValues(EnergyPlusData &state); - static int getLocationOfUserDefinedPlugin(EnergyPlusData &state, std::string const &_programName); - static int getUserDefinedCallbackIndex(EnergyPlusData &state, const std::string &callbackProgramName); + static int getLocationOfUserDefinedPlugin(const EnergyPlusData &state, std::string const &_programName); + static int getUserDefinedCallbackIndex(const EnergyPlusData &state, const std::string &callbackProgramName); static void runSingleUserDefinedPlugin(EnergyPlusData &state, int index); static void runSingleUserDefinedCallback(EnergyPlusData &state, int index); static bool anyUnexpectedPluginObjects(EnergyPlusData &state); @@ -226,7 +226,7 @@ namespace PluginManagement { std::deque values; std::deque times; int indexOfPluginVariable; - PluginTrendVariable(EnergyPlusData &state, std::string _name, int _numValues, int _indexOfPluginVariable); + PluginTrendVariable(const EnergyPlusData &state, std::string _name, int _numValues, int _indexOfPluginVariable); void reset() { this->values.clear(); diff --git a/src/EnergyPlus/api/EnergyPlusPgm.cc b/src/EnergyPlus/api/EnergyPlusPgm.cc index f674a18e3cb..f47c52a681b 100644 --- a/src/EnergyPlus/api/EnergyPlusPgm.cc +++ b/src/EnergyPlus/api/EnergyPlusPgm.cc @@ -405,7 +405,7 @@ int RunEnergyPlus(EnergyPlus::EnergyPlusData &state, std::string const &filepath // METHODOLOGY EMPLOYED: // The method used in EnergyPlus is to simplify the main program as much // as possible and contain all "simulation" code in other modules and files. - + using namespace EnergyPlus; int status = initializeEnergyPlus(state, filepath); if (status || state.dataGlobal->outputEpJSONConversionOnly) return status; try { @@ -434,7 +434,7 @@ int runEnergyPlusAsLibrary(EnergyPlus::EnergyPlusData &state, const std::vector< // METHODOLOGY EMPLOYED: // The method used in EnergyPlus is to simplify the main program as much // as possible and contain all "simulation" code in other modules and files. - + using namespace EnergyPlus; state.dataGlobal->eplusRunningViaAPI = true; // clean out any stdin, stderr, stdout flags from a prior call diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index f8c8449427c..a4367fd7d23 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -65,6 +65,8 @@ #include #include +using namespace EnergyPlus; + APIDataEntry *getAPIData(EnergyPlusState state, unsigned int *resultingSize) { struct LocalAPIDataEntry From 239316cbbf670fd96ae204939aa1d20428f2ba24 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Wed, 24 Jul 2024 11:23:32 -0500 Subject: [PATCH 062/164] Clean unused namespace qualifier in runtime.cc --- src/EnergyPlus/api/runtime.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EnergyPlus/api/runtime.cc b/src/EnergyPlus/api/runtime.cc index 8792f7ebc48..44009acb7c1 100644 --- a/src/EnergyPlus/api/runtime.cc +++ b/src/EnergyPlus/api/runtime.cc @@ -98,17 +98,17 @@ void setEnergyPlusRootDirectory(EnergyPlusState state, const char *path) void issueWarning(EnergyPlusState state, const char *message) { auto *thisState = reinterpret_cast(state); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast) - EnergyPlus::ShowWarningError(*thisState, message); + ShowWarningError(*thisState, message); } void issueSevere(EnergyPlusState state, const char *message) { auto *thisState = reinterpret_cast(state); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast) - EnergyPlus::ShowSevereError(*thisState, message); + ShowSevereError(*thisState, message); } void issueText(EnergyPlusState state, const char *message) { auto *thisState = reinterpret_cast(state); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast) - EnergyPlus::ShowContinueError(*thisState, message); + ShowContinueError(*thisState, message); } void registerProgressCallback([[maybe_unused]] EnergyPlusState state, std::function f) From a7102f10b487d771019e211bcbe6ba437035887e Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Wed, 24 Jul 2024 12:14:14 -0500 Subject: [PATCH 063/164] Update plugin manager function signatures for LINK_WITH_PYTHON=OFF builds --- src/EnergyPlus/PluginManager.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/EnergyPlus/PluginManager.cc b/src/EnergyPlus/PluginManager.cc index 3013431f0a0..bbd68698014 100644 --- a/src/EnergyPlus/PluginManager.cc +++ b/src/EnergyPlus/PluginManager.cc @@ -162,7 +162,7 @@ std::string pythonStringForUsage(const EnergyPlusData &state) return "Linked to Python Version: \"" + sVersion + "\""; } #else -std::string pythonStringForUsage([[maybe_unused]] EnergyPlusData &state) +std::string pythonStringForUsage([[maybe_unused]] const EnergyPlusData &state) { return "This version of EnergyPlus not linked to Python library."; } @@ -1213,7 +1213,7 @@ void PluginManager::addGlobalVariable(const EnergyPlusData &state, const std::st this->maxGlobalVariableIndex++; } #else -void PluginManager::addGlobalVariable([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] const std::string &name) +void PluginManager::addGlobalVariable([[maybe_unused]] const EnergyPlusData &state, [[maybe_unused]] const std::string &name) { } #endif @@ -1260,7 +1260,7 @@ int PluginManager::getTrendVariableHandle(const EnergyPlusData &state, const std return -1; } #else -int PluginManager::getTrendVariableHandle([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] const std::string &name) +int PluginManager::getTrendVariableHandle([[maybe_unused]] const EnergyPlusData &state, [[maybe_unused]] const std::string &name) { return -1; } @@ -1272,7 +1272,7 @@ Real64 PluginManager::getTrendVariableValue(const EnergyPlusData &state, int han return state.dataPluginManager->trends[handle].values[timeIndex]; } #else -Real64 PluginManager::getTrendVariableValue([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int timeIndex) +Real64 PluginManager::getTrendVariableValue([[maybe_unused]] const EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int timeIndex) { return 0.0; } @@ -1288,7 +1288,7 @@ Real64 PluginManager::getTrendVariableAverage(const EnergyPlusData &state, int h return sum / count; } #else -Real64 PluginManager::getTrendVariableAverage([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int count) +Real64 PluginManager::getTrendVariableAverage([[maybe_unused]] const EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int count) { return 0.0; } @@ -1306,7 +1306,7 @@ Real64 PluginManager::getTrendVariableMin(const EnergyPlusData &state, int handl return minimumValue; } #else -Real64 PluginManager::getTrendVariableMin([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int count) +Real64 PluginManager::getTrendVariableMin([[maybe_unused]] const EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int count) { return 0.0; } @@ -1324,7 +1324,7 @@ Real64 PluginManager::getTrendVariableMax(const EnergyPlusData &state, int handl return maximumValue; } #else -Real64 PluginManager::getTrendVariableMax([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int count) +Real64 PluginManager::getTrendVariableMax([[maybe_unused]] const EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int count) { return 0.0; } @@ -1340,7 +1340,7 @@ Real64 PluginManager::getTrendVariableSum(const EnergyPlusData &state, int handl return sum; } #else -Real64 PluginManager::getTrendVariableSum([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int count) +Real64 PluginManager::getTrendVariableSum([[maybe_unused]] const EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int count) { return 0.0; } @@ -1365,7 +1365,7 @@ Real64 PluginManager::getTrendVariableDirection(const EnergyPlusData &state, int return numerator / denominator; } #else -Real64 PluginManager::getTrendVariableDirection([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int count) +Real64 PluginManager::getTrendVariableDirection([[maybe_unused]] const EnergyPlusData &state, [[maybe_unused]] int handle, [[maybe_unused]] int count) { return 0.0; } @@ -1377,7 +1377,7 @@ size_t PluginManager::getTrendVariableHistorySize(const EnergyPlusData &state, i return state.dataPluginManager->trends[handle].values.size(); } #else -size_t PluginManager::getTrendVariableHistorySize([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] int handle) +size_t PluginManager::getTrendVariableHistorySize([[maybe_unused]] const EnergyPlusData &state, [[maybe_unused]] int handle) { return 0; } @@ -1452,7 +1452,7 @@ int PluginManager::getLocationOfUserDefinedPlugin(const EnergyPlusData &state, s return -1; } #else -int PluginManager::getLocationOfUserDefinedPlugin([[maybe_unused]] EnergyPlusData &state, [[maybe_unused]] std::string const &_programName) +int PluginManager::getLocationOfUserDefinedPlugin([[maybe_unused]] const EnergyPlusData &state, [[maybe_unused]] std::string const &_programName) { return -1; } From 19c4aae751f39f0c8428d9fc0b62ad20edce5de3 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 24 Jul 2024 14:29:45 -0700 Subject: [PATCH 064/164] fix unit test Fan:VariableVolume to Fan:SystemModel transition --- .../unit/AirTerminalSingleDuctMixer.unit.cc | 102 ++++-- .../unit/HVACVariableRefrigerantFlow.unit.cc | 317 +++++++++++------- 2 files changed, 268 insertions(+), 151 deletions(-) diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc index 6fb85c4a598..752ccc73f3b 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctMixer.unit.cc @@ -3405,7 +3405,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMInletSi " 0, !- Outdoor Air Flow Rate When No Cooling or Heating is Needed {m3/s}", " VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", " drawthrough, !- Supply Air Fan Placement", - " Fan:VariableVolume, !- Supply Air Fan Object Type", + " Fan:SystemModel, !- Supply Air Fan Object Type", " TU1 VRF Supply Fan, !- Supply Air Fan Object Name", " , !- Outside Air Mixer Object Type", " , !- Outside Air Mixer Object Name", @@ -3416,26 +3416,43 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMInletSi " 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W}", " 20; !- Zone Terminal Unit Off Parasitic Electric Energy Use {W}", - " Fan:VariableVolume,", + " Fan:SystemModel,", " TU1 VRF Supply Fan, !- Name", " VRFAvailSched, !- Availability Schedule Name", - " 0.7, !- Fan Total Efficiency", - " 600, !- Pressure Rise {Pa}", - " 0.500, !- Maximum Flow Rate {m3/s}", - " Fraction, !- Fan Power Minimum Flow Rate Input Method", - " 0, !- Fan Power Minimum Flow Fraction", - " 0, !- Fan Power Minimum Air Flow Rate {m3/s}", - " 0.9, !- Motor Efficiency", - " 1, !- Motor In Airstream Fraction", - " 0.059, !- Fan Power Coefficient 1", - " 0, !- Fan Power Coefficient 2", - " 0, !- Fan Power Coefficient 3", - " 0.928, !- Fan Power Coefficient 4", - " 0, !- Fan Power Coefficient 5", " TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", " TU1 Outlet Node, !- Air Outlet Node Name", + " 0.500, !- Design Maximum Air Flow Rate {m3/s}", + " Continuous, !- Speed Control Method", + " 0.0, !- Electric Power Minimum Flow Rate Fraction", + " 600, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " autosize, !- Design Electric Power Consumption {W}", + " TotalEfficiencyAndPressure, !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " TU1 Fan Power Curve, !- Electric Power Function of Flow Fraction Curve Name", + " ,", + " ,", + " ,", + " ,", " General; !- End-Use Subcategory", + " Curve:Quartic,", + " TU1 Fan Power Curve , !- Name", + " 0.059, !- Coefficient1 Constant", + " 0, !- Coefficient2 x ", + " 0, !- Coefficient3 x**2 ", + " 0.928, !- Coefficient4 x**3 ", + " 0, !- Coefficient5 x**4 ", + " 0.0, !- Minimum Value of x", + " 1.0, !- Maximum Value of x", + " 0.0, !- Minimum Curve Output", + " 1.0, !- Maximum Curve Output", + " Dimensionless, !- Input Unit Type for X", + " Dimensionless; !- Output Unit Type", + " Coil:Heating:DX:VariableRefrigerantFlow:FluidTemperatureControl,", " TU1 VRF DX Heating Coil, !- Name", " VRFAvailSched, !- Availability Schedule", @@ -5063,6 +5080,8 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMInletSi // set secondary air mass flow rate to zero state->dataLoopNodes->Node(state->dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; + state->dataFans->fans(1)->set_size(*state); // add sizing + state->dataHVACVarRefFlow->VRF(1).VRFCondCyclingRatio = 1.0; // Simulate zoneHVAC equipment (VRF terminal unit) SimVRF(*state, VRFTUNum, FirstHVACIteration, OnOffAirFlowRatio, QUnitOutVRFTU, LatOutputProvided, QZnReq); @@ -5164,7 +5183,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMSupplyS " 0, !- Outdoor Air Flow Rate When No Cooling or Heating is Needed {m3/s}", " VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", " drawthrough, !- Supply Air Fan Placement", - " Fan:VariableVolume, !- Supply Air Fan Object Type", + " Fan:SystemModel, !- Supply Air Fan Object Type", " TU1 VRF Supply Fan, !- Supply Air Fan Object Name", " , !- Outside Air Mixer Object Type", " , !- Outside Air Mixer Object Name", @@ -5175,26 +5194,43 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMSupplyS " 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W}", " 20; !- Zone Terminal Unit Off Parasitic Electric Energy Use {W}", - " Fan:VariableVolume,", + " Fan:SystemModel,", " TU1 VRF Supply Fan, !- Name", " VRFAvailSched, !- Availability Schedule Name", - " 0.7, !- Fan Total Efficiency", - " 600, !- Pressure Rise {Pa}", - " 0.500, !- Maximum Flow Rate {m3/s}", - " Fraction, !- Fan Power Minimum Flow Rate Input Method", - " 0, !- Fan Power Minimum Flow Fraction", - " 0, !- Fan Power Minimum Air Flow Rate {m3/s}", - " 0.9, !- Motor Efficiency", - " 1, !- Motor In Airstream Fraction", - " 0.059, !- Fan Power Coefficient 1", - " 0, !- Fan Power Coefficient 2", - " 0, !- Fan Power Coefficient 3", - " 0.928, !- Fan Power Coefficient 4", - " 0, !- Fan Power Coefficient 5", " TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", " SPACE1-1 AIR TERMINAL MIXER SECONDARY INLET, !- Air Outlet Node Name", + " 0.500, !- Design Maximum Air Flow Rate {m3/s}", + " Continuous, !- Speed Control Method", + " 0.0, !- Electric Power Minimum Flow Rate Fraction", + " 600, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " autosize, !- Design Electric Power Consumption {W}", + " TotalEfficiencyAndPressure, !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " TU1 Fan Power Curve, !- Electric Power Function of Flow Fraction Curve Name", + " ,", + " ,", + " ,", + " ,", " General; !- End-Use Subcategory", + " Curve:Quartic,", + " TU1 Fan Power Curve , !- Name", + " 0.059, !- Coefficient1 Constant", + " 0, !- Coefficient2 x ", + " 0, !- Coefficient3 x**2 ", + " 0.928, !- Coefficient4 x**3 ", + " 0, !- Coefficient5 x**4 ", + " 0.0, !- Minimum Value of x", + " 1.0, !- Maximum Value of x", + " 0.0, !- Minimum Curve Output", + " 1.0, !- Maximum Curve Output", + " Dimensionless, !- Input Unit Type for X", + " Dimensionless; !- Output Unit Type", + " Coil:Heating:DX:VariableRefrigerantFlow:FluidTemperatureControl,", " TU1 VRF DX Heating Coil, !- Name", " VRFAvailSched, !- Availability Schedule", @@ -6817,6 +6853,8 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMSupplyS state->dataScheduleMgr->Schedule(state->dataHVACVarRefFlow->VRFTU(VRFTUNum).SchedPtr).CurrentValue = 1.0; // unit is always available state->dataScheduleMgr->Schedule(state->dataHVACVarRefFlow->VRFTU(VRFTUNum).FanAvailSchedPtr).CurrentValue = 1.0; // fan is always available + state->dataHVACVarRefFlow->VRF(1).VRFCondCyclingRatio = 1.0; + state->dataFans->fans(1)->set_size(*state); // add fan sizing // set secondary air mass flow rate to zero state->dataLoopNodes->Node(state->dataSingleDuct->SysATMixer(1).SecInNode).MassFlowRate = 0.0; @@ -6829,8 +6867,8 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimVRFfluidCntrl_ATMSupplyS // check the terminal air mixer outlet flow rate must be equal to the mass flow rate of VRFTU + the primary air ATMixerOutletMassFlowRate = SecondaryAirMassFlowRate + PrimaryAirMassFlowRate; ASSERT_EQ(ATMixerOutletMassFlowRate, state->dataSingleDuct->SysATMixer(1).MixedAirMassFlowRate); - // check the cooling output delivered is within 2.0 Watt of zone cooling load - ASSERT_NEAR(QZnReq, QUnitOutVRFTU, 2.0); + // changed the threshold from 2 to 3 as the fan was changed from hard-sized to autosize, a little more error is expected + ASSERT_NEAR(QZnReq, QUnitOutVRFTU, 3.0); } TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimUnitVent_ATMInletSide) diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index b392f7abf46..5e04826e9a2 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -11785,7 +11785,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " 0, !- Outdoor Air Flow Rate When No Cooling or Heating is Needed {m3/s}", " VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", " drawthrough, !- Supply Air Fan Placement", - " Fan:VariableVolume, !- Supply Air Fan Object Type", + " Fan:SystemModel, !- Supply Air Fan Object Type", " TU1 VRF Supply Fan, !- Supply Air Fan Object Name", " , !- Outside Air Mixer Object Type", " , !- Outside Air Mixer Object Name", @@ -11857,26 +11857,43 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " Temperature, !- Input Unit Type for X", " Temperature; !- Output Unit Type", - " Fan:VariableVolume,", + " Fan:SystemModel,", " TU1 VRF Supply Fan, !- Name", " VRFAvailSched, !- Availability Schedule Name", - " 0.7, !- Fan Total Efficiency", - " 600, !- Pressure Rise {Pa}", - " autosize, !- Maximum Flow Rate {m3/s}", - " Fraction, !- Fan Power Minimum Flow Rate Input Method", - " 0, !- Fan Power Minimum Flow Fraction", - " 0, !- Fan Power Minimum Air Flow Rate {m3/s}", - " 0.9, !- Motor Efficiency", - " 1, !- Motor In Airstream Fraction", - " 0.059, !- Fan Power Coefficient 1", - " 0, !- Fan Power Coefficient 2", - " 0, !- Fan Power Coefficient 3", - " 0.928, !- Fan Power Coefficient 4", - " 0, !- Fan Power Coefficient 5", " TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", " TU1 Outlet Node, !- Air Outlet Node Name", + " autosize, !- Design Maximum Air Flow Rate {m3/s}", + " Continuous, !- Speed Control Method", + " 0.0, !- Electric Power Minimum Flow Rate Fraction", + " 600, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " autosize, !- Design Electric Power Consumption {W}", + " TotalEfficiencyAndPressure, !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " TU1 Fan Power Curve, !- Electric Power Function of Flow Fraction Curve Name", + " ,", + " ,", + " ,", + " ,", " General; !- End-Use Subcategory", + " Curve:Quartic,", + " TU1 Fan Power Curve , !- Name", + " 0.059, !- Coefficient1 Constant", + " 0, !- Coefficient2 x ", + " 0, !- Coefficient3 x**2 ", + " 0.928, !- Coefficient4 x**3 ", + " 0, !- Coefficient5 x**4 ", + " 0.0, !- Minimum Value of x", + " 1.0, !- Maximum Value of x", + " 0.0, !- Minimum Curve Output", + " 1.0, !- Maximum Curve Output", + " Dimensionless, !- Input Unit Type for X", + " Dimensionless; !- Output Unit Type", + " !- =========== ALL OBJECTS IN CLASS: FLUIDPROPERTIES:NAME =========== ", " ", " FluidProperties:Name, ", @@ -16302,7 +16319,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_SupplementalHtgCoilTest) " 0, !- No Load Outdoor Air Flow Rate {m3/s}", " VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", " drawthrough, !- Supply Air Fan Placement", - " Fan:VariableVolume, !- Supply Air Fan Object Type", + " Fan:SystemModel, !- Supply Air Fan Object Type", " TU1 VRF Supply Fan, !- Supply Air Fan Object Name", " OutdoorAir:Mixer, !- Outside Air Mixer Object Type", " TU1 OA Mixer, !- Outside Air Mixer Object Name", @@ -16333,7 +16350,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_SupplementalHtgCoilTest) " 0, !- No Load Outdoor Air Flow Rate {m3/s}", " VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", " drawthrough, !- Supply Air Fan Placement", - " Fan:VariableVolume, !- Supply Air Fan Object Type", + " Fan:SystemModel, !- Supply Air Fan Object Type", " TU2 VRF Supply Fan, !- Supply Air Fan Object Name", " OutdoorAir:Mixer, !- Outside Air Mixer Object Type", " TU2 OA Mixer, !- Outside Air Mixer Object Name", @@ -16386,44 +16403,64 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_SupplementalHtgCoilTest) " SPACE2-1 Node, !- Zone Air Node Name", " SPACE2-1 Out Node; !- Zone Return Air Node or NodeList Name", - "Fan:VariableVolume,", + " Fan:SystemModel,", " TU1 VRF Supply Fan, !- Name", " VRFAvailSched, !- Availability Schedule Name", - " 0.7, !- Fan Total Efficiency", - " 600, !- Pressure Rise {Pa}", - " autosize, !- Maximum Flow Rate {m3/s}", - " Fraction, !- Fan Power Minimum Flow Rate Input Method", - " 0, !- Fan Power Minimum Flow Fraction", - " 0, !- Fan Power Minimum Air Flow Rate {m3/s}", - " 0.9, !- Motor Efficiency", - " 1, !- Motor In Airstream Fraction", - " 0.059, !- Fan Power Coefficient 1", - " 0, !- Fan Power Coefficient 2", - " 0, !- Fan Power Coefficient 3", - " 0.928, !- Fan Power Coefficient 4", - " 0, !- Fan Power Coefficient 5", " TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", - " TU1 VRF Fan Outlet Node, !- Air Outlet Node Name", + " TU1 VRF Fan Outlet Node, !- Air Outlet Node Name", + " autosize, !- Design Maximum Air Flow Rate {m3/s}", + " Continuous, !- Speed Control Method", + " 0.0, !- Electric Power Minimum Flow Rate Fraction", + " 600, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " autosize, !- Design Electric Power Consumption {W}", + " TotalEfficiencyAndPressure, !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " TU Fan Power Curve, !- Electric Power Function of Flow Fraction Curve Name", + " ,", + " ,", + " ,", + " ,", " General; !- End-Use Subcategory", - "Fan:VariableVolume,", + " Curve:Quartic,", + " TU Fan Power Curve , !- Name", + " 0.059, !- Coefficient1 Constant", + " 0, !- Coefficient2 x ", + " 0, !- Coefficient3 x**2 ", + " 0.928, !- Coefficient4 x**3 ", + " 0, !- Coefficient5 x**4 ", + " 0.0, !- Minimum Value of x", + " 1.0, !- Maximum Value of x", + " 0.0, !- Minimum Curve Output", + " 1.0, !- Maximum Curve Output", + " Dimensionless, !- Input Unit Type for X", + " Dimensionless; !- Output Unit Type", + + " Fan:SystemModel,", " TU2 VRF Supply Fan, !- Name", " VRFAvailSched, !- Availability Schedule Name", - " 0.7, !- Fan Total Efficiency", - " 600, !- Pressure Rise {Pa}", - " autosize, !- Maximum Flow Rate {m3/s}", - " Fraction, !- Fan Power Minimum Flow Rate Input Method", - " 0, !- Fan Power Minimum Flow Fraction", - " 0, !- Fan Power Minimum Air Flow Rate {m3/s}", - " 0.9, !- Motor Efficiency", - " 1, !- Motor In Airstream Fraction", - " 0.059, !- Fan Power Coefficient 1", - " 0, !- Fan Power Coefficient 2", - " 0, !- Fan Power Coefficient 3", - " 0.928, !- Fan Power Coefficient 4", - " 0, !- Fan Power Coefficient 5", " TU2 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", - " TU2 VRF Fan Outlet Node, !- Air Outlet Node Name", + " TU2 VRF Fan Outlet Node, !- Air Outlet Node Name", + " autosize, !- Design Maximum Air Flow Rate {m3/s}", + " Continuous, !- Speed Control Method", + " 0.0, !- Electric Power Minimum Flow Rate Fraction", + " 600, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " autosize, !- Design Electric Power Consumption {W}", + " TotalEfficiencyAndPressure, !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " TU Fan Power Curve, !- Electric Power Function of Flow Fraction Curve Name", + " ,", + " ,", + " ,", + " ,", " General; !- End-Use Subcategory", "Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl,", @@ -18263,6 +18300,8 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_SupplementalHtgCoilTest) state->dataHVACVarRefFlow->HeatingLoad(VRFCond) = false; state->dataHVACVarRefFlow->TerminalUnitList(1).IsSimulated = true; + state->dataHVACVarRefFlow->VRF(1).VRFCondCyclingRatio = 1.0; + QZnReq = state->dataZoneEnergyDemand->ZoneSysEnergyDemand(zone_num_TU1).RemainingOutputRequired; SimVRF(*state, VRFTUNum, FirstHVACIteration, OnOffAirFlowRatio, SysOutputProvided, LatOutputProvided, QZnReq); ReportVRFTerminalUnit(*state, VRFTUNum); @@ -18415,7 +18454,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_offSupplementalHtgCoilTest) " 0, !- No Load Outdoor Air Flow Rate {m3/s}", " VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", " drawthrough, !- Supply Air Fan Placement", - " Fan:VariableVolume, !- Supply Air Fan Object Type", + " Fan:SystemModel, !- Supply Air Fan Object Type", " TU1 VRF Supply Fan, !- Supply Air Fan Object Name", " OutdoorAir:Mixer, !- Outside Air Mixer Object Type", " TU1 OA Mixer, !- Outside Air Mixer Object Name", @@ -18446,7 +18485,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_offSupplementalHtgCoilTest) " 0, !- No Load Outdoor Air Flow Rate {m3/s}", " VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", " drawthrough, !- Supply Air Fan Placement", - " Fan:VariableVolume, !- Supply Air Fan Object Type", + " Fan:SystemModel, !- Supply Air Fan Object Type", " TU2 VRF Supply Fan, !- Supply Air Fan Object Name", " OutdoorAir:Mixer, !- Outside Air Mixer Object Type", " TU2 OA Mixer, !- Outside Air Mixer Object Name", @@ -18499,44 +18538,64 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_offSupplementalHtgCoilTest) " SPACE2-1 Node, !- Zone Air Node Name", " SPACE2-1 Out Node; !- Zone Return Air Node or NodeList Name", - "Fan:VariableVolume,", + " Fan:SystemModel,", " TU1 VRF Supply Fan, !- Name", " VRFAvailSched, !- Availability Schedule Name", - " 0.7, !- Fan Total Efficiency", - " 600, !- Pressure Rise {Pa}", - " autosize, !- Maximum Flow Rate {m3/s}", - " Fraction, !- Fan Power Minimum Flow Rate Input Method", - " 0, !- Fan Power Minimum Flow Fraction", - " 0, !- Fan Power Minimum Air Flow Rate {m3/s}", - " 0.9, !- Motor Efficiency", - " 1, !- Motor In Airstream Fraction", - " 0.059, !- Fan Power Coefficient 1", - " 0, !- Fan Power Coefficient 2", - " 0, !- Fan Power Coefficient 3", - " 0.928, !- Fan Power Coefficient 4", - " 0, !- Fan Power Coefficient 5", " TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", - " TU1 VRF Fan Outlet Node, !- Air Outlet Node Name", + " TU1 VRF Fan Outlet Node, !- Air Outlet Node Name", + " autosize, !- Design Maximum Air Flow Rate {m3/s}", + " Continuous, !- Speed Control Method", + " 0.0, !- Electric Power Minimum Flow Rate Fraction", + " 600, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " autosize, !- Design Electric Power Consumption {W}", + " TotalEfficiencyAndPressure, !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " TU Fan Power Curve, !- Electric Power Function of Flow Fraction Curve Name", + " ,", + " ,", + " ,", + " ,", " General; !- End-Use Subcategory", - "Fan:VariableVolume,", + " Curve:Quartic,", + " TU Fan Power Curve , !- Name", + " 0.059, !- Coefficient1 Constant", + " 0, !- Coefficient2 x ", + " 0, !- Coefficient3 x**2 ", + " 0.928, !- Coefficient4 x**3 ", + " 0, !- Coefficient5 x**4 ", + " 0.0, !- Minimum Value of x", + " 1.0, !- Maximum Value of x", + " 0.0, !- Minimum Curve Output", + " 1.0, !- Maximum Curve Output", + " Dimensionless, !- Input Unit Type for X", + " Dimensionless; !- Output Unit Type", + + " Fan:SystemModel,", " TU2 VRF Supply Fan, !- Name", " VRFAvailSched, !- Availability Schedule Name", - " 0.7, !- Fan Total Efficiency", - " 600, !- Pressure Rise {Pa}", - " autosize, !- Maximum Flow Rate {m3/s}", - " Fraction, !- Fan Power Minimum Flow Rate Input Method", - " 0, !- Fan Power Minimum Flow Fraction", - " 0, !- Fan Power Minimum Air Flow Rate {m3/s}", - " 0.9, !- Motor Efficiency", - " 1, !- Motor In Airstream Fraction", - " 0.059, !- Fan Power Coefficient 1", - " 0, !- Fan Power Coefficient 2", - " 0, !- Fan Power Coefficient 3", - " 0.928, !- Fan Power Coefficient 4", - " 0, !- Fan Power Coefficient 5", " TU2 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", - " TU2 VRF Fan Outlet Node, !- Air Outlet Node Name", + " TU2 VRF Fan Outlet Node, !- Air Outlet Node Name", + " autosize, !- Design Maximum Air Flow Rate {m3/s}", + " Continuous, !- Speed Control Method", + " 0.0, !- Electric Power Minimum Flow Rate Fraction", + " 600, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " autosize, !- Design Electric Power Consumption {W}", + " TotalEfficiencyAndPressure, !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " TU Fan Power Curve, !- Electric Power Function of Flow Fraction Curve Name", + " ,", + " ,", + " ,", + " ,", " General; !- End-Use Subcategory", "Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl,", @@ -20524,7 +20583,7 @@ TEST_F(EnergyPlusFixture, VRF_MixedTypes) " 0, !- Outdoor Air Flow Rate When No Cooling or Heating is Needed {m3/s}", " VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", " drawthrough, !- Supply Air Fan Placement", - " Fan:VariableVolume, !- Supply Air Fan Object Type", + " Fan:SystemModel, !- Supply Air Fan Object Type", " TU1 VRF Supply Fan, !- Supply Air Fan Object Name", " , !- Outside Air Mixer Object Type", " , !- Outside Air Mixer Object Name", @@ -20556,25 +20615,28 @@ TEST_F(EnergyPlusFixture, VRF_MixedTypes) " IUCondTempCurve; !- Indoor Unit Condensing Temperature Function of Subcooling Curve Name", "", "", - "Fan:VariableVolume,", - " TU1 VRF Supply Fan, !- Name", - " VRFAvailSched, !- Availability Schedule Name", - " 0.7, !- Fan Total Efficiency", - " 600, !- Pressure Rise {Pa}", - " autosize, !- Maximum Flow Rate {m3/s}", - " Fraction, !- Fan Power Minimum Flow Rate Input Method", - " 0, !- Fan Power Minimum Flow Fraction", - " 0, !- Fan Power Minimum Air Flow Rate {m3/s}", - " 0.9, !- Motor Efficiency", - " 1, !- Motor In Airstream Fraction", - " 0.059, !- Fan Power Coefficient 1", - " 0, !- Fan Power Coefficient 2", - " 0, !- Fan Power Coefficient 3", - " 0.928, !- Fan Power Coefficient 4", - " 0, !- Fan Power Coefficient 5", - " TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", - " TU1 Outlet Node, !- Air Outlet Node Name", - " General; !- End-Use Subcategory", + " Fan:SystemModel,", + " TU1 VRF Supply Fan, !- Name", + " VRFAvailSched, !- Availability Schedule Name", + " TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", + " TU1 Outlet Node, !- Air Outlet Node Name", + " autosize, !- Design Maximum Air Flow Rate {m3/s}", + " Continuous, !- Speed Control Method", + " 0.0, !- Electric Power Minimum Flow Rate Fraction", + " 600, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " autosize, !- Design Electric Power Consumption {W}", + " , !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " TU Fan Power Curve, !- Electric Power Function of Flow Fraction Curve Name", + " ,", + " ,", + " ,", + " ,", + " General; !- End-Use Subcategory", }); std::string const vrfFluidCtrl_HR = delimited_string({ @@ -20692,7 +20754,7 @@ TEST_F(EnergyPlusFixture, VRF_MixedTypes) " 0, !- Outdoor Air Flow Rate When No Cooling or Heating is Needed {m3/s}", " VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name", " drawthrough, !- Supply Air Fan Placement", - " Fan:VariableVolume, !- Supply Air Fan Object Type", + " Fan:SystemModel, !- Supply Air Fan Object Type", " TU2 VRF Supply Fan, !- Supply Air Fan Object Name", " , !- Outside Air Mixer Object Type", " , !- Outside Air Mixer Object Name", @@ -20724,28 +20786,45 @@ TEST_F(EnergyPlusFixture, VRF_MixedTypes) " IUCondTempCurve; !- Indoor Unit Condensing Temperature Function of Subcooling Curve Name", "", "", - "Fan:VariableVolume,", - " TU2 VRF Supply Fan, !- Name", - " VRFAvailSched, !- Availability Schedule Name", - " 0.7, !- Fan Total Efficiency", - " 600, !- Pressure Rise {Pa}", - " autosize, !- Maximum Flow Rate {m3/s}", - " Fraction, !- Fan Power Minimum Flow Rate Input Method", - " 0, !- Fan Power Minimum Flow Fraction", - " 0, !- Fan Power Minimum Air Flow Rate {m3/s}", - " 0.9, !- Motor Efficiency", - " 1, !- Motor In Airstream Fraction", - " 0.059, !- Fan Power Coefficient 1", - " 0, !- Fan Power Coefficient 2", - " 0, !- Fan Power Coefficient 3", - " 0.928, !- Fan Power Coefficient 4", - " 0, !- Fan Power Coefficient 5", - " TU2 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", - " TU2 Outlet Node, !- Air Outlet Node Name", - " General; !- End-Use Subcategory", + " Fan:SystemModel,", + " TU2 VRF Supply Fan, !- Name", + " VRFAvailSched, !- Availability Schedule Name", + " TU2 VRF DX HCoil Outlet Node, !- Air Inlet Node Name", + " TU2 Outlet Node, !- Air Outlet Node Name", + " autosize, !- Design Maximum Air Flow Rate {m3/s}", + " Continuous, !- Speed Control Method", + " 0.0, !- Electric Power Minimum Flow Rate Fraction", + " 600, !- Design Pressure Rise {Pa}", + " 0.9, !- Motor Efficiency", + " 1.0, !- Motor In Air Stream Fraction", + " autosize, !- Design Electric Power Consumption {W}", + " , !- Design Power Sizing Method", + " , !- Electric Power Per Unit Flow Rate {W/(m3/s)}", + " , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)}", + " 0.7, !- Fan Total Efficiency", + " TU Fan Power Curve, !- Electric Power Function of Flow Fraction Curve Name", + " ,", + " ,", + " ,", + " ,", + " General; !- End-Use Subcategory", }); std::string const commonCurvesAndFansForFluidCtrlAndHR = delimited_string({ + " Curve:Quartic,", + " TU Fan Power Curve , !- Name", + " 0.059, !- Coefficient1 Constant", + " 0, !- Coefficient2 x ", + " 0, !- Coefficient3 x**2 ", + " 0.928, !- Coefficient4 x**3 ", + " 0, !- Coefficient5 x**4 ", + " 0.0, !- Minimum Value of x", + " 1.0, !- Maximum Value of x", + " 0.0, !- Minimum Curve Output", + " 1.0, !- Maximum Curve Output", + " Dimensionless, !- Input Unit Type for X", + " Dimensionless; !- Output Unit Type", + "Curve:Quadratic,", " OUEvapTempCurve, !- Name", " 0, !- Coefficient1 Constant", From 3870cef41949884f01bb79714e04543463d4ba62 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Thu, 25 Jul 2024 15:53:38 -0500 Subject: [PATCH 065/164] Fix unit test fail on windows --- src/EnergyPlus/FluidProperties.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index a27751e06b6..540cb65ab1c 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -2849,7 +2849,7 @@ namespace FluidProperties { static constexpr std::string_view routineName = "RefrigProps::getSatTemperature"; // FUNCTION LOCAL VARIABLE DECLARATIONS: - bool ErrorFlag; // error flag for current call + bool ErrorFlag = false; // error flag for current call auto &df = state.dataFluidProps; From a246dffbb7875c5ef5b6458209362dceb742cbfd Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Thu, 25 Jul 2024 15:54:22 -0500 Subject: [PATCH 066/164] Space IV-Non-coincident 5 --- src/EnergyPlus/ZoneEquipmentManager.cc | 163 ++++++++++++++++++------- 1 file changed, 120 insertions(+), 43 deletions(-) diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index b459e11ae07..6c4089019e1 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -1916,6 +1916,7 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.CoolOutHumRatSeq(ts) = 0.0; zoneCFS.CoolLoadNoDOASSeq(ts) = 0.0; } + if (zoneCFS.zoneLatentSizing) { // Zero out latent simple sums zoneCFS.DesLatentHeatVolFlow = 0.0; @@ -1950,7 +1951,45 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum } } + // Other - Initialize to first space values (clear later if not all the same) + int firstSpace = state.dataHeatBal->Zone(zoneNum).spaceIndexes[0]; + auto &firstSpaceCFS = state.dataSize->CalcFinalSpaceSizing(firstSpace); + zoneCFS.HeatDesDay = firstSpaceCFS.HeatDesDay; + zoneCFS.HeatDDNum = firstSpaceCFS.HeatDDNum; + zoneCFS.cHeatDDDate = firstSpaceCFS.cHeatDDDate; + zoneCFS.TimeStepNumAtHeatMax = firstSpaceCFS.TimeStepNumAtHeatMax; + zoneCFS.HeatNoDOASDDNum = firstSpaceCFS.HeatNoDOASDDNum; + zoneCFS.HeatNoDOASDesDay = firstSpaceCFS.HeatNoDOASDesDay; + zoneCFS.TimeStepNumAtHeatNoDOASMax = firstSpaceCFS.TimeStepNumAtHeatNoDOASMax; + zoneCFS.CoolDesDay = firstSpaceCFS.CoolDesDay; + zoneCFS.CoolDDNum = firstSpaceCFS.CoolDDNum; + zoneCFS.cCoolDDDate = firstSpaceCFS.cCoolDDDate; + zoneCFS.TimeStepNumAtCoolMax = firstSpaceCFS.TimeStepNumAtCoolMax; + if (zoneCFS.zoneLatentSizing) { + zoneCFS.LatHeatDesDay = firstSpaceCFS.LatHeatDesDay; + zoneCFS.cLatentHeatDDDate = firstSpaceCFS.cLatentHeatDDDate; + zoneCFS.LatentHeatDDNum = firstSpaceCFS.LatentHeatDDNum; + zoneCFS.TimeStepNumAtLatentHeatMax = firstSpaceCFS.TimeStepNumAtLatentHeatMax; + zoneCFS.LatentHeatNoDOASDDNum = firstSpaceCFS.LatentHeatNoDOASDDNum; + zoneCFS.LatHeatNoDOASDesDay = firstSpaceCFS.LatHeatNoDOASDesDay; + zoneCFS.TimeStepNumAtLatentHeatNoDOASMax = firstSpaceCFS.TimeStepNumAtLatentHeatNoDOASMax; + zoneCFS.LatCoolDesDay = firstSpaceCFS.LatCoolDesDay; + zoneCFS.cLatentCoolDDDate = firstSpaceCFS.cLatentCoolDDDate; + zoneCFS.LatentCoolDDNum = firstSpaceCFS.LatentCoolDDNum; + zoneCFS.TimeStepNumAtLatentCoolMax = firstSpaceCFS.TimeStepNumAtLatentCoolMax; + zoneCFS.CoolNoDOASDDNum = firstSpaceCFS.CoolNoDOASDDNum; + zoneCFS.CoolNoDOASDesDay = firstSpaceCFS.CoolNoDOASDesDay; + zoneCFS.TimeStepNumAtCoolNoDOASMax = firstSpaceCFS.TimeStepNumAtCoolNoDOASMax; + zoneCFS.LatentCoolNoDOASDDNum = firstSpaceCFS.LatentCoolNoDOASDDNum; + zoneCFS.LatCoolNoDOASDesDay = firstSpaceCFS.LatCoolNoDOASDesDay; + zoneCFS.TimeStepNumAtLatentCoolNoDOASMax = firstSpaceCFS.TimeStepNumAtLatentCoolNoDOASMax; + } + int numSpaces = 0; // Track this for averages later + bool heatDDNumAllSame = true; + bool coolDDNumAllSame = true; + int priorHeatDDNum = 0; + int priorCoolDDNum = 0; for (int spaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) { auto &spaceCFS = state.dataSize->CalcFinalSpaceSizing(spaceNum); ++numSpaces; @@ -2006,20 +2045,24 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum } // Other - // zoneCFS.HeatDesDay = spaceCFS.HeatDesDay; - // zoneCFS.HeatDDNum = spaceCFS.HeatDDNum; - // zoneCFS.cHeatDDDate = desDayWeath.DateString; - // zoneCFS.TimeStepNumAtHeatMax = spaceCFS.TimeStepNumAtHeatMax; - // zoneCFS.HeatNoDOASDDNum = spaceCFS.HeatNoDOASDDNum; - // zoneCFS.HeatNoDOASDesDay = spaceCFS.HeatNoDOASDesDay; - // zoneCFS.TimeStepNumAtHeatNoDOASMax = spaceCFS.TimeStepNumAtHeatNoDOASMax; - // zoneCFS.LatentHeatNoDOASDDNum = spaceCFS.LatentHeatNoDOASDDNum; - // zoneCFS.LatHeatNoDOASDesDay = spaceCFS.LatHeatNoDOASDesDay; - // zoneCFS.TimeStepNumAtLatentHeatNoDOASMax = spaceCFS.TimeStepNumAtLatentHeatNoDOASMax; - // zoneCFS.CoolDesDay = spaceCFS.CoolDesDay; - // zoneCFS.CoolDDNum = spaceCFS.CoolDDNum; - // zoneCFS.cCoolDDDate = desDayWeath.DateString; - // zoneCFS.TimeStepNumAtCoolMax = spaceCFS.TimeStepNumAtCoolMax; + if ((zoneCFS.HeatDDNum != 0) && (zoneCFS.HeatDDNum != spaceCFS.HeatDDNum)) { + zoneCFS.HeatDesDay = "n/a"; + zoneCFS.HeatDDNum = 0; + zoneCFS.cHeatDDDate = ""; + } + if ((zoneCFS.HeatNoDOASDDNum != 0) && (zoneCFS.HeatNoDOASDDNum != spaceCFS.HeatNoDOASDDNum)) { + zoneCFS.HeatNoDOASDDNum = 0; + zoneCFS.HeatNoDOASDesDay = "n/a"; + } + if ((zoneCFS.CoolDDNum != 0) && (zoneCFS.CoolDDNum != spaceCFS.CoolDDNum)) { + zoneCFS.CoolDesDay = "n/a"; + zoneCFS.CoolDDNum = 0; + zoneCFS.cCoolDDDate = ""; + } + if ((zoneCFS.CoolNoDOASDDNum != 0) && (zoneCFS.CoolNoDOASDDNum != spaceCFS.CoolNoDOASDDNum)) { + zoneCFS.CoolNoDOASDDNum = 0; + zoneCFS.CoolNoDOASDesDay = "n/a"; + } if (zoneCFS.zoneLatentSizing) { // Simple sums @@ -2045,20 +2088,24 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.DesLatentCoolCoilInHumRat += spaceCFS.DesLatentCoolCoilInHumRat * spaceCFS.DesLatentCoolVolFlow; // Other - // zoneCFS.LatHeatDesDay = spaceCFS.LatHeatDesDay; - // zoneCFS.cLatentHeatDDDate = desDayWeath.DateString; - // zoneCFS.LatentHeatDDNum = spaceCFS.LatentHeatDDNum; - // zoneCFS.TimeStepNumAtLatentHeatMax = spaceCFS.TimeStepNumAtLatentHeatMax; - // zoneCFS.LatCoolDesDay = spaceCFS.LatCoolDesDay; - // zoneCFS.cLatentCoolDDDate = desDayWeath.DateString; - // zoneCFS.LatentCoolDDNum = spaceCFS.LatentCoolDDNum; - // zoneCFS.TimeStepNumAtLatentCoolMax = spaceCFS.TimeStepNumAtLatentCoolMax; - // zoneCFS.CoolNoDOASDDNum = spaceCFS.CoolNoDOASDDNum; - // zoneCFS.CoolNoDOASDesDay = spaceCFS.CoolNoDOASDesDay; - // zoneCFS.TimeStepNumAtCoolNoDOASMax = spaceCFS.TimeStepNumAtCoolNoDOASMax; - // zoneCFS.LatentCoolNoDOASDDNum = spaceCFS.LatentCoolNoDOASDDNum; - // zoneCFS.LatCoolNoDOASDesDay = spaceCFS.LatCoolNoDOASDesDay; - // zoneCFS.TimeStepNumAtLatentCoolNoDOASMax = spaceCFS.TimeStepNumAtLatentCoolNoDOASMax; + if ((zoneCFS.LatentHeatDDNum != 0) && (zoneCFS.LatentHeatDDNum != spaceCFS.LatentHeatDDNum)) { + zoneCFS.LatHeatDesDay = "n/a"; + zoneCFS.cLatentHeatDDDate = ""; + zoneCFS.LatentHeatDDNum = 0; + } + if ((zoneCFS.LatentHeatNoDOASDDNum != 0) && (zoneCFS.LatentHeatNoDOASDDNum != spaceCFS.LatentHeatNoDOASDDNum)) { + zoneCFS.LatentHeatNoDOASDDNum = 0; + zoneCFS.LatHeatNoDOASDesDay = "n/a"; + } + if ((zoneCFS.LatentCoolDDNum != 0) && (zoneCFS.LatentCoolDDNum != spaceCFS.LatentCoolDDNum)) { + zoneCFS.LatCoolDesDay = "n/a"; + zoneCFS.cLatentCoolDDDate = ""; + zoneCFS.LatentCoolDDNum = 0; + } + if ((zoneCFS.LatentCoolNoDOASDDNum != 0) && (zoneCFS.LatentCoolNoDOASDDNum != spaceCFS.LatentCoolNoDOASDDNum)) { + zoneCFS.LatentCoolNoDOASDDNum = 0; + zoneCFS.LatCoolNoDOASDesDay = "n/a"; + } // Time-series sums for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { @@ -2093,24 +2140,39 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.DesCoolCoilInTemp /= zoneCFS.DesCoolMassFlow; zoneCFS.DesCoolCoilInHumRat /= zoneCFS.DesCoolMassFlow; } + // Timestep at max + zoneCFS.TimeStepNumAtHeatMax = 0; + zoneCFS.TimeStepNumAtHeatNoDOASMax = 0; + zoneCFS.TimeStepNumAtCoolMax = 0; + zoneCFS.TimeStepNumAtHeatNoDOASMax = 0; + Real64 maxHeatLoad = 0.0; + Real64 maxHeatLoadNoDOAS = 0.0; + Real64 maxCoolLoad = 0.0; + Real64 maxCoolLoadNoDOAS = 0.0; for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { - if (zoneCFS.HeatFlowSeq(ts) > 0) { - zoneCFS.HeatZoneTempSeq(ts) /= zoneCFS.HeatFlowSeq(ts); - zoneCFS.HeatOutTempSeq(ts) /= zoneCFS.HeatFlowSeq(ts); - zoneCFS.HeatZoneRetTempSeq(ts) /= zoneCFS.HeatFlowSeq(ts); - zoneCFS.HeatZoneHumRatSeq(ts) /= zoneCFS.HeatFlowSeq(ts); - zoneCFS.HeatOutHumRatSeq(ts) /= zoneCFS.HeatFlowSeq(ts); - zoneCFS.HeatLoadNoDOASSeq(ts) /= zoneCFS.HeatFlowSeq(ts); - } - if (zoneCFS.CoolFlowSeq(ts) > 0) { - zoneCFS.CoolZoneTempSeq(ts) /= zoneCFS.CoolFlowSeq(ts); - zoneCFS.CoolOutTempSeq(ts) /= zoneCFS.CoolFlowSeq(ts); - zoneCFS.CoolZoneRetTempSeq(ts) /= zoneCFS.CoolFlowSeq(ts); - zoneCFS.CoolZoneHumRatSeq(ts) /= zoneCFS.CoolFlowSeq(ts); - zoneCFS.CoolOutHumRatSeq(ts) /= zoneCFS.CoolFlowSeq(ts); - zoneCFS.CoolLoadNoDOASSeq(ts) /= zoneCFS.CoolFlowSeq(ts); + Real64 tsHeatFlow = zoneCFS.HeatFlowSeq(ts); + if (tsHeatFlow > 0) { + zoneCFS.HeatZoneTempSeq(ts) /= tsHeatFlow; + zoneCFS.HeatOutTempSeq(ts) /= tsHeatFlow; + zoneCFS.HeatZoneRetTempSeq(ts) /= tsHeatFlow; + zoneCFS.HeatZoneHumRatSeq(ts) /= tsHeatFlow; + zoneCFS.HeatOutHumRatSeq(ts) /= tsHeatFlow; + } + if (zoneCFS.HeatLoadSeq(ts) > maxHeatLoad) zoneCFS.TimeStepNumAtHeatMax = ts; + if (zoneCFS.HeatLoadNoDOASSeq(ts) > maxHeatLoadNoDOAS) zoneCFS.TimeStepNumAtHeatNoDOASMax = ts; + + Real64 tsCoolFlow = zoneCFS.CoolFlowSeq(ts); + if (tsCoolFlow > 0) { + zoneCFS.CoolZoneTempSeq(ts) /= tsCoolFlow; + zoneCFS.CoolOutTempSeq(ts) /= tsCoolFlow; + zoneCFS.CoolZoneRetTempSeq(ts) /= tsCoolFlow; + zoneCFS.CoolZoneHumRatSeq(ts) /= tsCoolFlow; + zoneCFS.CoolOutHumRatSeq(ts) /= tsCoolFlow; } + if (zoneCFS.CoolLoadSeq(ts) > maxCoolLoad) zoneCFS.TimeStepNumAtCoolMax = ts; + if (zoneCFS.CoolLoadNoDOASSeq(ts) > maxCoolLoadNoDOAS) zoneCFS.TimeStepNumAtCoolNoDOASMax = ts; } + if (zoneCFS.zoneLatentSizing) { if (zoneCFS.DesLatentHeatMassFlow > 0) { zoneCFS.ZoneTempAtLatentHeatPeak /= zoneCFS.DesLatentHeatMassFlow; @@ -2126,6 +2188,21 @@ void updateZoneSizingEndZoneSizingCalc1(EnergyPlusData &state, int const zoneNum zoneCFS.DesLatentCoolCoilInTemp /= zoneCFS.DesLatentCoolMassFlow; zoneCFS.DesLatentCoolCoilInHumRat /= zoneCFS.DesLatentCoolMassFlow; } + // Timestep at max + zoneCFS.TimeStepNumAtLatentHeatMax = 0; + zoneCFS.TimeStepNumAtLatentHeatNoDOASMax = 0; + zoneCFS.TimeStepNumAtLatentCoolMax = 0; + zoneCFS.TimeStepNumAtLatentCoolNoDOASMax = 0; + Real64 maxLatHeatLoad = 0.0; + Real64 maxLatHeatLoadNoDOAS = 0.0; + Real64 maxLatCoolLoad = 0.0; + Real64 maxLatCoolLoadNoDOAS = 0.0; + for (int ts = 1; ts <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++ts) { + if (zoneCFS.LatentHeatFlowSeq(ts) > maxLatHeatLoad) zoneCFS.TimeStepNumAtLatentHeatMax = ts; + if (zoneCFS.HeatLatentLoadNoDOASSeq(ts) > maxLatHeatLoadNoDOAS) zoneCFS.TimeStepNumAtLatentHeatNoDOASMax = ts; + if (zoneCFS.LatentCoolLoadSeq(ts) > maxLatCoolLoad) zoneCFS.TimeStepNumAtLatentCoolMax = ts; + if (zoneCFS.CoolLatentLoadNoDOASSeq(ts) > maxLatCoolLoadNoDOAS) zoneCFS.TimeStepNumAtLatentCoolNoDOASMax = ts; + } } return; From f57c2fbcf60b37b43453fc5bd2ae3d390b38d8af Mon Sep 17 00:00:00 2001 From: "Lerond, Jeremy" Date: Fri, 26 Jul 2024 15:22:17 -0700 Subject: [PATCH 067/164] Add support for VRF terminals and zonal unitary systems (PTHP, PTAC, WAHP). Missing unit test for the latter. --- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 41 ++++- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 22 +++ src/EnergyPlus/HVACVariableRefrigerantFlow.hh | 2 + src/EnergyPlus/UnitarySystem.cc | 51 +++++- src/EnergyPlus/UnitarySystem.hh | 1 + .../unit/AirflowNetworkHVAC.unit.cc | 155 ++++++++++++++++++ 6 files changed, 258 insertions(+), 14 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 8d583fbb388..f52280bca16 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -88,6 +88,7 @@ #include #include #include +#include #include #include #include @@ -100,6 +101,7 @@ #include #include #include +#include #include #include #include @@ -10159,8 +10161,11 @@ namespace AirflowNetwork { EPVector NodeConnectionType; // Specifies the type of node connection std::string CurrentModuleObject; - bool HPWHFound(false); // Flag for HPWH identification - bool StandaloneERVFound(false); // Flag for Standalone ERV (ZoneHVAC:EnergyRecoveryVentilator) identification + bool hpwhFound(false); // Flag for HPWH identification + bool standaloneERVFound(false); // Flag for Standalone ERV (ZoneHVAC:EnergyRecoveryVentilator) identification + bool packagedUnitaryFound(false); // Flag for packaged unitary systems (ZoneHVAC:PackagedTerminalAirConditioner, + // ZoneHVAC:PackagedTerminalHeatPump, ZoneHVAC:WaterToAirHeatPump) identification + bool vrfTUFound(false); // Validate supply and return connections NodeFound.dimension(m_state.dataLoopNodes->NumOfNodes, false); @@ -10265,13 +10270,25 @@ namespace AirflowNetwork { // Skip HPWH nodes that don't have to be included in the AFN if (GetHeatPumpWaterHeaterNodeNumber(m_state, i)) { NodeFound(i) = true; - HPWHFound = true; + hpwhFound = true; } // Skip Standalone ERV nodes that don't have to be included in the AFN if (GetStandAloneERVNodeNumber(m_state, i)) { NodeFound(i) = true; - StandaloneERVFound = true; + standaloneERVFound = true; + } + + // Skip zonal unitary system based nodes that don't have to be included in the AFN + if (UnitarySystems::getUnitarySystemNodeNumber(m_state, i)) { + NodeFound(i) = true; + packagedUnitaryFound = true; + } + + // Skip zonal vrf terminal nodes that don't have to be included in the AFN + if (HVACVariableRefrigerantFlow::getVRFTUNodeNumber(m_state, i)) { + NodeFound(i) = true; + vrfTUFound = true; } } @@ -10403,16 +10420,28 @@ namespace AirflowNetwork { } } } - if (HPWHFound) { + if (hpwhFound) { ShowWarningError(m_state, format(RoutineName) + "Heat pump water heater is simulated along with an AirflowNetwork but is not included in " "the AirflowNetwork."); } - if (StandaloneERVFound) { + if (standaloneERVFound) { ShowWarningError(m_state, format(RoutineName) + "A ZoneHVAC:EnergyRecoveryVentilator is simulated along with an AirflowNetwork but is not " "included in the AirflowNetwork."); } + if (packagedUnitaryFound) { + ShowWarningError(m_state, + format(RoutineName) + "A ZoneHVAC:PackagedTerminalAirConditioner, ZoneHVAC:PackagedTerminalHeatPump, or " + "ZoneHVAC:WaterToAirHeatPump is simulated along with an AirflowNetwork but is not " + "included in the AirflowNetwork."); + } + if (vrfTUFound) { + ShowWarningError(m_state, + format(RoutineName) + + "A ZoneHVAC:TerminalUnit:VariableRefrigerantFlow is simulated along with an AirflowNetwork but is not " + "included in the AirflowNetwork."); + } NodeFound.deallocate(); // Assign AirLoop Number to every node and linkage diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index ea402f0ea39..de42c32347e 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -10822,6 +10822,28 @@ void getVRFTUZoneLoad( } } +bool getVRFTUNodeNumber(EnergyPlusData &state, int const nodeNumber) +{ + for (int vrfTUIndex = 1; vrfTUIndex <= state.dataHVACVarRefFlow->NumVRFTU; ++vrfTUIndex) { + auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(vrfTUIndex); + + bool vrfTUOutdoorAir = false; + if (vrfTU.CoolOutAirVolFlow == 0 && vrfTU.HeatOutAirVolFlow == 0 && vrfTU.NoCoolHeatOutAirVolFlow == 0) { + vrfTUOutdoorAir = true; + } + + if (vrfTUOutdoorAir && + (nodeNumber == vrfTU.VRFTUInletNodeNum || nodeNumber == vrfTU.VRFTUOutletNodeNum || nodeNumber == vrfTU.fanInletNode || + nodeNumber == vrfTU.fanOutletNode || nodeNumber == vrfTU.heatCoilAirOutNode || nodeNumber == vrfTU.coolCoilAirOutNode || + nodeNumber == vrfTU.VRFTUOAMixerOANodeNum || nodeNumber == vrfTU.VRFTUOAMixerRelNodeNum || nodeNumber == vrfTU.VRFTUOAMixerRetNodeNum || + nodeNumber == vrfTU.VRFTUOAMixerMixedNodeNum || nodeNumber == vrfTU.SuppHeatCoilAirInletNode || + nodeNumber == vrfTU.SuppHeatCoilAirOutletNode)) { + return true; + } + return false; + } +} + void VRFCondenserEquipment::CalcVRFIUTeTc_FluidTCtrl(EnergyPlusData &state) { // SUBROUTINE INFORMATION: diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh index 480aa67321a..590fc89e9da 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh @@ -929,6 +929,8 @@ namespace HVACVariableRefrigerantFlow { void getVRFTUZoneLoad( EnergyPlusData &state, int const VRFTUNum, Real64 &zoneLoad, Real64 &LoadToHeatingSP, Real64 &LoadToCoolingSP, bool const InitFlag); + bool getVRFTUNodeNumber(EnergyPlusData &state, int const nodeNumber); + void ReportVRFTerminalUnit(EnergyPlusData &state, int VRFTUNum); // index to VRF terminal unit void ReportVRFCondenser(EnergyPlusData &state, int VRFCond); // index to VRF condensing unit diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 29cf56ad968..d89f4f03bda 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -10149,7 +10149,8 @@ namespace UnitarySystems { Real64 TotalOutputDelta = 0.0; // delta total output rate, {W} int ZoneInNode = this->m_ZoneInletNode; Real64 MassFlowRate = state.dataLoopNodes->Node(ZoneInNode).MassFlowRate / this->ControlZoneMassFlowFrac; - if (state.afn->distribution_simulated) { + if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && + this->m_sysType != SysType::PackagedWSHP) { DeltaMassRate = state.dataLoopNodes->Node(this->AirOutNode).MassFlowRate - state.dataLoopNodes->Node(ZoneInNode).MassFlowRate / this->ControlZoneMassFlowFrac; if (DeltaMassRate < 0.0) DeltaMassRate = 0.0; @@ -12143,7 +12144,8 @@ namespace UnitarySystems { Real64 DesOutHumRat = this->m_DesiredOutletHumRat; int CoilType_Num = this->m_CoolingCoilType_Num; Real64 LoopDXCoilMaxRTFSave = 0.0; - if (state.afn->distribution_simulated) { + if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && + this->m_sysType != SysType::PackagedWSHP) { LoopDXCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF; state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = 0.0; } @@ -13897,7 +13899,8 @@ namespace UnitarySystems { this->m_CoolingCycRatio = CycRatio; this->m_DehumidificationMode = DehumidMode; - if (state.afn->distribution_simulated) { + if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && + this->m_sysType != SysType::PackagedWSHP) { state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = max(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF, LoopDXCoilMaxRTFSave); } @@ -13952,7 +13955,8 @@ namespace UnitarySystems { Real64 LoopHeatingCoilMaxRTFSave = 0.0; Real64 LoopDXCoilMaxRTFSave = 0.0; - if (state.afn->distribution_simulated) { + if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && + this->m_sysType != SysType::PackagedWSHP) { LoopHeatingCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF; state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = 0.0; LoopDXCoilMaxRTFSave = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF; @@ -14571,7 +14575,8 @@ namespace UnitarySystems { this->m_HeatingCycRatio = CycRatio; HeatCoilLoad = ReqOutput; - if (state.afn->distribution_simulated) { + if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && + this->m_sysType != SysType::PackagedWSHP) { state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF = max(state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopHeatingCoilMaxRTF, LoopHeatingCoilMaxRTFSave); state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).AFNLoopDXCoilRTF = @@ -14622,7 +14627,8 @@ namespace UnitarySystems { Real64 LoopHeatingCoilMaxRTFSave = 0.0; Real64 LoopDXCoilMaxRTFSave = 0.0; - if (state.afn->distribution_simulated) { + if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && + this->m_sysType != SysType::PackagedWSHP) { auto &afnInfo = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum); LoopHeatingCoilMaxRTFSave = afnInfo.AFNLoopHeatingCoilMaxRTF; afnInfo.AFNLoopHeatingCoilMaxRTF = 0.0; @@ -14975,7 +14981,8 @@ namespace UnitarySystems { } // IF((GetCurrentScheduleValue(state, UnitarySystem(UnitarySysNum)%m_SysAvailSchedPtr) > 0.0d0) .AND. & // LoopHeatingCoilMaxRTF used for AirflowNetwork gets set in child components (gas and fuel) - if (state.afn->distribution_simulated) { + if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && + this->m_sysType != SysType::PackagedWSHP) { auto &afnInfo = state.dataAirLoop->AirLoopAFNInfo(AirLoopNum); afnInfo.AFNLoopHeatingCoilMaxRTF = max(afnInfo.AFNLoopHeatingCoilMaxRTF, LoopHeatingCoilMaxRTFSave); afnInfo.AFNLoopDXCoilRTF = max(afnInfo.AFNLoopDXCoilRTF, LoopDXCoilMaxRTFSave); @@ -15664,7 +15671,8 @@ namespace UnitarySystems { this->m_ElecPower = locFanElecPower + elecCoolingPower + elecHeatingPower + suppHeatingPower + defrostElecPower + this->m_TotalAuxElecPower; this->m_ElecPowerConsumption = this->m_ElecPower * ReportingConstant; - if (state.afn->distribution_simulated) { + if (state.afn->distribution_simulated && this->m_sysType != SysType::PackagedAC && this->m_sysType != SysType::PackagedHP && + this->m_sysType != SysType::PackagedWSHP) { state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopSystemOnMassFlowrate = state.dataUnitarySystems->CompOnMassFlow; state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopSystemOffMassFlowrate = state.dataUnitarySystems->CompOffMassFlow; state.dataAirLoop->AirLoopAFNInfo(AirLoopNum).LoopFanOperationMode = this->m_FanOpMode; @@ -16718,6 +16726,33 @@ namespace UnitarySystems { return false; } + bool getUnitarySystemNodeNumber(EnergyPlusData &state, int const nodeNumber) + { + for (int unitarySysIndex = 0; unitarySysIndex <= state.dataUnitarySystems->numUnitarySystems - 1; ++unitarySysIndex) { + auto &unitarySys = state.dataUnitarySystems->unitarySys[unitarySysIndex]; + + int FanInletNodeIndex = state.dataFans->fans(unitarySys.m_FanIndex)->inletNodeNum; + int FanOutletNodeIndex = state.dataFans->fans(unitarySys.m_FanIndex)->outletNodeNum; + + bool unitarySysOutdoorAir = false; + if (unitarySys.m_CoolOutAirVolFlow == 0 && unitarySys.m_HeatOutAirVolFlow == 0 && unitarySys.m_NoCoolHeatOutAirVolFlow == 0) { + unitarySysOutdoorAir = true; + } + + if (unitarySys.m_sysType == UnitarySys::SysType::PackagedWSHP || unitarySys.m_sysType == UnitarySys::SysType::PackagedAC || + unitarySys.m_sysType == UnitarySys::SysType::PackagedHP) { + if (unitarySysOutdoorAir && (nodeNumber == FanInletNodeIndex || nodeNumber == FanOutletNodeIndex || + nodeNumber == unitarySys.AirInNode || nodeNumber == unitarySys.m_OAMixerNodes[0] || + nodeNumber == unitarySys.m_OAMixerNodes[1] || nodeNumber == unitarySys.m_OAMixerNodes[2]) || + nodeNumber == unitarySys.m_OAMixerNodes[3] || nodeNumber == unitarySys.CoolCoilOutletNodeNum || + nodeNumber == unitarySys.HeatCoilOutletNodeNum) { + return true; + } + } + } + return false; + } + void setupAllOutputVars(EnergyPlusData &state, int const numAllSystemTypes) { // setup reports only once diff --git a/src/EnergyPlus/UnitarySystem.hh b/src/EnergyPlus/UnitarySystem.hh index 298d986a33b..f2330dc748b 100644 --- a/src/EnergyPlus/UnitarySystem.hh +++ b/src/EnergyPlus/UnitarySystem.hh @@ -952,6 +952,7 @@ namespace UnitarySystems { int getDesignSpecMSHPIndex(EnergyPlusData &state, std::string_view objectName); int getUnitarySystemIndex(EnergyPlusData &state, std::string_view objectName); + bool getUnitarySystemNodeNumber(EnergyPlusData &state, int const nodeNumber); bool searchZoneInletNodes(EnergyPlusData &state, int nodeToFind, int &ZoneEquipConfigIndex, int &InletNodeIndex); bool searchZoneInletNodesByEquipmentIndex(EnergyPlusData &state, int nodeToFind, int zoneEquipmentIndex); diff --git a/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc b/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc index 712f22d1fba..2753d5c752e 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #include @@ -81,6 +82,7 @@ #include #include #include +#include #include #include #include @@ -19767,4 +19769,157 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_ZoneOrderTest) state->afn->AirflowNetworkNodeData(3).EPlusNodeNum = 0; } +TEST_F(EnergyPlusFixture, AirflowNetwork_TestZoneEqpSupportZoneVRF) +{ + // Create zone + state->dataGlobal->NumOfZones = 1; + state->dataHeatBal->Zone.allocate(1); + state->dataHeatBal->Zone(1).Name = "ZONE 1"; + + // Create surfaces + state->dataSurface->Surface.allocate(1); + state->dataSurface->Surface(1).Name = "ZN004:ROOF001"; + state->dataSurface->Surface(1).Zone = 1; + state->dataSurface->Surface(1).ZoneName = "ZONE 1"; + state->dataSurface->Surface(1).Azimuth = 0.0; + state->dataSurface->Surface(1).ExtBoundCond = 0; + state->dataSurface->Surface(1).HeatTransSurf = true; + state->dataSurface->Surface(1).Tilt = 180.0; + state->dataSurface->Surface(1).Sides = 4; + state->dataSurface->Surface(1).Name = "ZN004:ROOF002"; + state->dataSurface->Surface(1).Zone = 1; + state->dataSurface->Surface(1).ZoneName = "ZONE 1"; + state->dataSurface->Surface(1).Azimuth = 0.0; + state->dataSurface->Surface(1).ExtBoundCond = 0; + state->dataSurface->Surface(1).HeatTransSurf = true; + state->dataSurface->Surface(1).Tilt = 180.0; + state->dataSurface->Surface(1).Sides = 4; + + state->dataSurface->Surface(1).OriginalClass = DataSurfaces::SurfaceClass::Window; + + // Create air system + state->dataAirSystemsData->PrimaryAirSystems.allocate(1); + state->dataAirSystemsData->PrimaryAirSystems(1).NumBranches = 1; + state->dataAirSystemsData->PrimaryAirSystems(1).Branch.allocate(1); + state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).TotalComponents = 1; + state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp.allocate(1); + state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).TypeOf = "Fan:ConstantVolume"; + + // Create air nodes + state->dataLoopNodes->NumOfNodes = 11; + state->dataLoopNodes->Node.allocate(11); + state->dataLoopNodes->Node(1).FluidType = DataLoopNode::NodeFluidType::Air; + state->dataLoopNodes->Node(2).FluidType = DataLoopNode::NodeFluidType::Air; + state->dataLoopNodes->Node(3).FluidType = DataLoopNode::NodeFluidType::Air; + state->dataLoopNodes->NodeID.allocate(11); + state->dataLoopNodes->NodeID(1) = "ZONE 1 AIR NODE"; + bool errFlag{false}; + BranchNodeConnections::RegisterNodeConnection(*state, + 1, + "ZONE 1 AIR NODE", + DataLoopNode::ConnectionObjectType::FanOnOff, + "Object1", + DataLoopNode::ConnectionType::ZoneNode, + NodeInputManager::CompFluidStream::Primary, + false, + errFlag); + EXPECT_FALSE(errFlag); + + // Connect zone to air node + state->dataZoneEquip->ZoneEquipConfig.allocate(1); + state->dataZoneEquip->ZoneEquipConfig(1).IsControlled = true; + state->dataZoneEquip->ZoneEquipConfig(1).ZoneName = "ZONE 1"; + state->dataZoneEquip->ZoneEquipConfig(1).ZoneNode = 1; + state->dataZoneEquip->ZoneEquipConfig(1).NumInletNodes = 0; + state->dataZoneEquip->ZoneEquipConfig(1).NumReturnNodes = 0; + state->dataZoneEquip->ZoneEquipConfig(1).IsControlled = true; + + // One AirflowNetwork:MultiZone:Zone object + state->afn->AirflowNetworkNumOfZones = 1; + state->afn->MultizoneZoneData.allocate(1); + state->afn->MultizoneZoneData(1).ZoneNum = 1; + state->afn->MultizoneZoneData(1).ZoneName = "ZONE 1"; + + // Assume only one AirflowNetwork:Distribution:Node object is set for the Zone Air Node + state->afn->AirflowNetworkNumOfNodes = 1; + state->afn->AirflowNetworkNodeData.allocate(1); + state->afn->AirflowNetworkNodeData(1).Name = "ZONE 1"; + state->afn->AirflowNetworkNodeData(1).EPlusZoneNum = 1; + + state->afn->SplitterNodeNumbers.allocate(2); + state->afn->SplitterNodeNumbers(1) = 0; + state->afn->SplitterNodeNumbers(2) = 0; + + // Set flag to support zone equipment + state->afn->simulation_control.allow_unsupported_zone_equipment = true; + + // Create Fans + Real64 supplyFlowRate = 0.005; + Real64 exhaustFlowRate = 0.005; + + auto *fan1 = new Fans::FanComponent; + fan1->Name = "SupplyFan"; + + fan1->inletNodeNum = 2; + fan1->outletNodeNum = 3; + fan1->type = HVAC::FanType::OnOff; + fan1->maxAirFlowRate = supplyFlowRate; + + state->dataFans->fans.push_back(fan1); + state->dataFans->fanMap.insert_or_assign(fan1->Name, state->dataFans->fans.size()); + + state->dataLoopNodes->NodeID(2) = "SupplyFanInletNode"; + BranchNodeConnections::RegisterNodeConnection(*state, + 2, + state->dataLoopNodes->NodeID(2), + DataLoopNode::ConnectionObjectType::FanOnOff, + state->dataFans->fans(1)->Name, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + false, + errFlag); + state->dataLoopNodes->NodeID(3) = "SupplyFanOutletNode"; + BranchNodeConnections::RegisterNodeConnection(*state, + 3, + state->dataLoopNodes->NodeID(3), + DataLoopNode::ConnectionObjectType::FanOnOff, + state->dataFans->fans(1)->Name, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + false, + errFlag); + + // Create VRF Terminal + state->dataHVACVarRefFlow->VRFTU.allocate(1); + state->dataHVACVarRefFlow->GetVRFInputFlag = false; + state->dataHVACVarRefFlow->NumVRFTU = 1; + state->dataHVACVarRefFlow->VRFTU(1).CoolOutAirVolFlow = 0.0; + state->dataHVACVarRefFlow->VRFTU(1).HeatOutAirVolFlow = 0.0; + state->dataHVACVarRefFlow->VRFTU(1).NoCoolHeatOutAirVolFlow = 0.0; + state->dataHVACVarRefFlow->VRFTU(1).FanIndex = 1; + state->dataHVACVarRefFlow->VRFTU(1).fanInletNode = 2; + state->dataHVACVarRefFlow->VRFTU(1).fanOutletNode = 3; + state->dataHVACVarRefFlow->VRFTU(1).VRFTUInletNodeNum = 4; + state->dataHVACVarRefFlow->VRFTU(1).VRFTUOutletNodeNum = 5; + state->dataHVACVarRefFlow->VRFTU(1).heatCoilAirOutNode = 6; + state->dataHVACVarRefFlow->VRFTU(1).coolCoilAirOutNode = 7; + state->dataHVACVarRefFlow->VRFTU(1).VRFTUOAMixerOANodeNum = 8; + state->dataHVACVarRefFlow->VRFTU(1).VRFTUOAMixerRelNodeNum = 9; + state->dataHVACVarRefFlow->VRFTU(1).VRFTUOAMixerRetNodeNum = 10; + state->dataHVACVarRefFlow->VRFTU(1).VRFTUOAMixerMixedNodeNum = 11; + + state->dataLoopNodes->NodeID(4) = "Test"; + + // Check validation and expected warning + state->afn->validate_distribution(); + + EXPECT_TRUE(compare_err_stream_substring( + " ** Warning ** AirflowNetwork::Solver::validate_distribution: A ZoneHVAC:TerminalUnit:VariableRefrigerantFlow is simulated " + "along with an AirflowNetwork but is not included in the AirflowNetwork.\n", + true)); + + // Unset flag to support zone equipment + state->afn->simulation_control.allow_unsupported_zone_equipment = false; +} + } // namespace EnergyPlus From 4e56d25dd89dd21a5bed484e0ba39ca5a82f05e2 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Mon, 29 Jul 2024 17:45:06 -0500 Subject: [PATCH 068/164] Space IV-Non-coincident 6 --- src/EnergyPlus/OutputReportTabular.cc | 2 +- src/EnergyPlus/SimAirServingZones.cc | 32 ++++++++++++++++++++++----- src/EnergyPlus/SizingManager.cc | 10 +++++++++ 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index e3171047cf7..bbf5530f5bc 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -15970,7 +15970,7 @@ void CollectPeakZoneConditions( if (isCooling) { // Time of Peak Load - if ((size_t)desDaySelected <= state.dataWeather->DesDayInput.size()) { + if ((desDaySelected > 0) && ((size_t)desDaySelected <= state.dataWeather->DesDayInput.size())) { compLoad.peakDateHrMin = format("{}/{} {}", state.dataWeather->DesDayInput(desDaySelected).Month, state.dataWeather->DesDayInput(desDaySelected).DayOfMonth, diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 8284166804c..5a8ccc20e53 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -6426,8 +6426,14 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn (1.0 + termUnitSizing.InducRat); CoolDDNum = state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).CoolDDNum; CoolTimeStepNum = state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).TimeStepNumAtCoolMax; - OutAirTemp += state.dataSize->DesDayWeath(CoolDDNum).Temp(CoolTimeStepNum) * coolMassFlow / (1.0 + termUnitSizing.InducRat); - OutAirHumRat += state.dataSize->DesDayWeath(CoolDDNum).HumRat(CoolTimeStepNum) * coolMassFlow / (1.0 + termUnitSizing.InducRat); + if (CoolDDNum == 0) { + auto &zoneCFS = state.dataSize->CalcFinalZoneSizing(state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).ZoneNum); + OutAirTemp += zoneCFS.CoolOutTemp * coolMassFlow / (1.0 + termUnitSizing.InducRat); + OutAirHumRat += zoneCFS.CoolOutHumRat * coolMassFlow / (1.0 + termUnitSizing.InducRat); + } else { + OutAirTemp += state.dataSize->DesDayWeath(CoolDDNum).Temp(CoolTimeStepNum) * coolMassFlow / (1.0 + termUnitSizing.InducRat); + OutAirHumRat += state.dataSize->DesDayWeath(CoolDDNum).HumRat(CoolTimeStepNum) * coolMassFlow / (1.0 + termUnitSizing.InducRat); + } } if (state.dataSize->CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow > 0.0) { SysCoolRetTemp /= state.dataSize->CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow; @@ -6490,8 +6496,15 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn (1.0 + termUnitSizing.InducRat); HeatDDNum = state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).HeatDDNum; HeatTimeStepNum = state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).TimeStepNumAtHeatMax; - OutAirTemp += state.dataSize->DesDayWeath(HeatDDNum).Temp(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat); - OutAirHumRat += state.dataSize->DesDayWeath(HeatDDNum).HumRat(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat); + if (HeatDDNum == 0) { + auto &zoneCFS = state.dataSize->CalcFinalZoneSizing(state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).ZoneNum); + OutAirTemp += zoneCFS.HeatOutTemp * heatMassFlow / (1.0 + termUnitSizing.InducRat); + OutAirHumRat += zoneCFS.HeatOutHumRat * heatMassFlow / (1.0 + termUnitSizing.InducRat); + } else { + OutAirTemp += state.dataSize->DesDayWeath(HeatDDNum).Temp(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat); + OutAirHumRat += + state.dataSize->DesDayWeath(HeatDDNum).HumRat(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat); + } } if (state.dataSize->CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow > 0.0) { SysHeatRetTemp /= state.dataSize->CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow; @@ -6537,8 +6550,15 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn (1.0 + termUnitSizing.InducRat); HeatDDNum = state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).HeatDDNum; HeatTimeStepNum = state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).TimeStepNumAtHeatMax; - OutAirTemp += state.dataSize->DesDayWeath(HeatDDNum).Temp(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat); - OutAirHumRat += state.dataSize->DesDayWeath(HeatDDNum).HumRat(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat); + if (HeatDDNum == 0) { + auto &zoneCFS = state.dataSize->CalcFinalZoneSizing(state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).ZoneNum); + OutAirTemp += zoneCFS.HeatOutTemp * heatMassFlow / (1.0 + termUnitSizing.InducRat); + OutAirHumRat += zoneCFS.HeatOutHumRat * heatMassFlow / (1.0 + termUnitSizing.InducRat); + } else { + OutAirTemp += state.dataSize->DesDayWeath(HeatDDNum).Temp(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat); + OutAirHumRat += + state.dataSize->DesDayWeath(HeatDDNum).HumRat(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat); + } } if (state.dataSize->CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow > 0.0) { SysHeatRetTemp /= state.dataSize->CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow; diff --git a/src/EnergyPlus/SizingManager.cc b/src/EnergyPlus/SizingManager.cc index 9c830da768a..0b76cbd122e 100644 --- a/src/EnergyPlus/SizingManager.cc +++ b/src/EnergyPlus/SizingManager.cc @@ -4283,6 +4283,11 @@ void reportZoneSizing(EnergyPlusData &state, HumRatAtPeak = state.dataSize->DesDayWeath(DDNum).HumRat(TimeStepAtPeak); DOASHeatGainRateAtClPk = zsCalcSizing(DDNum, thisNum).DOASHeatAddSeq(TimeStepAtPeak); TStatSetPtAtPk = zSizing(DDNum, thisNum).CoolTstatTempSeq(TimeStepAtPeak); + } else { + TempAtPeak = zsCalcFinalSizing.OutTempAtCoolPeak; + HumRatAtPeak = zsCalcFinalSizing.OutHumRatAtCoolPeak; + DOASHeatGainRateAtClPk = zsCalcFinalSizing.DOASCoolLoad; + TStatSetPtAtPk = zsCalcFinalSizing.ZoneTempAtCoolPeak; } reportZoneSizingEio(state, zsFinalSizing.ZoneName, @@ -4351,6 +4356,11 @@ void reportZoneSizing(EnergyPlusData &state, HumRatAtPeak = state.dataSize->DesDayWeath(DDNum).HumRat(TimeStepAtPeak); DOASHeatGainRateAtHtPk = zsCalcSizing(DDNum, thisNum).DOASHeatAddSeq(TimeStepAtPeak); TStatSetPtAtPk = zSizing(DDNum, thisNum).HeatTstatTempSeq(TimeStepAtPeak); + } else { + TempAtPeak = zsCalcFinalSizing.OutTempAtHeatPeak; + HumRatAtPeak = zsCalcFinalSizing.OutHumRatAtHeatPeak; + DOASHeatGainRateAtHtPk = zsCalcFinalSizing.DOASHeatLoad; + TStatSetPtAtPk = zsCalcFinalSizing.ZoneTempAtHeatPeak; } reportZoneSizingEio(state, zsFinalSizing.ZoneName, From a19c99063cb59032f6903e71ad3af0971c5b951d Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 31 Jul 2024 10:35:36 -0700 Subject: [PATCH 069/164] change ElecPowerMinFlowRateFrac calc, autosize DesignElecPower to compute "Electric Power Minimum Flow Rate Fraction", use the following logic This field in Fan:SystemModel is "Electric Power Minimum Flow Rate Fraction", so if the old fan is FixedFlowRate then the new field should be old fanPowerMinAirFlow_str / maxAirFlow_str If maxAirFlow_str is autosize, and fanPowerMinAirFlow_str` is > 0, then throw a warning and set this field to 0 if the old fan is Fraction, then this field = old fan minAirFlowFrac_str. For "Design Electric Power Consumption", directly make it autosize and use TotalEfficiencyAndPressure in the sizing method. This way also ensures the "_localTotalEff" variable in the code to use inputs from "Fan Total Efficiency" in Fan:SystemModel --- .../CreateNewIDFUsingRulesV24_2_0.f90 | 35 +- ...US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf | 114 ++--- ...riableRefrigerantFlow_FluidTCtrl_5Zone.idf | 443 ++++++++-------- ...bleRefrigerantFlow_FluidTCtrl_HR_5Zone.idf | 441 ++++++++-------- ...erantFlow_FluidTCtrl_wSuppHeater_5Zone.idf | 479 ++++++++++-------- 5 files changed, 807 insertions(+), 705 deletions(-) diff --git a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 index 59fbe7b5d11..67a848f7a97 100644 --- a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 @@ -600,32 +600,27 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile OutArgs(5) = OldFanVO(Num3)%maxAirFlow_str OutArgs(6) = 'Continuous' !- Speed Control Method IF (SameString(OldFanVO(Num3)%minFlowInputMethod, "FixedFlowRate")) THEN - OutArgs(7) = OldFanVO(Num3)%maxAirFlow_str - ELSE ! input method is "Fraction" - READ(OldFanVO(Num3)%minAirFlowFrac_str, '(F15.5)') minAirFlowFrac - IF (minAirFlowFrac == 0.0) THEN + IF (.NOT. SameString(OldFanVO(Num3)%maxAirFlow_str, "AUTOSIZE")) THEN + READ(OldFanVO(Num3)%fanPowerMinAirFlow_str, '(F15.5)') fanPowerMinAirFlow + READ(OldFanVO(Num3)%maxAirFlow_str, '(F15.5)') maxAirFlow + WRITE(OutArgs(7), '(F15.5)') (fanPowerMinAirFlow / maxAirFlow) + ELSE ! maxAirFlow_stris autosize + READ(OldFanVO(Num3)%fanPowerMinAirFlow_str, '(F15.5)') fanPowerMinAirFlow + IF (.NOT. fanPowerMinAirFlow == 0) THEN ! don't know how to do division with autosize + CALL writePreprocessorObject(DifLfn, PrognameConversion, 'Warning', & + 'Cannot calculate Electric Power Minimum Flow Rate Fraction for' // sysFanName // & + 'when Maximum Flow Rate is autosize and Fan Power Minimum Air Flow Rate is non-zero') + END IF OutArgs(7) = '0.0' - ELSE - IF (.NOT. SameString(OldFanVO(Num3)%maxAirFlow_str, "AUTOSIZE")) THEN - READ(OldFanVO(Num3)%maxAirFlow_str, '(F15.5)') maxAirFlow - WRITE(OutArgs(7), '(F15.5)') (maxAirFlow * minAirFlowFrac) - ELSE ! don't know how to multiply fraction with autosize - OutArgs(7) = '' - ENDIF ENDIF + ELSE ! input method is "Fraction" + OutArgs(7) = OldFanVO(Num3)%minAirFlowFrac_str ENDIF OutArgs(8) = OldFanVO(Num3)%pressureRise_str !- Design Pressure Rise {Pa} OutArgs(9) = OldFanVO(Num3)%motorEfficiency !- Motor Efficiency OutArgs(10) = OldFanVO(Num3)%motorInAirStreamFrac !- Motor In Air Stream Fraction - IF (.NOT. SameString(OldFanVO(Num3)%maxAirFlow_str, "AUTOSIZE")) THEN - READ(OldFanVO(Num3)%maxAirFlow_str, '(F15.5)') maxAirFlow - READ(OldFanVO(Num3)%pressureRise_str, '(F15.5)') pressureRise - READ(OldFanVO(Num3)%fanTotalEff_str, '(F15.5)') fanTotalEff - WRITE(OutArgs(11), '(F15.5)') (maxAirFlow * pressureRise / fanTotalEff) !- Design Electric Power Consumption {W} - ELSE - OutArgs(11) = 'autosize' - OutArgs(12) = 'TotalEfficiencyAndPressure' ! chose this becuase power per flow or per pressure are unknown - ENDIF + OutArgs(11) = 'autosize' + OutArgs(12) = 'TotalEfficiencyAndPressure' ! chose this becuase power per flow or per pressure are unknown OutArgs(13) = '' !- Electric Power Per Unit Flow Rate {W/(m3/s)} OutArgs(14) = '' !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} OutArgs(15) = OldFanVO(Num3)%fanTotalEff_str !- Fan Total Efficiency diff --git a/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf b/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf index 09900d222ef..2a21a3cbc47 100644 --- a/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf +++ b/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf @@ -482,7 +482,7 @@ 0, !- No Load Outdoor Air Flow Rate {m3/s} VRFFanModeSchedule, !- Supply Air Fan Operating Mode Schedule Name drawthrough, !- Supply Air Fan Placement - Fan:SystemModel, !- Supply Air Fan Object Type + Fan:SystemModel, !- Supply Air Fan Object Type TU1 VRF Supply Fan, !- Supply Air Fan Object Name OutdoorAir:Mixer, !- Outside Air Mixer Object Type TU1 OA Mixer, !- Outside Air Mixer Object Name @@ -497,7 +497,45 @@ , !- Design Specification ZoneHVAC Sizing Object Name Coil:Heating:Electric, !- Supplemental Heating Coil Object Type TU1 Supp Heating Coil, !- Supplemental Heating Coil Name - 50; !- Maximum Supply Air Temperature from Supplemental Heater {C} + 50, !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + + Fan:SystemModel, + TU1 VRF Supply Fan, !- Name + VRFAvailSched, !- Availability Schedule Name + TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name + TU1 VRF Fan Outlet Node, !- Air Outlet Node Name + 0.595, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0.69748, !- Electric Power Minimum Flow Rate Fraction + 400, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.5, !- Fan Total Efficiency + TU1 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction + General; !- End-Use Subcategory + + Curve:Quartic, + TU1 VRF Supply Fan_curve,!- Name + 0.09, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.91, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.6974790, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type !- =========== ALL OBJECTS IN CLASS: COIL:HEATING:ELECTRIC =========== @@ -530,58 +568,6 @@ OutdoorAir:NodeList, Outside Air Inlet Node 1;!- Node or NodeList Name 1 - !- Fan:VariableVolume, - !- TU1 VRF Supply Fan, !- Name - !- VRFAvailSched, !- Availability Schedule Name - !- 0.5, !- Fan Total Efficiency - !- 400, !- Pressure Rise {Pa} - !- 0.595, !- Maximum Flow Rate {m3/s} - !- FixedFlowRate, !- Fan Power Minimum Flow Rate Input Method - !- 0, !- Fan Power Minimum Flow Fraction - !- 0.415, !- Fan Power Minimum Air Flow Rate {m3/s} - !- 0.9, !- Motor Efficiency - !- 1, !- Motor In Airstream Fraction - !- 0.09, !- Fan Power Coefficient 1 - !- 0, !- Fan Power Coefficient 2 - !- 0, !- Fan Power Coefficient 3 - !- 0.91, !- Fan Power Coefficient 4 - !- 0, !- Fan Power Coefficient 5 - !- TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name - !- TU1 VRF Fan Outlet Node, !- Air Outlet Node Name - !- General; !- End-Use Subcategory - - Fan:SystemModel, - TU1 VRF Supply Fan, !- Name - VRFAvailSched, !- Availability Schedule Name - TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name - TU1 VRF Fan Outlet Node, !- Air Outlet Node Name - 0.595, !- Design Maximum Air Flow Rate {m3/s} - Continuous, !- Speed Control Method - 0.415, !- Electric Power Minimum Flow Rate Fraction - 400, !- Design Pressure Rise {Pa} - 0.9, !- Motor Efficiency - 1.0, !- Motor In Air Stream Fraction - 476, !- Design Electric Power Consumption {W} - , !- Design Power Sizing Method - , !- Electric Power Per Unit Flow Rate {W/(m3/s)} - , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} - 0.5, !- Fan Total Efficiency - Fan Power Curve; !- Electric Power Function of Flow Fraction Curve Name - - Curve:Quartic, - Fan Power Curve , !- Name - 0.09, !- Coefficient1 Constant - 0, !- Coefficient2 x - 0, !- Coefficient3 x**2 - 0.91, !- Coefficient4 x**3 - 0, !- Coefficient5 x**4 - 0.6975, !- Minimum Value of x - 1.0, !- Maximum Value of x - 0.0, !- Minimum Curve Output - 5.0, !- Maximum Curve Output - Dimensionless, !- Input Unit Type for X - Dimensionless; !- Output Unit Type - !- =========== ALL OBJECTS IN CLASS: COIL:COOLING:DX:VARIABLEREFRIGERANTFLOW:FLUIDTEMPERATURECONTROL =========== Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, @@ -4727,7 +4713,7 @@ DishWasher, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 65.698787492023, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.15, !- Fraction Latent 0.6, !- Fraction Radiant @@ -4740,7 +4726,7 @@ Refrigerator, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 91.0575745202123, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 1, !- Fraction Radiant @@ -4753,7 +4739,7 @@ ClothesWasher, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 28.4784377542718, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.8, !- Fraction Radiant @@ -4766,7 +4752,7 @@ ClothesDryer, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 213.064557285022, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.05, !- Fraction Latent 0.15, !- Fraction Radiant @@ -4779,7 +4765,7 @@ CookingRange, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 248.154224774405, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.3, !- Fraction Latent 0.4, !- Fraction Radiant @@ -4792,7 +4778,7 @@ InteriorLighting, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 0, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 1, !- Fraction Radiant @@ -4805,7 +4791,7 @@ MiscPlugLoad, !- Schedule Name EquipmentLevel, !- Design Level Calculation Method 567.464237516869, !- Design Level {W} - , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.06, !- Fraction Latent 0.69, !- Fraction Radiant @@ -4818,7 +4804,7 @@ MiscPlugLoad, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 1.54356736989469, !- Watts per Zone Floor Area {W/m2} + 1.54356736989469, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0624390461422629, !- Fraction Latent 0.41190936353998, !- Fraction Radiant @@ -6387,7 +6373,7 @@ InteriorLightingHE, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 1.91387072900558, !- Watts per Zone Floor Area {W/m2} + 1.91387072900558, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Return Air Fraction 0.6, !- Fraction Radiant @@ -6400,7 +6386,7 @@ InteriorLightingHE, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 0.478467682251396, !- Watts per Zone Floor Area {W/m2} + 0.478467682251396, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Return Air Fraction 0.6, !- Fraction Radiant diff --git a/testfiles/VariableRefrigerantFlow_FluidTCtrl_5Zone.idf b/testfiles/VariableRefrigerantFlow_FluidTCtrl_5Zone.idf index 877b1e884fa..e674841ad1f 100644 --- a/testfiles/VariableRefrigerantFlow_FluidTCtrl_5Zone.idf +++ b/testfiles/VariableRefrigerantFlow_FluidTCtrl_5Zone.idf @@ -335,175 +335,8 @@ , !- Design Specification ZoneHVAC Sizing Object Name , !- Supplemental Heating Coil Object Type , !- Supplemental Heating Coil Name - ; !- Maximum Supply Air Temperature from Supplemental Heater {C} - - ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, - TU2, !- Zone Terminal Unit Name - VRFAvailSched, !- Terminal Unit Availability Schedule - TU2 Inlet Node, !- Terminal Unit Air Inlet Node Name - TU2 Outlet Node, !- Terminal Unit Air Outlet Node Name - autosize, !- Cooling Supply Air Flow Rate {m3/s} - autosize, !- No Cooling Supply Air Flow Rate {m3/s} - autosize, !- Heating Supply Air Flow Rate {m3/s} - autosize, !- No Heating Supply Air Flow Rate {m3/s} - autosize, !- Cooling Outdoor Air Flow Rate {m3/s} - autosize, !- Heating Outdoor Air Flow Rate {m3/s} - autosize, !- No Load Outdoor Air Flow Rate {m3/s} - VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name - drawthrough, !- Supply Air Fan Placement - Fan:SystemModel, !- Supply Air Fan Object Type - TU2 VRF Supply Fan, !- Supply Air Fan Object Name - OutdoorAir:Mixer, !- Outside Air Mixer Object Type - TU2 OA Mixer, !- Outside Air Mixer Object Name - Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type - TU2 VRF DX Cooling Coil, !- Cooling Coil Object Name - COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type - TU2 VRF DX Heating Coil, !- Heating Coil Object Name - 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} - 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} - , !- Rated Heating Capacity Sizing Ratio {W/W} - , !- Availability Manager List Name - , !- Design Specification ZoneHVAC Sizing Object Name - , !- Supplemental Heating Coil Object Type - , !- Supplemental Heating Coil Name - ; !- Maximum Supply Air Temperature from Supplemental Heater {C} - - ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, - TU3, !- Zone Terminal Unit Name - VRFAvailSched, !- Terminal Unit Availability Schedule - TU3 Inlet Node, !- Terminal Unit Air Inlet Node Name - TU3 Outlet Node, !- Terminal Unit Air Outlet Node Name - autosize, !- Cooling Supply Air Flow Rate {m3/s} - autosize, !- No Cooling Supply Air Flow Rate {m3/s} - autosize, !- Heating Supply Air Flow Rate {m3/s} - autosize, !- No Heating Supply Air Flow Rate {m3/s} - autosize, !- Cooling Outdoor Air Flow Rate {m3/s} - autosize, !- Heating Outdoor Air Flow Rate {m3/s} - autosize, !- No Load Outdoor Air Flow Rate {m3/s} - VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name - drawthrough, !- Supply Air Fan Placement - Fan:SystemModel, !- Supply Air Fan Object Type - TU3 VRF Supply Fan, !- Supply Air Fan Object Name - OutdoorAir:Mixer, !- Outside Air Mixer Object Type - TU3 OA Mixer, !- Outside Air Mixer Object Name - Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type - TU3 VRF DX Cooling Coil, !- Cooling Coil Object Name - COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type - TU3 VRF DX Heating Coil, !- Heating Coil Object Name - 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} - 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} - , !- Rated Heating Capacity Sizing Ratio {W/W} - , !- Availability Manager List Name - , !- Design Specification ZoneHVAC Sizing Object Name - , !- Supplemental Heating Coil Object Type - , !- Supplemental Heating Coil Name - ; !- Maximum Supply Air Temperature from Supplemental Heater {C} - - ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, - TU4, !- Zone Terminal Unit Name - VRFAvailSched, !- Terminal Unit Availability Schedule - TU4 Inlet Node, !- Terminal Unit Air Inlet Node Name - TU4 Outlet Node, !- Terminal Unit Air Outlet Node Name - autosize, !- Cooling Supply Air Flow Rate {m3/s} - autosize, !- No Cooling Supply Air Flow Rate {m3/s} - autosize, !- Heating Supply Air Flow Rate {m3/s} - autosize, !- No Heating Supply Air Flow Rate {m3/s} - autosize, !- Cooling Outdoor Air Flow Rate {m3/s} - autosize, !- Heating Outdoor Air Flow Rate {m3/s} - autosize, !- No Load Outdoor Air Flow Rate {m3/s} - VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name - drawthrough, !- Supply Air Fan Placement - Fan:SystemModel, !- Supply Air Fan Object Type - TU4 VRF Supply Fan, !- Supply Air Fan Object Name - OutdoorAir:Mixer, !- Outside Air Mixer Object Type - TU4 OA Mixer, !- Outside Air Mixer Object Name - Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type - TU4 VRF DX Cooling Coil, !- Cooling Coil Object Name - COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type - TU4 VRF DX Heating Coil, !- Heating Coil Object Name - 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} - 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} - , !- Rated Heating Capacity Sizing Ratio {W/W} - , !- Availability Manager List Name - , !- Design Specification ZoneHVAC Sizing Object Name - , !- Supplemental Heating Coil Object Type - , !- Supplemental Heating Coil Name - ; !- Maximum Supply Air Temperature from Supplemental Heater {C} - - ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, - TU5, !- Zone Terminal Unit Name - VRFAvailSched, !- Terminal Unit Availability Schedule - TU5 Inlet Node, !- Terminal Unit Air Inlet Node Name - TU5 Outlet Node, !- Terminal Unit Air Outlet Node Name - autosize, !- Cooling Supply Air Flow Rate {m3/s} - autosize, !- No Cooling Supply Air Flow Rate {m3/s} - autosize, !- Heating Supply Air Flow Rate {m3/s} - autosize, !- No Heating Supply Air Flow Rate {m3/s} - autosize, !- Cooling Outdoor Air Flow Rate {m3/s} - autosize, !- Heating Outdoor Air Flow Rate {m3/s} - autosize, !- No Load Outdoor Air Flow Rate {m3/s} - VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name - drawthrough, !- Supply Air Fan Placement - Fan:SystemModel, !- Supply Air Fan Object Type - TU5 VRF Supply Fan, !- Supply Air Fan Object Name - OutdoorAir:Mixer, !- Outside Air Mixer Object Type - TU5 OA Mixer, !- Outside Air Mixer Object Name - Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type - TU5 VRF DX Cooling Coil, !- Cooling Coil Object Name - COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type - TU5 VRF DX Heating Coil, !- Heating Coil Object Name - 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} - 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} - , !- Rated Heating Capacity Sizing Ratio {W/W} - , !- Availability Manager List Name - , !- Design Specification ZoneHVAC Sizing Object Name - , !- Supplemental Heating Coil Object Type - , !- Supplemental Heating Coil Name - ; !- Maximum Supply Air Temperature from Supplemental Heater {C} - - Schedule:Compact, - VRFFanSchedule, !- Name - Any Number, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 7:00,1.0, !- Field 3 - Until: 18:00,1.0, !- Field 5 - Until: 24:00,1.0; !- Field 7 - - OutdoorAir:Mixer, - TU1 OA Mixer, !- Name - TU1 VRF DX CCoil Inlet Node, !- Mixed Air Node Name - Outside Air Inlet Node 1,!- Outdoor Air Stream Node Name - Relief Air Outlet Node 1,!- Relief Air Stream Node Name - TU1 Inlet Node; !- Return Air Stream Node Name - - OutdoorAir:Mixer, - TU2 OA Mixer, !- Name - TU2 VRF DX CCoil Inlet Node, !- Mixed Air Node Name - Outside Air Inlet Node 2,!- Outdoor Air Stream Node Name - Relief Air Outlet Node 2,!- Relief Air Stream Node Name - TU2 Inlet Node; !- Return Air Stream Node Name - - OutdoorAir:Mixer, - TU3 OA Mixer, !- Name - TU3 VRF DX CCoil Inlet Node, !- Mixed Air Node Name - Outside Air Inlet Node 3,!- Outdoor Air Stream Node Name - Relief Air Outlet Node 3,!- Relief Air Stream Node Name - TU3 Inlet Node; !- Return Air Stream Node Name - - OutdoorAir:Mixer, - TU4 OA Mixer, !- Name - TU4 VRF DX CCoil Inlet Node, !- Mixed Air Node Name - Outside Air Inlet Node 4,!- Outdoor Air Stream Node Name - Relief Air Outlet Node 4,!- Relief Air Stream Node Name - TU4 Inlet Node; !- Return Air Stream Node Name - - OutdoorAir:Mixer, - TU5 OA Mixer, !- Name - TU5 VRF DX CCoil Inlet Node, !- Mixed Air Node Name - Outside Air Inlet Node 5,!- Outdoor Air Stream Node Name - Relief Air Outlet Node 5,!- Relief Air Stream Node Name - TU5 Inlet Node; !- Return Air Stream Node Name + , !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} Fan:SystemModel, TU1 VRF Supply Fan, !- Name @@ -512,7 +345,7 @@ TU1 Outlet Node, !- Air Outlet Node Name autosize, !- Design Maximum Air Flow Rate {m3/s} Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction + 0, !- Electric Power Minimum Flow Rate Fraction 600, !- Design Pressure Rise {Pa} 0.9, !- Motor Efficiency 1, !- Motor In Air Stream Fraction @@ -542,6 +375,38 @@ Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type + ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, + TU2, !- Zone Terminal Unit Name + VRFAvailSched, !- Terminal Unit Availability Schedule + TU2 Inlet Node, !- Terminal Unit Air Inlet Node Name + TU2 Outlet Node, !- Terminal Unit Air Outlet Node Name + autosize, !- Cooling Supply Air Flow Rate {m3/s} + autosize, !- No Cooling Supply Air Flow Rate {m3/s} + autosize, !- Heating Supply Air Flow Rate {m3/s} + autosize, !- No Heating Supply Air Flow Rate {m3/s} + autosize, !- Cooling Outdoor Air Flow Rate {m3/s} + autosize, !- Heating Outdoor Air Flow Rate {m3/s} + autosize, !- No Load Outdoor Air Flow Rate {m3/s} + VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name + drawthrough, !- Supply Air Fan Placement + Fan:SystemModel, !- Supply Air Fan Object Type + TU2 VRF Supply Fan, !- Supply Air Fan Object Name + OutdoorAir:Mixer, !- Outside Air Mixer Object Type + TU2 OA Mixer, !- Outside Air Mixer Object Name + Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type + TU2 VRF DX Cooling Coil, !- Cooling Coil Object Name + COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type + TU2 VRF DX Heating Coil, !- Heating Coil Object Name + 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} + 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} + , !- Rated Heating Capacity Sizing Ratio {W/W} + , !- Availability Manager List Name + , !- Design Specification ZoneHVAC Sizing Object Name + , !- Supplemental Heating Coil Object Type + , !- Supplemental Heating Coil Name + , !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + Fan:SystemModel, TU2 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name @@ -549,7 +414,7 @@ TU2 Outlet Node, !- Air Outlet Node Name autosize, !- Design Maximum Air Flow Rate {m3/s} Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction + 0, !- Electric Power Minimum Flow Rate Fraction 600, !- Design Pressure Rise {Pa} 0.9, !- Motor Efficiency 1, !- Motor In Air Stream Fraction @@ -579,6 +444,38 @@ Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type + ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, + TU3, !- Zone Terminal Unit Name + VRFAvailSched, !- Terminal Unit Availability Schedule + TU3 Inlet Node, !- Terminal Unit Air Inlet Node Name + TU3 Outlet Node, !- Terminal Unit Air Outlet Node Name + autosize, !- Cooling Supply Air Flow Rate {m3/s} + autosize, !- No Cooling Supply Air Flow Rate {m3/s} + autosize, !- Heating Supply Air Flow Rate {m3/s} + autosize, !- No Heating Supply Air Flow Rate {m3/s} + autosize, !- Cooling Outdoor Air Flow Rate {m3/s} + autosize, !- Heating Outdoor Air Flow Rate {m3/s} + autosize, !- No Load Outdoor Air Flow Rate {m3/s} + VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name + drawthrough, !- Supply Air Fan Placement + Fan:SystemModel, !- Supply Air Fan Object Type + TU3 VRF Supply Fan, !- Supply Air Fan Object Name + OutdoorAir:Mixer, !- Outside Air Mixer Object Type + TU3 OA Mixer, !- Outside Air Mixer Object Name + Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type + TU3 VRF DX Cooling Coil, !- Cooling Coil Object Name + COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type + TU3 VRF DX Heating Coil, !- Heating Coil Object Name + 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} + 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} + , !- Rated Heating Capacity Sizing Ratio {W/W} + , !- Availability Manager List Name + , !- Design Specification ZoneHVAC Sizing Object Name + , !- Supplemental Heating Coil Object Type + , !- Supplemental Heating Coil Name + , !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + Fan:SystemModel, TU3 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name @@ -586,7 +483,7 @@ TU3 Outlet Node, !- Air Outlet Node Name autosize, !- Design Maximum Air Flow Rate {m3/s} Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction + 0, !- Electric Power Minimum Flow Rate Fraction 600, !- Design Pressure Rise {Pa} 0.9, !- Motor Efficiency 1, !- Motor In Air Stream Fraction @@ -616,6 +513,38 @@ Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type + ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, + TU4, !- Zone Terminal Unit Name + VRFAvailSched, !- Terminal Unit Availability Schedule + TU4 Inlet Node, !- Terminal Unit Air Inlet Node Name + TU4 Outlet Node, !- Terminal Unit Air Outlet Node Name + autosize, !- Cooling Supply Air Flow Rate {m3/s} + autosize, !- No Cooling Supply Air Flow Rate {m3/s} + autosize, !- Heating Supply Air Flow Rate {m3/s} + autosize, !- No Heating Supply Air Flow Rate {m3/s} + autosize, !- Cooling Outdoor Air Flow Rate {m3/s} + autosize, !- Heating Outdoor Air Flow Rate {m3/s} + autosize, !- No Load Outdoor Air Flow Rate {m3/s} + VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name + drawthrough, !- Supply Air Fan Placement + Fan:SystemModel, !- Supply Air Fan Object Type + TU4 VRF Supply Fan, !- Supply Air Fan Object Name + OutdoorAir:Mixer, !- Outside Air Mixer Object Type + TU4 OA Mixer, !- Outside Air Mixer Object Name + Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type + TU4 VRF DX Cooling Coil, !- Cooling Coil Object Name + COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type + TU4 VRF DX Heating Coil, !- Heating Coil Object Name + 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} + 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} + , !- Rated Heating Capacity Sizing Ratio {W/W} + , !- Availability Manager List Name + , !- Design Specification ZoneHVAC Sizing Object Name + , !- Supplemental Heating Coil Object Type + , !- Supplemental Heating Coil Name + , !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + Fan:SystemModel, TU4 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name @@ -623,7 +552,7 @@ TU4 Outlet Node, !- Air Outlet Node Name autosize, !- Design Maximum Air Flow Rate {m3/s} Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction + 0, !- Electric Power Minimum Flow Rate Fraction 600, !- Design Pressure Rise {Pa} 0.9, !- Motor Efficiency 1, !- Motor In Air Stream Fraction @@ -653,6 +582,38 @@ Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type + ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, + TU5, !- Zone Terminal Unit Name + VRFAvailSched, !- Terminal Unit Availability Schedule + TU5 Inlet Node, !- Terminal Unit Air Inlet Node Name + TU5 Outlet Node, !- Terminal Unit Air Outlet Node Name + autosize, !- Cooling Supply Air Flow Rate {m3/s} + autosize, !- No Cooling Supply Air Flow Rate {m3/s} + autosize, !- Heating Supply Air Flow Rate {m3/s} + autosize, !- No Heating Supply Air Flow Rate {m3/s} + autosize, !- Cooling Outdoor Air Flow Rate {m3/s} + autosize, !- Heating Outdoor Air Flow Rate {m3/s} + autosize, !- No Load Outdoor Air Flow Rate {m3/s} + VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name + drawthrough, !- Supply Air Fan Placement + Fan:SystemModel, !- Supply Air Fan Object Type + TU5 VRF Supply Fan, !- Supply Air Fan Object Name + OutdoorAir:Mixer, !- Outside Air Mixer Object Type + TU5 OA Mixer, !- Outside Air Mixer Object Name + Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type + TU5 VRF DX Cooling Coil, !- Cooling Coil Object Name + COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type + TU5 VRF DX Heating Coil, !- Heating Coil Object Name + 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} + 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} + , !- Rated Heating Capacity Sizing Ratio {W/W} + , !- Availability Manager List Name + , !- Design Specification ZoneHVAC Sizing Object Name + , !- Supplemental Heating Coil Object Type + , !- Supplemental Heating Coil Name + , !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + Fan:SystemModel, TU5 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name @@ -660,7 +621,7 @@ TU5 Outlet Node, !- Air Outlet Node Name autosize, !- Design Maximum Air Flow Rate {m3/s} Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction + 0, !- Electric Power Minimum Flow Rate Fraction 600, !- Design Pressure Rise {Pa} 0.9, !- Motor Efficiency 1, !- Motor In Air Stream Fraction @@ -683,13 +644,57 @@ 0, !- Coefficient3 x**2 0.928, !- Coefficient4 x**3 0, !- Coefficient5 x**4 - 0.0000000, !- Minimum Value of x + 0.0000000, !- Minimum Value of x 1.0, !- Maximum Value of x 0.0, !- Minimum Curve Output 5.0, !- Maximum Curve Output Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type + Schedule:Compact, + VRFFanSchedule, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 7:00,1.0, !- Field 3 + Until: 18:00,1.0, !- Field 5 + Until: 24:00,1.0; !- Field 7 + + OutdoorAir:Mixer, + TU1 OA Mixer, !- Name + TU1 VRF DX CCoil Inlet Node, !- Mixed Air Node Name + Outside Air Inlet Node 1,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 1,!- Relief Air Stream Node Name + TU1 Inlet Node; !- Return Air Stream Node Name + + OutdoorAir:Mixer, + TU2 OA Mixer, !- Name + TU2 VRF DX CCoil Inlet Node, !- Mixed Air Node Name + Outside Air Inlet Node 2,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 2,!- Relief Air Stream Node Name + TU2 Inlet Node; !- Return Air Stream Node Name + + OutdoorAir:Mixer, + TU3 OA Mixer, !- Name + TU3 VRF DX CCoil Inlet Node, !- Mixed Air Node Name + Outside Air Inlet Node 3,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 3,!- Relief Air Stream Node Name + TU3 Inlet Node; !- Return Air Stream Node Name + + OutdoorAir:Mixer, + TU4 OA Mixer, !- Name + TU4 VRF DX CCoil Inlet Node, !- Mixed Air Node Name + Outside Air Inlet Node 4,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 4,!- Relief Air Stream Node Name + TU4 Inlet Node; !- Return Air Stream Node Name + + OutdoorAir:Mixer, + TU5 OA Mixer, !- Name + TU5 VRF DX CCoil Inlet Node, !- Mixed Air Node Name + Outside Air Inlet Node 5,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 5,!- Relief Air Stream Node Name + TU5 Inlet Node; !- Return Air Stream Node Name + !- =========== ALL OBJECTS IN CLASS: COIL:COOLING:DX:VARIABLEREFRIGERANTFLOW:FLUIDTEMPERATURECONTROL =========== Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, @@ -2125,7 +2130,8 @@ HeatBalanceAlgorithm,ConductionTransferFunction; ZoneAirHeatBalanceAlgorithm, - AnalyticalSolution; !- Algorithm + AnalyticalSolution, !- Algorithm + ; !- Do Space Heat Balance for Sizing GlobalGeometryRules, UpperLeftCorner, !- Starting Vertex Position @@ -2827,8 +2833,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.0167, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -2853,7 +2859,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -2867,7 +2873,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -3042,8 +3048,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.00717, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -3068,7 +3074,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -3082,7 +3088,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -3222,8 +3228,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.0167, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -3248,7 +3254,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -3262,7 +3268,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -3417,8 +3423,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.00717, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -3443,7 +3449,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -3457,7 +3463,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -3597,8 +3603,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.031089, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -3623,7 +3629,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -3637,7 +3643,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -3776,7 +3782,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE1-1, !- Name @@ -3812,7 +3825,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE2-1, !- Name @@ -3848,7 +3868,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE3-1, !- Name @@ -3884,7 +3911,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE4-1, !- Name @@ -3920,7 +3954,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE5-1, !- Name diff --git a/testfiles/VariableRefrigerantFlow_FluidTCtrl_HR_5Zone.idf b/testfiles/VariableRefrigerantFlow_FluidTCtrl_HR_5Zone.idf index 423639c97d9..c40c8642f64 100644 --- a/testfiles/VariableRefrigerantFlow_FluidTCtrl_HR_5Zone.idf +++ b/testfiles/VariableRefrigerantFlow_FluidTCtrl_HR_5Zone.idf @@ -354,175 +354,8 @@ , !- Design Specification ZoneHVAC Sizing Object Name , !- Supplemental Heating Coil Object Type , !- Supplemental Heating Coil Name - ; !- Maximum Supply Air Temperature from Supplemental Heater {C} - - ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, - TU2, !- Zone Terminal Unit Name - VRFAvailSched, !- Terminal Unit Availability Schedule - TU2 Inlet Node, !- Terminal Unit Air Inlet Node Name - TU2 Outlet Node, !- Terminal Unit Air Outlet Node Name - autosize, !- Cooling Supply Air Flow Rate {m3/s} - autosize, !- No Cooling Supply Air Flow Rate {m3/s} - autosize, !- Heating Supply Air Flow Rate {m3/s} - autosize, !- No Heating Supply Air Flow Rate {m3/s} - autosize, !- Cooling Outdoor Air Flow Rate {m3/s} - autosize, !- Heating Outdoor Air Flow Rate {m3/s} - autosize, !- No Load Outdoor Air Flow Rate {m3/s} - VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name - drawthrough, !- Supply Air Fan Placement - Fan:SystemModel, !- Supply Air Fan Object Type - TU2 VRF Supply Fan, !- Supply Air Fan Object Name - OutdoorAir:Mixer, !- Outside Air Mixer Object Type - TU2 OA Mixer, !- Outside Air Mixer Object Name - Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type - TU2 VRF DX Cooling Coil, !- Cooling Coil Object Name - COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type - TU2 VRF DX Heating Coil, !- Heating Coil Object Name - 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} - 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} - , !- Rated Heating Capacity Sizing Ratio {W/W} - , !- Availability Manager List Name - , !- Design Specification ZoneHVAC Sizing Object Name - , !- Supplemental Heating Coil Object Type - , !- Supplemental Heating Coil Name - ; !- Maximum Supply Air Temperature from Supplemental Heater {C} - - ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, - TU3, !- Zone Terminal Unit Name - VRFAvailSched, !- Terminal Unit Availability Schedule - TU3 Inlet Node, !- Terminal Unit Air Inlet Node Name - TU3 Outlet Node, !- Terminal Unit Air Outlet Node Name - autosize, !- Cooling Supply Air Flow Rate {m3/s} - autosize, !- No Cooling Supply Air Flow Rate {m3/s} - autosize, !- Heating Supply Air Flow Rate {m3/s} - autosize, !- No Heating Supply Air Flow Rate {m3/s} - autosize, !- Cooling Outdoor Air Flow Rate {m3/s} - autosize, !- Heating Outdoor Air Flow Rate {m3/s} - autosize, !- No Load Outdoor Air Flow Rate {m3/s} - VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name - drawthrough, !- Supply Air Fan Placement - Fan:SystemModel, !- Supply Air Fan Object Type - TU3 VRF Supply Fan, !- Supply Air Fan Object Name - OutdoorAir:Mixer, !- Outside Air Mixer Object Type - TU3 OA Mixer, !- Outside Air Mixer Object Name - Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type - TU3 VRF DX Cooling Coil, !- Cooling Coil Object Name - COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type - TU3 VRF DX Heating Coil, !- Heating Coil Object Name - 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} - 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} - , !- Rated Heating Capacity Sizing Ratio {W/W} - , !- Availability Manager List Name - , !- Design Specification ZoneHVAC Sizing Object Name - , !- Supplemental Heating Coil Object Type - , !- Supplemental Heating Coil Name - ; !- Maximum Supply Air Temperature from Supplemental Heater {C} - - ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, - TU4, !- Zone Terminal Unit Name - VRFAvailSched, !- Terminal Unit Availability Schedule - TU4 Inlet Node, !- Terminal Unit Air Inlet Node Name - TU4 Outlet Node, !- Terminal Unit Air Outlet Node Name - autosize, !- Cooling Supply Air Flow Rate {m3/s} - autosize, !- No Cooling Supply Air Flow Rate {m3/s} - autosize, !- Heating Supply Air Flow Rate {m3/s} - autosize, !- No Heating Supply Air Flow Rate {m3/s} - autosize, !- Cooling Outdoor Air Flow Rate {m3/s} - autosize, !- Heating Outdoor Air Flow Rate {m3/s} - autosize, !- No Load Outdoor Air Flow Rate {m3/s} - VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name - drawthrough, !- Supply Air Fan Placement - Fan:SystemModel, !- Supply Air Fan Object Type - TU4 VRF Supply Fan, !- Supply Air Fan Object Name - OutdoorAir:Mixer, !- Outside Air Mixer Object Type - TU4 OA Mixer, !- Outside Air Mixer Object Name - Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type - TU4 VRF DX Cooling Coil, !- Cooling Coil Object Name - COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type - TU4 VRF DX Heating Coil, !- Heating Coil Object Name - 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} - 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} - , !- Rated Heating Capacity Sizing Ratio {W/W} - , !- Availability Manager List Name - , !- Design Specification ZoneHVAC Sizing Object Name - , !- Supplemental Heating Coil Object Type - , !- Supplemental Heating Coil Name - ; !- Maximum Supply Air Temperature from Supplemental Heater {C} - - ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, - TU5, !- Zone Terminal Unit Name - VRFAvailSched, !- Terminal Unit Availability Schedule - TU5 Inlet Node, !- Terminal Unit Air Inlet Node Name - TU5 Outlet Node, !- Terminal Unit Air Outlet Node Name - autosize, !- Cooling Supply Air Flow Rate {m3/s} - autosize, !- No Cooling Supply Air Flow Rate {m3/s} - autosize, !- Heating Supply Air Flow Rate {m3/s} - autosize, !- No Heating Supply Air Flow Rate {m3/s} - autosize, !- Cooling Outdoor Air Flow Rate {m3/s} - autosize, !- Heating Outdoor Air Flow Rate {m3/s} - autosize, !- No Load Outdoor Air Flow Rate {m3/s} - VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name - drawthrough, !- Supply Air Fan Placement - Fan:SystemModel, !- Supply Air Fan Object Type - TU5 VRF Supply Fan, !- Supply Air Fan Object Name - OutdoorAir:Mixer, !- Outside Air Mixer Object Type - TU5 OA Mixer, !- Outside Air Mixer Object Name - Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type - TU5 VRF DX Cooling Coil, !- Cooling Coil Object Name - COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type - TU5 VRF DX Heating Coil, !- Heating Coil Object Name - 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} - 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} - , !- Rated Heating Capacity Sizing Ratio {W/W} - , !- Availability Manager List Name - , !- Design Specification ZoneHVAC Sizing Object Name - , !- Supplemental Heating Coil Object Type - , !- Supplemental Heating Coil Name - ; !- Maximum Supply Air Temperature from Supplemental Heater {C} - - Schedule:Compact, - VRFFanSchedule, !- Name - Any Number, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 7:00,1.0, !- Field 3 - Until: 18:00,1.0, !- Field 5 - Until: 24:00,1.0; !- Field 7 - - OutdoorAir:Mixer, - TU1 OA Mixer, !- Name - TU1 VRF DX CCoil Inlet Node, !- Mixed Air Node Name - Outside Air Inlet Node 1,!- Outdoor Air Stream Node Name - Relief Air Outlet Node 1,!- Relief Air Stream Node Name - TU1 Inlet Node; !- Return Air Stream Node Name - - OutdoorAir:Mixer, - TU2 OA Mixer, !- Name - TU2 VRF DX CCoil Inlet Node, !- Mixed Air Node Name - Outside Air Inlet Node 2,!- Outdoor Air Stream Node Name - Relief Air Outlet Node 2,!- Relief Air Stream Node Name - TU2 Inlet Node; !- Return Air Stream Node Name - - OutdoorAir:Mixer, - TU3 OA Mixer, !- Name - TU3 VRF DX CCoil Inlet Node, !- Mixed Air Node Name - Outside Air Inlet Node 3,!- Outdoor Air Stream Node Name - Relief Air Outlet Node 3,!- Relief Air Stream Node Name - TU3 Inlet Node; !- Return Air Stream Node Name - - OutdoorAir:Mixer, - TU4 OA Mixer, !- Name - TU4 VRF DX CCoil Inlet Node, !- Mixed Air Node Name - Outside Air Inlet Node 4,!- Outdoor Air Stream Node Name - Relief Air Outlet Node 4,!- Relief Air Stream Node Name - TU4 Inlet Node; !- Return Air Stream Node Name - - OutdoorAir:Mixer, - TU5 OA Mixer, !- Name - TU5 VRF DX CCoil Inlet Node, !- Mixed Air Node Name - Outside Air Inlet Node 5,!- Outdoor Air Stream Node Name - Relief Air Outlet Node 5,!- Relief Air Stream Node Name - TU5 Inlet Node; !- Return Air Stream Node Name + , !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} Fan:SystemModel, TU1 VRF Supply Fan, !- Name @@ -531,7 +364,7 @@ TU1 Outlet Node, !- Air Outlet Node Name autosize, !- Design Maximum Air Flow Rate {m3/s} Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction + 0, !- Electric Power Minimum Flow Rate Fraction 600, !- Design Pressure Rise {Pa} 0.9, !- Motor Efficiency 1, !- Motor In Air Stream Fraction @@ -561,6 +394,38 @@ Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type + ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, + TU2, !- Zone Terminal Unit Name + VRFAvailSched, !- Terminal Unit Availability Schedule + TU2 Inlet Node, !- Terminal Unit Air Inlet Node Name + TU2 Outlet Node, !- Terminal Unit Air Outlet Node Name + autosize, !- Cooling Supply Air Flow Rate {m3/s} + autosize, !- No Cooling Supply Air Flow Rate {m3/s} + autosize, !- Heating Supply Air Flow Rate {m3/s} + autosize, !- No Heating Supply Air Flow Rate {m3/s} + autosize, !- Cooling Outdoor Air Flow Rate {m3/s} + autosize, !- Heating Outdoor Air Flow Rate {m3/s} + autosize, !- No Load Outdoor Air Flow Rate {m3/s} + VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name + drawthrough, !- Supply Air Fan Placement + Fan:SystemModel, !- Supply Air Fan Object Type + TU2 VRF Supply Fan, !- Supply Air Fan Object Name + OutdoorAir:Mixer, !- Outside Air Mixer Object Type + TU2 OA Mixer, !- Outside Air Mixer Object Name + Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type + TU2 VRF DX Cooling Coil, !- Cooling Coil Object Name + COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type + TU2 VRF DX Heating Coil, !- Heating Coil Object Name + 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} + 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} + , !- Rated Heating Capacity Sizing Ratio {W/W} + , !- Availability Manager List Name + , !- Design Specification ZoneHVAC Sizing Object Name + , !- Supplemental Heating Coil Object Type + , !- Supplemental Heating Coil Name + , !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + Fan:SystemModel, TU2 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name @@ -568,7 +433,7 @@ TU2 Outlet Node, !- Air Outlet Node Name autosize, !- Design Maximum Air Flow Rate {m3/s} Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction + 0, !- Electric Power Minimum Flow Rate Fraction 600, !- Design Pressure Rise {Pa} 0.9, !- Motor Efficiency 1, !- Motor In Air Stream Fraction @@ -598,6 +463,38 @@ Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type + ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, + TU3, !- Zone Terminal Unit Name + VRFAvailSched, !- Terminal Unit Availability Schedule + TU3 Inlet Node, !- Terminal Unit Air Inlet Node Name + TU3 Outlet Node, !- Terminal Unit Air Outlet Node Name + autosize, !- Cooling Supply Air Flow Rate {m3/s} + autosize, !- No Cooling Supply Air Flow Rate {m3/s} + autosize, !- Heating Supply Air Flow Rate {m3/s} + autosize, !- No Heating Supply Air Flow Rate {m3/s} + autosize, !- Cooling Outdoor Air Flow Rate {m3/s} + autosize, !- Heating Outdoor Air Flow Rate {m3/s} + autosize, !- No Load Outdoor Air Flow Rate {m3/s} + VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name + drawthrough, !- Supply Air Fan Placement + Fan:SystemModel, !- Supply Air Fan Object Type + TU3 VRF Supply Fan, !- Supply Air Fan Object Name + OutdoorAir:Mixer, !- Outside Air Mixer Object Type + TU3 OA Mixer, !- Outside Air Mixer Object Name + Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type + TU3 VRF DX Cooling Coil, !- Cooling Coil Object Name + COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type + TU3 VRF DX Heating Coil, !- Heating Coil Object Name + 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} + 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} + , !- Rated Heating Capacity Sizing Ratio {W/W} + , !- Availability Manager List Name + , !- Design Specification ZoneHVAC Sizing Object Name + , !- Supplemental Heating Coil Object Type + , !- Supplemental Heating Coil Name + , !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + Fan:SystemModel, TU3 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name @@ -605,7 +502,7 @@ TU3 Outlet Node, !- Air Outlet Node Name autosize, !- Design Maximum Air Flow Rate {m3/s} Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction + 0, !- Electric Power Minimum Flow Rate Fraction 600, !- Design Pressure Rise {Pa} 0.9, !- Motor Efficiency 1, !- Motor In Air Stream Fraction @@ -635,6 +532,38 @@ Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type + ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, + TU4, !- Zone Terminal Unit Name + VRFAvailSched, !- Terminal Unit Availability Schedule + TU4 Inlet Node, !- Terminal Unit Air Inlet Node Name + TU4 Outlet Node, !- Terminal Unit Air Outlet Node Name + autosize, !- Cooling Supply Air Flow Rate {m3/s} + autosize, !- No Cooling Supply Air Flow Rate {m3/s} + autosize, !- Heating Supply Air Flow Rate {m3/s} + autosize, !- No Heating Supply Air Flow Rate {m3/s} + autosize, !- Cooling Outdoor Air Flow Rate {m3/s} + autosize, !- Heating Outdoor Air Flow Rate {m3/s} + autosize, !- No Load Outdoor Air Flow Rate {m3/s} + VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name + drawthrough, !- Supply Air Fan Placement + Fan:SystemModel, !- Supply Air Fan Object Type + TU4 VRF Supply Fan, !- Supply Air Fan Object Name + OutdoorAir:Mixer, !- Outside Air Mixer Object Type + TU4 OA Mixer, !- Outside Air Mixer Object Name + Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type + TU4 VRF DX Cooling Coil, !- Cooling Coil Object Name + COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type + TU4 VRF DX Heating Coil, !- Heating Coil Object Name + 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} + 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} + , !- Rated Heating Capacity Sizing Ratio {W/W} + , !- Availability Manager List Name + , !- Design Specification ZoneHVAC Sizing Object Name + , !- Supplemental Heating Coil Object Type + , !- Supplemental Heating Coil Name + , !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + Fan:SystemModel, TU4 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name @@ -642,7 +571,7 @@ TU4 Outlet Node, !- Air Outlet Node Name autosize, !- Design Maximum Air Flow Rate {m3/s} Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction + 0, !- Electric Power Minimum Flow Rate Fraction 600, !- Design Pressure Rise {Pa} 0.9, !- Motor Efficiency 1, !- Motor In Air Stream Fraction @@ -672,6 +601,38 @@ Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type + ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, + TU5, !- Zone Terminal Unit Name + VRFAvailSched, !- Terminal Unit Availability Schedule + TU5 Inlet Node, !- Terminal Unit Air Inlet Node Name + TU5 Outlet Node, !- Terminal Unit Air Outlet Node Name + autosize, !- Cooling Supply Air Flow Rate {m3/s} + autosize, !- No Cooling Supply Air Flow Rate {m3/s} + autosize, !- Heating Supply Air Flow Rate {m3/s} + autosize, !- No Heating Supply Air Flow Rate {m3/s} + autosize, !- Cooling Outdoor Air Flow Rate {m3/s} + autosize, !- Heating Outdoor Air Flow Rate {m3/s} + autosize, !- No Load Outdoor Air Flow Rate {m3/s} + VRFFanSchedule, !- Supply Air Fan Operating Mode Schedule Name + drawthrough, !- Supply Air Fan Placement + Fan:SystemModel, !- Supply Air Fan Object Type + TU5 VRF Supply Fan, !- Supply Air Fan Object Name + OutdoorAir:Mixer, !- Outside Air Mixer Object Type + TU5 OA Mixer, !- Outside Air Mixer Object Name + Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, !- Cooling Coil Object Type + TU5 VRF DX Cooling Coil, !- Cooling Coil Object Name + COIL:HEATING:DX:VARIABLEREFRIGERANTFLOW:FluidTemperatureControl, !- Heating Coil Object Type + TU5 VRF DX Heating Coil, !- Heating Coil Object Name + 30, !- Zone Terminal Unit On Parasitic Electric Energy Use {W} + 20, !- Zone Terminal Unit Off Parasitic Electric Energy Use {W} + , !- Rated Heating Capacity Sizing Ratio {W/W} + , !- Availability Manager List Name + , !- Design Specification ZoneHVAC Sizing Object Name + , !- Supplemental Heating Coil Object Type + , !- Supplemental Heating Coil Name + , !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + Fan:SystemModel, TU5 VRF Supply Fan, !- Name VRFAvailSched, !- Availability Schedule Name @@ -679,7 +640,7 @@ TU5 Outlet Node, !- Air Outlet Node Name autosize, !- Design Maximum Air Flow Rate {m3/s} Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction + 0, !- Electric Power Minimum Flow Rate Fraction 600, !- Design Pressure Rise {Pa} 0.9, !- Motor Efficiency 1, !- Motor In Air Stream Fraction @@ -709,6 +670,50 @@ Dimensionless, !- Input Unit Type for X Dimensionless; !- Output Unit Type + Schedule:Compact, + VRFFanSchedule, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 7:00,1.0, !- Field 3 + Until: 18:00,1.0, !- Field 5 + Until: 24:00,1.0; !- Field 7 + + OutdoorAir:Mixer, + TU1 OA Mixer, !- Name + TU1 VRF DX CCoil Inlet Node, !- Mixed Air Node Name + Outside Air Inlet Node 1,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 1,!- Relief Air Stream Node Name + TU1 Inlet Node; !- Return Air Stream Node Name + + OutdoorAir:Mixer, + TU2 OA Mixer, !- Name + TU2 VRF DX CCoil Inlet Node, !- Mixed Air Node Name + Outside Air Inlet Node 2,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 2,!- Relief Air Stream Node Name + TU2 Inlet Node; !- Return Air Stream Node Name + + OutdoorAir:Mixer, + TU3 OA Mixer, !- Name + TU3 VRF DX CCoil Inlet Node, !- Mixed Air Node Name + Outside Air Inlet Node 3,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 3,!- Relief Air Stream Node Name + TU3 Inlet Node; !- Return Air Stream Node Name + + OutdoorAir:Mixer, + TU4 OA Mixer, !- Name + TU4 VRF DX CCoil Inlet Node, !- Mixed Air Node Name + Outside Air Inlet Node 4,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 4,!- Relief Air Stream Node Name + TU4 Inlet Node; !- Return Air Stream Node Name + + OutdoorAir:Mixer, + TU5 OA Mixer, !- Name + TU5 VRF DX CCoil Inlet Node, !- Mixed Air Node Name + Outside Air Inlet Node 5,!- Outdoor Air Stream Node Name + Relief Air Outlet Node 5,!- Relief Air Stream Node Name + TU5 Inlet Node; !- Return Air Stream Node Name + !- =========== ALL OBJECTS IN CLASS: COIL:COOLING:DX:VARIABLEREFRIGERANTFLOW:FLUIDTEMPERATURECONTROL =========== Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, @@ -2144,7 +2149,8 @@ HeatBalanceAlgorithm,ConductionTransferFunction; ZoneAirHeatBalanceAlgorithm, - AnalyticalSolution; !- Algorithm + AnalyticalSolution, !- Algorithm + ; !- Do Space Heat Balance for Sizing GlobalGeometryRules, UpperLeftCorner, !- Starting Vertex Position @@ -2846,8 +2852,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.0167, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -2872,7 +2878,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -2886,7 +2892,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -3061,8 +3067,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.00717, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -3087,7 +3093,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -3101,7 +3107,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -3241,8 +3247,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.0167, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -3267,7 +3273,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -3281,7 +3287,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -3436,8 +3442,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.00717, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -3462,7 +3468,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -3476,7 +3482,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -3616,8 +3622,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.031089, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -3642,7 +3648,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -3656,7 +3662,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 107.64, !- Watts per Zone Floor Area {W/m2} + 107.64, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -3795,7 +3801,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE1-1, !- Name @@ -3831,7 +3844,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE2-1, !- Name @@ -3867,7 +3887,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE3-1, !- Name @@ -3903,7 +3930,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE4-1, !- Name @@ -3939,7 +3973,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} DesignSpecification:OutdoorAir, SZ DSOA SPACE5-1, !- Name diff --git a/testfiles/VariableRefrigerantFlow_FluidTCtrl_wSuppHeater_5Zone.idf b/testfiles/VariableRefrigerantFlow_FluidTCtrl_wSuppHeater_5Zone.idf index 611e87422c2..4b4c889d90c 100644 --- a/testfiles/VariableRefrigerantFlow_FluidTCtrl_wSuppHeater_5Zone.idf +++ b/testfiles/VariableRefrigerantFlow_FluidTCtrl_wSuppHeater_5Zone.idf @@ -145,7 +145,8 @@ !- =========== ALL OBJECTS IN CLASS: ZONEAIRHEATBALANCEALGORITHM =========== ZoneAirHeatBalanceAlgorithm, - AnalyticalSolution; !- Algorithm + AnalyticalSolution, !- Algorithm + ; !- Do Space Heat Balance for Sizing !- =========== ALL OBJECTS IN CLASS: TIMESTEP =========== @@ -1721,7 +1722,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -1735,7 +1736,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -1749,7 +1750,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -1763,7 +1764,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -1777,7 +1778,7 @@ LIGHTS-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Lighting Level {W} - 16.15, !- Watts per Zone Floor Area {W/m2} + 16.15, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0.0, !- Return Air Fraction 0.59, !- Fraction Radiant @@ -1793,7 +1794,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -1805,7 +1806,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -1817,7 +1818,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -1829,7 +1830,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -1841,7 +1842,7 @@ EQUIP-1, !- Schedule Name Watts/Area, !- Design Level Calculation Method , !- Design Level {W} - 10.76, !- Watts per Zone Floor Area {W/m2} + 10.76, !- Watts per Floor Area {W/m2} , !- Watts per Person {W/person} 0, !- Fraction Latent 0.3, !- Fraction Radiant @@ -1855,8 +1856,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.0167, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -1869,8 +1870,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.00717, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -1883,8 +1884,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.0167, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -1897,8 +1898,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.00717, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -1911,8 +1912,8 @@ INFIL-SCH, !- Schedule Name flow/zone, !- Design Flow Rate Calculation Method 0.031089, !- Design Flow Rate {m3/s} - , !- Flow per Zone Floor Area {m3/s-m2} - , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Flow Rate per Floor Area {m3/s-m2} + , !- Flow Rate per Exterior Surface Area {m3/s-m2} , !- Air Changes per Hour {1/hr} 0, !- Constant Term Coefficient 0, !- Temperature Term Coefficient @@ -1991,7 +1992,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} Sizing:Zone, SPACE2-1, !- Zone or ZoneList Name @@ -2020,7 +2028,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} Sizing:Zone, SPACE3-1, !- Zone or ZoneList Name @@ -2049,7 +2064,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} Sizing:Zone, SPACE4-1, !- Zone or ZoneList Name @@ -2078,7 +2100,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} Sizing:Zone, SPACE5-1, !- Zone or ZoneList Name @@ -2107,7 +2136,14 @@ No, !- Account for Dedicated Outdoor Air System NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} - autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + autosize, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + , !- Zone Load Sizing Method + , !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method + , !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + , !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} + , !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method + , !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir} + ; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir} !- =========== ALL OBJECTS IN CLASS: SIZING:PLANT =========== ! ************* Hot Water Plant Loop for space heating ****************************** @@ -2222,7 +2258,45 @@ , !- Design Specification ZoneHVAC Sizing Object Name Coil:Heating:Electric, !- Supplemental Heating Coil Object Type TU1 Supp Heating Coil, !- Supplemental Heating Coil Name - autosize; !- Maximum Supply Air Temperature from Supplemental Heater {C} + autosize, !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + + Fan:SystemModel, + TU1 VRF Supply Fan, !- Name + VRFAvailSched, !- Availability Schedule Name + TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name + TU1 VRF Fan Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU1 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction + General; !- End-Use Subcategory + + Curve:Quartic, + TU1 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, TU2, !- Zone Terminal Unit Name @@ -2253,7 +2327,45 @@ , !- Design Specification ZoneHVAC Sizing Object Name Coil:Heating:Fuel, !- Supplemental Heating Coil Object Type TU2 Supp Heating Coil, !- Supplemental Heating Coil Name - autosize; !- Maximum Supply Air Temperature from Supplemental Heater {C} + autosize, !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + + Fan:SystemModel, + TU2 VRF Supply Fan, !- Name + VRFAvailSched, !- Availability Schedule Name + TU2 VRF DX HCoil Outlet Node, !- Air Inlet Node Name + TU2 VRF Fan Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU2 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction + General; !- End-Use Subcategory + + Curve:Quartic, + TU2 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, TU3, !- Zone Terminal Unit Name @@ -2284,7 +2396,45 @@ , !- Design Specification ZoneHVAC Sizing Object Name Coil:Heating:Water, !- Supplemental Heating Coil Object Type TU3 Supp Heating Coil, !- Supplemental Heating Coil Name - autosize; !- Maximum Supply Air Temperature from Supplemental Heater {C} + autosize, !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + + Fan:SystemModel, + TU3 VRF Supply Fan, !- Name + VRFAvailSched, !- Availability Schedule Name + TU3 VRF DX HCoil Outlet Node, !- Air Inlet Node Name + TU3 VRF Fan Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU3 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction + General; !- End-Use Subcategory + + Curve:Quartic, + TU3 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, TU4, !- Zone Terminal Unit Name @@ -2315,7 +2465,45 @@ , !- Design Specification ZoneHVAC Sizing Object Name Coil:Heating:Fuel, !- Supplemental Heating Coil Object Type TU4 Supp Heating Coil, !- Supplemental Heating Coil Name - autosize; !- Maximum Supply Air Temperature from Supplemental Heater {C} + autosize, !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + + Fan:SystemModel, + TU4 VRF Supply Fan, !- Name + VRFAvailSched, !- Availability Schedule Name + TU4 VRF DX HCoil Outlet Node, !- Air Inlet Node Name + TU4 VRF Fan Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU4 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction + General; !- End-Use Subcategory + + Curve:Quartic, + TU4 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, TU5, !- Zone Terminal Unit Name @@ -2346,7 +2534,45 @@ , !- Design Specification ZoneHVAC Sizing Object Name Coil:Heating:Steam, !- Supplemental Heating Coil Object Type TU5 Supp Heating Coil, !- Supplemental Heating Coil Name - autosize; !- Maximum Supply Air Temperature from Supplemental Heater {C} + autosize, !- Maximum Supply Air Temperature from Supplemental Heater {C} + ; !- Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation {C} + + Fan:SystemModel, + TU5 VRF Supply Fan, !- Name + VRFAvailSched, !- Availability Schedule Name + TU5 VRF DX HCoil Outlet Node, !- Air Inlet Node Name + TU5 VRF Fan Outlet Node, !- Air Outlet Node Name + autosize, !- Design Maximum Air Flow Rate {m3/s} + Continuous, !- Speed Control Method + 0, !- Electric Power Minimum Flow Rate Fraction + 600, !- Design Pressure Rise {Pa} + 0.9, !- Motor Efficiency + 1, !- Motor In Air Stream Fraction + autosize, !- Design Electric Power Consumption {W} + TotalEfficiencyAndPressure, !- Design Power Sizing Method + , !- Electric Power Per Unit Flow Rate {W/(m3/s)} + , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} + 0.7, !- Fan Total Efficiency + TU5 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name + , !- Night Ventilation Mode Pressure Rise {Pa} + , !- Night Ventilation Mode Flow Fraction + , !- Motor Loss Zone Name + , !- Motor Loss Radiative Fraction + General; !- End-Use Subcategory + + Curve:Quartic, + TU5 VRF Supply Fan_curve,!- Name + 0.059, !- Coefficient1 Constant + 0, !- Coefficient2 x + 0, !- Coefficient3 x**2 + 0.928, !- Coefficient4 x**3 + 0, !- Coefficient5 x**4 + 0.0000000, !- Minimum Value of x + 1.0, !- Maximum Value of x + 0.0, !- Minimum Curve Output + 5.0, !- Maximum Curve Output + Dimensionless, !- Input Unit Type for X + Dimensionless; !- Output Unit Type !- =========== ALL OBJECTS IN CLASS: ZONEHVAC:EQUIPMENTLIST =========== @@ -2442,193 +2668,6 @@ SPACE5-1 Node, !- Zone Air Node Name SPACE5-1 Out Node; !- Zone Return Air Node or NodeList Name -!- =========== ALL OBJECTS IN CLASS: FAN:VARIABLEVOLUME =========== - - Fan:SystemModel, - TU1 VRF Supply Fan, !- Name - VRFAvailSched, !- Availability Schedule Name - TU1 VRF DX HCoil Outlet Node, !- Air Inlet Node Name - TU1 VRF Fan Outlet Node, !- Air Outlet Node Name - autosize, !- Design Maximum Air Flow Rate {m3/s} - Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction - 600, !- Design Pressure Rise {Pa} - 0.9, !- Motor Efficiency - 1, !- Motor In Air Stream Fraction - autosize, !- Design Electric Power Consumption {W} - TotalEfficiencyAndPressure, !- Design Power Sizing Method - , !- Electric Power Per Unit Flow Rate {W/(m3/s)} - , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} - 0.7, !- Fan Total Efficiency - TU1 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name - , !- Night Ventilation Mode Pressure Rise {Pa} - , !- Night Ventilation Mode Flow Fraction - , !- Motor Loss Zone Name - , !- Motor Loss Radiative Fraction - General; !- End-Use Subcategory - - Curve:Quartic, - TU1 VRF Supply Fan_curve,!- Name - 0.059, !- Coefficient1 Constant - 0, !- Coefficient2 x - 0, !- Coefficient3 x**2 - 0.928, !- Coefficient4 x**3 - 0, !- Coefficient5 x**4 - 0.0000000, !- Minimum Value of x - 1.0, !- Maximum Value of x - 0.0, !- Minimum Curve Output - 5.0, !- Maximum Curve Output - Dimensionless, !- Input Unit Type for X - Dimensionless; !- Output Unit Type - - Fan:SystemModel, - TU2 VRF Supply Fan, !- Name - VRFAvailSched, !- Availability Schedule Name - TU2 VRF DX HCoil Outlet Node, !- Air Inlet Node Name - TU2 VRF Fan Outlet Node, !- Air Outlet Node Name - autosize, !- Design Maximum Air Flow Rate {m3/s} - Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction - 600, !- Design Pressure Rise {Pa} - 0.9, !- Motor Efficiency - 1, !- Motor In Air Stream Fraction - autosize, !- Design Electric Power Consumption {W} - TotalEfficiencyAndPressure, !- Design Power Sizing Method - , !- Electric Power Per Unit Flow Rate {W/(m3/s)} - , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} - 0.7, !- Fan Total Efficiency - TU2 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name - , !- Night Ventilation Mode Pressure Rise {Pa} - , !- Night Ventilation Mode Flow Fraction - , !- Motor Loss Zone Name - , !- Motor Loss Radiative Fraction - General; !- End-Use Subcategory - - Curve:Quartic, - TU2 VRF Supply Fan_curve,!- Name - 0.059, !- Coefficient1 Constant - 0, !- Coefficient2 x - 0, !- Coefficient3 x**2 - 0.928, !- Coefficient4 x**3 - 0, !- Coefficient5 x**4 - 0.0000000, !- Minimum Value of x - 1.0, !- Maximum Value of x - 0.0, !- Minimum Curve Output - 5.0, !- Maximum Curve Output - Dimensionless, !- Input Unit Type for X - Dimensionless; !- Output Unit Type - - Fan:SystemModel, - TU3 VRF Supply Fan, !- Name - VRFAvailSched, !- Availability Schedule Name - TU3 VRF DX HCoil Outlet Node, !- Air Inlet Node Name - TU3 VRF Fan Outlet Node, !- Air Outlet Node Name - autosize, !- Design Maximum Air Flow Rate {m3/s} - Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction - 600, !- Design Pressure Rise {Pa} - 0.9, !- Motor Efficiency - 1, !- Motor In Air Stream Fraction - autosize, !- Design Electric Power Consumption {W} - TotalEfficiencyAndPressure, !- Design Power Sizing Method - , !- Electric Power Per Unit Flow Rate {W/(m3/s)} - , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} - 0.7, !- Fan Total Efficiency - TU3 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name - , !- Night Ventilation Mode Pressure Rise {Pa} - , !- Night Ventilation Mode Flow Fraction - , !- Motor Loss Zone Name - , !- Motor Loss Radiative Fraction - General; !- End-Use Subcategory - - Curve:Quartic, - TU3 VRF Supply Fan_curve,!- Name - 0.059, !- Coefficient1 Constant - 0, !- Coefficient2 x - 0, !- Coefficient3 x**2 - 0.928, !- Coefficient4 x**3 - 0, !- Coefficient5 x**4 - 0.0000000, !- Minimum Value of x - 1.0, !- Maximum Value of x - 0.0, !- Minimum Curve Output - 5.0, !- Maximum Curve Output - Dimensionless, !- Input Unit Type for X - Dimensionless; !- Output Unit Type - - Fan:SystemModel, - TU4 VRF Supply Fan, !- Name - VRFAvailSched, !- Availability Schedule Name - TU4 VRF DX HCoil Outlet Node, !- Air Inlet Node Name - TU4 VRF Fan Outlet Node, !- Air Outlet Node Name - autosize, !- Design Maximum Air Flow Rate {m3/s} - Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction - 600, !- Design Pressure Rise {Pa} - 0.9, !- Motor Efficiency - 1, !- Motor In Air Stream Fraction - autosize, !- Design Electric Power Consumption {W} - TotalEfficiencyAndPressure, !- Design Power Sizing Method - , !- Electric Power Per Unit Flow Rate {W/(m3/s)} - , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} - 0.7, !- Fan Total Efficiency - TU4 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name - , !- Night Ventilation Mode Pressure Rise {Pa} - , !- Night Ventilation Mode Flow Fraction - , !- Motor Loss Zone Name - , !- Motor Loss Radiative Fraction - General; !- End-Use Subcategory - - Curve:Quartic, - TU4 VRF Supply Fan_curve,!- Name - 0.059, !- Coefficient1 Constant - 0, !- Coefficient2 x - 0, !- Coefficient3 x**2 - 0.928, !- Coefficient4 x**3 - 0, !- Coefficient5 x**4 - 0.0000000, !- Minimum Value of x - 1.0, !- Maximum Value of x - 0.0, !- Minimum Curve Output - 5.0, !- Maximum Curve Output - Dimensionless, !- Input Unit Type for X - Dimensionless; !- Output Unit Type - - Fan:SystemModel, - TU5 VRF Supply Fan, !- Name - VRFAvailSched, !- Availability Schedule Name - TU5 VRF DX HCoil Outlet Node, !- Air Inlet Node Name - TU5 VRF Fan Outlet Node, !- Air Outlet Node Name - autosize, !- Design Maximum Air Flow Rate {m3/s} - Continuous, !- Speed Control Method - 0.0, !- Electric Power Minimum Flow Rate Fraction - 600, !- Design Pressure Rise {Pa} - 0.9, !- Motor Efficiency - 1, !- Motor In Air Stream Fraction - autosize, !- Design Electric Power Consumption {W} - TotalEfficiencyAndPressure, !- Design Power Sizing Method - , !- Electric Power Per Unit Flow Rate {W/(m3/s)} - , !- Electric Power Per Unit Flow Rate Per Unit Pressure {W/((m3/s)-Pa)} - 0.7, !- Fan Total Efficiency - TU5 VRF Supply Fan_curve,!- Electric Power Function of Flow Fraction Curve Name - , !- Night Ventilation Mode Pressure Rise {Pa} - , !- Night Ventilation Mode Flow Fraction - , !- Motor Loss Zone Name - , !- Motor Loss Radiative Fraction - General; !- End-Use Subcategory - - Curve:Quartic, - TU5 VRF Supply Fan_curve,!- Name - 0.059, !- Coefficient1 Constant - 0, !- Coefficient2 x - 0, !- Coefficient3 x**2 - 0.928, !- Coefficient4 x**3 - 0, !- Coefficient5 x**4 - 0.0000000, !- Minimum Value of x - 1.0, !- Maximum Value of x - 0.0, !- Minimum Curve Output - 5.0, !- Maximum Curve Output - Dimensionless, !- Input Unit Type for X - Dimensionless; !- Output Unit Type - !- =========== ALL OBJECTS IN CLASS: COIL:COOLING:DX:VARIABLEREFRIGERANTFLOW:FLUIDTEMPERATURECONTROL =========== Coil:Cooling:DX:VariableRefrigerantFlow:FluidTemperatureControl, @@ -2905,7 +2944,7 @@ Branch, Heating Purchased Hot Water Branch, !- Name , !- Pressure Drop Curve Name - DistrictHeating:Water, !- Component 1 Object Type + DistrictHeating:Water, !- Component 1 Object Type Purchased Heating, !- Component 1 Name Purchased Heat Inlet Node, !- Component 1 Inlet Node Name Purchased Heat Outlet Node; !- Component 1 Outlet Node Name @@ -3357,7 +3396,7 @@ PlantEquipmentList, heating plant, !- Name - DistrictHeating:Water, !- Equipment 1 Object Type + DistrictHeating:Water, !- Equipment 1 Object Type Purchased Heating; !- Equipment 1 Name PlantEquipmentList, From f968a2cdf0cb54b9601193697f886cb89ee1af1c Mon Sep 17 00:00:00 2001 From: Lixing Gu Date: Thu, 1 Aug 2024 10:11:51 -0400 Subject: [PATCH 070/164] Remove an unnecessary function --- .../include/AirflowNetwork/Solver.hpp | 3 --- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 24 ------------------- 2 files changed, 27 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Solver.hpp b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Solver.hpp index 93e34b5669e..b3f013708e8 100644 --- a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Solver.hpp +++ b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Solver.hpp @@ -307,7 +307,6 @@ namespace AirflowNetwork { void venting_control(int i, // AirflowNetwork surface number Real64 &OpenFactor // Window or door opening factor (used to calculate airflow) ); - void assign_fan_airloop(); void validate_distribution(); void validate_fan_flowrate(); // Catch a fan flow rate from EPlus input file and add a flag for VAV terminal damper void validate_exhaust_fan_input(); @@ -364,7 +363,6 @@ namespace AirflowNetwork { int NumOfOAFans = 0; // number of OutdoorAir fans int NumOfReliefFans = 0; // number of OutdoorAir relief fans bool AirflowNetworkGetInputFlag = true; - bool AssignFanAirLoopNumFlag = true; bool ValidateDistributionSystemFlag = true; Array1D FacadeAng = Array1D(5); // Facade azimuth angle (for walls, angle of outward normal to facade measured clockwise from North) (deg) @@ -592,7 +590,6 @@ namespace AirflowNetwork { NumOfOAFans = 0; NumOfReliefFans = 0; AirflowNetworkGetInputFlag = true; - AssignFanAirLoopNumFlag = true; ValidateDistributionSystemFlag = true; FacadeAng = Array1D(5); AirflowNetworkZnRpt.deallocate(); diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 058ea051962..fb175eb7226 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -269,12 +269,6 @@ namespace AirflowNetwork { // VAV terminal set only if (present(FirstHVACIteration) && FirstHVACIteration) VAVTerminalRatio = 0.0; - // Set AirLoop Number for fans - if (FirstHVACIteration && AssignFanAirLoopNumFlag) { - assign_fan_airloop(); - AssignFanAirLoopNumFlag = false; - } - if (AirflowNetworkFanActivated && distribution_simulated) { if (ValidateDistributionSystemFlag) { validate_distribution(); @@ -10098,24 +10092,6 @@ namespace AirflowNetwork { } } - void Solver::assign_fan_airloop() - { - // Assign the system Fan AirLoop Number based on the zone inlet node - - for (int i = 1; i <= AirflowNetworkNumOfZones; i++) { - for (int j = 1; j <= m_state.dataGlobal->NumOfZones; j++) { - if (!m_state.dataZoneEquip->ZoneEquipConfig(j).IsControlled) continue; - if ((MultizoneZoneData(i).ZoneNum == j) && (m_state.dataZoneEquip->ZoneEquipConfig(j).NumInletNodes > 0)) { - for (int k = 1; k <= DisSysNumOfCVFs; k++) { - if (DisSysCompCVFData(k).AirLoopNum == 0) { - DisSysCompCVFData(k).AirLoopNum = m_state.dataZoneEquip->ZoneEquipConfig(j).InletNodeAirLoopNum(1); - } - } - } - } - } - } - void Solver::validate_distribution() { From dc5c34246fd34b83c3790c06cb581e6af9f121a5 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Thu, 1 Aug 2024 17:58:36 -0700 Subject: [PATCH 071/164] change READ to ProcessNumber --- src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 index 67a848f7a97..8015e693f6b 100644 --- a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 @@ -601,11 +601,20 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile OutArgs(6) = 'Continuous' !- Speed Control Method IF (SameString(OldFanVO(Num3)%minFlowInputMethod, "FixedFlowRate")) THEN IF (.NOT. SameString(OldFanVO(Num3)%maxAirFlow_str, "AUTOSIZE")) THEN - READ(OldFanVO(Num3)%fanPowerMinAirFlow_str, '(F15.5)') fanPowerMinAirFlow - READ(OldFanVO(Num3)%maxAirFlow_str, '(F15.5)') maxAirFlow + fanPowerMinAirFlow = ProcessNumber(OldFanVO(Num3)%fanPowerMinAirFlow_str, ErrFlag) + IF (ErrFlag) THEN + CALL ShowSevereError('Invalid Number, FAN:VARIABLEVOLUME field 8, Fan Power Minimum Air Flow Rate, Name=' // TRIM(OutArgs(1)), Auditf) + END IF + maxAirFlow = ProcessNumber(OldFanVO(Num3)%maxAirFlow_str, ErrFlag) + IF (ErrFlag) THEN + CALL ShowSevereError('Invalid Number, FAN:VARIABLEVOLUME field 5, Maximum Flow Rate, Name=' // TRIM(OutArgs(1)), Auditf) + END IF WRITE(OutArgs(7), '(F15.5)') (fanPowerMinAirFlow / maxAirFlow) ELSE ! maxAirFlow_stris autosize - READ(OldFanVO(Num3)%fanPowerMinAirFlow_str, '(F15.5)') fanPowerMinAirFlow + fanPowerMinAirFlow = ProcessNumber(OldFanVO(Num3)%fanPowerMinAirFlow_str, ErrFlag) + IF (ErrFlag) THEN + CALL ShowSevereError('Invalid Number, FAN:VARIABLEVOLUME field 8, Fan Power Minimum Air Flow Rate, Name=' // TRIM(OutArgs(1)), Auditf) + END IF IF (.NOT. fanPowerMinAirFlow == 0) THEN ! don't know how to do division with autosize CALL writePreprocessorObject(DifLfn, PrognameConversion, 'Warning', & 'Cannot calculate Electric Power Minimum Flow Rate Fraction for' // sysFanName // & From d1c3cd7fd1522b564943cd416a53ca6eb15d1a31 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Thu, 1 Aug 2024 17:59:12 -0700 Subject: [PATCH 072/164] update err message and call ShowWarningError --- src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 index 8015e693f6b..78cd7eb1b90 100644 --- a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 @@ -617,8 +617,14 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile END IF IF (.NOT. fanPowerMinAirFlow == 0) THEN ! don't know how to do division with autosize CALL writePreprocessorObject(DifLfn, PrognameConversion, 'Warning', & - 'Cannot calculate Electric Power Minimum Flow Rate Fraction for' // sysFanName // & - 'when Maximum Flow Rate is autosize and Fan Power Minimum Air Flow Rate is non-zero') + 'Cannot calculate Electric Power Minimum Flow Rate Fraction for Fan:SystemModel=' // sysFanName // & + ' when old Fan:VariableVolume Maximum Flow Rate is autosize and Fan Power Minimum Air Flow Rate is non-zero. ' // & + 'Electric Power Minimum Flow Rate Fraction is set to zero. ' // & + 'Manually size the Maximum Flow Rate if Electric Power Minimum Flow Rate Fraction should not be zero.') + CALL ShowWarningError('Cannot calculate Electric Power Minimum Flow Rate Fraction for Fan:SystemModel=' // sysFanName // & + ' when old Fan:VariableVolume Maximum Flow Rate is autosize and Fan Power Minimum Air Flow Rate is non-zero. ' // & + 'Electric Power Minimum Flow Rate Fraction is set to zero. ' // & + 'Manually size the Maximum Flow Rate if Electric Power Minimum Flow Rate Fraction should not be zero.', Auditf) END IF OutArgs(7) = '0.0' ENDIF From 3c6c5813377b6e3a560e3553e57a9b3612b2c352 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Thu, 1 Aug 2024 17:59:32 -0700 Subject: [PATCH 073/164] use 0.0 as min x value of fan performance curve --- src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 index 78cd7eb1b90..d8bf573e276 100644 --- a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 @@ -657,8 +657,7 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile OutArgs(4) = OldFanVO(Num3)%coeff3 !- Coefficient3 x**2 OutArgs(5) = OldFanVO(Num3)%coeff4 !- Coefficient4 x**3 OutArgs(6) = OldFanVO(Num3)%coeff5 !- Coefficient5 x**4 - READ(OldFanVO(Num3)%fanPowerMinAirFlow_str, '(F15.5)') fanPowerMinAirFlow - WRITE(OutArgs(7), '(F10.7)') (fanPowerMinAirFlow / maxAirFlow) !- Minimum Value of x + OutArgs(7) = '0.0' !- Minimum Value of x OutArgs(8) = '1.0' !- Maximum Value of x OutArgs(9) = '0.0' !- Minimum Curve Output OutArgs(10) = '5.0' !- Maximum Curve Output From f1cb19f478affeb3d5d2f24671c3bcb359f25503 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Fri, 2 Aug 2024 11:39:56 -0500 Subject: [PATCH 074/164] Space IV-Final NFP and Design --- .../FY2024/NFP-Space Sizing and HVAC-Part4.md | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/design/FY2024/NFP-Space Sizing and HVAC-Part4.md b/design/FY2024/NFP-Space Sizing and HVAC-Part4.md index 5f6aef92e27..029ba7e734b 100644 --- a/design/FY2024/NFP-Space Sizing and HVAC-Part4.md +++ b/design/FY2024/NFP-Space Sizing and HVAC-Part4.md @@ -4,6 +4,7 @@ Extend Spaces to Sizing and HVAC - Part 4 **Michael J. Witte, GARD Analytics, Inc.** - Original June 17, 2024 + - Revised, August 2, 2024 ## Table of Contents ## @@ -26,6 +27,7 @@ Extend Spaces to Sizing and HVAC - Part 4 [Design](#design) ## E-mail and Conference Call Conclusions ## +June 17-20, Q&A in the pull request with rraustad. Made some minor updates to the NFP to clarify the sizing methods and to mention that an spsz output file will be created, similar to the existing zsz output. ## Background and Overview ## @@ -61,7 +63,16 @@ This NFP proposes additional optional capabilities: ## Approach ## ### Sizing -* Currently zone sizing is independent of space sizing, essentially sizing all zone equipment to the coincident space peak. A new input will be added to Sizing:Zone to allow zone sizing using the non-coincident space peaks. +A new input will be added to Sizing:Zone to allow zone sizing using the non-coincident space peaks or the coincident peak. + +Space sizing is an actual heat balance on each space. Currently zone sizing is an actual heat balance on each zone (as a whole) although some of the components for the zone heat balance are sums across the spaces (even when space heat balance is off). e.g. internal gains. The current zone sizing calculations will be used to calculate the coincident zone sizing using the combined spaces. + +For the non-coincident zone sizing, the individual space peaks will be summed and other values (such as outdoor temperature) will be averaged. + +When space sizing is active, sizing results are reported in the table output for both spaces and zones. There will be no change here. + +When space sizing is active, a new spssz output file will be generated, similar to the existing zsz output. This will require a new field in the OutputControl:Files object. + ### HVAC * Calculate return flows at the Space level. Currently, space return nodes can be specified, but there is no flow assigned to them. All return flow is lumped at the zone level. @@ -79,14 +90,25 @@ Compare Space vs Zone-level results. Some new objects and some changes to existing objects are proposed. ### Sizing:Zone -* *New field:"* +* *New field at the end:"* ``` - A??, \field Type of Space Sum to Use + A15; \field Type of Space Sum to Use \type choice \key Coincident \key NonCoincident \default Coincident ``` + +### OutputControl:Files +* *New field in the middle:"* +``` + A9 , \field Output Space Sizing + \type choice + \key Yes + \key No + \default Yes +``` + ### ZoneRefrigerationDoorMixing (If budget allows, otherwise limit these to single-space zones.) * *Change field "Zone 1 Name" to "Zone or Space Name 1."* @@ -105,6 +127,7 @@ Some new objects and some changes to existing objects are proposed. ## Outputs Description ## +A new Spsz output file will be created when space sizing is active. ## Engineering Reference ## @@ -112,11 +135,11 @@ Some new objects and some changes to existing objects are proposed. ## Example File and Transition Changes ## -* Transition may be required for idf Sizing:Zone if the new field is placed in the middle of the object. +* Transition will be required for idf OutputControl:Files. * Field name changes may be required for epJSON inputs for ZoneRefrigerationDoorMixing, ZoneCoolTower:Shower, and/or ZoneThermalChimney. -* The existing example file 5ZoneAirCooledWithSpaces will be copied to a new example file that uses the new Sizing:Zone Conincident Space sum option. +* The existing example file 5ZoneAirCooledWithSpaces will be copied to a new example file that uses the new Sizing:Zone Coincident Space sum option. ## Design ## From 043ebb0a3cf2373f29e7a7d9ccc07e8f01049c08 Mon Sep 17 00:00:00 2001 From: "Lerond, Jeremy" Date: Fri, 2 Aug 2024 13:07:10 -0700 Subject: [PATCH 075/164] Add support for zonal VRF terminal PTHP, PTAC, WASHP. Add unit tests and docs, and address comments from #10617. --- .../src/overview/group-airflow-network.tex | 2 +- src/EnergyPlus/AirflowNetwork/src/Solver.cpp | 16 +- src/EnergyPlus/WindowAC.cc | 25 +-- src/EnergyPlus/WindowAC.hh | 3 +- .../unit/AirflowNetworkHVAC.unit.cc | 158 +++++++++++++++++- 5 files changed, 177 insertions(+), 27 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-airflow-network.tex b/doc/input-output-reference/src/overview/group-airflow-network.tex index 0445fd9c008..61599bfaeaa 100644 --- a/doc/input-output-reference/src/overview/group-airflow-network.tex +++ b/doc/input-output-reference/src/overview/group-airflow-network.tex @@ -331,7 +331,7 @@ \subsubsection{Inputs}\label{inputs-004} \paragraph{Field: Allow Unsupported Zone Equipment}\label{allow-unsupported-zone-equipment} -This is an optional field. Input is Yes or No. The default is No. Set this input to Yes to have zone equipment that are currently unsupported in the AirflowNetwork model allowed in the simulation. Setting this field to Yes, allows the following equipment to be modeled along an AirflowNetwork model: ZoneHVAC:Dehumidifier, ZoneHVAC:EnergyRecoveryVentilator, WaterHeater:HeatPump:*, and ZoneHVAC:WindowAirConditioner. The AirflowNetwork model will exclude mass balance in these equipment objects and assume the mass flows are self-balanced in the equipment objects. +This is an optional field. Input is Yes or No. The default is No. Set this input to Yes to have zone equipment that are currently unsupported in the AirflowNetwork model allowed in the simulation. Setting this field to Yes, allows the following equipment to be modeled along an AirflowNetwork model: ZoneHVAC:Dehumidifier, ZoneHVAC:EnergyRecoveryVentilator, WaterHeater:HeatPump:*, ZoneHVAC:WindowAirConditioner, ZoneHVAC:WaterToAirHeatPump, ZoneHVAC:PackagedTerminalAirConditioner, ZoneHVAC:PackagedTerminalHeatPump, and ZoneHVAC:TerminalUnit:VariableRefrigerantFlow. The AirflowNetwork model will exclude mass balance in these equipment objects and assume the mass flows are self-balanced in the equipment objects. These objects should be modeled with no outdoor air flow rate, or in the case of a ZoneHVAC:EnergyRecoveryVentilator with a balanced air flow (same supply airflow rate as exhaust airflow rate). \paragraph{Field: Do Distribution Duct Sizing Calculation}\label{do-distribution-duct-sizing-calculation} diff --git a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp index 36ab0b98e7c..a9ca4ead3aa 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Solver.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Solver.cpp @@ -10143,10 +10143,12 @@ namespace AirflowNetwork { using DXCoils::SetDXCoilAirLoopNumber; using HeatingCoils::SetHeatingCoilAirLoopNumber; using HVACStandAloneERV::GetStandAloneERVNodeNumber; + using HVACVariableRefrigerantFlow::getVRFTUNodeNumber; using SplitterComponent::GetSplitterNodeNumbers; using SplitterComponent::GetSplitterOutletNumber; + using UnitarySystems::getUnitarySystemNodeNumber; using WaterThermalTanks::GetHeatPumpWaterHeaterNodeNumber; - using WindowAC::GetWindowACNodeNumber; + using WindowAC::getWindowACNodeNumber; using ZoneDehumidifier::GetZoneDehumidifierNodeNumber; // SUBROUTINE PARAMETER DEFINITIONS: @@ -10168,7 +10170,7 @@ namespace AirflowNetwork { bool packagedUnitaryFound(false); // Flag for packaged unitary systems (ZoneHVAC:PackagedTerminalAirConditioner, // ZoneHVAC:PackagedTerminalHeatPump, ZoneHVAC:WaterToAirHeatPump) identification bool vrfTUFound(false); - bool WindowACFound(false); // Flag for Window AC (ZoneHVAC:WindowAirConditioner) identification + bool windowACFound(false); // Flag for Window AC (ZoneHVAC:WindowAirConditioner) identification // Validate supply and return connections NodeFound.dimension(m_state.dataLoopNodes->NumOfNodes, false); @@ -10283,21 +10285,21 @@ namespace AirflowNetwork { } // Skip zonal unitary system based nodes that don't have to be included in the AFN - if (UnitarySystems::getUnitarySystemNodeNumber(m_state, i)) { + if (getUnitarySystemNodeNumber(m_state, i)) { NodeFound(i) = true; packagedUnitaryFound = true; } // Skip zonal vrf terminal nodes that don't have to be included in the AFN - if (HVACVariableRefrigerantFlow::getVRFTUNodeNumber(m_state, i)) { + if (getVRFTUNodeNumber(m_state, i)) { NodeFound(i) = true; vrfTUFound = true; } // Skip Window AC with no OA - if (GetWindowACNodeNumber(m_state, i)) { + if (getWindowACNodeNumber(m_state, i)) { NodeFound(i) = true; - WindowACFound = true; + windowACFound = true; } } @@ -10451,7 +10453,7 @@ namespace AirflowNetwork { "A ZoneHVAC:TerminalUnit:VariableRefrigerantFlow is simulated along with an AirflowNetwork but is not " "included in the AirflowNetwork."); } - if (WindowACFound) { + if (windowACFound) { ShowWarningError(m_state, format(RoutineName) + "A ZoneHVAC:WindowAirConditioner is simulated along with an AirflowNetwork but is not " "included in the AirflowNetwork."); diff --git a/src/EnergyPlus/WindowAC.cc b/src/EnergyPlus/WindowAC.cc index 32df382feac..21fc96df840 100644 --- a/src/EnergyPlus/WindowAC.cc +++ b/src/EnergyPlus/WindowAC.cc @@ -359,6 +359,7 @@ namespace WindowAC { } else { state.dataWindowAC->WindAC(WindACNum).OutsideAirNode = OANodeNums(1); state.dataWindowAC->WindAC(WindACNum).AirReliefNode = OANodeNums(2); + state.dataWindowAC->WindAC(WindACNum).ReturnAirNode = OANodeNums(3); state.dataWindowAC->WindAC(WindACNum).MixedAirNode = OANodeNums(4); } } @@ -1499,30 +1500,22 @@ namespace WindowAC { } // WindAC(WindACNum)%DXCoilType_Num == CoilDX_CoolingHXAssisted && * } - bool GetWindowACNodeNumber(EnergyPlusData &state, int const NodeNumber) + bool getWindowACNodeNumber(EnergyPlusData &state, int const nodeNumber) { if (state.dataWindowAC->GetWindowACInputFlag) { GetWindowAC(state); state.dataWindowAC->GetWindowACInputFlag = false; } - bool windowACOutdoorAir = false; - for (int windowACIndex = 1; windowACIndex <= state.dataWindowAC->NumWindAC; ++windowACIndex) { auto &windowAC = state.dataWindowAC->WindAC(windowACIndex); - if (windowAC.OutAirVolFlow == 0) { - windowACOutdoorAir = true; - } else { - windowACOutdoorAir = false; - } - int FanInletNodeIndex = 0; - int FanOutletNodeIndex = 0; - FanInletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->inletNodeNum; - FanOutletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->outletNodeNum; - - if (windowACOutdoorAir && - (NodeNumber == windowAC.OutsideAirNode || NodeNumber == windowAC.MixedAirNode || NodeNumber == windowAC.AirReliefNode || - NodeNumber == FanInletNodeIndex || NodeNumber == FanOutletNodeIndex || NodeNumber == windowAC.AirInNode)) { + int FanInletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->inletNodeNum; + int FanOutletNodeIndex = state.dataFans->fans(windowAC.FanIndex)->outletNodeNum; + + if (windowAC.OutAirVolFlow == 0 && + (nodeNumber == windowAC.OutsideAirNode || nodeNumber == windowAC.MixedAirNode || nodeNumber == windowAC.AirReliefNode || + nodeNumber == FanInletNodeIndex || nodeNumber == FanOutletNodeIndex || nodeNumber == windowAC.AirInNode || + nodeNumber == windowAC.CoilOutletNodeNum || nodeNumber == windowAC.AirOutNode || nodeNumber == windowAC.ReturnAirNode)) { return true; } } diff --git a/src/EnergyPlus/WindowAC.hh b/src/EnergyPlus/WindowAC.hh index 0ac3a1f033d..311b122d99b 100644 --- a/src/EnergyPlus/WindowAC.hh +++ b/src/EnergyPlus/WindowAC.hh @@ -81,6 +81,7 @@ namespace WindowAC { int AirOutNode; // outlet air node number int OutsideAirNode; // outside air node number int AirReliefNode; // relief air node number + int ReturnAirNode; // return air node number int MixedAirNode; // Mixed Air Node number std::string OAMixName; // name of outdoor air mixer std::string OAMixType; // type of outdoor air mixer @@ -197,7 +198,7 @@ namespace WindowAC { bool &HXUnitOn // Used to control HX heat recovery as needed ); - bool GetWindowACNodeNumber(EnergyPlusData &state, int const WindACNum); + bool getWindowACNodeNumber(EnergyPlusData &state, int const WindACNum); int GetWindowACZoneInletAirNode(EnergyPlusData &state, int const WindACNum); diff --git a/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc b/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc index 6eaedc2bdb1..8d93879c64c 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc @@ -19899,6 +19899,9 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestZoneEqpSupportZoneWindowAC) state->dataWindowAC->WindAC(1).FanName = state->dataFans->fans(1)->Name; state->dataWindowAC->WindAC(1).FanIndex = 1; + // Check validation and expected warning + state->afn->validate_distribution(); + EXPECT_TRUE(compare_err_stream(" ** Warning ** AirflowNetwork::Solver::validate_distribution: A ZoneHVAC:WindowAirConditioner is simulated " "along with an AirflowNetwork but is not included in the AirflowNetwork.\n", true)); @@ -20043,8 +20046,6 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestZoneEqpSupportZoneVRF) state->dataHVACVarRefFlow->VRFTU(1).VRFTUOAMixerRetNodeNum = 10; state->dataHVACVarRefFlow->VRFTU(1).VRFTUOAMixerMixedNodeNum = 11; - state->dataLoopNodes->NodeID(4) = "Test"; - // Check validation and expected warning state->afn->validate_distribution(); @@ -20057,4 +20058,157 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestZoneEqpSupportZoneVRF) state->afn->simulation_control.allow_unsupported_zone_equipment = false; } +TEST_F(EnergyPlusFixture, AirflowNetwork_TestZoneEqpSupportZonePTHP) +{ + // Create zone + state->dataGlobal->NumOfZones = 1; + state->dataHeatBal->Zone.allocate(1); + state->dataHeatBal->Zone(1).Name = "ZONE 1"; + + // Create surfaces + state->dataSurface->Surface.allocate(1); + state->dataSurface->Surface(1).Name = "ZN004:ROOF001"; + state->dataSurface->Surface(1).Zone = 1; + state->dataSurface->Surface(1).ZoneName = "ZONE 1"; + state->dataSurface->Surface(1).Azimuth = 0.0; + state->dataSurface->Surface(1).ExtBoundCond = 0; + state->dataSurface->Surface(1).HeatTransSurf = true; + state->dataSurface->Surface(1).Tilt = 180.0; + state->dataSurface->Surface(1).Sides = 4; + state->dataSurface->Surface(1).Name = "ZN004:ROOF002"; + state->dataSurface->Surface(1).Zone = 1; + state->dataSurface->Surface(1).ZoneName = "ZONE 1"; + state->dataSurface->Surface(1).Azimuth = 0.0; + state->dataSurface->Surface(1).ExtBoundCond = 0; + state->dataSurface->Surface(1).HeatTransSurf = true; + state->dataSurface->Surface(1).Tilt = 180.0; + state->dataSurface->Surface(1).Sides = 4; + + state->dataSurface->Surface(1).OriginalClass = DataSurfaces::SurfaceClass::Window; + + // Create air system + state->dataAirSystemsData->PrimaryAirSystems.allocate(1); + state->dataAirSystemsData->PrimaryAirSystems(1).NumBranches = 1; + state->dataAirSystemsData->PrimaryAirSystems(1).Branch.allocate(1); + state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).TotalComponents = 1; + state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp.allocate(1); + state->dataAirSystemsData->PrimaryAirSystems(1).Branch(1).Comp(1).TypeOf = "Fan:ConstantVolume"; + + // Create air nodes + state->dataLoopNodes->NumOfNodes = 9; + state->dataLoopNodes->Node.allocate(9); + state->dataLoopNodes->Node(1).FluidType = DataLoopNode::NodeFluidType::Air; + state->dataLoopNodes->Node(2).FluidType = DataLoopNode::NodeFluidType::Air; + state->dataLoopNodes->Node(3).FluidType = DataLoopNode::NodeFluidType::Air; + state->dataLoopNodes->NodeID.allocate(9); + state->dataLoopNodes->NodeID(1) = "ZONE 1 AIR NODE"; + bool errFlag{false}; + BranchNodeConnections::RegisterNodeConnection(*state, + 1, + "ZONE 1 AIR NODE", + DataLoopNode::ConnectionObjectType::FanOnOff, + "Object1", + DataLoopNode::ConnectionType::ZoneNode, + NodeInputManager::CompFluidStream::Primary, + false, + errFlag); + EXPECT_FALSE(errFlag); + + // Connect zone to air node + state->dataZoneEquip->ZoneEquipConfig.allocate(1); + state->dataZoneEquip->ZoneEquipConfig(1).IsControlled = true; + state->dataZoneEquip->ZoneEquipConfig(1).ZoneName = "ZONE 1"; + state->dataZoneEquip->ZoneEquipConfig(1).ZoneNode = 1; + state->dataZoneEquip->ZoneEquipConfig(1).NumInletNodes = 0; + state->dataZoneEquip->ZoneEquipConfig(1).NumReturnNodes = 0; + state->dataZoneEquip->ZoneEquipConfig(1).IsControlled = true; + + // One AirflowNetwork:MultiZone:Zone object + state->afn->AirflowNetworkNumOfZones = 1; + state->afn->MultizoneZoneData.allocate(1); + state->afn->MultizoneZoneData(1).ZoneNum = 1; + state->afn->MultizoneZoneData(1).ZoneName = "ZONE 1"; + + // Assume only one AirflowNetwork:Distribution:Node object is set for the Zone Air Node + state->afn->AirflowNetworkNumOfNodes = 1; + state->afn->AirflowNetworkNodeData.allocate(1); + state->afn->AirflowNetworkNodeData(1).Name = "ZONE 1"; + state->afn->AirflowNetworkNodeData(1).EPlusZoneNum = 1; + + state->afn->SplitterNodeNumbers.allocate(2); + state->afn->SplitterNodeNumbers(1) = 0; + state->afn->SplitterNodeNumbers(2) = 0; + + // Set flag to support zone equipment + state->afn->simulation_control.allow_unsupported_zone_equipment = true; + + // Create Fans + Real64 supplyFlowRate = 0.005; + Real64 exhaustFlowRate = 0.005; + + auto *fan1 = new Fans::FanComponent; + fan1->Name = "SupplyFan"; + + fan1->inletNodeNum = 2; + fan1->outletNodeNum = 3; + fan1->type = HVAC::FanType::OnOff; + fan1->maxAirFlowRate = supplyFlowRate; + + state->dataFans->fans.push_back(fan1); + state->dataFans->fanMap.insert_or_assign(fan1->Name, state->dataFans->fans.size()); + + state->dataLoopNodes->NodeID(2) = "SupplyFanInletNode"; + BranchNodeConnections::RegisterNodeConnection(*state, + 2, + state->dataLoopNodes->NodeID(2), + DataLoopNode::ConnectionObjectType::FanOnOff, + state->dataFans->fans(1)->Name, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + false, + errFlag); + state->dataLoopNodes->NodeID(3) = "SupplyFanOutletNode"; + BranchNodeConnections::RegisterNodeConnection(*state, + 3, + state->dataLoopNodes->NodeID(3), + DataLoopNode::ConnectionObjectType::FanOnOff, + state->dataFans->fans(1)->Name, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + false, + errFlag); + + // Create Zonal WAHP + state->dataUnitarySystems->getInputOnceFlag = false; + state->dataUnitarySystems->numUnitarySystems = 1; + UnitarySystems::UnitarySys thisSys; + thisSys.m_UnitarySysNum = 0; + thisSys.m_sysType = UnitarySystems::UnitarySys::SysType::PackagedWSHP; + state->dataUnitarySystems->unitarySys.push_back(thisSys); + state->dataUnitarySystems->unitarySys[0].Name = "ZonalWAHP"; + state->dataUnitarySystems->unitarySys[0].m_CoolOutAirVolFlow == 0; + state->dataUnitarySystems->unitarySys[0].m_HeatOutAirVolFlow == 0; + state->dataUnitarySystems->unitarySys[0].m_NoCoolHeatOutAirVolFlow == 0; + state->dataUnitarySystems->unitarySys[0].m_FanIndex = 1; + state->dataUnitarySystems->unitarySys[0].AirInNode = 3; + state->dataUnitarySystems->unitarySys[0].m_OAMixerNodes[0] = 4; + state->dataUnitarySystems->unitarySys[0].m_OAMixerNodes[1] = 5; + state->dataUnitarySystems->unitarySys[0].m_OAMixerNodes[2] = 6; + state->dataUnitarySystems->unitarySys[0].m_OAMixerNodes[3] = 7; + state->dataUnitarySystems->unitarySys[0].CoolCoilOutletNodeNum = 8; + state->dataUnitarySystems->unitarySys[0].HeatCoilOutletNodeNum = 9; + + // Check validation and expected warning + state->afn->validate_distribution(); + + EXPECT_TRUE( + compare_err_stream_substring(" ** Warning ** AirflowNetwork::Solver::validate_distribution: A ZoneHVAC:PackagedTerminalAirConditioner, " + "ZoneHVAC:PackagedTerminalHeatPump, or ZoneHVAC:WaterToAirHeatPump is simulated along with an AirflowNetwork " + "but is not included in the AirflowNetwork.\n", + true)); + + // Unset flag to support zone equipment + state->afn->simulation_control.allow_unsupported_zone_equipment = false; +} + } // namespace EnergyPlus From dac299b51076628a2d8ce148f64cd13b719ef0f8 Mon Sep 17 00:00:00 2001 From: "Lerond, Jeremy" Date: Fri, 2 Aug 2024 13:37:19 -0700 Subject: [PATCH 076/164] Clarify variable names. --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 6 +++--- src/EnergyPlus/UnitarySystem.cc | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 97132e74103..917384890d4 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -10846,12 +10846,12 @@ bool getVRFTUNodeNumber(EnergyPlusData &state, int const nodeNumber) for (int vrfTUIndex = 1; vrfTUIndex <= state.dataHVACVarRefFlow->NumVRFTU; ++vrfTUIndex) { auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(vrfTUIndex); - bool vrfTUOutdoorAir = false; + bool noVrfTUOutdoorAir = false; if (vrfTU.CoolOutAirVolFlow == 0 && vrfTU.HeatOutAirVolFlow == 0 && vrfTU.NoCoolHeatOutAirVolFlow == 0) { - vrfTUOutdoorAir = true; + noVrfTUOutdoorAir = true; } - if (vrfTUOutdoorAir && + if (noVrfTUOutdoorAir && (nodeNumber == vrfTU.VRFTUInletNodeNum || nodeNumber == vrfTU.VRFTUOutletNodeNum || nodeNumber == vrfTU.fanInletNode || nodeNumber == vrfTU.fanOutletNode || nodeNumber == vrfTU.heatCoilAirOutNode || nodeNumber == vrfTU.coolCoilAirOutNode || nodeNumber == vrfTU.VRFTUOAMixerOANodeNum || nodeNumber == vrfTU.VRFTUOAMixerRelNodeNum || nodeNumber == vrfTU.VRFTUOAMixerRetNodeNum || diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 840a981c64f..5070ef8c4bc 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -16755,16 +16755,16 @@ namespace UnitarySystems { int FanInletNodeIndex = state.dataFans->fans(unitarySys.m_FanIndex)->inletNodeNum; int FanOutletNodeIndex = state.dataFans->fans(unitarySys.m_FanIndex)->outletNodeNum; - bool unitarySysOutdoorAir = false; + bool noUnitarySysOutdoorAir = false; if (unitarySys.m_CoolOutAirVolFlow == 0 && unitarySys.m_HeatOutAirVolFlow == 0 && unitarySys.m_NoCoolHeatOutAirVolFlow == 0) { - unitarySysOutdoorAir = true; + noUnitarySysOutdoorAir = true; } if (unitarySys.m_sysType == UnitarySys::SysType::PackagedWSHP || unitarySys.m_sysType == UnitarySys::SysType::PackagedAC || unitarySys.m_sysType == UnitarySys::SysType::PackagedHP) { - if (unitarySysOutdoorAir && (nodeNumber == FanInletNodeIndex || nodeNumber == FanOutletNodeIndex || - nodeNumber == unitarySys.AirInNode || nodeNumber == unitarySys.m_OAMixerNodes[0] || - nodeNumber == unitarySys.m_OAMixerNodes[1] || nodeNumber == unitarySys.m_OAMixerNodes[2]) || + if (noUnitarySysOutdoorAir && (nodeNumber == FanInletNodeIndex || nodeNumber == FanOutletNodeIndex || + nodeNumber == unitarySys.AirInNode || nodeNumber == unitarySys.m_OAMixerNodes[0] || + nodeNumber == unitarySys.m_OAMixerNodes[1] || nodeNumber == unitarySys.m_OAMixerNodes[2]) || nodeNumber == unitarySys.m_OAMixerNodes[3] || nodeNumber == unitarySys.CoolCoilOutletNodeNum || nodeNumber == unitarySys.HeatCoilOutletNodeNum) { return true; From b6a68bdfd4e725e1a6154cfce62b273d3c8bfd4f Mon Sep 17 00:00:00 2001 From: "Lerond, Jeremy" Date: Mon, 5 Aug 2024 08:52:09 -0700 Subject: [PATCH 077/164] Missplaced return... --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 917384890d4..45832559a3e 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -10859,8 +10859,8 @@ bool getVRFTUNodeNumber(EnergyPlusData &state, int const nodeNumber) nodeNumber == vrfTU.SuppHeatCoilAirOutletNode)) { return true; } - return false; } + return false; } void VRFCondenserEquipment::CalcVRFIUTeTc_FluidTCtrl(EnergyPlusData &state) From 635af34a78f50da48f7f7fa6d009c28a1b050496 Mon Sep 17 00:00:00 2001 From: "Lerond, Jeremy" Date: Mon, 5 Aug 2024 08:58:59 -0700 Subject: [PATCH 078/164] Clang! --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 45832559a3e..f0efdbf193c 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -10860,7 +10860,7 @@ bool getVRFTUNodeNumber(EnergyPlusData &state, int const nodeNumber) return true; } } - return false; + return false; } void VRFCondenserEquipment::CalcVRFIUTeTc_FluidTCtrl(EnergyPlusData &state) From 698ddbf4ce3aa023a9becab9188875d9e373daca Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Mon, 5 Aug 2024 09:18:14 -0700 Subject: [PATCH 079/164] min value of system fan curve in idf change to 0 --- testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf b/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf index 2a21a3cbc47..b766fbdc1a5 100644 --- a/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf +++ b/testfiles/US+SF+CZ4A+hp+crawlspace+IECC_2006_VRF.idf @@ -530,7 +530,7 @@ 0, !- Coefficient3 x**2 0.91, !- Coefficient4 x**3 0, !- Coefficient5 x**4 - 0.6974790, !- Minimum Value of x + 0.0, !- Minimum Value of x 1.0, !- Maximum Value of x 0.0, !- Minimum Curve Output 5.0, !- Maximum Curve Output From 084d8f129cce46d572f50ea2c7b1ad94028b94a4 Mon Sep 17 00:00:00 2001 From: amirroth Date: Mon, 5 Aug 2024 20:24:07 -0400 Subject: [PATCH 080/164] Increase blind slat angle sampling frequency to five degrees --- src/EnergyPlus/Material.hh | 2 +- src/EnergyPlus/WindowManager.cc | 36 ++++++++++++++++++--------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/EnergyPlus/Material.hh b/src/EnergyPlus/Material.hh index 74be89e784a..e4c802f0d7f 100644 --- a/src/EnergyPlus/Material.hh +++ b/src/EnergyPlus/Material.hh @@ -61,7 +61,7 @@ namespace EnergyPlus { namespace Material { - constexpr int MaxSlatAngs(19); + constexpr int MaxSlatAngs(37); constexpr int MaxProfAngs(37); // Parameters to indicate material group type for use with the Material diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 1c7d5b5a6a1..45f391f9267 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -5833,7 +5833,7 @@ namespace Window { DPhi = 5.0 * Constant::DegToRadians; // Integrate from -90 to 0 deg - for (int IPhi = 1; IPhi <= 18; ++IPhi) { + for (int IPhi = 1; IPhi <= (Material::MaxProfAngs / 2); ++IPhi) { Phi = -Constant::PiOvr2 + (IPhi - 0.5) * DPhi; Sum += std::cos(Phi) * DPhi * InterpProfAng(Phi, Property); SumDenom += std::cos(Phi) * DPhi; @@ -5876,7 +5876,7 @@ namespace Window { DPhi = 5.0 * Constant::DegToRadians; // Integrate from 0 to 90 deg - for (int IPhi = 19; IPhi <= 36; ++IPhi) { + for (int IPhi = (Material::MaxProfAngs / 2) + 1; IPhi <= Material::MaxProfAngs - 1; ++IPhi) { Phi = -Constant::PiOvr2 + (IPhi - 0.5) * DPhi; Sum += std::cos(Phi) * DPhi * InterpProfAng(Phi, Property); SumDenom += std::cos(Phi) * DPhi; @@ -7461,7 +7461,7 @@ namespace Window { Array1D bld_pr(15); // Slat properties Array1D st_lay(16); // Solar-optical blind/glazing system properties Real64 sun_el; // Solar profile angle (radians) - Array1D sun_el_deg(37); // Solar profile angle (deg) corresponding to sun_el values + Array1D sun_el_deg(Material::MaxProfAngs); // Solar profile angle (deg) corresponding to sun_el values Real64 bld_el; // Slat angle (elevation of slat normal vector in plane // perpendicular to window and containing the slat normal vector) (radians) int IProfAng; // Profile angle index @@ -7538,7 +7538,7 @@ namespace Window { // If blind has variable slat angle, vary slat angle from 0 to 180 deg in 10-deg steps // (for Material::MaxSlatAngs = 19). If blind has fixed slat angle, calculate properties at that angle only. - for (int IProfAng = 1; IProfAng <= 37; ++IProfAng) { + for (int IProfAng = 1; IProfAng <= Material::MaxProfAngs; ++IProfAng) { sun_el = -Constant::Pi / 2.0 + (Constant::Pi / 36.0) * (IProfAng - 1); sun_el_deg(IProfAng) = 57.2958 * sun_el; @@ -7583,14 +7583,18 @@ namespace Window { if (ISolVis == 1) { for (int ISlatAng = 1; ISlatAng <= Material::MaxSlatAngs; ++ISlatAng) { - blind.SolFrontDiffDiffTransGnd(ISlatAng) = DiffuseAverageProfAngGnd(blind.SolFrontBeamBeamTrans(ISlatAng, {1, 37})) + - DiffuseAverageProfAngGnd(blind.SolFrontBeamDiffTrans(ISlatAng, {1, 37})); - blind.SolFrontDiffDiffTransSky(ISlatAng) = DiffuseAverageProfAngSky(blind.SolFrontBeamBeamTrans(ISlatAng, {1, 37})) + - DiffuseAverageProfAngSky(blind.SolFrontBeamDiffTrans(ISlatAng, {1, 37})); - blind.SolFrontDiffAbsGnd(ISlatAng) = DiffuseAverageProfAngGnd(blind.SolFrontBeamAbs(ISlatAng, {1, 37})); - blind.SolFrontDiffAbsSky(ISlatAng) = DiffuseAverageProfAngSky(blind.SolFrontBeamAbs(ISlatAng, {1, 37})); - blind.SolFrontDiffDiffReflGnd(ISlatAng) = DiffuseAverageProfAngGnd(blind.SolFrontBeamDiffRefl(ISlatAng, {1, 37})); - blind.SolFrontDiffDiffReflSky(ISlatAng) = DiffuseAverageProfAngSky(blind.SolFrontBeamDiffRefl(ISlatAng, {1, 37})); + blind.SolFrontDiffDiffTransGnd(ISlatAng) = + DiffuseAverageProfAngGnd(blind.SolFrontBeamBeamTrans(ISlatAng, {1, Material::MaxProfAngs})) + + DiffuseAverageProfAngGnd(blind.SolFrontBeamDiffTrans(ISlatAng, {1, Material::MaxProfAngs})); + blind.SolFrontDiffDiffTransSky(ISlatAng) = + DiffuseAverageProfAngSky(blind.SolFrontBeamBeamTrans(ISlatAng, {1, Material::MaxProfAngs})) + + DiffuseAverageProfAngSky(blind.SolFrontBeamDiffTrans(ISlatAng, {1, Material::MaxProfAngs})); + blind.SolFrontDiffAbsGnd(ISlatAng) = DiffuseAverageProfAngGnd(blind.SolFrontBeamAbs(ISlatAng, {1, Material::MaxProfAngs})); + blind.SolFrontDiffAbsSky(ISlatAng) = DiffuseAverageProfAngSky(blind.SolFrontBeamAbs(ISlatAng, {1, Material::MaxProfAngs})); + blind.SolFrontDiffDiffReflGnd(ISlatAng) = + DiffuseAverageProfAngGnd(blind.SolFrontBeamDiffRefl(ISlatAng, {1, Material::MaxProfAngs})); + blind.SolFrontDiffDiffReflSky(ISlatAng) = + DiffuseAverageProfAngSky(blind.SolFrontBeamDiffRefl(ISlatAng, {1, Material::MaxProfAngs})); // TH 2/17/2010. Added. Loop only for movable slat blinds if (blind.SlatAngleType == DataWindowEquivalentLayer::AngleType::Fixed) break; @@ -8485,7 +8489,7 @@ namespace Window { // Linear interpolation. // Argument array dimensioning - PropArray.dim(Material::MaxSlatAngs, 37); + PropArray.dim(Material::MaxSlatAngs, Material::MaxProfAngs); Real64 SlatAng1 = std::clamp(SlatAng, 0.0, Constant::Pi); @@ -8505,14 +8509,14 @@ namespace Window { Real64 SlatAngRatio = (SlatAng1 - (IBeta - 1) * DeltaSlatAng) / DeltaSlatAng; // Slat angle interpolation factor Val1 = PropArray(IBeta, IAlpha); // Property values at points enclosing the given ProfAngle and SlatAngle Val2 = PropArray(min(Material::MaxSlatAngs, IBeta + 1), IAlpha); - Real64 Val3 = PropArray(IBeta, min(37, IAlpha + 1)); - Real64 Val4 = PropArray(min(Material::MaxSlatAngs, IBeta + 1), min(37, IAlpha + 1)); + Real64 Val3 = PropArray(IBeta, min(Material::MaxProfAngs, IAlpha + 1)); + Real64 Val4 = PropArray(min(Material::MaxSlatAngs, IBeta + 1), min(Material::MaxProfAngs, IAlpha + 1)); Real64 ValA = Val1 + SlatAngRatio * (Val2 - Val1); // Property values at given SlatAngle to be interpolated in profile angle Real64 ValB = Val3 + SlatAngRatio * (Val4 - Val3); return ValA + ProfAngRatio * (ValB - ValA); } else { // Fixed-angle slats: interpolate only in profile angle Val1 = PropArray(1, IAlpha); - Val2 = PropArray(1, min(37, IAlpha + 1)); + Val2 = PropArray(1, min(Material::MaxProfAngs, IAlpha + 1)); return Val1 + ProfAngRatio * (Val2 - Val1); } } // InterpProfSlatAng() From 7c8c9eb0cf0f1d1777874d11590bdafb2f91d65e Mon Sep 17 00:00:00 2001 From: amirroth Date: Tue, 6 Aug 2024 16:34:33 -0400 Subject: [PATCH 081/164] Sample blind properties at 1 degree slat angle increments --- src/EnergyPlus/Material.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/Material.hh b/src/EnergyPlus/Material.hh index e4c802f0d7f..54db2988aef 100644 --- a/src/EnergyPlus/Material.hh +++ b/src/EnergyPlus/Material.hh @@ -61,7 +61,7 @@ namespace EnergyPlus { namespace Material { - constexpr int MaxSlatAngs(37); + constexpr int MaxSlatAngs(181); // 1 degree increments for slat angles (We'll see what the performance implications are) constexpr int MaxProfAngs(37); // Parameters to indicate material group type for use with the Material From 261699abc631efc6eb20e73a8181f49c6442e2db Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 7 Aug 2024 12:07:20 -0700 Subject: [PATCH 082/164] remove OU fan adjustment and put it in a different PR there might be larger issue with the OU fan like negative VRF Heat Pump Outdoor Unit Fan Power value. This will be fixed in another PR --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index cda29a32fe6..497f4a341a1 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -11506,9 +11506,9 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) // Key outputs of this subroutine this->CompActSpeed = max(CompSpdActual, 0.0); - this->Ncomp = max(Ncomp, 0.0) / this->EffCompInverter; // 0.95 is the efficiency of the compressor inverter, can come from IDF //@minor - this->OUFanPower = this->RatedOUFanPower * CyclingRatio; //@ * pow_3( CondFlowRatio ) - this->VRFCondCyclingRatio = CyclingRatio; // report variable for cycling rate + this->Ncomp = max(Ncomp, 0.0) / this->EffCompInverter; // 0.95 is the efficiency of the compressor inverter, can come from IDF //@minor + this->OUFanPower = this->RatedOUFanPower; //@ * pow_3( CondFlowRatio ) + this->VRFCondCyclingRatio = CyclingRatio; // report variable for cycling rate Tdischarge = this->CondensingTemp; // outdoor unit condensing temperature this->CoolingCapacity = @@ -11736,7 +11736,7 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) // Key outputs of this subroutine this->CompActSpeed = max(CompSpdActual, 0.0); this->Ncomp = max(Ncomp, 0.0) / this->EffCompInverter; - this->OUFanPower = this->RatedOUFanPower * CyclingRatio; + this->OUFanPower = this->RatedOUFanPower; this->VRFCondCyclingRatio = CyclingRatio; Tsuction = this->EvaporatingTemp; // Outdoor unit evaporating temperature From dcd3358998d9e0cb265aa70fdbdbecee501c2d81 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 20 Jun 2024 01:40:34 +0200 Subject: [PATCH 083/164] Enable Floating point exceptions by default in Debug mode (?) --- cmake/CompilerFlags.cmake | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake index 936b844962c..bfc9fb3b8b7 100644 --- a/cmake/CompilerFlags.cmake +++ b/cmake/CompilerFlags.cmake @@ -126,16 +126,13 @@ elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" O set(need_arithm_debug_genex "$,$>") - # TODO: after we fix all tests, remove this if statement (keeping the block to always execute) to enable this by default on Debug builds - if (FORCE_DEBUG_ARITHM_GCC_OR_CLANG) - # in main.cc for E+ and gtest: feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) - target_compile_definitions(project_fp_options INTERFACE $<${need_arithm_debug_genex}:DEBUG_ARITHM_GCC_OR_CLANG>) - include(CheckCXXSymbolExists) - check_cxx_symbol_exists(feenableexcept "fenv.h" HAVE_FEENABLEEXCEPT) - message(VERBOSE "HAVE_FEENABLEEXCEPT=${HAVE_FEENABLEEXCEPT}") - if(HAVE_FEENABLEEXCEPT) - target_compile_definitions(project_fp_options INTERFACE HAVE_FEENABLEEXCEPT) - endif() + # in main.cc for E+ and gtest: feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) + target_compile_definitions(project_fp_options INTERFACE $<${need_arithm_debug_genex}:DEBUG_ARITHM_GCC_OR_CLANG>) + include(CheckCXXSymbolExists) + check_cxx_symbol_exists(feenableexcept "fenv.h" HAVE_FEENABLEEXCEPT) + message(VERBOSE "HAVE_FEENABLEEXCEPT=${HAVE_FEENABLEEXCEPT}") + if(HAVE_FEENABLEEXCEPT) + target_compile_definitions(project_fp_options INTERFACE HAVE_FEENABLEEXCEPT) endif() # ADDITIONAL GCC-SPECIFIC FLAGS From 0146701087f7cccc24b365761b698e7b93dab5e0 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 13:11:58 +0200 Subject: [PATCH 084/164] Fix RefrigeratedRackWithCaseInZone by initializing OutBaroPress --- tst/EnergyPlus/unit/RefrigeratedCase.unit.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tst/EnergyPlus/unit/RefrigeratedCase.unit.cc b/tst/EnergyPlus/unit/RefrigeratedCase.unit.cc index 589dd49cb73..ae91acad1de 100644 --- a/tst/EnergyPlus/unit/RefrigeratedCase.unit.cc +++ b/tst/EnergyPlus/unit/RefrigeratedCase.unit.cc @@ -54,6 +54,7 @@ // I should not have to import these, but I do, the headers don't declare them #include +#include #include #include #include @@ -385,6 +386,7 @@ Schedule:Compact, ASSERT_TRUE(process_idf(fmt::format("{}\n{}", oneZoneBuildingWithIdealLoads, idf_objects))); // read idf objects state->dataZoneEquip->ZoneEquipInputsFilled = true; + state->dataEnvrn->OutBaroPress = 101325.0; bool ErrorsFound = false; HeatBalanceManager::GetZoneData(*state, ErrorsFound); ASSERT_FALSE(ErrorsFound); @@ -479,6 +481,7 @@ Refrigeration:WalkIn, ASSERT_TRUE(process_idf(fmt::format("{}\n{}", oneZoneBuildingWithIdealLoads, idf_objects))); // read idf objects state->dataZoneEquip->ZoneEquipInputsFilled = true; + state->dataEnvrn->OutBaroPress = 101325.0; bool ErrorsFound = false; HeatBalanceManager::GetZoneData(*state, ErrorsFound); ASSERT_FALSE(ErrorsFound); @@ -576,6 +579,7 @@ Refrigeration:WalkIn, ASSERT_TRUE(process_idf(fmt::format("{}\n{}", oneZoneBuildingWithIdealLoads, idf_objects))); // read idf objects state->dataZoneEquip->ZoneEquipInputsFilled = true; + state->dataEnvrn->OutBaroPress = 101325.0; bool ErrorsFound = false; HeatBalanceManager::GetZoneData(*state, ErrorsFound); ASSERT_FALSE(ErrorsFound); @@ -733,6 +737,7 @@ Schedule:Compact, ASSERT_TRUE(process_idf(fmt::format("{}\n{}", oneZoneBuildingWithIdealLoads, idf_objects))); // read idf objects state->dataZoneEquip->ZoneEquipInputsFilled = true; + state->dataEnvrn->OutBaroPress = 101325.0; bool ErrorsFound = false; HeatBalanceManager::GetZoneData(*state, ErrorsFound); ASSERT_FALSE(ErrorsFound); From b43c6d5216072ab14c9117b11c0383ccba2e8925 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 13:12:27 +0200 Subject: [PATCH 085/164] CurveManager: when divisor is zero, don't try to exercise it Fixes EnergyPlusFixture.DivisorNormalizationDivisorOnlyButItIsZero --- src/EnergyPlus/CurveManager.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EnergyPlus/CurveManager.cc b/src/EnergyPlus/CurveManager.cc index e8c3faec990..77a0e811884 100644 --- a/src/EnergyPlus/CurveManager.cc +++ b/src/EnergyPlus/CurveManager.cc @@ -2497,6 +2497,7 @@ namespace Curve { ShowSevereError( state, format("Table:Lookup named \"{}\": Normalization divisor entered as zero, which is invalid", thisCurve->Name)); ErrorsFound = true; + continue; } } From 268de045353b7bce41980df487f0d0d2dd25f00a Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 13:14:24 +0200 Subject: [PATCH 086/164] Fix CO2ControlDesignOccupancyTest The issue was first unitialized StdRhoAir and co, but the main problem was getting the test to pass. Took me a while to figure out... --- tst/EnergyPlus/unit/MixedAir.unit.cc | 60 +++++++++++++++++++--------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/tst/EnergyPlus/unit/MixedAir.unit.cc b/tst/EnergyPlus/unit/MixedAir.unit.cc index 47d9a53d472..01bdbee4868 100644 --- a/tst/EnergyPlus/unit/MixedAir.unit.cc +++ b/tst/EnergyPlus/unit/MixedAir.unit.cc @@ -840,6 +840,13 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest) state->dataGlobal->NumOfTimeStepInHour = 4; // must initialize this to get schedules initialized state->dataGlobal->MinutesPerTimeStep = 15; // must initialize this to get schedules initialized + state->dataEnvrn->StdBaroPress = StdPressureSeaLevel; + state->dataEnvrn->OutDryBulbTemp = 13.0; + state->dataEnvrn->OutBaroPress = StdPressureSeaLevel; + state->dataEnvrn->OutHumRat = 0.008; + state->dataEnvrn->StdRhoAir = + Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, state->dataEnvrn->OutDryBulbTemp, state->dataEnvrn->OutHumRat); + ScheduleManager::ProcessScheduleInput(*state); InternalHeatGains::GetInternalHeatGainsInput(*state); GetOAControllerInputs(*state); @@ -873,7 +880,6 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest) state->dataLoopNodes->Node(10).Temp = 13.00; state->dataLoopNodes->Node(10).HumRat = 0.008; state->dataLoopNodes->Node(10).MassFlowRate = 1.7 * state->dataEnvrn->StdRhoAir; - state->dataEnvrn->OutBaroPress = 101325; state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(1); oaRequirements.OAFlowMethod = OAFlowCalcMethod::PCDesOcc; @@ -914,7 +920,6 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest) EXPECT_EQ("ProportionalControlBasedOnDesignOccupancy", DataSizing::OAFlowCalcMethodNames[static_cast(ventMechanical.VentMechZone(1).ZoneOAFlowMethod)]); - state->dataEnvrn->StdRhoAir = 1.2; oaController.MixMassFlow = 1.7 * state->dataEnvrn->StdRhoAir; oaController.MaxOAMassFlowRate = 1.7 * state->dataEnvrn->StdRhoAir; state->dataAirLoop->AirLoopFlow(1).DesSupply = 1.7 * state->dataEnvrn->StdRhoAir; @@ -925,25 +930,32 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest) // Case 1 - Zone CO2 greater than CO2 Max, so OA flow is flow/area+flow/person state->dataContaminantBalance->ZoneAirCO2(1) = 600.0; - Real64 expectedOAMassFlow = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + - oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants) * - state->dataEnvrn->StdRhoAir; + Real64 ZoneOA = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + + oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants); + Real64 ZoneOAFrac = ZoneOA / 1.7; + Real64 Evz = 1.0 - ZoneOAFrac; // SysEv == Evz + Real64 expectedOAMassFlow = ZoneOA * state->dataEnvrn->StdRhoAir / Evz; oaController.CalcOAController(*state, 1, true); EXPECT_NEAR(expectedOAMassFlow, oaController.OAMassFlow, 0.00001); EXPECT_NEAR(expectedOAMassFlow / oaController.MixMassFlow, oaController.MinOAFracLimit, 0.00001); // Case 2 - Zone CO2 greater than CO2 Min, so OA flow is flow/area state->dataContaminantBalance->ZoneAirCO2(1) = 200.0; - expectedOAMassFlow = oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea * state->dataEnvrn->StdRhoAir; + ZoneOA = oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea; + ZoneOAFrac = ZoneOA / 1.7; + Evz = 1.0 - ZoneOAFrac; + expectedOAMassFlow = ZoneOA * state->dataEnvrn->StdRhoAir / Evz; oaController.CalcOAController(*state, 1, true); EXPECT_NEAR(expectedOAMassFlow, oaController.OAMassFlow, 0.00001); EXPECT_NEAR(expectedOAMassFlow / oaController.MixMassFlow, oaController.MinOAFracLimit, 0.00001); // Case 3 - Zone CO2 in between CO2 Max and Min, so OA flow is flow/area + proportionate flow/person state->dataContaminantBalance->ZoneAirCO2(1) = zoneCO2Min + 0.3 * (zoneCO2Max - zoneCO2Min); - expectedOAMassFlow = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + - 0.3 * oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants) * - state->dataEnvrn->StdRhoAir; + ZoneOA = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + + 0.3 * oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants); + ZoneOAFrac = ZoneOA / 1.7; + Evz = 1.0 - ZoneOAFrac; + expectedOAMassFlow = ZoneOA * state->dataEnvrn->StdRhoAir / Evz; oaController.CalcOAController(*state, 1, true); EXPECT_NEAR(expectedOAMassFlow, oaController.OAMassFlow, 0.00001); EXPECT_NEAR(expectedOAMassFlow / oaController.MixMassFlow, oaController.MinOAFracLimit, 0.00001); @@ -1117,6 +1129,13 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest3Zone) state->dataGlobal->NumOfTimeStepInHour = 4; // must initialize this to get schedules initialized state->dataGlobal->MinutesPerTimeStep = 15; // must initialize this to get schedules initialized + state->dataEnvrn->StdBaroPress = StdPressureSeaLevel; + state->dataEnvrn->OutDryBulbTemp = 13.0; + state->dataEnvrn->OutBaroPress = StdPressureSeaLevel; + state->dataEnvrn->OutHumRat = 0.008; + state->dataEnvrn->StdRhoAir = + Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, state->dataEnvrn->OutDryBulbTemp, state->dataEnvrn->OutHumRat); + ScheduleManager::ProcessScheduleInput(*state); InternalHeatGains::GetInternalHeatGainsInput(*state); GetOAControllerInputs(*state); @@ -1174,7 +1193,6 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest3Zone) state->dataLoopNodes->Node(10).MassFlowRate = 1.7 * state->dataEnvrn->StdRhoAir; state->dataLoopNodes->Node(11) = state->dataLoopNodes->Node(10); state->dataLoopNodes->Node(12) = state->dataLoopNodes->Node(10); - state->dataEnvrn->OutBaroPress = 101325; state->dataZoneEnergyDemand->ZoneSysEnergyDemand.allocate(3); oaRequirements.OAFlowMethod = OAFlowCalcMethod::PCDesOcc; @@ -1223,7 +1241,6 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest3Zone) EXPECT_EQ("ProportionalControlBasedOnDesignOccupancy", DataSizing::OAFlowCalcMethodNames[static_cast(ventMechanical.VentMechZone(3).ZoneOAFlowMethod)]); - state->dataEnvrn->StdRhoAir = 1.2; oaController.MixMassFlow = 1.7 * state->dataEnvrn->StdRhoAir; oaController.MaxOAMassFlowRate = 1.7 * state->dataEnvrn->StdRhoAir; state->dataAirLoop->AirLoopFlow(1).DesSupply = 1.7 * state->dataEnvrn->StdRhoAir; @@ -1236,9 +1253,11 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest3Zone) state->dataContaminantBalance->ZoneAirCO2(1) = 600.0; state->dataContaminantBalance->ZoneAirCO2(2) = 600.0; state->dataContaminantBalance->ZoneAirCO2(3) = 600.0; - Real64 expectedOAMassFlow = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + - oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants) * - state->dataEnvrn->StdRhoAir; + Real64 ZoneOA = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + + oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants); + Real64 ZoneOAFrac = ZoneOA / 1.7; + Real64 Evz = 1.0 - ZoneOAFrac; // SysEv == Evz + Real64 expectedOAMassFlow = ZoneOA * state->dataEnvrn->StdRhoAir / Evz; oaController.CalcOAController(*state, 1, true); // 3 identical zones should produce 3x OA flow EXPECT_NEAR(3 * expectedOAMassFlow, oaController.OAMassFlow, 0.00001); @@ -1248,7 +1267,10 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest3Zone) state->dataContaminantBalance->ZoneAirCO2(1) = 200.0; state->dataContaminantBalance->ZoneAirCO2(2) = 200.0; state->dataContaminantBalance->ZoneAirCO2(3) = 200.0; - expectedOAMassFlow = oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea * state->dataEnvrn->StdRhoAir; + ZoneOA = oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea; + ZoneOAFrac = ZoneOA / 1.7; + Evz = 1.0 - ZoneOAFrac; + expectedOAMassFlow = ZoneOA * state->dataEnvrn->StdRhoAir / Evz; oaController.CalcOAController(*state, 1, true); // 3 identical zones should produce 3x OA flow EXPECT_NEAR(3 * expectedOAMassFlow, oaController.OAMassFlow, 0.00001); @@ -1258,9 +1280,11 @@ TEST_F(EnergyPlusFixture, CO2ControlDesignOccupancyTest3Zone) state->dataContaminantBalance->ZoneAirCO2(1) = zoneCO2Min + 0.3 * (zoneCO2Max - zoneCO2Min); state->dataContaminantBalance->ZoneAirCO2(2) = zoneCO2Min + 0.3 * (zoneCO2Max - zoneCO2Min); state->dataContaminantBalance->ZoneAirCO2(3) = zoneCO2Min + 0.3 * (zoneCO2Max - zoneCO2Min); - expectedOAMassFlow = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + - 0.3 * oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants) * - state->dataEnvrn->StdRhoAir; + ZoneOA = (oaRequirements.OAFlowPerArea * state->dataHeatBal->Zone(1).FloorArea + + 0.3 * oaRequirements.OAFlowPerPerson * state->dataHeatBal->Zone(1).TotOccupants); + ZoneOAFrac = ZoneOA / 1.7; + Evz = 1.0 - ZoneOAFrac; + expectedOAMassFlow = ZoneOA * state->dataEnvrn->StdRhoAir / Evz; oaController.CalcOAController(*state, 1, true); // 3 identical zones should produce 3x OA flow EXPECT_NEAR(3 * expectedOAMassFlow, oaController.OAMassFlow, 0.00001); From 40cb5478e34fe2264a92d18d54d551785beb2d29 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 13:34:56 +0200 Subject: [PATCH 087/164] Fix WindowManager_RefAirTempTest by properly allocating arrays --- tst/EnergyPlus/unit/WindowManager.unit.cc | 41 +++-------------------- 1 file changed, 5 insertions(+), 36 deletions(-) diff --git a/tst/EnergyPlus/unit/WindowManager.unit.cc b/tst/EnergyPlus/unit/WindowManager.unit.cc index 03e131c0934..3dec455a767 100644 --- a/tst/EnergyPlus/unit/WindowManager.unit.cc +++ b/tst/EnergyPlus/unit/WindowManager.unit.cc @@ -480,12 +480,17 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataGlobal->TimeStep = 1; state->dataGlobal->TimeStepZone = 1; + state->dataGlobal->TimeStepZoneSec = 3600.0; state->dataGlobal->HourOfDay = 1; state->dataGlobal->NumOfTimeStepInHour = 1; state->dataGlobal->BeginSimFlag = true; state->dataGlobal->BeginEnvrnFlag = true; state->dataEnvrn->OutBaroPress = 100000; + HeatBalanceManager::AllocateHeatBalArrays(*state); + SolarShading::AllocateModuleArrays(*state); + HeatBalanceSurfaceManager::AllocateSurfaceHeatBalArrays(*state); + state->dataZoneEquip->ZoneEquipConfig.allocate(1); state->dataZoneEquip->ZoneEquipConfig(1).ZoneName = "Zone"; state->dataHeatBal->Zone(1).IsControlled = true; @@ -535,7 +540,6 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataLoopNodes->Node(3).MassFlowRate = 0.1; state->dataLoopNodes->Node(4).MassFlowRate = 0.1; - state->dataHeatBalSurf->SurfHConvInt.allocate(3); state->dataHeatBalSurf->SurfHConvInt(surfNum1) = 0.5; state->dataHeatBalSurf->SurfHConvInt(surfNum2) = 0.5; state->dataHeatBalSurf->SurfHConvInt(surfNum3) = 0.5; @@ -549,30 +553,6 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataZoneTempPredictorCorrector->spaceHeatBalance(1).airHumRatAvg = 0.011; state->dataZoneTempPredictorCorrector->spaceHeatBalance(1).airHumRat = 0.011; - state->dataHeatBalSurf->SurfQdotRadHVACInPerArea.allocate(3); - state->dataHeatBalSurf->SurfWinInitialDifSolInTrans.allocate(3); - state->dataHeatBal->SurfWinQRadSWwinAbs.allocate(3, 1); - state->dataHeatBal->SurfQdotRadIntGainsInPerArea.allocate(3); - state->dataHeatBal->SurfQRadSWOutIncident.allocate(3); - state->dataSurface->SurfWinTransSolar.allocate(3); - state->dataHeatBal->ZoneWinHeatGain.allocate(1); - state->dataHeatBal->ZoneWinHeatGainRep.allocate(1); - state->dataHeatBal->ZoneWinHeatGainRepEnergy.allocate(1); - state->dataSurface->SurfWinHeatGain.allocate(3); - state->dataSurface->SurfWinGainConvGlazToZoneRep.allocate(3); - state->dataSurface->SurfWinGainIRGlazToZoneRep.allocate(3); - state->dataSurface->SurfWinGapConvHtFlowRep.allocate(3); - state->dataSurface->SurfWinGapConvHtFlowRepEnergy.allocate(3); - state->dataHeatBal->EnclSolQSWRad.allocate(1); - state->dataSurface->SurfWinLossSWZoneToOutWinRep.allocate(3); - state->dataSurface->SurfWinSysSolTransmittance.allocate(3); - state->dataSurface->SurfWinSysSolAbsorptance.allocate(3); - state->dataSurface->SurfWinSysSolReflectance.allocate(3); - state->dataSurface->SurfWinInsideGlassCondensationFlag.allocate(3); - state->dataSurface->SurfWinGainFrameDividerToZoneRep.allocate(3); - state->dataSurface->SurfWinInsideFrameCondensationFlag.allocate(3); - state->dataSurface->SurfWinInsideDividerCondensationFlag.allocate(3); - state->dataSurface->SurfTAirRef(surfNum1) = DataSurfaces::RefAirTemp::ZoneMeanAirTemp; state->dataSurface->SurfTAirRef(surfNum2) = DataSurfaces::RefAirTemp::ZoneSupplyAirTemp; state->dataSurface->SurfTAirRef(surfNum3) = DataSurfaces::RefAirTemp::AdjacentAirTemp; @@ -580,17 +560,6 @@ TEST_F(EnergyPlusFixture, WindowManager_RefAirTempTest) state->dataHeatBalSurf->SurfWinCoeffAdjRatio.allocate(3); state->dataHeatBalSurf->SurfWinCoeffAdjRatio(surfNum2) = 1.0; - state->dataHeatBalSurf->SurfQdotConvOutRep.allocate(3); - state->dataHeatBalSurf->SurfQdotConvOutPerArea.allocate(3); - state->dataHeatBalSurf->SurfQConvOutReport.allocate(3); - state->dataHeatBalSurf->SurfQdotRadOutRep.allocate(3); - state->dataHeatBalSurf->SurfQdotRadOutRepPerArea.allocate(3); - state->dataHeatBalSurf->SurfQRadOutReport.allocate(3); - state->dataHeatBalSurf->SurfQRadLWOutSrdSurfs.allocate(3); - state->dataHeatBalSurf->SurfQAirExtReport.allocate(3); - state->dataHeatBalSurf->SurfQHeatEmiReport.allocate(3); - state->dataHeatBalSurf->SurfWinInitialBeamSolInTrans.dimension(3, 0.0); - state->dataHeatBal->SurfQRadSWOutIncident = 0.0; state->dataHeatBal->SurfWinQRadSWwinAbs = 0.0; state->dataHeatBal->SurfQdotRadIntGainsInPerArea = 0.0; From 6686e0cc5d02ef898025f315637aac56ffe1fbb5 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 14:23:37 +0200 Subject: [PATCH 088/164] Work around for DXCoils_Test1 cf #10651 --- tst/EnergyPlus/unit/DXCoils.unit.cc | 223 ++++++++++++++++++---------- 1 file changed, 143 insertions(+), 80 deletions(-) diff --git a/tst/EnergyPlus/unit/DXCoils.unit.cc b/tst/EnergyPlus/unit/DXCoils.unit.cc index 1e6bdeeb19b..518b788a32b 100644 --- a/tst/EnergyPlus/unit/DXCoils.unit.cc +++ b/tst/EnergyPlus/unit/DXCoils.unit.cc @@ -87,13 +87,138 @@ using namespace DataEnvironment; namespace EnergyPlus { +void createFlatCurves(EnergyPlusData *state) +{ + state->dataCurveManager->allocateCurveVector(4); + + { + auto *curve = state->dataCurveManager->PerfCurve(1); + curve->curveType = CurveType::BiQuadratic; + curve->interpolationType = InterpType::EvaluateCurveToLimits; + curve->Name = "Non Flat BiQuadratic FT"; + curve->coeff[0] = 0.95624428; + curve->coeff[1] = 0; + curve->coeff[2] = 0; + curve->coeff[3] = 0.005999544; + curve->coeff[4] = -0.0000900072; + curve->coeff[5] = 0; + curve->inputLimits[0].min = 0.0; + curve->inputLimits[0].max = 2.0; + curve->inputLimits[1].min = 0.0; + curve->inputLimits[1].max = 2.0; + } + + { + auto *curve = state->dataCurveManager->PerfCurve(2); + curve->curveType = CurveType::Quadratic; + curve->Name = "Flat Quadratic FFlow"; + curve->coeff[0] = 1; + curve->coeff[1] = 0; + curve->coeff[2] = 0; + curve->inputLimits[0].min = 0; + curve->inputLimits[0].max = 2; + curve->outputLimits.min = 0; + curve->outputLimits.max = 2; + } + + { + auto *curve = state->dataCurveManager->PerfCurve(3); + curve->Name = "Flat Quadratic PLFFPLR"; + curve->curveType = CurveType::Quadratic; + curve->interpolationType = InterpType::EvaluateCurveToLimits; + curve->coeff[0] = 1; + curve->coeff[1] = 0.0; + curve->coeff[2] = 0.0; + curve->coeff[3] = 0.0; + curve->coeff[4] = 0.0; + curve->coeff[5] = 0.0; + curve->inputLimits[0].min = 0.0; + curve->inputLimits[0].max = 1.0; + curve->inputLimits[1].min = 0.7; + curve->inputLimits[1].max = 1.0; + } + + { + auto *curve = state->dataCurveManager->PerfCurve(4); + curve->Name = "Flat BiQuadratic FEIR"; + curve->curveType = CurveType::BiQuadratic; + curve->interpolationType = InterpType::EvaluateCurveToLimits; + curve->coeff[0] = 1; + curve->coeff[1] = 0.0; + curve->coeff[2] = 0.0; + curve->coeff[3] = 0.0; + curve->coeff[4] = 0.0; + curve->coeff[5] = 0.0; + curve->inputLimits[0].min = -100.0; + curve->inputLimits[0].max = 100.0; + curve->inputLimits[1].min = -100.0; + curve->inputLimits[1].max = 100.0; + } +} +void createSpeedsWithDefaults(DXCoils::DXCoilData &thisDXCoil) +{ + int const numSpeeds = thisDXCoil.NumOfSpeeds; + thisDXCoil.MSRatedTotCap.allocate(numSpeeds); + thisDXCoil.MSRatedTotCap = DataSizing::AutoSize; + + thisDXCoil.MSRatedSHR.allocate(numSpeeds); + thisDXCoil.MSRatedSHR = DataSizing::AutoSize; + + thisDXCoil.MSRatedCOP.allocate(numSpeeds); + thisDXCoil.MSRatedCOP = 3.0; + + thisDXCoil.MSRatedAirVolFlowRate.allocate(numSpeeds); + thisDXCoil.MSRatedAirVolFlowRate = DataSizing::AutoSize; + + thisDXCoil.MSFanPowerPerEvapAirFlowRate.allocate(numSpeeds); + thisDXCoil.MSFanPowerPerEvapAirFlowRate = 777.3; + + thisDXCoil.MSFanPowerPerEvapAirFlowRate_2023.allocate(numSpeeds); + thisDXCoil.MSFanPowerPerEvapAirFlowRate_2023 = 934.4; + + thisDXCoil.MSCCapFTemp.allocate(numSpeeds); + thisDXCoil.MSCCapFFlow.allocate(numSpeeds); + thisDXCoil.MSEIRFTemp.allocate(numSpeeds); + thisDXCoil.MSEIRFFlow.allocate(numSpeeds); + thisDXCoil.MSPLFFPLR.allocate(numSpeeds); + + thisDXCoil.MSTwet_Rated.allocate(numSpeeds); + thisDXCoil.MSTwet_Rated = 0.0; + + thisDXCoil.MSGamma_Rated.allocate(numSpeeds); + thisDXCoil.MSGamma_Rated = 0.0; + + thisDXCoil.MSMaxONOFFCyclesperHour.allocate(numSpeeds); + thisDXCoil.MSMaxONOFFCyclesperHour = 0.0; + + thisDXCoil.MSLatentCapacityTimeConstant.allocate(numSpeeds); + thisDXCoil.MSLatentCapacityTimeConstant = 0.0; + + thisDXCoil.MSWasteHeatFrac.allocate(numSpeeds); + thisDXCoil.MSWasteHeatFrac = 0.2; + + thisDXCoil.MSWasteHeat.allocate(numSpeeds); + + thisDXCoil.MSEvapCondEffect.allocate(numSpeeds); + thisDXCoil.MSEvapCondEffect = 0.9; + + thisDXCoil.MSEvapCondAirFlow.allocate(numSpeeds); + thisDXCoil.MSEvapCondAirFlow = DataSizing::AutoSize; + + thisDXCoil.MSEvapCondPumpElecNomPower.allocate(numSpeeds); + thisDXCoil.MSEvapCondPumpElecNomPower = DataSizing::AutoSize; + + // Other + thisDXCoil.MSRatedCBF.allocate(numSpeeds); + thisDXCoil.MSRatedAirMassFlowRate.allocate(numSpeeds); +} + TEST_F(EnergyPlusFixture, DXCoils_Test1) { using Psychrometrics::PsyRhFnTdbWPb; using Psychrometrics::PsyTdbFnHW; using Psychrometrics::PsyTsatFnHPb; using Psychrometrics::PsyWFnTdbH; - int DXCoilNum; state->dataDXCoils->NumDXCoils = 2; state->dataDXCoils->DXCoil.allocate(state->dataDXCoils->NumDXCoils); @@ -114,38 +239,20 @@ TEST_F(EnergyPlusFixture, DXCoils_Test1) state->dataDXCoils->DXCoil(1).NumOfSpeeds = 2; state->dataDXCoils->DXCoil(2).NumOfSpeeds = 2; - for (DXCoilNum = 1; DXCoilNum <= 2; ++DXCoilNum) { - state->dataDXCoils->DXCoil(DXCoilNum).MSRatedTotCap.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSRatedSHR.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSRatedCOP.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSRatedAirVolFlowRate.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSRatedAirMassFlowRate.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSCCapFTemp.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSCCapFFlow.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSEIRFTemp.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSEIRFFlow.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSWasteHeat.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSEvapCondEffect.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSEvapCondAirFlow.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSEvapCondPumpElecNomPower.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSRatedCBF.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSWasteHeatFrac.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSPLFFPLR.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSTwet_Rated.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSGamma_Rated.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSMaxONOFFCyclesperHour.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSLatentCapacityTimeConstant.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSFanPowerPerEvapAirFlowRate.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); - state->dataDXCoils->DXCoil(DXCoilNum).MSFanPowerPerEvapAirFlowRate_2023.allocate(state->dataDXCoils->DXCoil(DXCoilNum).NumOfSpeeds); + for (int DXCoilNum = 1; DXCoilNum <= 2; ++DXCoilNum) { + createSpeedsWithDefaults(state->dataDXCoils->DXCoil(DXCoilNum)); } - state->dataDXCoils->DXCoil(1).MSRatedTotCap(1) = 4455.507579219055; - state->dataDXCoils->DXCoil(1).MSRatedTotCap(2) = 6188.507579219055; - state->dataDXCoils->DXCoil(1).MSCCapFFlow = 1; - state->dataDXCoils->DXCoil(1).MSCCapFTemp = 3; - state->dataDXCoils->DXCoil(1).MSEIRFFlow = 1; - state->dataDXCoils->DXCoil(1).MSEIRFTemp = 3; - state->dataDXCoils->DXCoil(1).MSPLFFPLR = 2; + createFlatCurves(state); + + int DXCoilNum = 1; + state->dataDXCoils->DXCoil(DXCoilNum).MSRatedTotCap(1) = 4455.507579219055; + state->dataDXCoils->DXCoil(DXCoilNum).MSRatedTotCap(2) = 6188.507579219055; + state->dataDXCoils->DXCoil(DXCoilNum).MSCCapFFlow = 2; + state->dataDXCoils->DXCoil(DXCoilNum).MSCCapFTemp = 1; + state->dataDXCoils->DXCoil(DXCoilNum).MSEIRFFlow = 2; + state->dataDXCoils->DXCoil(DXCoilNum).MSEIRFTemp = 4; + state->dataDXCoils->DXCoil(DXCoilNum).MSPLFFPLR = 3; DXCoilNum = 2; state->dataDXCoils->DXCoil(DXCoilNum).MSRatedTotCap(1) = 4455.507579219055; @@ -153,11 +260,11 @@ TEST_F(EnergyPlusFixture, DXCoils_Test1) state->dataDXCoils->DXCoil(DXCoilNum).MSRatedCOP(1) = 4.03; state->dataDXCoils->DXCoil(DXCoilNum).MSRatedCOP(2) = 3.53; - state->dataDXCoils->DXCoil(DXCoilNum).MSCCapFFlow = 1; - state->dataDXCoils->DXCoil(DXCoilNum).MSCCapFTemp = 3; - state->dataDXCoils->DXCoil(DXCoilNum).MSEIRFFlow = 1; - state->dataDXCoils->DXCoil(DXCoilNum).MSEIRFTemp = 3; - state->dataDXCoils->DXCoil(DXCoilNum).MSPLFFPLR = 2; + state->dataDXCoils->DXCoil(DXCoilNum).MSCCapFFlow = 2; + state->dataDXCoils->DXCoil(DXCoilNum).MSCCapFTemp = 1; + state->dataDXCoils->DXCoil(DXCoilNum).MSEIRFFlow = 2; + state->dataDXCoils->DXCoil(DXCoilNum).MSEIRFTemp = 4; + state->dataDXCoils->DXCoil(DXCoilNum).MSPLFFPLR = 3; state->dataDXCoils->DXCoil(DXCoilNum).MSRatedAirVolFlowRate(1) = 0.2339; state->dataDXCoils->DXCoil(DXCoilNum).MSRatedAirVolFlowRate(2) = 0.2924; state->dataDXCoils->DXCoil(DXCoilNum).MSFanPowerPerEvapAirFlowRate = 0.0; @@ -165,50 +272,6 @@ TEST_F(EnergyPlusFixture, DXCoils_Test1) state->dataDXCoils->DXCoil(DXCoilNum).RegionNum = 4; state->dataDXCoils->DXCoil(DXCoilNum).MinOATCompressor = -17.78; - state->dataCurveManager->allocateCurveVector(3); - - auto *curve1 = state->dataCurveManager->PerfCurve(1); - curve1->curveType = CurveType::Quadratic; - curve1->interpolationType = InterpType::EvaluateCurveToLimits; - curve1->coeff[0] = 1; - curve1->coeff[1] = 0.0; - curve1->coeff[2] = 0.0; - curve1->coeff[3] = 0.0; - curve1->coeff[4] = 0.0; - curve1->coeff[5] = 0.0; - curve1->inputLimits[0].min = 0.0; - curve1->inputLimits[0].max = 2.0; - curve1->inputLimits[1].min = 0.0; - curve1->inputLimits[1].max = 2.0; - - auto *curve2 = state->dataCurveManager->PerfCurve(2); - curve2->curveType = CurveType::Quadratic; - curve2->interpolationType = InterpType::EvaluateCurveToLimits; - curve2->coeff[0] = 1; - curve2->coeff[1] = 0.0; - curve2->coeff[2] = 0.0; - curve2->coeff[3] = 0.0; - curve2->coeff[4] = 0.0; - curve2->coeff[5] = 0.0; - curve2->inputLimits[0].min = 0.0; - curve2->inputLimits[0].max = 1.0; - curve2->inputLimits[1].min = 0.7; - curve2->inputLimits[1].max = 1.0; - - auto *curve3 = state->dataCurveManager->PerfCurve(3); - curve3->curveType = CurveType::BiQuadratic; - curve3->interpolationType = InterpType::EvaluateCurveToLimits; - curve3->coeff[0] = 1; - curve3->coeff[1] = 0.0; - curve3->coeff[2] = 0.0; - curve3->coeff[3] = 0.0; - curve3->coeff[4] = 0.0; - curve3->coeff[5] = 0.0; - curve3->inputLimits[0].min = -100.0; - curve3->inputLimits[0].max = 100.0; - curve3->inputLimits[1].min = -100.0; - curve3->inputLimits[1].max = 100.0; - SetPredefinedTables(*state); SizeDXCoil(*state, 2); EXPECT_DOUBLE_EQ(5000.0, state->dataDXCoils->DXCoil(2).DefrostCapacity); From 409f804f572016ab81dcf04e6c8cb859c94e674d Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 14:30:14 +0200 Subject: [PATCH 089/164] Fix HPWHSizing --- tst/EnergyPlus/unit/WaterThermalTanks.unit.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc index 42969011661..dcc74d48ce4 100644 --- a/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc +++ b/tst/EnergyPlus/unit/WaterThermalTanks.unit.cc @@ -54,6 +54,7 @@ #include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include #include @@ -1046,6 +1047,7 @@ TEST_F(EnergyPlusFixture, HPWHSizing) ASSERT_FALSE(ErrorsFound); state->dataHVACGlobal->TimeStepSys = 1; state->dataHVACGlobal->TimeStepSysSec = state->dataHVACGlobal->TimeStepSys * Constant::SecInHour; + state->dataEnvrn->OutBaroPress = 101325; SetPredefinedTables(*state); state->dataZoneTempPredictorCorrector->zoneHeatBalance.allocate(1); From 7d4e4fa7c160717ac42b2f42b22a93e17a921e16 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 14:48:53 +0200 Subject: [PATCH 090/164] Fix VariableSpeedCoils_ZeroRatedCoolingCapacity_Test cf https://github.com/NREL/EnergyPlus/pull/10470#pullrequestreview-2230090029 @RKStrand does that mean sense to you please? --- src/EnergyPlus/VariableSpeedCoils.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index 72555173ab9..324a94c8872 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -5556,7 +5556,11 @@ namespace VariableSpeedCoils { RatedInletEnth = Psychrometrics::PsyHFnTdbW(RatedInletAirTemp, RatedInletAirHumRat); CBFRated = AdjustCBF(varSpeedCoil.MSRatedCBF(NormSpeed), varSpeedCoil.MSRatedAirMassFlowRate(NormSpeed), RatedAirMassFlowRate); if (CBFRated > 0.999) CBFRated = 0.999; - AirMassFlowRatio = RatedAirMassFlowRate / varSpeedCoil.MSRatedAirMassFlowRate(NormSpeed); + if (varSpeedCoil.MSRatedAirMassFlowRate(NormSpeed) > 1.0e-10) { + AirMassFlowRatio = RatedAirMassFlowRate / varSpeedCoil.MSRatedAirMassFlowRate(NormSpeed); + } else { + AirMassFlowRatio = 1.0; + } if (varSpeedCoil.MSRatedWaterVolFlowRate(NormSpeed) > 1.0e-10) { WaterMassFlowRatio = varSpeedCoil.RatedWaterVolFlowRate / varSpeedCoil.MSRatedWaterVolFlowRate(NormSpeed); @@ -8622,7 +8626,11 @@ namespace VariableSpeedCoils { Real64 tADP = PsyTsatFnHPb(state, hADP, Pressure, RoutineName); // Apparatus dew point temperature [C] Real64 wADP = PsyWFnTdbH(state, tADP, hADP, RoutineName); // Apparatus dew point humidity ratio [kg/kg] Real64 hTinwADP = PsyHFnTdbW(InletDryBulb, wADP); // Enthalpy at inlet dry-bulb and wADP [J/kg] - SHRCalc = min((hTinwADP - hADP) / (InletEnthalpy - hADP), 1.0); // temporary calculated value of SHR + if (TotCapCalc > 1.0e-10) { + SHRCalc = min((hTinwADP - hADP) / (InletEnthalpy - hADP), 1.0); // temporary calculated value of SHR + } else { + SHRCalc = 1.0; + } // Check for dry evaporator conditions (win < wadp) if (wADP > InletHumRatCalc || (Counter >= 1 && Counter < MaxIter)) { From 390e393bd1ec528b60f943c5f06ed6d93506172f Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Fri, 9 Aug 2024 08:01:35 -0500 Subject: [PATCH 091/164] Space IV-ZoneRefrigerationDoorMixing --- .../src/overview/group-airflow.tex | 10 ++-- idd/Energy+.idd.in | 10 +++- src/EnergyPlus/HeatBalanceAirManager.cc | 19 +++++- src/EnergyPlus/ZoneEquipmentManager.cc | 59 ++++++++++++++----- 4 files changed, 72 insertions(+), 26 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-airflow.tex b/doc/input-output-reference/src/overview/group-airflow.tex index 4d6aea4e36c..db393414b97 100644 --- a/doc/input-output-reference/src/overview/group-airflow.tex +++ b/doc/input-output-reference/src/overview/group-airflow.tex @@ -1518,7 +1518,7 @@ \subsection{ZoneRefrigerationDoorMixing}\label{zonerefrigerationdoormixing} ZoneRefrigerationDoorMixing is ideally suited for two zones, at least one of which is refrigerated, that exchange an equal amount of dry air. As with \hyperref[zonemixing]{ZoneMixing}, this is a simplified interzone airflow in EnergyPlus. The ZoneRefrigerationDoorMixing approach shares some features of both \hyperref[zonemixing]{ZoneMixing} and \hyperref[zonecrossmixing]{ZoneCrossMixing}. Like \hyperref[zonecrossmixing]{ZoneCrossMixing}, ZoneRefrigerationDoorMixing has an energy effect on both the source and the receiving zone, thus maintaining both the air mass and energy balances in the two zones. Unlike the other two mixing objects, ZoneRefrigerationDoorMixing always calculates the air exchange rate based on the zone temperature and relative humidity. That is, the user does not specify the air flow rate. The user can moderate the flow through a door-opening schedule. -ZoneRefrigerationDoorMixing can only be entered once for any unique pair of zones. It doesn't matter which zone is listed first and the zones will automatically switch back and forth between source and receiving zones depending upon which zone is colder. +ZoneRefrigerationDoorMixing can only be entered once for any unique pair of zones. It doesn't matter which zone is listed first and the zones will automatically switch back and forth between source and receiving zones depending upon which zone is colder. If space heat balance is active and a space name is specified for Space or Zone Name 1 or 2, then the space conditions will be used and the exchange will be with that space only. If space heat balance is active and a zone name is specified, then the aveerage zone conditions will be used, and the exchange will be proportioned to all spaces in the zone by space volume. \subsubsection{Inputs}\label{inputs-7-003} @@ -1526,13 +1526,13 @@ \subsubsection{Inputs}\label{inputs-7-003} The name of the ZoneRefrigerationDoorMixing object. -\paragraph{Field: Zone 1~ Name}\label{field-zone-1-name} +\paragraph{Field: Zone or Space Name 1}\label{field-zone-1-name} -This field is the name of one of the two zones (ref: Zone) exchanging air and attaches a particular refrigeration door~ mixing statement to both thermal zones in the building. +This field is the name of one of the two zones (ref: Zone) or spaces exchanging air and attaches a particular refrigeration door~ mixing statement to both thermal zones or spaces in the building. If a space name is used, it must belong to a different zone than Zone or Space Name 2. -\paragraph{Field: Zone 2~ Name}\label{field-zone-2-name} +\paragraph{Field: Zone or Space Name 2}\label{field-zone-2-name} -This field is the name of the other zone (ref: Zone) exchanging air and attaches a particular refrigeration door~ mixing statement to both thermal zones in the building. +This field is the name of the other zone (ref: Zone) or space exchanging air and attaches a particular refrigeration door~ mixing statement to both thermal zones or spaces in the building. If a space name is used, it must belong to a different zone than Zone or Space Name 1. \paragraph{Field: Schedule Name}\label{field-schedule-name-5} diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index d0901eae735..a3ebbedd817 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -24572,7 +24572,7 @@ ZoneCrossMixing, ZoneRefrigerationDoorMixing, \min-fields 4 - \memo Refrigeration Door Mixing is used for an opening between two zones that are at the + \memo Refrigeration Door Mixing is used for an opening between two zones (or spaces) that are at the \memo same elevation but have different air temperatures. In this case, the mixing air flow \memo between the two zones is determined by the density difference between the two zones. \memo This would typically be used between two zones in a refrigerated warehouse that are @@ -24581,14 +24581,18 @@ ZoneRefrigerationDoorMixing, A1 , \field Name \required-field \type alpha - A2 , \field Zone 1 Name + A2 , \field Zone or Space Name 1 + \note If a space name is used, it must belong to a different zone than Zone or Space Name 2. \required-field \type object-list \object-list ZoneNames - A3 , \field Zone 2 Name + \object-list SpaceNames + A3 , \field Zone or Space Name 2 + \note If a space name is used, it must belong to a different zone than Zone or Space Name 1. \required-field \type object-list \object-list ZoneNames + \object-list SpaceNames A4 , \field Schedule Name \note This schedule defines the fraction of the time the refrigeration door is open \note For example, if the warehouse is closed at night and there are no door openings diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index e9745fcad4f..870f2f35162 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -3802,7 +3802,8 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err int AlphaNum = 2; int Zone1Num = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->Zone); - if (Zone1Num == 0) { + int space1Num = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->space); + if ((Zone1Num == 0) && (space1Num==0)) { ShowSevereError(state, format("{}{}=\"{}\", invalid (not found) {}=\"{}\".", RoutineName, @@ -3811,11 +3812,14 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err cAlphaFieldNames(AlphaNum), cAlphaArgs(AlphaNum))); ErrorsFound = true; + } else if (Zone1Num == 0) { + Zone1Num = state.dataHeatBal->space(space1Num).zoneNum; } ++AlphaNum; // 3 int Zone2Num = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->Zone); - if (Zone2Num == 0) { + int space2Num = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->space); + if ((Zone2Num == 0) && (space2Num==0)) { ShowSevereError(state, format("{}{}=\"{}\", invalid (not found) {}=\"{}\".", RoutineName, @@ -3824,7 +3828,12 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err cAlphaFieldNames(AlphaNum), cAlphaArgs(AlphaNum))); ErrorsFound = true; + } else if (Zone2Num == 0) { + Zone2Num = state.dataHeatBal->space(space2Num).zoneNum; } + + int spaceNumA = 0; + int spaceNumB = 0; if (Zone1Num == Zone2Num) { ShowSevereError(state, format("{}{}=\"{}\", The same zone name has been entered for both sides of a refrigerated door {}=\"{}\".", @@ -3837,9 +3846,13 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err } else if (Zone1Num < Zone2Num) { // zone 1 will come first in soln loop, id zone 2 as mate zone ZoneNumA = Zone1Num; ZoneNumB = Zone2Num; + spaceNumA = space1Num; + spaceNumB = space2Num; } else { // zone 2 will come first in soln loop, id zone 1 as mate zone ZoneNumA = Zone2Num; ZoneNumB = Zone1Num; + spaceNumA = space2Num; + spaceNumB = space1Num; } if (!allocated(state.dataHeatBal->RefDoorMixing(ZoneNumA).OpenSchedPtr)) { @@ -3891,6 +3904,8 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err ConnectionNumber = state.dataHeatBal->RefDoorMixing(ZoneNumA).NumRefDoorConnections + 1; state.dataHeatBal->RefDoorMixing(ZoneNumA).NumRefDoorConnections = ConnectionNumber; state.dataHeatBal->RefDoorMixing(ZoneNumA).ZonePtr = ZoneNumA; + state.dataHeatBal->RefDoorMixing(ZoneNumA).spaceIndex = spaceNumA; + state.dataHeatBal->RefDoorMixing(ZoneNumA).fromSpaceIndex = spaceNumB; state.dataHeatBal->RefDoorMixing(ZoneNumA).MateZonePtr(ConnectionNumber) = ZoneNumB; state.dataHeatBal->RefDoorMixing(ZoneNumA).DoorMixingObjectName(ConnectionNumber) = NameThisObject; // need to make sure same pair of zones is only entered once. diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 6c4089019e1..ae3ecdf4cbd 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -6403,9 +6403,15 @@ void CalcAirFlowSimple(EnergyPlusData &state, // Zone loops structured in getinput so only do each pair of zones bounding door once, even if multiple doors in one zone for (int ZoneA = 1; ZoneA <= (state.dataGlobal->NumOfZones - 1); ++ZoneA) { if (!state.dataHeatBal->RefDoorMixing(ZoneA).RefDoorMixFlag) continue; + auto &thisRefDoorMixing = state.dataHeatBal->RefDoorMixing(ZoneA); auto &zoneAHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneA); Real64 TZoneA = zoneAHB.MixingMAT; Real64 HumRatZoneA = zoneAHB.MixingHumRat; + if ((state.dataHeatBal->doSpaceHeatBalance) && (thisRefDoorMixing.spaceIndex > 0)) { + auto &spaceAHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(thisRefDoorMixing.spaceIndex); + TZoneA = spaceAHB.MixingMAT; + HumRatZoneA = spaceAHB.MixingHumRat; + } Real64 AirDensityZoneA = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, TZoneA, HumRatZoneA, RoutineNameRefrigerationDoorMixing); Real64 CpAirZoneA = PsyCpAirFnW(HumRatZoneA); for (int j = 1; j <= state.dataHeatBal->RefDoorMixing(ZoneA).NumRefDoorConnections; ++j) { @@ -6414,6 +6420,11 @@ void CalcAirFlowSimple(EnergyPlusData &state, Real64 TZoneB = zoneBHB.MixingMAT; Real64 HumRatZoneB = zoneBHB.MixingHumRat; Real64 CpAirZoneB = PsyCpAirFnW(HumRatZoneB); + if ((state.dataHeatBal->doSpaceHeatBalance) && (thisRefDoorMixing.fromSpaceIndex > 0)) { + auto &spaceBHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(thisRefDoorMixing.fromSpaceIndex); + TZoneB = spaceBHB.MixingMAT; + HumRatZoneB = spaceBHB.MixingHumRat; + } Real64 Tavg = (TZoneA + TZoneB) / 2.0; Real64 Wavg = (HumRatZoneA + HumRatZoneB) / 2.0; Real64 AirDensityAvg = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, Tavg, Wavg, RoutineNameRefrigerationDoorMixing); @@ -6471,23 +6482,39 @@ void CalcAirFlowSimple(EnergyPlusData &state, zoneAHB.MixingMassFlowXHumRat += MassFlowXHumRatToA; zoneBHB.MixingMassFlowXHumRat += MassFlowXHumRatToB; if (state.dataHeatBal->doSpaceHeatBalance) { - // ZoneRefrigerationDoorMixing has no space information, just zones - // Allocate mixing flows by space volume fraction of zone volume - for (int spaceNum : state.dataHeatBal->Zone(ZoneA).spaceIndexes) { - Real64 spaceFrac = state.dataHeatBal->space(spaceNum).fracZoneVolume; - auto &spaceAHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum); - spaceAHB.MCPM += MassFlowXCpToA * spaceFrac; - spaceAHB.MCPTM += MassFlowXCpXTempToA * spaceFrac; - spaceAHB.MixingMassFlowZone += MassFlowToA * spaceFrac; - spaceAHB.MixingMassFlowXHumRat += MassFlowXHumRatToA * spaceFrac; + if (thisRefDoorMixing.spaceIndex > 0) { + auto &spaceAHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(thisRefDoorMixing.spaceIndex); + spaceAHB.MCPM += MassFlowXCpToA; + spaceAHB.MCPTM += MassFlowXCpXTempToA; + spaceAHB.MixingMassFlowZone += MassFlowToA; + spaceAHB.MixingMassFlowXHumRat += MassFlowXHumRatToA; + } else { + // Allocate mixing flows by space volume fraction of zone volume + for (int spaceNum : state.dataHeatBal->Zone(ZoneA).spaceIndexes) { + Real64 spaceFrac = state.dataHeatBal->space(spaceNum).fracZoneVolume; + auto &spaceAHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum); + spaceAHB.MCPM += MassFlowXCpToA * spaceFrac; + spaceAHB.MCPTM += MassFlowXCpXTempToA * spaceFrac; + spaceAHB.MixingMassFlowZone += MassFlowToA * spaceFrac; + spaceAHB.MixingMassFlowXHumRat += MassFlowXHumRatToA * spaceFrac; + } } - for (int spaceNum : state.dataHeatBal->Zone(ZoneB).spaceIndexes) { - Real64 spaceFrac = state.dataHeatBal->space(spaceNum).fracZoneVolume; - auto &spaceBHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum); - spaceBHB.MCPM += MassFlowXCpToB * spaceFrac; - spaceBHB.MCPTM += MassFlowXCpXTempToB * spaceFrac; - spaceBHB.MixingMassFlowZone += MassFlowToB * spaceFrac; - spaceBHB.MixingMassFlowXHumRat += MassFlowXHumRatToB * spaceFrac; + if (thisRefDoorMixing.spaceIndex > 0) { + auto &spaceBHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(thisRefDoorMixing.fromSpaceIndex); + spaceBHB.MCPM += MassFlowXCpToB; + spaceBHB.MCPTM += MassFlowXCpXTempToB; + spaceBHB.MixingMassFlowZone += MassFlowToB; + spaceBHB.MixingMassFlowXHumRat += MassFlowXHumRatToB; + } else { + // Allocate mixing flows by space volume fraction of zone volume + for (int spaceNum : state.dataHeatBal->Zone(ZoneB).spaceIndexes) { + Real64 spaceFrac = state.dataHeatBal->space(spaceNum).fracZoneVolume; + auto &spaceBHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum); + spaceBHB.MCPM += MassFlowXCpToB * spaceFrac; + spaceBHB.MCPTM += MassFlowXCpXTempToB * spaceFrac; + spaceBHB.MixingMassFlowZone += MassFlowToB * spaceFrac; + spaceBHB.MixingMassFlowXHumRat += MassFlowXHumRatToB * spaceFrac; + } } } From d54533cc5a664c68939856073de046f75515d119 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 15:19:29 +0200 Subject: [PATCH 092/164] Fix SolarShadingTest_CalcBeamSolarOnWinRevealSurface --- tst/EnergyPlus/unit/SolarShading.unit.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index aa28eb96a4a..04cd3aa78c3 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -5192,6 +5192,11 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_CalcBeamSolarOnWinRevealSurface) surf2.SinTilt = 1.0; surf1.CosTilt = 0.0; surf2.CosTilt = 0.0; + surf1.Area = 2.0; + surf2.Area = 2.0; + state->dataSurface->SurfWinFrameArea(1) = 0.64; + state->dataSurface->SurfWinFrameArea(2) = 0.64; + state->dataSurface->SurfActiveConstruction(1) = 1; state->dataSurface->SurfActiveConstruction(2) = 1; From 89455497cfab9aacce224360f3bcce0b863105b9 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 15:21:58 +0200 Subject: [PATCH 093/164] Fix ManageElectricPowerTest_CheckOutputReporting --- tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc b/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc index 05f2f7cc81d..ec4c23113c4 100644 --- a/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc +++ b/tst/EnergyPlus/unit/ElectricPowerServiceManager.unit.cc @@ -693,6 +693,7 @@ TEST_F(EnergyPlusFixture, ManageElectricPowerTest_CheckOutputReporting) ASSERT_TRUE(process_idf(idf_objects)); state->dataHVACGlobal->TimeStepSys = 1.0; + state->dataHVACGlobal->TimeStepSysSec = 3600.0; state->dataGlobal->TimeStepZoneSec = 3600.0; createFacilityElectricPowerServiceObject(*state); From 08343943446bf137ff1fd24220e44bf1285d31e4 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 15:49:50 +0200 Subject: [PATCH 094/164] Fix UnitaryBypassVAV_ParentElectricityRateTest --- tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc index 0f871939e9b..4e3edc51a24 100644 --- a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc +++ b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc @@ -1715,13 +1715,21 @@ TEST_F(EnergyPlusFixture, UnitaryBypassVAV_ParentElectricityRateTest) // set sizing variables state->dataSize->SysSizingRunDone = true; state->dataSize->ZoneSizingRunDone = true; - state->dataGlobal->SysSizingCalc = true; + state->dataGlobal->SysSizingCalc = true; // disable sizing calculation state->dataGlobal->SysSizingCalc = true; state->dataGlobal->BeginEnvrnFlag = true; // set local variables for convenience auto *supplyFan = state->dataFans->fans(1); auto &dxClgCoilMain = state->dataVariableSpeedCoils->VarSpeedCoil(1); auto &dxHtgCoilMain = state->dataVariableSpeedCoils->VarSpeedCoil(2); + + for (int Mode = 1; Mode <= dxClgCoilMain.NumOfSpeeds; ++Mode) { + dxClgCoilMain.MSRatedAirMassFlowRate(Mode) = dxClgCoilMain.MSRatedAirVolFlowRate(Mode) * state->dataEnvrn->StdRhoAir; + } + for (int Mode = 1; Mode <= dxHtgCoilMain.NumOfSpeeds; ++Mode) { + dxHtgCoilMain.MSRatedAirMassFlowRate(Mode) = dxHtgCoilMain.MSRatedAirVolFlowRate(Mode) * state->dataEnvrn->StdRhoAir; + } + // initialize priority control BypassVAV.PriorityControl = HVACUnitaryBypassVAV::PriorityCtrlMode::HeatingPriority; BypassVAV.AirFlowControl = HVACUnitaryBypassVAV::AirFlowCtrlMode::UseCompressorOnFlow; From 9cdb3e4c1400222c70dc3de05ee175bea779716c Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Fri, 9 Aug 2024 15:54:19 +0200 Subject: [PATCH 095/164] Fix HVACMSHP_UnitarySystemElectricityRateTest --- tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc index 11e18252587..ecab9c6fdcd 100644 --- a/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/HVACMultiSpeedHeatPump.unit.cc @@ -2204,6 +2204,14 @@ TEST_F(EnergyPlusFixture, HVACMSHP_UnitarySystemElectricityRateTest) state->dataEnvrn->OutHumRat = 0.005; state->dataEnvrn->StdBaroPress = 101325.0; state->dataEnvrn->OutBaroPress = 101325.0; + + for (int Mode = 1; Mode <= dxClgCoilMain.NumOfSpeeds; ++Mode) { + dxClgCoilMain.MSRatedAirMassFlowRate(Mode) = dxClgCoilMain.MSRatedAirVolFlowRate(Mode) * state->dataEnvrn->StdRhoAir; + } + for (int Mode = 1; Mode <= dxHtgCoilMain.NumOfSpeeds; ++Mode) { + dxHtgCoilMain.MSRatedAirMassFlowRate(Mode) = dxHtgCoilMain.MSRatedAirVolFlowRate(Mode) * state->dataEnvrn->StdRhoAir; + } + // set zone air conditions auto &zoneAirNode = state->dataLoopNodes->Node(Util::FindItemInList("Z401 AIR NODE", state->dataLoopNodes->NodeID, state->dataLoopNodes->NumOfNodes)); From c95600bd4f2492445d4d773e440424fb9f381d29 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Fri, 9 Aug 2024 13:05:21 -0500 Subject: [PATCH 096/164] 10634 Fix of Condenser Operation Issue This commit includes the fix to the problem for both condensers operating even when the operation scheme said that one of them should not be operating. It fixes this for all of the cooling tower models that were not set up to look at this. Results now should that the towers are operating when they are supposed to. --- src/EnergyPlus/CondenserLoopTowers.cc | 68 ++++++++++++------- src/EnergyPlus/CondenserLoopTowers.hh | 8 ++- .../unit/CondenserLoopTowers.unit.cc | 12 ++-- 3 files changed, 54 insertions(+), 34 deletions(-) diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index dfd6f8f7b5b..8460b789753 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -137,13 +137,13 @@ namespace CondenserLoopTowers { this->initialize(state); switch (this->TowerType) { case DataPlant::PlantEquipmentType::CoolingTower_SingleSpd: - this->calculateSingleSpeedTower(state); + this->calculateSingleSpeedTower(state, CurLoad); break; case DataPlant::PlantEquipmentType::CoolingTower_TwoSpd: - this->calculateTwoSpeedTower(state); + this->calculateTwoSpeedTower(state, CurLoad); break; case DataPlant::PlantEquipmentType::CoolingTower_VarSpd: - this->calculateVariableSpeedTower(state); + this->calculateVariableSpeedTower(state, CurLoad); break; case DataPlant::PlantEquipmentType::CoolingTower_VarSpdMerkel: this->calculateMerkelVariableSpeedTower(state, CurLoad); @@ -4535,7 +4535,7 @@ namespace CondenserLoopTowers { } } // namespace CondenserLoopTowers - void CoolingTower::calculateSingleSpeedTower(EnergyPlusData &state) + void CoolingTower::calculateSingleSpeedTower(EnergyPlusData &state, Real64 &MyLoad) { // SUBROUTINE INFORMATION: @@ -4695,13 +4695,9 @@ namespace CondenserLoopTowers { // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. - // MassFlowTolerance is a parameter to indicate a no flow condition - if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { - // for multiple cells, we assume that it's a common basin - CalcBasinHeaterPower( - state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); - return; - } + bool returnFlagSet; + this->checkMassFlowAndLoad(state, MyLoad, returnFlagSet); + if (returnFlagSet) return; bool IncrNumCellFlag = true; // determine if yes or no we increase the number of cells // set value to true to enter in the loop @@ -4847,7 +4843,7 @@ namespace CondenserLoopTowers { this->airFlowRateRatio = (AirFlowRate * this->NumCell) / this->HighSpeedAirFlowRate; } - void CoolingTower::calculateTwoSpeedTower(EnergyPlusData &state) + void CoolingTower::calculateTwoSpeedTower(EnergyPlusData &state, Real64 &MyLoad) { // SUBROUTINE INFORMATION: @@ -4974,12 +4970,9 @@ namespace CondenserLoopTowers { // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. if (state.dataPlnt->PlantLoop(this->plantLoc.loopNum).LoopSide(this->plantLoc.loopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; // TODO: WTF - // MassFlowTolerance is a parameter to indicate a no flow condition - if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { - CalcBasinHeaterPower( - state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); - return; - } + bool returnFlagSet; + this->checkMassFlowAndLoad(state, MyLoad, returnFlagSet); + if (returnFlagSet) return; // Added for multi-cell. Determine the number of cells operating Real64 WaterMassFlowRatePerCellMin = 0.0; @@ -5089,7 +5082,7 @@ namespace CondenserLoopTowers { this->airFlowRateRatio = (AirFlowRate * this->NumCell) / this->HighSpeedAirFlowRate; } - void CoolingTower::calculateVariableSpeedTower(EnergyPlusData &state) + void CoolingTower::calculateVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad) { // SUBROUTINE INFORMATION: @@ -5209,12 +5202,10 @@ namespace CondenserLoopTowers { // Do not RETURN here if flow rate is less than MassFlowTolerance. Check basin heater and then RETURN. if (state.dataPlnt->PlantLoop(this->plantLoc.loopNum).LoopSide(this->plantLoc.loopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; // TODO: WTF - // MassFlowTolerance is a parameter to indicate a no flow condition - if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { - CalcBasinHeaterPower( - state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); - return; - } + + bool returnFlagSet; + this->checkMassFlowAndLoad(state, MyLoad, returnFlagSet); + if (returnFlagSet) return; // loop to increment NumCell if we cannot meet the setpoint with the actual number of cells calculated above bool IncrNumCellFlag = true; @@ -5512,9 +5503,10 @@ namespace CondenserLoopTowers { } WaterMassFlowRatePerCell = this->WaterMassFlowRate / this->NumCellOn; + // MassFlowTolerance is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || (MyLoad > HVAC::SmallLoad)) { - // for multiple cells, we assume that it's a common bassin + // for multiple cells, we assume that it's a common basin CalcBasinHeaterPower( state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); return; @@ -6463,6 +6455,30 @@ namespace CondenserLoopTowers { } } + void CoolingTower::checkMassFlowAndLoad(EnergyPlusData &state, Real64 const MyLoad, bool &returnFlagSet) + { + returnFlagSet = false; + // MassFlowTolerance is a parameter to indicate a no flow condition + if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { + // for multiple cells, we assume that it's a common basin + CalcBasinHeaterPower( + state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); + returnFlagSet = true; + } + + // Also check to see if the tower is not running (zero MyLoad) + if (std::abs(MyLoad) <= HVAC::SmallLoad) { + // tower doesn't need to do anything + this->OutletWaterTemp = state.dataLoopNodes->Node(this->WaterInletNodeNum).Temp; + this->FanPower = 0.0; + this->airFlowRateRatio = 0.0; + this->Qactual = 0.0; + CalcBasinHeaterPower( + state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); + returnFlagSet = true; + } + } + } // namespace CondenserLoopTowers } // namespace EnergyPlus diff --git a/src/EnergyPlus/CondenserLoopTowers.hh b/src/EnergyPlus/CondenserLoopTowers.hh index d1f128674ce..ef2da0f931a 100644 --- a/src/EnergyPlus/CondenserLoopTowers.hh +++ b/src/EnergyPlus/CondenserLoopTowers.hh @@ -387,13 +387,13 @@ namespace CondenserLoopTowers { void SizeVSMerkelTower(EnergyPlusData &state); - void calculateSingleSpeedTower(EnergyPlusData &state); + void calculateSingleSpeedTower(EnergyPlusData &state, Real64 &MyLoad); - void calculateTwoSpeedTower(EnergyPlusData &state); + void calculateTwoSpeedTower(EnergyPlusData &state, Real64 &MyLoad); void calculateMerkelVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad); - void calculateVariableSpeedTower(EnergyPlusData &state); + void calculateVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad); Real64 calculateSimpleTowerOutletTemp(EnergyPlusData &state, Real64 waterMassFlowRate, Real64 AirFlowRate, Real64 UAdesign); @@ -427,6 +427,8 @@ namespace CondenserLoopTowers { void report(EnergyPlusData &state, bool RunFlag); + void checkMassFlowAndLoad(EnergyPlusData &state, Real64 MyLoad, bool &returnFlagSet); + static CoolingTower *factory(EnergyPlusData &state, std::string_view objectName); }; diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index 99aac875025..76b9fc1f407 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -904,10 +904,11 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedSizing) SimulationManager::SetupSimulation(*state, ErrorsFound); CondenserLoopTowers::GetTowerInput(*state); + Real64 MyLoad = 0.0; state->dataCondenserLoopTowers->towers(1).initialize(*state); state->dataCondenserLoopTowers->towers(1).SizeTower(*state); state->dataCondenserLoopTowers->towers(1).initialize(*state); - state->dataCondenserLoopTowers->towers(1).calculateSingleSpeedTower(*state); + state->dataCondenserLoopTowers->towers(1).calculateSingleSpeedTower(*state, MyLoad); state->dataCondenserLoopTowers->towers(1).update(*state); state->dataCondenserLoopTowers->towers(1).report(*state, true); @@ -927,8 +928,8 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedSizing) outletNodeIndex = std::distance(state->dataLoopNodes->NodeID.begin(), outletNode); } // TODO: FIXME: This is failing. Actual is -10.409381032746095, expected is 30. - EXPECT_GT(state->dataLoopNodes->Node(inletNodeIndex).Temp, 30.0); // inlet node temperature - EXPECT_DOUBLE_EQ(30.0, state->dataLoopNodes->Node(outletNodeIndex).Temp); // outlet node temperature + EXPECT_GT(state->dataLoopNodes->Node(inletNodeIndex).Temp, 30.0); // inlet node temperature + EXPECT_DOUBLE_EQ(state->dataLoopNodes->Node(inletNodeIndex).Temp, state->dataLoopNodes->Node(outletNodeIndex).Temp); // outlet node temperature // input not needed for sizing (WasAutoSized = false) using NominalCapacity method but this variable should still size EXPECT_FALSE(state->dataCondenserLoopTowers->towers(1).HighSpeedTowerUAWasAutoSized); @@ -3967,7 +3968,8 @@ TEST_F(EnergyPlusFixture, VSCoolingTowers_WaterOutletTempTest) state->dataPlnt->PlantLoop(VSTower.plantLoc.loopNum).LoopSide(VSTower.plantLoc.loopSideNum).TempSetPoint = 30.0; VSTower.WaterMassFlowRate = VSTower.DesWaterMassFlowRate * WaterFlowRateRatio; - VSTower.calculateVariableSpeedTower(*state); + Real64 myLoad = 1000.0; + VSTower.calculateVariableSpeedTower(*state, myLoad); EXPECT_DOUBLE_EQ(30.0, VSTower.OutletWaterTemp); EXPECT_DOUBLE_EQ(1.0, VSTower.FanCyclingRatio); Real64 TowerOutletWaterTemp = VSTower.calculateVariableTowerOutletTemp(*state, WaterFlowRateRatio, VSTower.airFlowRateRatio, AirWetBulbTemp); @@ -3985,7 +3987,7 @@ TEST_F(EnergyPlusFixture, VSCoolingTowers_WaterOutletTempTest) VSTower.AirWetBulb = state->dataEnvrn->OutWetBulbTemp; VSTower.AirHumRat = state->dataEnvrn->OutHumRat; - VSTower.calculateVariableSpeedTower(*state); + VSTower.calculateVariableSpeedTower(*state, myLoad); EXPECT_DOUBLE_EQ(30.0, VSTower.OutletWaterTemp); EXPECT_NEAR(0.5424, VSTower.FanCyclingRatio, 0.0001); // outside air condition is favorable that fan only needs to cycle at min flow to meet the setpoint From 8f7c5de3d1741aae708a732fbe3ccba4f39af3af Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Fri, 9 Aug 2024 13:35:38 -0500 Subject: [PATCH 097/164] 10634 Address Custom Check Error Something about the logical flag wasn't what the custom check wanted. This is an attempt to fix that. --- src/EnergyPlus/CondenserLoopTowers.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 8460b789753..ad8a019c43a 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -4695,7 +4695,7 @@ namespace CondenserLoopTowers { // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. - bool returnFlagSet; + bool returnFlagSet = false; this->checkMassFlowAndLoad(state, MyLoad, returnFlagSet); if (returnFlagSet) return; @@ -4970,7 +4970,7 @@ namespace CondenserLoopTowers { // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. if (state.dataPlnt->PlantLoop(this->plantLoc.loopNum).LoopSide(this->plantLoc.loopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; // TODO: WTF - bool returnFlagSet; + bool returnFlagSet = false; this->checkMassFlowAndLoad(state, MyLoad, returnFlagSet); if (returnFlagSet) return; @@ -5203,7 +5203,7 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantLoop(this->plantLoc.loopNum).LoopSide(this->plantLoc.loopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; // TODO: WTF - bool returnFlagSet; + bool returnFlagSet = false; this->checkMassFlowAndLoad(state, MyLoad, returnFlagSet); if (returnFlagSet) return; @@ -6457,7 +6457,6 @@ namespace CondenserLoopTowers { void CoolingTower::checkMassFlowAndLoad(EnergyPlusData &state, Real64 const MyLoad, bool &returnFlagSet) { - returnFlagSet = false; // MassFlowTolerance is a parameter to indicate a no flow condition if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { // for multiple cells, we assume that it's a common basin From 712f23f9fc6f6eb39a32cad75f2eb04264bcca5e Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Fri, 9 Aug 2024 15:02:26 -0500 Subject: [PATCH 098/164] 10634 Addition of Unit Test Unit test was added to exercise the new subroutine that is being used to allow condensers to factor in condenser loop operation schemes. --- .../unit/CondenserLoopTowers.unit.cc | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index 76b9fc1f407..bb6f354a6f6 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -4307,4 +4307,69 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_CalculateVariableTowerOutletTemp) EXPECT_NEAR(tower.WaterTemp - 22.2222, tOutlet, 0.01); } +TEST_F(EnergyPlusFixture, CondenserLoopTowers_checkMassFlowAndLoadTest) +{ + bool flagToReturn; + Real64 myLoad; + Real64 constexpr allowedTolerance = 0.0001; + Real64 expectedPower; + Real64 expectedTemp; + + state->dataCondenserLoopTowers->towers.allocate(1); + auto &tower = state->dataCondenserLoopTowers->towers(1); + state->dataLoopNodes->Node.allocate(1); + tower.WaterInletNodeNum = 1; + + // Test 1: Mass flow rate is low but myLoad is ok--flag should be set to true + flagToReturn = false; + myLoad = 1000.0; + state->dataEnvrn->OutDryBulbTemp = 27.0; + tower.WaterMassFlowRate = 0.0; + tower.BasinHeaterPowerFTempDiff = 1.0; + tower.BasinHeaterSchedulePtr = 0; + tower.BasinHeaterSetPointTemp = 26.0; + tower.BasinHeaterPower = 1.0; + expectedPower = 0.0; + tower.checkMassFlowAndLoad(*state, myLoad, flagToReturn); + EXPECT_TRUE(flagToReturn); + EXPECT_NEAR(expectedPower, tower.BasinHeaterPower, allowedTolerance); + + // Test 2: Mass flow rate is ok but myLoad is zero--flag should be set to true + flagToReturn = false; + myLoad = 0.0; + state->dataEnvrn->OutDryBulbTemp = 27.0; + tower.WaterMassFlowRate = 0.5; + tower.BasinHeaterPowerFTempDiff = 1.0; + tower.BasinHeaterSchedulePtr = 0; + tower.BasinHeaterSetPointTemp = 25.0; + tower.BasinHeaterPower = 2.0; + tower.FanPower = 1.0; + tower.airFlowRateRatio = 1.0; + tower.Qactual = 1.0; + expectedPower = 0.0; + expectedTemp = 23.0; + state->dataLoopNodes->Node(tower.WaterInletNodeNum).Temp = 23.0; + tower.checkMassFlowAndLoad(*state, myLoad, flagToReturn); + EXPECT_TRUE(flagToReturn); + EXPECT_NEAR(expectedPower, tower.BasinHeaterPower, allowedTolerance); + EXPECT_NEAR(expectedTemp, tower.OutletWaterTemp, allowedTolerance); + EXPECT_NEAR(0.0, tower.FanPower, allowedTolerance); + EXPECT_NEAR(0.0, tower.airFlowRateRatio, allowedTolerance); + EXPECT_NEAR(0.0, tower.Qactual, allowedTolerance); + + // Test 3: Mass flow rate and myLoad are both ok--nothing changes, power does not get calculated here + flagToReturn = false; + myLoad = 1000.0; + state->dataEnvrn->OutDryBulbTemp = 27.0; + tower.WaterMassFlowRate = 0.5; + tower.BasinHeaterPowerFTempDiff = 1.0; + tower.BasinHeaterSchedulePtr = 0; + tower.BasinHeaterSetPointTemp = 25.0; + tower.BasinHeaterPower = 3.0; + expectedPower = 3.0; + tower.checkMassFlowAndLoad(*state, myLoad, flagToReturn); + EXPECT_FALSE(flagToReturn); + EXPECT_NEAR(expectedPower, tower.BasinHeaterPower, allowedTolerance); +} + } // namespace EnergyPlus From 8d8fec6187a832ee6e360ceee8c8027434c8d6ee Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Fri, 9 Aug 2024 15:53:06 -0500 Subject: [PATCH 099/164] Space IV-ZoneRefrigerationDoorMixing --- src/EnergyPlus/HeatBalanceAirManager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index 870f2f35162..8467d62d731 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -3803,7 +3803,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err int AlphaNum = 2; int Zone1Num = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->Zone); int space1Num = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->space); - if ((Zone1Num == 0) && (space1Num==0)) { + if ((Zone1Num == 0) && (space1Num == 0)) { ShowSevereError(state, format("{}{}=\"{}\", invalid (not found) {}=\"{}\".", RoutineName, @@ -3819,7 +3819,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err ++AlphaNum; // 3 int Zone2Num = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->Zone); int space2Num = Util::FindItemInList(cAlphaArgs(AlphaNum), state.dataHeatBal->space); - if ((Zone2Num == 0) && (space2Num==0)) { + if ((Zone2Num == 0) && (space2Num == 0)) { ShowSevereError(state, format("{}{}=\"{}\", invalid (not found) {}=\"{}\".", RoutineName, From 2a966e9e96060b379b51fbcd5e7891b92ec688e3 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Fri, 9 Aug 2024 16:54:43 -0500 Subject: [PATCH 100/164] Space IV-ZoneCoolTowerShower --- .../src/overview/group-airflow.tex | 4 +- idd/Energy+.idd.in | 5 +- src/EnergyPlus/CoolTower.cc | 46 ++++++++++++++----- src/EnergyPlus/CoolTower.hh | 4 +- 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-airflow.tex b/doc/input-output-reference/src/overview/group-airflow.tex index db393414b97..157e30f5a91 100644 --- a/doc/input-output-reference/src/overview/group-airflow.tex +++ b/doc/input-output-reference/src/overview/group-airflow.tex @@ -1965,9 +1965,9 @@ \subsubsection{Inputs}\label{inputs-8-002} This field is the name of the schedule that denotes whether the cooltower can run during a given time period. A schedule value greater than 0 (usually 1 is used) indicates that the cooltower is available and can be on during the time period. A value less than or equal to 0 (usually 0 is used) denotes that the cooltower is not available and must be off for the time period. If this field is blank, the schedule has values of 1 for all time periods. -\paragraph{Field: Zone Name}\label{field-zone-name-6} +\paragraph{Field: Zone or Space Name}\label{field-zone-name-6} -This field is the name of the zone (ref: Zone) and attaches a particular cooltower statement to a thermal zone in the building. +This field is the name of the zone (ref: Zone) or space the cooltower is attached to. \paragraph{Field: Water Supply Storage Tank Name}\label{field-water-supply-storage-tank-name} diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index a3ebbedd817..1d4e673dd17 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -24795,7 +24795,7 @@ ZoneCoolTower:Shower, \memo A cooltower (sometimes referred to as a wind tower or a shower cooling tower) \memo models passive downdraught evaporative cooling (PDEC) that is designed to capture the \memo wind at the top of a tower and cool the outdoor air using water evaporation before - \memo delivering it to a space. + \memo delivering it to a zone (or space). A1, \field Name \required-field A2, \field Availability Schedule Name @@ -24803,10 +24803,11 @@ ZoneCoolTower:Shower, \note If this field is blank, the system is always available. \type object-list \object-list ScheduleNames - A3, \field Zone Name + A3, \field Zone or Space Name \required-field \type object-list \object-list ZoneNames + \object-list SpaceNames A4, \field Water Supply Storage Tank Name \note In case of stand alone tank or underground water, leave this input blank \type object-list diff --git a/src/EnergyPlus/CoolTower.cc b/src/EnergyPlus/CoolTower.cc index 4991348103a..b0d46af320f 100644 --- a/src/EnergyPlus/CoolTower.cc +++ b/src/EnergyPlus/CoolTower.cc @@ -198,9 +198,10 @@ namespace CoolTower { } } - state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZoneName = state.dataIPShortCut->cAlphaArgs(3); // Name of zone where cooltower is serving state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), Zone); - if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr == 0) { + state.dataCoolTower->CoolTowerSys(CoolTowerNum).spacePtr = + Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(3), state.dataHeatBal->space); + if ((state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr == 0) && (state.dataCoolTower->CoolTowerSys(CoolTowerNum).spacePtr == 0)) { if (lAlphaBlanks(3)) { ShowSevereError(state, format("{}=\"{}\" invalid {} is required but input is blank.", @@ -216,6 +217,9 @@ namespace CoolTower { state.dataIPShortCut->cAlphaArgs(3))); } ErrorsFound = true; + } else if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr == 0) { + state.dataCoolTower->CoolTowerSys(CoolTowerNum).ZonePtr = + state.dataHeatBal->space(state.dataCoolTower->CoolTowerSys(CoolTowerNum).spacePtr).zoneNum; } state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterSupplyName = state.dataIPShortCut->cAlphaArgs(4); // Name of water storage tank @@ -627,7 +631,12 @@ namespace CoolTower { thisZoneHB.MCPTC = 0.0; thisZoneHB.MCPC = 0.0; thisZoneHB.CTMFL = 0.0; - + if ((state.dataHeatBal->doSpaceHeatBalance) && (state.dataCoolTower->CoolTowerSys(CoolTowerNum).spacePtr > 0)) { + auto &thisSpaceHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataCoolTower->CoolTowerSys(CoolTowerNum).spacePtr); + thisSpaceHB.MCPTC = 0.0; + thisSpaceHB.MCPC = 0.0; + thisSpaceHB.CTMFL = 0.0; + } if (ScheduleManager::GetCurrentScheduleValue(state, state.dataCoolTower->CoolTowerSys(CoolTowerNum).SchedPtr) > 0.0) { // check component operation if (state.dataEnvrn->WindSpeed < MinWindSpeed || state.dataEnvrn->WindSpeed > MaxWindSpeed) continue; @@ -707,22 +716,35 @@ namespace CoolTower { AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, OutletTemp, OutletHumRat); // Outlet air density CVF_ZoneNum = state.dataCoolTower->CoolTowerSys(CoolTowerNum).ActualAirVolFlowRate * ScheduleManager::GetCurrentScheduleValue(state, state.dataCoolTower->CoolTowerSys(CoolTowerNum).SchedPtr); - thisZoneHB.MCPC = CVF_ZoneNum * AirDensity * AirSpecHeat; - thisZoneHB.MCPTC = thisZoneHB.MCPC * OutletTemp; - thisZoneHB.CTMFL = thisZoneHB.MCPC / AirSpecHeat; + Real64 thisMCPC = CVF_ZoneNum * AirDensity * AirSpecHeat; + Real64 thisMCPTC = thisMCPC * OutletTemp; + Real64 thisCTMFL = thisMCPC / AirSpecHeat; + Real64 thisZT = thisZoneHB.ZT; + Real64 thisAirHumRat = thisZoneHB.airHumRat; + thisZoneHB.MCPC = thisMCPC; + thisZoneHB.MCPTC = thisMCPTC; + thisZoneHB.CTMFL = thisCTMFL; + if ((state.dataHeatBal->doSpaceHeatBalance) && (state.dataCoolTower->CoolTowerSys(CoolTowerNum).spacePtr > 0)) { + auto &thisSpaceHB = + state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataCoolTower->CoolTowerSys(CoolTowerNum).spacePtr); + thisSpaceHB.MCPC = thisMCPC; + thisSpaceHB.MCPTC = thisMCPTC; + thisSpaceHB.CTMFL = thisCTMFL; + thisZT = thisSpaceHB.ZT; + thisAirHumRat = thisSpaceHB.airHumRat; + } - state.dataCoolTower->CoolTowerSys(CoolTowerNum).SenHeatPower = thisZoneHB.MCPC * std::abs(thisZoneHB.ZT - OutletTemp); - state.dataCoolTower->CoolTowerSys(CoolTowerNum).LatHeatPower = CVF_ZoneNum * std::abs(thisZoneHB.airHumRat - OutletHumRat); + state.dataCoolTower->CoolTowerSys(CoolTowerNum).SenHeatPower = thisMCPC * std::abs(thisZT - OutletTemp); + state.dataCoolTower->CoolTowerSys(CoolTowerNum).LatHeatPower = CVF_ZoneNum * std::abs(thisAirHumRat - OutletHumRat); state.dataCoolTower->CoolTowerSys(CoolTowerNum).OutletTemp = OutletTemp; state.dataCoolTower->CoolTowerSys(CoolTowerNum).OutletHumRat = OutletHumRat; state.dataCoolTower->CoolTowerSys(CoolTowerNum).AirVolFlowRate = CVF_ZoneNum; - state.dataCoolTower->CoolTowerSys(CoolTowerNum).AirMassFlowRate = thisZoneHB.CTMFL; - state.dataCoolTower->CoolTowerSys(CoolTowerNum).AirVolFlowRateStd = thisZoneHB.CTMFL / state.dataEnvrn->StdRhoAir; + state.dataCoolTower->CoolTowerSys(CoolTowerNum).AirMassFlowRate = thisCTMFL; + state.dataCoolTower->CoolTowerSys(CoolTowerNum).AirVolFlowRateStd = thisCTMFL / state.dataEnvrn->StdRhoAir; state.dataCoolTower->CoolTowerSys(CoolTowerNum).InletDBTemp = Zone(ZoneNum).OutDryBulbTemp; state.dataCoolTower->CoolTowerSys(CoolTowerNum).InletWBTemp = Zone(ZoneNum).OutWetBulbTemp; state.dataCoolTower->CoolTowerSys(CoolTowerNum).InletHumRat = state.dataEnvrn->OutHumRat; - state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterConsumpRate = - (std::abs(InletHumRat - OutletHumRat) * thisZoneHB.CTMFL) / RhoWater; + state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterConsumpRate = (std::abs(InletHumRat - OutletHumRat) * thisCTMFL) / RhoWater; state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterStarvMakeupRate = 0.0; // initialize -- calc in update state.dataCoolTower->CoolTowerSys(CoolTowerNum).PumpElecPower = state.dataCoolTower->CoolTowerSys(CoolTowerNum).RatedPumpPower * PumpPartLoadRat; diff --git a/src/EnergyPlus/CoolTower.hh b/src/EnergyPlus/CoolTower.hh index 47cc18415a6..0353f82aa39 100644 --- a/src/EnergyPlus/CoolTower.hh +++ b/src/EnergyPlus/CoolTower.hh @@ -85,9 +85,9 @@ namespace CoolTower { std::string Name; // The component name std::string CompType; // Type of component std::string Schedule; // Available schedule - std::string ZoneName; // Name of zone the component is serving int SchedPtr = 0; // Index to schedule - int ZonePtr = 0; // Point to this zone + int ZonePtr = 0; // Index to zone + int spacePtr = 0; // Index to space (if applicable) int PumpSchedPtr = 0; // Index to schedule for water pump FlowCtrl FlowCtrlType = FlowCtrl::Invalid; // Type of cooltower operation WaterSupplyMode CoolTWaterSupplyMode = WaterSupplyMode::FromMains; // Type of water source From eb0559cfae2b87e10cebd141c73c0f7549eb2ee7 Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Fri, 9 Aug 2024 17:17:23 -0500 Subject: [PATCH 101/164] 10634 Mass Flow to Zero Corrected an issue with the fix where the mass flow rate when the load was zero was still positive in the defect idf when it should be zero. This is now corrected. --- src/EnergyPlus/CondenserLoopTowers.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index ad8a019c43a..642f21bf2e9 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -6469,6 +6469,7 @@ namespace CondenserLoopTowers { if (std::abs(MyLoad) <= HVAC::SmallLoad) { // tower doesn't need to do anything this->OutletWaterTemp = state.dataLoopNodes->Node(this->WaterInletNodeNum).Temp; + this->WaterMassFlowRate = 0.0; this->FanPower = 0.0; this->airFlowRateRatio = 0.0; this->Qactual = 0.0; From cebfcb59666acdd3ac07985665962c3edde5380e Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Fri, 9 Aug 2024 19:46:38 -0500 Subject: [PATCH 102/164] Space IV-ZoneThermalChimney --- .../src/overview/group-airflow.tex | 6 +- idd/Energy+.idd.in | 104 +++++++++++------- src/EnergyPlus/ThermalChimney.cc | 104 +++++++++++++----- src/EnergyPlus/ThermalChimney.hh | 1 + 4 files changed, 140 insertions(+), 75 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-airflow.tex b/doc/input-output-reference/src/overview/group-airflow.tex index 157e30f5a91..f70b854e548 100644 --- a/doc/input-output-reference/src/overview/group-airflow.tex +++ b/doc/input-output-reference/src/overview/group-airflow.tex @@ -1518,7 +1518,7 @@ \subsection{ZoneRefrigerationDoorMixing}\label{zonerefrigerationdoormixing} ZoneRefrigerationDoorMixing is ideally suited for two zones, at least one of which is refrigerated, that exchange an equal amount of dry air. As with \hyperref[zonemixing]{ZoneMixing}, this is a simplified interzone airflow in EnergyPlus. The ZoneRefrigerationDoorMixing approach shares some features of both \hyperref[zonemixing]{ZoneMixing} and \hyperref[zonecrossmixing]{ZoneCrossMixing}. Like \hyperref[zonecrossmixing]{ZoneCrossMixing}, ZoneRefrigerationDoorMixing has an energy effect on both the source and the receiving zone, thus maintaining both the air mass and energy balances in the two zones. Unlike the other two mixing objects, ZoneRefrigerationDoorMixing always calculates the air exchange rate based on the zone temperature and relative humidity. That is, the user does not specify the air flow rate. The user can moderate the flow through a door-opening schedule. -ZoneRefrigerationDoorMixing can only be entered once for any unique pair of zones. It doesn't matter which zone is listed first and the zones will automatically switch back and forth between source and receiving zones depending upon which zone is colder. If space heat balance is active and a space name is specified for Space or Zone Name 1 or 2, then the space conditions will be used and the exchange will be with that space only. If space heat balance is active and a zone name is specified, then the aveerage zone conditions will be used, and the exchange will be proportioned to all spaces in the zone by space volume. +ZoneRefrigerationDoorMixing can only be entered once for any unique pair of zones. It doesn't matter which zone is listed first and the zones will automatically switch back and forth between source and receiving zones depending upon which zone is colder. If space heat balance is active and a space name is specified for Zone or Space Name 1 or 2, then the space conditions will be used and the exchange will be with that space only. If space heat balance is active and a zone name is specified, then the aveerage zone conditions will be used, and the exchange will be proportioned to all spaces in the zone by space volume. \subsubsection{Inputs}\label{inputs-7-003} @@ -2185,9 +2185,9 @@ \subsubsection{Inputs} This dimensionless number is the discharge coefficient of the thermal chimney. The ventilation rate enhanced by the thermal chimney is also dependent on the discharge coefficient. -\paragraph{Field: Zone \textless{}\#\textgreater{} Name}\label{field-zone-name-8} +\paragraph{Field: Zone or Space Name \textless{}\#\textgreater{}}\label{field-zone-name-8} -This field is the name of the zone (ref: Zone) to which the thermal chimney is attached. It is used in conjunction with the next three fields. Note that up to 20 sets of zone name, distance from the top of the thermal chimney to each inlet, relative ratios of air flow rates passing through each zone and cross sectional areas of each air channel inlet may be entered for a single thermal chimney if multiple zones share the common thermal chimney. +This field is the name of the zone (ref: Zone) or space to which the thermal chimney is attached. It is used in conjunction with the next three fields. Note that up to 20 sets of zone or space name, distance from the top of the thermal chimney to each inlet, relative ratios of air flow rates passing through each zone and cross sectional areas of each air channel inlet may be entered for a single thermal chimney if multiple zones or spaces share the common thermal chimney. If space heat balance is active and a space name is specified for Zone or Space Name, then the space conditions will be used and the exchange will be with that space only. If space heat balance is active and a zone name is specified, then the aveerage zone conditions will be used, and the exchange will be proportioned to all spaces in the zone by space volume. \paragraph{Field: Distance from Top of Thermal Chimney to Inlet \textless{}\#\textgreater{}}\label{field-distance-from-top-of-thermal-chimney-to-inlet} diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 1d4e673dd17..ba438f1829c 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -24866,11 +24866,11 @@ ZoneThermalChimney, \memo A thermal chimney is a vertical shaft utilizing solar radiation to enhance natural \memo ventilation. It consists of an absorber wall, air gap and glass cover with high solar \memo transmissivity. - \min-fields 10 + \min-fields 10 A1, \field Name \required-field A2, \field Zone Name - \note Name of zone that is the thermal chimney + \note Name of zone that is the thermal chimney. \required-field \type object-list \object-list ZoneNames @@ -24894,16 +24894,17 @@ ZoneThermalChimney, \minimum 0 \maximum 1 \default 0.8 - A4, \field Zone 1 Name + A4, \field Zone or Space Name 1 \required-field \type object-list \object-list ZoneNames + \object-list SpaceNames N4, \field Distance from Top of Thermal Chimney to Inlet 1 \required-field \units m \type real \minimum 0 - N5, \field Relative Ratios of Air Flow Rates Passing through Zone 1 + N5, \field Relative Ratios of Air Flow Rates Passing through Inlet 1 \type real \minimum 0 \maximum 1 @@ -24913,14 +24914,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A5, \field Zone 2 Name + A5, \field Zone or Space Name 2 \type object-list \object-list ZoneNames + \object-list SpaceNames N7, \field Distance from Top of Thermal Chimney to Inlet 2 \units m \type real \minimum 0 - N8, \field Relative Ratios of Air Flow Rates Passing through Zone 2 + N8, \field Relative Ratios of Air Flow Rates Passing through Inlet 2 \type real \minimum 0 \maximum 1 @@ -24928,14 +24930,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A6, \field Zone 3 Name + A6, \field Zone or Space Name 3 \type object-list \object-list ZoneNames + \object-list SpaceNames N10, \field Distance from Top of Thermal Chimney to Inlet 3 \units m \type real \minimum 0 - N11, \field Relative Ratios of Air Flow Rates Passing through Zone 3 + N11, \field Relative Ratios of Air Flow Rates Passing through Inlet 3 \type real \minimum 0 \maximum 1 @@ -24943,14 +24946,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A7, \field Zone 4 Name + A7, \field Zone or Space Name 4 \type object-list \object-list ZoneNames + \object-list SpaceNames N13, \field Distance from Top of Thermal Chimney to Inlet 4 \units m \type real \minimum 0 - N14, \field Relative Ratios of Air Flow Rates Passing through Zone 4 + N14, \field Relative Ratios of Air Flow Rates Passing through Inlet 4 \type real \minimum 0 \maximum 1 @@ -24958,14 +24962,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A8, \field Zone 5 Name + A8, \field Zone or Space Name 5 \type object-list \object-list ZoneNames + \object-list SpaceNames N16, \field Distance from Top of Thermal Chimney to Inlet 5 \units m \type real \minimum 0 - N17, \field Relative Ratios of Air Flow Rates Passing through Zone 5 + N17, \field Relative Ratios of Air Flow Rates Passing through Inlet 5 \type real \minimum 0 \maximum 1 @@ -24973,14 +24978,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A9, \field Zone 6 Name + A9, \field Zone or Space Name 6 \type object-list \object-list ZoneNames + \object-list SpaceNames N19, \field Distance from Top of Thermal Chimney to Inlet 6 \units m \type real \minimum 0 - N20, \field Relative Ratios of Air Flow Rates Passing through Zone 6 + N20, \field Relative Ratios of Air Flow Rates Passing through Inlet 6 \type real \minimum 0 \maximum 1 @@ -24988,14 +24994,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A10, \field Zone 7 Name + A10, \field Zone or Space Name 7 \type object-list \object-list ZoneNames + \object-list SpaceNames N22, \field Distance from Top of Thermal Chimney to Inlet 7 \units m \type real \minimum 0 - N23, \field Relative Ratios of Air Flow Rates Passing through Zone 7 + N23, \field Relative Ratios of Air Flow Rates Passing through Inlet 7 \type real \minimum 0 \maximum 1 @@ -25003,14 +25010,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A11, \field Zone 8 Name + A11, \field Zone or Space Name 8 \type object-list \object-list ZoneNames + \object-list SpaceNames N25, \field Distance from Top of Thermal Chimney to Inlet 8 \units m \type real \minimum 0 - N26, \field Relative Ratios of Air Flow Rates Passing through Zone 8 + N26, \field Relative Ratios of Air Flow Rates Passing through Inlet 8 \type real \minimum 0 \maximum 1 @@ -25018,14 +25026,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A12, \field Zone 9 Name + A12, \field Zone or Space Name 9 \type object-list \object-list ZoneNames + \object-list SpaceNames N28, \field Distance from Top of Thermal Chimney to Inlet 9 \units m \type real \minimum 0 - N29, \field Relative Ratios of Air Flow Rates Passing through Zone 9 + N29, \field Relative Ratios of Air Flow Rates Passing through Inlet 9 \type real \minimum 0 \maximum 1 @@ -25033,14 +25042,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A13, \field Zone 10 Name + A13, \field Zone or Space Name 10 \type object-list \object-list ZoneNames + \object-list SpaceNames N31, \field Distance from Top of Thermal Chimney to Inlet 10 \units m \type real \minimum 0 - N32, \field Relative Ratios of Air Flow Rates Passing through Zone 10 + N32, \field Relative Ratios of Air Flow Rates Passing through Inlet 10 \type real \minimum 0 \maximum 1 @@ -25048,14 +25058,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A14, \field Zone 11 Name + A14, \field Zone or Space Name 11 \type object-list \object-list ZoneNames + \object-list SpaceNames N34, \field Distance from Top of Thermal Chimney to Inlet 11 \units m \type real \minimum 0 - N35, \field Relative Ratios of Air Flow Rates Passing through Zone 11 + N35, \field Relative Ratios of Air Flow Rates Passing through Inlet 11 \type real \minimum 0 \maximum 1 @@ -25063,14 +25074,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A15, \field Zone 12 Name + A15, \field Zone or Space Name 12 \type object-list \object-list ZoneNames + \object-list SpaceNames N37, \field Distance from Top of Thermal Chimney to Inlet 12 \units m \type real \minimum 0 - N38, \field Relative Ratios of Air Flow Rates Passing through Zone 12 + N38, \field Relative Ratios of Air Flow Rates Passing through Inlet 12 \type real \minimum 0 \maximum 1 @@ -25078,14 +25090,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A16, \field Zone 13 Name + A16, \field Zone or Space Name 13 \type object-list \object-list ZoneNames + \object-list SpaceNames N40, \field Distance from Top of Thermal Chimney to Inlet 13 \units m \type real \minimum 0 - N41, \field Relative Ratios of Air Flow Rates Passing through Zone 13 + N41, \field Relative Ratios of Air Flow Rates Passing through Inlet 13 \type real \minimum 0 \maximum 1 @@ -25093,14 +25106,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A17, \field Zone 14 Name + A17, \field Zone or Space Name 14 \type object-list \object-list ZoneNames + \object-list SpaceNames N43, \field Distance from Top of Thermal Chimney to Inlet 14 \units m \type real \minimum 0 - N44, \field Relative Ratios of Air Flow Rates Passing through Zone 14 + N44, \field Relative Ratios of Air Flow Rates Passing through Inlet 14 \type real \minimum 0 \maximum 1 @@ -25108,14 +25122,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A18, \field Zone 15 Name + A18, \field Zone or Space Name 15 \type object-list \object-list ZoneNames + \object-list SpaceNames N46, \field Distance from Top of Thermal Chimney to Inlet 15 \units m \type real \minimum 0 - N47, \field Relative Ratios of Air Flow Rates Passing through Zone 15 + N47, \field Relative Ratios of Air Flow Rates Passing through Inlet 15 \type real \minimum 0 \maximum 1 @@ -25123,14 +25138,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A19, \field Zone 16 Name + A19, \field Zone or Space Name 16 \type object-list \object-list ZoneNames + \object-list SpaceNames N49, \field Distance from Top of Thermal Chimney to Inlet 16 \units m \type real \minimum 0 - N50, \field Relative Ratios of Air Flow Rates Passing through Zone 16 + N50, \field Relative Ratios of Air Flow Rates Passing through Inlet 16 \type real \minimum 0 \maximum 1 @@ -25138,14 +25154,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A20, \field Zone 17 Name + A20, \field Zone or Space Name 17 \type object-list \object-list ZoneNames + \object-list SpaceNames N52, \field Distance from Top of Thermal Chimney to Inlet 17 \units m \type real \minimum 0 - N53, \field Relative Ratios of Air Flow Rates Passing through Zone 17 + N53, \field Relative Ratios of Air Flow Rates Passing through Inlet 17 \type real \minimum 0 \maximum 1 @@ -25153,14 +25170,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A21, \field Zone 18 Name + A21, \field Zone or Space Name 18 \type object-list \object-list ZoneNames + \object-list SpaceNames N55, \field Distance from Top of Thermal Chimney to Inlet 18 \units m \type real \minimum 0 - N56, \field Relative Ratios of Air Flow Rates Passing through Zone 18 + N56, \field Relative Ratios of Air Flow Rates Passing through Inlet 18 \type real \minimum 0 \maximum 1 @@ -25168,14 +25186,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A22, \field Zone 19 Name + A22, \field Zone or Space Name 19 \type object-list \object-list ZoneNames + \object-list SpaceNames N58, \field Distance from Top of Thermal Chimney to Inlet 19 \units m \type real \minimum 0 - N59, \field Relative Ratios of Air Flow Rates Passing through Zone 19 + N59, \field Relative Ratios of Air Flow Rates Passing through Inlet 19 \type real \minimum 0 \maximum 1 @@ -25183,14 +25202,15 @@ ZoneThermalChimney, \units m2 \type real \minimum 0 - A23, \field Zone 20 Name + A23, \field Zone or Space Name 20 \type object-list \object-list ZoneNames + \object-list SpaceNames N61, \field Distance from Top of Thermal Chimney to Inlet 20 \units m \type real \minimum 0 - N62, \field Relative Ratios of Air Flow Rates Passing through Zone 20 + N62, \field Relative Ratios of Air Flow Rates Passing through Inlet 20 \type real \minimum 0 \maximum 1 diff --git a/src/EnergyPlus/ThermalChimney.cc b/src/EnergyPlus/ThermalChimney.cc index ba0329917ed..58b236f75c5 100644 --- a/src/EnergyPlus/ThermalChimney.cc +++ b/src/EnergyPlus/ThermalChimney.cc @@ -264,6 +264,7 @@ namespace ThermalChimney { state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib = NumAlpha - 3; state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr.allocate(state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib); + state.dataThermalChimneys->ThermalChimneySys(Loop).spacePtr.allocate(state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib); state.dataThermalChimneys->ThermalChimneySys(Loop).ZoneName.allocate(state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib); state.dataThermalChimneys->ThermalChimneySys(Loop).DistanceThermChimInlet.allocate( state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib); @@ -277,6 +278,15 @@ namespace ThermalChimney { state.dataThermalChimneys->ThermalChimneySys(Loop).ZoneName(TCZoneNum) = state.dataIPShortCut->cAlphaArgs(TCZoneNum + 3); state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum) = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(TCZoneNum + 3), state.dataHeatBal->Zone); + if (state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum) == 0) { + int spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(TCZoneNum + 3), state.dataHeatBal->space); + if (spaceNum > 0) { + state.dataThermalChimneys->ThermalChimneySys(Loop).spacePtr(TCZoneNum) = spaceNum; + int zoneNum = state.dataHeatBal->space(spaceNum).zoneNum; + state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum) = zoneNum; + } + } + state.dataThermalChimneys->ThermalChimneySys(Loop).DistanceThermChimInlet(TCZoneNum) = state.dataIPShortCut->rNumericArgs(3 * TCZoneNum + 1); state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) = @@ -676,8 +686,6 @@ namespace ThermalChimney { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: // Real local vaiables - int TCZoneNumCounter; - int TCZoneNum; Real64 minorW; // width of enclosure (narrow dimension) Real64 majorW; // width of major surface Real64 TempmajorW; @@ -771,28 +779,41 @@ namespace ThermalChimney { DischargeCoeffTC = state.dataThermalChimneys->ThermalChimneySys(Loop).DischargeCoeff; AirInletCrossArea = 0.0; - for (TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { + for (int TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { AirInletCrossArea += state.dataThermalChimneys->ThermalChimneySys(Loop).EachAirInletCrossArea(TCZoneNum); } RoomAirTemp = 0.0; - for (TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { - TCZoneNumCounter = state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum); - RoomAirTemp += state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) * - state.dataZoneTempPredictorCorrector->zoneHeatBalance(TCZoneNumCounter).MAT; + for (int TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { + int tcSpacePtr = state.dataThermalChimneys->ThermalChimneySys(Loop).spacePtr(TCZoneNum); + if ((state.dataHeatBal->doSpaceHeatBalance) && (tcSpacePtr > 0)) { + RoomAirTemp += state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) * + state.dataZoneTempPredictorCorrector->spaceHeatBalance(tcSpacePtr).MAT; + } else { + int tcZonePtr = state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum); + RoomAirTemp += state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) * + state.dataZoneTempPredictorCorrector->zoneHeatBalance(tcZonePtr).MAT; + } } RoomAirTemp += Constant::Kelvin; Process1 = 0.0; Process2 = 0.0; - for (TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { - TCZoneNumCounter = state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum); - auto &thisTCZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(TCZoneNumCounter); - Process1 += PsyHFnTdbW(thisTCZoneHB.MAT, thisTCZoneHB.airHumRat) * - state.dataThermalChimneys->ThermalChimneySys(Loop).DistanceThermChimInlet(TCZoneNum) * + for (int TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { + int tcZonePtr = state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum); + auto &thisTCZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(tcZonePtr); + Real64 tcZoneMAT = thisTCZoneHB.MAT; + Real64 tcZoneHumRat = thisTCZoneHB.airHumRat; + int tcSpacePtr = state.dataThermalChimneys->ThermalChimneySys(Loop).spacePtr(TCZoneNum); + if ((state.dataHeatBal->doSpaceHeatBalance) && (tcSpacePtr > 0)) { + auto &thisTCspaceHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(tcSpacePtr); + tcZoneMAT = thisTCspaceHB.MAT; + tcZoneHumRat = thisTCspaceHB.airHumRat; + } + Real64 tcZoneEnth = PsyHFnTdbW(tcZoneMAT, tcZoneHumRat); + Process1 += tcZoneEnth * state.dataThermalChimneys->ThermalChimneySys(Loop).DistanceThermChimInlet(TCZoneNum) * state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum); - Process2 += state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) * - PsyHFnTdbW(state.dataZoneTempPredictorCorrector->zoneHeatBalance(TCZoneNumCounter).MAT, thisTCZoneHB.airHumRat); + Process2 += state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum) * tcZoneEnth; } OverallThermalChimLength = Process1 / Process2; @@ -888,23 +909,39 @@ namespace ThermalChimney { } // Now assignment of the overall mass flow rate into each zone - for (TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { - TCZoneNumCounter = state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum); - auto &thisTCZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(TCZoneNumCounter); - AirDensity = PsyRhoAirFnPbTdbW(state, - state.dataEnvrn->OutBaroPress, - state.dataZoneTempPredictorCorrector->zoneHeatBalance(TCZoneNumCounter).MAT, - thisTCZoneHB.airHumRat); - CpAir = PsyCpAirFnW(thisTCZoneHB.airHumRat); - thisTCZoneHB.MCPThermChim = + for (int TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { + int tcZonePtr = state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum); + auto &thisTCZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(tcZonePtr); + Real64 tcZoneMAT = thisTCZoneHB.MAT; + Real64 tcZoneHumRat = thisTCZoneHB.airHumRat; + int tcSpacePtr = state.dataThermalChimneys->ThermalChimneySys(Loop).spacePtr(TCZoneNum); + if ((state.dataHeatBal->doSpaceHeatBalance) && (tcSpacePtr > 0)) { + auto &thisTCSpaceHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(tcSpacePtr); + tcZoneMAT = thisTCSpaceHB.MAT; + tcZoneHumRat = thisTCSpaceHB.airHumRat; + } + // ToDo - Let this persist to avoid diffs, but should be local + AirDensity = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->OutBaroPress, tcZoneMAT, tcZoneHumRat); + CpAir = PsyCpAirFnW(tcZoneHumRat); + Real64 thisMCPThermChim = TCVolumeAirFlowRate * AirDensity * CpAir * state.dataThermalChimneys->ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum); - if (thisTCZoneHB.MCPThermChim <= 0.0) { - thisTCZoneHB.MCPThermChim = 0.0; + if (thisMCPThermChim <= 0.0) { + thisMCPThermChim = 0.0; + } + Real64 thisThermChimAMFL = thisMCPThermChim / CpAir; + Real64 thisMCPTThermChim = thisMCPThermChim * state.dataHeatBal->Zone(tcZonePtr).OutDryBulbTemp; // Only zones have an ODB temp value + thisTCZoneHB.MCPThermChim = thisMCPThermChim; + thisTCZoneHB.ThermChimAMFL = thisThermChimAMFL; + thisTCZoneHB.MCPTThermChim = thisMCPTThermChim; + if ((state.dataHeatBal->doSpaceHeatBalance) && (tcSpacePtr > 0)) { + auto &thisTCSpaceHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(tcSpacePtr); + thisTCSpaceHB.MCPThermChim = thisMCPThermChim; + thisTCSpaceHB.ThermChimAMFL = thisThermChimAMFL; + thisTCSpaceHB.MCPTThermChim = thisMCPTThermChim; } - thisTCZoneHB.ThermChimAMFL = thisTCZoneHB.MCPThermChim / CpAir; - thisTCZoneHB.MCPTThermChim = thisTCZoneHB.MCPThermChim * state.dataHeatBal->Zone(TCZoneNumCounter).OutDryBulbTemp; } + // ToDo - This should probably be using AirDensityThermalChim here instead of AirDensity which is leftover from the last inlet zone thisZoneHB.MCPThermChim = TCVolumeAirFlowRate * AirDensity * CpAir; if (thisZoneHB.MCPThermChim <= 0.0) { thisZoneHB.MCPThermChim = 0.0; @@ -922,12 +959,19 @@ namespace ThermalChimney { state.dataThermalChimneys->ThermalChimneyReport(Loop).OutletAirTempThermalChim = ThermChimSubTemp(NTC) - Constant::Kelvin; if (GetCurrentScheduleValue(state, state.dataThermalChimneys->ThermalChimneySys(Loop).SchedPtr) <= 0.0) { - for (TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { - TCZoneNumCounter = state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum); - auto &thisTCZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(TCZoneNumCounter); + for (int TCZoneNum = 1; TCZoneNum <= state.dataThermalChimneys->ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { + int tcZonePtr = state.dataThermalChimneys->ThermalChimneySys(Loop).ZonePtr(TCZoneNum); + auto &thisTCZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(tcZonePtr); thisTCZoneHB.MCPThermChim = 0.0; thisTCZoneHB.ThermChimAMFL = 0.0; thisTCZoneHB.MCPTThermChim = 0.0; + int tcSpacePtr = state.dataThermalChimneys->ThermalChimneySys(Loop).spacePtr(TCZoneNum); + if ((state.dataHeatBal->doSpaceHeatBalance) && (tcSpacePtr > 0)) { + auto &thisTCSpaceHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(tcSpacePtr); + thisTCSpaceHB.MCPThermChim = 0.0; + thisTCSpaceHB.ThermChimAMFL = 0.0; + thisTCSpaceHB.MCPTThermChim = 0.0; + } } thisZoneHB.MCPThermChim = 0.0; thisZoneHB.ThermChimAMFL = 0.0; diff --git a/src/EnergyPlus/ThermalChimney.hh b/src/EnergyPlus/ThermalChimney.hh index 4731ca007e5..797594f6756 100644 --- a/src/EnergyPlus/ThermalChimney.hh +++ b/src/EnergyPlus/ThermalChimney.hh @@ -79,6 +79,7 @@ namespace ThermalChimney { bool EMSOverrideOn; // if true then EMS is requesting to override Real64 EMSAirFlowRateValue; // value EMS is setting for air flow rate Array1D_int ZonePtr; + Array1D_int spacePtr; Array1D_string ZoneName; Array1D DistanceThermChimInlet; Array1D RatioThermChimAirFlow; From 57a62ce0f254af5eff21cb8da05e41d3245ae7a7 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Sun, 11 Aug 2024 23:42:18 -0500 Subject: [PATCH 103/164] Space IV-SpaceHVACZoneReturnMixer --- .../overview/group-simulation-parameters.tex | 2 +- .../src/overview/group-zone-equipment.tex | 44 ++- idd/Energy+.idd.in | 53 +++ idd/schema/modify_schema.py | 1 + src/EnergyPlus/DataLoopNode.hh | 1 + src/EnergyPlus/DataZoneEquipment.cc | 302 +++++++++++++++++- src/EnergyPlus/DataZoneEquipment.hh | 21 ++ src/EnergyPlus/ZoneEquipmentManager.cc | 184 +---------- src/EnergyPlus/ZoneEquipmentManager.hh | 6 - .../unit/ZoneEquipmentManager.unit.cc | 10 +- 10 files changed, 430 insertions(+), 194 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-simulation-parameters.tex b/doc/input-output-reference/src/overview/group-simulation-parameters.tex index f26cd185a3e..133543c557a 100644 --- a/doc/input-output-reference/src/overview/group-simulation-parameters.tex +++ b/doc/input-output-reference/src/overview/group-simulation-parameters.tex @@ -473,7 +473,7 @@ \subsubsection{Inputs}\label{inputs-8-023} If yes, space-level heat balance will be calculated and reported during sizing, and space sizing results will be reported along with zone sizing results. If no, then only zone-level heat balance will be calculated. This field defaults to No. For zones with more than one space, the zone sizing results are calculated for the whole zone and represent the coincident peak for the spaces in the zone. Note that space heat balance is not supported for \hyperref[inputs-hm]{HybridModel:Zone}, \hyperref[roomairmodeltype]{RoomAirModelType} other than Mixing, \hyperref[heatbalancealgorithm]{HeatBalanceAlgorithm} MoisturePenetrationDepthConductionTransferFunction and CombinedHeatAndMoistureFiniteElement. \paragraph{Field: Do Space Heat Balance for Simulation}\label{field-do-space-heat-balance-simulation} -If yes, space-level heat balance will be calculated and reported during the simulation. If no, then only zone-level heat balance will be calculated. This field defaults to No. When this field is Yes, optional SpaceHVAC objects may be used to distribute zone HVAC equipment output to the spaces in the zone. See \hyperref[spacehvacequipmentconnections]{SpaceHVAC:EquipmentConnections}, \hyperref[spacehvaczoneequipmentsplitter]{SpaceHVAC:ZoneEquipmentSplitter} and \hyperref[spacehvaczoneequipmentmixer]{SpaceHVAC:ZoneEquipmentMixer}. +If yes, space-level heat balance will be calculated and reported during the simulation. If no, then only zone-level heat balance will be calculated. This field defaults to No. When this field is Yes, optional SpaceHVAC objects may be used to distribute zone HVAC equipment output to the spaces in the zone. See \hyperref[spacehvacequipmentconnections]{SpaceHVAC:EquipmentConnections}, \hyperref[spacehvaczoneequipmentsplitter]{SpaceHVAC:ZoneEquipmentSplitter}, \hyperref[spacehvaczoneequipmentmixer]{SpaceHVAC:ZoneEquipmentMixer} and \hyperref[spacehvaczonereturnmixer]{SpaceHVAC:ZoneReturnMixer}. And, a default IDF example is shown below: diff --git a/doc/input-output-reference/src/overview/group-zone-equipment.tex b/doc/input-output-reference/src/overview/group-zone-equipment.tex index 32ffff31da9..600d3c236ef 100644 --- a/doc/input-output-reference/src/overview/group-zone-equipment.tex +++ b/doc/input-output-reference/src/overview/group-zone-equipment.tex @@ -388,7 +388,7 @@ \subsubsection{Inputs}\label{inputs-2-048} \subsection{SpaceHVAC:EquipmentConnections}\label{spacehvacequipmentconnections} If HVAC equipment is modeled at the Space level for one or more zones, the SpaceHVAC:EquipmentConnections statement defines the node connections to a space. Any space modeled with SpaceHVAC:EquipmentConnections will have its own air temperature and humidity ratio, and surfaces and internal gains in the zone will interact with the space conditions. -Note that all nodes mentioned in the SpaceHVAC:EquipmentConnections input must be unique. That is, all nodes in all the SpaceHVAC:EquipmentConnections statements referenced by the ``Space Air Inlet Nodes'', ``Space Air Exhaust Nodes'', ``Space Air Node Name'' and ``Space Return Air Node Name'' cannot have any node name appearing more than once. Unlike ZoneHVAC:EquipmentConnections, there is no equipment list. Equipment is connected to spaces using \hyperref[spacehvaczoneequipmentsplitter]{SpaceHVAC:ZoneEquipmentSplitter} and \hyperref[spacehvaczoneequipmentmixer]{SpaceHVAC:ZoneEquipmentMixer} as shown in Figure \ref{fig:space-hvac-equipment-connections}. If any space in a zone has a SpaceHVAC:EquipmentConnections object, then all spaces in that zone must have one, even if they are not served by any HVAC equipment. SpaceHVAC is only used when \hyperref[zoneairheatbalancealgorithm]{ZoneAirHeatBalanceAlgorithm} ``Do Space Heat Balance for Simulation'' is Yes. +Note that all nodes mentioned in the SpaceHVAC:EquipmentConnections input must be unique. That is, all nodes in all the SpaceHVAC:EquipmentConnections statements referenced by the ``Space Air Inlet Nodes'', ``Space Air Exhaust Nodes'', ``Space Air Node Name'' and ``Space Return Air Node Name'' cannot have any node name appearing more than once. Unlike ZoneHVAC:EquipmentConnections, there is no equipment list. Equipment is connected to spaces using \hyperref[spacehvaczoneequipmentsplitter]{SpaceHVAC:ZoneEquipmentSplitter}, \hyperref[spacehvaczoneequipmentmixer]{SpaceHVAC:ZoneEquipmentMixer} and \hyperref[spacehvaczonereturnmixer]{SpaceHVAC:ZoneReturnMixer} as shown in Figure \ref{fig:space-hvac-equipment-connections}. If any space in a zone has a SpaceHVAC:EquipmentConnections object, then all spaces in that zone must have one, even if they are not served by any HVAC equipment. SpaceHVAC is only used when \hyperref[zoneairheatbalancealgorithm]{ZoneAirHeatBalanceAlgorithm} ``Do Space Heat Balance for Simulation'' is Yes. \begin{figure}[hbtp] \centering @@ -581,3 +581,45 @@ \subsubsection{Inputs}\label{inputs-1-052-seqmixer} Zone 5-Remainder In Node; !- Space 3 Node Name \end{lstlisting} +\subsection{SpaceHVAC:ZoneReturnMixer}\label{spacehvaczonereturnmixer} + +The SpaceHVAC:ZoneReturnMixer object mixes the airflow from one or more space return air nodes to a zone return air node. + +\subsubsection{Inputs}\label{inputs-1-052-sretmixer} + +\paragraph{Field: Name}\label{field-sretmixer-name-015} + +Name of the mixer object. + +\paragraph{Field: Zone Name}\label{field-sretmixer-zone-name} + +Name of the zone which contains the return air node. + +\paragraph{Field: Zone Return Air Node Name}\label{field-sretmixer-zone-return-air-node-name} + +Name of the zone return air node that is supplied by the Space Return Air Nodes. + +\paragraph{Field: Space \textless{}x\textgreater{} Name}\label{field-sretmixer-space-name} + +Name of a space to supply air to this zone return air node. + +\paragraph{Field: Space \textless{}x\textgreater{} Return Air Node Name}\label{field-sretmixer-space-node-name} + +The name of a \hyperref[spacehvacequipmentconnections]{SpaceHVAC:EquipmentConnections} Return Air Node Name that sends airflow to the Zone Return Air Node. + +An example of this statement in an IDF is: + +\begin{lstlisting} + + SpaceHVAC:ZoneReturnMixer, + Zone 5 Return Mixer, !- Name + Zone 5, !- Zone Name + Zone 5 Out Node, !- Zone Return Air Node Name + Space 5 Office, !- Space 1 Name + Space 5 Office Return Node, !- Space 1 Return Air Node Name + Space 5 Conference, !- Space 2 Name + Space 5 Conference Return Node, !- Space 2 Return Air Node Name + Zone 5-Remainder, !- Space 3 Name + Zone 5-Remainder Return Node; !- Space 3 Return Air Node Name +\end{lstlisting} + diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index ba438f1829c..47002a4c942 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -50820,6 +50820,59 @@ SpaceHVAC:ZoneEquipmentMixer, \note Matches a SpaceHVAC:EquipmentConnections Exhaust Node Name \type node +SpaceHVAC:ZoneReturnMixer, + \extensible:2 + \memo Mixes the return airflow from one or more Spaces into a zone return node. + \memo All spaces in the zone must also have a SpaceHVAC:EquipmentConnections object. + \memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Sizing" = Yes. + \min-fields 5 + A1, \field Name + \required-field + \reference SpaceMixerNames + A2, \field Zone Name + \note Must be a controlled zone which has a ZoneHVAC:EquipmentConfiguration object. + \required-field + \type object-list + \object-list ZoneNames + A3, \field Zone Return Air Node Name + \note The zone return air node will be mixed from the spaces. + \note Must match a Zone Return Air Node for this zone. + \required-field + \type node + A4, \field Space 1 Name + \begin-extensible + \required-field + \type object-list + \object-list SpaceNames + A5, \field Space 1 Return Air Node Name + \note Matches a SpaceHVAC:EquipmentConnections Return Air Node Name + \required-field + \type node + A6, \field Space 2 Name + \type object-list + \object-list SpaceNames + A7, \field Space 3 Return Air Node Name + \note Matches a SpaceHVAC:EquipmentConnections Return Air Node Name + \type node + A8, \field Space 3 Name + \type object-list + \object-list SpaceNames + A9, \field Space 3 Return Air Node Name + \note Matches a SpaceHVAC:EquipmentConnections Return Air Node Name + \type node + A10,\field Space 4 Name + \type object-list + \object-list SpaceNames + A11,\field Space 4 Return Air Node Name + \note Matches a SpaceHVAC:EquipmentConnections Return Air Node Name + \type node + A12,\field Space 5 Name + \type object-list + \object-list SpaceNames + A13;\field Space 5 Return Air Node Name + \note Matches a SpaceHVAC:EquipmentConnections Return Air Node Name + \type node + \group Fans !*****************AIR LOOP COMPONENTS********************* Fan:SystemModel, diff --git a/idd/schema/modify_schema.py b/idd/schema/modify_schema.py index 3d9e631facf..04b59c37f6e 100644 --- a/idd/schema/modify_schema.py +++ b/idd/schema/modify_schema.py @@ -139,6 +139,7 @@ def isInt(s): 'ZoneHVAC:EquipmentList': 'equipment', 'SpaceHVAC:ZoneEquipmentSplitter': 'spaces', 'SpaceHVAC:ZoneEquipmentMixer': 'spaces', + 'SpaceHVAC:ZoneReturnMixer': 'spaces', 'AvailabilityManagerAssignmentList': 'managers', 'Table:IndependentVariable': 'values', 'Table:IndependentVariableList': 'independent_variables', diff --git a/src/EnergyPlus/DataLoopNode.hh b/src/EnergyPlus/DataLoopNode.hh index 4b809c59911..6d409b27070 100644 --- a/src/EnergyPlus/DataLoopNode.hh +++ b/src/EnergyPlus/DataLoopNode.hh @@ -427,6 +427,7 @@ namespace DataLoopNode { SpaceHVACEquipmentConnections, SpaceHVACZoneEquipmentSplitter, SpaceHVACZoneEquipmentMixer, + SpaceHVACZoneReturnMixer, Num, }; diff --git a/src/EnergyPlus/DataZoneEquipment.cc b/src/EnergyPlus/DataZoneEquipment.cc index 45fbab68918..d4c6087da87 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -552,7 +552,44 @@ void GetZoneEquipmentData(EnergyPlusData &state) processZoneEquipMixerInput(state, CurrentModuleObject, zoneNum, objectSchemaProps, objectFields, thisZeqMixer); } - } // end loop over zone equipment splitters + } // end loop over zone equipment mixers + + CurrentModuleObject = "SpaceHVAC:ZoneReturnMixer"; + instances = ip->epJSON.find(CurrentModuleObject); + if (instances != ip->epJSON.end()) { + auto const &objectSchemaProps = ip->getObjectSchemaProps(state, CurrentModuleObject); + auto &instancesValue = instances.value(); + int numZoneRetMixers = instancesValue.size(); + state.dataZoneEquip->zoneReturnMixer.resize(numZoneRetMixers); + int zeqRetNum = -1; + for (auto instance = instancesValue.begin(); instance != instancesValue.end(); ++instance) { + ++zeqRetNum; + auto const &objectFields = instance.value(); + auto &thisZretMixer = state.dataZoneEquip->zoneReturnMixer[zeqRetNum]; + thisZretMixer.Name = Util::makeUPPER(instance.key()); + thisZretMixer.spaceEquipType = DataLoopNode::ConnectionObjectType::SpaceHVACZoneReturnMixer; + ip->markObjectAsUsed(CurrentModuleObject, instance.key()); + + std::string zoneName = ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_name"); + int zoneNum = Util::FindItemInList(zoneName, state.dataHeatBal->Zone); + if (zoneNum == 0) { + ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, CurrentModuleObject, thisZretMixer.Name)); + ShowContinueError(state, format("..Zone Name={} not found, remaining items for this object not processed.", zoneName)); + state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; + continue; + } + if (!state.dataHeatBal->Zone(zoneNum).IsControlled) { + ShowSevereError(state, format("{}{}=\"{}\"", RoutineName, CurrentModuleObject, thisZretMixer.Name)); + ShowContinueError( + state, + format("..Zone Name={} is not a controlled zone. A ZoneHVAC:EquipmentConfiguration object is required for this zone.", zoneName)); + state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; + continue; + } + + processZoneReturnMixerInput(state, CurrentModuleObject, zoneNum, objectSchemaProps, objectFields, thisZretMixer); + } + } // end loop over zone return mixers CurrentModuleObject = "AirLoopHVAC:SupplyPath"; for (int PathNum = 1; PathNum <= state.dataZoneEquip->NumSupplyAirPaths; ++PathNum) { @@ -1368,6 +1405,93 @@ void processZoneEquipMixerInput(EnergyPlusData &state, } } +void processZoneReturnMixerInput(EnergyPlusData &state, + std::string_view zeqMixerModuleObject, + int const zoneNum, + InputProcessor::json const objectSchemaProps, + InputProcessor::json const objectFields, + DataZoneEquipment::ZoneReturnMixer &thisZretMixer) + +{ + static constexpr std::string_view RoutineName("processZoneReturnMixerInput: "); // include trailing blank space + auto &ip = state.dataInputProcessing->inputProcessor; + bool objectIsParent = true; + thisZretMixer.zoneReturnNodeNum = GetOnlySingleNode(state, + ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_return_air_node_name"), + state.dataZoneEquip->GetZoneEquipmentDataErrorsFound, + thisZretMixer.spaceEquipType, + thisZretMixer.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + objectIsParent); + // Check zone return nodes + bool found = false; + auto &thisZoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(zoneNum); + for (int retNodeNum : thisZoneEquipConfig.ReturnNode) { + if (thisZretMixer.zoneReturnNodeNum == retNodeNum) { + found = true; + break; + } + } + if (!found) { + ShowSevereError(state, format("{}{}={}", RoutineName, zeqMixerModuleObject, thisZretMixer.Name)); + ShowContinueError(state, + format("Zone Equipment Return Air Node Name={} is not a return air node for ZoneHVAC:EquipmentConnections={}.", + state.dataLoopNodes->NodeID(thisZretMixer.zoneReturnNodeNum), + thisZoneEquipConfig.ZoneName)); + state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; + } + + auto extensibles = objectFields.find("spaces"); + auto const &extensionSchemaProps = objectSchemaProps["spaces"]["items"]["properties"]; + if (extensibles != objectFields.end()) { + auto &extensiblesArray = extensibles.value(); + int const numSpaces = extensiblesArray.size(); + thisZretMixer.spaces.resize(numSpaces); + int spaceCount = -1; + for (auto &extensibleInstance : extensiblesArray) { + ++spaceCount; + auto &thisZeqSpace = thisZretMixer.spaces[spaceCount]; + std::string const spaceName = ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_name"); + thisZeqSpace.spaceIndex = Util::FindItemInList(spaceName, state.dataHeatBal->space); + if (thisZeqSpace.spaceIndex == 0) { + ShowSevereError(state, format("{}{}={}", RoutineName, zeqMixerModuleObject, thisZretMixer.Name)); + ShowContinueError(state, format("Space Name={} not found.", spaceName)); + state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; + } else { + thisZeqSpace.spaceNodeNum = + GetOnlySingleNode(state, + ip->getAlphaFieldValue(extensibleInstance, extensionSchemaProps, "space_return_air_node_name"), + state.dataZoneEquip->GetZoneEquipmentDataErrorsFound, + thisZretMixer.spaceEquipType, + thisZretMixer.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Inlet, + NodeInputManager::CompFluidStream::Primary, + objectIsParent); + // Check space return nodes + bool found = false; + auto &thisSpaceEquipConfig = state.dataZoneEquip->spaceEquipConfig(thisZeqSpace.spaceIndex); + for (int retNodeNum : thisSpaceEquipConfig.ReturnNode) { + if (thisZeqSpace.spaceNodeNum == retNodeNum) { + found = true; + break; + } + } + if (!found) { + ShowSevereError(state, format("{}{}={}", RoutineName, zeqMixerModuleObject, thisZretMixer.Name)); + ShowContinueError(state, + format("Space Return Air Node Name={} is not a return air node for SpaceHVAC:EquipmentConnections={}.", + state.dataLoopNodes->NodeID(thisZeqSpace.spaceNodeNum), + thisSpaceEquipConfig.ZoneName)); + state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; + } + } + } + } +} + bool CheckZoneEquipmentList(EnergyPlusData &state, std::string_view const ComponentType, // Type of component std::string_view const ComponentName, // Name of component @@ -1743,6 +1867,8 @@ void ZoneEquipmentSplitterMixer::size(EnergyPlusData &state) this->Name)); break; default: + // If method is not set, then return + return; break; } @@ -2057,4 +2183,178 @@ void EquipConfiguration::hvacTimeStepInit(EnergyPlusData &state, bool FirstHVACI } } +void EquipConfiguration::calcReturnFlows(EnergyPlusData &state, + Real64 &ExpTotalReturnMassFlow, // Expected total return air mass flow rate + Real64 &FinalTotalReturnMassFlow // Final total return air mass flow rate +) +{ + int numRetNodes = this->NumReturnNodes; + Real64 totReturnFlow = 0.0; // Total flow to all return nodes in the zone (kg/s) + Real64 totVarReturnFlow = + 0.0; // Total variable return flow, for return nodes connected to an airloop with an OA system or not with specified flow (kg/s) + Real64 returnSchedFrac = ScheduleManager::GetCurrentScheduleValue(state, this->ReturnFlowSchedPtrNum); + this->FixedReturnFlow = false; + FinalTotalReturnMassFlow = 0.0; + this->TotAvailAirLoopOA = 0.0; + + // Set initial flow rate for each return node + for (int returnNum = 1; returnNum <= numRetNodes; ++returnNum) { + int retNode = this->ReturnNode(returnNum); + + if (retNode > 0) { + Real64 returnNodeMassFlow = 0.0; + auto &retNodeData(state.dataLoopNodes->Node(retNode)); + + int inletNum = this->ReturnNodeInletNum(returnNum); // which inlet node matches this return node (same airloop) + int ADUNum = 0; + if (inletNum > 0) ADUNum = this->InletNodeADUNum(inletNum); + int airLoop = this->ReturnNodeAirLoopNum(returnNum); + Real64 airLoopReturnFrac = 1.0; + if (airLoop > 0) { + // Establish corresponding airloop inlet(s) mass flow rate and set return node max/min/maxavail + Real64 inletMassFlow = 0.0; + int maxMinNodeNum = 0; + auto &thisAirLoopFlow(state.dataAirLoop->AirLoopFlow(airLoop)); + if (ADUNum > 0) { + // Zone return node could carry supply flow to zone without leaks plus any induced flow from plenum (but don't include other + // secondary flows from exhaust nodes) + inletMassFlow = state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateZSup + + state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRatePlenInd; + maxMinNodeNum = state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum; + } else if (inletNum > 0) { + // If not connected to an ADU, then use the inlet node flow + inletMassFlow = state.dataLoopNodes->Node(this->InletNode(inletNum)).MassFlowRate; + maxMinNodeNum = this->InletNode(inletNum); + } + if (maxMinNodeNum > 0) { + auto const &maxMinNodeData(state.dataLoopNodes->Node(maxMinNodeNum)); + retNodeData.MassFlowRateMax = maxMinNodeData.MassFlowRateMax; + retNodeData.MassFlowRateMin = maxMinNodeData.MassFlowRateMin; + retNodeData.MassFlowRateMaxAvail = maxMinNodeData.MassFlowRateMaxAvail; + } else { + auto const &zoneNodeData(state.dataLoopNodes->Node(this->ZoneNode)); + retNodeData.MassFlowRateMax = zoneNodeData.MassFlowRateMax; + retNodeData.MassFlowRateMin = zoneNodeData.MassFlowRateMin; + retNodeData.MassFlowRateMaxAvail = zoneNodeData.MassFlowRateMaxAvail; + } + + airLoopReturnFrac = thisAirLoopFlow.DesReturnFrac; + if (state.dataAirSystemsData->PrimaryAirSystems(airLoop).OASysExists && (thisAirLoopFlow.MaxOutAir > 0.0)) { + // Set return flow as fraction of matching inlet node flow if there is an OA system and available OA flow > 0.0 + returnNodeMassFlow = airLoopReturnFrac * inletMassFlow; + this->TotAvailAirLoopOA += thisAirLoopFlow.MaxOutAir; + } else { + // Set return flow to matching inlet node flow + returnNodeMassFlow = inletMassFlow; + this->FixedReturnFlow(returnNum) = true; + } + } else { + returnNodeMassFlow = 0.0; + } + + // Return node 1 is special + if (returnNum == 1) { + // Make no return air flow adjustments during sizing + if ((state.dataGlobal->DoingSizing) && numRetNodes == 1) { + returnNodeMassFlow = ExpTotalReturnMassFlow; + if (airLoop > 0) { + if (!state.dataAirSystemsData->PrimaryAirSystems(airLoop).OASysExists || + (state.dataAirLoop->AirLoopFlow(airLoop).MaxOutAir == 0.0)) { + ExpTotalReturnMassFlow = max(0.0, ExpTotalReturnMassFlow - this->ZoneExhBalanced + this->ZoneExh); + returnNodeMassFlow = ExpTotalReturnMassFlow; + } + } + } else if (!state.dataGlobal->DoingSizing) { + if (this->NumReturnFlowBasisNodes > 0) { + // Set base return air flow rate for node 1 using basis node flow rates + Real64 basisNodesMassFlow = 0.0; + for (int nodeNum = 1; nodeNum <= this->NumReturnFlowBasisNodes; ++nodeNum) { + basisNodesMassFlow += state.dataLoopNodes->Node(this->ReturnFlowBasisNode(nodeNum)).MassFlowRate; + } + returnNodeMassFlow = max(0.0, (basisNodesMassFlow * returnSchedFrac)); + this->FixedReturnFlow(returnNum) = true; + } else { + // If only 1 return node, use the standard return mass flow + if ((numRetNodes == 1) && !this->FixedReturnFlow(returnNum)) { + returnNodeMassFlow = max(0.0, (ExpTotalReturnMassFlow * returnSchedFrac * airLoopReturnFrac)); + } + } + } + } + totReturnFlow += returnNodeMassFlow; + retNodeData.MassFlowRate = returnNodeMassFlow; + retNodeData.MassFlowRateMinAvail = 0.0; + if (!this->FixedReturnFlow(returnNum)) totVarReturnFlow += returnNodeMassFlow; + } + } + + // if zone mass balance true, set to expected return flow + if (state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::AdjustmentType::NoAdjustReturnAndMixing) { + // applies zone return flow schedule multiplier + ExpTotalReturnMassFlow = returnSchedFrac * ExpTotalReturnMassFlow; + // set air flow rate for each return node + Real64 zoneTotReturnFlow = 0.0; + Real64 returnNodeMassFlow = 0.0; + for (int returnNum = 1; returnNum <= numRetNodes; ++returnNum) { + int retNode = this->ReturnNode(returnNum); + if (retNode > 0) { + if (numRetNodes == 1) { + returnNodeMassFlow = ExpTotalReturnMassFlow; + } else { // multiple return nodes + if (ExpTotalReturnMassFlow > 0.0) { + Real64 returnAdjFactor = state.dataLoopNodes->Node(retNode).MassFlowRate / ExpTotalReturnMassFlow; + returnNodeMassFlow = returnAdjFactor * ExpTotalReturnMassFlow; + } else { + returnNodeMassFlow = 0.0; + } + } + } + zoneTotReturnFlow += returnNodeMassFlow; + } + // Adjust return node flows if zone total return flow is > 0 + if (zoneTotReturnFlow > 0.0) { + for (int returnNum = 1; returnNum <= numRetNodes; ++returnNum) { + int retNode = this->ReturnNode(returnNum); + if (retNode > 0) { + if (numRetNodes == 1) { + // set it to expected return flows + state.dataLoopNodes->Node(retNode).MassFlowRate = ExpTotalReturnMassFlow; + FinalTotalReturnMassFlow = ExpTotalReturnMassFlow; + } else { // multiple return nodes, adjust nodes flow + Real64 newReturnFlow = 0.0; + Real64 returnAdjFactor = ExpTotalReturnMassFlow / zoneTotReturnFlow; + Real64 curReturnFlow = state.dataLoopNodes->Node(retNode).MassFlowRate; + newReturnFlow = curReturnFlow * returnAdjFactor; + state.dataLoopNodes->Node(retNode).MassFlowRate = newReturnFlow; + FinalTotalReturnMassFlow += newReturnFlow; + } + } + } + } else { + FinalTotalReturnMassFlow = ExpTotalReturnMassFlow; + } + } else { + // Adjust return flows if greater than expected (i.e. there is exhaust or mixing flow reducing the total available for return) + if ((totReturnFlow > ExpTotalReturnMassFlow) && (totVarReturnFlow > 0.0)) { + Real64 newReturnFlow = 0.0; + Real64 returnAdjFactor = (1 - ((totReturnFlow - ExpTotalReturnMassFlow) / totVarReturnFlow)); // Return flow adjustment factor + for (int returnNum = 1; returnNum <= numRetNodes; ++returnNum) { + int retNode = this->ReturnNode(returnNum); + Real64 curReturnFlow = state.dataLoopNodes->Node(retNode).MassFlowRate; + if (retNode > 0) { + if (!this->FixedReturnFlow(returnNum)) { + newReturnFlow = curReturnFlow * returnAdjFactor; + FinalTotalReturnMassFlow += newReturnFlow; + state.dataLoopNodes->Node(retNode).MassFlowRate = newReturnFlow; + } else { + FinalTotalReturnMassFlow += curReturnFlow; + } + } + } + } else { + FinalTotalReturnMassFlow = totReturnFlow; + } + } +} + } // namespace EnergyPlus::DataZoneEquipment diff --git a/src/EnergyPlus/DataZoneEquipment.hh b/src/EnergyPlus/DataZoneEquipment.hh index 9746958919f..af898323a1b 100644 --- a/src/EnergyPlus/DataZoneEquipment.hh +++ b/src/EnergyPlus/DataZoneEquipment.hh @@ -372,6 +372,11 @@ namespace DataZoneEquipment { void beginEnvirnInit(EnergyPlusData &state); void hvacTimeStepInit(EnergyPlusData &state, bool FirstHVACIteration); + + void calcReturnFlows(EnergyPlusData &state, + Real64 &ExpTotalReturnMassFlow, // Expected total return air mass flow rate + Real64 &FinalTotalReturnMassFlow // Final total return air mass flow rate + ); }; struct EquipmentData // data for an individual component @@ -486,6 +491,14 @@ namespace DataZoneEquipment { void setInletFlows(EnergyPlusData &state); }; + struct ZoneReturnMixer : ZoneEquipmentSplitterMixer + { + int zoneReturnNodeNum = 0; + + // void setOutletConditions(EnergyPlusData &state); + + // void setInletFlows(EnergyPlusData &state); + }; struct ControlList { // Members @@ -567,6 +580,13 @@ namespace DataZoneEquipment { InputProcessor::json const objectFields, DataZoneEquipment::ZoneEquipmentMixer &thisZeqMixer); + void processZoneReturnMixerInput(EnergyPlusData &state, + std::string_view zeqMixerModuleObject, + int const zoneNum, + InputProcessor::json const objectSchemaProps, + InputProcessor::json const objectFields, + DataZoneEquipment::ZoneReturnMixer &thisZretMixer); + bool CheckZoneEquipmentList(EnergyPlusData &state, std::string_view ComponentType, // Type of component std::string_view ComponentName, // Name of component @@ -623,6 +643,7 @@ struct DataZoneEquipmentData : BaseGlobalStruct Array1D ZoneExhaustControlSystem; // 2022-01: maybe a better name? std::vector zoneEquipSplitter; std::vector zoneEquipMixer; + std::vector zoneReturnMixer; void init_state([[maybe_unused]] EnergyPlusData &state) override { diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index ae3ecdf4cbd..3653be24fb4 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -4908,7 +4908,7 @@ void CalcZoneMassBalance(EnergyPlusData &state, bool const FirstHVACIteration) } Real64 FinalTotalReturnMassFlow = 0; - CalcZoneReturnFlows(state, ZoneNum, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); + zoneEquipConfig.calcReturnFlows(state, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); if (state.dataHeatBal->ZoneAirMassFlow.EnforceZoneMassBalance) { // set mass conservation variables massConservation.InMassFlowRate = TotInletAirMassFlowRate; @@ -4927,7 +4927,7 @@ void CalcZoneMassBalance(EnergyPlusData &state, bool const FirstHVACIteration) AdjustedTotalReturnMassFlow = min(AdjustedTotalReturnMassFlow, zoneEquipConfig.AirLoopDesSupply); } // add adjust zone return node air flow calc - CalcZoneReturnFlows(state, ZoneNum, AdjustedTotalReturnMassFlow, FinalTotalReturnMassFlow); + zoneEquipConfig.calcReturnFlows(state, AdjustedTotalReturnMassFlow, FinalTotalReturnMassFlow); massConservation.RetMassFlowRate = FinalTotalReturnMassFlow; ZoneReturnAirMassFlowRate = FinalTotalReturnMassFlow; } @@ -4944,7 +4944,7 @@ void CalcZoneMassBalance(EnergyPlusData &state, bool const FirstHVACIteration) } // add adjust zone return node air flow calculation - CalcZoneReturnFlows(state, ZoneNum, AdjustedTotalReturnMassFlow, FinalTotalReturnMassFlow); + zoneEquipConfig.calcReturnFlows(state, AdjustedTotalReturnMassFlow, FinalTotalReturnMassFlow); massConservation.RetMassFlowRate = FinalTotalReturnMassFlow; ZoneReturnAirMassFlowRate = FinalTotalReturnMassFlow; @@ -4962,7 +4962,7 @@ void CalcZoneMassBalance(EnergyPlusData &state, bool const FirstHVACIteration) } // add adjust zone return node air flow calc - CalcZoneReturnFlows(state, ZoneNum, AdjustedTotalReturnMassFlow, FinalTotalReturnMassFlow); + zoneEquipConfig.calcReturnFlows(state, AdjustedTotalReturnMassFlow, FinalTotalReturnMassFlow); massConservation.RetMassFlowRate = FinalTotalReturnMassFlow; ZoneReturnAirMassFlowRate = FinalTotalReturnMassFlow; } @@ -5094,182 +5094,6 @@ void CalcZoneMassBalance(EnergyPlusData &state, bool const FirstHVACIteration) } } -void CalcZoneReturnFlows(EnergyPlusData &state, - int const ZoneNum, - Real64 &ExpTotalReturnMassFlow, // Expected total return air mass flow rate - Real64 &FinalTotalReturnMassFlow // Final total return air mass flow rate -) -{ - auto &thisZoneEquip(state.dataZoneEquip->ZoneEquipConfig(ZoneNum)); - int numRetNodes = thisZoneEquip.NumReturnNodes; - Real64 totReturnFlow = 0.0; // Total flow to all return nodes in the zone (kg/s) - Real64 totVarReturnFlow = - 0.0; // Total variable return flow, for return nodes connected to an airloop with an OA system or not with specified flow (kg/s) - Real64 returnSchedFrac = ScheduleManager::GetCurrentScheduleValue(state, thisZoneEquip.ReturnFlowSchedPtrNum); - thisZoneEquip.FixedReturnFlow = false; - FinalTotalReturnMassFlow = 0.0; - thisZoneEquip.TotAvailAirLoopOA = 0.0; - - // Set initial flow rate for each return node - for (int returnNum = 1; returnNum <= numRetNodes; ++returnNum) { - int retNode = thisZoneEquip.ReturnNode(returnNum); - - if (retNode > 0) { - Real64 returnNodeMassFlow = 0.0; - auto &retNodeData(state.dataLoopNodes->Node(retNode)); - - int inletNum = thisZoneEquip.ReturnNodeInletNum(returnNum); // which inlet node matches this return node (same airloop) - int ADUNum = 0; - if (inletNum > 0) ADUNum = thisZoneEquip.InletNodeADUNum(inletNum); - int airLoop = thisZoneEquip.ReturnNodeAirLoopNum(returnNum); - Real64 airLoopReturnFrac = 1.0; - if (airLoop > 0) { - // Establish corresponding airloop inlet(s) mass flow rate and set return node max/min/maxavail - Real64 inletMassFlow = 0.0; - int maxMinNodeNum = 0; - auto &thisAirLoopFlow(state.dataAirLoop->AirLoopFlow(airLoop)); - if (ADUNum > 0) { - // Zone return node could carry supply flow to zone without leaks plus any induced flow from plenum (but don't include other - // secondary flows from exhaust nodes) - inletMassFlow = state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRateZSup + - state.dataDefineEquipment->AirDistUnit(ADUNum).MassFlowRatePlenInd; - maxMinNodeNum = state.dataDefineEquipment->AirDistUnit(ADUNum).OutletNodeNum; - } else if (inletNum > 0) { - // If not connected to an ADU, then use the inlet node flow - inletMassFlow = state.dataLoopNodes->Node(thisZoneEquip.InletNode(inletNum)).MassFlowRate; - maxMinNodeNum = thisZoneEquip.InletNode(inletNum); - } - if (maxMinNodeNum > 0) { - auto const &maxMinNodeData(state.dataLoopNodes->Node(maxMinNodeNum)); - retNodeData.MassFlowRateMax = maxMinNodeData.MassFlowRateMax; - retNodeData.MassFlowRateMin = maxMinNodeData.MassFlowRateMin; - retNodeData.MassFlowRateMaxAvail = maxMinNodeData.MassFlowRateMaxAvail; - } else { - auto const &zoneNodeData(state.dataLoopNodes->Node(thisZoneEquip.ZoneNode)); - retNodeData.MassFlowRateMax = zoneNodeData.MassFlowRateMax; - retNodeData.MassFlowRateMin = zoneNodeData.MassFlowRateMin; - retNodeData.MassFlowRateMaxAvail = zoneNodeData.MassFlowRateMaxAvail; - } - - airLoopReturnFrac = thisAirLoopFlow.DesReturnFrac; - if (state.dataAirSystemsData->PrimaryAirSystems(airLoop).OASysExists && (thisAirLoopFlow.MaxOutAir > 0.0)) { - // Set return flow as fraction of matching inlet node flow if there is an OA system and available OA flow > 0.0 - returnNodeMassFlow = airLoopReturnFrac * inletMassFlow; - thisZoneEquip.TotAvailAirLoopOA += thisAirLoopFlow.MaxOutAir; - } else { - // Set return flow to matching inlet node flow - returnNodeMassFlow = inletMassFlow; - thisZoneEquip.FixedReturnFlow(returnNum) = true; - } - } else { - returnNodeMassFlow = 0.0; - } - - // Return node 1 is special - if (returnNum == 1) { - // Make no return air flow adjustments during sizing - if ((state.dataGlobal->DoingSizing) && numRetNodes == 1) { - returnNodeMassFlow = ExpTotalReturnMassFlow; - if (airLoop > 0) { - if (!state.dataAirSystemsData->PrimaryAirSystems(airLoop).OASysExists || - (state.dataAirLoop->AirLoopFlow(airLoop).MaxOutAir == 0.0)) { - ExpTotalReturnMassFlow = max(0.0, ExpTotalReturnMassFlow - thisZoneEquip.ZoneExhBalanced + thisZoneEquip.ZoneExh); - returnNodeMassFlow = ExpTotalReturnMassFlow; - } - } - } else if (!state.dataGlobal->DoingSizing) { - if (thisZoneEquip.NumReturnFlowBasisNodes > 0) { - // Set base return air flow rate for node 1 using basis node flow rates - Real64 basisNodesMassFlow = 0.0; - for (int nodeNum = 1; nodeNum <= thisZoneEquip.NumReturnFlowBasisNodes; ++nodeNum) { - basisNodesMassFlow += state.dataLoopNodes->Node(thisZoneEquip.ReturnFlowBasisNode(nodeNum)).MassFlowRate; - } - returnNodeMassFlow = max(0.0, (basisNodesMassFlow * returnSchedFrac)); - thisZoneEquip.FixedReturnFlow(returnNum) = true; - } else { - // If only 1 return node, use the standard return mass flow - if ((numRetNodes == 1) && !thisZoneEquip.FixedReturnFlow(returnNum)) { - returnNodeMassFlow = max(0.0, (ExpTotalReturnMassFlow * returnSchedFrac * airLoopReturnFrac)); - } - } - } - } - totReturnFlow += returnNodeMassFlow; - retNodeData.MassFlowRate = returnNodeMassFlow; - retNodeData.MassFlowRateMinAvail = 0.0; - if (!thisZoneEquip.FixedReturnFlow(returnNum)) totVarReturnFlow += returnNodeMassFlow; - } - } - - // if zone mass balance true, set to expected return flow - if (state.dataHeatBal->ZoneAirMassFlow.ZoneFlowAdjustment != DataHeatBalance::AdjustmentType::NoAdjustReturnAndMixing) { - // applies zone return flow schedule multiplier - ExpTotalReturnMassFlow = returnSchedFrac * ExpTotalReturnMassFlow; - // set air flow rate for each return node - Real64 zoneTotReturnFlow = 0.0; - Real64 returnNodeMassFlow = 0.0; - for (int returnNum = 1; returnNum <= numRetNodes; ++returnNum) { - int retNode = thisZoneEquip.ReturnNode(returnNum); - if (retNode > 0) { - if (numRetNodes == 1) { - returnNodeMassFlow = ExpTotalReturnMassFlow; - } else { // multiple return nodes - if (ExpTotalReturnMassFlow > 0.0) { - Real64 returnAdjFactor = state.dataLoopNodes->Node(retNode).MassFlowRate / ExpTotalReturnMassFlow; - returnNodeMassFlow = returnAdjFactor * ExpTotalReturnMassFlow; - } else { - returnNodeMassFlow = 0.0; - } - } - } - zoneTotReturnFlow += returnNodeMassFlow; - } - // Adjust return node flows if zone total return flow is > 0 - if (zoneTotReturnFlow > 0.0) { - for (int returnNum = 1; returnNum <= numRetNodes; ++returnNum) { - int retNode = thisZoneEquip.ReturnNode(returnNum); - if (retNode > 0) { - if (numRetNodes == 1) { - // set it to expected return flows - state.dataLoopNodes->Node(retNode).MassFlowRate = ExpTotalReturnMassFlow; - FinalTotalReturnMassFlow = ExpTotalReturnMassFlow; - } else { // multiple return nodes, adjust nodes flow - Real64 newReturnFlow = 0.0; - Real64 returnAdjFactor = ExpTotalReturnMassFlow / zoneTotReturnFlow; - Real64 curReturnFlow = state.dataLoopNodes->Node(retNode).MassFlowRate; - newReturnFlow = curReturnFlow * returnAdjFactor; - state.dataLoopNodes->Node(retNode).MassFlowRate = newReturnFlow; - FinalTotalReturnMassFlow += newReturnFlow; - } - } - } - } else { - FinalTotalReturnMassFlow = ExpTotalReturnMassFlow; - } - } else { - // Adjust return flows if greater than expected (i.e. there is exhaust or mixing flow reducing the total available for return) - if ((totReturnFlow > ExpTotalReturnMassFlow) && (totVarReturnFlow > 0.0)) { - Real64 newReturnFlow = 0.0; - Real64 returnAdjFactor = (1 - ((totReturnFlow - ExpTotalReturnMassFlow) / totVarReturnFlow)); // Return flow adjustment factor - for (int returnNum = 1; returnNum <= numRetNodes; ++returnNum) { - int retNode = thisZoneEquip.ReturnNode(returnNum); - Real64 curReturnFlow = state.dataLoopNodes->Node(retNode).MassFlowRate; - if (retNode > 0) { - if (!thisZoneEquip.FixedReturnFlow(returnNum)) { - newReturnFlow = curReturnFlow * returnAdjFactor; - FinalTotalReturnMassFlow += newReturnFlow; - state.dataLoopNodes->Node(retNode).MassFlowRate = newReturnFlow; - } else { - FinalTotalReturnMassFlow += curReturnFlow; - } - } - } - } else { - FinalTotalReturnMassFlow = totReturnFlow; - } - } -} - void CalcZoneInfiltrationFlows(EnergyPlusData &state, int const ZoneNum, // current zone index Real64 &ZoneReturnAirMassFlowRate // zone total zone return air mass flow rate diff --git a/src/EnergyPlus/ZoneEquipmentManager.hh b/src/EnergyPlus/ZoneEquipmentManager.hh index 25e10c8b2f2..b1114a23688 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.hh +++ b/src/EnergyPlus/ZoneEquipmentManager.hh @@ -212,12 +212,6 @@ namespace ZoneEquipmentManager { void CalcZoneMassBalance(EnergyPlusData &state, bool FirstHVACIteration); - void CalcZoneReturnFlows(EnergyPlusData &state, - int ZoneNum, - Real64 &ExpTotalReturnMassFlow, // Expected total return air mass flow rate - Real64 &FinalTotalReturnMassFlow // Final total return air mass flow rate - ); - void CalcZoneInfiltrationFlows(EnergyPlusData &state, int ZoneNum, // current zone index Real64 &ZoneReturnAirMassFlowRate // zone total zone return air mass flow rate diff --git a/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc b/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc index 7dcaa240cb5..8f27f0bfe7d 100644 --- a/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc +++ b/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc @@ -555,7 +555,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_CalcZoneMassBalanceTest2) Real64 StdTotalReturnMassFlow = 0.0; Real64 FinalTotalReturnMassFlow = 0.0; - CalcZoneReturnFlows(*state, ZoneNum, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); + state->dataZoneEquip->ZoneEquipConfig(ZoneNum).calcReturnFlows(*state, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); EXPECT_EQ(FinalTotalReturnMassFlow, 0.0); EXPECT_EQ(state->dataLoopNodes->Node(returnNode1).MassFlowRate, 0.0); EXPECT_EQ(state->dataLoopNodes->Node(returnNode2).MassFlowRate, 0.0); @@ -572,7 +572,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_CalcZoneMassBalanceTest2) StdTotalReturnMassFlow = 0.0; FinalTotalReturnMassFlow = 0.0; - CalcZoneReturnFlows(*state, ZoneNum, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); + state->dataZoneEquip->ZoneEquipConfig(ZoneNum).calcReturnFlows(*state, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); EXPECT_EQ(FinalTotalReturnMassFlow, 6.0); EXPECT_EQ(state->dataLoopNodes->Node(returnNode1).MassFlowRate, 2.0); EXPECT_EQ(state->dataLoopNodes->Node(returnNode2).MassFlowRate, 1.0); @@ -792,7 +792,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_CalcZoneMassBalanceTest4) Real64 StdTotalReturnMassFlow = 0.0; Real64 FinalTotalReturnMassFlow = 0.0; - CalcZoneReturnFlows(*state, ZoneNum, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); + state->dataZoneEquip->ZoneEquipConfig(ZoneNum).calcReturnFlows(*state, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); EXPECT_EQ(FinalTotalReturnMassFlow, 0.0); EXPECT_EQ(state->dataLoopNodes->Node(returnNode1).MassFlowRate, 0.0); EXPECT_EQ(state->dataLoopNodes->Node(returnNode2).MassFlowRate, 0.0); @@ -809,7 +809,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_CalcZoneMassBalanceTest4) StdTotalReturnMassFlow = 6.0; FinalTotalReturnMassFlow = 0.0; - CalcZoneReturnFlows(*state, ZoneNum, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); + state->dataZoneEquip->ZoneEquipConfig(ZoneNum).calcReturnFlows(*state, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); EXPECT_EQ(FinalTotalReturnMassFlow, 5.9); EXPECT_EQ(state->dataLoopNodes->Node(returnNode1).MassFlowRate, 2.0); EXPECT_EQ(state->dataLoopNodes->Node(returnNode2).MassFlowRate, 0.9); @@ -832,7 +832,7 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_CalcZoneMassBalanceTest4) StdTotalReturnMassFlow = 6.0; FinalTotalReturnMassFlow = 0.0; - CalcZoneReturnFlows(*state, ZoneNum, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); + state->dataZoneEquip->ZoneEquipConfig(ZoneNum).calcReturnFlows(*state, StdTotalReturnMassFlow, FinalTotalReturnMassFlow); EXPECT_EQ(FinalTotalReturnMassFlow, 6.0); EXPECT_EQ(state->dataLoopNodes->Node(returnNode1).MassFlowRate, 2.0); EXPECT_EQ(state->dataLoopNodes->Node(returnNode2).MassFlowRate, 1.0); From 21527bbccdb7925c8c82a455e2a19025fa72dbc0 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 12 Aug 2024 11:04:07 +0200 Subject: [PATCH 104/164] Expose CLIPLINE and write a simple unit test that shows the NaN occurring --- src/EnergyPlus/SolarShading.hh | 2 ++ tst/EnergyPlus/unit/SolarShading.unit.cc | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/EnergyPlus/SolarShading.hh b/src/EnergyPlus/SolarShading.hh index 5e3d62e5f41..f91a571901b 100644 --- a/src/EnergyPlus/SolarShading.hh +++ b/src/EnergyPlus/SolarShading.hh @@ -136,6 +136,8 @@ namespace SolarShading { void CLIP(EnergyPlusData &state, int const NVT, Array1D &XVT, Array1D &YVT, Array1D &ZVT); + void CLIPLINE(Real64 &x0, Real64 &x1, Real64 &y0, Real64 &y1, Real64 maxX, Real64 minX, Real64 maxY, Real64 minY, bool &visible, bool &rev); + void CTRANS(EnergyPlusData &state, int const NS, // Surface number whose vertex coordinates are being transformed int const NGRS, // Base surface number for surface NS diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index aa28eb96a4a..cee697e0f17 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -6204,3 +6204,25 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest6) } #endif } + +TEST_F(EnergyPlusFixture, CLIPLINE_Throw) +{ + Real64 const minX = 2.0; + Real64 const maxX = 8.0; + Real64 const minY = 3.0; + Real64 const maxY = 6.0; + + Real64 x0 = maxX; + Real64 x1 = maxX; + Real64 y0 = 4.5; + Real64 y1 = 1.0; + bool visible = false; + bool rev = false; + + EXPECT_NO_THROW(CLIPLINE(x0, x1, y0, y1, maxX, minX, maxY, minY, visible, rev)); + + EXPECT_DOUBLE_EQ(maxX, x0); + EXPECT_DOUBLE_EQ(4.5, y0); + EXPECT_DOUBLE_EQ(maxX, x1); + EXPECT_DOUBLE_EQ(minY, y1); // This is NaN +} From 55edc57aaa613b97adb66654030868213d5ee86e Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 12 Aug 2024 11:06:58 +0200 Subject: [PATCH 105/164] Complete unit test for CLIPLINE --- tst/EnergyPlus/unit/SolarShading.unit.cc | 269 ++++++++++++++++++++++- 1 file changed, 265 insertions(+), 4 deletions(-) diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index cee697e0f17..302a684be5b 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -6207,10 +6207,10 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_GetShadowingInputTest6) TEST_F(EnergyPlusFixture, CLIPLINE_Throw) { - Real64 const minX = 2.0; - Real64 const maxX = 8.0; - Real64 const minY = 3.0; - Real64 const maxY = 6.0; + Real64 constexpr minX = 2.0; + Real64 constexpr maxX = 8.0; + Real64 constexpr minY = 3.0; + Real64 constexpr maxY = 6.0; Real64 x0 = maxX; Real64 x1 = maxX; @@ -6226,3 +6226,264 @@ TEST_F(EnergyPlusFixture, CLIPLINE_Throw) EXPECT_DOUBLE_EQ(maxX, x1); EXPECT_DOUBLE_EQ(minY, y1); // This is NaN } + +TEST_F(EnergyPlusFixture, CLIPLINE_Full) +{ + Real64 constexpr minX = 2.0; + Real64 constexpr maxX = 8.0; + Real64 constexpr minY = 3.0; + Real64 constexpr maxY = 6.0; + + Real64 constexpr below_x = 0.0; + Real64 constexpr center_x = 5.0; + Real64 constexpr greater_x = 10.0; + + Real64 constexpr below_y = 1.0; + Real64 constexpr center_y = 4.5; + Real64 constexpr greater_y = 9.0; + + struct Point + { + Real64 x = 0.0; + Real64 y = 0.0; + }; + + struct Line + { + Point p0{}; + Point p1{}; + }; + + struct TestCase + { + Line line_ori; + bool visible = false; + Line line_new{}; // Only defined if visible + }; + + auto testclipline = [&maxX, &minX, &maxY, &minY](const TestCase &t) { + Real64 x0 = t.line_ori.p0.x; + Real64 y0 = t.line_ori.p0.y; + + Real64 x1 = t.line_ori.p1.x; + Real64 y1 = t.line_ori.p1.y; + + std::string const msg = fmt::format("From ({}, {}) to ({}, {})", t.line_ori.p0.x, t.line_ori.p0.y, t.line_ori.p1.x, t.line_ori.p1.y); + + bool visible = false; + bool rev = false; + CLIPLINE(x0, x1, y0, y1, maxX, minX, maxY, minY, visible, rev); + if (rev) { + std::swap(x0, x1); + std::swap(y0, y1); + } + if (t.visible) { + EXPECT_TRUE(visible) << msg; + EXPECT_DOUBLE_EQ(t.line_new.p0.x, x0) << msg; + EXPECT_DOUBLE_EQ(t.line_new.p0.y, y0) << msg; + EXPECT_DOUBLE_EQ(t.line_new.p1.x, x1) << msg; + EXPECT_DOUBLE_EQ(t.line_new.p1.y, y1) << msg; + } else { + EXPECT_FALSE(visible) << msg; + EXPECT_DOUBLE_EQ(t.line_ori.p0.x, x0) << msg; + EXPECT_DOUBLE_EQ(t.line_ori.p0.y, y0) << msg; + EXPECT_DOUBLE_EQ(t.line_ori.p1.x, x1) << msg; + EXPECT_DOUBLE_EQ(t.line_ori.p1.y, y1) << msg; + } + }; + + constexpr std::array test_cases{{ + // From 0 to 3 + TestCase{Line{Point{below_x, below_y}, Point{below_x, center_y}}, false}, + // From 0 to 6 + TestCase{Line{Point{below_x, below_y}, Point{below_x, greater_y}}, false}, + // From 0 to 1 + TestCase{Line{Point{below_x, below_y}, Point{center_x, below_y}}, false}, + // From 0 to 4 + TestCase{Line{Point{below_x, below_y}, Point{center_x, center_y}}, true, Line{Point{2.8571428571428568, minY}, Point{center_x, center_y}}}, + // From 0 to 7 + TestCase{Line{Point{below_x, below_y}, Point{center_x, greater_y}}, true, Line{Point{minX, 4.2}, Point{3.125, maxY}}}, + // From 0 to 2 + TestCase{Line{Point{below_x, below_y}, Point{greater_x, below_y}}, false}, + // From 0 to 5 + TestCase{ + Line{Point{below_x, below_y}, Point{greater_x, center_y}}, true, Line{Point{5.7142857142857135, minY}, Point{maxX, 3.8000000000000003}}}, + // From 0 to 8 + TestCase{Line{Point{below_x, below_y}, Point{greater_x, greater_y}}, true, Line{Point{2.5, minY}, Point{6.25, maxY}}}, + // From 3 to 0 + TestCase{Line{Point{below_x, center_y}, Point{below_x, below_y}}, false}, + // From 3 to 6 + TestCase{Line{Point{below_x, center_y}, Point{below_x, greater_y}}, false}, + // From 3 to 1 + TestCase{ + Line{Point{below_x, center_y}, Point{center_x, below_y}}, true, Line{Point{minX, 3.0999999999999996}, Point{2.142857142857143, minY}}}, + // From 3 to 4 + TestCase{Line{Point{below_x, center_y}, Point{center_x, center_y}}, true, Line{Point{minX, center_y}, Point{center_x, center_y}}}, + // From 3 to 7 + TestCase{Line{Point{below_x, center_y}, Point{center_x, greater_y}}, false}, + // From 3 to 2 + TestCase{Line{Point{below_x, center_y}, Point{greater_x, below_y}}, true, Line{Point{minX, 3.8}, Point{4.285714285714286, minY}}}, + // From 3 to 5 + TestCase{Line{Point{below_x, center_y}, Point{greater_x, center_y}}, true, Line{Point{minX, center_y}, Point{maxX, center_y}}}, + // From 3 to 8 + TestCase{Line{Point{below_x, center_y}, Point{greater_x, greater_y}}, true, Line{Point{minX, 5.4}, Point{3.333333333333333, maxY}}}, + // From 6 to 0 + TestCase{Line{Point{below_x, greater_y}, Point{below_x, below_y}}, false}, + // From 6 to 3 + TestCase{Line{Point{below_x, greater_y}, Point{below_x, center_y}}, false}, + // From 6 to 1 + TestCase{Line{Point{below_x, greater_y}, Point{center_x, below_y}}, true, Line{Point{minX, 5.8}, Point{3.75, minY}}}, + // From 6 to 4 + TestCase{Line{Point{below_x, greater_y}, Point{center_x, center_y}}, true, Line{Point{3.333333333333333, maxY}, Point{center_x, center_y}}}, + // From 6 to 7 + TestCase{Line{Point{below_x, greater_y}, Point{center_x, greater_y}}, false}, + // From 6 to 2 + TestCase{Line{Point{below_x, greater_y}, Point{greater_x, below_y}}, true, Line{Point{3.75, maxY}, Point{7.5, minY}}}, + // From 6 to 5 + TestCase{Line{Point{below_x, greater_y}, Point{greater_x, center_y}}, true, Line{Point{6.666666666666666, maxY}, Point{maxX, 5.4}}}, + // From 6 to 8 + TestCase{Line{Point{below_x, greater_y}, Point{greater_x, greater_y}}, false}, + // From 1 to 0 + TestCase{Line{Point{center_x, below_y}, Point{below_x, below_y}}, false}, + // From 1 to 3 + TestCase{Line{Point{center_x, below_y}, Point{below_x, center_y}}, true, Line{Point{2.1428571428571432, minY}, Point{minX, 3.1}}}, + // From 1 to 6 + TestCase{Line{Point{center_x, below_y}, Point{below_x, greater_y}}, true, Line{Point{3.75, minY}, Point{minX, 5.8}}}, + // From 1 to 4 + TestCase{Line{Point{center_x, below_y}, Point{center_x, center_y}}, true, Line{Point{center_x, minY}, Point{center_x, center_y}}}, + // From 1 to 7 + TestCase{Line{Point{center_x, below_y}, Point{center_x, greater_y}}, true, Line{Point{center_x, minY}, Point{center_x, maxY}}}, + // From 1 to 2 + TestCase{Line{Point{center_x, below_y}, Point{greater_x, below_y}}, false}, + // From 1 to 5 + TestCase{Line{Point{center_x, below_y}, Point{greater_x, center_y}}, true, Line{Point{7.857142857142857, minY}, Point{maxX, 3.1}}}, + // From 1 to 8 + TestCase{Line{Point{center_x, below_y}, Point{greater_x, greater_y}}, true, Line{Point{6.25, minY}, Point{maxX, 5.8}}}, + // From 4 to 0 + TestCase{Line{Point{center_x, center_y}, Point{below_x, below_y}}, true, Line{Point{center_x, center_y}, Point{2.857142857142857, minY}}}, + // From 4 to 3 + TestCase{Line{Point{center_x, center_y}, Point{below_x, center_y}}, true, Line{Point{center_x, center_y}, Point{minX, center_y}}}, + // From 4 to 6 + TestCase{Line{Point{center_x, center_y}, Point{below_x, greater_y}}, true, Line{Point{center_x, center_y}, Point{3.3333333333333335, maxY}}}, + // From 4 to 1 + TestCase{Line{Point{center_x, center_y}, Point{center_x, below_y}}, true, Line{Point{center_x, center_y}, Point{center_x, minY}}}, + // From 4 to 7 + TestCase{Line{Point{center_x, center_y}, Point{center_x, greater_y}}, true, Line{Point{center_x, center_y}, Point{center_x, maxY}}}, + // From 4 to 2 + TestCase{Line{Point{center_x, center_y}, Point{greater_x, below_y}}, true, Line{Point{center_x, center_y}, Point{7.142857142857142, minY}}}, + // From 4 to 5 + TestCase{Line{Point{center_x, center_y}, Point{greater_x, center_y}}, true, Line{Point{center_x, center_y}, Point{maxX, center_y}}}, + // From 4 to 8 + TestCase{Line{Point{center_x, center_y}, Point{greater_x, greater_y}}, true, Line{Point{center_x, center_y}, Point{6.666666666666666, maxY}}}, + // From 7 to 0 + TestCase{Line{Point{center_x, greater_y}, Point{below_x, below_y}}, true, Line{Point{3.125, maxY}, Point{minX, 4.2}}}, + // From 7 to 3 + TestCase{Line{Point{center_x, greater_y}, Point{below_x, center_y}}, false}, + // From 7 to 6 + TestCase{Line{Point{center_x, greater_y}, Point{below_x, greater_y}}, false}, + // From 7 to 1 + TestCase{Line{Point{center_x, greater_y}, Point{center_x, below_y}}, true, Line{Point{center_x, maxY}, Point{center_x, minY}}}, + // From 7 to 4 + TestCase{Line{Point{center_x, greater_y}, Point{center_x, center_y}}, true, Line{Point{center_x, maxY}, Point{center_x, center_y}}}, + // From 7 to 2 + TestCase{Line{Point{center_x, greater_y}, Point{greater_x, below_y}}, true, Line{Point{6.875, maxY}, Point{maxX, 4.2}}}, + // From 7 to 5 + TestCase{Line{Point{center_x, greater_y}, Point{greater_x, center_y}}, false}, + // From 7 to 8 + TestCase{Line{Point{center_x, greater_y}, Point{greater_x, greater_y}}, false}, + // From 2 to 0 + TestCase{Line{Point{greater_x, below_y}, Point{below_x, below_y}}, false}, + // From 2 to 3 + TestCase{ + Line{Point{greater_x, below_y}, Point{below_x, center_y}}, true, Line{Point{4.2857142857142865, minY}, Point{minX, 3.8000000000000003}}}, + // From 2 to 6 + TestCase{Line{Point{greater_x, below_y}, Point{below_x, greater_y}}, true, Line{Point{7.5, minY}, Point{3.75, maxY}}}, + // From 2 to 1 + TestCase{Line{Point{greater_x, below_y}, Point{center_x, below_y}}, false}, + // From 2 to 4 + TestCase{Line{Point{greater_x, below_y}, Point{center_x, center_y}}, true, Line{Point{7.142857142857143, minY}, Point{center_x, center_y}}}, + // From 2 to 7 + TestCase{Line{Point{greater_x, below_y}, Point{center_x, greater_y}}, true, Line{Point{maxX, 4.2}, Point{6.875, maxY}}}, + // From 2 to 5 + TestCase{Line{Point{greater_x, below_y}, Point{greater_x, center_y}}, false}, + // From 2 to 8 + TestCase{Line{Point{greater_x, below_y}, Point{greater_x, greater_y}}, false}, + // From 5 to 0 + TestCase{Line{Point{greater_x, center_y}, Point{below_x, below_y}}, true, Line{Point{maxX, 3.8}, Point{5.714285714285714, minY}}}, + // From 5 to 3 + TestCase{Line{Point{greater_x, center_y}, Point{below_x, center_y}}, true, Line{Point{maxX, center_y}, Point{minX, center_y}}}, + // From 5 to 6 + TestCase{Line{Point{greater_x, center_y}, Point{below_x, greater_y}}, true, Line{Point{maxX, 5.4}, Point{6.666666666666667, maxY}}}, + // From 5 to 1 + TestCase{ + Line{Point{greater_x, center_y}, Point{center_x, below_y}}, true, Line{Point{maxX, 3.0999999999999996}, Point{7.857142857142858, minY}}}, + // From 5 to 4 + TestCase{Line{Point{greater_x, center_y}, Point{center_x, center_y}}, true, Line{Point{maxX, center_y}, Point{center_x, center_y}}}, + // From 5 to 7 + TestCase{Line{Point{greater_x, center_y}, Point{center_x, greater_y}}, false}, + // From 5 to 2 + TestCase{Line{Point{greater_x, center_y}, Point{greater_x, below_y}}, false}, + // From 5 to 8 + TestCase{Line{Point{greater_x, center_y}, Point{greater_x, greater_y}}, false}, + // From 8 to 0 + TestCase{Line{Point{greater_x, greater_y}, Point{below_x, below_y}}, true, Line{Point{6.25, maxY}, Point{2.5, minY}}}, + // From 8 to 3 + TestCase{Line{Point{greater_x, greater_y}, Point{below_x, center_y}}, true, Line{Point{3.333333333333334, maxY}, Point{minX, 5.4}}}, + // From 8 to 6 + TestCase{Line{Point{greater_x, greater_y}, Point{below_x, greater_y}}, false}, + // From 8 to 1 + TestCase{Line{Point{greater_x, greater_y}, Point{center_x, below_y}}, true, Line{Point{maxX, 5.8}, Point{6.25, minY}}}, + // From 8 to 4 + TestCase{Line{Point{greater_x, greater_y}, Point{center_x, center_y}}, true, Line{Point{6.666666666666667, maxY}, Point{center_x, center_y}}}, + // From 8 to 7 + TestCase{Line{Point{greater_x, greater_y}, Point{center_x, greater_y}}, false}, + // From 8 to 2 + TestCase{Line{Point{greater_x, greater_y}, Point{greater_x, below_y}}, false}, + // From 8 to 5 + TestCase{Line{Point{greater_x, greater_y}, Point{greater_x, center_y}}, false}, + }}; + + size_t i = 0; + for (const auto &t : test_cases) { + ++i; + std::string const msg = + fmt::format("test_case {}: From ({}, {}) to ({}, {})", i, t.line_ori.p0.x, t.line_ori.p0.y, t.line_ori.p1.x, t.line_ori.p1.y); + SCOPED_TRACE(msg); + testclipline(t); + } + + constexpr std::array boundary_lines{ + TestCase{Line{Point{minX, below_y}, Point{minX, center_y}}, true, Line{Point{minX, minY}, Point{minX, center_y}}}, + TestCase{Line{Point{minX, below_y}, Point{minX, greater_y}}, true, Line{Point{minX, minY}, Point{minX, maxY}}}, + TestCase{Line{Point{minX, center_y}, Point{minX, below_y}}, true, Line{Point{minX, center_y}, Point{minX, minY}}}, + TestCase{Line{Point{minX, center_y}, Point{minX, greater_y}}, true, Line{Point{minX, center_y}, Point{minX, maxY}}}, + TestCase{Line{Point{minX, greater_y}, Point{minX, below_y}}, true, Line{Point{minX, maxY}, Point{minX, minY}}}, + TestCase{Line{Point{minX, greater_y}, Point{minX, center_y}}, true, Line{Point{minX, maxY}, Point{minX, center_y}}}, + TestCase{Line{Point{maxX, below_y}, Point{maxX, center_y}}, true, Line{Point{maxX, minY}, Point{maxX, center_y}}}, + TestCase{Line{Point{maxX, below_y}, Point{maxX, greater_y}}, true, Line{Point{maxX, minY}, Point{maxX, maxY}}}, + TestCase{Line{Point{maxX, center_y}, Point{maxX, below_y}}, true, Line{Point{maxX, center_y}, Point{maxX, minY}}}, + TestCase{Line{Point{maxX, center_y}, Point{maxX, greater_y}}, true, Line{Point{maxX, center_y}, Point{maxX, maxY}}}, + TestCase{Line{Point{maxX, greater_y}, Point{maxX, below_y}}, true, Line{Point{maxX, maxY}, Point{maxX, minY}}}, + TestCase{Line{Point{maxX, greater_y}, Point{maxX, center_y}}, true, Line{Point{maxX, maxY}, Point{maxX, center_y}}}, + TestCase{Line{Point{below_x, minY}, Point{center_x, minY}}, true, Line{Point{minX, minY}, Point{center_x, minY}}}, + TestCase{Line{Point{below_x, minY}, Point{greater_x, minY}}, true, Line{Point{minX, minY}, Point{maxX, minY}}}, + TestCase{Line{Point{center_x, minY}, Point{below_x, minY}}, true, Line{Point{center_x, minY}, Point{minX, minY}}}, + TestCase{Line{Point{center_x, minY}, Point{greater_x, minY}}, true, Line{Point{center_x, minY}, Point{maxX, minY}}}, + TestCase{Line{Point{greater_x, minY}, Point{below_x, minY}}, true, Line{Point{maxX, minY}, Point{minX, minY}}}, + TestCase{Line{Point{greater_x, minY}, Point{center_x, minY}}, true, Line{Point{maxX, minY}, Point{center_x, minY}}}, + TestCase{Line{Point{below_x, maxY}, Point{center_x, maxY}}, true, Line{Point{minX, maxY}, Point{center_x, maxY}}}, + TestCase{Line{Point{below_x, maxY}, Point{greater_x, maxY}}, true, Line{Point{minX, maxY}, Point{maxX, maxY}}}, + TestCase{Line{Point{center_x, maxY}, Point{below_x, maxY}}, true, Line{Point{center_x, maxY}, Point{minX, maxY}}}, + TestCase{Line{Point{center_x, maxY}, Point{greater_x, maxY}}, true, Line{Point{center_x, maxY}, Point{maxX, maxY}}}, + TestCase{Line{Point{greater_x, maxY}, Point{below_x, maxY}}, true, Line{Point{maxX, maxY}, Point{minX, maxY}}}, + TestCase{Line{Point{greater_x, maxY}, Point{center_x, maxY}}, true, Line{Point{maxX, maxY}, Point{center_x, maxY}}}, + }; + i = 0; + for (const auto &t : boundary_lines) { + ++i; + std::string const msg = + fmt::format("Boundary Line {}: From ({}, {}) to ({}, {})", i, t.line_ori.p0.x, t.line_ori.p0.y, t.line_ori.p1.x, t.line_ori.p1.y); + SCOPED_TRACE(msg); + testclipline(t); + } +} From 251ea560e504b2bf3f1b79dbbb9f73bae3aa9e7c Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 12 Aug 2024 12:27:56 +0200 Subject: [PATCH 106/164] Fix #10656 - Rewrite the CLIPLINE algorithm Use the Liang-Barsky algorithm * Loosely adapted from https://en.wikipedia.org/wiki/Liang%E2%80%93Barsky_algorithm * Rewrote it until performance is optimal I used microbenchmarking: https://github.com/jmarrec/CppBenchmarks/blob/94f0e1594ff17f9833a0547f0725d68c561311a1/bench_clipline.cpp BM_CLIPLINE is the current E+ algorithm. BM_liang_barsky_clipper3 is my final version that I used here, and which is 15% faster than the original while being actually correct. in the edge cases ``` ------------------------------------------------------------------- Benchmark Time CPU Iterations ------------------------------------------------------------------- BM_CLIPLINE 567 ns 566 ns 1231826 BM_Clip2 703 ns 703 ns 991672 BM_liang_barsky_clipper 588 ns 588 ns 1199750 BM_liang_barsky_clipper2 490 ns 490 ns 1430600 BM_liang_barsky_clipper3 482 ns 482 ns 145236 ``` --- src/EnergyPlus/SolarShading.cc | 233 ++++++++--------------- src/EnergyPlus/SolarShading.hh | 2 +- tst/EnergyPlus/unit/SolarShading.unit.cc | 10 +- 3 files changed, 84 insertions(+), 161 deletions(-) diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 4f01b2b0583..df6c21bf79b 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -46,6 +46,7 @@ // POSSIBILITY OF SUCH DAMAGE. // C++ Headers +#include #include #include #include @@ -3868,162 +3869,99 @@ inline bool d_eq(Real64 a, Real64 b) return std::abs(a - b) < 2.0; } -void CLIPLINE(Real64 &x1, Real64 &x2, Real64 &y1, Real64 &y2, Real64 maxX, Real64 minX, Real64 maxY, Real64 minY, bool &visible, bool &rev) +void CLIPLINE(Real64 &x0, Real64 &x1, Real64 &y0, Real64 &y1, Real64 maxX, Real64 minX, Real64 maxY, Real64 minY, bool &visible) { + // Line segment clipping // Reference: - // Slater, M., Barsky, B.A. + // Liang, Y.D., Barsky, B.A., Slater, M. // 2D line and polygon clipping based on space subdivision. // The Visual Computer 10, 407–422 (1994). - Real64 dx, dy, e, xinc, yinc, tempVar; - bool needX = true, needY = true; - int c1, c2; - - if (x1 > x2) { // reverse for efficiency - tempVar = x1; - x1 = x2; - x2 = tempVar; - tempVar = y1; - y1 = y2; - y2 = tempVar; + + // Tweaked via microbenchmarking to improve efficiency + + bool rev = false; + if (x0 > x1) { // reverse for efficiency + std::swap(x0, x1); + std::swap(y0, y1); rev = true; } - if (x1 > maxX || x2 < minX) return; // x is positive - if (x1 < minX) { - if (y1 < minY) { - if (y2 < minY) return; - c1 = 0; - dx = x2 - x1; - dy = y2 - y1; - e = dy * (minX - x1) + dx * (y1 - minY); - } else if (y1 > maxY) { - if (y2 > maxY) return; - c1 = 6; - dx = x2 - x1; - dy = y2 - y1; - e = dy * (minX - x1) + dx * (y1 - maxY); - } else { - c1 = 3; - dx = x2 - x1; - dy = y2 - y1; - if (dy > 0) { - e = dy * (minX - x1) + dx * (y1 - maxY); - } else { - e = dy * (minX - x1) + dx * (y1 - minY); - } + + if (x0 > maxX || x1 < minX) { + // Both points are outside the clip window, so they can't cross it + return; + } + + // defining variables + Real64 const dx = x1 - x0; // >= 0 + Real64 const dy = y1 - y0; + + Real64 const q1 = x0 - minX; + Real64 const q2 = maxX - x0; + Real64 const q3 = y0 - minY; + Real64 const q4 = maxY - y0; + + Real64 u1 = 0; + Real64 u2 = 1; + + if ((dx == 0 && (q1 < 0 || q2 < 0)) || (dy == 0 && (q3 < 0 || q4 < 0))) { + // Line is parallel to clipping window + return; + } + if (dx != 0) { + Real64 const r1 = q1 / -dx; + if (r1 > u1) { + u1 = r1; } - } else { - if (y1 < minY) { - if (y2 < minY) return; - c1 = 1; - dx = x2 - x1; - dy = y2 - y1; - e = dy * (maxX - x1) + dx * (y1 - minY); - } else if (y1 > maxY) { - if (y2 > maxY) return; - c1 = 7; - dx = x2 - x1; - dy = y2 - y1; - e = dy * (maxX - x1) + dx * (y1 - maxY); - } else { - visible = true; - if (x2 <= maxX && (y2 >= minY && y2 <= maxY)) return; - c1 = 4; - dx = x2 - x1; - dy = y2 - y1; - if (dy > 0) { - e = dy * (maxX - x1) + dx * (y1 - maxY); - } else { - e = dy * (maxX - x1) + dx * (y1 - minY); - } + Real64 const r2 = q2 / dx; + if (r2 < u2) { + u2 = r2; } } - c2 = c1; - if (dy > 0) { - while (true) { - if (e < 0.0) { - if (c2 == 1) - return; - else if (c2 == 3) { - visible = true; - x1 = minX; - y1 = maxY + e / dx; - if (x2 <= maxX && y2 <= maxY) return; - } else if (c2 == 4) { - x2 = maxX; - y2 = maxY + e / dx; - return; - } - if (needX) { - xinc = dy * (maxX - minX); - needX = false; - } - e += xinc; - c2 += 1; - } else { - if (c2 == 3) - return; - else if (c2 == 1) { - visible = true; - x1 = maxX - e / dy; - y1 = minY; - if (x2 <= maxX && y2 <= maxY) return; - } else if (c2 == 4) { - x2 = maxX - e / dy; - y2 = maxY; - return; - } - if (needY) { - yinc = dx * (maxY - minY); - needY = false; - } - e -= yinc; - c2 += 3; + if (dy != 0) { + Real64 const r3 = q3 / -dy; + Real64 const r4 = q4 / dy; + if (dy > 0) { + if (r3 > u1) { + u1 = r3; } - } - } else { - while (true) { - if (e >= 0.0) { - if (c2 == 7) - return; - else if (c2 == 3) { - visible = true; - x1 = minX; - y1 = minY + e / dx; - if (x2 <= maxX && y2 >= minY) return; - } else if (c2 == 4) { - x2 = maxX; - y2 = minY + e / dx; - return; - } - if (needX) { - xinc = dy * (maxX - minX); - needX = false; - } - e += xinc; - c2 += 1; - } else { - if (c2 == 3) - return; - else if (c2 == 7) { - visible = true; - x1 = maxX - e / dy; - y1 = maxY; - if (x2 <= maxX && y2 >= minY) return; - } else if (c2 == 4) { - x2 = maxX - e / dy; - y2 = minY; - return; - } - if (needY) { - yinc = dx * (maxY - minY); - needY = false; - } - e += yinc; - c2 -= 3; + if (r4 < u2) { + u2 = r4; + } + } else { + if (r4 > u1) { + u1 = r4; + } + if (r3 < u2) { + u2 = r3; } } } + + if (u1 > u2) { // reject + // Line is outside the clipping window + return; + } + + visible = true; + + Real64 const xn0 = x0 + dx * u1; + Real64 const yn0 = y0 + dy * u1; + + Real64 const xn1 = x0 + dx * u2; + Real64 const yn1 = y0 + dy * u2; + + if (rev) { + x0 = xn1; + y0 = yn1; + x1 = xn0; + y1 = yn0; + } else { + x0 = xn0; + y0 = yn0; + x1 = xn1; + y1 = yn1; + } } void CLIPRECT(EnergyPlusData &state, int const NS2, int const NV1, int &NV3) @@ -4063,20 +4001,11 @@ void CLIPRECT(EnergyPlusData &state, int const NS2, int const NV1, int &NV3) Real64 x1 = x_1, x2 = x_2, y1 = y_1, y2 = y_2; bool visible = false; - bool rev = false; - CLIPLINE(x_1, x_2, y_1, y_2, maxX, minX, maxY, minY, visible, rev); + CLIPLINE(x_1, x_2, y_1, y_2, maxX, minX, maxY, minY, visible); if (visible) { if ((x_1 != x1 || y_1 != y1) || (x_2 != x2 || y_2 != y2)) { INTFLAG = true; } - if (rev) { // undo reverse - Real64 tempVar = x_1; - x_1 = x_2; - x_2 = tempVar; - tempVar = y_1; - y_1 = y_2; - y_2 = tempVar; - } // if line on edge, or inside, add both points if (arrc == 0 || ((neq(arrx[arrc - 1], x_1) || neq(arry[arrc - 1], y_1)) && (neq(arrx[0], x_1) || neq(arry[0], y_1)))) { arrx[arrc] = x_1; diff --git a/src/EnergyPlus/SolarShading.hh b/src/EnergyPlus/SolarShading.hh index f91a571901b..31878be083d 100644 --- a/src/EnergyPlus/SolarShading.hh +++ b/src/EnergyPlus/SolarShading.hh @@ -136,7 +136,7 @@ namespace SolarShading { void CLIP(EnergyPlusData &state, int const NVT, Array1D &XVT, Array1D &YVT, Array1D &ZVT); - void CLIPLINE(Real64 &x0, Real64 &x1, Real64 &y0, Real64 &y1, Real64 maxX, Real64 minX, Real64 maxY, Real64 minY, bool &visible, bool &rev); + void CLIPLINE(Real64 &x0, Real64 &x1, Real64 &y0, Real64 &y1, Real64 maxX, Real64 minX, Real64 maxY, Real64 minY, bool &visible); void CTRANS(EnergyPlusData &state, int const NS, // Surface number whose vertex coordinates are being transformed diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 302a684be5b..68d481be86b 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -6217,9 +6217,8 @@ TEST_F(EnergyPlusFixture, CLIPLINE_Throw) Real64 y0 = 4.5; Real64 y1 = 1.0; bool visible = false; - bool rev = false; - EXPECT_NO_THROW(CLIPLINE(x0, x1, y0, y1, maxX, minX, maxY, minY, visible, rev)); + EXPECT_NO_THROW(CLIPLINE(x0, x1, y0, y1, maxX, minX, maxY, minY, visible)); EXPECT_DOUBLE_EQ(maxX, x0); EXPECT_DOUBLE_EQ(4.5, y0); @@ -6271,12 +6270,7 @@ TEST_F(EnergyPlusFixture, CLIPLINE_Full) std::string const msg = fmt::format("From ({}, {}) to ({}, {})", t.line_ori.p0.x, t.line_ori.p0.y, t.line_ori.p1.x, t.line_ori.p1.y); bool visible = false; - bool rev = false; - CLIPLINE(x0, x1, y0, y1, maxX, minX, maxY, minY, visible, rev); - if (rev) { - std::swap(x0, x1); - std::swap(y0, y1); - } + CLIPLINE(x0, x1, y0, y1, maxX, minX, maxY, minY, visible); if (t.visible) { EXPECT_TRUE(visible) << msg; EXPECT_DOUBLE_EQ(t.line_new.p0.x, x0) << msg; From a0b20cca8d0a5747d5b6acd8d96e6b0ba71e26c0 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 12 Aug 2024 13:13:59 +0200 Subject: [PATCH 107/164] Similar fix for PTHP test: init the RatedAirMassFlowRate due to sizing disabled --- tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index feb753e7edc..7487dcafe92 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -4613,7 +4613,7 @@ TEST_F(EnergyPlusFixture, ZonePTHP_ElectricityRateTest) // set sizing parameters state->dataSize->SysSizingRunDone = true; state->dataSize->ZoneSizingRunDone = true; - state->dataGlobal->SysSizingCalc = true; + state->dataGlobal->SysSizingCalc = true; // disable sizing calculation state->dataZoneEnergyDemand->CurDeadBandOrSetback.allocate(1); state->dataZoneEnergyDemand->CurDeadBandOrSetback(1) = false; @@ -4654,6 +4654,10 @@ TEST_F(EnergyPlusFixture, ZonePTHP_ElectricityRateTest) auto &dxHtgCoilMain = state->dataDXCoils->DXCoil(2); auto &elecHtgCoilSupp = state->dataHeatingCoils->HeatingCoil(1); + // We disabled sizing calculation, so we must initialize these + dxClgCoilMain.RatedAirMassFlowRate(1) = dxClgCoilMain.RatedAirVolFlowRate(1) * state->dataEnvrn->StdRhoAir; + dxHtgCoilMain.RatedAirMassFlowRate(1) = dxHtgCoilMain.RatedAirVolFlowRate(1) * state->dataEnvrn->StdRhoAir; + state->dataGlobal->BeginEnvrnFlag = true; mySys->simulate(*state, thisSys.Name, From e92b7e8957359e188f44e97832edff397eebcb57 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 12 Aug 2024 13:33:29 +0200 Subject: [PATCH 108/164] Fix TestReadingCoilCoolingHeatingDX --- tst/EnergyPlus/unit/DXCoils.unit.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tst/EnergyPlus/unit/DXCoils.unit.cc b/tst/EnergyPlus/unit/DXCoils.unit.cc index 518b788a32b..b600886e13f 100644 --- a/tst/EnergyPlus/unit/DXCoils.unit.cc +++ b/tst/EnergyPlus/unit/DXCoils.unit.cc @@ -2003,6 +2003,14 @@ TEST_F(EnergyPlusFixture, TestReadingCoilCoolingHeatingDX) GetCurveInput(*state); GetDXCoils(*state); VariableSpeedCoils::GetVarSpeedCoilInput(*state); + + state->dataEnvrn->StdBaroPress = DataEnvironment::StdPressureSeaLevel; + state->dataEnvrn->OutBaroPress = DataEnvironment::StdPressureSeaLevel; + state->dataEnvrn->OutDryBulbTemp = 20.0; + state->dataEnvrn->OutHumRat = 0.008; + state->dataEnvrn->StdRhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, 20.0, 0.0); + Psychrometrics::InitializePsychRoutines(*state); + // Coil:Cooling:DX:SingleSpeed EXPECT_EQ(state->dataDXCoils->DXCoil(1).DXCoilType_Num, HVAC::CoilDX_CoolingSingleSpeed); EXPECT_EQ("HEATERCAPCURVE", Curve::GetCurveName(*state, state->dataDXCoils->DXCoil(1).CrankcaseHeaterCapacityCurveIndex)); @@ -2067,6 +2075,7 @@ TEST_F(EnergyPlusFixture, TestReadingCoilCoolingHeatingDX) Real64 LatentLoad = 100.0; Real64 OnOffAirFlowRatio = 0.5; state->dataVariableSpeedCoils->VarSpeedCoil(VarSpeedCoilNum).AirMassFlowRate = 1.0; + state->dataVariableSpeedCoils->VarSpeedCoil(VarSpeedCoilNum).DesignAirMassFlowRate = 1.0; state->dataVariableSpeedCoils->VarSpeedCoil(VarSpeedCoilNum).RunFrac = 0.0; state->dataVariableSpeedCoils->VarSpeedCoil(VarSpeedCoilNum).RatedCapCoolTotal = 100.0; // power = 26 + 2x @@ -2085,6 +2094,7 @@ TEST_F(EnergyPlusFixture, TestReadingCoilCoolingHeatingDX) VarSpeedCoilNum = 2; state->dataVariableSpeedCoils->VarSpeedCoil(VarSpeedCoilNum).AirMassFlowRate = 0.5; state->dataVariableSpeedCoils->VarSpeedCoil(VarSpeedCoilNum).RunFrac = 0.0; + state->dataVariableSpeedCoils->VarSpeedCoil(VarSpeedCoilNum).DesignAirMassFlowRate = 1.0; // power = 28 + 2x state->dataEnvrn->OutHumRat = 0.0114507065; state->dataEnvrn->OutBaroPress = 98200.0; From 30fdefb3539496005a24ee98286f8b73e66ed134 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 12 Aug 2024 14:32:47 +0200 Subject: [PATCH 109/164] Fix SingleSpeedDXCoolingCoilOutputTest --- tst/EnergyPlus/unit/DXCoils.unit.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tst/EnergyPlus/unit/DXCoils.unit.cc b/tst/EnergyPlus/unit/DXCoils.unit.cc index b600886e13f..3dcd4d2dbb8 100644 --- a/tst/EnergyPlus/unit/DXCoils.unit.cc +++ b/tst/EnergyPlus/unit/DXCoils.unit.cc @@ -5160,6 +5160,7 @@ TEST_F(EnergyPlusFixture, SingleSpeedDXCoolingCoilOutputTest) Coil.RatedTotCap(1) = 17580.0; Coil.RatedCOP(1) = 3.0; Coil.RatedEIR(1) = 1.0 / Coil.RatedCOP(1); + Coil.RatedCBF(1) = 0.00000001; // autosizing is disabled so initialize coil bypass factor Coil.RatedAirMassFlowRate = 1.0; Coil.MinOATCompressor = -17.78; Coil.CCapFTemp(1) = 1; @@ -5215,6 +5216,10 @@ TEST_F(EnergyPlusFixture, SingleSpeedDXCoolingCoilOutputTest) state->dataEnvrn->OutHumRat = 0.0120; state->dataEnvrn->WindSpeed = 5.0; state->dataEnvrn->WindDir = 0.0; + state->dataEnvrn->StdBaroPress = DataEnvironment::StdPressureSeaLevel; + state->dataEnvrn->StdRhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->StdBaroPress, 20.0, 0.0); + Psychrometrics::InitializePsychRoutines(*state); + // run coil at full capacity Real64 PartLoadRatio(1.0); Real64 AirFlowRatio(1.0); From 9fa8ee0600e3b1c9a68c6d7a69ae7904fbfe788a Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 12 Aug 2024 14:49:14 +0200 Subject: [PATCH 110/164] Fix MultiSpeedDXCoolingCoilOutputTest --- tst/EnergyPlus/unit/DXCoils.unit.cc | 52 +++++++++++------------------ 1 file changed, 19 insertions(+), 33 deletions(-) diff --git a/tst/EnergyPlus/unit/DXCoils.unit.cc b/tst/EnergyPlus/unit/DXCoils.unit.cc index 3dcd4d2dbb8..90ec3f11d2a 100644 --- a/tst/EnergyPlus/unit/DXCoils.unit.cc +++ b/tst/EnergyPlus/unit/DXCoils.unit.cc @@ -5303,47 +5303,21 @@ TEST_F(EnergyPlusFixture, MultiSpeedDXCoolingCoilOutputTest) state->dataDXCoils->DXCoilOutletHumRat.allocate(1); state->dataDXCoils->DXCoilPartLoadRatio.allocate(1); state->dataDXCoils->DXCoilFanOp.allocate(1); - state->dataCurveManager->allocateCurveVector(2); auto &Coil = state->dataDXCoils->DXCoil(1); - EnergyPlus::Curve::Curve *constantcurve1 = state->dataCurveManager->PerfCurve(1); - EnergyPlus::Curve::Curve *constantcurve2 = state->dataCurveManager->PerfCurve(2); auto &AirInletNode = state->dataLoopNodes->Node(1); auto &AirOutletNode = state->dataLoopNodes->Node(2); Coil.DXCoilType_Num = HVAC::CoilDX_MultiSpeedCooling; Coil.DXCoilType = "Coil:Cooling:DX:MultiSpeed"; Coil.SchedPtr = ScheduleManager::ScheduleAlwaysOn; + Coil.NumOfSpeeds = 2; - Coil.MSRatedTotCap.allocate(Coil.NumOfSpeeds); - Coil.MSRatedSHR.allocate(Coil.NumOfSpeeds); - Coil.MSRatedCOP.allocate(Coil.NumOfSpeeds); - Coil.MSRatedAirVolFlowRate.allocate(Coil.NumOfSpeeds); - Coil.MSRatedAirMassFlowRate.allocate(Coil.NumOfSpeeds); - Coil.MSCCapFTemp.allocate(Coil.NumOfSpeeds); - Coil.MSCCapFFlow.allocate(Coil.NumOfSpeeds); - Coil.MSEIRFTemp.allocate(Coil.NumOfSpeeds); - Coil.MSEIRFFlow.allocate(Coil.NumOfSpeeds); - Coil.MSWasteHeat.allocate(Coil.NumOfSpeeds); - Coil.MSEvapCondEffect.allocate(Coil.NumOfSpeeds); - Coil.MSEvapCondAirFlow.allocate(Coil.NumOfSpeeds); - Coil.MSEvapCondPumpElecNomPower.allocate(Coil.NumOfSpeeds); - Coil.MSRatedCBF.allocate(Coil.NumOfSpeeds); - Coil.MSWasteHeatFrac.allocate(Coil.NumOfSpeeds); - Coil.MSPLFFPLR.allocate(Coil.NumOfSpeeds); - Coil.MSTwet_Rated.allocate(Coil.NumOfSpeeds); - Coil.MSGamma_Rated.allocate(Coil.NumOfSpeeds); - Coil.MSMaxONOFFCyclesperHour.allocate(Coil.NumOfSpeeds); - Coil.MSLatentCapacityTimeConstant.allocate(Coil.NumOfSpeeds); - Coil.MSFanPowerPerEvapAirFlowRate.allocate(Coil.NumOfSpeeds); - Coil.MSCCapFTemp = 1; - Coil.MSCCapFFlow = 2; - Coil.MSEIRFTemp = 1; - Coil.MSEIRFFlow = 2; - Coil.MSPLFFPLR = 2; - Coil.AirOutNode = 2; - Coil.AirInNode = 1; + createSpeedsWithDefaults(Coil); + + state->dataCurveManager->allocateCurveVector(2); // biquadratic curve + EnergyPlus::Curve::Curve *constantcurve1 = state->dataCurveManager->PerfCurve(1); constantcurve1->Name = "constant biquadratic curve"; constantcurve1->curveType = CurveType::BiQuadratic; constantcurve1->interpolationType = InterpType::EvaluateCurveToLimits; @@ -5360,6 +5334,7 @@ TEST_F(EnergyPlusFixture, MultiSpeedDXCoolingCoilOutputTest) constantcurve1->outputLimits.min = 1.0; constantcurve1->outputLimits.max = 1.0; // quadratic curve + EnergyPlus::Curve::Curve *constantcurve2 = state->dataCurveManager->PerfCurve(2); constantcurve2->Name = "constant quadratic curve"; constantcurve2->curveType = CurveType::Quadratic; constantcurve2->interpolationType = InterpType::EvaluateCurveToLimits; @@ -5370,14 +5345,22 @@ TEST_F(EnergyPlusFixture, MultiSpeedDXCoolingCoilOutputTest) constantcurve2->inputLimits[0].max = 1.0; constantcurve2->outputLimits.min = 1.0; constantcurve2->outputLimits.max = 1.0; + + Coil.MSCCapFTemp = 1; + Coil.MSCCapFFlow = 2; + Coil.MSEIRFTemp = 1; + Coil.MSEIRFFlow = 2; + Coil.MSPLFFPLR = 2; + Coil.AirInNode = 1; + Coil.AirOutNode = 2; // set coil parameter Coil.MSRatedTotCap(1) = 10710.0; // 60 % of full capacity Coil.MSRatedTotCap(2) = 17850.0; // 5 ton capcity Coil.InletAirMassFlowRate = state->dataHVACGlobal->MSHPMassFlowRateHigh; Coil.MSRatedAirMassFlowRate(1) = state->dataHVACGlobal->MSHPMassFlowRateLow; Coil.MSRatedAirMassFlowRate(2) = state->dataHVACGlobal->MSHPMassFlowRateHigh; - Coil.MSRatedCBF(1) = 0.0; - Coil.MSRatedCBF(2) = 0.0; + Coil.MSRatedCBF(1) = 0.00000001; + Coil.MSRatedCBF(2) = 0.00000001; Coil.MSWasteHeat(1) = 0; Coil.MSWasteHeat(2) = 0; Coil.MSWasteHeatFrac(1) = 0; @@ -5404,6 +5387,9 @@ TEST_F(EnergyPlusFixture, MultiSpeedDXCoolingCoilOutputTest) state->dataEnvrn->OutHumRat = 0.0120; state->dataEnvrn->WindSpeed = 5.0; state->dataEnvrn->WindDir = 0.0; + state->dataEnvrn->StdBaroPress = DataEnvironment::StdPressureSeaLevel; + state->dataEnvrn->StdRhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->StdBaroPress, 20.0, 0.0); + Psychrometrics::InitializePsychRoutines(*state); int SpeedNum = 2; HVAC::FanOp fanOp = HVAC::FanOp::Cycling; HVAC::CompressorOp compressorOp = HVAC::CompressorOp::On; From 2dee72c57a9986f68fdf9cb0f184d4eeea288248 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 12 Aug 2024 15:02:24 +0200 Subject: [PATCH 111/164] Fix SQLiteFixture.DXCoils_TestComponentSizingOutput_SingleSpeed / DXCoils_TestComponentSizingOutput_TwoSpeed --- tst/EnergyPlus/unit/DXCoils.unit.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tst/EnergyPlus/unit/DXCoils.unit.cc b/tst/EnergyPlus/unit/DXCoils.unit.cc index 90ec3f11d2a..02eff5135d7 100644 --- a/tst/EnergyPlus/unit/DXCoils.unit.cc +++ b/tst/EnergyPlus/unit/DXCoils.unit.cc @@ -3320,7 +3320,11 @@ TEST_F(SQLiteFixture, DXCoils_TestComponentSizingOutput_TwoSpeed) state->dataSize->SysSizInput(1).AirLoopNum = state->dataSize->CurSysNum; state->dataSize->NumSysSizInput = 1; - state->dataEnvrn->StdBaroPress = 101325.0; + state->dataEnvrn->StdBaroPress = DataEnvironment::StdPressureSeaLevel; + state->dataEnvrn->OutBaroPress = DataEnvironment::StdPressureSeaLevel; + state->dataEnvrn->OutDryBulbTemp = 20.0; + state->dataEnvrn->OutHumRat = 0.008; + state->dataEnvrn->StdRhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->StdBaroPress, 20.0, 0.0); Psychrometrics::InitializePsychRoutines(*state); // Need this to prevent crash in Sizers @@ -3545,7 +3549,11 @@ TEST_F(SQLiteFixture, DXCoils_TestComponentSizingOutput_SingleSpeed) state->dataSize->SysSizInput(1).AirLoopNum = state->dataSize->CurSysNum; state->dataSize->NumSysSizInput = 1; - state->dataEnvrn->StdBaroPress = 101325.0; + state->dataEnvrn->StdBaroPress = DataEnvironment::StdPressureSeaLevel; + state->dataEnvrn->OutBaroPress = DataEnvironment::StdPressureSeaLevel; + state->dataEnvrn->OutDryBulbTemp = 20.0; + state->dataEnvrn->OutHumRat = 0.008; + state->dataEnvrn->StdRhoAir = Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->StdBaroPress, 20.0, 0.0); Psychrometrics::InitializePsychRoutines(*state); // Need this to prevent crash in Sizers From 023b7f8eddd5ffc24a7158ab8f80f0c27b15b390 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 12 Aug 2024 15:18:26 +0200 Subject: [PATCH 112/164] Fix EnergyPlusFixture.TwoSpeedDXCoilStandardRatings_Curve_Fix_Test EnergyPlusFixture.TwoSpeedDXCoilStandardRatingsTest --- tst/EnergyPlus/unit/DXCoils.unit.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tst/EnergyPlus/unit/DXCoils.unit.cc b/tst/EnergyPlus/unit/DXCoils.unit.cc index 02eff5135d7..fddcb1dd1c0 100644 --- a/tst/EnergyPlus/unit/DXCoils.unit.cc +++ b/tst/EnergyPlus/unit/DXCoils.unit.cc @@ -5608,6 +5608,8 @@ TEST_F(EnergyPlusFixture, TwoSpeedDXCoilStandardRatingsTest) state->dataGlobal->SysSizingCalc = true; coolcoilTwoSpeed.RatedAirMassFlowRate(1) = coolcoilTwoSpeed.RatedAirVolFlowRate(1) * state->dataEnvrn->StdRhoAir; coolcoilTwoSpeed.RatedAirMassFlowRate2 = coolcoilTwoSpeed.RatedAirVolFlowRate2 * state->dataEnvrn->StdRhoAir; + coolcoilTwoSpeed.RatedCBF(1) = 0.00000001; // autosizing is disabled so initialize coil bypass factor + coolcoilTwoSpeed.RatedCBF2 = 0.00000001; supplyFan->maxAirMassFlowRate = supplyFan->maxAirFlowRate * state->dataEnvrn->StdRhoAir; supplyFan->rhoAirStdInit = state->dataEnvrn->StdRhoAir; auto &InletNode = state->dataLoopNodes->Node(supplyFan->inletNodeNum); @@ -5629,7 +5631,7 @@ TEST_F(EnergyPlusFixture, TwoSpeedDXCoilStandardRatingsTest) EXPECT_EQ(coolcoilTwoSpeed.InternalStaticPressureDrop, 400.0); EXPECT_TRUE(coolcoilTwoSpeed.RateWithInternalStaticAndFanObject); EXPECT_EQ("8.77", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilEERIP, coolcoilTwoSpeed.Name)); - EXPECT_EQ("11.2", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); + EXPECT_EQ("10.8", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); // TODO: The IEER will not be generated for this particular coil because the cpacity is below the minimum for IEER // i.e, 65,000 Btu/h (19049.61955 Watts) // EXPECT_EQ("N/A", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); @@ -5638,7 +5640,7 @@ TEST_F(EnergyPlusFixture, TwoSpeedDXCoilStandardRatingsTest) OutputReportPredefined::SetPredefinedTables(*state); CalcTwoSpeedDXCoilStandardRating(*state, dXCoilIndex); EXPECT_EQ("8.72", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilEERIP, coolcoilTwoSpeed.Name)); - EXPECT_EQ("10.1", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); + EXPECT_EQ("9.8", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); // EXPECT_EQ("N/A", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); } @@ -5850,6 +5852,8 @@ TEST_F(EnergyPlusFixture, TwoSpeedDXCoilStandardRatings_Curve_Fix_Test) state->dataGlobal->SysSizingCalc = true; coolcoilTwoSpeed.RatedAirMassFlowRate(1) = coolcoilTwoSpeed.RatedAirVolFlowRate(1) * state->dataEnvrn->StdRhoAir; coolcoilTwoSpeed.RatedAirMassFlowRate2 = coolcoilTwoSpeed.RatedAirVolFlowRate2 * state->dataEnvrn->StdRhoAir; + coolcoilTwoSpeed.RatedCBF(1) = 0.00000001; // autosizing is disabled so initialize coil bypass factor + coolcoilTwoSpeed.RatedCBF2 = 0.00000001; supplyFan->maxAirMassFlowRate = supplyFan->maxAirFlowRate * state->dataEnvrn->StdRhoAir; supplyFan->rhoAirStdInit = state->dataEnvrn->StdRhoAir; auto &InletNode = state->dataLoopNodes->Node(supplyFan->inletNodeNum); @@ -5873,7 +5877,7 @@ TEST_F(EnergyPlusFixture, TwoSpeedDXCoilStandardRatings_Curve_Fix_Test) EXPECT_EQ(coolcoilTwoSpeed.InternalStaticPressureDrop, 400.0); EXPECT_TRUE(coolcoilTwoSpeed.RateWithInternalStaticAndFanObject); EXPECT_EQ("8.77", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilEERIP, coolcoilTwoSpeed.Name)); - EXPECT_EQ("11.2", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); + EXPECT_EQ("10.8", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); // The IEER will not be generated for this particular coil because the cpacity is below the minimum for IEER // TODO: EXPECT_EQ("N/A", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); @@ -5885,7 +5889,7 @@ TEST_F(EnergyPlusFixture, TwoSpeedDXCoilStandardRatings_Curve_Fix_Test) OutputReportPredefined::SetPredefinedTables(*state); CalcTwoSpeedDXCoilStandardRating(*state, dXCoilIndex); EXPECT_EQ("8.72", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilEERIP, coolcoilTwoSpeed.Name)); - EXPECT_EQ("10.2", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); + EXPECT_EQ("9.8", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); // TODO: The IEER will not be generated for this particular coil because the cpacity is below the minimum for IEER // EXPECT_EQ("N/A", RetrievePreDefTableEntry(*state, state->dataOutRptPredefined->pdchDXCoolCoilIEERIP, coolcoilTwoSpeed.Name)); From 955463a0b14326bdcddb2aca2d7f694bae1f7d21 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Mon, 12 Aug 2024 15:54:03 +0200 Subject: [PATCH 113/164] Forgot to handle the rev case when I removed it as a param Note: in the regular usage, we do nothing is visible is false, and we pass copies into the CLIPLINE method anyways, so there's no point reversing it back --- tst/EnergyPlus/unit/SolarShading.unit.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 68d481be86b..e3f3988895f 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -6266,6 +6266,7 @@ TEST_F(EnergyPlusFixture, CLIPLINE_Full) Real64 x1 = t.line_ori.p1.x; Real64 y1 = t.line_ori.p1.y; + bool is_rev = x0 > x1; std::string const msg = fmt::format("From ({}, {}) to ({}, {})", t.line_ori.p0.x, t.line_ori.p0.y, t.line_ori.p1.x, t.line_ori.p1.y); @@ -6279,6 +6280,10 @@ TEST_F(EnergyPlusFixture, CLIPLINE_Full) EXPECT_DOUBLE_EQ(t.line_new.p1.y, y1) << msg; } else { EXPECT_FALSE(visible) << msg; + if (is_rev) { + std::swap(x0, x1); + std::swap(y0, y1); + } EXPECT_DOUBLE_EQ(t.line_ori.p0.x, x0) << msg; EXPECT_DOUBLE_EQ(t.line_ori.p0.y, y0) << msg; EXPECT_DOUBLE_EQ(t.line_ori.p1.x, x1) << msg; From fd2a28f67a847ab090cd73e2524ba4e8a3ff9d1d Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Mon, 12 Aug 2024 10:28:35 -0500 Subject: [PATCH 114/164] Space IV-SpaceHVACZoneReturnMixer 2 --- src/EnergyPlus/DataZoneEquipment.cc | 141 +++++++++++++----- src/EnergyPlus/DataZoneEquipment.hh | 22 +-- src/EnergyPlus/ZoneEquipmentManager.cc | 9 ++ .../unit/ZoneEquipmentManager.unit.cc | 4 +- 4 files changed, 125 insertions(+), 51 deletions(-) diff --git a/src/EnergyPlus/DataZoneEquipment.cc b/src/EnergyPlus/DataZoneEquipment.cc index d4c6087da87..5228b809e6a 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -587,7 +587,7 @@ void GetZoneEquipmentData(EnergyPlusData &state) continue; } - processZoneReturnMixerInput(state, CurrentModuleObject, zoneNum, objectSchemaProps, objectFields, thisZretMixer); + processZoneReturnMixerInput(state, CurrentModuleObject, zoneNum, objectSchemaProps, objectFields, zeqRetNum); } } // end loop over zone return mixers @@ -1326,20 +1326,20 @@ void processZoneEquipMixerInput(EnergyPlusData &state, static constexpr std::string_view RoutineName("processZoneEquipMixerInput: "); // include trailing blank space auto &ip = state.dataInputProcessing->inputProcessor; bool objectIsParent = true; - thisZeqMixer.zoneEquipInletNodeNum = GetOnlySingleNode(state, - ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_equipment_inlet_node_name"), - state.dataZoneEquip->GetZoneEquipmentDataErrorsFound, - thisZeqMixer.spaceEquipType, - thisZeqMixer.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Outlet, - NodeInputManager::CompFluidStream::Primary, - objectIsParent); + thisZeqMixer.outletNodeNum = GetOnlySingleNode(state, + ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_equipment_inlet_node_name"), + state.dataZoneEquip->GetZoneEquipmentDataErrorsFound, + thisZeqMixer.spaceEquipType, + thisZeqMixer.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + objectIsParent); // Check zone exhaust nodes bool found = false; auto &thisZoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(zoneNum); for (int exhNodeNum : thisZoneEquipConfig.ExhaustNode) { - if (thisZeqMixer.zoneEquipInletNodeNum == exhNodeNum) { + if (thisZeqMixer.outletNodeNum == exhNodeNum) { found = true; break; } @@ -1348,7 +1348,7 @@ void processZoneEquipMixerInput(EnergyPlusData &state, ShowSevereError(state, format("{}{}={}", RoutineName, zeqMixerModuleObject, thisZeqMixer.Name)); ShowContinueError(state, format("Zone Equipment Inlet Node Name={} is not an exhaust node for ZoneHVAC:EquipmentConnections={}.", - state.dataLoopNodes->NodeID(thisZeqMixer.zoneEquipInletNodeNum), + state.dataLoopNodes->NodeID(thisZeqMixer.outletNodeNum), thisZoneEquipConfig.ZoneName)); state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; } @@ -1410,27 +1410,37 @@ void processZoneReturnMixerInput(EnergyPlusData &state, int const zoneNum, InputProcessor::json const objectSchemaProps, InputProcessor::json const objectFields, - DataZoneEquipment::ZoneReturnMixer &thisZretMixer) + int mixerIndex) { static constexpr std::string_view RoutineName("processZoneReturnMixerInput: "); // include trailing blank space auto &ip = state.dataInputProcessing->inputProcessor; bool objectIsParent = true; - thisZretMixer.zoneReturnNodeNum = GetOnlySingleNode(state, - ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_return_air_node_name"), - state.dataZoneEquip->GetZoneEquipmentDataErrorsFound, - thisZretMixer.spaceEquipType, - thisZretMixer.Name, - DataLoopNode::NodeFluidType::Air, - DataLoopNode::ConnectionType::Outlet, - NodeInputManager::CompFluidStream::Primary, - objectIsParent); + auto &thisZretMixer = state.dataZoneEquip->zoneReturnMixer[mixerIndex]; + thisZretMixer.outletNodeNum = GetOnlySingleNode(state, + ip->getAlphaFieldValue(objectFields, objectSchemaProps, "zone_return_air_node_name"), + state.dataZoneEquip->GetZoneEquipmentDataErrorsFound, + thisZretMixer.spaceEquipType, + thisZretMixer.Name, + DataLoopNode::NodeFluidType::Air, + DataLoopNode::ConnectionType::Outlet, + NodeInputManager::CompFluidStream::Primary, + objectIsParent); // Check zone return nodes bool found = false; auto &thisZoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(zoneNum); + thisZoneEquipConfig.returnNodeSpaceMixerIndex.allocate(thisZoneEquipConfig.NumReturnNodes); + for (int &mixIndex : thisZoneEquipConfig.returnNodeSpaceMixerIndex) { + mixIndex = -1; + } + + int nodeCounter = 0; for (int retNodeNum : thisZoneEquipConfig.ReturnNode) { - if (thisZretMixer.zoneReturnNodeNum == retNodeNum) { + ++nodeCounter; + if (thisZretMixer.outletNodeNum == retNodeNum) { found = true; + // Zone return node is fed by a space return mixer + thisZoneEquipConfig.returnNodeSpaceMixerIndex(nodeCounter) = mixerIndex; break; } } @@ -1438,7 +1448,7 @@ void processZoneReturnMixerInput(EnergyPlusData &state, ShowSevereError(state, format("{}{}={}", RoutineName, zeqMixerModuleObject, thisZretMixer.Name)); ShowContinueError(state, format("Zone Equipment Return Air Node Name={} is not a return air node for ZoneHVAC:EquipmentConnections={}.", - state.dataLoopNodes->NodeID(thisZretMixer.zoneReturnNodeNum), + state.dataLoopNodes->NodeID(thisZretMixer.outletNodeNum), thisZoneEquipConfig.ZoneName)); state.dataZoneEquip->GetZoneEquipmentDataErrorsFound = true; } @@ -1923,9 +1933,9 @@ void ZoneEquipmentSplitterMixer::size(EnergyPlusData &state) } } -void ZoneEquipmentMixer::setOutletConditions(EnergyPlusData &state) +void ZoneMixer::setOutletConditions(EnergyPlusData &state) { - if (this->zoneEquipInletNodeNum == 0) return; + if (this->outletNodeNum == 0) return; Real64 sumEnthalpy = 0.0; Real64 sumHumRat = 0.0; @@ -1933,7 +1943,7 @@ void ZoneEquipmentMixer::setOutletConditions(EnergyPlusData &state) Real64 sumGenContam = 0.0; Real64 sumPressure = 0.0; Real64 sumFractions = 0.0; - auto &equipInletNode = state.dataLoopNodes->Node(this->zoneEquipInletNodeNum); + auto &outletNode = state.dataLoopNodes->Node(this->outletNodeNum); for (auto &mixerSpace : this->spaces) { auto &spaceOutletNode = state.dataLoopNodes->Node(mixerSpace.spaceNodeNum); sumEnthalpy += spaceOutletNode.Enthalpy * mixerSpace.fraction; @@ -1947,25 +1957,47 @@ void ZoneEquipmentMixer::setOutletConditions(EnergyPlusData &state) sumPressure += spaceOutletNode.Press * mixerSpace.fraction; sumFractions += mixerSpace.fraction; } - equipInletNode.Enthalpy = sumEnthalpy / sumFractions; - equipInletNode.HumRat = sumHumRat / sumFractions; - if (state.dataContaminantBalance->Contaminant.CO2Simulation) { - equipInletNode.CO2 = sumCO2 / sumFractions; - } - if (state.dataContaminantBalance->Contaminant.GenericContamSimulation) { - equipInletNode.GenContam = sumGenContam / sumFractions; - } - equipInletNode.Press = sumPressure / sumFractions; - // Use Enthalpy and humidity ratio to get outlet temperature from psych chart - equipInletNode.Temp = Psychrometrics::PsyTdbFnHW(equipInletNode.Enthalpy, equipInletNode.HumRat); + // For SpaceHVAC:ZoneReturnMixer, the fractions are dynamic and could be zero if there is no flow + if (sumFractions > 0) { + outletNode.Enthalpy = sumEnthalpy / sumFractions; + outletNode.HumRat = sumHumRat / sumFractions; + if (state.dataContaminantBalance->Contaminant.CO2Simulation) { + outletNode.CO2 = sumCO2 / sumFractions; + } + if (state.dataContaminantBalance->Contaminant.GenericContamSimulation) { + outletNode.GenContam = sumGenContam / sumFractions; + } + outletNode.Press = sumPressure / sumFractions; + + // Use Enthalpy and humidity ratio to get outlet temperature from psych chart + outletNode.Temp = Psychrometrics::PsyTdbFnHW(outletNode.Enthalpy, outletNode.HumRat); + } } +void ZoneReturnMixer::setInletConditions(EnergyPlusData &state) +{ + for (auto &mixerSpace : this->spaces) { + auto &spaceOutletNode = state.dataLoopNodes->Node(mixerSpace.spaceNodeNum); + int spaceZoneNodeNum = state.dataZoneEquip->spaceEquipConfig(mixerSpace.spaceIndex).ZoneNode; + auto &spaceNode = state.dataLoopNodes->Node(spaceZoneNodeNum); + spaceOutletNode.Temp = spaceNode.Temp; + spaceOutletNode.HumRat = spaceNode.HumRat; + spaceOutletNode.Enthalpy = spaceNode.Enthalpy; + spaceOutletNode.Press = spaceNode.Press; + if (state.dataContaminantBalance->Contaminant.CO2Simulation) { + spaceOutletNode.CO2 = spaceNode.CO2; + } + if (state.dataContaminantBalance->Contaminant.GenericContamSimulation) { + spaceOutletNode.GenContam = spaceNode.GenContam; + } + } +} void ZoneEquipmentMixer::setInletFlows(EnergyPlusData &state) { - if (this->zoneEquipInletNodeNum == 0) return; + if (this->outletNodeNum == 0) return; - auto &equipInletNode = state.dataLoopNodes->Node(this->zoneEquipInletNodeNum); + auto &equipInletNode = state.dataLoopNodes->Node(this->outletNodeNum); for (auto &mixerSpace : this->spaces) { auto &spaceOutletNode = state.dataLoopNodes->Node(mixerSpace.spaceNodeNum); spaceOutletNode.MassFlowRate = equipInletNode.MassFlowRate * mixerSpace.fraction; @@ -1974,6 +2006,35 @@ void ZoneEquipmentMixer::setInletFlows(EnergyPlusData &state) } } +void ZoneReturnMixer::setInletFlows(EnergyPlusData &state) +{ + if (this->outletNodeNum == 0) return; + auto &outletNode = state.dataLoopNodes->Node(this->outletNodeNum); + + Real64 sumMixerInletMassFlow = 0; + for (auto const &mixerSpace : this->spaces) { + // calc return flows for spaces feeding this mixer + auto &spaceEquipConfig = state.dataZoneEquip->spaceEquipConfig(mixerSpace.spaceIndex); + Real64 outletMassFlowRate = outletNode.MassFlowRate; // calcReturnFlows might adjust this parameter value, so make a copy here + Real64 spaceReturnFlow = 0.0; + spaceEquipConfig.calcReturnFlows(state, outletMassFlowRate, spaceReturnFlow); + sumMixerInletMassFlow += spaceReturnFlow; + } + + for (auto &mixerSpace : this->spaces) { + auto &spaceOutletNode = state.dataLoopNodes->Node(mixerSpace.spaceNodeNum); + // For return mixer, fraction is calculated every time step, not a user input + if (sumMixerInletMassFlow > 0.0) { + mixerSpace.fraction = spaceOutletNode.MassFlowRate / sumMixerInletMassFlow; + } else { + mixerSpace.fraction = 0.0; + } + spaceOutletNode.MassFlowRate = outletNode.MassFlowRate * mixerSpace.fraction; + spaceOutletNode.MassFlowRateMaxAvail = outletNode.MassFlowRateMaxAvail * mixerSpace.fraction; + spaceOutletNode.MassFlowRateMinAvail = outletNode.MassFlowRateMinAvail * mixerSpace.fraction; + } +} + void ZoneEquipmentSplitter::adjustLoads(EnergyPlusData &state, int zoneNum, int equipTypeNum) { auto &thisZoneEnergyDemand = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(zoneNum); diff --git a/src/EnergyPlus/DataZoneEquipment.hh b/src/EnergyPlus/DataZoneEquipment.hh index af898323a1b..772ee8001f6 100644 --- a/src/EnergyPlus/DataZoneEquipment.hh +++ b/src/EnergyPlus/DataZoneEquipment.hh @@ -326,10 +326,9 @@ namespace DataZoneEquipment { Array1D_int ReturnNodePlenumNum; // number of the return plenum attached to this return node (zero if none) Array1D_int ReturnFlowBasisNode; // return air flow basis nodes Array1D_int ReturnNodeExhaustNodeNum; // Exhaust node number flow to a corrsponding return node due to light heat gain - // Array1D_int SharedExhaustNode; // Exhaust node number shared by return nodes 0 No exhaust; 1 No share; > 1 shared; -1 use the - // exhaust node value Array1D SharedExhaustNode; // Exhaust node number shared by return nodes 0 No exhaust; 1 No share; > 1 shared; -1 use the exhaust node value + Array1D_int returnNodeSpaceMixerIndex; // index to SpaceHVAC:ZoneReturnMixer that feeds this return node (-1 if there is none) bool ZonalSystemOnly; // TRUE if served by a zonal system (only) bool IsControlled; // True when this is a controlled zone. @@ -482,22 +481,27 @@ namespace DataZoneEquipment { void adjustLoads(EnergyPlusData &state, int zoneNum, int equipTypeNum); }; - struct ZoneEquipmentMixer : ZoneEquipmentSplitterMixer + struct ZoneMixer : ZoneEquipmentSplitterMixer { - int zoneEquipInletNodeNum = 0; + int outletNodeNum = 0; void setOutletConditions(EnergyPlusData &state); + }; + + struct ZoneEquipmentMixer : ZoneMixer + { + // int zoneEquipInletNodeNum = 0; void setInletFlows(EnergyPlusData &state); }; - struct ZoneReturnMixer : ZoneEquipmentSplitterMixer + struct ZoneReturnMixer : ZoneMixer { - int zoneReturnNodeNum = 0; + // int zoneReturnNodeNum = 0; - // void setOutletConditions(EnergyPlusData &state); + void setInletConditions(EnergyPlusData &state); - // void setInletFlows(EnergyPlusData &state); + void setInletFlows(EnergyPlusData &state); }; struct ControlList { @@ -585,7 +589,7 @@ namespace DataZoneEquipment { int const zoneNum, InputProcessor::json const objectSchemaProps, InputProcessor::json const objectFields, - DataZoneEquipment::ZoneReturnMixer &thisZretMixer); + int mixerIndex); bool CheckZoneEquipmentList(EnergyPlusData &state, std::string_view ComponentType, // Type of component diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 3653be24fb4..df12bda5248 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -5170,6 +5170,15 @@ void CalcZoneLeavingConditions(EnergyPlusData &state, bool const FirstHVACIterat Real64 TempZoneAir; // Zone air temperature [C] Real64 SumRetAirLatentGainRate; + // If SpaceHVAC is active calculate SpaceHVAC:ReturnMixer inlet and outlet conditions before setting zone return conditions + if (state.dataHeatBal->doSpaceHeatBalanceSimulation && !state.dataGlobal->DoingSizing) { + for (auto &thisSpaceHVACMixer : state.dataZoneEquip->zoneReturnMixer) { + thisSpaceHVACMixer.setInletFlows(state); + thisSpaceHVACMixer.setInletConditions(state); + thisSpaceHVACMixer.setOutletConditions(state); + } + } + for (int ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) { if (!state.dataZoneEquip->ZoneEquipConfig(ZoneNum).IsControlled) continue; // A return air system may not exist for certain systems; Therefore when no return node exists diff --git a/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc b/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc index 8f27f0bfe7d..4d036e12ce8 100644 --- a/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc +++ b/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc @@ -5217,8 +5217,8 @@ TEST_F(EnergyPlusFixture, SpaceHVACMixerTest) mixSpace2.spaceNodeNum = 12; mixSpace3.spaceNodeNum = 13; state->dataLoopNodes->Node.allocate(13); - thisMixer.zoneEquipInletNodeNum = 1; - auto &equipInletNode = state->dataLoopNodes->Node(thisMixer.zoneEquipInletNodeNum); + thisMixer.outletNodeNum = 1; + auto &equipInletNode = state->dataLoopNodes->Node(thisMixer.outletNodeNum); auto &mixSpace1Node = state->dataLoopNodes->Node(mixSpace1.spaceNodeNum); auto &mixSpace2Node = state->dataLoopNodes->Node(mixSpace2.spaceNodeNum); auto &mixSpace3Node = state->dataLoopNodes->Node(mixSpace3.spaceNodeNum); From 58aa2f9ce372559c5a024c20ad58edabcbb78646 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Mon, 12 Aug 2024 15:55:27 -0500 Subject: [PATCH 115/164] Space IV-Transition etc --- src/EnergyPlus/DataZoneEquipment.hh | 4 ---- .../CreateNewIDFUsingRulesV24_2_0.f90 | 7 +++++++ .../InputRulesFiles/Rules24-1-0-to-24-2-0.md | 21 +++++++++++++++++-- .../OutputChanges24-1-0-to-24-2-0.md | 11 +++++++--- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/EnergyPlus/DataZoneEquipment.hh b/src/EnergyPlus/DataZoneEquipment.hh index 772ee8001f6..008be07c127 100644 --- a/src/EnergyPlus/DataZoneEquipment.hh +++ b/src/EnergyPlus/DataZoneEquipment.hh @@ -490,15 +490,11 @@ namespace DataZoneEquipment { struct ZoneEquipmentMixer : ZoneMixer { - // int zoneEquipInletNodeNum = 0; - void setInletFlows(EnergyPlusData &state); }; struct ZoneReturnMixer : ZoneMixer { - // int zoneReturnNodeNum = 0; - void setInletConditions(EnergyPlusData &state); void setInletFlows(EnergyPlusData &state); diff --git a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 index 78900861161..4ab6cd2ffb3 100644 --- a/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 +++ b/src/Transition/CreateNewIDFUsingRulesV24_2_0.f90 @@ -468,6 +468,13 @@ SUBROUTINE CreateNewIDFUsingRules(EndOfFile,DiffOnly,InLfn,AskForInput,InputFile ! If your original object starts with N, insert the rules here ! If your original object starts with O, insert the rules here + CASE('OUTPUTCONTROL:FILES') + CALL GetNewObjectDefInIDD(ObjectName,NwNumArgs,NwAorN,NwReqFld,NwObjMinFlds,NwFldNames,NwFldDefaults,NwFldUnits) + nodiff=.false. + OutArgs(1:8)=InArgs(1:8) + OutArgs(9) = InArgs(9) ! Set new Output Space Sizing the same as old Output Zone Sizing + OutArgs(10:CurArgs+1)=InArgs(9:CurArgs) + CurArgs = CurArgs + 1 ! If your original object starts with P, insert the rules here diff --git a/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md b/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md index dd4cf24cda0..e863dd25f13 100644 --- a/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md +++ b/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md @@ -50,7 +50,11 @@ There are three new optional heat recovery fields at the end which transition wi # Object Change: ObjectStartsWithN -# Object Change: ObjectStartsWithO +# Object Change: OutputControl:Files +Insert new field F9 "A9 , \field Output Space Sizing" +Set this to the same value as the old F9 "A9 , \field Output Zone Sizing". +Shift remaining fields down 1. +See pull request [#10566](https://github.com/NREL/EnergyPlus/pull/10566) for more details. # Object Change: ObjectStartsWithP @@ -72,4 +76,17 @@ There are three new optional heat recovery fields at the end which transition wi # Object Change: ObjectStartsWithY -# Object Change: ObjectStartsWithZ +# epJSON Field Name Changes: ZoneRefrigerationDoorMixing +`zone_1_name` --> `zone_or_space_name_1` +`zone_2_name` --> `zone_or_space_name_2` + +# epJSON Field Name Changes: ZoneCoolTower:Shower +`zone_name` --> `zone_or_space_name` + +# epJSON Field Name Changes: ZoneThermalChimney +`zone_1_name` --> `zone_or_space_name_1` +`relative_ratios_of_air_flow_rates_passing_through_zone_1` --> `relative_ratios_of_air_flow_rates_passing_through_inlet_1` +thru +`zone_20_name` --> `zone_or_space_name_20` +`relative_ratios_of_air_flow_rates_passing_through_zone_20` --> `relative_ratios_of_air_flow_rates_passing_through_inlet_20` + diff --git a/src/Transition/OutputRulesFiles/OutputChanges24-1-0-to-24-2-0.md b/src/Transition/OutputRulesFiles/OutputChanges24-1-0-to-24-2-0.md index ee0d911e964..06aa8ae379c 100644 --- a/src/Transition/OutputRulesFiles/OutputChanges24-1-0-to-24-2-0.md +++ b/src/Transition/OutputRulesFiles/OutputChanges24-1-0-to-24-2-0.md @@ -50,11 +50,12 @@ Temperature The EIO and html tabular output files now have a seprate heading and data stream for DX Heating Coils with the AHRI 2023 and prior versions. +``` ! , Component Type, Component Name, High Temperature Heating (net) Rating Capacity {W}, Low Temperature Heating (net) Rating Capacity {W}, HSPF {Btu/W-h}, Region Number ! , Component Type, Component Name, High Temperature Heating (net) Rating Capacity {W}, Low Temperature Heating (net) Rating Capacity {W}, HSPF2 {Btu/W-h}, Region Number +``` - -### Euipment Summary Report +### Equipment Summary Report Renamed a table name in the Equipment Summary report: @@ -115,8 +116,12 @@ In the Demand Controlled Ventilation table added the "type" Added an entirely new table called Thermostat Schedules -## New HVAC Topology report in Tabular Reports +### New HVAC Topology report in Tabular Reports The HVAC Topology report provides information about the arrangement of HVAC components in the supply and demand side of the airloop, zone equipment, and plant loop. Each row shows the additional component, sub-component, or sub-sub-component being added to the arrangement. +### New Space Sizing Output File (spsz) +When space sizing is active (ZoneAirHeatBalanceAlgorithm, "Do Space Heat Balance for Sizing=Yes") a new space sizing (spsz) output file is created, similar to the existing zone sizing (zsz) output. A new field "Output Space Sizing" has been added to OutputControl:Files to control this file. + +See pull request [#10566](https://github.com/NREL/EnergyPlus/pull/10566) for more details. From 3ccf6e5aa74b4f2d591db99dbdfc37f45deba79d Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Mon, 12 Aug 2024 16:00:23 -0500 Subject: [PATCH 116/164] Space IV-Update 5ZoneAirCooledWithSpacesHVAC --- testfiles/5ZoneAirCooledWithSpacesHVAC.idf | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/testfiles/5ZoneAirCooledWithSpacesHVAC.idf b/testfiles/5ZoneAirCooledWithSpacesHVAC.idf index aa2a19233fb..799f1f8e735 100644 --- a/testfiles/5ZoneAirCooledWithSpacesHVAC.idf +++ b/testfiles/5ZoneAirCooledWithSpacesHVAC.idf @@ -2536,9 +2536,20 @@ ZoneAirHeatBalanceAlgorithm, Zone 5 Exhaust Fan Inlet,!- Zone Equipment Inlet Node Name DesignCoolingLoad, !- Space Fraction Method Space 5 Conference, !- Space 1 Name - autosize, !- Space 1 Fraction {dimensionless} + autosize, !- Space 1 Fraction {dimensionless} Space 5 Conference Exhaust Fan Inlet; !- Space 1 Node Name + SpaceHVAC:ZoneReturnMixer, + Zone 5 Return Mixer, !- Name + Zone 5, !- Zone Name + Zone 5 Out Node, !- Zone Return Air Node Name + Space 5 Office, !- Space 1 Name + Space 5 Office Return Node, !- Space 1 Return Air Node Name + Space 5 Conference, !- Space 2 Name + Space 5 Conference Return Node, !- Space 2 Return Air Node Name + Zone 5-Remainder, !- Space 3 Name + Zone 5-Remainder Return Node; !- Space 3 Return Air Node Name + SpaceHVAC:EquipmentConnections, Space 5 Office, !- Space Name Space 5 Office In Node, !- Space Air Inlet Node or NodeList Name @@ -3828,6 +3839,20 @@ Output:Variable,*,Space Predicted Sensible Load to Setpoint Heat Transfer Rate,h Output:Variable,Space 5 Conference In Node,System Node Temperature,hourly; !- HVAC Average [kg/s] Output:Variable,Zone 5-Remainder In Node,System Node Temperature,hourly; !- HVAC Average [kg/s] + Output:Variable,Zone 5 Out Node,System Node Mass Flow Rate,hourly; !- HVAC Average [kg/s] + Output:Variable,Zone 5 Exhaust Fan Inlet,System Node Mass Flow Rate,hourly; !- HVAC Average [kg/s] + Output:Variable,Space 5 Office Return Node,System Node Mass Flow Rate,hourly; !- HVAC Average [kg/s] + Output:Variable,Space 5 Conference Return Node,System Node Mass Flow Rate,hourly; !- HVAC Average [kg/s] + Output:Variable,Space 5 Conference Exhaust Fan Inlet,System Node Mass Flow Rate,hourly; !- HVAC Average [kg/s] + Output:Variable,Zone 5-Remainder Return Node,System Node Mass Flow Rate,hourly; !- HVAC Average [kg/s] + + Output:Variable,Zone 5 Out Node,System Node Temperature,hourly; !- HVAC Average [kg/s] + Output:Variable,Zone 5 Exhaust Fan Inlet,System Node Temperature,hourly; !- HVAC Average [kg/s] + Output:Variable,Space 5 Office Return Node,System Node Temperature,hourly; !- HVAC Average [kg/s] + Output:Variable,Space 5 Conference Return Node,System Node Temperature,hourly; !- HVAC Average [kg/s] + Output:Variable,Space 5 Conference Exhaust Fan Inlet,System Node Temperature,hourly; !- HVAC Average [kg/s] + Output:Variable,Zone 5-Remainder Return Node,System Node Temperature,hourly; !- HVAC Average [kg/s] + Output:Variable,*,EMS Zone Wetbulb Globe Temperature,hourly; Output:Variable,*,EMS Space Wetbulb Globe Temperature,hourly; From 5e85740f91fa7a6a3d278de45274add1068def1b Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Mon, 12 Aug 2024 16:44:05 -0500 Subject: [PATCH 117/164] Space IV-SpaceHVACZoneReturnMixer 3 --- src/EnergyPlus/DataZoneEquipment.cc | 9 ++++----- src/EnergyPlus/ZoneEquipmentManager.cc | 9 ++++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/DataZoneEquipment.cc b/src/EnergyPlus/DataZoneEquipment.cc index 5228b809e6a..56e0952aac1 100644 --- a/src/EnergyPlus/DataZoneEquipment.cc +++ b/src/EnergyPlus/DataZoneEquipment.cc @@ -1136,6 +1136,10 @@ void processZoneEquipmentInput(EnergyPlusData &state, thisEquipConfig.NumReturnNodes = NumNodes; thisEquipConfig.ReturnNode.allocate(NumNodes); + thisEquipConfig.returnNodeSpaceMixerIndex.allocate(NumNodes); + for (int &mixIndex : thisEquipConfig.returnNodeSpaceMixerIndex) { + mixIndex = -1; + } thisEquipConfig.ReturnNodeAirLoopNum.allocate(NumNodes); thisEquipConfig.ReturnNodeRetPathNum.allocate(NumNodes); thisEquipConfig.ReturnNodeRetPathCompNum.allocate(NumNodes); @@ -1429,11 +1433,6 @@ void processZoneReturnMixerInput(EnergyPlusData &state, // Check zone return nodes bool found = false; auto &thisZoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(zoneNum); - thisZoneEquipConfig.returnNodeSpaceMixerIndex.allocate(thisZoneEquipConfig.NumReturnNodes); - for (int &mixIndex : thisZoneEquipConfig.returnNodeSpaceMixerIndex) { - mixIndex = -1; - } - int nodeCounter = 0; for (int retNodeNum : thisZoneEquipConfig.ReturnNode) { ++nodeCounter; diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index df12bda5248..d321e8965c4 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -5207,7 +5207,14 @@ void CalcZoneLeavingConditions(EnergyPlusData &state, bool const FirstHVACIterat } // user defined room air model may feed temp that differs from zone node - if (allocated(state.dataRoomAir->AirPatternZoneInfo)) { + + if (state.dataHeatBal->doSpaceHeatBalanceSimulation && !state.dataGlobal->DoingSizing && + (state.dataZoneEquip->ZoneEquipConfig(ZoneNum).returnNodeSpaceMixerIndex(nodeCount) > -1)) { + // If a SpaceHVAC:ZoneReturnMixer feeds this node, use the node conditions which was set above in + // thisSpaceHVACMixer.setOutletConditions + TempZoneAir = state.dataLoopNodes->Node(ReturnNode).Temp; + TempRetAir = TempZoneAir; + } else if (allocated(state.dataRoomAir->AirPatternZoneInfo)) { if ((state.dataRoomAir->AirPatternZoneInfo(ZoneNum).IsUsed) && (!state.dataGlobal->BeginEnvrnFlag)) { TempZoneAir = state.dataRoomAir->AirPatternZoneInfo(ZoneNum).Tleaving; TempRetAir = TempZoneAir; From de9baf302ad24431736e9968f9e9cce2cc0a0d6a Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Mon, 12 Aug 2024 14:46:27 -0700 Subject: [PATCH 118/164] change OnOffFanPartLoadFraction back to use PLF --- src/EnergyPlus/DXCoils.cc | 2 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 2738bf5f501..c2fcfaef4a0 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -16880,7 +16880,7 @@ void CalcVRFCoolingCoil_FluidTCtrl(EnergyPlusData &state, } // If cycling fan, send coil part-load fraction to on/off fan via HVACDataGlobals - if (fanOp == HVAC::FanOp::Cycling) state.dataHVACGlobal->OnOffFanPartLoadFraction = thisDXCoil.CoolingCoilRuntimeFraction; + if (fanOp == HVAC::FanOp::Cycling) state.dataHVACGlobal->OnOffFanPartLoadFraction = PLF; // Check for saturation error and modify temperature at constant enthalpy if (OutletAirTemp < PsyTsatFnHPb(state, OutletAirEnthalpy, OutdoorPressure)) { diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 497f4a341a1..dee354b86d5 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12828,7 +12828,16 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state, auto *fan = state.dataFans->fans(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).FanIndex); if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType == HVAC::FanType::SystemModel) { if (OnOffAirFlowRatio > 0.0) { - fan->simulate(state, FirstHVACIteration, _, _, _, fan->inletAirMassFlowRate, OnOffFanPartLoadFraction, 0, 0, _); + fan->simulate(state, + FirstHVACIteration, + _, + _, + _, + fan->inletAirMassFlowRate, + state.dataDXCoils->DXCoil(this->CoolCoilIndex).CoolingCoilRuntimeFraction, + 0, + 0, + _); } else { fan->simulate(state, FirstHVACIteration, _, _, PartLoadRatio); } From 64018cfae450593e5e0f4077ec49f2d5bd9a47ef Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Tue, 13 Aug 2024 13:18:42 +0200 Subject: [PATCH 119/164] Catch floating point exceptions on MSVC for gtest + add cmake `FORCE_DEBUG_ARITHM_MSVC` to enable in release builds too --- cmake/CompilerFlags.cmake | 16 ++++++++++------ src/EnergyPlus/api/EnergyPlusPgm.cc | 27 +++++++++++++++++---------- src/EnergyPlus/main.cc | 8 -------- tst/EnergyPlus/unit/main.cc | 16 ++++++++++++++++ 4 files changed, 43 insertions(+), 24 deletions(-) diff --git a/cmake/CompilerFlags.cmake b/cmake/CompilerFlags.cmake index bfc9fb3b8b7..9acc1c3691a 100644 --- a/cmake/CompilerFlags.cmake +++ b/cmake/CompilerFlags.cmake @@ -76,15 +76,19 @@ if(MSVC AND NOT ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")) # Visual C++ (VS target_compile_options(project_options INTERFACE $<$:/Ob0>) # Disable inlining target_compile_options(project_options INTERFACE $<$:/RTCsu>) # Runtime checks target_compile_options(project_fp_options INTERFACE $<$:/fp:strict>) # Floating point model - target_compile_options(project_options INTERFACE $<$:/DMSVC_DEBUG>) # Triggers code in main.cc to catch floating point NaNs - target_compile_options(turn_off_warnings INTERFACE /W0) + option(FORCE_DEBUG_ARITHM_MSVC "Enable trapping floating point exceptions in non Debug mode" OFF) + mark_as_advanced(FORCE_DEBUG_ARITHM_MSVC) + + set(need_arithm_debug_genex "$,$>") + + # in main.cc for E+ (actual: api/EnergyPlusPgm.cc) and gtest: will catch _EM_ZERODIVIDE | _EM_INVALID | _EM_OVERFLOW + target_compile_definitions(project_fp_options INTERFACE $<${need_arithm_debug_genex}:DEBUG_ARITHM_MSVC>) + elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") # g++/Clang - # TODO: after we fix all test, enable this by default on Debug builds - # option(FORCE_DEBUG_ARITHM_GCC_OR_CLANG "Enable trapping floating point exceptions in non Debug mode" OFF) - option(FORCE_DEBUG_ARITHM_GCC_OR_CLANG "Enable trapping floating point exceptions" OFF) + option(FORCE_DEBUG_ARITHM_GCC_OR_CLANG "Enable trapping floating point exceptions in non Debug mode" OFF) mark_as_advanced(FORCE_DEBUG_ARITHM_GCC_OR_CLANG) # COMPILER FLAGS @@ -126,7 +130,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" O set(need_arithm_debug_genex "$,$>") - # in main.cc for E+ and gtest: feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) + # in main.cc for E+ (actual: api/EnergyPlusPgm.cc) and gtest: feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW) target_compile_definitions(project_fp_options INTERFACE $<${need_arithm_debug_genex}:DEBUG_ARITHM_GCC_OR_CLANG>) include(CheckCXXSymbolExists) check_cxx_symbol_exists(feenableexcept "fenv.h" HAVE_FEENABLEEXCEPT) diff --git a/src/EnergyPlus/api/EnergyPlusPgm.cc b/src/EnergyPlus/api/EnergyPlusPgm.cc index a86e8c1a94e..6c7a375f371 100644 --- a/src/EnergyPlus/api/EnergyPlusPgm.cc +++ b/src/EnergyPlus/api/EnergyPlusPgm.cc @@ -182,10 +182,12 @@ #include #include -#ifndef NDEBUG -#ifdef __unix__ -#include +#ifdef DEBUG_ARITHM_GCC_OR_CLANG +#include #endif + +#ifdef DEBUG_ARITHM_MSVC +#include #endif // ObjexxFCL Headers @@ -248,17 +250,22 @@ void commonInitialize(EnergyPlus::EnergyPlusData &state) // std::cin.tie(nullptr); // Untie cin and cout: Could cause odd behavior for interactive prompts // Enable floating point exceptions -#ifndef NDEBUG -#ifdef __unix__ +#ifdef DEBUG_ARITHM_GCC_OR_CLANG feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); // These exceptions are enabled (FE_INEXACT and FE_UNDERFLOW will not throw) #endif -#endif -#ifdef MSVC_DEBUG - // the following line enables NaN detection in Visual Studio debug builds. See +#ifdef DEBUG_ARITHM_MSVC + // the following enables NaN detection in Visual Studio debug builds. See // https://github.com/NREL/EnergyPlus/wiki/Debugging-Tips - int fp_control_state = - _controlfp(_EM_INEXACT | _EM_UNDERFLOW, _MCW_EM); // These exceptions are disabled (_EM_INEXACT and _EM_UNDERFLOW will not throw) + + // Note: what you need to pass to the _controlfp_s is actually the opposite + // By default all bits are 1, and the exceptions are turned off, so you need to turn off the bits for the exceptions you want to enable + // > For the _MCW_EM mask, clearing it sets the exception, which allows the hardware exception; setting it hides the exception. + unsigned int fpcntrl = 0; + _controlfp_s(&fpcntrl, 0, 0); + unsigned int new_exceptions = _EM_ZERODIVIDE | _EM_INVALID | _EM_OVERFLOW; + unsigned int new_control = fpcntrl & ~new_exceptions; + _controlfp_s(&fpcntrl, new_control, _MCW_EM); #endif #ifdef _MSC_VER diff --git a/src/EnergyPlus/main.cc b/src/EnergyPlus/main.cc index b7ee17b6659..cffbc573080 100644 --- a/src/EnergyPlus/main.cc +++ b/src/EnergyPlus/main.cc @@ -50,16 +50,8 @@ #include -#ifdef DEBUG_ARITHM_GCC_OR_CLANG -#include -#endif - int main(int argc, char **argv) { -#ifdef DEBUG_ARITHM_GCC_OR_CLANG - feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); -#endif - #ifdef _WIN32 const std::vector args = CLI::detail::compute_win32_argv(); #else diff --git a/tst/EnergyPlus/unit/main.cc b/tst/EnergyPlus/unit/main.cc index 45d9421cf3b..b46336bf040 100644 --- a/tst/EnergyPlus/unit/main.cc +++ b/tst/EnergyPlus/unit/main.cc @@ -54,6 +54,10 @@ #include #endif +#ifdef DEBUG_ARITHM_MSVC +#include +#endif + // Google Test main int main(int argc, char **argv) { @@ -68,5 +72,17 @@ int main(int argc, char **argv) #ifdef DEBUG_ARITHM_GCC_OR_CLANG feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); #endif + +#ifdef DEBUG_ARITHM_MSVC + // Note: what you need to pass to the _controlfp_s is actually the opposite + // By default all bits are 1, and the exceptions are turned off, so you need to turn off the bits for the exceptions you want to enable + // > For the _MCW_EM mask, clearing it sets the exception, which allows the hardware exception; setting it hides the exception. + unsigned int fpcntrl = 0; + _controlfp_s(&fpcntrl, 0, 0); + unsigned int new_exceptions = _EM_ZERODIVIDE | _EM_INVALID | _EM_OVERFLOW; + unsigned int new_control = fpcntrl & ~new_exceptions; + _controlfp_s(&fpcntrl, new_control, _MCW_EM); +#endif + return RUN_ALL_TESTS(); } From b6be21a3bbda26433f172ffa18d44086325018ab Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 13 Aug 2024 10:56:21 -0400 Subject: [PATCH 120/164] Fix 5 DX coil unit tests --- src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc | 7 ++----- src/EnergyPlus/DXCoils.cc | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc b/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc index 60339fe5202..1cf816f2658 100644 --- a/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc @@ -378,11 +378,8 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, FlagCheckVolFlowPerRatedTotCap = false; } - if (this->dataIsDXCoil && FlagCheckVolFlowPerRatedTotCap) { - Real64 RatedVolFlowPerRatedTotCap = 0.0; - if (this->autoSizedValue > 0.0) { - RatedVolFlowPerRatedTotCap = DesVolFlow / this->autoSizedValue; - } + if (this->dataIsDXCoil && FlagCheckVolFlowPerRatedTotCap && this->autoSizedValue > 0.0) { + Real64 RatedVolFlowPerRatedTotCap = DesVolFlow / this->autoSizedValue; if (RatedVolFlowPerRatedTotCap < HVAC::MinRatedVolFlowPerRatedTotCap[(int)state.dataHVACGlobal->DXCT]) { if ((this->dataEMSOverride == 0.0) && state.dataGlobal->DisplayExtraWarnings && this->printWarningFlag) { ShowWarningError(state, this->callingRoutine + ' ' + this->compType + ' ' + this->compName); diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index c2fcfaef4a0..72fa482395f 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -4099,6 +4099,7 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.MSRatedCOP.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSRatedAirVolFlowRate.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSRatedAirMassFlowRate.allocate(thisDXCoil.NumOfSpeeds); + thisDXCoil.MSRatedAirMassFlowRate = 1.0; // avoid divide by 0, will get overwritten in getInput or sizing thisDXCoil.MSCCapFTemp.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSCCapFFlow.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSEIRFTemp.allocate(thisDXCoil.NumOfSpeeds); @@ -4613,6 +4614,7 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.MSRatedCOP.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSRatedAirVolFlowRate.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSRatedAirMassFlowRate.allocate(thisDXCoil.NumOfSpeeds); + thisDXCoil.MSRatedAirMassFlowRate = 1.0; // avoid divide by 0, will get overwritten in getInput or sizing thisDXCoil.MSCCapFTemp.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSCCapFFlow.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSEIRFTemp.allocate(thisDXCoil.NumOfSpeeds); From 9bd214312fbd8eacf38b18946c8bf50f0e1178d9 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Tue, 13 Aug 2024 11:43:17 -0500 Subject: [PATCH 121/164] Space for IlluminanceMap --- .../src/overview/group-daylighting.tex | 10 +-- idd/Energy+.idd.in | 3 +- src/EnergyPlus/DataDaylighting.hh | 1 + src/EnergyPlus/DaylightingManager.cc | 70 +++++++++++-------- .../InputRulesFiles/Rules24-1-0-to-24-2-0.md | 3 +- 5 files changed, 52 insertions(+), 35 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-daylighting.tex b/doc/input-output-reference/src/overview/group-daylighting.tex index 340e6df8e8d..769bf3ae999 100644 --- a/doc/input-output-reference/src/overview/group-daylighting.tex +++ b/doc/input-output-reference/src/overview/group-daylighting.tex @@ -505,7 +505,7 @@ \subsubsection{Outputs}\label{outputs-1-004} \subsection{Output:IlluminanceMap}\label{outputilluminancemap} -The Output:IlluminanceMap object expands on the reporting capabilities of the daylighting simulation. For any zone simulated with \hyperref[daylightingcontrols-000]{Daylighting:Controls}, the illuminance map can generate up to 2,500 points of additional daylighting illuminance values. The resulting map is output as a comma delimited text file that can be imported into a spreadsheet program for rapid visualization of the daylighting illuminance patterns in a zone. The values are produced on an hourly basis. The Z height of the map is constant (parallel to a flat floor). More than one illuminance map can be created for a zone. IlluminanceMap output is available only when SplitFlux daylighting method is selected in \hyperref[daylightingcontrols-000]{Daylighting:Controls} object. +The Output:IlluminanceMap object expands on the reporting capabilities of the daylighting simulation. For any space or zone simulated with \hyperref[daylightingcontrols-000]{Daylighting:Controls}, the illuminance map can generate up to 2,500 points of additional daylighting illuminance values. The resulting map is output as a comma delimited text file that can be imported into a spreadsheet program for rapid visualization of the daylighting illuminance patterns in a space or zone. The values are produced on an hourly basis. The Z height of the map is constant (parallel to a flat floor). More than one illuminance map can be created for a space or zone. IlluminanceMap output is available only when SplitFlux daylighting method is selected in \hyperref[daylightingcontrols-000]{Daylighting:Controls} object. \subsubsection{Inputs}\label{inputs-4-006} @@ -513,13 +513,13 @@ \subsubsection{Inputs}\label{inputs-4-006} The name of the map object. -\paragraph{Field: Zone Name}\label{field-zone-name-2-000} +\paragraph{Field: Zone or Space Name}\label{field-zone-name-2-000} -Reference to a zone with \hyperref[daylightingcontrols-000]{Daylighting:Controls}. The zone must lie completely within a single solar enclosure. +Reference to a zone or space with \hyperref[daylightingcontrols-000]{Daylighting:Controls}. If a zone name is specified, all spaces in the zone must be within the same solar enclosure. \paragraph{Field: Z Height}\label{field-z-height} -The height or elevation of the grid of daylighting points. +The height or elevation of the grid of daylighting points. Coordinates may be world or relative as specified in the \hyperref[globalgeometryrules]{GlobalGeometryRules} object Daylighting Reference Point CoordinateSystem field. If a space name is specifice for this map, relative coodinates are relative to the origin of the zone that contains the space (spaces do not have a separate origin). \paragraph{Field: X Minimum Coordinate}\label{field-x-minimum-coordinate} @@ -551,7 +551,7 @@ \subsubsection{Inputs}\label{inputs-4-006} Output:IlluminanceMap, Daylit Map, ! Map Name - Daylit Zone, ! Zone Name + Daylit Zone, ! Zone or Space Name 0, ! Z Height [m] 0.1, ! X Minimum Coordinate [m] 4.9, ! X Maximum Coordinate [m] diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index c8c81ed5963..1244abd0c0d 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -23840,10 +23840,11 @@ Output:IlluminanceMap, \memo Daylighting Reference Point CoordinateSystem field A1 , \field Name \required-field - A2 , \field Zone Name + A2 , \field Zone or Space Name \required-field \type object-list \object-list ZoneNames + \object-list SpaceNames N1 , \field Z height \units m \type real diff --git a/src/EnergyPlus/DataDaylighting.hh b/src/EnergyPlus/DataDaylighting.hh index 187e07670bb..9f61690fc42 100644 --- a/src/EnergyPlus/DataDaylighting.hh +++ b/src/EnergyPlus/DataDaylighting.hh @@ -245,6 +245,7 @@ namespace Dayltg { { // Members std::string Name; // Map name + int spaceIndex = 0; // Index to space being mapped int zoneIndex = 0; // Index to zone being mapped int enclIndex = 0; // Index to enclosure for this map Real64 Z = 0.0; // Elevation or height diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index c06f9dee700..dc7bbaecc4c 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -700,10 +700,15 @@ void CalcDayltgCoeffsRefMapPoints(EnergyPlusData &state) if ((int)dl->illumMaps.size() > 0) { for (int MapNum = 1; MapNum <= (int)dl->illumMaps.size(); ++MapNum) { int mapZoneNum = dl->illumMaps(MapNum).zoneIndex; + std::string name = format("Zone={}", state.dataHeatBal->Zone(mapZoneNum).Name); + int mapSpaceNum = dl->illumMaps(MapNum).spaceIndex; + if (mapSpaceNum > 0) { + name = format("Space={}", state.dataHeatBal->space(mapSpaceNum).Name); + } if (state.dataGlobal->WarmupFlag) { - DisplayString(state, "Calculating Daylighting Coefficients (Map Points), Zone=" + state.dataHeatBal->Zone(mapZoneNum).Name); + DisplayString(state, format("Calculating Daylighting Coefficients (Map Points), {}", name)); } else { - DisplayString(state, "Updating Daylighting Coefficients (Map Points), Zone=" + state.dataHeatBal->Zone(mapZoneNum).Name); + DisplayString(state, format("Updating Daylighting Coefficients (Map Points), {}", name)); } CalcDayltgCoeffsMapPoints(state, MapNum); } @@ -4033,37 +4038,46 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) auto &illumMap = dl->illumMaps(MapNum); illumMap.Name = ipsc->cAlphaArgs(1); - illumMap.zoneIndex = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); - - if (illumMap.zoneIndex == 0) { - ShowSevereError(state, - format("{}=\"{}\", invalid {}=\"{}\".", - ipsc->cCurrentModuleObject, - ipsc->cAlphaArgs(1), - ipsc->cAlphaFieldNames(2), - ipsc->cAlphaArgs(2))); - ErrorsFound = true; + int const spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->space); + if (spaceNum > 0) { + illumMap.spaceIndex = spaceNum; + illumMap.zoneIndex = state.dataHeatBal->space(spaceNum).zoneNum; + illumMap.enclIndex = state.dataHeatBal->space(spaceNum).solarEnclosureNum; + assert(illumMap.enclIndex > 0); } else { - // set enclosure index for first space in zone - int zoneNum = illumMap.zoneIndex; - int enclNum = state.dataHeatBal->space(state.dataHeatBal->Zone(zoneNum).spaceIndexes(1)).solarEnclosureNum; - illumMap.enclIndex = enclNum; - // check that all spaces in the zone are in the same enclosure - for (int spaceCounter = 2; spaceCounter <= state.dataHeatBal->Zone(zoneNum).numSpaces; ++spaceCounter) { - int spaceNum = state.dataHeatBal->Zone(zoneNum).spaceIndexes(spaceCounter); - if (enclNum != state.dataHeatBal->space(spaceNum).solarEnclosureNum) { - ShowSevereError(state, - format("{}=\"{}\" All spaces in the zone must be in the same enclosure for daylighting illuminance maps.", - ipsc->cCurrentModuleObject, - ipsc->cAlphaArgs(1))); - ErrorsFound = true; - break; + illumMap.zoneIndex = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); + if (illumMap.zoneIndex == 0) { + ShowSevereError(state, + format("{}=\"{}\", invalid {}=\"{}\".", + ipsc->cCurrentModuleObject, + ipsc->cAlphaArgs(1), + ipsc->cAlphaFieldNames(2), + ipsc->cAlphaArgs(2))); + ErrorsFound = true; + } else { + // set enclosure index for first space in zone + int zoneNum = illumMap.zoneIndex; + int enclNum = state.dataHeatBal->space(state.dataHeatBal->Zone(zoneNum).spaceIndexes(1)).solarEnclosureNum; + illumMap.enclIndex = enclNum; + // check that all spaces in the zone are in the same enclosure + for (int spaceCounter = 2; spaceCounter <= state.dataHeatBal->Zone(zoneNum).numSpaces; ++spaceCounter) { + int spaceNum = state.dataHeatBal->Zone(zoneNum).spaceIndexes(spaceCounter); + if (enclNum != state.dataHeatBal->space(spaceNum).solarEnclosureNum) { + ShowSevereError(state, + format("{}=\"{}\" All spaces in the zone must be in the same enclosure for daylighting illuminance maps.", + ipsc->cCurrentModuleObject, + ipsc->cAlphaArgs(1))); + ShowContinueError( + state, + format("Zone=\"{}\" spans multiple enclosures. Use a Space Name instead.", state.dataHeatBal->Zone(zoneNum).Name)); + ErrorsFound = true; + break; + } } } } illumMap.Z = ipsc->rNumericArgs(1); - illumMap.Xmin = ipsc->rNumericArgs(2); illumMap.Xmax = ipsc->rNumericArgs(3); if (ipsc->rNumericArgs(2) > ipsc->rNumericArgs(3)) { @@ -4308,6 +4322,7 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) } } ZoneMsgDone.deallocate(); + if (ErrorsFound) return; if (TotIllumMaps > 0) { print(state.files.eio, @@ -4330,7 +4345,6 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) illumMap.Z); } - if (ErrorsFound) return; } // GetInputIlluminanceMap() void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) diff --git a/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md b/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md index dd4cf24cda0..ab8d337958b 100644 --- a/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md +++ b/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md @@ -50,7 +50,8 @@ There are three new optional heat recovery fields at the end which transition wi # Object Change: ObjectStartsWithN -# Object Change: ObjectStartsWithO +# epJSON Field Name Change: Output:IlluminanceMap +`zone_name` --> `zone_or_space_name` # Object Change: ObjectStartsWithP From c01601c1a95d3c5cf0c319b97da58f10cc729419 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Tue, 13 Aug 2024 12:07:31 -0500 Subject: [PATCH 122/164] Skip builtin EMS vars and add testing of new endpoints --- scripts/dev/verify_idfs_in_cmake.py | 2 +- src/EnergyPlus/CMakeLists.txt | 2 +- src/EnergyPlus/DataRuntimeLanguage.hh | 5 + src/EnergyPlus/RuntimeLanguageProcessor.cc | 3 + src/EnergyPlus/api/datatransfer.cc | 15 +- src/EnergyPlus/api/datatransfer.h | 6 + src/EnergyPlus/api/datatransfer.py | 15 +- .../_1ZoneUncontrolled_ForAPITesting.idf | 466 ++++++++++++++++++ tst/EnergyPlus/api/TestDataTransfer.c | 28 +- tst/EnergyPlus/api/TestDataTransfer.py | 20 + 10 files changed, 552 insertions(+), 10 deletions(-) create mode 100644 testfiles/_1ZoneUncontrolled_ForAPITesting.idf diff --git a/scripts/dev/verify_idfs_in_cmake.py b/scripts/dev/verify_idfs_in_cmake.py index 2c48a107401..2adaa1b45ce 100755 --- a/scripts/dev/verify_idfs_in_cmake.py +++ b/scripts/dev/verify_idfs_in_cmake.py @@ -94,7 +94,7 @@ # there are a few files we purposely skip files_to_skip = {"_1a-Long0.0.idf", "_ExternalInterface-actuator.idf", "_ExternalInterface-schedule.idf", "_ExternalInterface-variable.idf", "HVAC3Zone-IntGains-Def.imf", "HVAC3ZoneChillerSpec.imf", - "HVAC3ZoneGeometry.imf", "HVAC3ZoneMat-Const.imf"} + "HVAC3ZoneGeometry.imf", "HVAC3ZoneMat-Const.imf", "_1ZoneUncontrolled_ForAPITesting.idf"} found_idf_files_trimmed = found_idf_files - files_to_skip # the CMakeLists file will always have "forward" slashes diff --git a/src/EnergyPlus/CMakeLists.txt b/src/EnergyPlus/CMakeLists.txt index 9f4f3565624..cfb928e00dc 100644 --- a/src/EnergyPlus/CMakeLists.txt +++ b/src/EnergyPlus/CMakeLists.txt @@ -991,7 +991,7 @@ if(BUILD_TESTING) -DEPW_FILE=USA_CO_Golden-NREL.724666_TMY3.epw -P ${PROJECT_SOURCE_DIR}/cmake/RunCallbackTest.cmake) set(EPW_FILE "${PROJECT_SOURCE_DIR}/weather/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw") - set(IDF_FILE "${PROJECT_SOURCE_DIR}/testfiles/1ZoneUncontrolled.idf") + set(IDF_FILE "${PROJECT_SOURCE_DIR}/testfiles/_1ZoneUncontrolled_ForAPITesting.idf") add_executable(TestAPI_Functional_C ${PROJECT_SOURCE_DIR}/tst/EnergyPlus/api/TestFunctional.c) # project_warnings is essentially a C++ interface, and not included here because this is C, not C++ diff --git a/src/EnergyPlus/DataRuntimeLanguage.hh b/src/EnergyPlus/DataRuntimeLanguage.hh index dbfb131cda2..e55cc25e588 100644 --- a/src/EnergyPlus/DataRuntimeLanguage.hh +++ b/src/EnergyPlus/DataRuntimeLanguage.hh @@ -737,6 +737,11 @@ namespace DataRuntimeLanguage { struct RuntimeLanguageData : BaseGlobalStruct { + // In the API, we allow the user to manipulate user-defined EMS globals, but we skip the built-in ones to avoid + // problems. This constexpr should be incremented if we ever add more built-ins so that we skip the right amount + // in the API calls. + static int constexpr NumBuiltInErlVariables = 27; + int NumProgramCallManagers = 0; // count of Erl program managers with calling points int NumSensors = 0; // count of EMS sensors used in model (data from output variables) int numActuatorsUsed = 0; // count of EMS actuators used in model diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index 71214b90f17..0e08e3b2ba5 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -160,6 +160,9 @@ void InitializeRuntimeLanguage(EnergyPlusData &state) state.dataRuntimeLangProcessor->ActualTimeNum = NewEMSVariable(state, "ACTUALTIME", 0); state.dataRuntimeLangProcessor->WarmUpFlagNum = NewEMSVariable(state, "WARMUPFLAG", 0); + // this ensures we stay in sync with the number of skipped built-ins for API calls + assert(state.dataRuntimeLang->NumErlVariables == state.dataRuntimeLang->NumBuiltInErlVariables); + GetRuntimeLanguageUserInput(state); // Load and parse all runtime language objects date_and_time(datestring, _, _, datevalues); diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index 066e0ccfb6e..26017f46c0a 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -248,6 +248,14 @@ char *inputFilePath(EnergyPlusState state) return p; } +char *epwFilePath(EnergyPlusState state) +{ + const auto *thisState = static_cast(state); + char *p = new char[std::strlen(thisState->files.inputWeatherFilePath.filePath.c_str()) + 1]; + std::strcpy(p, thisState->files.inputWeatherFilePath.filePath.c_str()); + return p; +} + char **getObjectNames(EnergyPlusState state, const char *objectType, unsigned int *resultingSize) { const auto *thisState = static_cast(state); @@ -588,6 +596,9 @@ int getEMSGlobalVariableHandle(EnergyPlusState state, const char *name) int index = 0; for (auto const &erlVar : thisState->dataRuntimeLang->ErlVariable) { index++; + if (index <= thisState->dataRuntimeLang->NumBuiltInErlVariables) { + continue; // don't return handles to the built-in EMS variables, they can be accessed via API endpoints + } if (EnergyPlus::Util::SameString(name, erlVar.Name)) { return index; } @@ -598,7 +609,7 @@ int getEMSGlobalVariableHandle(EnergyPlusState state, const char *name) Real64 getEMSGlobalVariableValue(EnergyPlusState state, int handle) { auto *thisState = static_cast(state); - if (handle < 0 || handle > thisState->dataRuntimeLang->NumErlVariables) { + if (handle < thisState->dataRuntimeLang->NumBuiltInErlVariables || handle > thisState->dataRuntimeLang->NumErlVariables) { // need to fatal out once the process is done // throw an error, set the fatal flag, and then return 0 EnergyPlus::ShowSevereError( @@ -614,7 +625,7 @@ Real64 getEMSGlobalVariableValue(EnergyPlusState state, int handle) void setEMSGlobalVariableValue(EnergyPlusState state, int handle, Real64 value) { auto *thisState = static_cast(state); - if (handle < 0 || handle > thisState->dataRuntimeLang->NumErlVariables) { + if (handle < thisState->dataRuntimeLang->NumBuiltInErlVariables || handle > thisState->dataRuntimeLang->NumErlVariables) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return EnergyPlus::ShowSevereError( diff --git a/src/EnergyPlus/api/datatransfer.h b/src/EnergyPlus/api/datatransfer.h index 6ab69306286..7b31ba56970 100644 --- a/src/EnergyPlus/api/datatransfer.h +++ b/src/EnergyPlus/api/datatransfer.h @@ -127,6 +127,12 @@ ENERGYPLUSLIB_API void resetErrorFlag(EnergyPlusState state); /// \param[in] state An active EnergyPlusState instance created with `stateNew`. /// \return A char * of the input file path. This allocates a new char *, and calling clients must free this when done with it! ENERGYPLUSLIB_API char *inputFilePath(EnergyPlusState state); +/// \brief Provides the weather file path back to the user +/// \details In most circumstances the client will know the path to the weather file, but there are some cases where code +/// is generalized in unexpected workflows. Users have requested a way to get the weather file path back from the running instance. +/// \param[in] state An active EnergyPlusState instance created with `stateNew`. +/// \return A char * of the weather file path. This allocates a new char *, and calling clients must free this when done with it! +ENERGYPLUSLIB_API char *epwFilePath(EnergyPlusState state); // ----- DATA TRANSFER HELPER FUNCTIONS diff --git a/src/EnergyPlus/api/datatransfer.py b/src/EnergyPlus/api/datatransfer.py index 312da6c0a3b..7f7985b9721 100644 --- a/src/EnergyPlus/api/datatransfer.py +++ b/src/EnergyPlus/api/datatransfer.py @@ -141,6 +141,8 @@ def __init__(self, api: cdll, running_as_python_plugin: bool = False): self.api.resetErrorFlag.restype = c_void_p self.api.inputFilePath.argtypes = [c_void_p] self.api.inputFilePath.restype = c_char_p + self.api.epwFilePath.argtypes = [c_void_p] + self.api.epwFilePath.restype = c_char_p self.api.requestVariable.argtypes = [c_void_p, c_char_p, c_char_p] self.api.getNumNodesInCondFDSurfaceLayer.argtypes = [c_void_p, c_char_p, c_char_p] self.api.requestVariable.restype = c_void_p @@ -370,7 +372,18 @@ def get_input_file_path(self, state: c_void_p) -> bytes: :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. :return: Returns a raw bytes representation of the input file path """ - return self.api.inputFilePath(state) + return self.api.inputFilePath(state) # TODO: Need to call free for the underlying char *? + + def get_weather_file_path(self, state: c_void_p) -> bytes: + """ + Provides the weather file path back to the client. In most circumstances the client will know the path to the + weather file, but there are some cases where code is generalized in unexpected workflows. Users have requested + a way to get the weather file path back from the running instance. + + :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. + :return: Returns a raw bytes representation of the weather file path + """ + return self.api.epwFilePath(state) def get_object_names(self, state: c_void_p, object_type_name: Union[str, bytes]) -> List[str]: """ diff --git a/testfiles/_1ZoneUncontrolled_ForAPITesting.idf b/testfiles/_1ZoneUncontrolled_ForAPITesting.idf new file mode 100644 index 00000000000..371220f4605 --- /dev/null +++ b/testfiles/_1ZoneUncontrolled_ForAPITesting.idf @@ -0,0 +1,466 @@ +!-Generator IDFEditor 1.34 +!-Option OriginalOrderTop UseSpecialFormat +!-NOTE: All comments with '!-' are ignored by the IDFEditor and are generated automatically. +!- Use '!' comments if they need to be retained when using the IDFEditor. +!1ZoneUncontrolled.idf +! Basic file description: Basic test for EnergyPlus. Resistive Walls. Regular (no ground contact) floor. +! Regular roof. No Windows. +! +! Highlights: Very basic test to see that EnergyPlus "works". +! +! +! Simulation Location/Run: Denver Centennial Golden CO USA WMO=724666, 2 design days, 1 run period, +! Run Control executes two design days (see RUN PERIOD object) +! +! Location: Denver, CO +! +! Design Days: Denver Centennial Golden CO USA Annual Heating 99%, MaxDB=-15.5°C +! Denver Centennial Golden CO USA Annual Cooling (DB=>MWB) 1%, MaxDB=32°C MWB=15.5°C +! +! Run Period (Weather File): Full Annual Simulation, DENVER_STAPLETON_CO_USA_WMO_724690 +! +! Run Control: No zone or system sizing, design day run control (no weather file simulation) +! +! Building: Fictional 1 zone building with resistive walls. +! +! The building is oriented due north. +! +! Floor Area: 232.25 m2 +! Number of Stories: 1 +! +! Zone Description Details: +! +! (0,15.24,0) (15.24,15.24,0) +! _____________________________ +! | | +! | | +! | | +! | | +! | | +! | | +! | | +! | | +! | | +! | | +! | | +! | | +! | | +! | | +! | | +! |_____________________________| +! +! (0,0,0) (15.24,0,0) +! +! Internal gains description: NA +! +! Interzone Surfaces: None +! Internal Mass: None +! People: None +! Lights: None +! Equipment: None +! Windows: 0 +! Detached Shading: None +! Daylight: None +! Natural Ventilation: None +! Compact Schedules: NA (Example of non-Compact Schedules) +! Solar Distribution: MinimalShadowing +! +! HVAC: NA +! +! Zonal Equipment: NA +! Central Air Handling Equipment: No +! System Equipment Autosize: No +! Purchased Cooling: No +! Purchased Heating: No +! Purchased Chilled Water: No +! Purchased Hot Water: No +! Coils: None +! Pumps: None +! Boilers: None +! Chillers: None +! Towers: None +! +! Results: +! Standard Reports: Variable Dictionary, Surfaces (dxf-wireframe), Meter File +! Timestep or Hourly Variables: Hourly and Daily +! Time bins Report: None +! HTML Report: None +! Environmental Emissions: None +! Utility Tariffs: None + + Version,24.2; + + Timestep,4; + + Building, + Simple One Zone (Wireframe DXF), !- Name + 0, !- North Axis {deg} + Suburbs, !- Terrain + 0.04, !- Loads Convergence Tolerance Value {W} + 0.004, !- Temperature Convergence Tolerance Value {deltaC} + MinimalShadowing, !- Solar Distribution + 30, !- Maximum Number of Warmup Days + 6; !- Minimum Number of Warmup Days + + HeatBalanceAlgorithm,ConductionTransferFunction; + + SurfaceConvectionAlgorithm:Inside,TARP; + + SurfaceConvectionAlgorithm:Outside,DOE-2; + + SimulationControl, + No, !- Do Zone Sizing Calculation + No, !- Do System Sizing Calculation + No, !- Do Plant Sizing Calculation + Yes, !- Run Simulation for Sizing Periods + Yes, !- Run Simulation for Weather File Run Periods + No, !- Do HVAC Sizing Simulation for Sizing Periods + 1; !- Maximum Number of HVAC Sizing Simulation Passes + + RunPeriod, + Run Period 1, !- Name + 1, !- Begin Month + 1, !- Begin Day of Month + , !- Begin Year + 12, !- End Month + 31, !- End Day of Month + , !- End Year + Tuesday, !- Day of Week for Start Day + Yes, !- Use Weather File Holidays and Special Days + Yes, !- Use Weather File Daylight Saving Period + No, !- Apply Weekend Holiday Rule + Yes, !- Use Weather File Rain Indicators + Yes; !- Use Weather File Snow Indicators + + Site:Location, + Denver Centennial Golden N_CO_USA Design_Conditions, !- Name + 39.74, !- Latitude {deg} + -105.18, !- Longitude {deg} + -7.00, !- Time Zone {hr} + 1829.00; !- Elevation {m} + + ! WMO=724666 Time Zone=NAM: (GMT-07:00) Mountain Time (US & Canada) + ! Data Source=ASHRAE 2009 Annual Design Conditions + ! Denver Centennial Golden N_CO_USA Annual Heating Design Conditions Wind Speed=3m/s Wind Dir=340 + ! Coldest Month=DEC + ! Denver Centennial Golden N_CO_USA Annual Heating 99%, MaxDB=-15.5°C + + SizingPeriod:DesignDay, + Denver Centennial Golden N Ann Htg 99% Condns DB, !- Name + 12, !- Month + 21, !- Day of Month + WinterDesignDay, !- Day Type + -15.5, !- Maximum Dry-Bulb Temperature {C} + 0.0, !- Daily Dry-Bulb Temperature Range {deltaC} + , !- Dry-Bulb Temperature Range Modifier Type + , !- Dry-Bulb Temperature Range Modifier Day Schedule Name + Wetbulb, !- Humidity Condition Type + -15.5, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C} + , !- Humidity Condition Day Schedule Name + , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir} + , !- Enthalpy at Maximum Dry-Bulb {J/kg} + , !- Daily Wet-Bulb Temperature Range {deltaC} + 81198., !- Barometric Pressure {Pa} + 3, !- Wind Speed {m/s} + 340, !- Wind Direction {deg} + No, !- Rain Indicator + No, !- Snow Indicator + No, !- Daylight Saving Time Indicator + ASHRAEClearSky, !- Solar Model Indicator + , !- Beam Solar Day Schedule Name + , !- Diffuse Solar Day Schedule Name + , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless} + , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless} + 0.00; !- Sky Clearness + + ! Denver Centennial Golden N Annual Cooling Design Conditions Wind Speed=4.9m/s Wind Dir=0 + ! Hottest Month=JUL + ! Denver Centennial Golden N_CO_USA Annual Cooling (DB=>MWB) 1%, MaxDB=32°C MWB=15.5°C + + SizingPeriod:DesignDay, + Denver Centennial Golden N Ann Clg 1% Condns DB=>MWB, !- Name + 7, !- Month + 21, !- Day of Month + SummerDesignDay, !- Day Type + 32, !- Maximum Dry-Bulb Temperature {C} + 15.2, !- Daily Dry-Bulb Temperature Range {deltaC} + , !- Dry-Bulb Temperature Range Modifier Type + , !- Dry-Bulb Temperature Range Modifier Day Schedule Name + Wetbulb, !- Humidity Condition Type + 15.5, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C} + , !- Humidity Condition Day Schedule Name + , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir} + , !- Enthalpy at Maximum Dry-Bulb {J/kg} + , !- Daily Wet-Bulb Temperature Range {deltaC} + 81198., !- Barometric Pressure {Pa} + 4.9, !- Wind Speed {m/s} + 0, !- Wind Direction {deg} + No, !- Rain Indicator + No, !- Snow Indicator + No, !- Daylight Saving Time Indicator + ASHRAEClearSky, !- Solar Model Indicator + , !- Beam Solar Day Schedule Name + , !- Diffuse Solar Day Schedule Name + , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless} + , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless} + 1.00; !- Sky Clearness + + Material:NoMass, + R13LAYER, !- Name + Rough, !- Roughness + 2.290965, !- Thermal Resistance {m2-K/W} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material:NoMass, + R31LAYER, !- Name + Rough, !- Roughness + 5.456, !- Thermal Resistance {m2-K/W} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + C5 - 4 IN HW CONCRETE, !- Name + MediumRough, !- Roughness + 0.1014984, !- Thickness {m} + 1.729577, !- Conductivity {W/m-K} + 2242.585, !- Density {kg/m3} + 836.8000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.6500000, !- Solar Absorptance + 0.6500000; !- Visible Absorptance + + Construction, + R13WALL, !- Name + R13LAYER; !- Outside Layer + + Construction, + FLOOR, !- Name + C5 - 4 IN HW CONCRETE; !- Outside Layer + + Construction, + ROOF31, !- Name + R31LAYER; !- Outside Layer + + Zone, + ZONE ONE, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + autocalculate, !- Ceiling Height {m} + autocalculate; !- Volume {m3} + + ScheduleTypeLimits, + Fraction, !- Name + 0.0, !- Lower Limit Value + 1.0, !- Upper Limit Value + CONTINUOUS; !- Numeric Type + + GlobalGeometryRules, + UpperLeftCorner, !- Starting Vertex Position + CounterClockWise, !- Vertex Entry Direction + World; !- Coordinate System + + BuildingSurface:Detailed, + Zn001:Wall001, !- Name + Wall, !- Surface Type + R13WALL, !- Construction Name + ZONE ONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 0,0,4.572000, !- X,Y,Z ==> Vertex 1 {m} + 0,0,0, !- X,Y,Z ==> Vertex 2 {m} + 15.24000,0,0, !- X,Y,Z ==> Vertex 3 {m} + 15.24000,0,4.572000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn001:Wall002, !- Name + Wall, !- Surface Type + R13WALL, !- Construction Name + ZONE ONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 15.24000,0,4.572000, !- X,Y,Z ==> Vertex 1 {m} + 15.24000,0,0, !- X,Y,Z ==> Vertex 2 {m} + 15.24000,15.24000,0, !- X,Y,Z ==> Vertex 3 {m} + 15.24000,15.24000,4.572000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn001:Wall003, !- Name + Wall, !- Surface Type + R13WALL, !- Construction Name + ZONE ONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 15.24000,15.24000,4.572000, !- X,Y,Z ==> Vertex 1 {m} + 15.24000,15.24000,0, !- X,Y,Z ==> Vertex 2 {m} + 0,15.24000,0, !- X,Y,Z ==> Vertex 3 {m} + 0,15.24000,4.572000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn001:Wall004, !- Name + Wall, !- Surface Type + R13WALL, !- Construction Name + ZONE ONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.5000000, !- View Factor to Ground + 4, !- Number of Vertices + 0,15.24000,4.572000, !- X,Y,Z ==> Vertex 1 {m} + 0,15.24000,0, !- X,Y,Z ==> Vertex 2 {m} + 0,0,0, !- X,Y,Z ==> Vertex 3 {m} + 0,0,4.572000; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn001:Flr001, !- Name + Floor, !- Surface Type + FLOOR, !- Construction Name + ZONE ONE, !- Zone Name + , !- Space Name + Adiabatic, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 1.000000, !- View Factor to Ground + 4, !- Number of Vertices + 15.24000,0.000000,0.0, !- X,Y,Z ==> Vertex 1 {m} + 0.000000,0.000000,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.000000,15.24000,0.0, !- X,Y,Z ==> Vertex 3 {m} + 15.24000,15.24000,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Zn001:Roof001, !- Name + Roof, !- Surface Type + ROOF31, !- Construction Name + ZONE ONE, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0, !- View Factor to Ground + 4, !- Number of Vertices + 0.000000,15.24000,4.572, !- X,Y,Z ==> Vertex 1 {m} + 0.000000,0.000000,4.572, !- X,Y,Z ==> Vertex 2 {m} + 15.24000,0.000000,4.572, !- X,Y,Z ==> Vertex 3 {m} + 15.24000,15.24000,4.572; !- X,Y,Z ==> Vertex 4 {m} + + Output:Variable,*,Site Outdoor Air Drybulb Temperature,hourly; + + Output:Variable,*,Site Total Sky Cover,hourly; + + Output:Variable,*,Site Opaque Sky Cover,hourly; + + Output:Variable,*,Site Daylight Saving Time Status,daily; + + Output:Variable,*,Site Day Type Index,daily; + + Output:Variable,*,Zone Mean Air Temperature,hourly; + + Output:Variable,*,Zone Operative Temperature,hourly; !- Zone Average [C] + + Output:Variable,ZONE ONE,Zone Wetbulb Globe Temperature,hourly; + + Output:Variable,*,Zone Total Internal Latent Gain Energy,hourly; + + Output:Variable,*,Zone Mean Radiant Temperature,hourly; + + Output:Variable,*,Zone Air Heat Balance Surface Convection Rate,hourly; + + Output:Variable,*,Zone Air Heat Balance Air Energy Storage Rate,hourly; + + Output:Variable,*,Surface Inside Face Temperature,daily; + + Output:Variable,*,Surface Outside Face Temperature,daily; + + Output:Variable,*,Surface Inside Face Convection Heat Transfer Coefficient,daily; + + Output:Variable,*,Surface Outside Face Convection Heat Transfer Coefficient,daily; + + Output:Variable,*,Other Equipment Total Heating Energy,monthly; + + Output:Variable,*,Zone Other Equipment Total Heating Energy,monthly; + + Output:VariableDictionary,IDF; + + Output:Surfaces:Drawing,dxf:wireframe; + + Output:Constructions,Constructions; + + Output:Meter:MeterFileOnly,ExteriorLights:Electricity,hourly; + + Output:Meter:MeterFileOnly,EnergyTransfer:Building,hourly; + + Output:Meter:MeterFileOnly,EnergyTransfer:Facility,hourly; + + OutputControl:Table:Style, + ALL; !- Column Separator + + Output:Table:SummaryReports, + AllSummary; !- Report 1 Name + + Exterior:Lights, + ExtLights, !- Name + AlwaysOn, !- Schedule Name + 5250, !- Design Level {W} + AstronomicalClock, !- Control Option + Grounds Lights; !- End-Use Subcategory + + ScheduleTypeLimits, + On/Off, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + DISCRETE; !- Numeric Type + + OtherEquipment, + Test 352a, !- Name + None, !- Fuel Type + ZONE ONE, !- Zone or ZoneList or Space or SpaceList Name + AlwaysOn, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + 352, !- Design Level {W} + , !- Power per Zone Floor Area {W/m2} + , !- Power per Person {W/person} + 0, !- Fraction Latent + 0, !- Fraction Radiant + 0; !- Fraction Lost + + OtherEquipment, + Test 352 minus, !- Name + None, !- Fuel Type + ZONE ONE, !- Zone or ZoneList or Space or SpaceList Name + AlwaysOn, !- Schedule Name + EquipmentLevel, !- Design Level Calculation Method + -352, !- Design Level {W} + , !- Power per Zone Floor Area {W/m2} + , !- Power per Person {W/person} + 0, !- Fraction Latent + 0, !- Fraction Radiant + 0; !- Fraction Lost + + Schedule:Constant,AlwaysOn,On/Off,1.0; + + EnergyManagementSystem:GlobalVariable,MaximumEffort; diff --git a/tst/EnergyPlus/api/TestDataTransfer.c b/tst/EnergyPlus/api/TestDataTransfer.c index 5544756772d..978d1bbde5f 100644 --- a/tst/EnergyPlus/api/TestDataTransfer.c +++ b/tst/EnergyPlus/api/TestDataTransfer.c @@ -79,7 +79,7 @@ void afterZoneTimeStepHandler(EnergyPlusState state) char **surfaceNames = getObjectNames(state, "BuildingSurface:Detailed", &arraySize); if (arraySize == 0) { - printf("Encountered a file with no BuildingSurface:Detailed, can't run this script on that file! Aborting!"); + printf("Encountered a file with no BuildingSurface:Detailed, can't run this script on that file! Aborting!\n"); exit(1); } @@ -91,7 +91,23 @@ void afterZoneTimeStepHandler(EnergyPlusState state) wallConstruction = getConstructionHandle(state, "R13WALL"); floorConstruction = getConstructionHandle(state, "FLOOR"); - // don't forget to free memory from the API! + // checking for EMS globals + int const emsGlobalValid = getEMSGlobalVariableHandle(state, "MaximumEffort"); + int const emsGlobalInvalid = getEMSGlobalVariableHandle(state, "4or5moments"); + int const emsGlobalBuiltIn = getEMSGlobalVariableHandle(state, "WARMUPFLAG"); + if (emsGlobalValid > 0 && emsGlobalInvalid == 0 && emsGlobalBuiltIn == 0) { + printf("EMS Global handle lookups worked just fine!\n"); + } else { + printf("EMS Global handle lookup failed. Make sure to call this with _1ZoneUncontrolled_ForAPITesting.idf\n"); + exit(1); + } + setEMSGlobalVariableValue(state, emsGlobalValid, 2.0); + Real64 const val = getEMSGlobalVariableValue(state, emsGlobalValid); + if (val < 1.9999 || val > 2.0001) { + printf("EMS Global assignment/lookup didn't seem to work, odd\n"); + exit(1); + } + freeAPIData(data, arraySize); freeObjectNames(surfaceNames, arraySize); @@ -107,9 +123,11 @@ void afterZoneTimeStepHandler(EnergyPlusState state) exit(1); } - char *filePath = inputFilePath(state); - printf("Input file path accessed via API: %s\n", filePath); - free(filePath); + char *idfPath = inputFilePath(state); + char *epwPath = epwFilePath(state); + printf("Got an input file path of: %s, and weather file path of: %s\n", idfPath, epwPath); + free(idfPath); + free(epwPath); handlesRetrieved = 1; } diff --git a/tst/EnergyPlus/api/TestDataTransfer.py b/tst/EnergyPlus/api/TestDataTransfer.py index a73a91b1107..422670190d7 100644 --- a/tst/EnergyPlus/api/TestDataTransfer.py +++ b/tst/EnergyPlus/api/TestDataTransfer.py @@ -101,6 +101,26 @@ def time_step_handler(state): wall_construction_handle = api.exchange.get_construction_handle(state, "R13WALL") floor_construction_handle = api.exchange.get_construction_handle(state, "FLOOR") + + idf_path = api.exchange.get_input_file_path(state) + epw_path = api.exchange.get_weather_file_path(state) + print(f"Got an input file path of: {idf_path}, and weather file path of: {epw_path}") + + # checking for EMS globals + ems_global_valid = api.exchange.get_ems_global_handle(state, "MaximumEffort") + ems_global_invalid = api.exchange.get_ems_global_handle(state, "4or5moments") + ems_global_builtin = api.exchange.get_ems_global_handle(state, "WARMUPFLAG") + if ems_global_valid > 0 and ems_global_invalid == 0 and ems_global_builtin == 0: + print("EMS Global handle lookups worked just fine!") + else: + raise Exception( + "EMS Global handle lookup failed. Make sure to call this with _1ZoneUncontrolled_ForAPITesting.idf" + ) + api.exchange.set_ems_global_value(state, ems_global_valid, 2.0) + val = api.exchange.get_ems_global_value(state, ems_global_valid) + if val < 1.9999 or val > 2.0001: + raise Exception("EMS Global assignment/lookup didn't seem to work, odd") + except Exception as e: # Capture ok and exception message exception = e From e03dea0d12f9a3912dab751bb025977548ae1796 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Tue, 13 Aug 2024 10:38:04 -0700 Subject: [PATCH 123/164] fix unit test related to OU fan, as it's not fixed here --- tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 1658ce38122..c7f26710338 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -13278,9 +13278,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) EXPECT_NEAR(125.2573 * thisDXCoolingCoil.CoolingCoilRuntimeFraction, thisFan->totalPower, 0.0001); EXPECT_NEAR(thisDXCoolingCoil.TotalCoolingEnergyRate, (thisVRFTU.TotalCoolingRate + thisFan->totalPower), 0.0001); EXPECT_NEAR(0.8930, state->dataHVACVarRefFlow->VRF(1).VRFCondCyclingRatio, 0.0001); - EXPECT_NEAR(state->dataHVACVarRefFlow->VRF(1).OUFanPower, - state->dataHVACVarRefFlow->VRF(1).RatedOUFanPower * state->dataHVACVarRefFlow->VRF(1).VRFCondCyclingRatio, - 0.0001); + EXPECT_NEAR(state->dataHVACVarRefFlow->VRF(1).OUFanPower, state->dataHVACVarRefFlow->VRF(1).RatedOUFanPower, 0.0001); } // Test for #7648: HREIRFTHeat wrongly used HRCAPFTHeatConst. Occurs only if you have Heat Recovery From 37471e12a01982b1585ce6bbb4374b542714af75 Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Tue, 13 Aug 2024 10:38:52 -0700 Subject: [PATCH 124/164] pass in OnOffFanPartLoadFraction of constant 1 --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index dee354b86d5..fc8ff1253fc 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12834,7 +12834,7 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state, _, _, fan->inletAirMassFlowRate, - state.dataDXCoils->DXCoil(this->CoolCoilIndex).CoolingCoilRuntimeFraction, + OnOffFanPartLoadFraction, 0, 0, _); From 92134b5847814dfa0a98eced09e047e673c03f3c Mon Sep 17 00:00:00 2001 From: Rick Strand Date: Tue, 13 Aug 2024 14:24:37 -0500 Subject: [PATCH 125/164] 10634 Addresses Review Comments Various review comments were received. These were all addressed in this commit. --- src/EnergyPlus/CondenserLoopTowers.cc | 58 +++++++++---------- src/EnergyPlus/CondenserLoopTowers.hh | 10 ++-- .../unit/CondenserLoopTowers.unit.cc | 38 ++++++++---- 3 files changed, 57 insertions(+), 49 deletions(-) diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 642f21bf2e9..f365bd4e722 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -137,16 +137,16 @@ namespace CondenserLoopTowers { this->initialize(state); switch (this->TowerType) { case DataPlant::PlantEquipmentType::CoolingTower_SingleSpd: - this->calculateSingleSpeedTower(state, CurLoad); + this->calculateSingleSpeedTower(state, CurLoad, RunFlag); break; case DataPlant::PlantEquipmentType::CoolingTower_TwoSpd: - this->calculateTwoSpeedTower(state, CurLoad); + this->calculateTwoSpeedTower(state, CurLoad, RunFlag); break; case DataPlant::PlantEquipmentType::CoolingTower_VarSpd: - this->calculateVariableSpeedTower(state, CurLoad); + this->calculateVariableSpeedTower(state, CurLoad, RunFlag); break; case DataPlant::PlantEquipmentType::CoolingTower_VarSpdMerkel: - this->calculateMerkelVariableSpeedTower(state, CurLoad); + this->calculateMerkelVariableSpeedTower(state, CurLoad, RunFlag); break; default: ShowFatalError(state, format("Plant Equipment Type specified for {} is not a Cooling Tower.", this->Name)); @@ -4535,7 +4535,7 @@ namespace CondenserLoopTowers { } } // namespace CondenserLoopTowers - void CoolingTower::calculateSingleSpeedTower(EnergyPlusData &state, Real64 &MyLoad) + void CoolingTower::calculateSingleSpeedTower(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag) { // SUBROUTINE INFORMATION: @@ -4696,7 +4696,7 @@ namespace CondenserLoopTowers { // Do not RETURN here if flow rate is less than SmallMassFlow. Check basin heater and then RETURN. bool returnFlagSet = false; - this->checkMassFlowAndLoad(state, MyLoad, returnFlagSet); + this->checkMassFlowAndLoad(state, MyLoad, RunFlag, returnFlagSet); if (returnFlagSet) return; bool IncrNumCellFlag = true; // determine if yes or no we increase the number of cells // set value to true to enter in the loop @@ -4843,7 +4843,7 @@ namespace CondenserLoopTowers { this->airFlowRateRatio = (AirFlowRate * this->NumCell) / this->HighSpeedAirFlowRate; } - void CoolingTower::calculateTwoSpeedTower(EnergyPlusData &state, Real64 &MyLoad) + void CoolingTower::calculateTwoSpeedTower(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag) { // SUBROUTINE INFORMATION: @@ -4971,7 +4971,7 @@ namespace CondenserLoopTowers { if (state.dataPlnt->PlantLoop(this->plantLoc.loopNum).LoopSide(this->plantLoc.loopSideNum).FlowLock == DataPlant::FlowLock::Unlocked) return; // TODO: WTF bool returnFlagSet = false; - this->checkMassFlowAndLoad(state, MyLoad, returnFlagSet); + this->checkMassFlowAndLoad(state, MyLoad, RunFlag, returnFlagSet); if (returnFlagSet) return; // Added for multi-cell. Determine the number of cells operating @@ -5082,7 +5082,7 @@ namespace CondenserLoopTowers { this->airFlowRateRatio = (AirFlowRate * this->NumCell) / this->HighSpeedAirFlowRate; } - void CoolingTower::calculateVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad) + void CoolingTower::calculateVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag) { // SUBROUTINE INFORMATION: @@ -5204,7 +5204,7 @@ namespace CondenserLoopTowers { return; // TODO: WTF bool returnFlagSet = false; - this->checkMassFlowAndLoad(state, MyLoad, returnFlagSet); + this->checkMassFlowAndLoad(state, MyLoad, RunFlag, returnFlagSet); if (returnFlagSet) return; // loop to increment NumCell if we cannot meet the setpoint with the actual number of cells calculated above @@ -5418,7 +5418,7 @@ namespace CondenserLoopTowers { } } - void CoolingTower::calculateMerkelVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad) + void CoolingTower::calculateMerkelVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag) { // SUBROUTINE INFORMATION: @@ -5504,15 +5504,7 @@ namespace CondenserLoopTowers { WaterMassFlowRatePerCell = this->WaterMassFlowRate / this->NumCellOn; - // MassFlowTolerance is a parameter to indicate a no flow condition - if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || (MyLoad > HVAC::SmallLoad)) { - // for multiple cells, we assume that it's a common basin - CalcBasinHeaterPower( - state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); - return; - } - - if (std::abs(MyLoad) <= HVAC::SmallLoad) { + if ((std::abs(MyLoad) <= HVAC::SmallLoad) || !RunFlag) { // tower doesn't need to do anything this->OutletWaterTemp = state.dataLoopNodes->Node(this->WaterInletNodeNum).Temp; this->FanPower = 0.0; @@ -5521,6 +5513,11 @@ namespace CondenserLoopTowers { CalcBasinHeaterPower( state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); return; + } else if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance || (MyLoad > HVAC::SmallLoad)) { + // for multiple cells, we assume that it's a common basin + CalcBasinHeaterPower( + state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); + return; } // first find free convection cooling rate @@ -6455,24 +6452,21 @@ namespace CondenserLoopTowers { } } - void CoolingTower::checkMassFlowAndLoad(EnergyPlusData &state, Real64 const MyLoad, bool &returnFlagSet) + void CoolingTower::checkMassFlowAndLoad(EnergyPlusData &state, Real64 const MyLoad, bool RunFlag, bool &returnFlagSet) { - // MassFlowTolerance is a parameter to indicate a no flow condition - if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { - // for multiple cells, we assume that it's a common basin - CalcBasinHeaterPower( - state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); - returnFlagSet = true; - } - - // Also check to see if the tower is not running (zero MyLoad) - if (std::abs(MyLoad) <= HVAC::SmallLoad) { + if ((MyLoad > -HVAC::SmallLoad) || !RunFlag) { // tower doesn't need to do anything this->OutletWaterTemp = state.dataLoopNodes->Node(this->WaterInletNodeNum).Temp; - this->WaterMassFlowRate = 0.0; this->FanPower = 0.0; this->airFlowRateRatio = 0.0; this->Qactual = 0.0; + this->WaterMassFlowRate = 0.0; + PlantUtilities::SetComponentFlowRate(state, this->WaterMassFlowRate, this->WaterInletNodeNum, this->WaterOutletNodeNum, this->plantLoc); + CalcBasinHeaterPower( + state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); + returnFlagSet = true; + } else if (this->WaterMassFlowRate <= DataBranchAirLoopPlant::MassFlowTolerance) { + // for multiple cells, we assume that it's a common basin CalcBasinHeaterPower( state, this->BasinHeaterPowerFTempDiff, this->BasinHeaterSchedulePtr, this->BasinHeaterSetPointTemp, this->BasinHeaterPower); returnFlagSet = true; diff --git a/src/EnergyPlus/CondenserLoopTowers.hh b/src/EnergyPlus/CondenserLoopTowers.hh index ef2da0f931a..f49d8b2ad8e 100644 --- a/src/EnergyPlus/CondenserLoopTowers.hh +++ b/src/EnergyPlus/CondenserLoopTowers.hh @@ -387,13 +387,13 @@ namespace CondenserLoopTowers { void SizeVSMerkelTower(EnergyPlusData &state); - void calculateSingleSpeedTower(EnergyPlusData &state, Real64 &MyLoad); + void calculateSingleSpeedTower(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag); - void calculateTwoSpeedTower(EnergyPlusData &state, Real64 &MyLoad); + void calculateTwoSpeedTower(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag); - void calculateMerkelVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad); + void calculateMerkelVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag); - void calculateVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad); + void calculateVariableSpeedTower(EnergyPlusData &state, Real64 &MyLoad, bool RunFlag); Real64 calculateSimpleTowerOutletTemp(EnergyPlusData &state, Real64 waterMassFlowRate, Real64 AirFlowRate, Real64 UAdesign); @@ -427,7 +427,7 @@ namespace CondenserLoopTowers { void report(EnergyPlusData &state, bool RunFlag); - void checkMassFlowAndLoad(EnergyPlusData &state, Real64 MyLoad, bool &returnFlagSet); + void checkMassFlowAndLoad(EnergyPlusData &state, Real64 MyLoad, bool RunFlag, bool &returnFlagSet); static CoolingTower *factory(EnergyPlusData &state, std::string_view objectName); }; diff --git a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc index bb6f354a6f6..41e89f21271 100644 --- a/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc +++ b/tst/EnergyPlus/unit/CondenserLoopTowers.unit.cc @@ -515,7 +515,8 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_MerkelNoCooling) state->dataCondenserLoopTowers->towers(1).SizeVSMerkelTower(*state); state->dataCondenserLoopTowers->towers(1).initialize(*state); Real64 MyLoad = 0.0; - state->dataCondenserLoopTowers->towers(1).calculateMerkelVariableSpeedTower(*state, MyLoad); + bool RunFlag = false; + state->dataCondenserLoopTowers->towers(1).calculateMerkelVariableSpeedTower(*state, MyLoad, RunFlag); state->dataCondenserLoopTowers->towers(1).update(*state); state->dataCondenserLoopTowers->towers(1).report(*state, true); @@ -905,10 +906,11 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedSizing) CondenserLoopTowers::GetTowerInput(*state); Real64 MyLoad = 0.0; + bool RunFlag = false; state->dataCondenserLoopTowers->towers(1).initialize(*state); state->dataCondenserLoopTowers->towers(1).SizeTower(*state); state->dataCondenserLoopTowers->towers(1).initialize(*state); - state->dataCondenserLoopTowers->towers(1).calculateSingleSpeedTower(*state, MyLoad); + state->dataCondenserLoopTowers->towers(1).calculateSingleSpeedTower(*state, MyLoad, RunFlag); state->dataCondenserLoopTowers->towers(1).update(*state); state->dataCondenserLoopTowers->towers(1).report(*state, true); @@ -927,7 +929,6 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_SingleSpeedSizing) if (outletNode != state->dataLoopNodes->NodeID.end()) { outletNodeIndex = std::distance(state->dataLoopNodes->NodeID.begin(), outletNode); } - // TODO: FIXME: This is failing. Actual is -10.409381032746095, expected is 30. EXPECT_GT(state->dataLoopNodes->Node(inletNodeIndex).Temp, 30.0); // inlet node temperature EXPECT_DOUBLE_EQ(state->dataLoopNodes->Node(inletNodeIndex).Temp, state->dataLoopNodes->Node(outletNodeIndex).Temp); // outlet node temperature @@ -3968,8 +3969,9 @@ TEST_F(EnergyPlusFixture, VSCoolingTowers_WaterOutletTempTest) state->dataPlnt->PlantLoop(VSTower.plantLoc.loopNum).LoopSide(VSTower.plantLoc.loopSideNum).TempSetPoint = 30.0; VSTower.WaterMassFlowRate = VSTower.DesWaterMassFlowRate * WaterFlowRateRatio; - Real64 myLoad = 1000.0; - VSTower.calculateVariableSpeedTower(*state, myLoad); + Real64 myLoad = -1000.0; + bool RunFlag = true; + VSTower.calculateVariableSpeedTower(*state, myLoad, RunFlag); EXPECT_DOUBLE_EQ(30.0, VSTower.OutletWaterTemp); EXPECT_DOUBLE_EQ(1.0, VSTower.FanCyclingRatio); Real64 TowerOutletWaterTemp = VSTower.calculateVariableTowerOutletTemp(*state, WaterFlowRateRatio, VSTower.airFlowRateRatio, AirWetBulbTemp); @@ -3987,7 +3989,7 @@ TEST_F(EnergyPlusFixture, VSCoolingTowers_WaterOutletTempTest) VSTower.AirWetBulb = state->dataEnvrn->OutWetBulbTemp; VSTower.AirHumRat = state->dataEnvrn->OutHumRat; - VSTower.calculateVariableSpeedTower(*state, myLoad); + VSTower.calculateVariableSpeedTower(*state, myLoad, RunFlag); EXPECT_DOUBLE_EQ(30.0, VSTower.OutletWaterTemp); EXPECT_NEAR(0.5424, VSTower.FanCyclingRatio, 0.0001); // outside air condition is favorable that fan only needs to cycle at min flow to meet the setpoint @@ -4310,6 +4312,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_CalculateVariableTowerOutletTemp) TEST_F(EnergyPlusFixture, CondenserLoopTowers_checkMassFlowAndLoadTest) { bool flagToReturn; + bool runFlag; Real64 myLoad; Real64 constexpr allowedTolerance = 0.0001; Real64 expectedPower; @@ -4317,12 +4320,21 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_checkMassFlowAndLoadTest) state->dataCondenserLoopTowers->towers.allocate(1); auto &tower = state->dataCondenserLoopTowers->towers(1); - state->dataLoopNodes->Node.allocate(1); + state->dataPlnt->PlantLoop.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch.allocate(1); + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Supply).Branch(1).Comp.allocate(1); + state->dataLoopNodes->Node.allocate(2); tower.WaterInletNodeNum = 1; + tower.WaterOutletNodeNum = 2; + tower.plantLoc.loopNum = 1; + tower.plantLoc.loopSideNum = DataPlant::LoopSideLocation::Supply; + tower.plantLoc.branchNum = 1; + tower.plantLoc.compNum = 1; // Test 1: Mass flow rate is low but myLoad is ok--flag should be set to true flagToReturn = false; - myLoad = 1000.0; + runFlag = true; + myLoad = -1000.0; state->dataEnvrn->OutDryBulbTemp = 27.0; tower.WaterMassFlowRate = 0.0; tower.BasinHeaterPowerFTempDiff = 1.0; @@ -4330,12 +4342,13 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_checkMassFlowAndLoadTest) tower.BasinHeaterSetPointTemp = 26.0; tower.BasinHeaterPower = 1.0; expectedPower = 0.0; - tower.checkMassFlowAndLoad(*state, myLoad, flagToReturn); + tower.checkMassFlowAndLoad(*state, myLoad, runFlag, flagToReturn); EXPECT_TRUE(flagToReturn); EXPECT_NEAR(expectedPower, tower.BasinHeaterPower, allowedTolerance); // Test 2: Mass flow rate is ok but myLoad is zero--flag should be set to true flagToReturn = false; + runFlag = false; myLoad = 0.0; state->dataEnvrn->OutDryBulbTemp = 27.0; tower.WaterMassFlowRate = 0.5; @@ -4349,7 +4362,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_checkMassFlowAndLoadTest) expectedPower = 0.0; expectedTemp = 23.0; state->dataLoopNodes->Node(tower.WaterInletNodeNum).Temp = 23.0; - tower.checkMassFlowAndLoad(*state, myLoad, flagToReturn); + tower.checkMassFlowAndLoad(*state, myLoad, runFlag, flagToReturn); EXPECT_TRUE(flagToReturn); EXPECT_NEAR(expectedPower, tower.BasinHeaterPower, allowedTolerance); EXPECT_NEAR(expectedTemp, tower.OutletWaterTemp, allowedTolerance); @@ -4359,7 +4372,8 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_checkMassFlowAndLoadTest) // Test 3: Mass flow rate and myLoad are both ok--nothing changes, power does not get calculated here flagToReturn = false; - myLoad = 1000.0; + runFlag = true; + myLoad = -1000.0; state->dataEnvrn->OutDryBulbTemp = 27.0; tower.WaterMassFlowRate = 0.5; tower.BasinHeaterPowerFTempDiff = 1.0; @@ -4367,7 +4381,7 @@ TEST_F(EnergyPlusFixture, CondenserLoopTowers_checkMassFlowAndLoadTest) tower.BasinHeaterSetPointTemp = 25.0; tower.BasinHeaterPower = 3.0; expectedPower = 3.0; - tower.checkMassFlowAndLoad(*state, myLoad, flagToReturn); + tower.checkMassFlowAndLoad(*state, myLoad, runFlag, flagToReturn); EXPECT_FALSE(flagToReturn); EXPECT_NEAR(expectedPower, tower.BasinHeaterPower, allowedTolerance); } From 1c2a56c2c2e8073709d69972cb6b51410f111563 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Tue, 13 Aug 2024 16:44:33 -0500 Subject: [PATCH 126/164] Space cleanup for InternalMass --- ...roup-thermal-zone-description-geometry.tex | 10 +- idd/Energy+.idd.in | 8 +- src/EnergyPlus/SurfaceGeometry.cc | 22 +- ...eAirCooledWithSpacesDaylightingIntMass.idf | 3981 +++++++++++++++++ testfiles/CMakeLists.txt | 1 + 5 files changed, 3999 insertions(+), 23 deletions(-) create mode 100644 testfiles/5ZoneAirCooledWithSpacesDaylightingIntMass.idf diff --git a/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex b/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex index 586043ef97b..3582195a29f 100644 --- a/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex +++ b/doc/input-output-reference/src/overview/group-thermal-zone-description-geometry.tex @@ -2772,11 +2772,11 @@ \subsubsection{Inputs}\label{inputs-25-004} \paragraph{Field: Zone or ZoneList Name}\label{field-zone-or-zonelist-name-14} -This field is the name of the \hyperref[zone]{Zone} or \hyperref[zonelist]{ZoneList} in which the internal mass will be added. When the ZoneList option is used then this internal mass object is applied to each of zone in the list. The name of the actual internal mass object in each zone becomes and should be less than the standard length (100 characters) for a name field. If it is greater than this standard length, it may be difficult to specify in output reporting as it will be truncated. A warning will be shown if the generated name is greater than 100 characters. If it duplicates another such concatenated name, there will be a severe error and terminate the run. +This field is the name of the \hyperref[zone]{Zone} or \hyperref[zonelist]{ZoneList} in which the internal mass will be added. When the ZoneList option is used then this internal mass object is applied to each zone in the list. The name of the actual internal mass object in each zone becomes and should be less than the standard length (100 characters) for a name field. If it is greater than this standard length, it may be difficult to specify in output reporting as it will be truncated. A warning will be shown if the generated name is greater than 100 characters. If it duplicates another such concatenated name, there will be a severe error and terminate the run. This field is ignored when a Space or SpaceList Name is specified. \paragraph{Field: Space or SpaceList Name}\label{field-space-or-spacelist-name-14} -This field is the name of the \hyperref[space]{Space} or \hyperref[spacelist]{SpaceList} in which the internal mass will be added. When the SpaceList option is used then this internal mass object is applied to each space in the list. The name of the actual internal mass object in each space becomes and should be less than the standard length (100 characters) for a name field. If it is greater than this standard length, it may be difficult to specify in output reporting as it will be truncated. A warning will be shown if the generated name is greater than 100 characters. If it duplicates another such concatenated name, there will be a severe error and terminate the run. This field is ignored when a ZoneList Name is specified for Zone or ZoneList Name. If a Space Name is used, then the Space must be part of Zone Name. If a SpaceList Name is used, then the Zone Name is ignored (even though it is a required field), and the surface is assigned to the corresponding Zone(s) for each Space in the SpaceList. +This field is the name of the \hyperref[space]{Space} or \hyperref[spacelist]{SpaceList} in which the internal mass will be added. If this field is blank (or a ZoneList Name is specified), the internal mass will be added to the last space attached to the zone. When the SpaceList option is used then this internal mass object is applied to each space in the list. The name of the actual internal mass object in each space becomes and should be less than the standard length (100 characters) for a name field. If it is greater than this standard length, it may be difficult to specify in output reporting as it will be truncated. A warning will be shown if the generated name is greater than 100 characters. If it duplicates another such concatenated name, there will be a severe error and terminate the run. This field is ignored when a ZoneList Name is specified for Zone or ZoneList Name. If this field is entered, then the Zone or ZoneList Name is ignored, and the surface is assigned to the corresponding Zone(s) for the Space(s). \paragraph{Field: Surface Area}\label{field-surface-area} @@ -2789,13 +2789,15 @@ \subsubsection{Inputs}\label{inputs-25-004} Zn002:IntM001, !- Surface Name INTERIOR, !- Construction Name DORM ROOMS AND COMMON AREAS, !- Zone or ZoneList Name - 408.7734; !- Total area exposed to Zone {m2} + , !- Space or SpaceList Name + 408.7734; !- Surface Area {m2} InternalMass, Zn002:IntM002, !- Surface Name PARTITION02, !- Construction Name DORM ROOMS AND COMMON AREAS, !- Zone or ZoneList Name - 371.6122; !- Total area exposed to Zone {m2} + , !- Space or SpaceList Name + 371.6122; !- Surface Area {m2} \end{lstlisting} \subsection{Surface Output Variables/Reports}\label{surface-output-variablesreports} diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 1244abd0c0d..7bf6ad8d181 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -13371,16 +13371,16 @@ InternalMass, \type object-list \object-list ConstructionNames A3 , \field Zone or ZoneList Name - \required-field \type object-list \object-list ZoneAndZoneListNames - \note Zone the surface is a part of. - \note used to be Interior Environment + \note Zone(s) the surface is a part of. + \note This field is ignored when a Space or SpaceList Name is specified. A4 , \field Space or SpaceList Name \type object-list \object-list SpaceAndSpaceListNames - \note Space the surface is a part of (optional, see description of Space object for more details). + \note Space(s) the surface is a part of. \note This field is ignored when a ZoneList Name is specified for Zone or ZoneList Name. + \note An internal mass surface will be added to every Space in every Zone in the ZoneList. N1 ; \field Surface Area \required-field \units m2 diff --git a/src/EnergyPlus/SurfaceGeometry.cc b/src/EnergyPlus/SurfaceGeometry.cc index 09b60d6a98f..a6ef8c68d2d 100644 --- a/src/EnergyPlus/SurfaceGeometry.cc +++ b/src/EnergyPlus/SurfaceGeometry.cc @@ -2846,7 +2846,8 @@ namespace SurfaceGeometry { for (int surfNum = 1; surfNum <= state.dataSurface->TotSurfaces; ++surfNum) { auto &thisSurf = Surfaces(surfNum); - if (!thisSurf.HeatTransSurf) continue; // ignore shading surfaces + if (!thisSurf.HeatTransSurf) continue; // ignore shading surfaces + if (thisSurf.Class == DataSurfaces::SurfaceClass::IntMass) continue; // skip internal mass surfaces for this check if (thisSurf.BaseSurf != surfNum) { // Set space for subsurfaces thisSurf.spaceNum = Surfaces(thisSurf.BaseSurf).spaceNum; @@ -7192,7 +7193,8 @@ namespace SurfaceGeometry { state.dataSurface->IntMassObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones; state.dataSurface->IntMassObjects(Item).ZoneListActive = true; state.dataSurface->IntMassObjects(Item).ZoneOrZoneListPtr = ZLItem; - } else { + } else if (state.dataIPShortCut->lAlphaFieldBlanks(4)) { + // If Space or SpaceList Name is blank, then throw error. ShowSevereError(state, format("{}=\"{}\" invalid {}=\"{}\" not found.", cCurrentModuleObject, @@ -7217,19 +7219,9 @@ namespace SurfaceGeometry { state.dataSurface->IntMassObjects(Item).numOfSpaces = 1; state.dataSurface->IntMassObjects(Item).spaceListActive = false; state.dataSurface->IntMassObjects(Item).spaceOrSpaceListPtr = Item1; - if (!state.dataSurface->IntMassObjects(Item).ZoneListActive) { - if (state.dataHeatBal->space(Item1).zoneNum != state.dataSurface->IntMassObjects(Item).ZoneOrZoneListPtr) { - ShowSevereError(state, - format("{}=\"{}\" invalid {}=\"{}\" is not part of Zone =\"{}\".", - cCurrentModuleObject, - state.dataIPShortCut->cAlphaArgs(1), - state.dataIPShortCut->cAlphaFieldNames(4), - state.dataIPShortCut->cAlphaArgs(4), - state.dataIPShortCut->cAlphaArgs(3))); - ErrorsFound = true; - errFlag = true; - } - } + state.dataSurface->IntMassObjects(Item).NumOfZones = 1; + state.dataSurface->IntMassObjects(Item).ZoneListActive = false; + state.dataSurface->IntMassObjects(Item).ZoneOrZoneListPtr = state.dataHeatBal->space(Item1).zoneNum; } else if (SLItem > 0) { int numOfSpaces = int(state.dataHeatBal->spaceList(SLItem).numListSpaces); NumIntMassSurfaces += numOfSpaces; diff --git a/testfiles/5ZoneAirCooledWithSpacesDaylightingIntMass.idf b/testfiles/5ZoneAirCooledWithSpacesDaylightingIntMass.idf new file mode 100644 index 00000000000..cd1d76f745e --- /dev/null +++ b/testfiles/5ZoneAirCooledWithSpacesDaylightingIntMass.idf @@ -0,0 +1,3981 @@ +!-Generator IDFEditor 1.51 +!-Option OriginalOrderTop UseSpecialFormat +!-NOTE: All comments with '!-' are ignored by the IDFEditor and are generated automatically. +!- Use '!' comments if they need to be retained when using the IDFEditor. +! 5ZoneAirCooledWithSpaces.idf +! Basic file description: 1 story building divided into 4 exterior and one interior conditioned zones and return plenum. +! Two of the zones are divided into spaces. Zone 5 is divided into 2 spaces using floor surfaces only +! which results in both spaces being in the same enclosure. Zone 3 is divided into 3 spaces, one +! fully enclosed space (this is one enclosure) and two spaces joined by an air boundary (this is another enclosure). +! +! Highlights: Illustrates various uses of Space. Electric chiller with air cooled condenser; autosized preheating and +! precooling water coils in the outside air stream controlled to preheat and precool setpoints. +! +! Simulation Location/Run: CHICAGO_IL_USA TMY2-94846, 2 design days, 2 run periods, +! Run Control executes the run periods using the weather file +! +! Location: Chicago, IL +! +! Design Days: CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, MaxDB= -17.3°C +! CHICAGO_IL_USA Annual Cooling 1% Design Conditions, MaxDB= 31.5°C MCWB= 23.0°C +! +! Run Period (Weather File): 1/1 through 12/31, CHICAGO_IL_USA TMY2-94846 +! +! Run Control: Zone and System sizing with weather file run control (no design days run) +! +! Building: Single floor rectangular building 100 ft x 50 ft. 5 zones - 4 exterior, 1 interior, zone height 8 feet. +! Exterior zone depth is 12 feet. There is a 2 foot high return plenum: the overall building height is +! 10 feet. There are windows on all 4 facades; the south and north facades have glass doors. +! The south facing glass is shaded by overhangs. The walls are woodshingle over plywood, R11 insulation, +! and gypboard. The roof is a gravel built up roof with R-3 mineral board insulation and plywood sheathing. +! The windows are of various single and double pane construction with 3mm and 6mm glass and either 6mm or +! 13mm argon or air gap. The window to wall ratio is approximately 0.29. +! The south wall and door have overhangs. +! +! The building is oriented 30 degrees east of north. +! +! Floor Area: 463.6 m2 (5000 ft2) +! Number of Stories: 1 +! +! Zone Description Details: +! +! (0,15.2,0) (30.5,15.2,0) +! _____ ________ ____ +! |\ *** **************** /| +! | \ / | +! | \ (26.8,11.6,0) / | +! * \_____________________________/ * +! * |(3.7,11.6,0) | * +! * | | * +! * | | * +! * | (26.8,3.7,0)| * +! * |___________________________| * +! * / (3.7,3.7,0) \ * +! | / \ | +! | / \ | +! |/___******************___***________\| +! | Overhang | | +! |_______________________| | window/door = * +! |___| +! +! (0,0,0) (30.5,0,0) +! +! Internal gains description: lighting is 1.5 watts/ft2, office equip is 1.0 watts/ft2. There is 1 occupant +! per 100 ft2 of floor area. The infiltration is 0.25 air changes per hour. +! +! Interzone Surfaces: 6 interzone surfaces (see diagram) +! Internal Mass: None +! People: 50 +! Lights: 7500 W +! Windows: 4 ea.: 1) Double pane clear, 3mm glass, 13mm air gap +! 2) Double pane clear, 3mm glass, 13mm argon gap +! 3) Double pane clear, 6mm glass, 6mm air gap +! 4) Double pane lowE, 6mm lowE glass outside, 6mm air gap, 6mm clear glass +! +! Doors: 2 ea.: Single pane grey, 3mm glass +! +! Detached Shading: None +! Daylight: None +! Natural Ventilation: None +! Compact Schedules: Yes +! +! HVAC: Standard VAV system with outside air, hot water reheat coils, +! central chilled water cooling coil. Central Plant is single hot water +! boiler, electric compression chiller with air cooled condenser. +! All equipment is autosized. HW and ChW coils are used in the outside air +! stream to precondition the outside air. +! +! Zonal Equipment: AirTerminal:SingleDuct:VAV:Reheat +! Central Air Handling Equipment: Yes +! System Equipment Autosize: Yes +! Purchased Cooling: None +! Purchased Heating: None +! Coils: Coil:Cooling:Water, Coil:Heating:Water +! Pumps: Pump:VariableSpeed +! Boilers: Boiler:HotWater +! Chillers: Chiller:Electric +! +! Results: +! Standard Reports: None +! Timestep or Hourly Variables: Hourly +! Time bins Report: None +! HTML Report: None +! Environmental Emissions: None +! Utility Tariffs: None + + Version,24.2; + + Building, + Building, !- Name + 30., !- North Axis {deg} + City, !- Terrain + 0.04, !- Loads Convergence Tolerance Value {W} + 0.4, !- Temperature Convergence Tolerance Value {deltaC} + FullExterior, !- Solar Distribution + 25, !- Maximum Number of Warmup Days + 6; !- Minimum Number of Warmup Days + + Timestep,4; + + SurfaceConvectionAlgorithm:Inside,Simple; + + SurfaceConvectionAlgorithm:Outside,SimpleCombined; + + HeatBalanceAlgorithm,ConductionTransferFunction; + + GlobalGeometryRules, + UpperLeftCorner, !- Starting Vertex Position + CounterClockWise, !- Vertex Entry Direction + Relative, !- Coordinate System + Relative; !- Daylighting Reference Point Coordinate System + + ScheduleTypeLimits, + Any Number; !- Name + + ScheduleTypeLimits, + Fraction, !- Name + 0.0, !- Lower Limit Value + 1.0, !- Upper Limit Value + CONTINUOUS; !- Numeric Type + + ScheduleTypeLimits, + Temperature, !- Name + -60, !- Lower Limit Value + 200, !- Upper Limit Value + CONTINUOUS, !- Numeric Type + Temperature; !- Unit Type + + ScheduleTypeLimits, + Control Type, !- Name + 0, !- Lower Limit Value + 4, !- Upper Limit Value + DISCRETE; !- Numeric Type + + ScheduleTypeLimits, + On/Off, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + DISCRETE; !- Numeric Type + + ScheduleTypeLimits, + FlowRate, !- Name + 0.0, !- Lower Limit Value + 10, !- Upper Limit Value + CONTINUOUS; !- Numeric Type + + RunPeriod, + January, !- Name + 1, !- Begin Month + 1, !- Begin Day of Month + , !- Begin Year + 1, !- End Month + 31, !- End Day of Month + , !- End Year + Tuesday, !- Day of Week for Start Day + Yes, !- Use Weather File Holidays and Special Days + Yes, !- Use Weather File Daylight Saving Period + No, !- Apply Weekend Holiday Rule + Yes, !- Use Weather File Rain Indicators + Yes; !- Use Weather File Snow Indicators + + RunPeriod, + July, !- Name + 7, !- Begin Month + 1, !- Begin Day of Month + , !- Begin Year + 7, !- End Month + 31, !- End Day of Month + , !- End Year + Tuesday, !- Day of Week for Start Day + Yes, !- Use Weather File Holidays and Special Days + Yes, !- Use Weather File Daylight Saving Period + No, !- Apply Weekend Holiday Rule + Yes, !- Use Weather File Rain Indicators + Yes; !- Use Weather File Snow Indicators + + Site:Location, + CHICAGO_IL_USA TMY2-94846, !- Name + 41.78, !- Latitude {deg} + -87.75, !- Longitude {deg} + -6.00, !- Time Zone {hr} + 190.00; !- Elevation {m} + + SimulationControl, + Yes, !- Do Zone Sizing Calculation + Yes, !- Do System Sizing Calculation + Yes, !- Do Plant Sizing Calculation + No, !- Run Simulation for Sizing Periods + Yes, !- Run Simulation for Weather File Run Periods + No, !- Do HVAC Sizing Simulation for Sizing Periods + 1; !- Maximum Number of HVAC Sizing Simulation Passes + +! CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, MaxDB= -17.3°C + + SizingPeriod:DesignDay, + CHICAGO_IL_USA Annual Heating 99% Design Conditions DB, !- Name + 1, !- Month + 21, !- Day of Month + WinterDesignDay, !- Day Type + -17.3, !- Maximum Dry-Bulb Temperature {C} + 0.0, !- Daily Dry-Bulb Temperature Range {deltaC} + , !- Dry-Bulb Temperature Range Modifier Type + , !- Dry-Bulb Temperature Range Modifier Day Schedule Name + Wetbulb, !- Humidity Condition Type + -17.3, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C} + , !- Humidity Condition Day Schedule Name + , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir} + , !- Enthalpy at Maximum Dry-Bulb {J/kg} + , !- Daily Wet-Bulb Temperature Range {deltaC} + 99063., !- Barometric Pressure {Pa} + 4.9, !- Wind Speed {m/s} + 270, !- Wind Direction {deg} + No, !- Rain Indicator + No, !- Snow Indicator + No, !- Daylight Saving Time Indicator + ASHRAEClearSky, !- Solar Model Indicator + , !- Beam Solar Day Schedule Name + , !- Diffuse Solar Day Schedule Name + , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless} + , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless} + 0.0; !- Sky Clearness + +! CHICAGO_IL_USA Annual Cooling 1% Design Conditions, MaxDB= 31.5°C MCWB= 23.0°C + + SizingPeriod:DesignDay, + CHICAGO_IL_USA Annual Cooling 1% Design Conditions DB/MCWB, !- Name + 7, !- Month + 21, !- Day of Month + SummerDesignDay, !- Day Type + 31.5, !- Maximum Dry-Bulb Temperature {C} + 10.7, !- Daily Dry-Bulb Temperature Range {deltaC} + , !- Dry-Bulb Temperature Range Modifier Type + , !- Dry-Bulb Temperature Range Modifier Day Schedule Name + Wetbulb, !- Humidity Condition Type + 23.0, !- Wetbulb or DewPoint at Maximum Dry-Bulb {C} + , !- Humidity Condition Day Schedule Name + , !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir} + , !- Enthalpy at Maximum Dry-Bulb {J/kg} + , !- Daily Wet-Bulb Temperature Range {deltaC} + 99063., !- Barometric Pressure {Pa} + 5.3, !- Wind Speed {m/s} + 230, !- Wind Direction {deg} + No, !- Rain Indicator + No, !- Snow Indicator + No, !- Daylight Saving Time Indicator + ASHRAEClearSky, !- Solar Model Indicator + , !- Beam Solar Day Schedule Name + , !- Diffuse Solar Day Schedule Name + , !- ASHRAE Clear Sky Optical Depth for Beam Irradiance (taub) {dimensionless} + , !- ASHRAE Clear Sky Optical Depth for Diffuse Irradiance (taud) {dimensionless} + 1.0; !- Sky Clearness + + Site:GroundTemperature:BuildingSurface,20.03,20.03,20.13,20.30,20.43,20.52,20.62,20.77,20.78,20.55,20.44,20.20; + + Material, + WD10, !- Name + MediumSmooth, !- Roughness + 0.667, !- Thickness {m} + 0.115, !- Conductivity {W/m-K} + 513, !- Density {kg/m3} + 1381, !- Specific Heat {J/kg-K} + 0.9, !- Thermal Absorptance + 0.78, !- Solar Absorptance + 0.78; !- Visible Absorptance + + Material, + RG01, !- Name + Rough, !- Roughness + 1.2700000E-02, !- Thickness {m} + 1.442000, !- Conductivity {W/m-K} + 881.0000, !- Density {kg/m3} + 1674.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.6500000, !- Solar Absorptance + 0.6500000; !- Visible Absorptance + + Material, + BR01, !- Name + VeryRough, !- Roughness + 9.4999997E-03, !- Thickness {m} + 0.1620000, !- Conductivity {W/m-K} + 1121.000, !- Density {kg/m3} + 1464.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7000000, !- Solar Absorptance + 0.7000000; !- Visible Absorptance + + Material, + IN46, !- Name + VeryRough, !- Roughness + 7.6200001E-02, !- Thickness {m} + 2.3000000E-02, !- Conductivity {W/m-K} + 24.00000, !- Density {kg/m3} + 1590.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.5000000, !- Solar Absorptance + 0.5000000; !- Visible Absorptance + + Material, + WD01, !- Name + MediumSmooth, !- Roughness + 1.9099999E-02, !- Thickness {m} + 0.1150000, !- Conductivity {W/m-K} + 513.0000, !- Density {kg/m3} + 1381.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7800000, !- Solar Absorptance + 0.7800000; !- Visible Absorptance + + Material, + PW03, !- Name + MediumSmooth, !- Roughness + 1.2700000E-02, !- Thickness {m} + 0.1150000, !- Conductivity {W/m-K} + 545.0000, !- Density {kg/m3} + 1213.000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7800000, !- Solar Absorptance + 0.7800000; !- Visible Absorptance + + Material, + IN02, !- Name + Rough, !- Roughness + 9.0099998E-02, !- Thickness {m} + 4.3000001E-02, !- Conductivity {W/m-K} + 10.00000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + GP01, !- Name + MediumSmooth, !- Roughness + 1.2700000E-02, !- Thickness {m} + 0.1600000, !- Conductivity {W/m-K} + 801.0000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + GP02, !- Name + MediumSmooth, !- Roughness + 1.5900001E-02, !- Thickness {m} + 0.1600000, !- Conductivity {W/m-K} + 801.0000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material, + CC03, !- Name + MediumRough, !- Roughness + 0.1016000, !- Thickness {m} + 1.310000, !- Conductivity {W/m-K} + 2243.000, !- Density {kg/m3} + 837.0000, !- Specific Heat {J/kg-K} + 0.9000000, !- Thermal Absorptance + 0.6500000, !- Solar Absorptance + 0.6500000; !- Visible Absorptance + + Material:NoMass, + CP01, !- Name + Rough, !- Roughness + 0.3670000, !- Thermal Resistance {m2-K/W} + 0.9000000, !- Thermal Absorptance + 0.7500000, !- Solar Absorptance + 0.7500000; !- Visible Absorptance + + Material:NoMass, + MAT-CLNG-1, !- Name + Rough, !- Roughness + 0.652259290, !- Thermal Resistance {m2-K/W} + 0.65, !- Thermal Absorptance + 0.65, !- Solar Absorptance + 0.65; !- Visible Absorptance + + Material:AirGap, + AL21, !- Name + 0.1570000; !- Thermal Resistance {m2-K/W} + + Material:AirGap, + AL23, !- Name + 0.1530000; !- Thermal Resistance {m2-K/W} + + Construction, + ROOF-1, !- Name + RG01, !- Outside Layer + BR01, !- Layer 2 + IN46, !- Layer 3 + WD01; !- Layer 4 + + Construction, + WALL-1, !- Name + WD01, !- Outside Layer + PW03, !- Layer 2 + IN02, !- Layer 3 + GP01; !- Layer 4 + + Construction, + CLNG-1, !- Name + MAT-CLNG-1; !- Outside Layer + + Construction, + FLOOR-SLAB-1, !- Name + CC03; !- Outside Layer + + Construction, + INT-WALL-1, !- Name + GP02, !- Outside Layer + AL21, !- Layer 2 + GP02; !- Layer 3 + + WindowMaterial:Gas, + AIR 13MM, !- Name + Air, !- Gas Type + 0.0127; !- Thickness {m} + + WindowMaterial:Glazing, + CLEAR 3MM, !- Name + SpectralAverage, !- Optical Data Type + , !- Window Glass Spectral Data Set Name + 0.003, !- Thickness {m} + 0.837, !- Solar Transmittance at Normal Incidence + 0.075, !- Front Side Solar Reflectance at Normal Incidence + 0.075, !- Back Side Solar Reflectance at Normal Incidence + 0.898, !- Visible Transmittance at Normal Incidence + 0.081, !- Front Side Visible Reflectance at Normal Incidence + 0.081, !- Back Side Visible Reflectance at Normal Incidence + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Front Side Infrared Hemispherical Emissivity + 0.84, !- Back Side Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + WindowMaterial:Glazing, + GREY 3MM, !- Name + SpectralAverage, !- Optical Data Type + , !- Window Glass Spectral Data Set Name + 0.003, !- Thickness {m} + 0.626, !- Solar Transmittance at Normal Incidence + 0.061, !- Front Side Solar Reflectance at Normal Incidence + 0.061, !- Back Side Solar Reflectance at Normal Incidence + 0.611, !- Visible Transmittance at Normal Incidence + 0.061, !- Front Side Visible Reflectance at Normal Incidence + 0.061, !- Back Side Visible Reflectance at Normal Incidence + 0.0, !- Infrared Transmittance at Normal Incidence + 0.84, !- Front Side Infrared Hemispherical Emissivity + 0.84, !- Back Side Infrared Hemispherical Emissivity + 0.9; !- Conductivity {W/m-K} + + Construction, + Dbl Clr 3mm/13mm Air, !- Name + CLEAR 3MM, !- Outside Layer + AIR 13MM, !- Layer 2 + CLEAR 3MM; !- Layer 3 + + Construction, + Sgl Grey 3mm, !- Name + GREY 3MM; !- Outside Layer + + Schedule:Compact, + OCCUPY-1, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays SummerDesignDay CustomDay1 CustomDay2, !- Field 2 + Until: 8:00,0.0, !- Field 3 + Until: 11:00,1.00, !- Field 5 + Until: 12:00,0.80, !- Field 7 + Until: 13:00,0.40, !- Field 9 + Until: 14:00,0.80, !- Field 11 + Until: 18:00,1.00, !- Field 13 + Until: 19:00,0.50, !- Field 15 + Until: 24:00,0.0, !- Field 17 + For: Weekends WinterDesignDay Holiday, !- Field 19 + Until: 24:00,0.0; !- Field 20 + + Schedule:Compact, + LIGHTS-1, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays SummerDesignDay CustomDay1 CustomDay2, !- Field 2 + Until: 8:00,0.05, !- Field 3 + Until: 9:00,0.9, !- Field 5 + Until: 10:00,0.95, !- Field 7 + Until: 11:00,1.00, !- Field 9 + Until: 12:00,0.95, !- Field 11 + Until: 13:00,0.8, !- Field 13 + Until: 14:00,0.9, !- Field 15 + Until: 18:00,1.00, !- Field 17 + Until: 19:00,0.60, !- Field 19 + Until: 21:00,0.20, !- Field 21 + Until: 24:00,0.05, !- Field 23 + For: Weekends WinterDesignDay Holiday, !- Field 25 + Until: 24:00,0.05; !- Field 26 + + Schedule:Compact, + EQUIP-1, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays SummerDesignDay CustomDay1 CustomDay2, !- Field 2 + Until: 8:00,0.02, !- Field 3 + Until: 9:00,0.4, !- Field 5 + Until: 14:00,0.9, !- Field 7 + Until: 15:00,0.8, !- Field 9 + Until: 16:00,0.7, !- Field 11 + Until: 18:00,0.5, !- Field 13 + Until: 20:00,0.3, !- Field 15 + Until: 24:00,0.02, !- Field 17 + For: Weekends WinterDesignDay Holiday, !- Field 19 + Until: 24:00,0.2; !- Field 20 + + Schedule:Compact, + INFIL-SCH, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0, !- Field 3 + Through: 10/31, !- Field 5 + For: AllDays, !- Field 6 + Until: 24:00,0.0, !- Field 7 + Through: 12/31, !- Field 9 + For: AllDays, !- Field 10 + Until: 24:00,1.0; !- Field 11 + + Schedule:Compact, + ActSchd, !- Name + Any Number, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,117.239997864; !- Field 3 + + !- Field 4 + + Schedule:Compact, + ShadeTransSch, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,0.0; !- Field 3 + + Space, + Space 5 Office, !- Name + Zone 5, !- Zone Name + autocalculate, !- Ceiling Height {m} + autocalculate, !- Volume {m3} + , !- Floor Area {m2} + Office, !- Space Type + Std 62.1 Office Space, !- Tag 1 + Std 90.1 Office-Open Plan; !- Tag 2 + + Space, + Space 5 Conference, !- Name + Zone 5, !- Zone Name + autocalculate, !- Ceiling Height {m} + autocalculate, !- Volume {m3} + , !- Floor Area {m2} + Conference, !- Space Type + Std 62.1 Conference/meeting, !- Tag 1 + Std 90.1 Conference/Meeting/Multipurpose; !- Tag 2 + + Space, + Space 2, !- Name + Zone 2, !- Zone Name + autocalculate, !- Ceiling Height {m} + autocalculate, !- Volume {m3} + , !- Floor Area {m2} + Reception, !- Space Type + Std 62.1 Reception areas,!- Tag 1 + Std 90.1 Lobby; !- Tag 2 + + Space, + Space 3 Open Office 1, !- Name + Zone 3, !- Zone Name + autocalculate, !- Ceiling Height {m} + autocalculate, !- Volume {m3} + , !- Floor Area {m2} + Office, !- Space Type + Std 62.1 Office Space, !- Tag 1 + Std 90.1 Office-Open Plan; !- Tag 2 + + Space, + Space 3 Open Office 2, !- Name + Zone 3, !- Zone Name + autocalculate, !- Ceiling Height {m} + autocalculate, !- Volume {m3} + , !- Floor Area {m2} + Office, !- Space Type + Std 62.1 Office Space, !- Tag 1 + Std 90.1 Office-Open Plan; !- Tag 2 + + Space, + Space 3 Storage, !- Name + Zone 3, !- Zone Name + autocalculate, !- Ceiling Height {m} + autocalculate, !- Volume {m3} + , !- Floor Area {m2} + Storage, !- Space Type + Std 62.1 Storage, !- Tag 1 + Std 90.1 Storage; !- Tag 2 + + Space, + Space 4, !- Name + Zone 4, !- Zone Name + autocalculate, !- Ceiling Height {m} + autocalculate, !- Volume {m3} + , !- Floor Area {m2} + Office, !- Space Type + Std 62.1 Office Space, !- Tag 1 + Std 90.1 Office-Open Plan; !- Tag 2 + + Space, + Space 1, !- Name + Zone 1, !- Zone Name + autocalculate, !- Ceiling Height {m} + autocalculate, !- Volume {m3} + , !- Floor Area {m2} + Office, !- Space Type + Std 62.1 Office Space, !- Tag 1 + Std 90.1 Office-Open Plan; !- Tag 2 + + SpaceList, + AllConditionedSpaces, !- Name + Space 1, !- Space 1 Name + Space 2, !- Space 2 Name + Space 3 Open Office 1, !- Space 3 Name + Space 3 Open Office 2, !- Space 4 Name + Space 3 Storage, !- Space 5 Name + Space 4, !- Space 6 Name + Space 5 Office, !- Space 7 Name + Space 5 Conference; !- Space 8 Name + + ZoneList, + All Zones, !- Name + Zone 1, !- Zone 1 Name + Zone 2, !- Zone 2 Name + Zone 3, !- Zone 3 Name + Zone 4, !- Zone 4 Name + Zone 5; !- Zone 5 Name + + Zone, + PLENUM-1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 0.609600067, !- Ceiling Height {m} + 283.2, !- Volume {m3} + , !- Floor Area {m2} + , !- Zone Inside Convection Algorithm + , !- Zone Outside Convection Algorithm + No; !- Part of Total Floor Area + + BuildingSurface:Detailed, + WALL-1PF, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,0.0,3.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 30.5,0.0,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + WALL-1PR, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,0.0,3.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + WALL-1PB, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,3.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 0.0,15.2,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + WALL-1PL, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,3.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 0.0,0.0,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + TOP-1, !- Name + ROOF, !- Surface Type + ROOF-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.00000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,3.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,3.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,3.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,3.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C1-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C1-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C2-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C2-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C3-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C3-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 3, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 3.7,15.2,2.4; !- X,Y,Z ==> Vertex 3 {m} + + BuildingSurface:Detailed, + C3-2P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C3-2, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 12.0,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 2 {m} + 3.7,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 12.0,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C3-3P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C3-3, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 12.0,11.6,2.4, !- X,Y,Z ==> Vertex 2 {m} + 12.0,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C4-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C4-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C5-1P, !- Name + FLOOR, !- Surface Type + CLNG-1, !- Construction Name + PLENUM-1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C5-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + Zone 1, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 239.247360229; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + Zone 1 Infil 1, !- Name + Zone 1, !- Zone or ZoneList or Space or SpaceList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.032, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + Zone 1 People, !- Name + Zone 1, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 11, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + Zone 1 Lights, !- Name + Zone 1, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 1584, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 1.0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + Daylighting:Controls, + Zone 1 Daylighting Control, !- Name + Zone 1, !- Zone or Space Name + SplitFlux, !- Daylighting Method + , !- Availability Schedule Name + Stepped, !- Lighting Control Type + 0.3000, !- Minimum Input Power Fraction for Continuous or ContinuousOff Dimming Control + 0.2000, !- Minimum Light Output Fraction for Continuous or ContinuousOff Dimming Control + 3, !- Number of Stepped Control Steps + 1.0000, !- Probability Lighting will be Reset When Needed in Manual Stepped Control + Zone 1 Reference Point1, !- Glare Calculation Daylighting Reference Point Name + 180, !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone y-Axis {deg} + 20, !- Maximum Allowable Discomfort Glare Index + , !- DElight Gridding Resolution {m2} + Zone 1 Reference Point1, !- Daylighting Reference Point 1 Name + 1.0000, !- Fraction of Lights Controlled by Reference Point 1 + 400.0000; !- Illuminance Setpoint at Reference Point 1 {lux} + + Daylighting:ReferencePoint, + Zone 1 Reference Point1, !- Name + Zone 1, !- Zone or Space Name + 15.0, !- X-Coordinate of Reference Point {m} + 3.0, !- Y-Coordinate of Reference Point {m} + 0.7; !- Z-Coordinate of Reference Point {m} + + Output:IlluminanceMap, + Zone 1 Daylit Map, !- Name + Zone 1, !- Zone Name + 0.8, !- Z height {m} + 3.9, !- X Minimum Coordinate {m} + 26.6, !- X Maximum Coordinate {m} + 5, !- Number of X Grid Points + 0.2, !- Y Minimum Coordinate {m} + 3.5, !- Y Maximum Coordinate {m} + 5; !- Number of Y Grid Points + + ElectricEquipment, + All Spaces Elec Equip, !- Name + AllConditionedSpaces, !- Zone or ZoneList or Space or SpaceList Name + EQUIP-1, !- Schedule Name + Watts/Area, !- Design Level Calculation Method + , !- Design Level {W} + 10.0, !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0, !- Fraction Latent + 0.3, !- Fraction Radiant + 0; !- Fraction Lost + + BuildingSurface:Detailed, + FRONT-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + Zone 1, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WF-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + FRONT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 3.0,0.0,2.1, !- X,Y,Z ==> Vertex 1 {m} + 3.0,0.0,0.9, !- X,Y,Z ==> Vertex 2 {m} + 16.8,0.0,0.9, !- X,Y,Z ==> Vertex 3 {m} + 16.8,0.0,2.1; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + DF-1, !- Name + GLASSDOOR, !- Surface Type + Sgl Grey 3mm, !- Construction Name + FRONT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 21.3,0.0,2.1, !- X,Y,Z ==> Vertex 1 {m} + 21.3,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 23.8,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 23.8,0.0,2.1; !- X,Y,Z ==> Vertex 4 {m} + + Shading:Zone:Detailed, + Main South Overhang, !- Name + FRONT-1, !- Base Surface Name + ShadeTransSch, !- Transmittance Schedule Name + 4, !- Number of Vertices + 0.0,-1.3,2.2, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.2, !- X,Y,Z ==> Vertex 2 {m} + 19.8,0.0,2.2, !- X,Y,Z ==> Vertex 3 {m} + 19.8,-1.3,2.2; !- X,Y,Z ==> Vertex 4 {m} + + Shading:Zone:Detailed, + South Door Overhang, !- Name + FRONT-1, !- Base Surface Name + ShadeTransSch, !- Transmittance Schedule Name + 4, !- Number of Vertices + 21.0,-2.0,2.6, !- X,Y,Z ==> Vertex 1 {m} + 21.0,0.0,2.6, !- X,Y,Z ==> Vertex 2 {m} + 24.1,0.0,2.6, !- X,Y,Z ==> Vertex 3 {m} + 24.1,-2.0,2.6; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C1-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + Zone 1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C1-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F1-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + Zone 1, !- Zone Name + , !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB12, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB21, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB14, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB41, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB15, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 1, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB51, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + Zone 2, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 103.311355591; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + Zone 2 Infil 1, !- Name + Zone 2, !- Zone or ZoneList or Space or SpaceList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.014, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + Zone 2 People, !- Name + Zone 2, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 5, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + Zone 2 Lights, !- Name + Zone 2, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 684, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + BuildingSurface:Detailed, + RIGHT-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + Zone 2, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WR-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + RIGHT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 30.5,3.8,2.1, !- X,Y,Z ==> Vertex 1 {m} + 30.5,3.8,0.9, !- X,Y,Z ==> Vertex 2 {m} + 30.5,11.4,0.9, !- X,Y,Z ==> Vertex 3 {m} + 30.5,11.4,2.1; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C2-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + Zone 2, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C2-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,0.0,2.4, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F2-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + Zone 2, !- Zone Name + , !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB21, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 2, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB12, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB23, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 2, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB32, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB25, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 2, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB52, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + Zone 3, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 239.247360229; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + Zone 3 Infil, !- Name + Zone 3, !- Zone or ZoneList or Space or SpaceList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.032, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + Zone 3 People, !- Name + Zone 3, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 11, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + Space 3 Open Office 1 Lights, !- Name + Space 3 Open Office 1, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + Watts/Area, !- Design Level Calculation Method + , !- Lighting Level {W} + 10.76, !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 1.0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + Daylighting:Controls, + Space 3 Open Office 1 Daylighting Control, !- Name + Space 3 Open Office 1, !- Zone or Space Name + SplitFlux, !- Daylighting Method + , !- Availability Schedule Name + Stepped, !- Lighting Control Type + 0.3000, !- Minimum Input Power Fraction for Continuous or ContinuousOff Dimming Control + 0.2000, !- Minimum Light Output Fraction for Continuous or ContinuousOff Dimming Control + 3, !- Number of Stepped Control Steps + 1.0000, !- Probability Lighting will be Reset When Needed in Manual Stepped Control + Space 3 Open Office 1 Reference Point1, !- Glare Calculation Daylighting Reference Point Name + 180, !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone y-Axis {deg} + 20, !- Maximum Allowable Discomfort Glare Index + , !- DElight Gridding Resolution {m2} + Space 3 Open Office 1 Reference Point1, !- Daylighting Reference Point 1 Name + 1.0000, !- Fraction of Lights Controlled by Reference Point 1 + 400.0000; !- Illuminance Setpoint at Reference Point 1 {lux} + + Daylighting:ReferencePoint, + Space 3 Open Office 1 Reference Point1, !- Name + Space 3 Open Office 1, !- Zone or Space Name + 8.0, !- X-Coordinate of Reference Point {m} + 12.5, !- Y-Coordinate of Reference Point {m} + 0.7; !- Z-Coordinate of Reference Point {m} + + Output:IlluminanceMap, + Space 3 Open Office 1 Daylit Map, !- Name + Space 3 Open Office 1, !- Zone or Space Name + 0.8, !- Z height {m} + 3.8, !- X Minimum Coordinate {m} + 11.8, !- X Maximum Coordinate {m} + 5, !- Number of X Grid Points + 11.8, !- Y Minimum Coordinate {m} + 15.0, !- Y Maximum Coordinate {m} + 10; !- Number of Y Grid Points + + Lights, + Space 3 Open Office 2 Lights, !- Name + Space 3 Open Office 2, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + Watts/Area, !- Design Level Calculation Method + , !- Lighting Level {W} + 10.76, !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + Lights, + Space 3 Storage Lights, !- Name + Space 3 Storage, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + Watts/Area, !- Design Level Calculation Method + , !- Lighting Level {W} + 5.0, !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + Construction, + Furniture, !- Name + WD10; !- Outside Layer + + InternalMass, + Zone 3 Furniture, !- Name + Furniture, !- Construction Name + Zone 3, !- Zone or ZoneList Name + , !- Space or SpaceList Name + 77; !- Surface Area {m2} + + InternalMass, + Misc Furniture, !- Name + Furniture, !- Construction Name + , !- Zone or ZoneList Name + AllConditionedSpaces, !- Space or SpaceList Name + 5.0; !- Surface Area {m2} + + InternalMass, + Misc Furniture 2, !- Name + Furniture, !- Construction Name + All Zones, !- Zone or ZoneList Name + , !- Space or SpaceList Name + 2.0; !- Surface Area {m2} + + BuildingSurface:Detailed, + BACK-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Storage, !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + BACK-2, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 1, !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 12.0,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 12.0,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + BACK-3, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 2, !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 12.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 12.0,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Storage-Office Wall, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Storage, !- Space Name + Surface, !- Outside Boundary Condition + Office-Storage Wall, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + Office-Storage Wall, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 1, !- Space Name + Surface, !- Outside Boundary Condition + Storage-Office Wall, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Construction:AirBoundary, + AirBoundary, !- Name + , !- Air Exchange Method + , !- Simple Mixing Air Changes per Hour {1/hr} + ; !- Simple Mixing Schedule Name + + BuildingSurface:Detailed, + AirWall 1, !- Name + WALL, !- Surface Type + AirBoundary, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 1, !- Space Name + Surface, !- Outside Boundary Condition + AirWall 2, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 12.0,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 12.0,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 12.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 12.0,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + AirWall 2, !- Name + WALL, !- Surface Type + AirBoundary, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 2, !- Space Name + Surface, !- Outside Boundary Condition + AirWall 1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 12.0,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 12.0,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 12.0,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 12.0,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WB-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + BACK-3, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 27.4,15.2,2.1, !- X,Y,Z ==> Vertex 1 {m} + 27.4,15.2,0.9, !- X,Y,Z ==> Vertex 2 {m} + 13.7,15.2,0.9, !- X,Y,Z ==> Vertex 3 {m} + 13.7,15.2,2.1; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + DB-1, !- Name + GLASSDOOR, !- Surface Type + Sgl Grey 3mm, !- Construction Name + BACK-2, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 9.1,15.2,2.1, !- X,Y,Z ==> Vertex 1 {m} + 9.1,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 7.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 7.0,15.2,2.1; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C3-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Storage, !- Space Name + Surface, !- Outside Boundary Condition + C3-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 3, !- Number of Vertices + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 2 {m} + 3.7,15.2,2.4; !- X,Y,Z ==> Vertex 3 {m} + + BuildingSurface:Detailed, + C3-2, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 1, !- Space Name + Surface, !- Outside Boundary Condition + C3-2P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 12.0,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 3 {m} + 12.0,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C3-3, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 2, !- Space Name + Surface, !- Outside Boundary Condition + C3-3P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 30.5,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 12.0,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 12.0,11.6,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F3-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Storage, !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 3, !- Number of Vertices + 3.7,15.2,0.0, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0; !- X,Y,Z ==> Vertex 3 {m} + + BuildingSurface:Detailed, + F3-2, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 1, !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 12.0,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 12.0,15.2,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F3-3, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 2, !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 12.0,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 12.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB32, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 2, !- Space Name + Surface, !- Outside Boundary Condition + SB23, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 30.5,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 30.5,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB34, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Storage, !- Space Name + Surface, !- Outside Boundary Condition + SB43, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB35-1, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 1, !- Space Name + Surface, !- Outside Boundary Condition + SB53-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 12.0,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 12.0,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB35-2, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 3, !- Zone Name + Space 3 Open Office 2, !- Space Name + Surface, !- Outside Boundary Condition + SB53-2, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 12.0,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 12.0,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + Zone 4, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 103.311355591; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + Zone 4 Infil, !- Name + Zone 4, !- Zone or ZoneList or Space or SpaceList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.014, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + Zone 4 People, !- Name + Zone 4, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 5, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + Lights, + Zone 4 Lights, !- Name + Zone 4, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 684, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + BuildingSurface:Detailed, + LEFT-1, !- Name + WALL, !- Surface Type + WALL-1, !- Construction Name + Zone 4, !- Zone Name + , !- Space Name + Outdoors, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + SunExposed, !- Sun Exposure + WindExposed, !- Wind Exposure + 0.50000, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,0.0,2.4; !- X,Y,Z ==> Vertex 4 {m} + + FenestrationSurface:Detailed, + WL-1, !- Name + WINDOW, !- Surface Type + Dbl Clr 3mm/13mm Air, !- Construction Name + LEFT-1, !- Building Surface Name + , !- Outside Boundary Condition Object + 0.50000, !- View Factor to Ground + , !- Frame and Divider Name + 1, !- Multiplier + 4, !- Number of Vertices + 0.0,11.4,2.1, !- X,Y,Z ==> Vertex 1 {m} + 0.0,11.4,0.9, !- X,Y,Z ==> Vertex 2 {m} + 0.0,3.8,0.9, !- X,Y,Z ==> Vertex 3 {m} + 0.0,3.8,2.1; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + C4-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + Zone 4, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C4-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,15.2,2.4, !- X,Y,Z ==> Vertex 2 {m} + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F4-1, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + Zone 4, !- Zone Name + , !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB41, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 4, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB14, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 0.0,0.0,2.4, !- X,Y,Z ==> Vertex 1 {m} + 0.0,0.0,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB43, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 4, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB34, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 0.0,15.2,0.0, !- X,Y,Z ==> Vertex 3 {m} + 0.0,15.2,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB45, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 4, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB54, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Zone, + Zone 5, !- Name + 0, !- Direction of Relative North {deg} + 0, !- X Origin {m} + 0, !- Y Origin {m} + 0, !- Z Origin {m} + 1, !- Type + 1, !- Multiplier + 2.438400269, !- Ceiling Height {m} + 447.682556152; !- Volume {m3} + + ZoneInfiltration:DesignFlowRate, + Zone 5 Infil, !- Name + Zone 5, !- Zone or ZoneList or Space or SpaceList Name + INFIL-SCH, !- Schedule Name + flow/zone, !- Design Flow Rate Calculation Method + 0.062, !- Design Flow Rate {m3/s} + , !- Flow per Zone Floor Area {m3/s-m2} + , !- Flow per Exterior Surface Area {m3/s-m2} + , !- Air Changes per Hour {1/hr} + 0, !- Constant Term Coefficient + 0, !- Temperature Term Coefficient + 0.2237, !- Velocity Term Coefficient + 0; !- Velocity Squared Term Coefficient + + People, + Zone 5 People, !- Name + Zone 5, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + people, !- Number of People Calculation Method + 20, !- Number of People + , !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + , !- Sensible Heat Fraction + ActSchd; !- Activity Level Schedule Name + + People, + ZoneList People, !- Name + All Zones, !- Zone or ZoneList or Space or SpaceList Name + OCCUPY-1, !- Number of People Schedule Name + People/Area, !- Number of People Calculation Method + , !- Number of People + 0.5, !- People per Floor Area {person/m2} + , !- Floor Area per Person {m2/person} + 0.3, !- Fraction Radiant + autocalculate, !- Sensible Heat Fraction + ActSchd, !- Activity Level Schedule Name + 0.0000000382, !- Carbon Dioxide Generation Rate {m3/s-W} + No, !- Enable ASHRAE 55 Comfort Warnings + EnclosureAveraged, !- Mean Radiant Temperature Calculation Type + , !- Surface Name/Angle Factor List Name + , !- Work Efficiency Schedule Name + ClothingInsulationSchedule; !- Clothing Insulation Calculation Method + + Lights, + Zone 5 Lights, !- Name + Zone 5, !- Zone or ZoneList or Space or SpaceList Name + LIGHTS-1, !- Schedule Name + LightingLevel, !- Design Level Calculation Method + 2964, !- Lighting Level {W} + , !- Watts per Zone Floor Area {W/m2} + , !- Watts per Person {W/person} + 0.2, !- Return Air Fraction + 0.59, !- Fraction Radiant + 0.2, !- Fraction Visible + 0, !- Fraction Replaceable + GeneralLights; !- End-Use Subcategory + + InternalMass, + Space 5 Office Furniture, !- Name + Furniture, !- Construction Name + , !- Zone or ZoneList Name + Space 5 Office, !- Space or SpaceList Name + 10.0; !- Surface Area {m2} + + InternalMass, + Space 5 Conference Furniture, !- Name + Furniture, !- Construction Name + , !- Zone or ZoneList Name + Space 5 Conference, !- Space or SpaceList Name + 5.0; !- Surface Area {m2} + + BuildingSurface:Detailed, + C5-1, !- Name + CEILING, !- Surface Type + CLNG-1, !- Construction Name + Zone 5, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + C5-1P, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F5-1a, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + Zone 5, !- Zone Name + Space 5 Office, !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 6.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 6.7,11.6,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + F5-1b, !- Name + FLOOR, !- Surface Type + FLOOR-SLAB-1, !- Construction Name + Zone 5, !- Zone Name + Space 5 Conference, !- Space Name + Ground, !- Outside Boundary Condition + , !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 6.7,11.6,0.0, !- X,Y,Z ==> Vertex 1 {m} + 6.7,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,0.0; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB51, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 5, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB15, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB52, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 5, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB25, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,3.7,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,3.7,0.0, !- X,Y,Z ==> Vertex 2 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 26.8,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB53-1, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 5, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB35-1, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 12.0,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 12.0,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB53-2, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 5, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB35-2, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 26.8,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 26.8,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 12.0,11.6,0.0, !- X,Y,Z ==> Vertex 3 {m} + 12.0,11.6,2.4; !- X,Y,Z ==> Vertex 4 {m} + + BuildingSurface:Detailed, + SB54, !- Name + WALL, !- Surface Type + INT-WALL-1, !- Construction Name + Zone 5, !- Zone Name + , !- Space Name + Surface, !- Outside Boundary Condition + SB45, !- Outside Boundary Condition Object + NoSun, !- Sun Exposure + NoWind, !- Wind Exposure + 0.0, !- View Factor to Ground + 4, !- Number of Vertices + 3.7,11.6,2.4, !- X,Y,Z ==> Vertex 1 {m} + 3.7,11.6,0.0, !- X,Y,Z ==> Vertex 2 {m} + 3.7,3.7,0.0, !- X,Y,Z ==> Vertex 3 {m} + 3.7,3.7,2.4; !- X,Y,Z ==> Vertex 4 {m} + + Sizing:Parameters, + 1.0, !- Heating Sizing Factor + 1.0; !- Cooling Sizing Factor + + Sizing:Zone, + Zone 1, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA Zone 1, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDayWithLimit, !- Cooling Design Air Flow Method + , !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + , !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + , !- Heating Maximum Air Flow Fraction + , !- Design Specification Zone Air Distribution Object Name + No, !- Account for Dedicated Outdoor Air System + NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy + autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} + autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + + DesignSpecification:OutdoorAir, + SZ DSOA Zone 1, !- Name + sum, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + Zone 2, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA Zone 2, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDayWithLimit, !- Cooling Design Air Flow Method + , !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + , !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + , !- Heating Maximum Air Flow Fraction + , !- Design Specification Zone Air Distribution Object Name + No, !- Account for Dedicated Outdoor Air System + NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy + autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} + autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + + DesignSpecification:OutdoorAir, + SZ DSOA Zone 2, !- Name + sum, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + Zone 3, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA Zone 3, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDayWithLimit, !- Cooling Design Air Flow Method + , !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + , !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + , !- Heating Maximum Air Flow Fraction + , !- Design Specification Zone Air Distribution Object Name + No, !- Account for Dedicated Outdoor Air System + NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy + autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} + autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + + DesignSpecification:OutdoorAir, + SZ DSOA Zone 3, !- Name + sum, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + Zone 4, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA Zone 4, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDayWithLimit, !- Cooling Design Air Flow Method + , !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + , !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + , !- Heating Maximum Air Flow Fraction + , !- Design Specification Zone Air Distribution Object Name + No, !- Account for Dedicated Outdoor Air System + NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy + autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} + autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + + DesignSpecification:OutdoorAir, + SZ DSOA Zone 4, !- Name + sum, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + Sizing:Zone, + Zone 5, !- Zone or ZoneList Name + SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method + 14., !- Zone Cooling Design Supply Air Temperature {C} + , !- Zone Cooling Design Supply Air Temperature Difference {deltaC} + SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method + 50., !- Zone Heating Design Supply Air Temperature {C} + , !- Zone Heating Design Supply Air Temperature Difference {deltaC} + 0.009, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.004, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + SZ DSOA Zone 5 List, !- Design Specification Outdoor Air Object Name + 0.0, !- Zone Heating Sizing Factor + 0.0, !- Zone Cooling Sizing Factor + DesignDayWithLimit, !- Cooling Design Air Flow Method + , !- Cooling Design Air Flow Rate {m3/s} + , !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2} + , !- Cooling Minimum Air Flow {m3/s} + , !- Cooling Minimum Air Flow Fraction + DesignDay, !- Heating Design Air Flow Method + , !- Heating Design Air Flow Rate {m3/s} + , !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2} + , !- Heating Maximum Air Flow {m3/s} + , !- Heating Maximum Air Flow Fraction + , !- Design Specification Zone Air Distribution Object Name + No, !- Account for Dedicated Outdoor Air System + NeutralSupplyAir, !- Dedicated Outdoor Air System Control Strategy + autosize, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C} + autosize; !- Dedicated Outdoor Air High Setpoint Temperature for Design {C} + + DesignSpecification:OutdoorAir, + SZ DSOA Zone 5 Office, !- Name + sum, !- Outdoor Air Method + 0.00236, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + DesignSpecification:OutdoorAir, + SZ DSOA Zone 5 Conference, !- Name + sum, !- Outdoor Air Method + 0.00436, !- Outdoor Air Flow per Person {m3/s-person} + 0.000305, !- Outdoor Air Flow per Zone Floor Area {m3/s-m2} + 0.0; !- Outdoor Air Flow per Zone {m3/s} + + DesignSpecification:OutdoorAir:SpaceList, + SZ DSOA Zone 5 List, !- Name + Space 5 Office, !- Space 1 Name + SZ DSOA Zone 5 Office, !- Space 1 Design Specification Outdoor Air Object Name + Space 5 Conference, !- Space 2 Name + SZ DSOA Zone 5 Conference; !- Space 2 Design Specification Outdoor Air Object Name + + Sizing:System, + VAV Sys 1, !- AirLoop Name + sensible, !- Type of Load to Size On + autosize, !- Design Outdoor Air Flow Rate {m3/s} + 0.3, !- Central Heating Maximum System Air Flow Ratio + 4.5, !- Preheat Design Temperature {C} + 0.008, !- Preheat Design Humidity Ratio {kgWater/kgDryAir} + 11.0, !- Precool Design Temperature {C} + 0.008, !- Precool Design Humidity Ratio {kgWater/kgDryAir} + 12.8, !- Central Cooling Design Supply Air Temperature {C} + 16.7, !- Central Heating Design Supply Air Temperature {C} + noncoincident, !- Type of Zone Sum to Use + no, !- 100% Outdoor Air in Cooling + no, !- 100% Outdoor Air in Heating + 0.008, !- Central Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir} + 0.008, !- Central Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir} + DesignDay, !- Cooling Supply Air Flow Rate Method + 0, !- Cooling Supply Air Flow Rate {m3/s} + , !- Cooling Supply Air Flow Rate Per Floor Area {m3/s-m2} + , !- Cooling Fraction of Autosized Cooling Supply Air Flow Rate + , !- Cooling Supply Air Flow Rate Per Unit Cooling Capacity {m3/s-W} + DesignDay, !- Heating Supply Air Flow Rate Method + 0, !- Heating Supply Air Flow Rate {m3/s} + , !- Heating Supply Air Flow Rate Per Floor Area {m3/s-m2} + , !- Heating Fraction of Autosized Heating Supply Air Flow Rate + , !- Heating Fraction of Autosized Cooling Supply Air Flow Rate + , !- Heating Supply Air Flow Rate Per Unit Heating Capacity {m3/s-W} + , !- System Outdoor Air Method + 1.0, !- Zone Maximum Outdoor Air Fraction {dimensionless} + CoolingDesignCapacity, !- Cooling Design Capacity Method + autosize, !- Cooling Design Capacity {W} + , !- Cooling Design Capacity Per Floor Area {W/m2} + , !- Fraction of Autosized Cooling Design Capacity + HeatingDesignCapacity, !- Heating Design Capacity Method + autosize, !- Heating Design Capacity {W} + , !- Heating Design Capacity Per Floor Area {W/m2} + , !- Fraction of Autosized Heating Design Capacity + VAV; !- Central Cooling Capacity Control Method + + Sizing:Plant, + Hot Water Loop, !- Plant or Condenser Loop Name + heating, !- Loop Type + 82., !- Design Loop Exit Temperature {C} + 11; !- Loop Design Temperature Difference {deltaC} + + Sizing:Plant, + Chilled Water Loop, !- Plant or Condenser Loop Name + cooling, !- Loop Type + 7.00, !- Design Loop Exit Temperature {C} + 4.00; !- Loop Design Temperature Difference {deltaC} + + Schedule:Compact, + Htg-SetP-Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: SummerDesignDay, !- Field 2 + Until: 24:00,16.7, !- Field 3 + For: WinterDesignDay, !- Field 5 + Until: 24:00,22.2, !- Field 6 + For: WeekDays, !- Field 8 + Until: 6:00,16.7, !- Field 9 + Until: 20:00,22.2, !- Field 11 + Until: 24:00,16.7, !- Field 13 + For: WeekEnds Holiday, !- Field 15 + Until: 24:00,16.7, !- Field 16 + For: AllOtherDays, !- Field 18 + Until: 24:00,16.7; !- Field 19 + + Schedule:Compact, + PlenumHtg-SetP-Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,12.8; !- Field 3 + + Schedule:Compact, + Clg-SetP-Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: SummerDesignDay, !- Field 2 + Until: 24:00,23.9, !- Field 3 + For: WinterDesignDay, !- Field 5 + Until: 24:00,29.4, !- Field 6 + For: WeekDays, !- Field 8 + Until: 6:00,29.4, !- Field 9 + Until: 20:00,23.9, !- Field 11 + Until: 24:00,29.4, !- Field 13 + For: WeekEnds Holiday, !- Field 15 + Until: 24:00,29.4, !- Field 16 + For: AllOtherDays, !- Field 18 + Until: 24:00,29.4; !- Field 19 + + Schedule:Compact, + PlenumClg-SetP-Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,40.0; !- Field 3 + + Schedule:Compact, + Zone Control Type Sched, !- Name + Control Type, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: SummerDesignDay, !- Field 2 + Until: 24:00,2, !- Field 3 + For: WinterDesignDay, !- Field 5 + Until: 24:00,1, !- Field 6 + For: AllOtherDays, !- Field 8 + Until: 24:00,4; !- Field 9 + + Schedule:Compact, + Min OA Sched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: Weekdays, !- Field 2 + Until: 6:00,0.02, !- Field 3 + Until: 20:00,1.0, !- Field 5 + Until: 24:00,0.02, !- Field 7 + For: AllOtherDays, !- Field 9 + Until: 24:00,0.02; !- Field 10 + + Schedule:Compact, + FanAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0, !- Field 3 + Through: 9/30, !- Field 5 + For: WeekDays, !- Field 6 + Until: 6:00,0.0, !- Field 7 + Until: 20:00,1.0, !- Field 9 + Until: 24:00,0.0, !- Field 11 + For: SummerDesignDay WinterDesignDay, !- Field 13 + Until: 24:00,1.0, !- Field 14 + For: AllOtherDays, !- Field 16 + Until: 24:00,0.0, !- Field 17 + Through: 12/31, !- Field 19 + For: AllDays, !- Field 20 + Until: 24:00,1.0; !- Field 21 + + Schedule:Compact, + CoolingCoilAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: WeekDays, !- Field 2 + Until: 6:00,0.0, !- Field 3 + Until: 20:00,1.0, !- Field 5 + Until: 24:00,0.0, !- Field 7 + For: SummerDesignDay WinterDesignDay, !- Field 9 + Until: 24:00,1.0, !- Field 10 + For: AllOtherDays, !- Field 12 + Until: 24:00,0.0; !- Field 13 + + Schedule:Compact, + CoolingPumpAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0; !- Field 3 + + Schedule:Compact, + ReheatCoilAvailSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0, !- Field 3 + Through: 9/30, !- Field 5 + For: WeekDays, !- Field 6 + Until: 6:00,0.0, !- Field 7 + Until: 20:00,1.0, !- Field 9 + Until: 24:00,0.0, !- Field 11 + For: SummerDesignDay WinterDesignDay, !- Field 13 + Until: 24:00,1.0, !- Field 14 + For: AllOtherDays, !- Field 16 + Until: 24:00,0.0, !- Field 17 + Through: 12/31, !- Field 19 + For: AllDays, !- Field 20 + Until: 24:00,1.0; !- Field 21 + + Schedule:Compact, + CW Loop Temp Schedule, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,7.22; !- Field 3 + + Schedule:Compact, + HW Loop Temp Schedule, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,82; !- Field 3 + + Schedule:Compact, + PlantOnSched, !- Name + Fraction, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,1.0; !- Field 3 + + Schedule:Compact, + Seasonal Reset Supply Air Temp Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 3/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,16.0, !- Field 3 + Through: 9/30, !- Field 5 + For: AllDays, !- Field 6 + Until: 24:00,13.0, !- Field 7 + Through: 12/31, !- Field 9 + For: AllDays, !- Field 10 + Until: 24:00,16.0; !- Field 11 + + Schedule:Compact, + OA Cooling Supply Air Temp Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,11.5; !- Field 3 + + Schedule:Compact, + OA Heating Supply Air Temp Sch, !- Name + Temperature, !- Schedule Type Limits Name + Through: 12/31, !- Field 1 + For: AllDays, !- Field 2 + Until: 24:00,4.5; !- Field 3 + + OutdoorAir:NodeList, + OutsideAirInletNodes; !- Node or NodeList Name 1 + + NodeList, + OutsideAirInletNodes, !- Name + Outside Air Inlet Node 1;!- Node 1 Name + + ZoneHVAC:EquipmentConnections, + Zone 1, !- Zone Name + Zone 1 Eq, !- Zone Conditioning Equipment List Name + Zone 1 In Node, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + Zone 1 Node, !- Zone Air Node Name + Zone 1 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + Zone 2, !- Zone Name + Zone 2 Eq, !- Zone Conditioning Equipment List Name + Zone 2 In Node, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + Zone 2 Node, !- Zone Air Node Name + Zone 2 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + Zone 3, !- Zone Name + Zone 3 Eq, !- Zone Conditioning Equipment List Name + Zone 3 In Node, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + Zone 3 Node, !- Zone Air Node Name + Zone 3 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + Zone 4, !- Zone Name + Zone 4 Eq, !- Zone Conditioning Equipment List Name + Zone 4 In Node, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + Zone 4 Node, !- Zone Air Node Name + Zone 4 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneHVAC:EquipmentConnections, + Zone 5, !- Zone Name + Zone 5 Eq, !- Zone Conditioning Equipment List Name + Zone 5 In Node, !- Zone Air Inlet Node or NodeList Name + , !- Zone Air Exhaust Node or NodeList Name + Zone 5 Node, !- Zone Air Node Name + Zone 5 Out Node; !- Zone Return Air Node or NodeList Name + + ZoneControl:Thermostat, + Zone 1 Control, !- Name + Zone 1, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + Zone 2 Control, !- Name + Zone 2, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + Zone 3 Control, !- Name + Zone 3, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + Zone 4 Control, !- Name + Zone 4, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ZoneControl:Thermostat, + Zone 5 Control, !- Name + Zone 5, !- Zone or ZoneList Name + Zone Control Type Sched, !- Control Type Schedule Name + ThermostatSetpoint:SingleCooling, !- Control 1 Object Type + CoolingSetPoint, !- Control 1 Name + ThermostatSetpoint:SingleHeating, !- Control 2 Object Type + HeatingSetpoint, !- Control 2 Name + ThermostatSetpoint:DualSetpoint, !- Control 3 Object Type + DualSetPoint; !- Control 3 Name + + ThermostatSetpoint:SingleHeating, + HeatingSetpoint, !- Name + Htg-SetP-Sch; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:SingleCooling, + CoolingSetpoint, !- Name + Clg-SetP-Sch; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:SingleHeating, + PlenumHeatingSetpoint, !- Name + PlenumHtg-SetP-Sch; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:SingleCooling, + PlenumCoolingSetpoint, !- Name + PlenumClg-SetP-Sch; !- Setpoint Temperature Schedule Name + + ThermostatSetpoint:DualSetpoint, + DualSetPoint, !- Name + Htg-SetP-Sch, !- Heating Setpoint Temperature Schedule Name + Clg-SetP-Sch; !- Cooling Setpoint Temperature Schedule Name + + ZoneHVAC:EquipmentList, + Zone 1 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + Zone 1 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:EquipmentList, + Zone 2 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + Zone 2 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:EquipmentList, + Zone 3 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + Zone 3 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:EquipmentList, + Zone 4 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + Zone 4 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:EquipmentList, + Zone 5 Eq, !- Name + SequentialLoad, !- Load Distribution Scheme + ZoneHVAC:AirDistributionUnit, !- Zone Equipment 1 Object Type + Zone 5 ATU, !- Zone Equipment 1 Name + 1, !- Zone Equipment 1 Cooling Sequence + 1, !- Zone Equipment 1 Heating or No-Load Sequence + , !- Zone Equipment 1 Sequential Cooling Fraction Schedule Name + ; !- Zone Equipment 1 Sequential Heating Fraction Schedule Name + + ZoneHVAC:AirDistributionUnit, + Zone 1 ATU, !- Name + Zone 1 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + Zone 1 VAV Reheat; !- Air Terminal Name + + ZoneHVAC:AirDistributionUnit, + Zone 2 ATU, !- Name + Zone 2 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + Zone 2 VAV Reheat; !- Air Terminal Name + + ZoneHVAC:AirDistributionUnit, + Zone 3 ATU, !- Name + Zone 3 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + Zone 3 VAV Reheat; !- Air Terminal Name + + ZoneHVAC:AirDistributionUnit, + Zone 4 ATU, !- Name + Zone 4 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + Zone 4 VAV Reheat; !- Air Terminal Name + + ZoneHVAC:AirDistributionUnit, + Zone 5 ATU, !- Name + Zone 5 In Node, !- Air Distribution Unit Outlet Node Name + AirTerminal:SingleDuct:VAV:Reheat, !- Air Terminal Object Type + Zone 5 VAV Reheat; !- Air Terminal Name + + AirTerminal:SingleDuct:VAV:Reheat, + Zone 1 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + Zone 1 Zone Coil Air In Node, !- Damper Air Outlet Node Name + Zone 1 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + Constant, !- Zone Minimum Air Flow Input Method + 0.3, !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + Zone 1 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + Zone 1 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + NORMAL, !- Damper Heating Action + AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + AUTOCALCULATE; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + Zone 2 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + Zone 2 Zone Coil Air In Node, !- Damper Air Outlet Node Name + Zone 2 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + Constant, !- Zone Minimum Air Flow Input Method + 0.3, !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + Zone 2 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + Zone 2 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + NORMAL, !- Damper Heating Action + AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + AUTOCALCULATE; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + Zone 3 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + Zone 3 Zone Coil Air In Node, !- Damper Air Outlet Node Name + Zone 3 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + Constant, !- Zone Minimum Air Flow Input Method + 0.3, !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + Zone 3 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + Zone 3 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + NORMAL, !- Damper Heating Action + AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + AUTOCALCULATE; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + Zone 4 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + Zone 4 Zone Coil Air In Node, !- Damper Air Outlet Node Name + Zone 4 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + Constant, !- Zone Minimum Air Flow Input Method + 0.3, !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + Zone 4 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + Zone 4 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + NORMAL, !- Damper Heating Action + AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + AUTOCALCULATE; !- Maximum Flow Fraction During Reheat + + AirTerminal:SingleDuct:VAV:Reheat, + Zone 5 VAV Reheat, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + Zone 5 Zone Coil Air In Node, !- Damper Air Outlet Node Name + Zone 5 ATU In Node, !- Air Inlet Node Name + autosize, !- Maximum Air Flow Rate {m3/s} + Constant, !- Zone Minimum Air Flow Input Method + 0.3, !- Constant Minimum Air Flow Fraction + , !- Fixed Minimum Air Flow Rate {m3/s} + , !- Minimum Air Flow Fraction Schedule Name + Coil:Heating:Water, !- Reheat Coil Object Type + Zone 5 Zone Coil, !- Reheat Coil Name + autosize, !- Maximum Hot Water or Steam Flow Rate {m3/s} + 0.0, !- Minimum Hot Water or Steam Flow Rate {m3/s} + Zone 5 In Node, !- Air Outlet Node Name + 0.001, !- Convergence Tolerance + NORMAL, !- Damper Heating Action + AUTOCALCULATE, !- Maximum Flow per Zone Floor Area During Reheat {m3/s-m2} + AUTOCALCULATE; !- Maximum Flow Fraction During Reheat + + Coil:Heating:Water, + Zone 1 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + Zone 1 Zone Coil Water In Node, !- Water Inlet Node Name + Zone 1 Zone Coil Water Out Node, !- Water Outlet Node Name + Zone 1 Zone Coil Air In Node, !- Air Inlet Node Name + Zone 1 In Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Coil:Heating:Water, + Zone 2 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + Zone 2 Zone Coil Water In Node, !- Water Inlet Node Name + Zone 2 Zone Coil Water Out Node, !- Water Outlet Node Name + Zone 2 Zone Coil Air In Node, !- Air Inlet Node Name + Zone 2 In Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Coil:Heating:Water, + Zone 3 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + Zone 3 Zone Coil Water In Node, !- Water Inlet Node Name + Zone 3 Zone Coil Water Out Node, !- Water Outlet Node Name + Zone 3 Zone Coil Air In Node, !- Air Inlet Node Name + Zone 3 In Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Coil:Heating:Water, + Zone 4 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + Zone 4 Zone Coil Water In Node, !- Water Inlet Node Name + Zone 4 Zone Coil Water Out Node, !- Water Outlet Node Name + Zone 4 Zone Coil Air In Node, !- Air Inlet Node Name + Zone 4 In Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Coil:Heating:Water, + Zone 5 Zone Coil, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + Zone 5 Zone Coil Water In Node, !- Water Inlet Node Name + Zone 5 Zone Coil Water Out Node, !- Water Outlet Node Name + Zone 5 Zone Coil Air In Node, !- Air Inlet Node Name + Zone 5 In Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + AirLoopHVAC:ReturnPath, + ReturnAirPath1, !- Name + PLENUM-1 Out Node, !- Return Air Path Outlet Node Name + AirLoopHVAC:ReturnPlenum,!- Component 1 Object Type + Return-Plenum-1; !- Component 1 Name + + AirLoopHVAC:ReturnPlenum, + Return-Plenum-1, !- Name + PLENUM-1, !- Zone Name + PLENUM-1 Node, !- Zone Node Name + PLENUM-1 Out Node, !- Outlet Node Name + , !- Induced Air Outlet Node or NodeList Name + Zone 1 Out Node, !- Inlet 1 Node Name + Zone 2 Out Node, !- Inlet 2 Node Name + Zone 3 Out Node, !- Inlet 3 Node Name + Zone 4 Out Node, !- Inlet 4 Node Name + Zone 5 Out Node; !- Inlet 5 Node Name + + AirLoopHVAC:SupplyPath, + Zone Supply Air Path 1, !- Name + Zone Eq In Node, !- Supply Air Path Inlet Node Name + AirLoopHVAC:ZoneSplitter,!- Component 1 Object Type + Zone Supply Air Splitter 1; !- Component 1 Name + + AirLoopHVAC:ZoneSplitter, + Zone Supply Air Splitter 1, !- Name + Zone Eq In Node, !- Inlet Node Name + Zone 1 ATU In Node, !- Outlet 1 Node Name + Zone 2 ATU In Node, !- Outlet 2 Node Name + Zone 3 ATU In Node, !- Outlet 3 Node Name + Zone 4 ATU In Node, !- Outlet 4 Node Name + Zone 5 ATU In Node; !- Outlet 5 Node Name + + AirLoopHVAC, + VAV Sys 1, !- Name + VAV Sys 1 Controllers, !- Controller List Name + VAV Sys 1 Avail List, !- Availability Manager List Name + autosize, !- Design Supply Air Flow Rate {m3/s} + VAV Sys 1 Branches, !- Branch List Name + , !- Connector List Name + VAV Sys 1 Inlet Node, !- Supply Side Inlet Node Name + PLENUM-1 Out Node, !- Demand Side Outlet Node Name + Zone Eq In Node, !- Demand Side Inlet Node Names + VAV Sys 1 Outlet Node; !- Supply Side Outlet Node Names + + AirLoopHVAC:ControllerList, + VAV Sys 1 Controllers, !- Name + Controller:WaterCoil, !- Controller 1 Object Type + Central Cooling Coil Controller 1, !- Controller 1 Name + Controller:WaterCoil, !- Controller 2 Object Type + Central Heating Coil Controller 1; !- Controller 2 Name + + AvailabilityManagerAssignmentList, + VAV Sys 1 Avail List, !- Name + AvailabilityManager:Scheduled, !- Availability Manager 1 Object Type + VAV Sys 1 Avail; !- Availability Manager 1 Name + + AvailabilityManager:Scheduled, + VAV Sys 1 Avail, !- Name + FanAvailSched; !- Schedule Name + + BranchList, + VAV Sys 1 Branches, !- Name + VAV Sys 1 Main Branch; !- Branch 1 Name + + Branch, + VAV Sys 1 Main Branch, !- Name + , !- Pressure Drop Curve Name + AirLoopHVAC:OutdoorAirSystem, !- Component 1 Object Type + OA Sys 1, !- Component 1 Name + VAV Sys 1 Inlet Node, !- Component 1 Inlet Node Name + Mixed Air Node 1, !- Component 1 Outlet Node Name + Coil:Cooling:Water, !- Component 2 Object Type + Main Cooling Coil 1, !- Component 2 Name + Mixed Air Node 1, !- Component 2 Inlet Node Name + Main Cooling Coil 1 Outlet Node, !- Component 2 Outlet Node Name + Coil:Heating:Water, !- Component 3 Object Type + Main Heating Coil 1, !- Component 3 Name + Main Cooling Coil 1 Outlet Node, !- Component 3 Inlet Node Name + Main Heating Coil 1 Outlet Node, !- Component 3 Outlet Node Name + Fan:VariableVolume, !- Component 4 Object Type + Supply Fan 1, !- Component 4 Name + Main Heating Coil 1 Outlet Node, !- Component 4 Inlet Node Name + VAV Sys 1 Outlet Node; !- Component 4 Outlet Node Name + + AirLoopHVAC:OutdoorAirSystem, + OA Sys 1, !- Name + OA Sys 1 Controllers, !- Controller List Name + OA Sys 1 Equipment; !- Outdoor Air Equipment List Name + + AirLoopHVAC:ControllerList, + OA Sys 1 Controllers, !- Name + Controller:OutdoorAir, !- Controller 1 Object Type + OA Controller 1, !- Controller 1 Name + Controller:WaterCoil, !- Controller 2 Object Type + OA CC Controller 1, !- Controller 2 Name + Controller:WaterCoil, !- Controller 3 Object Type + OA HC Controller 1; !- Controller 3 Name + + AirLoopHVAC:OutdoorAirSystem:EquipmentList, + OA Sys 1 Equipment, !- Name + Coil:Heating:Water, !- Component 1 Object Type + OA Heating Coil 1, !- Component 1 Name + Coil:Cooling:Water, !- Component 2 Object Type + OA Cooling Coil 1, !- Component 2 Name + OutdoorAir:Mixer, !- Component 3 Object Type + OA Mixing Box 1; !- Component 3 Name + + Coil:Heating:Water, + OA Heating Coil 1, !- Name + CoolingCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + OA Heating Coil 1 Water Inlet Node, !- Water Inlet Node Name + OA Heating Coil 1 Water Outlet Node, !- Water Outlet Node Name + Outside Air Inlet Node 1,!- Air Inlet Node Name + OA Heating Coil 1 Air Outlet Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Coil:Cooling:Water, + OA Cooling Coil 1, !- Name + CoolingCoilAvailSched, !- Availability Schedule Name + autosize, !- Design Water Flow Rate {m3/s} + autosize, !- Design Air Flow Rate {m3/s} + autosize, !- Design Inlet Water Temperature {C} + autosize, !- Design Inlet Air Temperature {C} + autosize, !- Design Outlet Air Temperature {C} + autosize, !- Design Inlet Air Humidity Ratio {kgWater/kgDryAir} + autosize, !- Design Outlet Air Humidity Ratio {kgWater/kgDryAir} + OA Cooling Coil 1 Water Inlet Node, !- Water Inlet Node Name + OA Cooling Coil 1 Water Outlet Node, !- Water Outlet Node Name + OA Heating Coil 1 Air Outlet Node, !- Air Inlet Node Name + OA Mixing Box 1 Inlet Node, !- Air Outlet Node Name + SimpleAnalysis, !- Type of Analysis + CrossFlow, !- Heat Exchanger Configuration + , !- Condensate Collection Water Storage Tank Name + 4.0; !- Design Water Temperature Difference {deltaC} + + OutdoorAir:Mixer, + OA Mixing Box 1, !- Name + Mixed Air Node 1, !- Mixed Air Node Name + OA Mixing Box 1 Inlet Node, !- Outdoor Air Stream Node Name + Relief Air Outlet Node 1,!- Relief Air Stream Node Name + VAV Sys 1 Inlet Node; !- Return Air Stream Node Name + + Coil:Cooling:Water, + Main Cooling Coil 1, !- Name + CoolingCoilAvailSched, !- Availability Schedule Name + autosize, !- Design Water Flow Rate {m3/s} + autosize, !- Design Air Flow Rate {m3/s} + autosize, !- Design Inlet Water Temperature {C} + autosize, !- Design Inlet Air Temperature {C} + autosize, !- Design Outlet Air Temperature {C} + autosize, !- Design Inlet Air Humidity Ratio {kgWater/kgDryAir} + autosize, !- Design Outlet Air Humidity Ratio {kgWater/kgDryAir} + Main Cooling Coil 1 Water Inlet Node, !- Water Inlet Node Name + Main Cooling Coil 1 Water Outlet Node, !- Water Outlet Node Name + Mixed Air Node 1, !- Air Inlet Node Name + Main Cooling Coil 1 Outlet Node, !- Air Outlet Node Name + SimpleAnalysis, !- Type of Analysis + CrossFlow, !- Heat Exchanger Configuration + , !- Condensate Collection Water Storage Tank Name + 4.0; !- Design Water Temperature Difference {deltaC} + + Coil:Heating:Water, + Main Heating Coil 1, !- Name + ReheatCoilAvailSched, !- Availability Schedule Name + autosize, !- U-Factor Times Area Value {W/K} + autosize, !- Maximum Water Flow Rate {m3/s} + Main Heating Coil 1 Water Inlet Node, !- Water Inlet Node Name + Main Heating Coil 1 Water Outlet Node, !- Water Outlet Node Name + Main Cooling Coil 1 Outlet Node, !- Air Inlet Node Name + Main Heating Coil 1 Outlet Node, !- Air Outlet Node Name + UFactorTimesAreaAndDesignWaterFlowRate, !- Performance Input Method + autosize, !- Rated Capacity {W} + 82.2, !- Rated Inlet Water Temperature {C} + 16.6, !- Rated Inlet Air Temperature {C} + 71.1, !- Rated Outlet Water Temperature {C} + 32.2, !- Rated Outlet Air Temperature {C} + , !- Rated Ratio for Air and Water Convection + 11; !- Design Water Temperature Difference {deltaC} + + Fan:VariableVolume, + Supply Fan 1, !- Name + FanAvailSched, !- Availability Schedule Name + 0.7, !- Fan Total Efficiency + 600.0, !- Pressure Rise {Pa} + autosize, !- Maximum Flow Rate {m3/s} + Fraction, !- Fan Power Minimum Flow Rate Input Method + 0.25, !- Fan Power Minimum Flow Fraction + , !- Fan Power Minimum Air Flow Rate {m3/s} + 0.9, !- Motor Efficiency + 1.0, !- Motor In Airstream Fraction + 0.35071223, !- Fan Power Coefficient 1 + 0.30850535, !- Fan Power Coefficient 2 + -0.54137364, !- Fan Power Coefficient 3 + 0.87198823, !- Fan Power Coefficient 4 + 0.000, !- Fan Power Coefficient 5 + Main Heating Coil 1 Outlet Node, !- Air Inlet Node Name + VAV Sys 1 Outlet Node; !- Air Outlet Node Name + + Controller:WaterCoil, + OA HC Controller 1, !- Name + Temperature, !- Control Variable + Normal, !- Action + FLOW, !- Actuator Variable + OA Heating Coil 1 Air Outlet Node, !- Sensor Node Name + OA Heating Coil 1 Water Inlet Node, !- Actuator Node Name + 0.002, !- Controller Convergence Tolerance {deltaC} + autosize, !- Maximum Actuated Flow {m3/s} + 0.0; !- Minimum Actuated Flow {m3/s} + + Controller:WaterCoil, + OA CC Controller 1, !- Name + Temperature, !- Control Variable + Reverse, !- Action + FLOW, !- Actuator Variable + OA Mixing Box 1 Inlet Node, !- Sensor Node Name + OA Cooling Coil 1 Water Inlet Node, !- Actuator Node Name + 0.002, !- Controller Convergence Tolerance {deltaC} + autosize, !- Maximum Actuated Flow {m3/s} + 0.0; !- Minimum Actuated Flow {m3/s} + + Controller:WaterCoil, + Central Cooling Coil Controller 1, !- Name + Temperature, !- Control Variable + Reverse, !- Action + FLOW, !- Actuator Variable + Main Cooling Coil 1 Outlet Node, !- Sensor Node Name + Main Cooling Coil 1 Water Inlet Node, !- Actuator Node Name + 0.002, !- Controller Convergence Tolerance {deltaC} + autosize, !- Maximum Actuated Flow {m3/s} + 0.0; !- Minimum Actuated Flow {m3/s} + + Controller:OutdoorAir, + OA Controller 1, !- Name + Relief Air Outlet Node 1,!- Relief Air Outlet Node Name + VAV Sys 1 Inlet Node, !- Return Air Node Name + Mixed Air Node 1, !- Mixed Air Node Name + Outside Air Inlet Node 1,!- Actuator Node Name + autosize, !- Minimum Outdoor Air Flow Rate {m3/s} + autosize, !- Maximum Outdoor Air Flow Rate {m3/s} + NoEconomizer, !- Economizer Control Type + ModulateFlow, !- Economizer Control Action Type + 19., !- Economizer Maximum Limit Dry-Bulb Temperature {C} + , !- Economizer Maximum Limit Enthalpy {J/kg} + , !- Economizer Maximum Limit Dewpoint Temperature {C} + , !- Electronic Enthalpy Limit Curve Name + 4.6, !- Economizer Minimum Limit Dry-Bulb Temperature {C} + NoLockout, !- Lockout Type + FixedMinimum, !- Minimum Limit Type + Min OA Sched; !- Minimum Outdoor Air Schedule Name + + Controller:WaterCoil, + Central Heating Coil Controller 1, !- Name + Temperature, !- Control Variable + Normal, !- Action + FLOW, !- Actuator Variable + Main Heating Coil 1 Outlet Node, !- Sensor Node Name + Main Heating Coil 1 Water Inlet Node, !- Actuator Node Name + 0.002, !- Controller Convergence Tolerance {deltaC} + autosize, !- Maximum Actuated Flow {m3/s} + 0.0; !- Minimum Actuated Flow {m3/s} + + SetpointManager:Scheduled, + Supply Air Temp Manager 1, !- Name + Temperature, !- Control Variable + Seasonal Reset Supply Air Temp Sch, !- Schedule Name + VAV Sys 1 Outlet Node; !- Setpoint Node or NodeList Name + + SetpointManager:Scheduled, + OA Air Temp Manager 1, !- Name + Temperature, !- Control Variable + OA Cooling Supply Air Temp Sch, !- Schedule Name + OA Mixing Box 1 Inlet Node; !- Setpoint Node or NodeList Name + + SetpointManager:Scheduled, + OA Air Temp Manager 2, !- Name + Temperature, !- Control Variable + OA Heating Supply Air Temp Sch, !- Schedule Name + OA Heating Coil 1 Air Outlet Node; !- Setpoint Node or NodeList Name + + SetpointManager:MixedAir, + Mixed Air Temp Manager 1,!- Name + Temperature, !- Control Variable + VAV Sys 1 Outlet Node, !- Reference Setpoint Node Name + Main Heating Coil 1 Outlet Node, !- Fan Inlet Node Name + VAV Sys 1 Outlet Node, !- Fan Outlet Node Name + Main Branch SetPoint Node List; !- Setpoint Node or NodeList Name + + NodeList, + Main Branch SetPoint Node List, !- Name + Mixed Air Node 1, !- Node 1 Name + Main Cooling Coil 1 Outlet Node, !- Node 2 Name + Main Heating Coil 1 Outlet Node; !- Node 3 Name + + PlantLoop, + Hot Water Loop, !- Name + Water, !- Fluid Type + , !- User Defined Fluid Type + Hot Loop Operation, !- Plant Equipment Operation Scheme Name + HW Supply Outlet Node, !- Loop Temperature Setpoint Node Name + 100, !- Maximum Loop Temperature {C} + 10, !- Minimum Loop Temperature {C} + autosize, !- Maximum Loop Flow Rate {m3/s} + 0.0, !- Minimum Loop Flow Rate {m3/s} + , !- Plant Loop Volume {m3} + HW Supply Inlet Node, !- Plant Side Inlet Node Name + HW Supply Outlet Node, !- Plant Side Outlet Node Name + Heating Supply Side Branches, !- Plant Side Branch List Name + Heating Supply Side Connectors, !- Plant Side Connector List Name + HW Demand Inlet Node, !- Demand Side Inlet Node Name + HW Demand Outlet Node, !- Demand Side Outlet Node Name + Heating Demand Side Branches, !- Demand Side Branch List Name + Heating Demand Side Connectors, !- Demand Side Connector List Name + SequentialLoad; !- Load Distribution Scheme + + SetpointManager:Scheduled, + Hot Water Loop Setpoint Manager, !- Name + Temperature, !- Control Variable + HW Loop Temp Schedule, !- Schedule Name + HW Supply Outlet Node; !- Setpoint Node or NodeList Name + + BranchList, + Heating Supply Side Branches, !- Name + Heating Supply Inlet Branch, !- Branch 1 Name + Central Boiler Branch, !- Branch 2 Name + Heating Supply Bypass Branch, !- Branch 3 Name + Heating Supply Outlet Branch; !- Branch 4 Name + + ConnectorList, + Heating Supply Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + Heating Supply Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + Heating Supply Mixer; !- Connector 2 Name + + Branch, + Heating Supply Inlet Branch, !- Name + , !- Pressure Drop Curve Name + Pump:VariableSpeed, !- Component 1 Object Type + HW Circ Pump, !- Component 1 Name + HW Supply Inlet Node, !- Component 1 Inlet Node Name + HW Pump Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Central Boiler Branch, !- Name + , !- Pressure Drop Curve Name + Boiler:HotWater, !- Component 1 Object Type + Central Boiler, !- Component 1 Name + Central Boiler Inlet Node, !- Component 1 Inlet Node Name + Central Boiler Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Heating Supply Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Supply Side Bypass, !- Component 1 Name + Heating Supply Bypass Inlet Node, !- Component 1 Inlet Node Name + Heating Supply Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Supply Side Bypass, !- Name + Heating Supply Bypass Inlet Node, !- Inlet Node Name + Heating Supply Bypass Outlet Node; !- Outlet Node Name + + Branch, + Heating Supply Outlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Supply Outlet, !- Component 1 Name + Heating Supply Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + HW Supply Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Supply Outlet, !- Name + Heating Supply Exit Pipe Inlet Node, !- Inlet Node Name + HW Supply Outlet Node; !- Outlet Node Name + + BranchList, + Heating Demand Side Branches, !- Name + Heating Demand Inlet Branch, !- Branch 1 Name + Zone 1 Reheat Branch, !- Branch 2 Name + Zone 2 Reheat Branch, !- Branch 3 Name + Zone 3 Reheat Branch, !- Branch 4 Name + Zone 4 Reheat Branch, !- Branch 5 Name + Zone 5 Reheat Branch, !- Branch 6 Name + OA Heating Coil Branch, !- Branch 7 Name + Main Heating Coil 1 Branch, !- Branch 8 Name + Heating Demand Bypass Branch, !- Branch 9 Name + Heating Demand Outlet Branch; !- Branch 10 Name + + ConnectorList, + Heating Demand Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + Heating Demand Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + Heating Demand Mixer; !- Connector 2 Name + + Branch, + Heating Demand Inlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Demand Inlet Pipe, !- Component 1 Name + HW Demand Inlet Node, !- Component 1 Inlet Node Name + HW Demand Entrance Pipe Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Demand Inlet Pipe, !- Name + HW Demand Inlet Node, !- Inlet Node Name + HW Demand Entrance Pipe Outlet Node; !- Outlet Node Name + + Branch, + Heating Demand Outlet Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Demand Outlet Pipe, !- Component 1 Name + HW Demand Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + HW Demand Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Demand Outlet Pipe, !- Name + HW Demand Exit Pipe Inlet Node, !- Inlet Node Name + HW Demand Outlet Node; !- Outlet Node Name + + Branch, + Zone 1 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + Zone 1 Zone Coil, !- Component 1 Name + Zone 1 Zone Coil Water In Node, !- Component 1 Inlet Node Name + Zone 1 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + Zone 2 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + Zone 2 Zone Coil, !- Component 1 Name + Zone 2 Zone Coil Water In Node, !- Component 1 Inlet Node Name + Zone 2 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + Zone 3 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + Zone 3 Zone Coil, !- Component 1 Name + Zone 3 Zone Coil Water In Node, !- Component 1 Inlet Node Name + Zone 3 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + Zone 4 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + Zone 4 Zone Coil, !- Component 1 Name + Zone 4 Zone Coil Water In Node, !- Component 1 Inlet Node Name + Zone 4 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + Zone 5 Reheat Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + Zone 5 Zone Coil, !- Component 1 Name + Zone 5 Zone Coil Water In Node, !- Component 1 Inlet Node Name + Zone 5 Zone Coil Water Out Node; !- Component 1 Outlet Node Name + + Branch, + OA Heating Coil Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + OA Heating Coil 1, !- Component 1 Name + OA Heating Coil 1 Water Inlet Node, !- Component 1 Inlet Node Name + OA Heating Coil 1 Water Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Main Heating Coil 1 Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Heating:Water, !- Component 1 Object Type + Main Heating Coil 1, !- Component 1 Name + Main Heating Coil 1 Water Inlet Node, !- Component 1 Inlet Node Name + Main Heating Coil 1 Water Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Heating Demand Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Heating Demand Bypass, !- Component 1 Name + Heating Demand Bypass Inlet Node, !- Component 1 Inlet Node Name + Heating Demand Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Heating Demand Bypass, !- Name + Heating Demand Bypass Inlet Node, !- Inlet Node Name + Heating Demand Bypass Outlet Node; !- Outlet Node Name + + Connector:Splitter, + Heating Demand Splitter, !- Name + Heating Demand Inlet Branch, !- Inlet Branch Name + Zone 1 Reheat Branch, !- Outlet Branch 1 Name + Zone 2 Reheat Branch, !- Outlet Branch 2 Name + Zone 3 Reheat Branch, !- Outlet Branch 3 Name + Zone 4 Reheat Branch, !- Outlet Branch 4 Name + Zone 5 Reheat Branch, !- Outlet Branch 5 Name + OA Heating Coil Branch, !- Outlet Branch 6 Name + Main Heating Coil 1 Branch, !- Outlet Branch 7 Name + Heating Demand Bypass Branch; !- Outlet Branch 8 Name + + Connector:Mixer, + Heating Demand Mixer, !- Name + Heating Demand Outlet Branch, !- Outlet Branch Name + Zone 1 Reheat Branch, !- Inlet Branch 1 Name + Zone 2 Reheat Branch, !- Inlet Branch 2 Name + Zone 3 Reheat Branch, !- Inlet Branch 3 Name + Zone 4 Reheat Branch, !- Inlet Branch 4 Name + Zone 5 Reheat Branch, !- Inlet Branch 5 Name + OA Heating Coil Branch, !- Inlet Branch 6 Name + Main Heating Coil 1 Branch, !- Inlet Branch 7 Name + Heating Demand Bypass Branch; !- Inlet Branch 8 Name + + Connector:Splitter, + Heating Supply Splitter, !- Name + Heating Supply Inlet Branch, !- Inlet Branch Name + Central Boiler Branch, !- Outlet Branch 1 Name + Heating Supply Bypass Branch; !- Outlet Branch 2 Name + + Connector:Mixer, + Heating Supply Mixer, !- Name + Heating Supply Outlet Branch, !- Outlet Branch Name + Central Boiler Branch, !- Inlet Branch 1 Name + Heating Supply Bypass Branch; !- Inlet Branch 2 Name + + PlantEquipmentOperationSchemes, + Hot Loop Operation, !- Name + PlantEquipmentOperation:HeatingLoad, !- Control Scheme 1 Object Type + Central Boiler Only, !- Control Scheme 1 Name + PlantOnSched; !- Control Scheme 1 Schedule Name + + PlantEquipmentOperation:HeatingLoad, + Central Boiler Only, !- Name + 0, !- Load Range 1 Lower Limit {W} + 1000000, !- Load Range 1 Upper Limit {W} + heating plant; !- Range 1 Equipment List Name + + PlantEquipmentList, + heating plant, !- Name + Boiler:HotWater, !- Equipment 1 Object Type + Central Boiler; !- Equipment 1 Name + + Boiler:HotWater, + Central Boiler, !- Name + NaturalGas, !- Fuel Type + autosize, !- Nominal Capacity {W} + 0.8, !- Nominal Thermal Efficiency + LeavingBoiler, !- Efficiency Curve Temperature Evaluation Variable + BoilerEfficiency, !- Normalized Boiler Efficiency Curve Name + autosize, !- Design Water Flow Rate {m3/s} + 0.0, !- Minimum Part Load Ratio + 1.2, !- Maximum Part Load Ratio + 1.0, !- Optimum Part Load Ratio + Central Boiler Inlet Node, !- Boiler Water Inlet Node Name + Central Boiler Outlet Node, !- Boiler Water Outlet Node Name + 100., !- Water Outlet Upper Temperature Limit {C} + LeavingSetpointModulated;!- Boiler Flow Mode + + SetpointManager:Scheduled, + Central Boiler Setpoint Manager, !- Name + Temperature, !- Control Variable + HW Loop Temp Schedule, !- Schedule Name + Central Boiler Outlet Node; !- Setpoint Node or NodeList Name + + Curve:Quadratic, + BoilerEfficiency, !- Name + 1.0, !- Coefficient1 Constant + 0.0, !- Coefficient2 x + 0.0, !- Coefficient3 x**2 + 0, !- Minimum Value of x + 1; !- Maximum Value of x + + Pump:VariableSpeed, + HW Circ Pump, !- Name + HW Supply Inlet Node, !- Inlet Node Name + HW Pump Outlet Node, !- Outlet Node Name + autosize, !- Design Maximum Flow Rate {m3/s} + 179352, !- Design Pump Head {Pa} + autosize, !- Design Power Consumption {W} + 0.9, !- Motor Efficiency + 0.0, !- Fraction of Motor Inefficiencies to Fluid Stream + 0, !- Coefficient 1 of the Part Load Performance Curve + 1, !- Coefficient 2 of the Part Load Performance Curve + 0, !- Coefficient 3 of the Part Load Performance Curve + 0, !- Coefficient 4 of the Part Load Performance Curve + 0, !- Design Minimum Flow Rate {m3/s} + INTERMITTENT; !- Pump Control Type + + PlantLoop, + Chilled Water Loop, !- Name + Water, !- Fluid Type + , !- User Defined Fluid Type + CW Loop Operation, !- Plant Equipment Operation Scheme Name + CW Supply Outlet Node, !- Loop Temperature Setpoint Node Name + 98, !- Maximum Loop Temperature {C} + 1, !- Minimum Loop Temperature {C} + autosize, !- Maximum Loop Flow Rate {m3/s} + 0.0, !- Minimum Loop Flow Rate {m3/s} + , !- Plant Loop Volume {m3} + CW Supply Inlet Node, !- Plant Side Inlet Node Name + CW Supply Outlet Node, !- Plant Side Outlet Node Name + Cooling Supply Side Branches, !- Plant Side Branch List Name + Cooling Supply Side Connectors, !- Plant Side Connector List Name + CW Demand Inlet Node, !- Demand Side Inlet Node Name + CW Demand Outlet Node, !- Demand Side Outlet Node Name + Cooling Demand Side Branches, !- Demand Side Branch List Name + Cooling Demand Side Connectors, !- Demand Side Connector List Name + SequentialLoad, !- Load Distribution Scheme + CW Avail List; !- Availability Manager List Name + + AvailabilityManagerAssignmentList, + CW Avail List, !- Name + AvailabilityManager:LowTemperatureTurnOff, !- Availability Manager 1 Object Type + CW Low Temp Limit; !- Availability Manager 1 Name + + AvailabilityManager:LowTemperatureTurnOff, + CW Low Temp Limit, !- Name + Outside Air Inlet Node 1,!- Sensor Node Name + 2.0, !- Temperature {C} + CoolingPumpAvailSched; !- Applicability Schedule Name + + SetpointManager:Scheduled, + Chilled Water Loop Setpoint Manager, !- Name + Temperature, !- Control Variable + CW Loop Temp Schedule, !- Schedule Name + CW Supply Outlet Node; !- Setpoint Node or NodeList Name + + BranchList, + Cooling Supply Side Branches, !- Name + CW Pump Branch, !- Branch 1 Name + Central Chiller Branch, !- Branch 2 Name + Cooling Supply Bypass Branch, !- Branch 3 Name + Cooling Supply Outlet; !- Branch 4 Name + + BranchList, + Cooling Demand Side Branches, !- Name + Cooling Demand Inlet, !- Branch 1 Name + Cooling Coil Branch, !- Branch 2 Name + OA Cooling Coil Branch, !- Branch 3 Name + Cooling Demand Bypass Branch, !- Branch 4 Name + Cooling Demand Outlet; !- Branch 5 Name + + ConnectorList, + Cooling Supply Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + CW Loop Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + CW Loop Mixer; !- Connector 2 Name + + ConnectorList, + Cooling Demand Side Connectors, !- Name + Connector:Splitter, !- Connector 1 Object Type + CW Demand Splitter, !- Connector 1 Name + Connector:Mixer, !- Connector 2 Object Type + CW Demand Mixer; !- Connector 2 Name + + Branch, + Cooling Demand Inlet, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Cooling Demand Side Inlet Pipe, !- Component 1 Name + CW Demand Inlet Node, !- Component 1 Inlet Node Name + CW Demand Entrance Pipe Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Cooling Demand Side Inlet Pipe, !- Name + CW Demand Inlet Node, !- Inlet Node Name + CW Demand Entrance Pipe Outlet Node; !- Outlet Node Name + + Branch, + Cooling Coil Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Cooling:Water, !- Component 1 Object Type + Main Cooling Coil 1, !- Component 1 Name + Main Cooling Coil 1 Water Inlet Node, !- Component 1 Inlet Node Name + Main Cooling Coil 1 Water Outlet Node; !- Component 1 Outlet Node Name + + Branch, + OA Cooling Coil Branch, !- Name + , !- Pressure Drop Curve Name + Coil:Cooling:Water, !- Component 1 Object Type + OA Cooling Coil 1, !- Component 1 Name + OA Cooling Coil 1 Water Inlet Node, !- Component 1 Inlet Node Name + OA Cooling Coil 1 Water Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Cooling Demand Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Cooling Demand Side Bypass, !- Component 1 Name + CW Demand Bypass Inlet Node, !- Component 1 Inlet Node Name + CW Demand Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Cooling Demand Side Bypass, !- Name + CW Demand Bypass Inlet Node, !- Inlet Node Name + CW Demand Bypass Outlet Node; !- Outlet Node Name + + Branch, + Cooling Demand Outlet, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + CW Demand Side Outlet Pipe, !- Component 1 Name + CW Demand Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + CW Demand Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + CW Demand Side Outlet Pipe, !- Name + CW Demand Exit Pipe Inlet Node, !- Inlet Node Name + CW Demand Outlet Node; !- Outlet Node Name + + Branch, + Cooling Supply Outlet, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Supply Side Outlet Pipe, !- Component 1 Name + Supply Side Exit Pipe Inlet Node, !- Component 1 Inlet Node Name + CW Supply Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Supply Side Outlet Pipe, !- Name + Supply Side Exit Pipe Inlet Node, !- Inlet Node Name + CW Supply Outlet Node; !- Outlet Node Name + + Branch, + CW Pump Branch, !- Name + , !- Pressure Drop Curve Name + Pump:VariableSpeed, !- Component 1 Object Type + CW Circ Pump, !- Component 1 Name + CW Supply Inlet Node, !- Component 1 Inlet Node Name + CW Pump Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Central Chiller Branch, !- Name + , !- Pressure Drop Curve Name + Chiller:Electric, !- Component 1 Object Type + Central Chiller, !- Component 1 Name + Central Chiller Inlet Node, !- Component 1 Inlet Node Name + Central Chiller Outlet Node; !- Component 1 Outlet Node Name + + Branch, + Cooling Supply Bypass Branch, !- Name + , !- Pressure Drop Curve Name + Pipe:Adiabatic, !- Component 1 Object Type + Supply Side Bypass, !- Component 1 Name + CW Supply Bypass Inlet Node, !- Component 1 Inlet Node Name + CW Supply Bypass Outlet Node; !- Component 1 Outlet Node Name + + Pipe:Adiabatic, + Supply Side Bypass, !- Name + CW Supply Bypass Inlet Node, !- Inlet Node Name + CW Supply Bypass Outlet Node; !- Outlet Node Name + + Connector:Splitter, + CW Loop Splitter, !- Name + CW Pump Branch, !- Inlet Branch Name + Central Chiller Branch, !- Outlet Branch 1 Name + Cooling Supply Bypass Branch; !- Outlet Branch 2 Name + + Connector:Mixer, + CW Loop Mixer, !- Name + Cooling Supply Outlet, !- Outlet Branch Name + Central Chiller Branch, !- Inlet Branch 1 Name + Cooling Supply Bypass Branch; !- Inlet Branch 2 Name + + Connector:Splitter, + CW Demand Splitter, !- Name + Cooling Demand Inlet, !- Inlet Branch Name + Cooling Coil Branch, !- Outlet Branch 1 Name + OA Cooling Coil Branch, !- Outlet Branch 2 Name + Cooling Demand Bypass Branch; !- Outlet Branch 3 Name + + Connector:Mixer, + CW Demand Mixer, !- Name + Cooling Demand Outlet, !- Outlet Branch Name + Cooling Coil Branch, !- Inlet Branch 1 Name + OA Cooling Coil Branch, !- Inlet Branch 2 Name + Cooling Demand Bypass Branch; !- Inlet Branch 3 Name + + PlantEquipmentOperationSchemes, + CW Loop Operation, !- Name + PlantEquipmentOperation:CoolingLoad, !- Control Scheme 1 Object Type + Central Chiller Only, !- Control Scheme 1 Name + PlantOnSched; !- Control Scheme 1 Schedule Name + + PlantEquipmentOperation:CoolingLoad, + Central Chiller Only, !- Name + 0, !- Load Range 1 Lower Limit {W} + 900000, !- Load Range 1 Upper Limit {W} + Cooling Plant; !- Range 1 Equipment List Name + + PlantEquipmentList, + Cooling Plant, !- Name + Chiller:Electric, !- Equipment 1 Object Type + Central Chiller; !- Equipment 1 Name + + Chiller:Electric, + Central Chiller, !- Name + AirCooled, !- Condenser Type + autosize, !- Nominal Capacity {W} + 3.2, !- Nominal COP {W/W} + Central Chiller Inlet Node, !- Chilled Water Inlet Node Name + Central Chiller Outlet Node, !- Chilled Water Outlet Node Name + Central Chiller Condenser Inlet Node, !- Condenser Inlet Node Name + Central Chiller Condenser Outlet Node, !- Condenser Outlet Node Name + 0.0, !- Minimum Part Load Ratio + 1.0, !- Maximum Part Load Ratio + 0.65, !- Optimum Part Load Ratio + 35.0, !- Design Condenser Inlet Temperature {C} + 2.778, !- Temperature Rise Coefficient + 6.67, !- Design Chilled Water Outlet Temperature {C} + autosize, !- Design Chilled Water Flow Rate {m3/s} + autosize, !- Design Condenser Fluid Flow Rate {m3/s} + 0.9949, !- Coefficient 1 of Capacity Ratio Curve + -0.045954, !- Coefficient 2 of Capacity Ratio Curve + -0.0013543, !- Coefficient 3 of Capacity Ratio Curve + 2.333, !- Coefficient 1 of Power Ratio Curve + -1.975, !- Coefficient 2 of Power Ratio Curve + 0.6121, !- Coefficient 3 of Power Ratio Curve + 0.03303, !- Coefficient 1 of Full Load Ratio Curve + 0.6852, !- Coefficient 2 of Full Load Ratio Curve + 0.2818, !- Coefficient 3 of Full Load Ratio Curve + 5, !- Chilled Water Outlet Temperature Lower Limit {C} + LeavingSetpointModulated;!- Chiller Flow Mode + + SetpointManager:Scheduled, + Central Chiller Setpoint Manager, !- Name + Temperature, !- Control Variable + CW Loop Temp Schedule, !- Schedule Name + Central Chiller Outlet Node; !- Setpoint Node or NodeList Name + + OutdoorAir:Node, + Central Chiller Condenser Inlet Node, !- Name + -1.0; !- Height Above Ground {m} + + Pump:VariableSpeed, + CW Circ Pump, !- Name + CW Supply Inlet Node, !- Inlet Node Name + CW Pump Outlet Node, !- Outlet Node Name + autosize, !- Design Maximum Flow Rate {m3/s} + 179352, !- Design Pump Head {Pa} + autosize, !- Design Power Consumption {W} + 0.9, !- Motor Efficiency + 0.0, !- Fraction of Motor Inefficiencies to Fluid Stream + 0, !- Coefficient 1 of the Part Load Performance Curve + 1, !- Coefficient 2 of the Part Load Performance Curve + 0, !- Coefficient 3 of the Part Load Performance Curve + 0, !- Coefficient 4 of the Part Load Performance Curve + 0, !- Design Minimum Flow Rate {m3/s} + INTERMITTENT, !- Pump Control Type + CoolingPumpAvailSched; !- Pump Flow Rate Schedule Name + + Output:Variable,*,Site Outdoor Air Drybulb Temperature,hourly; + + Output:Variable,*,Zone Air Temperature,hourly; + + Output:Variable,*,Zone Mean Air Dewpoint Temperature,hourly; + + Output:Variable,*,Zone Air System Sensible Cooling Rate,hourly; + + Output:Variable,*,Zone Air System Sensible Heating Rate,hourly; + + Output:Variable,*,Zone People Occupant Count,hourly; + + Output:Variable,*,Zone People Total Heating Rate,hourly; + + Output:Variable,*,Space People Occupant Count,hourly; + + Output:Variable,*,Space People Total Heating Rate,hourly; + + Output:Variable,*,People Total Heating Rate,hourly; + + Output:Variable,*,People Occupant Count,hourly; + + Output:Variable,*,Lights Electricity Rate,hourly; + + Output:Variable,*,Zone Lights Electricity Rate,hourly; + + Output:Variable,*,Space Lights Electricity Rate,hourly; + + Output:Variable,*,Zone Electric Equipment Electricity Rate,hourly; + + Output:Variable,*,Space Electric Equipment Electricity Rate,hourly; + + Output:Variable,*,Zone Total Internal Radiant Heating Rate,hourly; + + Output:Variable,*,Zone Total Internal Visible Radiation Heating Rate,hourly; + + Output:Variable,*,Zone Total Internal Convective Heating Rate,hourly; + + Output:Variable,*,Zone Total Internal Latent Gain Rate,hourly; + + Output:Variable,*,Zone Total Internal Total Heating Rate,hourly; + + Output:Variable,*,Space Total Internal Radiant Heating Rate,hourly; + + Output:Variable,*,Space Total Internal Visible Radiation Heating Rate,hourly; + + Output:Variable,*,Space Total Internal Convective Heating Rate,hourly; + + Output:Variable,*,Space Total Internal Latent Gain Rate,hourly; + + Output:Variable,*,Space Total Internal Total Heating Rate,hourly; + + Output:VariableDictionary,idf; + + Output:Meter:MeterFileOnly,Electricity:Facility,monthly; + + Output:Meter:MeterFileOnly,Electricity:Building,monthly; + + Output:Meter:MeterFileOnly,InteriorLights:Electricity,monthly; + + Output:Meter:MeterFileOnly,Electricity:HVAC,monthly; + + Output:Meter:MeterFileOnly,Electricity:Plant,monthly; + + Output:Meter:MeterFileOnly,NaturalGas:Facility,monthly; + + Output:Meter:MeterFileOnly,NaturalGas:Plant,monthly; + + Output:Meter:MeterFileOnly,Electricity:Facility,runperiod; + + Output:Meter:MeterFileOnly,Electricity:Building,runperiod; + + Output:Meter:MeterFileOnly,InteriorLights:Electricity,runperiod; + + Output:Meter:MeterFileOnly,Electricity:HVAC,runperiod; + + Output:Meter:MeterFileOnly,Electricity:Plant,runperiod; + + Output:Meter:MeterFileOnly,NaturalGas:Facility,runperiod; + + Output:Meter:MeterFileOnly,NaturalGas:Plant,runperiod; + + Output:Meter:MeterFileOnly,MyGeneralLights,monthly; + + Output:Meter:MeterFileOnly,MyGeneralLights,runperiod; + + Output:Meter:MeterFileOnly,MyBuildingElectric,monthly; + + Output:Meter:MeterFileOnly,MyBuildingElectric,runperiod; + + Output:Meter:MeterFileOnly,MyBuildingOther,monthly; + + Output:Meter:MeterFileOnly,MyBuildingOther,runperiod; + +! The following custom meters are set up to illustrate the capabilities +! of custom meters. +! Custom Meter "MyGeneralLights" duplicates the InteriorLights:Electricity meter. +! Custom Meter "MyBuildingElectric" duplicates the Electricity:Building meter (by specifying that meter). +! Custom Meter (Decrement) "MyBuildingOther" uses Electricity:Building as its source meter +! and subtracts out the values for MyGeneralLights (aka InteriorLights:Electricity). The +! resultant value for MyBuildingOther should be equal to the value for the meters +! Electricity:Building - InteriorLights:Electricity (aka MyGeneralLights) + + Meter:Custom, + MyGeneralLights, !- Name + Electricity, !- Resource Type + Zone 1 Lights, !- Key Name 1 + Lights Electricity Energy, !- Output Variable or Meter Name 1 + Zone 2 Lights, !- Key Name 2 + Lights Electricity Energy, !- Output Variable or Meter Name 2 + Space 3 Storage Lights, !- Key Name 3 + Lights Electricity Energy, !- Output Variable or Meter Name 3 + Space 3 Open Office 1 Lights, !- Key Name 4 + Lights Electricity Energy, !- Output Variable or Meter Name 4 + Space 3 Open Office 2 Lights, !- Key Name 5 + Lights Electricity Energy, !- Output Variable or Meter Name 5 + Zone 4 Lights, !- Key Name 6 + Lights Electricity Energy, !- Output Variable or Meter Name 6 + Space 5 Office Zone 5 Lights, !- Key Name 7 + Lights Electricity Energy, !- Output Variable or Meter Name 7 + Space 5 Conference Zone 5 Lights, !- Key Name 8 + Lights Electricity Energy; !- Output Variable or Meter Name 8 + + Meter:Custom, + MyBuildingElectric, !- Name + Electricity, !- Resource Type + , !- Key Name 1 + Electricity:Building; !- Output Variable or Meter Name 1 + + Meter:CustomDecrement, + MyBuildingOther, !- Name + Electricity, !- Resource Type + Electricity:Building, !- Source Meter Name + , !- Key Name 1 + MyGeneralLights; !- Output Variable or Meter Name 1 + + Output:Surfaces:Drawing,VRML; + + OutputControl:Table:Style, + HTML; !- Column Separator + + Output:Table:SummaryReports, + AllSummary, !- Report 1 Name + ZoneComponentLoadSummary;!- Report 2 Name + + Output:Surfaces:List,Details; + + Output:Surfaces:List,DecayCurvesFromComponentLoadsSummary; + + Output:Surfaces:Drawing,dxf; + diff --git a/testfiles/CMakeLists.txt b/testfiles/CMakeLists.txt index 19f20cb9cfd..0f07fc71c17 100644 --- a/testfiles/CMakeLists.txt +++ b/testfiles/CMakeLists.txt @@ -51,6 +51,7 @@ add_simulation_test(IDF_FILE 5ZoneAirCooledConvCoef.idf EPW_FILE USA_CO_Golden-N add_simulation_test(IDF_FILE 5ZoneAirCooledConvCoef_VSFan.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE 5ZoneAirCooledKeepSiteLocation.idf EPW_FILE USA_CO_Golden-NREL.724666_TMY3.epw) add_simulation_test(IDF_FILE 5ZoneAirCooledWithSpaces.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) +add_simulation_test(IDF_FILE 5ZoneAirCooledWithSpacesDaylightingIntMass.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE 5ZoneAirCooledWithSpaceHeatBalance.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE 5ZoneAirCooledWithSpacesHVAC.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) add_simulation_test(IDF_FILE 5ZoneAirCooledDemandLimiting.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw) From 7220b7b3ff0e09c8bdb37f60b8dfbe80e92389ac Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 13 Aug 2024 22:52:42 -0400 Subject: [PATCH 127/164] Fixed crash, now get diffs in solar shading --- src/EnergyPlus/DXCoils.cc | 4 ++-- src/EnergyPlus/SolarShading.cc | 16 ++++++++-------- tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc | 2 +- .../unit/Fixtures/EnergyPlusFixture.cc | 1 + tst/EnergyPlus/unit/SolarShading.unit.cc | 9 ++++++++- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index 72fa482395f..355e0bc83fc 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -4099,7 +4099,7 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.MSRatedCOP.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSRatedAirVolFlowRate.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSRatedAirMassFlowRate.allocate(thisDXCoil.NumOfSpeeds); - thisDXCoil.MSRatedAirMassFlowRate = 1.0; // avoid divide by 0, will get overwritten in getInput or sizing + thisDXCoil.MSRatedAirMassFlowRate = 1.0; // avoid divide by 0, will get overwritten in InitDXCoil thisDXCoil.MSCCapFTemp.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSCCapFFlow.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSEIRFTemp.allocate(thisDXCoil.NumOfSpeeds); @@ -4614,7 +4614,7 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.MSRatedCOP.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSRatedAirVolFlowRate.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSRatedAirMassFlowRate.allocate(thisDXCoil.NumOfSpeeds); - thisDXCoil.MSRatedAirMassFlowRate = 1.0; // avoid divide by 0, will get overwritten in getInput or sizing + thisDXCoil.MSRatedAirMassFlowRate = 1.0; // avoid divide by 0, will get overwritten in InitDXCoil thisDXCoil.MSCCapFTemp.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSCCapFFlow.allocate(thisDXCoil.NumOfSpeeds); thisDXCoil.MSEIRFTemp.allocate(thisDXCoil.NumOfSpeeds); diff --git a/src/EnergyPlus/SolarShading.cc b/src/EnergyPlus/SolarShading.cc index 4f01b2b0583..46829bbec4c 100644 --- a/src/EnergyPlus/SolarShading.cc +++ b/src/EnergyPlus/SolarShading.cc @@ -3947,11 +3947,11 @@ void CLIPLINE(Real64 &x1, Real64 &x2, Real64 &y1, Real64 &y2, Real64 maxX, Real6 else if (c2 == 3) { visible = true; x1 = minX; - y1 = maxY + e / dx; + y1 = maxY + General::SafeDivide(e, dx); if (x2 <= maxX && y2 <= maxY) return; } else if (c2 == 4) { x2 = maxX; - y2 = maxY + e / dx; + y2 = maxY + General::SafeDivide(e, dx); return; } if (needX) { @@ -3965,11 +3965,11 @@ void CLIPLINE(Real64 &x1, Real64 &x2, Real64 &y1, Real64 &y2, Real64 maxX, Real6 return; else if (c2 == 1) { visible = true; - x1 = maxX - e / dy; + x1 = maxX - General::SafeDivide(e, dy); y1 = minY; if (x2 <= maxX && y2 <= maxY) return; } else if (c2 == 4) { - x2 = maxX - e / dy; + x2 = maxX - General::SafeDivide(e, dy); y2 = maxY; return; } @@ -3989,11 +3989,11 @@ void CLIPLINE(Real64 &x1, Real64 &x2, Real64 &y1, Real64 &y2, Real64 maxX, Real6 else if (c2 == 3) { visible = true; x1 = minX; - y1 = minY + e / dx; + y1 = minY + General::SafeDivide(e, dx); if (x2 <= maxX && y2 >= minY) return; } else if (c2 == 4) { x2 = maxX; - y2 = minY + e / dx; + y2 = minY + General::SafeDivide(e, dx); return; } if (needX) { @@ -4007,11 +4007,11 @@ void CLIPLINE(Real64 &x1, Real64 &x2, Real64 &y1, Real64 &y2, Real64 maxX, Real6 return; else if (c2 == 7) { visible = true; - x1 = maxX - e / dy; + x1 = maxX - General::SafeDivide(e, dy); y1 = maxY; if (x2 <= maxX && y2 >= minY) return; } else if (c2 == 4) { - x2 = maxX - e / dy; + x2 = maxX - General::SafeDivide(e, dy); y2 = minY; return; } diff --git a/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc b/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc index e94bc58351d..6096d877bc0 100644 --- a/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc +++ b/tst/EnergyPlus/unit/AirflowNetworkHVAC.unit.cc @@ -2212,7 +2212,7 @@ TEST_F(EnergyPlusFixture, AirflowNetwork_TestPressureStat) // Check indoor pressure and mass flow rate EXPECT_NEAR(PressureSet, state->afn->AirflowNetworkNodeSimu(3).PZ, 0.0001); - EXPECT_NEAR(0.00255337, state->afn->ReliefMassFlowRate, 0.0001); + EXPECT_NEAR(0.06551, state->afn->ReliefMassFlowRate, 0.0001); // Start a test for #5687 to report zero values of AirflowNetwork:Distribution airflow and pressure outputs when a system is off state->afn->AirflowNetworkFanActivated = false; diff --git a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc index f3da433eec1..4616f9874a1 100644 --- a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc +++ b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc @@ -119,6 +119,7 @@ void EnergyPlusFixture::SetUp() Psychrometrics::InitializePsychRoutines(*state); createCoilSelectionReportObj(*state); + state->dataEnvrn->StdRhoAir = 1.2; } void EnergyPlusFixture::TearDown() diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index 04cd3aa78c3..f144d13d77f 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -4674,6 +4674,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap2) state->dataGlobal->BeginSimFlag = false; state->dataGlobal->BeginEnvrnFlag = false; HeatBalanceIntRadExchange::InitSolarViewFactors(*state); // prevents crash in GetDaylightingParametersInput + state->dataSolarShading->ShadowingDaysLeft = 20; SolarShading::PerformSolarCalculations(*state); // Get surface nums @@ -4697,6 +4698,9 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap2) shade2SchedEMSOn = true; shade1SchedEMSValue = 1.0; shade2SchedEMSValue = 1.0; + state->dataBSDFWindow->SUNCOSTS(4, 12)(1) = 0.2; + state->dataBSDFWindow->SUNCOSTS(4, 12)(2) = 0.2; + state->dataBSDFWindow->SUNCOSTS(4, 12)(3) = 0.2; FigureSolarBeamAtTimestep(*state, state->dataGlobal->HourOfDay, state->dataGlobal->TimeStep); ReportSurfaceShading(*state); @@ -5035,6 +5039,7 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap3) state->dataGlobal->BeginSimFlag = false; state->dataGlobal->BeginEnvrnFlag = false; HeatBalanceIntRadExchange::InitSolarViewFactors(*state); // prevents crash in GetDaylightingParametersInput + state->dataSolarShading->ShadowingDaysLeft = 20; SolarShading::PerformSolarCalculations(*state); // Get surface nums @@ -5043,6 +5048,9 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap3) // Use the base transmittance schedules (no EMS override) // shade1 transmittance = 0.5, shade2 transmittance = 0.8 + state->dataBSDFWindow->SUNCOSTS(4, 12)(1) = 0.2; + state->dataBSDFWindow->SUNCOSTS(4, 12)(2) = 0.2; + state->dataBSDFWindow->SUNCOSTS(4, 12)(3) = 0.2; FigureSolarBeamAtTimestep(*state, state->dataGlobal->HourOfDay, state->dataGlobal->TimeStep); ReportSurfaceShading(*state); @@ -5197,7 +5205,6 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_CalcBeamSolarOnWinRevealSurface) state->dataSurface->SurfWinFrameArea(1) = 0.64; state->dataSurface->SurfWinFrameArea(2) = 0.64; - state->dataSurface->SurfActiveConstruction(1) = 1; state->dataSurface->SurfActiveConstruction(2) = 1; From 2c31f9fc35b78f28875f5545f59adc17bc5bd43b Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 14 Aug 2024 14:41:12 +0200 Subject: [PATCH 128/164] Use toGenericString and return a Pathlib.Path instead of a string --- src/EnergyPlus/api/datatransfer.cc | 10 ++++++---- src/EnergyPlus/api/datatransfer.py | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index 26017f46c0a..258b60c791e 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -243,16 +243,18 @@ void resetErrorFlag(EnergyPlusState state) char *inputFilePath(EnergyPlusState state) { const auto *thisState = static_cast(state); - char *p = new char[std::strlen(thisState->dataStrGlobals->inputFilePath.string().c_str()) + 1]; - std::strcpy(p, thisState->dataStrGlobals->inputFilePath.string().c_str()); + std::string const path_utf8 = EnergyPlus::FileSystem::toGenericString(thisState->dataStrGlobals->inputFilePath); + char *p = new char[std::strlen(path_utf8.c_str()) + 1]; + std::strcpy(p, path_utf8.c_str()); return p; } char *epwFilePath(EnergyPlusState state) { const auto *thisState = static_cast(state); - char *p = new char[std::strlen(thisState->files.inputWeatherFilePath.filePath.c_str()) + 1]; - std::strcpy(p, thisState->files.inputWeatherFilePath.filePath.c_str()); + std::string const path_utf8 = EnergyPlus::FileSystem::toGenericString(thisState->files.inputWeatherFilePath.filePath); + char *p = new char[std::strlen(path_utf8.c_str()) + 1]; + std::strcpy(p, path_utf8.c_str()); return p; } diff --git a/src/EnergyPlus/api/datatransfer.py b/src/EnergyPlus/api/datatransfer.py index 7f7985b9721..0a1c9112d28 100644 --- a/src/EnergyPlus/api/datatransfer.py +++ b/src/EnergyPlus/api/datatransfer.py @@ -56,7 +56,7 @@ from ctypes import cdll, c_int, c_char_p, c_void_p, POINTER, Structure, byref from pyenergyplus.common import RealEP, EnergyPlusException, is_number from typing import List, Union - +from pathlib import Path class DataExchange: """ @@ -363,27 +363,32 @@ def reset_api_error_flag(self, state: c_void_p) -> None: """ self.api.resetErrorFlag(state) - def get_input_file_path(self, state: c_void_p) -> bytes: + def get_input_file_path(self, state: c_void_p) -> Path: """ Provides the input file path back to the client. In most circumstances the client will know the path to the input file, but there are some cases where code is generalized in unexpected workflows. Users have requested a way to get the input file path back from the running instance. :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. - :return: Returns a raw bytes representation of the input file path + :return: A pathlib.Path of the input file path """ - return self.api.inputFilePath(state) # TODO: Need to call free for the underlying char *? + c_string = self.api.inputFilePath(state) + res = Path(c_string.decode('utf-8')) + return res - def get_weather_file_path(self, state: c_void_p) -> bytes: + def get_weather_file_path(self, state: c_void_p) -> Path: """ Provides the weather file path back to the client. In most circumstances the client will know the path to the weather file, but there are some cases where code is generalized in unexpected workflows. Users have requested a way to get the weather file path back from the running instance. :param state: An active EnergyPlus "state" that is returned from a call to `api.state_manager.new_state()`. - :return: Returns a raw bytes representation of the weather file path + :return: A pathlib.Path of the weather file """ - return self.api.epwFilePath(state) + c_string = self.api.epwFilePath(state) + res = Path(c_string.decode('utf-8')) + return res + def get_object_names(self, state: c_void_p, object_type_name: Union[str, bytes]) -> List[str]: """ From 4d6159464238ae9bcecfe57ef7ddc02a657478df Mon Sep 17 00:00:00 2001 From: Brent Griffith Date: Wed, 14 Aug 2024 07:18:58 -0600 Subject: [PATCH 129/164] add SafeCopyPlantNode() to cooling towers --- src/EnergyPlus/CondenserLoopTowers.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index f365bd4e722..a99dee14c4c 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -6344,6 +6344,7 @@ namespace CondenserLoopTowers { // This subroutine is for passing results to the outlet water node. // set node information + PlantUtilities::SafeCopyPlantNode(state, this->WaterInletNodeNum, this->WaterOutletNodeNum); state.dataLoopNodes->Node(this->WaterOutletNodeNum).Temp = this->OutletWaterTemp; if (state.dataPlnt->PlantLoop(this->plantLoc.loopNum).LoopSide(this->plantLoc.loopSideNum).FlowLock == DataPlant::FlowLock::Unlocked || From 0ba4621c6b63427dacdbecad2a2c82d92f77ff0b Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Wed, 14 Aug 2024 08:39:42 -0500 Subject: [PATCH 130/164] Add better range checking on erl var index --- src/EnergyPlus/DataRuntimeLanguage.hh | 6 +++--- src/EnergyPlus/RuntimeLanguageProcessor.cc | 6 ++++-- src/EnergyPlus/api/datatransfer.cc | 22 +++++++++++++--------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/EnergyPlus/DataRuntimeLanguage.hh b/src/EnergyPlus/DataRuntimeLanguage.hh index e55cc25e588..85a0424dad6 100644 --- a/src/EnergyPlus/DataRuntimeLanguage.hh +++ b/src/EnergyPlus/DataRuntimeLanguage.hh @@ -738,9 +738,9 @@ struct RuntimeLanguageData : BaseGlobalStruct { // In the API, we allow the user to manipulate user-defined EMS globals, but we skip the built-in ones to avoid - // problems. This constexpr should be incremented if we ever add more built-ins so that we skip the right amount - // in the API calls. - static int constexpr NumBuiltInErlVariables = 27; + // problems. The built-in ones will not always start at zero, so we keep a start/end to ignore that specific range. + int emsVarBuiltInStart = 0; + int emsVarBuiltInEnd = 0; int NumProgramCallManagers = 0; // count of Erl program managers with calling points int NumSensors = 0; // count of EMS sensors used in model (data from output variables) diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index 0e08e3b2ba5..55dc9cd6380 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -122,6 +122,8 @@ void InitializeRuntimeLanguage(EnergyPlusData &state) if (state.dataRuntimeLangProcessor->InitializeOnce) { + state.dataRuntimeLang->emsVarBuiltInStart = state.dataRuntimeLang->NumErlVariables + 1; + state.dataRuntimeLang->False = SetErlValueNumber(0.0); state.dataRuntimeLang->True = SetErlValueNumber(1.0); @@ -160,8 +162,8 @@ void InitializeRuntimeLanguage(EnergyPlusData &state) state.dataRuntimeLangProcessor->ActualTimeNum = NewEMSVariable(state, "ACTUALTIME", 0); state.dataRuntimeLangProcessor->WarmUpFlagNum = NewEMSVariable(state, "WARMUPFLAG", 0); - // this ensures we stay in sync with the number of skipped built-ins for API calls - assert(state.dataRuntimeLang->NumErlVariables == state.dataRuntimeLang->NumBuiltInErlVariables); + // update the end of the built-in range so we can ignore those on API calls + state.dataRuntimeLang->emsVarBuiltInEnd = state.dataRuntimeLang->NumErlVariables; GetRuntimeLanguageUserInput(state); // Load and parse all runtime language objects diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index 26017f46c0a..41c57c1d03e 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -596,11 +596,11 @@ int getEMSGlobalVariableHandle(EnergyPlusState state, const char *name) int index = 0; for (auto const &erlVar : thisState->dataRuntimeLang->ErlVariable) { index++; - if (index <= thisState->dataRuntimeLang->NumBuiltInErlVariables) { - continue; // don't return handles to the built-in EMS variables, they can be accessed via API endpoints - } - if (EnergyPlus::Util::SameString(name, erlVar.Name)) { - return index; + // only respond if we are outside of the built-in EMS var range + if (index < thisState->dataRuntimeLang->emsVarBuiltInStart || index > thisState->dataRuntimeLang->emsVarBuiltInEnd) { + if (EnergyPlus::Util::SameString(name, erlVar.Name)) { + return index; + } } } return 0; @@ -609,7 +609,9 @@ int getEMSGlobalVariableHandle(EnergyPlusState state, const char *name) Real64 getEMSGlobalVariableValue(EnergyPlusState state, int handle) { auto *thisState = static_cast(state); - if (handle < thisState->dataRuntimeLang->NumBuiltInErlVariables || handle > thisState->dataRuntimeLang->NumErlVariables) { + auto const &erl = thisState->dataRuntimeLang; + bool const insideBuiltInRange = index >= erl->emsVarBuiltInStart && index <= erl->emsVarBuiltInEnd; + if (insideBuiltInRange || handle > thisState->dataRuntimeLang->NumErlVariables) { // need to fatal out once the process is done // throw an error, set the fatal flag, and then return 0 EnergyPlus::ShowSevereError( @@ -619,13 +621,15 @@ Real64 getEMSGlobalVariableValue(EnergyPlusState state, int handle) thisState->dataPluginManager->apiErrorFlag = true; return 0; } - return thisState->dataRuntimeLang->ErlVariable(handle).Value.Number; + return erl->ErlVariable(handle).Value.Number; } void setEMSGlobalVariableValue(EnergyPlusState state, int handle, Real64 value) { auto *thisState = static_cast(state); - if (handle < thisState->dataRuntimeLang->NumBuiltInErlVariables || handle > thisState->dataRuntimeLang->NumErlVariables) { + auto const &erl = thisState->dataRuntimeLang; + bool const insideBuiltInRange = index >= erl->emsVarBuiltInStart && index <= erl->emsVarBuiltInEnd; + if (insideBuiltInRange || handle > erl->NumErlVariables) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return EnergyPlus::ShowSevereError( @@ -634,7 +638,7 @@ void setEMSGlobalVariableValue(EnergyPlusState state, int handle, Real64 value) "The setEMSGlobalVariableValue function will return to allow the plugin to finish, then EnergyPlus will abort"); thisState->dataPluginManager->apiErrorFlag = true; } - thisState->dataRuntimeLang->ErlVariable(handle).Value.Number = value; + erl->ErlVariable(handle).Value.Number = value; } int getPluginGlobalVariableHandle(EnergyPlusState state, const char *name) From aa433a76072c4b141d939715a667e0f46193ebb0 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 14 Aug 2024 15:50:09 +0200 Subject: [PATCH 131/164] clang format --- tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc index 4e3edc51a24..e53ed583850 100644 --- a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc +++ b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc @@ -1715,7 +1715,7 @@ TEST_F(EnergyPlusFixture, UnitaryBypassVAV_ParentElectricityRateTest) // set sizing variables state->dataSize->SysSizingRunDone = true; state->dataSize->ZoneSizingRunDone = true; - state->dataGlobal->SysSizingCalc = true; // disable sizing calculation + state->dataGlobal->SysSizingCalc = true; // disable sizing calculation state->dataGlobal->SysSizingCalc = true; state->dataGlobal->BeginEnvrnFlag = true; // set local variables for convenience From bbfe61b6806df973f199f1dc790a1ae5da82e5a5 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 14 Aug 2024 16:47:09 +0200 Subject: [PATCH 132/164] Use relatistic SUNCOSTS Gotten from running 1ZoneUncontrolled.idf with chicago weather on Jan 1 at 12 --- tst/EnergyPlus/unit/SolarShading.unit.cc | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tst/EnergyPlus/unit/SolarShading.unit.cc b/tst/EnergyPlus/unit/SolarShading.unit.cc index f144d13d77f..29914ae3e38 100644 --- a/tst/EnergyPlus/unit/SolarShading.unit.cc +++ b/tst/EnergyPlus/unit/SolarShading.unit.cc @@ -1880,6 +1880,10 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonClippingDirect) SolarShading::SkyDifSolarShading(*state); state->dataSolarShading->CalcSkyDifShading = false; + state->dataBSDFWindow->SUNCOSTS(state->dataGlobal->TimeStep, state->dataGlobal->HourOfDay)(1) = 0.20531446332266728; + state->dataBSDFWindow->SUNCOSTS(state->dataGlobal->TimeStep, state->dataGlobal->HourOfDay)(2) = -0.84761109808931534; + state->dataBSDFWindow->SUNCOSTS(state->dataGlobal->TimeStep, state->dataGlobal->HourOfDay)(3) = 0.48928662105799514; + FigureSolarBeamAtTimestep(*state, state->dataGlobal->HourOfDay, state->dataGlobal->TimeStep); int surfNum = Util::FindItemInList("ZN001:WALL-SOUTH:WIN001", state->dataSurface->Surface); EXPECT_NEAR(0.6504, state->dataSolarShading->SurfDifShdgRatioIsoSkyHRTS(4, 9, surfNum), 0.0001); @@ -4698,9 +4702,11 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap2) shade2SchedEMSOn = true; shade1SchedEMSValue = 1.0; shade2SchedEMSValue = 1.0; - state->dataBSDFWindow->SUNCOSTS(4, 12)(1) = 0.2; - state->dataBSDFWindow->SUNCOSTS(4, 12)(2) = 0.2; - state->dataBSDFWindow->SUNCOSTS(4, 12)(3) = 0.2; + + // Gotten from running 1ZoneUncontrolled.idf with chicago weather on Jan 1 at 12 + state->dataBSDFWindow->SUNCOSTS(state->dataGlobal->TimeStep, state->dataGlobal->HourOfDay)(1) = 0.20531446332266728; + state->dataBSDFWindow->SUNCOSTS(state->dataGlobal->TimeStep, state->dataGlobal->HourOfDay)(2) = -0.84761109808931534; + state->dataBSDFWindow->SUNCOSTS(state->dataGlobal->TimeStep, state->dataGlobal->HourOfDay)(3) = 0.48928662105799514; FigureSolarBeamAtTimestep(*state, state->dataGlobal->HourOfDay, state->dataGlobal->TimeStep); ReportSurfaceShading(*state); @@ -5048,9 +5054,9 @@ TEST_F(EnergyPlusFixture, SolarShadingTest_PolygonOverlap3) // Use the base transmittance schedules (no EMS override) // shade1 transmittance = 0.5, shade2 transmittance = 0.8 - state->dataBSDFWindow->SUNCOSTS(4, 12)(1) = 0.2; - state->dataBSDFWindow->SUNCOSTS(4, 12)(2) = 0.2; - state->dataBSDFWindow->SUNCOSTS(4, 12)(3) = 0.2; + state->dataBSDFWindow->SUNCOSTS(state->dataGlobal->TimeStep, state->dataGlobal->HourOfDay)(1) = 0.20531446332266728; + state->dataBSDFWindow->SUNCOSTS(state->dataGlobal->TimeStep, state->dataGlobal->HourOfDay)(2) = -0.84761109808931534; + state->dataBSDFWindow->SUNCOSTS(state->dataGlobal->TimeStep, state->dataGlobal->HourOfDay)(3) = 0.48928662105799514; FigureSolarBeamAtTimestep(*state, state->dataGlobal->HourOfDay, state->dataGlobal->TimeStep); ReportSurfaceShading(*state); From bcf41183f5cf727f462266b06274d51d79e6073d Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Wed, 14 Aug 2024 10:32:48 -0700 Subject: [PATCH 133/164] fix err message blow->draw through --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index fc8ff1253fc..19ac6450f64 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -5494,7 +5494,7 @@ void CheckVRFTUNodeConnections(EnergyPlusData &state, int const VRFTUNum, bool & if (fanOutletNode != VRFTUOutletNodeNum) { ShowSevereError(state, fmt::format("{}=\"{}\",", cTerminalUnitType, cTUName)); ShowContinueError(state, - "... For blow through fan and no supplemental heating coil the fan outlet node name must " + "... For draw through fan and no supplemental heating coil the fan outlet node name must " "match the terminal unit outlet node name."); if (fanOutletNode > 0 && VRFTUOutletNodeNum > 0) { ShowContinueError(state, format("... Fan outlet node name = {}.", nodeID(fanOutletNode))); From 49f4d36b6033919a32cc427601b2b20e827ec3bd Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Wed, 14 Aug 2024 12:44:41 -0500 Subject: [PATCH 134/164] Use handle not index --- src/EnergyPlus/api/datatransfer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EnergyPlus/api/datatransfer.cc b/src/EnergyPlus/api/datatransfer.cc index 9ed4f2458f4..25b274b469e 100644 --- a/src/EnergyPlus/api/datatransfer.cc +++ b/src/EnergyPlus/api/datatransfer.cc @@ -612,7 +612,7 @@ Real64 getEMSGlobalVariableValue(EnergyPlusState state, int handle) { auto *thisState = static_cast(state); auto const &erl = thisState->dataRuntimeLang; - bool const insideBuiltInRange = index >= erl->emsVarBuiltInStart && index <= erl->emsVarBuiltInEnd; + bool const insideBuiltInRange = handle >= erl->emsVarBuiltInStart && handle <= erl->emsVarBuiltInEnd; if (insideBuiltInRange || handle > thisState->dataRuntimeLang->NumErlVariables) { // need to fatal out once the process is done // throw an error, set the fatal flag, and then return 0 @@ -630,7 +630,7 @@ void setEMSGlobalVariableValue(EnergyPlusState state, int handle, Real64 value) { auto *thisState = static_cast(state); auto const &erl = thisState->dataRuntimeLang; - bool const insideBuiltInRange = index >= erl->emsVarBuiltInStart && index <= erl->emsVarBuiltInEnd; + bool const insideBuiltInRange = handle >= erl->emsVarBuiltInStart && handle <= erl->emsVarBuiltInEnd; if (insideBuiltInRange || handle > erl->NumErlVariables) { // need to fatal out once the plugin is done // throw an error, set the fatal flag, and then return From 49fd825b3d68d4d99114afe5e047d720cb41d96c Mon Sep 17 00:00:00 2001 From: Yujie Xu Date: Fri, 16 Aug 2024 12:36:46 -0700 Subject: [PATCH 135/164] clang-format --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 1422378f6cd..070dd4939fe 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12850,16 +12850,7 @@ void VRFTerminalUnitEquipment::CalcVRF_FluidTCtrl(EnergyPlusData &state, auto *fan = state.dataFans->fans(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).FanIndex); if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType == HVAC::FanType::SystemModel) { if (OnOffAirFlowRatio > 0.0) { - fan->simulate(state, - FirstHVACIteration, - _, - _, - _, - fan->inletAirMassFlowRate, - OnOffFanPartLoadFraction, - 0, - 0, - _); + fan->simulate(state, FirstHVACIteration, _, _, _, fan->inletAirMassFlowRate, OnOffFanPartLoadFraction, 0, 0, _); } else { fan->simulate(state, FirstHVACIteration, _, _, PartLoadRatio); } From be14c932c58a1d260457344704c88e298e14fca0 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Sun, 18 Aug 2024 20:02:49 -0500 Subject: [PATCH 136/164] SpaceReturnMixerTest --- .../unit/ZoneEquipmentManager.unit.cc | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) diff --git a/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc b/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc index 4d036e12ce8..86ba25331bb 100644 --- a/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc +++ b/tst/EnergyPlus/unit/ZoneEquipmentManager.unit.cc @@ -5357,3 +5357,181 @@ TEST_F(EnergyPlusFixture, ZoneEquipmentManager_GetZoneEquipmentTest) EXPECT_FALSE(state->dataZoneEquipmentManager->GetZoneEquipmentInputFlag); EXPECT_EQ(state->dataZoneEquipmentManager->NumOfTimeStepInDay, 24); } +TEST_F(EnergyPlusFixture, SpaceReturnMixerTest) +{ + state->dataZoneEquip->zoneReturnMixer.resize(1); + auto &thisMixer = state->dataZoneEquip->zoneReturnMixer[0]; + // Assume 3 spaces are served by this mixter + int numSpaces = 3; + thisMixer.spaces.resize(numSpaces); + auto &mixSpace1 = thisMixer.spaces[0]; + auto &mixSpace2 = thisMixer.spaces[1]; + auto &mixSpace3 = thisMixer.spaces[2]; + mixSpace1.spaceIndex = 1; + mixSpace2.spaceIndex = 3; + mixSpace3.spaceIndex = 2; + mixSpace1.spaceNodeNum = 11; + mixSpace2.spaceNodeNum = 13; + mixSpace3.spaceNodeNum = 12; + state->dataLoopNodes->Node.allocate(13); + thisMixer.outletNodeNum = 10; + auto &outletNode = state->dataLoopNodes->Node(thisMixer.outletNodeNum); + auto &mixSpace1Node = state->dataLoopNodes->Node(mixSpace1.spaceNodeNum); + auto &mixSpace2Node = state->dataLoopNodes->Node(mixSpace2.spaceNodeNum); + auto &mixSpace3Node = state->dataLoopNodes->Node(mixSpace3.spaceNodeNum); + state->dataContaminantBalance->Contaminant.CO2Simulation = true; + state->dataContaminantBalance->Contaminant.GenericContamSimulation = true; + state->dataZoneEquip->spaceEquipConfig.allocate(numSpaces); + auto &spaceEquipConfig1 = state->dataZoneEquip->spaceEquipConfig(1); + auto &spaceEquipConfig2 = state->dataZoneEquip->spaceEquipConfig(2); + auto &spaceEquipConfig3 = state->dataZoneEquip->spaceEquipConfig(3); + spaceEquipConfig1.NumReturnNodes = 1; + spaceEquipConfig2.NumReturnNodes = 1; + spaceEquipConfig3.NumReturnNodes = 1; + spaceEquipConfig1.ReturnNode.allocate(1); + spaceEquipConfig2.ReturnNode.allocate(1); + spaceEquipConfig3.ReturnNode.allocate(1); + spaceEquipConfig1.ReturnNode(1) = 11; + spaceEquipConfig2.ReturnNode(1) = 12; + spaceEquipConfig3.ReturnNode(1) = 13; + spaceEquipConfig1.ReturnNodeInletNum.allocate(1); + spaceEquipConfig2.ReturnNodeInletNum.allocate(1); + spaceEquipConfig3.ReturnNodeInletNum.allocate(1); + spaceEquipConfig1.ReturnNodeInletNum(1) = 1; + spaceEquipConfig2.ReturnNodeInletNum(1) = 1; + spaceEquipConfig3.ReturnNodeInletNum(1) = 1; + spaceEquipConfig1.InletNodeADUNum.allocate(1); + spaceEquipConfig2.InletNodeADUNum.allocate(1); + spaceEquipConfig3.InletNodeADUNum.allocate(1); + spaceEquipConfig1.InletNodeADUNum(1) = 0; + spaceEquipConfig2.InletNodeADUNum(1) = 0; + spaceEquipConfig3.InletNodeADUNum(1) = 0; + spaceEquipConfig1.ReturnNodeAirLoopNum.allocate(1); + spaceEquipConfig2.ReturnNodeAirLoopNum.allocate(1); + spaceEquipConfig3.ReturnNodeAirLoopNum.allocate(1); + spaceEquipConfig1.ReturnNodeAirLoopNum(1) = 1; + spaceEquipConfig2.ReturnNodeAirLoopNum(1) = 1; + spaceEquipConfig3.ReturnNodeAirLoopNum(1) = 1; + spaceEquipConfig1.InletNode.allocate(1); + spaceEquipConfig2.InletNode.allocate(1); + spaceEquipConfig3.InletNode.allocate(1); + spaceEquipConfig1.InletNode(1) = 1; + spaceEquipConfig2.InletNode(1) = 2; + spaceEquipConfig3.InletNode(1) = 3; + auto &space1InletNode = state->dataLoopNodes->Node(spaceEquipConfig1.InletNode(1)); + auto &space2InletNode = state->dataLoopNodes->Node(spaceEquipConfig2.InletNode(1)); + auto &space3InletNode = state->dataLoopNodes->Node(spaceEquipConfig3.InletNode(1)); + spaceEquipConfig1.FixedReturnFlow.allocate(1); + spaceEquipConfig2.FixedReturnFlow.allocate(1); + spaceEquipConfig3.FixedReturnFlow.allocate(1); + + spaceEquipConfig1.ZoneNode = 5; + spaceEquipConfig2.ZoneNode = 6; + spaceEquipConfig3.ZoneNode = 7; + auto &space1Node = state->dataLoopNodes->Node(spaceEquipConfig1.ZoneNode); + auto &space2Node = state->dataLoopNodes->Node(spaceEquipConfig2.ZoneNode); + auto &space3Node = state->dataLoopNodes->Node(spaceEquipConfig3.ZoneNode); + + // Note that spaces are not in numerical order + // mixSpace1.spaceIndex = 1; + // mixSpace2.spaceIndex = 3; + // mixSpace3.spaceIndex = 2; + space1InletNode.MassFlowRate = 0.2; + space3InletNode.MassFlowRate = 0.5; + space2InletNode.MassFlowRate = 0.3; + + state->dataAirLoop->AirLoopFlow.allocate(1); + auto &thisAirLoopFlow = state->dataAirLoop->AirLoopFlow(1); + thisAirLoopFlow.SysRetFlow = 1.0; + state->dataAirSystemsData->PrimaryAirSystems.allocate(1); + + // Set flow rates/fractions + outletNode.MassFlowRate = 1.0; + thisMixer.setInletFlows(*state); + EXPECT_NEAR(mixSpace1.fraction, 0.2, 0.001); + EXPECT_NEAR(mixSpace2.fraction, 0.5, 0.001); + EXPECT_NEAR(mixSpace3.fraction, 0.3, 0.001); + + // Case 1 + space1Node.Temp = 15.0; + space3Node.Temp = 15.0; + space2Node.Temp = 15.0; + + space1Node.HumRat = 0.004; + space3Node.HumRat = 0.001; + space2Node.HumRat = 0.080; + + space1Node.Press = 100000.0; + space3Node.Press = 100020.0; + space2Node.Press = 99400.0; + + space1Node.GenContam = 10.0; + space3Node.GenContam = 20.0; + space2Node.GenContam = 30.0; + + space1Node.Enthalpy = Psychrometrics::PsyHFnTdbW(space1Node.Temp, space1Node.HumRat); + space2Node.Enthalpy = Psychrometrics::PsyHFnTdbW(space2Node.Temp, space2Node.HumRat); + space3Node.Enthalpy = Psychrometrics::PsyHFnTdbW(space3Node.Temp, space3Node.HumRat); + + thisMixer.setInletConditions(*state); + + EXPECT_NEAR(mixSpace1Node.Temp, space1Node.Temp, 0.01); + EXPECT_NEAR(mixSpace2Node.Temp, space3Node.Temp, 0.01); + EXPECT_NEAR(mixSpace3Node.Temp, space2Node.Temp, 0.01); + + EXPECT_NEAR(mixSpace1Node.HumRat, space1Node.HumRat, 0.01); + EXPECT_NEAR(mixSpace2Node.HumRat, space3Node.HumRat, 0.01); + EXPECT_NEAR(mixSpace3Node.HumRat, space2Node.HumRat, 0.01); + + EXPECT_NEAR(mixSpace1Node.Enthalpy, space1Node.Enthalpy, 0.001); + EXPECT_NEAR(mixSpace2Node.Enthalpy, space3Node.Enthalpy, 0.001); + EXPECT_NEAR(mixSpace3Node.Enthalpy, space2Node.Enthalpy, 0.001); + + EXPECT_NEAR(mixSpace1Node.Press, space1Node.Press, 0.001); + EXPECT_NEAR(mixSpace2Node.Press, space3Node.Press, 0.001); + EXPECT_NEAR(mixSpace3Node.Press, space2Node.Press, 0.001); + + EXPECT_NEAR(mixSpace1Node.GenContam, space1Node.GenContam, 0.001); + EXPECT_NEAR(mixSpace2Node.GenContam, space3Node.GenContam, 0.001); + EXPECT_NEAR(mixSpace3Node.GenContam, space2Node.GenContam, 0.001); + + outletNode.Temp = 19.2; + outletNode.HumRat = 0.005; + outletNode.CO2 = 100.0; + + thisMixer.setOutletConditions(*state); + Real64 expectedInletEnthalpy = + mixSpace1Node.Enthalpy * mixSpace1.fraction + mixSpace2Node.Enthalpy * mixSpace2.fraction + mixSpace3Node.Enthalpy * mixSpace3.fraction; + Real64 expectedInletHumRat = + mixSpace1Node.HumRat * mixSpace1.fraction + mixSpace2Node.HumRat * mixSpace2.fraction + mixSpace3Node.HumRat * mixSpace3.fraction; + Real64 expectedInletCO2 = + mixSpace1Node.CO2 * mixSpace1.fraction + mixSpace2Node.CO2 * mixSpace2.fraction + mixSpace3Node.CO2 * mixSpace3.fraction; + Real64 expectedInletGenContam = + mixSpace1Node.GenContam * mixSpace1.fraction + mixSpace2Node.GenContam * mixSpace2.fraction + mixSpace3Node.GenContam * mixSpace3.fraction; + Real64 expectedInletPress = + mixSpace1Node.Press * mixSpace1.fraction + mixSpace2Node.Press * mixSpace2.fraction + mixSpace3Node.Press * mixSpace3.fraction; + Real64 expectedInletTemp = Psychrometrics::PsyTdbFnHW(expectedInletEnthalpy, expectedInletHumRat); + + EXPECT_NEAR(expectedInletEnthalpy, outletNode.Enthalpy, 0.0001); + EXPECT_NEAR(expectedInletTemp, outletNode.Temp, 0.0001); + EXPECT_NEAR(expectedInletHumRat, outletNode.HumRat, 0.0001); + EXPECT_NEAR(expectedInletCO2, outletNode.CO2, 0.0001); + EXPECT_NEAR(expectedInletGenContam, outletNode.GenContam, 0.0001); + EXPECT_NEAR(expectedInletPress, outletNode.Press, 0.0001); + + outletNode.MassFlowRate = 0.1; + outletNode.MassFlowRateMinAvail = 0.0; + outletNode.MassFlowRateMaxAvail = 0.15; + + thisMixer.setInletFlows(*state); + + EXPECT_NEAR(mixSpace1Node.MassFlowRate, outletNode.MassFlowRate * mixSpace1.fraction, 0.0001); + EXPECT_NEAR(mixSpace2Node.MassFlowRate, outletNode.MassFlowRate * mixSpace2.fraction, 0.0001); + EXPECT_NEAR(mixSpace3Node.MassFlowRate, outletNode.MassFlowRate * mixSpace3.fraction, 0.0001); + EXPECT_NEAR(mixSpace1Node.MassFlowRateMinAvail, outletNode.MassFlowRateMinAvail * mixSpace1.fraction, 0.0001); + EXPECT_NEAR(mixSpace2Node.MassFlowRateMinAvail, outletNode.MassFlowRateMinAvail * mixSpace2.fraction, 0.0001); + EXPECT_NEAR(mixSpace3Node.MassFlowRateMinAvail, outletNode.MassFlowRateMinAvail * mixSpace3.fraction, 0.0001); + EXPECT_NEAR(mixSpace1Node.MassFlowRateMaxAvail, outletNode.MassFlowRateMaxAvail * mixSpace1.fraction, 0.0001); + EXPECT_NEAR(mixSpace2Node.MassFlowRateMaxAvail, outletNode.MassFlowRateMaxAvail * mixSpace2.fraction, 0.0001); + EXPECT_NEAR(mixSpace3Node.MassFlowRateMaxAvail, outletNode.MassFlowRateMaxAvail * mixSpace3.fraction, 0.0001); +} From c07880f93fa98817d6ed2f6d2b5013ad5456017d Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Mon, 19 Aug 2024 08:40:54 -0500 Subject: [PATCH 137/164] Zone then Space and other cleanup --- src/EnergyPlus/DaylightingManager.cc | 146 +++++++++++++-------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index dc7bbaecc4c..003445caa9e 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -4038,15 +4038,29 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) auto &illumMap = dl->illumMaps(MapNum); illumMap.Name = ipsc->cAlphaArgs(1); - int const spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->space); - if (spaceNum > 0) { - illumMap.spaceIndex = spaceNum; - illumMap.zoneIndex = state.dataHeatBal->space(spaceNum).zoneNum; - illumMap.enclIndex = state.dataHeatBal->space(spaceNum).solarEnclosureNum; - assert(illumMap.enclIndex > 0); + int const zoneNum = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); + if (zoneNum > 0) { + illumMap.zoneIndex = zoneNum; + // set enclosure index for first space in zone + int enclNum = state.dataHeatBal->space(state.dataHeatBal->Zone(zoneNum).spaceIndexes(1)).solarEnclosureNum; + illumMap.enclIndex = enclNum; + // check that all spaces in the zone are in the same enclosure + for (int spaceCounter = 2; spaceCounter <= state.dataHeatBal->Zone(zoneNum).numSpaces; ++spaceCounter) { + int spaceNum = state.dataHeatBal->Zone(zoneNum).spaceIndexes(spaceCounter); + if (enclNum != state.dataHeatBal->space(spaceNum).solarEnclosureNum) { + ShowSevereError(state, + format("{}=\"{}\" All spaces in the zone must be in the same enclosure for daylighting illuminance maps.", + ipsc->cCurrentModuleObject, + ipsc->cAlphaArgs(1))); + ShowContinueError( + state, format("Zone=\"{}\" spans multiple enclosures. Use a Space Name instead.", state.dataHeatBal->Zone(zoneNum).Name)); + ErrorsFound = true; + break; + } + } } else { - illumMap.zoneIndex = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); - if (illumMap.zoneIndex == 0) { + int const spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->space); + if (spaceNum == 0) { ShowSevereError(state, format("{}=\"{}\", invalid {}=\"{}\".", ipsc->cCurrentModuleObject, @@ -4055,25 +4069,10 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) ipsc->cAlphaArgs(2))); ErrorsFound = true; } else { - // set enclosure index for first space in zone - int zoneNum = illumMap.zoneIndex; - int enclNum = state.dataHeatBal->space(state.dataHeatBal->Zone(zoneNum).spaceIndexes(1)).solarEnclosureNum; - illumMap.enclIndex = enclNum; - // check that all spaces in the zone are in the same enclosure - for (int spaceCounter = 2; spaceCounter <= state.dataHeatBal->Zone(zoneNum).numSpaces; ++spaceCounter) { - int spaceNum = state.dataHeatBal->Zone(zoneNum).spaceIndexes(spaceCounter); - if (enclNum != state.dataHeatBal->space(spaceNum).solarEnclosureNum) { - ShowSevereError(state, - format("{}=\"{}\" All spaces in the zone must be in the same enclosure for daylighting illuminance maps.", - ipsc->cCurrentModuleObject, - ipsc->cAlphaArgs(1))); - ShowContinueError( - state, - format("Zone=\"{}\" spans multiple enclosures. Use a Space Name instead.", state.dataHeatBal->Zone(zoneNum).Name)); - ErrorsFound = true; - break; - } - } + illumMap.spaceIndex = spaceNum; + illumMap.zoneIndex = state.dataHeatBal->space(spaceNum).zoneNum; + illumMap.enclIndex = state.dataHeatBal->space(spaceNum).solarEnclosureNum; + assert(illumMap.enclIndex > 0); } } @@ -4395,59 +4394,60 @@ void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) auto &daylightControl = dl->daylightControl(controlNum); daylightControl.Name = ipsc->cAlphaArgs(1); - // Is it a space or zone name? - int const spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->space); - if (spaceNum > 0) { - daylightControl.spaceIndex = spaceNum; - daylightControl.zoneIndex = state.dataHeatBal->space(spaceNum).zoneNum; - daylightControl.enclIndex = state.dataHeatBal->space(spaceNum).solarEnclosureNum; - // Check if this is a duplicate - if (spaceHasDaylightingControl(spaceNum)) { - ShowSevereError(state, - format("{}=\"{}\" Space==\"{}\" already has a {} object assigned to it. Only one per Space is allowed.", - ipsc->cCurrentModuleObject, - daylightControl.Name, - state.dataHeatBal->space(spaceNum).Name, - ipsc->cCurrentModuleObject)); - ErrorsFound = true; - continue; + // Is it a zone or space name? + int const zoneNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); + if (zoneNum > 0) { + daylightControl.zoneIndex = zoneNum; + // set enclosure index for first space in zone + int enclNum = state.dataHeatBal->space(state.dataHeatBal->Zone(zoneNum).spaceIndexes(1)).solarEnclosureNum; + daylightControl.enclIndex = enclNum; + // check that all spaces in the zone are in the same enclosure + for (int spaceCounter = 2; spaceCounter <= state.dataHeatBal->Zone(zoneNum).numSpaces; ++spaceCounter) { + int zoneSpaceNum = state.dataHeatBal->Zone(zoneNum).spaceIndexes(spaceCounter); + if (daylightControl.enclIndex != state.dataHeatBal->space(zoneSpaceNum).solarEnclosureNum) { + ShowSevereError(state, + format("{}: invalid {}=\"{}\" All spaces in the zone must be in the same enclosure for daylighting.", + ipsc->cCurrentModuleObject, + ipsc->cAlphaFieldNames(2), + ipsc->cAlphaArgs(2))); + ErrorsFound = true; + break; + } + } + for (int zoneSpaceNum : state.dataHeatBal->Zone(zoneNum).spaceIndexes) { + // Check if this is a duplicate + if (spaceHasDaylightingControl(zoneSpaceNum)) { + ShowWarningError(state, + format("{}=\"{}\" Space=\"{}\" already has a {} object assigned to it.", + ipsc->cCurrentModuleObject, + daylightControl.Name, + state.dataHeatBal->space(zoneSpaceNum).Name, + ipsc->cCurrentModuleObject)); + ShowContinueError(state, "This control will override the lighting power factor for this space."); + } + spaceHasDaylightingControl(zoneSpaceNum) = true; } } else { - int const zoneNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->Zone); - if (zoneNum == 0) { + int const spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->space); + if (spaceNum == 0) { ShowSevereError(state, format("{}: invalid {}=\"{}\".", ipsc->cCurrentModuleObject, ipsc->cAlphaFieldNames(2), ipsc->cAlphaArgs(2))); ErrorsFound = true; continue; } else { - daylightControl.zoneIndex = zoneNum; - - // set enclosure index for first space in zone - int enclNum = state.dataHeatBal->space(state.dataHeatBal->Zone(zoneNum).spaceIndexes(1)).solarEnclosureNum; - daylightControl.enclIndex = enclNum; - // check that all spaces in the zone are in the same enclosure - for (int spaceCounter = 2; spaceCounter <= state.dataHeatBal->Zone(zoneNum).numSpaces; ++spaceCounter) { - int zoneSpaceNum = state.dataHeatBal->Zone(zoneNum).spaceIndexes(spaceCounter); - if (daylightControl.enclIndex != state.dataHeatBal->space(zoneSpaceNum).solarEnclosureNum) { - ShowSevereError(state, - format("{}: invalid {}=\"{}\" All spaces in the zone must be in the same enclosure for daylighting.", - ipsc->cCurrentModuleObject, - ipsc->cAlphaFieldNames(2), - ipsc->cAlphaArgs(2))); - ErrorsFound = true; - break; - } - // Check if this is a duplicate - if (spaceHasDaylightingControl(zoneSpaceNum)) { - ShowSevereError(state, - format("{}=\"{}\" Space==\"{}\" already has a {} object assigned to it. Only one per Space is allowed.", - ipsc->cCurrentModuleObject, - daylightControl.Name, - state.dataHeatBal->space(zoneSpaceNum).Name, - ipsc->cCurrentModuleObject)); - ErrorsFound = true; - continue; - } + daylightControl.spaceIndex = spaceNum; + daylightControl.zoneIndex = state.dataHeatBal->space(spaceNum).zoneNum; + daylightControl.enclIndex = state.dataHeatBal->space(spaceNum).solarEnclosureNum; + // Check if this is a duplicate + if (spaceHasDaylightingControl(spaceNum)) { + ShowWarningError(state, + format("{}=\"{}\" Space=\"{}\" already has a {} object assigned to it.", + ipsc->cCurrentModuleObject, + daylightControl.Name, + state.dataHeatBal->space(spaceNum).Name, + ipsc->cCurrentModuleObject)); + ShowContinueError(state, "This control will override the lighting power factor for this space."); } + spaceHasDaylightingControl(spaceNum) = true; } } From 96c479ec4e8102240edbceb086ba436165b8898e Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Mon, 19 Aug 2024 09:57:05 -0500 Subject: [PATCH 138/164] Clang format --- src/EnergyPlus/WindowManager.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 45f391f9267..ba62fe8f54e 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -7458,11 +7458,11 @@ namespace Window { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: - Array1D bld_pr(15); // Slat properties - Array1D st_lay(16); // Solar-optical blind/glazing system properties - Real64 sun_el; // Solar profile angle (radians) + Array1D bld_pr(15); // Slat properties + Array1D st_lay(16); // Solar-optical blind/glazing system properties + Real64 sun_el; // Solar profile angle (radians) Array1D sun_el_deg(Material::MaxProfAngs); // Solar profile angle (deg) corresponding to sun_el values - Real64 bld_el; // Slat angle (elevation of slat normal vector in plane + Real64 bld_el; // Slat angle (elevation of slat normal vector in plane // perpendicular to window and containing the slat normal vector) (radians) int IProfAng; // Profile angle index @@ -7584,17 +7584,17 @@ namespace Window { if (ISolVis == 1) { for (int ISlatAng = 1; ISlatAng <= Material::MaxSlatAngs; ++ISlatAng) { blind.SolFrontDiffDiffTransGnd(ISlatAng) = - DiffuseAverageProfAngGnd(blind.SolFrontBeamBeamTrans(ISlatAng, {1, Material::MaxProfAngs})) + - DiffuseAverageProfAngGnd(blind.SolFrontBeamDiffTrans(ISlatAng, {1, Material::MaxProfAngs})); + DiffuseAverageProfAngGnd(blind.SolFrontBeamBeamTrans(ISlatAng, {1, Material::MaxProfAngs})) + + DiffuseAverageProfAngGnd(blind.SolFrontBeamDiffTrans(ISlatAng, {1, Material::MaxProfAngs})); blind.SolFrontDiffDiffTransSky(ISlatAng) = - DiffuseAverageProfAngSky(blind.SolFrontBeamBeamTrans(ISlatAng, {1, Material::MaxProfAngs})) + - DiffuseAverageProfAngSky(blind.SolFrontBeamDiffTrans(ISlatAng, {1, Material::MaxProfAngs})); + DiffuseAverageProfAngSky(blind.SolFrontBeamBeamTrans(ISlatAng, {1, Material::MaxProfAngs})) + + DiffuseAverageProfAngSky(blind.SolFrontBeamDiffTrans(ISlatAng, {1, Material::MaxProfAngs})); blind.SolFrontDiffAbsGnd(ISlatAng) = DiffuseAverageProfAngGnd(blind.SolFrontBeamAbs(ISlatAng, {1, Material::MaxProfAngs})); blind.SolFrontDiffAbsSky(ISlatAng) = DiffuseAverageProfAngSky(blind.SolFrontBeamAbs(ISlatAng, {1, Material::MaxProfAngs})); blind.SolFrontDiffDiffReflGnd(ISlatAng) = - DiffuseAverageProfAngGnd(blind.SolFrontBeamDiffRefl(ISlatAng, {1, Material::MaxProfAngs})); + DiffuseAverageProfAngGnd(blind.SolFrontBeamDiffRefl(ISlatAng, {1, Material::MaxProfAngs})); blind.SolFrontDiffDiffReflSky(ISlatAng) = - DiffuseAverageProfAngSky(blind.SolFrontBeamDiffRefl(ISlatAng, {1, Material::MaxProfAngs})); + DiffuseAverageProfAngSky(blind.SolFrontBeamDiffRefl(ISlatAng, {1, Material::MaxProfAngs})); // TH 2/17/2010. Added. Loop only for movable slat blinds if (blind.SlatAngleType == DataWindowEquivalentLayer::AngleType::Fixed) break; From 842b1090c298bdadf9c040b40200ed53c76fba1e Mon Sep 17 00:00:00 2001 From: rraustad Date: Mon, 19 Aug 2024 19:54:04 -0400 Subject: [PATCH 139/164] FluidProperties through HVACUnitaryBypassVAV --- src/EnergyPlus/FluidProperties.cc | 92 ++++++++++---------------- src/EnergyPlus/FluidProperties.hh | 2 +- src/EnergyPlus/Furnaces.cc | 8 +-- src/EnergyPlus/HVACInterfaceManager.cc | 2 +- src/EnergyPlus/HVACManager.cc | 2 +- src/EnergyPlus/HVACManager.hh | 2 +- src/EnergyPlus/HVACStandAloneERV.cc | 5 +- src/EnergyPlus/HVACUnitaryBypassVAV.cc | 7 +- 8 files changed, 44 insertions(+), 76 deletions(-) diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index 2fb88c72643..be30d53ed39 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -1035,7 +1035,7 @@ namespace FluidProperties { continue; } - auto &supTempArray = FluidTemps(supTempArrayNum); + auto const &supTempArray = FluidTemps(supTempArrayNum); refrig->NumSupTempPoints = supTempArray.NumOfTemps; refrig->SupTemps.allocate(refrig->NumSupTempPoints); refrig->SupTemps = supTempArray.Temps; @@ -1441,7 +1441,7 @@ namespace FluidProperties { if (!glycolRaw->CpTempArrayName.empty()) { int cpTempArrayNum = Util::FindItemInList(glycolRaw->CpTempArrayName, FluidTemps); - auto &cpTempArray = FluidTemps(cpTempArrayNum); + auto const &cpTempArray = FluidTemps(cpTempArrayNum); glycolRaw->NumCpTempPoints = cpTempArray.NumOfTemps; glycolRaw->CpTemps.allocate(glycolRaw->NumCpTempPoints); glycolRaw->CpTemps = cpTempArray.Temps; @@ -1452,7 +1452,7 @@ namespace FluidProperties { if (!glycolRaw->RhoTempArrayName.empty()) { int rhoTempArrayNum = Util::FindItemInList(glycolRaw->RhoTempArrayName, FluidTemps); - auto &rhoTempArray = FluidTemps(rhoTempArrayNum); + auto const &rhoTempArray = FluidTemps(rhoTempArrayNum); glycolRaw->NumRhoTempPoints = rhoTempArray.NumOfTemps; glycolRaw->RhoTemps.allocate(glycolRaw->NumRhoTempPoints); glycolRaw->RhoTemps = rhoTempArray.Temps; @@ -1463,7 +1463,7 @@ namespace FluidProperties { if (!glycolRaw->CondTempArrayName.empty()) { int condTempArrayNum = Util::FindItemInList(glycolRaw->CondTempArrayName, FluidTemps); - auto &condTempArray = FluidTemps(condTempArrayNum); + auto const &condTempArray = FluidTemps(condTempArrayNum); glycolRaw->NumCondTempPoints = condTempArray.NumOfTemps; glycolRaw->CondTemps.allocate(glycolRaw->NumCondTempPoints); glycolRaw->CondTemps = condTempArray.Temps; @@ -1474,7 +1474,7 @@ namespace FluidProperties { if (!glycolRaw->ViscTempArrayName.empty()) { int viscTempArrayNum = Util::FindItemInList(glycolRaw->ViscTempArrayName, FluidTemps); - auto &viscTempArray = FluidTemps(viscTempArrayNum); + auto const &viscTempArray = FluidTemps(viscTempArrayNum); glycolRaw->NumViscTempPoints = viscTempArray.NumOfTemps; glycolRaw->ViscTemps.allocate(glycolRaw->NumViscTempPoints); glycolRaw->ViscTemps = viscTempArray.Temps; @@ -1936,9 +1936,7 @@ namespace FluidProperties { // Most properties requested (e.g., Specific Heat) must be > 0 but the tables may // be set up for symmetry and not be limited to just valid values. - auto &df = state.dataFluidProps; - - for (auto *glycol : df->glycols) { + for (auto *glycol : state.dataFluidProps->glycols) { if (glycol->CpDataPresent) { // check for lowest non-zero value by referencing temp data for (int IndexNum = 1; IndexNum <= glycol->NumCpTempPoints; ++IndexNum) { @@ -2039,9 +2037,8 @@ namespace FluidProperties { // for the refrigerant properties. // Most properties requested (e.g., Specific Heat) must be > 0 but the tables may // be set up for symmetry and not be limited to just valid values. - auto &df = state.dataFluidProps; - for (auto *refrig : df->refrigs) { + for (auto *refrig : state.dataFluidProps->refrigs) { for (int IndexNum = 1; IndexNum <= refrig->NumPsPoints; ++IndexNum) { if (refrig->PsValues(IndexNum) <= 0.0) continue; refrig->PsLowPresIndex = IndexNum; @@ -2181,9 +2178,7 @@ namespace FluidProperties { Real64 Temperature; // Temperature to drive values Real64 ReturnValue; // Values returned from glycol functions - auto &df = state.dataFluidProps; - - for (auto *glycol : df->glycols) { + for (auto *glycol : state.dataFluidProps->glycols) { int GlycolIndex = 0; // used in routine calls -- value is returned when first 0 // Lay out the basic values: @@ -2423,9 +2418,7 @@ namespace FluidProperties { Real64 Temperature; // Temperature to drive values Real64 ReturnValue; // Values returned from refrigerant functions - auto &df = state.dataFluidProps; - - for (auto *refrig : df->refrigs) { + for (auto *refrig : state.dataFluidProps->refrigs) { // Lay out the basic values: if (!refrig->Name.empty()) { print(state.files.debug, "Refrigerant={}", refrig->Name); @@ -2759,8 +2752,6 @@ namespace FluidProperties { int LoTempIndex = FindArrayIndex(Temperature, this->PsTemps, this->PsLowTempIndex, this->PsHighTempIndex); - auto &df = state.dataFluidProps; - // check for out of data bounds problems if (LoTempIndex == 0) { ReturnValue = this->PsValues(this->PsLowTempIndex); @@ -2779,7 +2770,7 @@ namespace FluidProperties { if (!state.dataGlobal->WarmupFlag && ErrorFlag) { ++this->errors[(int)RefrigError::SatTemp].count; // send warning - if (this->errors[(int)RefrigError::SatTemp].count <= df->RefrigErrorLimitTest) { + if (this->errors[(int)RefrigError::SatTemp].count <= state.dataFluidProps->RefrigErrorLimitTest) { ShowSevereMessage( state, format("{}: Saturation temperature is out of range for refrigerant [{}] supplied data: **", routineName, this->Name)); ShowContinueError(state, @@ -2810,7 +2801,6 @@ namespace FluidProperties { ) { // Wrapper for RefrigProps::getSatPressure() - auto &df = state.dataFluidProps; if (RefrigIndex == 0) { if ((RefrigIndex = GetRefrigNum(state, refrigName)) == 0) { @@ -2820,7 +2810,7 @@ namespace FluidProperties { } } - return df->refrigs(RefrigIndex)->getSatPressure(state, Temperature, CalledFrom); + return state.dataFluidProps->refrigs(RefrigIndex)->getSatPressure(state, Temperature, CalledFrom); } //***************************************************************************** @@ -2851,8 +2841,6 @@ namespace FluidProperties { // FUNCTION LOCAL VARIABLE DECLARATIONS: bool ErrorFlag = false; // error flag for current call - auto &df = state.dataFluidProps; - // get the array indices int LoPresIndex = FindArrayIndex(Pressure, this->PsValues, this->PsLowPresIndex, this->PsHighPresIndex); @@ -2874,7 +2862,7 @@ namespace FluidProperties { if (!state.dataGlobal->WarmupFlag && ErrorFlag) { ++this->errors[(int)RefrigError::SatPress].count; // send warning - if (this->errors[(int)RefrigError::SatPress].count <= df->RefrigErrorLimitTest) { + if (this->errors[(int)RefrigError::SatPress].count <= state.dataFluidProps->RefrigErrorLimitTest) { ShowSevereMessage(state, format("{}: Saturation pressure is out of range for refrigerant [{}] supplied data: **", routineName, this->Name)); ShowContinueError(state, @@ -2904,7 +2892,6 @@ namespace FluidProperties { ) { // Wrapper for RefrigProps::getSatTemperature() - auto &df = state.dataFluidProps; if (RefrigIndex == 0) { if ((RefrigIndex = GetRefrigNum(state, refrigName)) == 0) { @@ -2914,7 +2901,7 @@ namespace FluidProperties { } } - return df->refrigs(RefrigIndex)->getSatTemperature(state, Pressure, CalledFrom); + return state.dataFluidProps->refrigs(RefrigIndex)->getSatTemperature(state, Pressure, CalledFrom); } //***************************************************************************** @@ -2954,7 +2941,6 @@ namespace FluidProperties { ) { // Wrapper for RefrigProps::getSatEnthalpy() - auto &df = state.dataFluidProps; if (RefrigIndex == 0) { if ((RefrigIndex = GetRefrigNum(state, refrigName)) == 0) { @@ -2963,7 +2949,7 @@ namespace FluidProperties { return 0.0; } } - return df->refrigs(RefrigIndex)->getSatEnthalpy(state, Temperature, Quality, CalledFrom); + return state.dataFluidProps->refrigs(RefrigIndex)->getSatEnthalpy(state, Temperature, Quality, CalledFrom); } //***************************************************************************** @@ -2995,8 +2981,6 @@ namespace FluidProperties { // FUNCTION PARAMETER DEFINITIONS: static constexpr std::string_view routineName = "RefrigProps::getSatDensity"; - auto &df = state.dataFluidProps; - if ((Quality < 0.0) || (Quality > 1.0)) { ShowSevereError(state, fmt::format("{}Refrigerant \"{}\", invalid quality, called from {}", routineName, this->Name, CalledFrom)); ShowContinueError(state, format("Saturated density quality must be between 0 and 1, entered value=[{:.4R}].", Quality)); @@ -3046,7 +3030,7 @@ namespace FluidProperties { if (!state.dataGlobal->WarmupFlag && ErrorFlag) { ++this->errors[(int)RefrigError::SatTempDensity].count; // send warning - if (this->errors[(int)RefrigError::SatTempDensity].count <= df->RefrigErrorLimitTest) { + if (this->errors[(int)RefrigError::SatTempDensity].count <= state.dataFluidProps->RefrigErrorLimitTest) { ShowSevereMessage( state, format("{}: Saturation temperature is out of range for refrigerant [{}] supplied data: **", routineName, this->Name)); ShowContinueError(state, @@ -3077,7 +3061,6 @@ namespace FluidProperties { ) { // Wrapper for RefrigProps::getSatDensity() - auto &df = state.dataFluidProps; if (RefrigIndex == 0) { if ((RefrigIndex = GetRefrigNum(state, refrigName)) == 0) { @@ -3087,7 +3070,7 @@ namespace FluidProperties { } } - return df->refrigs(RefrigIndex)->getSatDensity(state, Temperature, Quality, CalledFrom); + return state.dataFluidProps->refrigs(RefrigIndex)->getSatDensity(state, Temperature, Quality, CalledFrom); } //***************************************************************************** @@ -3137,7 +3120,6 @@ namespace FluidProperties { { // Wrapper for RefrigProps::getSpecificHeat() - auto &df = state.dataFluidProps; if (RefrigIndex == 0) { if ((RefrigIndex = GetRefrigNum(state, refrigName)) == 0) { @@ -3147,7 +3129,7 @@ namespace FluidProperties { } } - return df->refrigs(RefrigIndex)->getSatSpecificHeat(state, Temperature, Quality, CalledFrom); + return state.dataFluidProps->refrigs(RefrigIndex)->getSatSpecificHeat(state, Temperature, Quality, CalledFrom); } //***************************************************************************** @@ -3403,8 +3385,6 @@ namespace FluidProperties { // the enthalpy calculated from the pressure found static constexpr std::string_view routineName = "RefrigProps::getSupHeatPressure"; - auto &df = state.dataFluidProps; - // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 EnthalpyCheck; // recalculates enthalpy based on calculated pressure Real64 EnthalpyHigh; // Enthalpy value at interpolated pressure and high temperature @@ -3542,6 +3522,8 @@ namespace FluidProperties { } if (ErrCount > 0 && !state.dataGlobal->WarmupFlag) { + auto &df = state.dataFluidProps; + // send near saturation warning if flagged this->errors[(int)RefrigError::SatSupPress].count += CurSatErrCount; // send warning @@ -4593,7 +4575,7 @@ namespace FluidProperties { int GetGlycolRawNum(EnergyPlusData &state, std::string_view const glycolRawName) // carries in substance name { - auto &df = state.dataFluidProps; + auto const &df = state.dataFluidProps; auto found = std::find_if(df->glycolsRaw.begin(), df->glycolsRaw.end(), [glycolRawName](GlycolRawProps const *glycolRaw) { return glycolRaw->Name == glycolRawName; @@ -4607,9 +4589,8 @@ namespace FluidProperties { GlycolRawProps *GetGlycolRaw(EnergyPlusData &state, std::string_view const glycolRawName) { - auto &df = state.dataFluidProps; int glycolRawNum = GetGlycolRawNum(state, glycolRawName); - return (glycolRawNum > 0) ? df->glycolsRaw(glycolRawNum) : nullptr; + return (glycolRawNum > 0) ? state.dataFluidProps->glycolsRaw(glycolRawNum) : nullptr; } //***************************************************************************** @@ -4635,9 +4616,8 @@ namespace FluidProperties { // Check to see if this glycol shows up in the glycol data // ArrayLength = SIZE(GlycolData) - auto &df = state.dataFluidProps; - if (Idx > 0 && Idx <= df->glycols.isize()) { - return df->glycols(Idx)->Name; + if (Idx > 0 && Idx <= state.dataFluidProps->glycols.isize()) { + return state.dataFluidProps->glycols(Idx)->Name; } else { // return blank - error checking in calling proceedure return ""; } @@ -4779,8 +4759,6 @@ namespace FluidProperties { // Return value Real64 ReturnValue; - auto &df = state.dataFluidProps; - // error counters and dummy string bool ErrorFlag(false); // error flag for current call @@ -4811,6 +4789,8 @@ namespace FluidProperties { } if (ErrorFlag && (CalledFrom != "ReportAndTestRefrigerants")) { + auto &df = state.dataFluidProps; + ++df->TempRangeErrCountGetInterpolatedSatProp; // send warning if (df->TempRangeErrCountGetInterpolatedSatProp <= df->RefrigErrorLimitTest) { @@ -4832,7 +4812,7 @@ namespace FluidProperties { //***************************************************************************** - bool CheckFluidPropertyName(EnergyPlusData &state, + bool CheckFluidPropertyName(EnergyPlusData const &state, std::string const &name) // Name from input(?) to be checked against valid FluidPropertyNames { @@ -4842,7 +4822,7 @@ namespace FluidProperties { // PURPOSE OF THIS FUNCTION: // This function checks on an input fluid property to make sure it is valid. - auto &df = state.dataFluidProps; + auto const &df = state.dataFluidProps; auto foundRefrig = std::find_if(df->refrigs.begin(), df->refrigs.end(), [name](RefrigProps const *refrig) { return refrig->Name == name; }); if (foundRefrig != df->refrigs.end()) return true; @@ -4867,9 +4847,7 @@ namespace FluidProperties { bool NeedOrphanMessage = true; int NumUnusedRefrig = 0; - auto &df = state.dataFluidProps; - - for (auto const *refrig : df->refrigs) { + for (auto const *refrig : state.dataFluidProps->refrigs) { if (refrig->used) continue; if (refrig->Name == "STEAM") continue; if (NeedOrphanMessage && state.dataGlobal->DisplayUnusedObjects) { @@ -4886,7 +4864,7 @@ namespace FluidProperties { int NumUnusedGlycol = 0; - for (auto const *glycol : df->glycols) { + for (auto const *glycol : state.dataFluidProps->glycols) { if (glycol->used) continue; if (glycol->Name == "WATER") continue; if (glycol->Name == "ETHYLENEGLYCOL") continue; @@ -4913,18 +4891,18 @@ namespace FluidProperties { void GetFluidDensityTemperatureLimits(EnergyPlusData &state, int const FluidIndex, Real64 &MinTempLimit, Real64 &MaxTempLimit) { if (FluidIndex > 0) { - auto &df = state.dataFluidProps; - MinTempLimit = df->glycols(FluidIndex)->RhoLowTempValue; - MaxTempLimit = df->glycols(FluidIndex)->RhoHighTempValue; + auto const &df = state.dataFluidProps->glycols(FluidIndex); + MinTempLimit = df->RhoLowTempValue; + MaxTempLimit = df->RhoHighTempValue; } } void GetFluidSpecificHeatTemperatureLimits(EnergyPlusData &state, int const FluidIndex, Real64 &MinTempLimit, Real64 &MaxTempLimit) { if (FluidIndex > 0) { - auto &df = state.dataFluidProps; - MinTempLimit = df->glycols(FluidIndex)->CpLowTempValue; - MaxTempLimit = df->glycols(FluidIndex)->CpHighTempValue; + auto const &df = state.dataFluidProps->glycols(FluidIndex); + MinTempLimit = df->CpLowTempValue; + MaxTempLimit = df->CpHighTempValue; } } diff --git a/src/EnergyPlus/FluidProperties.hh b/src/EnergyPlus/FluidProperties.hh index 8beb5eb006f..2fd4cf1aeb8 100644 --- a/src/EnergyPlus/FluidProperties.hh +++ b/src/EnergyPlus/FluidProperties.hh @@ -564,7 +564,7 @@ namespace FluidProperties { int UpperBound // Valid values upper bound (set by calling program) ); - bool CheckFluidPropertyName(EnergyPlusData &state, + bool CheckFluidPropertyName(EnergyPlusData const &state, std::string const &NameToCheck); // Name from input(?) to be checked against valid FluidPropertyNames void ReportOrphanFluids(EnergyPlusData &state); diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 1f456af1569..6081df8a17f 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -2768,8 +2768,6 @@ namespace Furnaces { // Get fan data FanName = Alphas(7); - errFlag = false; - thisFurnace.fanType = static_cast(getEnumValue(HVAC::fanTypeNamesUC, Alphas(6))); if (thisFurnace.fanType == HVAC::FanType::OnOff || thisFurnace.fanType == HVAC::FanType::Constant) { @@ -4739,11 +4737,7 @@ namespace Furnaces { if (!state.dataGlobal->DoingSizing && state.dataFurnaces->MySecondOneTimeFlag(FurnaceNum)) { // sizing all done. check fan air flow rates - errFlag = false; thisFurnace.ActualFanVolFlowRate = state.dataFans->fans(thisFurnace.FanIndex)->maxAirFlowRate; - if (errFlag) { - ShowContinueError(state, format("...occurs in {} ={}", HVAC::unitarySysTypeNames[(int)thisFurnace.type], thisFurnace.Name)); - } if (thisFurnace.ActualFanVolFlowRate != DataSizing::AutoSize) { if (thisFurnace.DesignFanVolFlowRate > thisFurnace.ActualFanVolFlowRate) { ShowWarningError(state, @@ -5001,11 +4995,11 @@ namespace Furnaces { thisFurnace.CoolingSpeedRatio = thisFurnace.MaxCoolAirVolFlow / thisFurnace.ActualFanVolFlowRate; thisFurnace.NoHeatCoolSpeedRatio = thisFurnace.MaxNoCoolHeatAirVolFlow / thisFurnace.ActualFanVolFlowRate; } - std::string FanName; // used in warning messages if (dynamic_cast(state.dataFans->fans(thisFurnace.FanIndex))->powerRatioAtSpeedRatioCurveNum > 0) { if (thisFurnace.ActualFanVolFlowRate == thisFurnace.MaxHeatAirVolFlow && thisFurnace.ActualFanVolFlowRate == thisFurnace.MaxCoolAirVolFlow && thisFurnace.ActualFanVolFlowRate == thisFurnace.MaxNoCoolHeatAirVolFlow) { + std::string FanName = state.dataFans->fans(thisFurnace.FanIndex)->Name; ShowWarningError(state, format("{} \"{}\"", HVAC::unitarySysTypeNames[(int)thisFurnace.type], thisFurnace.Name)); ShowContinueError(state, format("...For fan type and name = {} \"{}\"", HVAC::fanTypeNames[(int)thisFurnace.fanType], FanName)); diff --git a/src/EnergyPlus/HVACInterfaceManager.cc b/src/EnergyPlus/HVACInterfaceManager.cc index d292194eacc..bc69d709fb9 100644 --- a/src/EnergyPlus/HVACInterfaceManager.cc +++ b/src/EnergyPlus/HVACInterfaceManager.cc @@ -123,7 +123,7 @@ void UpdateHVACInterface(EnergyPlusData &state, Real64 totDemandSideMaxAvail = 0.0; for (int demIn = 1; demIn <= state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).NumSupplyNodes; ++demIn) { int demInNode = state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).ZoneEquipSupplyNodeNum(demIn); - auto &node = state.dataLoopNodes->Node(demInNode); + auto const &node = state.dataLoopNodes->Node(demInNode); totDemandSideMassFlow += node.MassFlowRate; totDemandSideMinAvail += node.MassFlowRateMinAvail; totDemandSideMaxAvail += node.MassFlowRateMaxAvail; diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index bcf586817a3..8bc8708c0ed 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -2051,7 +2051,7 @@ void ResolveLockoutFlags(EnergyPlusData &state, bool &SimAir) // TRUE means air } } -void ResetHVACControl(EnergyPlusData &state) +void ResetHVACControl(EnergyPlusData const &state) { // SUBROUTINE INFORMATION: diff --git a/src/EnergyPlus/HVACManager.hh b/src/EnergyPlus/HVACManager.hh index d7fe431d612..89d35831ceb 100644 --- a/src/EnergyPlus/HVACManager.hh +++ b/src/EnergyPlus/HVACManager.hh @@ -97,7 +97,7 @@ namespace HVACManager { void ResolveLockoutFlags(EnergyPlusData &state, bool &SimAir); // TRUE means air loops must be (re)simulated - void ResetHVACControl(EnergyPlusData &state); + void ResetHVACControl(EnergyPlusData const &state); void ResetNodeData(EnergyPlusData &state); diff --git a/src/EnergyPlus/HVACStandAloneERV.cc b/src/EnergyPlus/HVACStandAloneERV.cc index 15438f65487..df323e14e3d 100644 --- a/src/EnergyPlus/HVACStandAloneERV.cc +++ b/src/EnergyPlus/HVACStandAloneERV.cc @@ -275,14 +275,13 @@ void GetStandAloneERV(EnergyPlusData &state) ShowContinueError(state, format("... occurs in {} \"{}\"", CurrentModuleObject, standAloneERV.Name)); ErrorsFound = true; } + standAloneERV.DesignHXVolFlowRate = HXSupAirFlowRate; standAloneERV.SupplyAirFanName = Alphas(4); GlobalNames::IntraObjUniquenessCheck( state, Alphas(4), CurrentModuleObject, cAlphaFields(4), state.dataHVACStandAloneERV->SupplyAirFanUniqueNames, ErrorsFound); - errFlag = false; - if ((standAloneERV.SupplyAirFanIndex = Fans::GetFanIndex(state, standAloneERV.SupplyAirFanName)) == 0) { ShowSevereItemNotFound(state, eoh, cAlphaFields(4), standAloneERV.SupplyAirFanName); ErrorsFound = true; @@ -297,7 +296,6 @@ void GetStandAloneERV(EnergyPlusData &state) standAloneERV.ExhaustAirFanName = Alphas(5); GlobalNames::IntraObjUniquenessCheck( state, Alphas(5), CurrentModuleObject, cAlphaFields(5), state.dataHVACStandAloneERV->ExhaustAirFanUniqueNames, ErrorsFound); - errFlag = false; if ((standAloneERV.ExhaustAirFanIndex = Fans::GetFanIndex(state, standAloneERV.ExhaustAirFanName)) == 0) { ShowSevereItemNotFound(state, eoh, cAlphaFields(5), standAloneERV.ExhaustAirFanName); @@ -1695,7 +1693,6 @@ int getEqIndex(EnergyPlusData &state, std::string_view CompName) for (int StandAloneERVNum = 1; StandAloneERVNum <= state.dataHVACStandAloneERV->NumStandAloneERVs; StandAloneERVNum++) { if (Util::SameString(CompName, state.dataHVACStandAloneERV->StandAloneERV(StandAloneERVNum).Name)) { return StandAloneERVNum; - break; } } return 0; diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index b12b3213faf..9be6d26b584 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -330,7 +330,6 @@ namespace HVACUnitaryBypassVAV { bool ErrorsFound(false); // Set to true if errors in input, fatal at end of routine bool DXErrorsFound(false); // Set to true if errors in get coil input Array1D_int OANodeNums(4); // Node numbers of OA mixer (OA, EA, RA, MA) - std::string HXDXCoolCoilName; // Name of DX cooling coil used with Heat Exchanger Assisted Cooling Coil bool DXCoilErrFlag; // used in warning messages Array1D_string Alphas(20, ""); @@ -754,7 +753,7 @@ namespace HVACUnitaryBypassVAV { ShowContinueError(state, format("...occurs in {} \"{}\"", thisCBVAV.UnitType, thisCBVAV.Name)); ErrorsFound = true; } else { - auto &newCoil = state.dataCoilCooingDX->coilCoolingDXs[thisCBVAV.DXCoolCoilIndexNum]; + auto const &newCoil = state.dataCoilCooingDX->coilCoolingDXs[thisCBVAV.DXCoolCoilIndexNum]; thisCBVAV.DXCoilInletNode = newCoil.evapInletNodeIndex; thisCBVAV.DXCoilOutletNode = newCoil.evapOutletNodeIndex; thisCBVAV.CondenserNodeNum = newCoil.condInletNodeIndex; @@ -2444,7 +2443,7 @@ namespace HVACUnitaryBypassVAV { } // now find the speed ratio for the found speednum auto f = [&state, CBVAVNum, SpeedNum, DesOutTemp](Real64 const SpeedRatio) { - auto &thisCBVAV = state.dataHVACUnitaryBypassVAV->CBVAV(CBVAVNum); + auto const &thisCBVAV = state.dataHVACUnitaryBypassVAV->CBVAV(CBVAVNum); // FUNCTION LOCAL VARIABLE DECLARATIONS: Real64 OutletAirTemp; // outlet air temperature [C] Real64 QZnReqCycling = 0.001; @@ -3429,7 +3428,7 @@ namespace HVACUnitaryBypassVAV { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 ZoneLoad = 0.0; // Total load in controlled zone [W] - int lastDayOfSim(0); // used during warmup to reset changeOverTimer since need to do same thing next warmup day + int lastDayOfSim(0); // used during warmup to reset changeOverTimer since need to do same thing next warmup day auto &cBVAV = state.dataHVACUnitaryBypassVAV->CBVAV(CBVAVNum); From a0f066f9a916f3acfceb72f9b089d0db674d3cab Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 08:26:45 -0400 Subject: [PATCH 140/164] Revert shortcut removal --- src/EnergyPlus/FluidProperties.cc | 48 +++++++++++++++++++------- src/EnergyPlus/HVACStandAloneERV.cc | 1 - src/EnergyPlus/HVACUnitaryBypassVAV.cc | 2 +- 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index be30d53ed39..f111ac104f0 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -1936,7 +1936,9 @@ namespace FluidProperties { // Most properties requested (e.g., Specific Heat) must be > 0 but the tables may // be set up for symmetry and not be limited to just valid values. - for (auto *glycol : state.dataFluidProps->glycols) { + auto const &df = state.dataFluidProps; + + for (auto *glycol : df->glycols) { if (glycol->CpDataPresent) { // check for lowest non-zero value by referencing temp data for (int IndexNum = 1; IndexNum <= glycol->NumCpTempPoints; ++IndexNum) { @@ -2038,7 +2040,9 @@ namespace FluidProperties { // Most properties requested (e.g., Specific Heat) must be > 0 but the tables may // be set up for symmetry and not be limited to just valid values. - for (auto *refrig : state.dataFluidProps->refrigs) { + auto const &df = state.dataFluidProps; + + for (auto *refrig : df->refrigs) { for (int IndexNum = 1; IndexNum <= refrig->NumPsPoints; ++IndexNum) { if (refrig->PsValues(IndexNum) <= 0.0) continue; refrig->PsLowPresIndex = IndexNum; @@ -2178,7 +2182,9 @@ namespace FluidProperties { Real64 Temperature; // Temperature to drive values Real64 ReturnValue; // Values returned from glycol functions - for (auto *glycol : state.dataFluidProps->glycols) { + auto const &df = state.dataFluidProps; + + for (auto *glycol : df->glycols) { int GlycolIndex = 0; // used in routine calls -- value is returned when first 0 // Lay out the basic values: @@ -2418,7 +2424,9 @@ namespace FluidProperties { Real64 Temperature; // Temperature to drive values Real64 ReturnValue; // Values returned from refrigerant functions - for (auto *refrig : state.dataFluidProps->refrigs) { + auto const &df = state.dataFluidProps; + + for (auto *refrig : df->refrigs) { // Lay out the basic values: if (!refrig->Name.empty()) { print(state.files.debug, "Refrigerant={}", refrig->Name); @@ -2769,8 +2777,10 @@ namespace FluidProperties { if (!state.dataGlobal->WarmupFlag && ErrorFlag) { ++this->errors[(int)RefrigError::SatTemp].count; + auto &df = state.dataFluidProps; + // send warning - if (this->errors[(int)RefrigError::SatTemp].count <= state.dataFluidProps->RefrigErrorLimitTest) { + if (this->errors[(int)RefrigError::SatTemp].count <= df->RefrigErrorLimitTest) { ShowSevereMessage( state, format("{}: Saturation temperature is out of range for refrigerant [{}] supplied data: **", routineName, this->Name)); ShowContinueError(state, @@ -2802,6 +2812,8 @@ namespace FluidProperties { { // Wrapper for RefrigProps::getSatPressure() + auto &df = state.dataFluidProps; + if (RefrigIndex == 0) { if ((RefrigIndex = GetRefrigNum(state, refrigName)) == 0) { ShowSevereError(state, format("Refrigerant \"{}\" not found, called from: {}", refrigName, CalledFrom)); @@ -2810,7 +2822,7 @@ namespace FluidProperties { } } - return state.dataFluidProps->refrigs(RefrigIndex)->getSatPressure(state, Temperature, CalledFrom); + return df->refrigs(RefrigIndex)->getSatPressure(state, Temperature, CalledFrom); } //***************************************************************************** @@ -2861,8 +2873,10 @@ namespace FluidProperties { if (!state.dataGlobal->WarmupFlag && ErrorFlag) { ++this->errors[(int)RefrigError::SatPress].count; + auto &df = state.dataFluidProps; + // send warning - if (this->errors[(int)RefrigError::SatPress].count <= state.dataFluidProps->RefrigErrorLimitTest) { + if (this->errors[(int)RefrigError::SatPress].count <= df->RefrigErrorLimitTest) { ShowSevereMessage(state, format("{}: Saturation pressure is out of range for refrigerant [{}] supplied data: **", routineName, this->Name)); ShowContinueError(state, @@ -2893,6 +2907,8 @@ namespace FluidProperties { { // Wrapper for RefrigProps::getSatTemperature() + auto &df = state.dataFluidProps; + if (RefrigIndex == 0) { if ((RefrigIndex = GetRefrigNum(state, refrigName)) == 0) { ShowSevereError(state, format("Refrigerant \"{}\" not found, called from: {}", refrigName, CalledFrom)); @@ -2901,7 +2917,7 @@ namespace FluidProperties { } } - return state.dataFluidProps->refrigs(RefrigIndex)->getSatTemperature(state, Pressure, CalledFrom); + return df->refrigs(RefrigIndex)->getSatTemperature(state, Pressure, CalledFrom); } //***************************************************************************** @@ -2942,6 +2958,8 @@ namespace FluidProperties { { // Wrapper for RefrigProps::getSatEnthalpy() + auto &df = state.dataFluidProps; + if (RefrigIndex == 0) { if ((RefrigIndex = GetRefrigNum(state, refrigName)) == 0) { ShowSevereError(state, format("Refrigerant \"{}\" not found, called from: {}", refrigName, CalledFrom)); @@ -2949,7 +2967,7 @@ namespace FluidProperties { return 0.0; } } - return state.dataFluidProps->refrigs(RefrigIndex)->getSatEnthalpy(state, Temperature, Quality, CalledFrom); + return df->refrigs(RefrigIndex)->getSatEnthalpy(state, Temperature, Quality, CalledFrom); } //***************************************************************************** @@ -3029,8 +3047,10 @@ namespace FluidProperties { if (!state.dataGlobal->WarmupFlag && ErrorFlag) { ++this->errors[(int)RefrigError::SatTempDensity].count; + auto &df = state.dataFluidProps; + // send warning - if (this->errors[(int)RefrigError::SatTempDensity].count <= state.dataFluidProps->RefrigErrorLimitTest) { + if (this->errors[(int)RefrigError::SatTempDensity].count <= df->RefrigErrorLimitTest) { ShowSevereMessage( state, format("{}: Saturation temperature is out of range for refrigerant [{}] supplied data: **", routineName, this->Name)); ShowContinueError(state, @@ -3062,6 +3082,8 @@ namespace FluidProperties { { // Wrapper for RefrigProps::getSatDensity() + auto &df = state.dataFluidProps; + if (RefrigIndex == 0) { if ((RefrigIndex = GetRefrigNum(state, refrigName)) == 0) { ShowSevereError(state, format("Refrigerant \"{}\" not found, called from: {}", refrigName, CalledFrom)); @@ -3070,7 +3092,7 @@ namespace FluidProperties { } } - return state.dataFluidProps->refrigs(RefrigIndex)->getSatDensity(state, Temperature, Quality, CalledFrom); + return df->refrigs(RefrigIndex)->getSatDensity(state, Temperature, Quality, CalledFrom); } //***************************************************************************** @@ -3121,6 +3143,8 @@ namespace FluidProperties { // Wrapper for RefrigProps::getSpecificHeat() + auto &df = state.dataFluidProps; + if (RefrigIndex == 0) { if ((RefrigIndex = GetRefrigNum(state, refrigName)) == 0) { ShowSevereError(state, format("Refrigerant \"{}\" not found, called from: {}", refrigName, CalledFrom)); @@ -3129,7 +3153,7 @@ namespace FluidProperties { } } - return state.dataFluidProps->refrigs(RefrigIndex)->getSatSpecificHeat(state, Temperature, Quality, CalledFrom); + return df->refrigs(RefrigIndex)->getSatSpecificHeat(state, Temperature, Quality, CalledFrom); } //***************************************************************************** diff --git a/src/EnergyPlus/HVACStandAloneERV.cc b/src/EnergyPlus/HVACStandAloneERV.cc index df323e14e3d..a606bccb8c8 100644 --- a/src/EnergyPlus/HVACStandAloneERV.cc +++ b/src/EnergyPlus/HVACStandAloneERV.cc @@ -275,7 +275,6 @@ void GetStandAloneERV(EnergyPlusData &state) ShowContinueError(state, format("... occurs in {} \"{}\"", CurrentModuleObject, standAloneERV.Name)); ErrorsFound = true; } - standAloneERV.DesignHXVolFlowRate = HXSupAirFlowRate; standAloneERV.SupplyAirFanName = Alphas(4); diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index 9be6d26b584..29014cd42a6 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -3428,7 +3428,7 @@ namespace HVACUnitaryBypassVAV { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 ZoneLoad = 0.0; // Total load in controlled zone [W] - int lastDayOfSim(0); // used during warmup to reset changeOverTimer since need to do same thing next warmup day + int lastDayOfSim(0); // used during warmup to reset changeOverTimer since need to do same thing next warmup day auto &cBVAV = state.dataHVACUnitaryBypassVAV->CBVAV(CBVAVNum); From 266dfa2096aebbe5ee5f8a7fd4c90fcebbebc50a Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 09:08:47 -0400 Subject: [PATCH 141/164] More reverts --- src/EnergyPlus/FluidProperties.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/EnergyPlus/FluidProperties.cc b/src/EnergyPlus/FluidProperties.cc index f111ac104f0..f42be6b6a47 100644 --- a/src/EnergyPlus/FluidProperties.cc +++ b/src/EnergyPlus/FluidProperties.cc @@ -2039,7 +2039,6 @@ namespace FluidProperties { // for the refrigerant properties. // Most properties requested (e.g., Specific Heat) must be > 0 but the tables may // be set up for symmetry and not be limited to just valid values. - auto const &df = state.dataFluidProps; for (auto *refrig : df->refrigs) { @@ -2811,7 +2810,6 @@ namespace FluidProperties { ) { // Wrapper for RefrigProps::getSatPressure() - auto &df = state.dataFluidProps; if (RefrigIndex == 0) { @@ -2906,7 +2904,6 @@ namespace FluidProperties { ) { // Wrapper for RefrigProps::getSatTemperature() - auto &df = state.dataFluidProps; if (RefrigIndex == 0) { @@ -2957,7 +2954,6 @@ namespace FluidProperties { ) { // Wrapper for RefrigProps::getSatEnthalpy() - auto &df = state.dataFluidProps; if (RefrigIndex == 0) { @@ -3081,7 +3077,6 @@ namespace FluidProperties { ) { // Wrapper for RefrigProps::getSatDensity() - auto &df = state.dataFluidProps; if (RefrigIndex == 0) { @@ -3142,7 +3137,6 @@ namespace FluidProperties { { // Wrapper for RefrigProps::getSpecificHeat() - auto &df = state.dataFluidProps; if (RefrigIndex == 0) { @@ -4613,8 +4607,9 @@ namespace FluidProperties { GlycolRawProps *GetGlycolRaw(EnergyPlusData &state, std::string_view const glycolRawName) { + auto &df = state.dataFluidProps; int glycolRawNum = GetGlycolRawNum(state, glycolRawName); - return (glycolRawNum > 0) ? state.dataFluidProps->glycolsRaw(glycolRawNum) : nullptr; + return (glycolRawNum > 0) ? df->glycolsRaw(glycolRawNum) : nullptr; } //***************************************************************************** @@ -4640,8 +4635,9 @@ namespace FluidProperties { // Check to see if this glycol shows up in the glycol data // ArrayLength = SIZE(GlycolData) - if (Idx > 0 && Idx <= state.dataFluidProps->glycols.isize()) { - return state.dataFluidProps->glycols(Idx)->Name; + auto &df = state.dataFluidProps; + if (Idx > 0 && Idx <= df->glycols.isize()) { + return df->glycols(Idx)->Name; } else { // return blank - error checking in calling proceedure return ""; } @@ -4871,7 +4867,9 @@ namespace FluidProperties { bool NeedOrphanMessage = true; int NumUnusedRefrig = 0; - for (auto const *refrig : state.dataFluidProps->refrigs) { + auto const &df = state.dataFluidProps; + + for (auto const *refrig : df->refrigs) { if (refrig->used) continue; if (refrig->Name == "STEAM") continue; if (NeedOrphanMessage && state.dataGlobal->DisplayUnusedObjects) { @@ -4888,7 +4886,7 @@ namespace FluidProperties { int NumUnusedGlycol = 0; - for (auto const *glycol : state.dataFluidProps->glycols) { + for (auto const *glycol : df->glycols) { if (glycol->used) continue; if (glycol->Name == "WATER") continue; if (glycol->Name == "ETHYLENEGLYCOL") continue; From 67ea60150b918b1ccb1fd15025c80ee9e7d659c8 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 21:42:57 -0400 Subject: [PATCH 142/164] Reduce scope --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 070dd4939fe..3d883fc1adc 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -14865,8 +14865,6 @@ void VRFCondenserEquipment::VRFOU_PipeLossC( using General::SolveRoot; int TUListNum; // index to TU List - int TUIndex; // Index to terminal unit - int CoilIndex; // index to coil in terminal unit int NumTUInList; // number of terminal units is list int NumIUActivated; // number of the used indoor units [-] @@ -14904,8 +14902,8 @@ void VRFCondenserEquipment::VRFOU_PipeLossC( Pipe_T_room = 0; NumIUActivated = 0; for (int NumTU = 1; NumTU <= NumTUInList; ++NumTU) { - TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); - CoilIndex = state.dataHVACVarRefFlow->VRFTU(TUIndex).CoolCoilIndex; + int TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); + int CoilIndex = state.dataHVACVarRefFlow->VRFTU(TUIndex).CoolCoilIndex; if (state.dataDXCoils->DXCoil(CoilIndex).TotalCoolingEnergyRate > 0.0) { Pipe_T_room = Pipe_T_room + state.dataDXCoils->DXCoil(CoilIndex).InletAirTemp; @@ -14994,8 +14992,6 @@ void VRFCondenserEquipment::VRFOU_PipeLossH( using General::SolveRoot; int TUListNum; // index to TU List - int TUIndex; // Index to terminal unit - int CoilIndex; // index to coil in terminal unit int NumTUInList; // number of terminal units is list int NumIUActivated; // number of the used indoor units [-] @@ -15045,8 +15041,8 @@ void VRFCondenserEquipment::VRFOU_PipeLossH( Pipe_T_room = 0; NumIUActivated = 0; for (int NumTU = 1; NumTU <= NumTUInList; ++NumTU) { - TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); - CoilIndex = state.dataHVACVarRefFlow->VRFTU(TUIndex).HeatCoilIndex; + int TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); + int CoilIndex = state.dataHVACVarRefFlow->VRFTU(TUIndex).HeatCoilIndex; if (state.dataDXCoils->DXCoil(CoilIndex).TotalHeatingEnergyRate > 0.0) { Pipe_T_room = Pipe_T_room + state.dataDXCoils->DXCoil(CoilIndex).InletAirTemp; @@ -15120,7 +15116,6 @@ void VRFTerminalUnitEquipment::CalcVRFSuppHeatingCoil(EnergyPlusData &state, Real64 constexpr Acc(1.e-3); // Accuracy of solver result // local variable declaration: - int SolFla; // Flag of solver, num iterations if >0, else error index Real64 SuppHeatCoilLoad; // load passed to supplemental heating coil (W) Real64 QActual; // actual coil output (W) Real64 PartLoadFrac; // temporary PLR variable @@ -15152,6 +15147,7 @@ void VRFTerminalUnitEquipment::CalcVRFSuppHeatingCoil(EnergyPlusData &state, WaterCoils::SimulateWaterCoilComponents( state, this->SuppHeatCoilName, FirstHVACIteration, this->SuppHeatCoilIndex, QActual, this->fanOp, PartLoadRatio); if (QActual > SuppHeatCoilLoad) { + int SolFla; // Flag of solver, num iterations if >0, else error index auto f = [&state, VRFTUNum, FirstHVACIteration, SuppHeatCoilLoad](Real64 const PartLoadFrac) { Real64 QActual = 0.0; // actual heating load delivered [W] Real64 mdot = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SuppHeatCoilFluidMaxFlow * PartLoadFrac; From c67cb127bbab8e124c5edb3394dc45cadb926fc9 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 21:43:19 -0400 Subject: [PATCH 143/164] Shadow variable --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 3d883fc1adc..ddce1d08d8d 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -14655,7 +14655,6 @@ void VRFCondenserEquipment::VRFHR_OU_HR_Mode(EnergyPlusData &state, Real64 Ncomp_new; Real64 Q_c_tot_temp; Real64 Q_c_OU_temp; - Real64 Tsuction_new; Real64 Tsuction_LB = state.dataEnvrn->OutDryBulbTemp - this->DiffOUTeTo; Real64 Tsuction_HB = Tsuction; From fafe1e7979de5559189bad2b04842b755833f4c2 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 21:45:09 -0400 Subject: [PATCH 144/164] Unused var --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index ddce1d08d8d..a1b8b3b6c0d 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -13810,7 +13810,6 @@ void VRFCondenserEquipment::VRFOU_CompCap( int CompSpdLB; // index for Compressor speed low bound [-] int CompSpdUB; // index for Compressor speed up bound [-] int NumOfCompSpdInput; // Number of compressor speed input by the user [-] - int NumTUInList; // number of terminal units is list int TUListNum; // index to TU List Real64 C_cap_operation; // Compressor capacity modification algorithm_modified Cap [-] Real64 P_suction; // Compressor suction pressure Pe' [Pa] @@ -13826,7 +13825,6 @@ void VRFCondenserEquipment::VRFOU_CompCap( // variable initializations: component index TUListNum = this->ZoneTUListPtr; - NumTUInList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).NumTUInList; RefPLow = this->refrig->PsLowPresValue; RefPHigh = this->refrig->PsHighPresValue; From 2e63ecffa3a8f8a5a70dc331f76f101e31abc235 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 22:11:19 -0400 Subject: [PATCH 145/164] Unused and const --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index a1b8b3b6c0d..5e9c347aa97 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -4346,7 +4346,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) vrfTU.DesignSpecMultispeedHPType = cAlphaArgs(20); vrfTU.DesignSpecMultispeedHPName = cAlphaArgs(21); vrfTU.DesignSpecMSHPIndex = UnitarySystems::getDesignSpecMSHPIndex(state, cAlphaArgs(21)); - auto &designSpecFan = state.dataUnitarySystems->designSpecMSHP[vrfTU.DesignSpecMSHPIndex]; + auto const &designSpecFan = state.dataUnitarySystems->designSpecMSHP[vrfTU.DesignSpecMSHPIndex]; if (vrfTU.DXCoolCoilType_Num == HVAC::CoilVRF_Cooling) { int NumSpeeds = designSpecFan.numOfSpeedCooling; vrfTU.NumOfSpeedCooling = NumSpeeds; @@ -5256,7 +5256,7 @@ void CheckVRFTUNodeConnections(EnergyPlusData &state, int const VRFTUNum, bool & { constexpr static std::string_view cTerminalUnitType("ZoneHVAC:TerminalUnit:VariableRefrigerantFlow"); - auto &nodeID = state.dataLoopNodes->NodeID; + auto const &nodeID = state.dataLoopNodes->NodeID; auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum); std::string const cTUName(vrfTU.Name); bool const CoolingCoilPresent = vrfTU.CoolingCoilPresent; @@ -9153,7 +9153,7 @@ void VRFTerminalUnitEquipment::ControlVRFToLoad(EnergyPlusData &state, // set supplemental heating coil calculation if the condition requires if (this->SuppHeatingCoilPresent) { if (this->isSetPointControlled) { - auto &thisSuppHeatCoilAirInletNode = state.dataLoopNodes->Node(this->SuppHeatCoilAirInletNode); + auto const &thisSuppHeatCoilAirInletNode = state.dataLoopNodes->Node(this->SuppHeatCoilAirInletNode); if (this->suppTempSetPoint > thisSuppHeatCoilAirInletNode.Temp) { Real64 mDot = thisSuppHeatCoilAirInletNode.MassFlowRate; Real64 Tin = thisSuppHeatCoilAirInletNode.Temp; @@ -10187,7 +10187,7 @@ void InitializeOperatingMode(EnergyPlusData &state, if (state.dataHVACVarRefFlow->VRF(VRFCond).ThermostatPriority == ThermostatCtrlType::ThermostatOffsetPriority) { // for TSTATPriority, just check difference between zone temp and thermostat setpoint if (ThisZoneNum > 0) { - auto &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ThisZoneNum); + auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ThisZoneNum); SPTempHi = state.dataHeatBalFanSys->ZoneThermostatSetPointHi(ThisZoneNum); SPTempLo = state.dataHeatBalFanSys->ZoneThermostatSetPointLo(ThisZoneNum); @@ -10844,7 +10844,7 @@ void getVRFTUZoneLoad( bool getVRFTUNodeNumber(EnergyPlusData &state, int const nodeNumber) { for (int vrfTUIndex = 1; vrfTUIndex <= state.dataHVACVarRefFlow->NumVRFTU; ++vrfTUIndex) { - auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(vrfTUIndex); + auto const &vrfTU = state.dataHVACVarRefFlow->VRFTU(vrfTUIndex); bool noVrfTUOutdoorAir = false; if (vrfTU.CoolOutAirVolFlow == 0 && vrfTU.HeatOutAirVolFlow == 0 && vrfTU.NoCoolHeatOutAirVolFlow == 0) { @@ -12493,18 +12493,18 @@ void VRFTerminalUnitEquipment::ControlVRF_FluidTCtrl(EnergyPlusData &state, if (!DXCoolingCoilOprCtrl) PartLoadRatio = 0.0; this->CalcVRF_FluidTCtrl(state, VRFTUNum, FirstHVACIteration, PartLoadRatio, FullOutput, OnOffAirFlowRatio, SuppHeatCoilLoad); if (this->CoolingCoilPresent) { - auto &thisAirInNode = state.dataLoopNodes->Node(state.dataDXCoils->DXCoil(this->CoolCoilIndex).AirInNode); + auto const &thisAirInNode = state.dataLoopNodes->Node(state.dataDXCoils->DXCoil(this->CoolCoilIndex).AirInNode); this->coilInNodeT = thisAirInNode.Temp; this->coilInNodeW = thisAirInNode.HumRat; } else { - auto &thisAirInNode = state.dataLoopNodes->Node(state.dataDXCoils->DXCoil(this->HeatCoilIndex).AirInNode); + auto const &thisAirInNode = state.dataLoopNodes->Node(state.dataDXCoils->DXCoil(this->HeatCoilIndex).AirInNode); this->coilInNodeT = thisAirInNode.Temp; this->coilInNodeW = thisAirInNode.HumRat; } // set supplemental heating coil calculation if the condition requires if (this->SuppHeatingCoilPresent) { - auto &thisSuppHeatCoilAirInletNode = state.dataLoopNodes->Node(this->SuppHeatCoilAirInletNode); + auto const &thisSuppHeatCoilAirInletNode = state.dataLoopNodes->Node(this->SuppHeatCoilAirInletNode); if (((QZnReq > HVAC::SmallLoad && QZnReq > FullOutput) || (((QZnReq - NoCompOutput) > HVAC::SmallLoad) && QZnReq <= 0.0)) || (this->isSetPointControlled && this->suppTempSetPoint > thisSuppHeatCoilAirInletNode.Temp)) { Real64 ZoneLoad = 0.0; @@ -13004,7 +13004,6 @@ Real64 VRFTerminalUnitEquipment::CalVRFTUAirFlowRate_FluidTCtrl(EnergyPlusData & using SingleDuct::SimATMixer; int constexpr Mode(1); // Performance mode for MultiMode DX coil. Always 1 for other coil types - int OAMixNode; // index to the mix node of OA mixer int VRFCond; // index to VRF condenser int VRFInletNode; // VRF inlet node number Real64 FanSpdRatioBase; // baseline FanSpdRatio for VRFTUAirFlowResidual @@ -13038,7 +13037,7 @@ Real64 VRFTerminalUnitEquipment::CalVRFTUAirFlowRate_FluidTCtrl(EnergyPlusData & if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).OAMixerUsed) { MixedAir::SimOAMixer( state, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).OAMixerName, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).OAMixerIndex); - OAMixNode = state.dataMixedAir->OAMixer(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).OAMixerIndex).MixNode; + int OAMixNode = state.dataMixedAir->OAMixer(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).OAMixerIndex).MixNode; Tin = state.dataLoopNodes->Node(OAMixNode).Temp; Win = state.dataLoopNodes->Node(OAMixNode).HumRat; } @@ -13668,7 +13667,6 @@ void VRFCondenserEquipment::VRFOU_CompSpd( int CompSpdLB; // index for Compressor speed low bound [-] int CompSpdUB; // index for Compressor speed up bound [-] int NumOfCompSpdInput; // Number of compressor speed input by the user [-] - int NumTUInList; // number of terminal units is list int TUListNum; // index to TU List Real64 C_cap_operation; // Compressor capacity modification algorithm_modified Cap [-] Real64 P_suction; // Compressor suction pressure Pe' [Pa] @@ -13685,7 +13683,6 @@ void VRFCondenserEquipment::VRFOU_CompSpd( // variable initializations: component index TUListNum = this->ZoneTUListPtr; - NumTUInList = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).NumTUInList; RefPLow = this->refrig->PsLowPresValue; RefPHigh = this->refrig->PsHighPresValue; From d0d4b8522acd97ddf947528f15d56bb3ca0f5df0 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 22:16:59 -0400 Subject: [PATCH 146/164] Unused and reduce scope --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 5e9c347aa97..2ce473122d1 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -12421,10 +12421,8 @@ void VRFTerminalUnitEquipment::ControlVRF_FluidTCtrl(EnergyPlusData &state, Real64 FullOutput; // unit full output when compressor is operating [W] Real64 TempOutput; // unit output when iteration limit exceeded [W] Real64 NoCompOutput; // output when no active compressor [W] - int SolFla; // Flag of RegulaFalsi solver Real64 TempMinPLR; // min PLR used in Regula Falsi call Real64 TempMaxPLR; // max PLR used in Regula Falsi call - bool ContinueIter; // used when convergence is an issue int VRFCond; // index to VRF condenser int IndexToTUInTUList; // index to TU in specific list for the VRF system int TUListIndex; // index to TU list for this VRF system @@ -12607,6 +12605,7 @@ void VRFTerminalUnitEquipment::ControlVRF_FluidTCtrl(EnergyPlusData &state, // The coil will not operate at PLR=0 or PLR=1, calculate the operating part-load ratio if ((VRFHeatingMode || HRHeatingMode) || ((VRFCoolingMode && DXCoolingCoilOprCtrl) || HRCoolingMode)) { + int SolFla; // Flag of RegulaFalsi solver auto f = [&state, VRFTUNum, FirstHVACIteration, QZnReq, OnOffAirFlowRatio](Real64 const PartLoadRatio) { Real64 QZnReqTemp = QZnReq; // denominator representing zone load (W) Real64 ActualOutput; // delivered capacity of VRF terminal unit @@ -12636,7 +12635,7 @@ void VRFTerminalUnitEquipment::ControlVRF_FluidTCtrl(EnergyPlusData &state, if (SolFla == -1) { // Very low loads may not converge quickly. Tighten PLR boundary and try again. TempMaxPLR = -0.1; - ContinueIter = true; + bool ContinueIter = true; while (ContinueIter && TempMaxPLR < 1.0) { TempMaxPLR += 0.1; @@ -13667,7 +13666,6 @@ void VRFCondenserEquipment::VRFOU_CompSpd( int CompSpdLB; // index for Compressor speed low bound [-] int CompSpdUB; // index for Compressor speed up bound [-] int NumOfCompSpdInput; // Number of compressor speed input by the user [-] - int TUListNum; // index to TU List Real64 C_cap_operation; // Compressor capacity modification algorithm_modified Cap [-] Real64 P_suction; // Compressor suction pressure Pe' [Pa] Real64 Q_evap_req; // Required evaporative capacity [W] @@ -13682,7 +13680,6 @@ void VRFCondenserEquipment::VRFOU_CompSpd( static constexpr std::string_view RoutineName("VRFOU_CompSpd"); // variable initializations: component index - TUListNum = this->ZoneTUListPtr; RefPLow = this->refrig->PsLowPresValue; RefPHigh = this->refrig->PsHighPresValue; @@ -13807,7 +13804,6 @@ void VRFCondenserEquipment::VRFOU_CompCap( int CompSpdLB; // index for Compressor speed low bound [-] int CompSpdUB; // index for Compressor speed up bound [-] int NumOfCompSpdInput; // Number of compressor speed input by the user [-] - int TUListNum; // index to TU List Real64 C_cap_operation; // Compressor capacity modification algorithm_modified Cap [-] Real64 P_suction; // Compressor suction pressure Pe' [Pa] Real64 Q_evap_sys; // evaporative capacity [W] @@ -13821,7 +13817,6 @@ void VRFCondenserEquipment::VRFOU_CompCap( static constexpr std::string_view RoutineName("VRFOU_CompCap"); // variable initializations: component index - TUListNum = this->ZoneTUListPtr; RefPLow = this->refrig->PsLowPresValue; RefPHigh = this->refrig->PsHighPresValue; From f6b6beee8f43773dcfeae127e2cf3eaf4218cc91 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 22:20:55 -0400 Subject: [PATCH 147/164] Reassigned OK to remove? --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 2ce473122d1..64d9030a993 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -11793,7 +11793,6 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) // Evaporator (IU side) operational parameters Pevap = this->refrig->getSatPressure(state, this->IUEvaporatingTemp, RoutineName); Psuction = Pevap; - Tsuction = this->IUEvaporatingTemp; this->EvaporatingTemp = this->IUEvaporatingTemp; // Condenser (OU side) operation ranges From 4e064bbcb750b5824f1f0952a5f6d60ea3a92850 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 22:29:01 -0400 Subject: [PATCH 148/164] Unused/reduce --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 64d9030a993..7e658376d2e 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -174,13 +174,6 @@ void SimulateVRF(EnergyPlusData &state, } CompIndex = VRFTUNum; - // suppress unused warnings temporarily until VRF inherits HVACSystemData - if (OAUnitNum > 0) { - bool tmpFlag = false; - if (OAUCoilOutTemp > 0.0) tmpFlag = true; - if (ZoneEquipment) tmpFlag = true; - } - } else { VRFTUNum = CompIndex; if (VRFTUNum > state.dataHVACVarRefFlow->NumVRFTU || VRFTUNum < 1) { @@ -7593,7 +7586,6 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) EqSizing.OAVolFlow = 0.0; VRFCond = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).VRFSysNum; - IsAutoSize = false; MaxCoolAirVolFlowDes = 0.0; MaxCoolAirVolFlowUser = 0.0; MaxHeatAirVolFlowDes = 0.0; From 72604802972ac0510456a7f96c2efc29789876b1 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 22:39:41 -0400 Subject: [PATCH 149/164] Unused and reduce scope --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 7e658376d2e..f97de97cf1e 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -10028,7 +10028,6 @@ void InitializeOperatingMode(EnergyPlusData &state, Real64 SPTempLo; // thermostat setpoint low int NumTU; // loop counter, number of TU's in list int TUIndex; // index to TU - int ThisZoneNum; // index to zone number where TU is located Real64 ZoneLoad; // current zone load (W) Real64 LoadToCoolingSP; // thermostat load to cooling setpoint (W) Real64 LoadToHeatingSP; // thermostat load to heating setpoint (W) @@ -10059,7 +10058,6 @@ void InitializeOperatingMode(EnergyPlusData &state, // make sure TU's have been sized before looping through each one of them to determine operating mode if (any(state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).TerminalUnitNotSizedYet)) break; TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); - ThisZoneNum = state.dataHVACVarRefFlow->VRFTU(TUIndex).ZoneNum; // check to see if coil is present if (state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).CoolingCoilPresent(NumTU)) { @@ -10174,6 +10172,7 @@ void InitializeOperatingMode(EnergyPlusData &state, // Constant fan systems are tested for ventilation load to determine if load to be met changes. // more logic may be needed here, what is the OA flow rate, was last mode heating or cooling, what control is used, etc... + int ThisZoneNum = state.dataHVACVarRefFlow->VRFTU(TUIndex).ZoneNum; getVRFTUZoneLoad(state, TUIndex, ZoneLoad, LoadToHeatingSP, LoadToCoolingSP, true); if (state.dataHVACVarRefFlow->VRF(VRFCond).ThermostatPriority == ThermostatCtrlType::ThermostatOffsetPriority) { @@ -10936,7 +10935,6 @@ void VRFTerminalUnitEquipment::CalcVRFIUVariableTeTc(EnergyPlusData &state, int TUListIndex; // index to TU list for this VRF system int VRFNum; // index to VRF that the VRF Terminal Unit serves int VRFInletNode; // VRF inlet node number - int ZoneIndex; // index to zone where the VRF Terminal Unit resides Real64 BFC; // Bypass factor at the cooling mode (-) Real64 BFH; // Bypass factor at the heating mode (-) Real64 C1Tevap; // Coefficient for indoor unit coil evaporating temperature curve (-) @@ -10967,7 +10965,6 @@ void VRFTerminalUnitEquipment::CalcVRFIUVariableTeTc(EnergyPlusData &state, // Get the equipment/zone index corresponding to the VRFTU CoolCoilNum = this->CoolCoilIndex; HeatCoilNum = this->HeatCoilIndex; - ZoneIndex = this->ZoneNum; VRFNum = this->VRFSysNum; TUListIndex = state.dataHVACVarRefFlow->VRF(VRFNum).ZoneTUListPtr; IndexToTUInTUList = this->IndexToTUInTUList; From dace1934722d6cdc7ea5ebef4436b6beb95ee15e Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 22:49:46 -0400 Subject: [PATCH 150/164] Assigned value before used --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index f97de97cf1e..9d0d816fae1 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -11340,8 +11340,6 @@ void VRFCondenserEquipment::CalcVRFCondenser_FluidTCtrl(EnergyPlusData &state) // Evaporator (IU side) operational parameters Pevap = this->refrig->getSatPressure(state, this->IUEvaporatingTemp, RoutineName); Psuction = Pevap; - Tsuction = this->IUEvaporatingTemp; // GetSatTemperatureRefrig(state, this->RefrigerantName, max( min( Psuction, RefPHigh ), RefPLow ), - // RefrigerantIndex, RoutineName ); this->EvaporatingTemp = this->IUEvaporatingTemp; // GetSatTemperatureRefrig(state, this->RefrigerantName, max( min( Pevap, RefPHigh ), RefPLow // ), RefrigerantIndex, RoutineName ); From 2d95252173577997e4526489dbb759c099852c2f Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 22:56:17 -0400 Subject: [PATCH 151/164] REduce scope HR --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 9d0d816fae1..d936d4abd7d 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -357,9 +357,6 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) static constexpr std::string_view RoutineName("VRFCondenser"); int NumTU; // loop counter - int TUIndex; // Index to terminal unit - int CoolCoilIndex; // index to cooling coil in terminal unit - int HeatCoilIndex; // index to heating coil in terminal unit Real64 TotCoolCapTempModFac; // cooling CAPFT curve output Real64 TotHeatCapTempModFac; // heating CAPFT curve output @@ -376,7 +373,6 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) Real64 CoolOABoundary; // output of cooling boundary curve (outdoor temperature, C) Real64 HeatOABoundary; // output of heating boundary curve (outdoor temperature, C) Real64 EIRFPLRModFac; // EIRFPLR curve output - int Stage; // used for crankcase heater power calculation Real64 UpperStageCompressorRatio; // used for crankcase heater power calculation Real64 RhoAir; // Density of air [kg/m3] Real64 RhoWater; // Density of water [kg/m3] @@ -392,11 +388,9 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) Real64 InputPowerMultiplier; // Multiplier for power when system is in defrost Real64 LoadDueToDefrost; // Additional load due to defrost Real64 DefrostEIRTempModFac; // EIR modifier for defrost (function of entering drybulb, outside wetbulb) - int HRCAPFT; // index to heat recovery CAPFTCool curve Real64 HRCAPFTConst; // stead-state capacity fraction Real64 HRInitialCapFrac; // Fractional cooling degradation at the start of heat recovery from cooling mode Real64 HRCapTC; // Time constant used to recover from initial degradation in cooling heat recovery - int HREIRFT; // Index to cool EIR as a function of temperature curve for heat recovery Real64 HREIRFTConst; // stead-state EIR fraction Real64 HRInitialEIRFrac; // Fractional cooling degradation at the start of heat recovery from cooling mode Real64 HREIRTC; // Time constant used to recover from initial degradation in cooling heat recovery @@ -549,9 +543,9 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) // loop through TU's and calculate average inlet conditions for active coils for (NumTU = 1; NumTU <= NumTUInList; ++NumTU) { - TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); - CoolCoilIndex = state.dataHVACVarRefFlow->VRFTU(TUIndex).CoolCoilIndex; - HeatCoilIndex = state.dataHVACVarRefFlow->VRFTU(TUIndex).HeatCoilIndex; + int TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); + int CoolCoilIndex = state.dataHVACVarRefFlow->VRFTU(TUIndex).CoolCoilIndex; + int HeatCoilIndex = state.dataHVACVarRefFlow->VRFTU(TUIndex).HeatCoilIndex; TUParasiticPower += state.dataHVACVarRefFlow->VRFTU(TUIndex).ParasiticCoolElecPower + state.dataHVACVarRefFlow->VRFTU(TUIndex).ParasiticHeatElecPower; TUFanPower += state.dataHVACVarRefFlow->VRFTU(TUIndex).FanPower; @@ -948,7 +942,7 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) } vrf.HRCoolingActive = true; vrf.HRHeatingActive = false; - HRCAPFT = vrf.HRCAPFTCool; // Index to cool capacity as a function of temperature\PLR curve for heat recovery + int HRCAPFT = vrf.HRCAPFTCool; // Index to cool capacity as a function of temperature\PLR curve for heat recovery if (HRCAPFT > 0) { // VRF(VRFCond)%HRCAPFTCoolConst = 0.9d0 ! initialized to 0.9 if (state.dataCurveManager->PerfCurve(vrf.HRCAPFTCool)->numDims == 2) { // Curve type for HRCAPFTCool @@ -961,7 +955,7 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) HRInitialCapFrac = vrf.HRInitialCoolCapFrac; // Fractional cooling degradation at the start of heat recovery from cooling mode HRCapTC = vrf.HRCoolCapTC; // Time constant used to recover from initial degradation in cooling heat recovery - HREIRFT = vrf.HREIRFTCool; // Index to cool EIR as a function of temperature curve for heat recovery + int HREIRFT = vrf.HREIRFTCool; // Index to cool EIR as a function of temperature curve for heat recovery if (HREIRFT > 0) { // VRF(VRFCond)%HREIRFTCoolConst = 1.1d0 ! initialized to 1.1 if (state.dataCurveManager->PerfCurve(vrf.HREIRFTCool)->numDims == 2) { // Curve type for HREIRFTCool @@ -979,7 +973,7 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) } vrf.HRCoolingActive = false; vrf.HRHeatingActive = true; - HRCAPFT = vrf.HRCAPFTHeat; // Index to heat capacity as a function of temperature\PLR curve for heat recovery + int HRCAPFT = vrf.HRCAPFTHeat; // Index to heat capacity as a function of temperature\PLR curve for heat recovery if (HRCAPFT > 0) { // VRF(VRFCond)%HRCAPFTHeatConst = 1.1d0 ! initialized to 1.1 if (state.dataCurveManager->PerfCurve(vrf.HRCAPFTHeat)->numDims == 2) { // Curve type for HRCAPFTCool @@ -1002,7 +996,7 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) HRInitialCapFrac = vrf.HRInitialHeatCapFrac; // Fractional heating degradation at the start of heat recovery from cooling mode HRCapTC = vrf.HRHeatCapTC; // Time constant used to recover from initial degradation in heating heat recovery - HREIRFT = vrf.HREIRFTHeat; // Index to cool EIR as a function of temperature curve for heat recovery + int HREIRFT = vrf.HREIRFTHeat; // Index to cool EIR as a function of temperature curve for heat recovery if (HREIRFT > 0) { // VRF(VRFCond)%HREIRFTCoolConst = 1.1d0 ! initialized to 1.1 if (state.dataCurveManager->PerfCurve(vrf.HREIRFTHeat)->numDims == 2) { // Curve type for HREIRFTHeat @@ -1210,7 +1204,7 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) vrf.CrankCaseHeaterPower = vrf.CCHeaterPower * (1.0 - VRFRTF); if (vrf.NumCompressors > 1) { UpperStageCompressorRatio = (1.0 - vrf.CompressorSizeRatio) / (vrf.NumCompressors - 1); - for (Stage = 1; Stage <= vrf.NumCompressors - 2; ++Stage) { + for (int Stage = 1; Stage <= vrf.NumCompressors - 2; ++Stage) { if (vrf.VRFCondPLR < (vrf.CompressorSizeRatio + Stage * UpperStageCompressorRatio)) { vrf.CrankCaseHeaterPower += vrf.CCHeaterPower; } From 19e73164f960ab9f52bbb160212cff8879c1d686 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 23:03:03 -0400 Subject: [PATCH 152/164] Reduce scope and shadow --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index d936d4abd7d..e8d5215b03b 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -356,7 +356,7 @@ void CalcVRFCondenser(EnergyPlusData &state, int const VRFCond) static constexpr std::string_view RoutineName("VRFCondenser"); - int NumTU; // loop counter + int NumTU; // loop counter Real64 TotCoolCapTempModFac; // cooling CAPFT curve output Real64 TotHeatCapTempModFac; // heating CAPFT curve output @@ -7542,8 +7542,6 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) // HeatingCapacitySizing, etc.) bool PrintFlag = true; // TRUE when sizing information is reported in the eio file int zoneHVACIndex; // index of zoneHVAC equipment sizing specification - int SAFMethod(0); // supply air flow rate sizing method (SupplyAirFlowRate, FlowPerFloorArea, FractionOfAutosizedCoolingAirflow, - // FractionOfAutosizedHeatingAirflow ...) int CapSizingMethod(0); // capacity sizing methods (HeatingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedCoolingCapacity, and // FractionOfAutosizedHeatingCapacity ) @@ -7662,7 +7660,9 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) SizingMethod = CoolingAirflowSizing; PrintFlag = true; bool errorsFound = false; - SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingSAFMethod; + // supply air flow rate sizing method (SupplyAirFlowRate, FlowPerFloorArea, FractionOfAutosizedCoolingAirflow, + // FractionOfAutosizedHeatingAirflow ...) + int SAFMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingSAFMethod; EqSizing.SizingMethod(SizingMethod) = SAFMethod; if (SAFMethod == SupplyAirFlowRate || SAFMethod == FlowPerFloorArea || SAFMethod == FractionOfAutosizedCoolingAirflow) { if (SAFMethod == SupplyAirFlowRate) { @@ -7772,7 +7772,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) } else { TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; } - bool errorsFound = false; + errorsFound = false; HeatingAirFlowSizer sizingHeatingAirFlow; sizingHeatingAirFlow.overrideSizingString(SizingString); // sizingHeatingAirFlow.setHVACSizingIndexData(FanCoil(FanCoilNum).HVACSizingIndex); @@ -7787,7 +7787,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) if (state.dataSize->ZoneHVACSizing(zoneHVACIndex).HeatingCapMethod == FractionOfAutosizedHeatingCapacity) { state.dataSize->DataFracOfAutosizedHeatingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).ScaledHeatingCapacity; } - bool errorsFound = false; + errorsFound = false; HeatingCapacitySizer sizerHeatingCapacity; sizerHeatingCapacity.overrideSizingString(SizingString); sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); @@ -7913,7 +7913,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) } else { TempSize = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxNoCoolHeatAirVolFlow; } - bool errorsFound = false; + errorsFound = false; HeatingAirFlowSizer sizingNoHeatingAirFlow; sizingNoHeatingAirFlow.overrideSizingString(SizingString); // sizingNoHeatingAirFlow.setHVACSizingIndexData(FanCoil(FanCoilNum).HVACSizingIndex); From e16708491f3af2fe593b3cb7e0357be6a0d44861 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 23:10:11 -0400 Subject: [PATCH 153/164] Reduce scope --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index e8d5215b03b..03d90e48eee 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -3258,8 +3258,6 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) for (int VRFTUNum = 1; VRFTUNum <= state.dataHVACVarRefFlow->NumVRFTU; ++VRFTUNum) { // initialize local node number variables - int FanInletNodeNum = 0; - int FanOutletNodeNum = 0; int CCoilInletNodeNum = 0; int CCoilOutletNodeNum = 0; int HCoilInletNodeNum = 0; @@ -3422,8 +3420,8 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) Real64 FanVolFlowRate = fan->maxAirFlowRate; thisVrfTU.ActualFanVolFlowRate = FanVolFlowRate; - FanInletNodeNum = fan->inletNodeNum; - FanOutletNodeNum = fan->outletNodeNum; + int FanInletNodeNum = fan->inletNodeNum; + int FanOutletNodeNum = fan->outletNodeNum; thisVrfTU.FanAvailSchedPtr = fan->availSchedNum; // Check fan's schedule for cycling fan operation if constant volume fan is used @@ -7497,13 +7495,9 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) static constexpr std::string_view RoutineName("SizeVRF: "); // include trailing blank space auto &CheckVRFCombinationRatio = state.dataHVACVarRefFlow->CheckVRFCombinationRatio; - bool FoundAll; // temporary variable used to check all terminal units - bool errFlag; // temporary variable used for error checking Real64 TUCoolingCapacity; // total terminal unit cooling capacity Real64 TUHeatingCapacity; // total terminal unit heating capacity int VRFCond; // index to VRF condenser - int TUListNum; // index to terminal unit list - int TUIndex; // index to terminal unit int NumTU; // DO Loop index counter Real64 OnOffAirFlowRat; // temporary variable used when sizing coils Real64 DXCoilCap; // capacity of DX cooling coil (W) @@ -8420,10 +8414,11 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) // ZoneEqDXCoil = .FALSE. TUCoolingCapacity = 0.0; TUHeatingCapacity = 0.0; - FoundAll = true; - TUListNum = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).TUListIndex; + bool FoundAll = true; + bool errFlag; // temporary variable used for error checking + int TUListNum = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).TUListIndex; for (NumTU = 1; NumTU <= state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).NumTUInList; ++NumTU) { - TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); + int TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); if (state.dataHVACVarRefFlow->VRFTU(TUIndex).CoolCoilIndex > 0) { DXCoilCap = DXCoils::GetCoilCapacityByIndexType(state, state.dataHVACVarRefFlow->VRFTU(TUIndex).CoolCoilIndex, From be8f7962fbd4c88753b7862f32ea25dc64d56b45 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 23:19:52 -0400 Subject: [PATCH 154/164] Reduce scope --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 03d90e48eee..07ca057fb92 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -7498,7 +7498,6 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) Real64 TUCoolingCapacity; // total terminal unit cooling capacity Real64 TUHeatingCapacity; // total terminal unit heating capacity int VRFCond; // index to VRF condenser - int NumTU; // DO Loop index counter Real64 OnOffAirFlowRat; // temporary variable used when sizing coils Real64 DXCoilCap; // capacity of DX cooling coil (W) bool IsAutoSize; // Indicator to autosize @@ -7532,12 +7531,9 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) std::string SizingString; // input field sizing description (e.g., Nominal Capacity) Real64 TempSize; // autosized value of coil input field int FieldNum = 2; // IDD numeric field number where input field description is found - int SizingMethod; // Integer representation of sizing method name (e.g., CoolingAirflowSizing, HeatingAirflowSizing, CoolingCapacitySizing, - // HeatingCapacitySizing, etc.) - bool PrintFlag = true; // TRUE when sizing information is reported in the eio file - int zoneHVACIndex; // index of zoneHVAC equipment sizing specification - int CapSizingMethod(0); // capacity sizing methods (HeatingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedCoolingCapacity, and - // FractionOfAutosizedHeatingCapacity ) + int SizingMethod; // Integer representation of sizing method name (e.g., CoolingAirflowSizing, HeatingAirflowSizing, CoolingCapacitySizing, + // HeatingCapacitySizing, etc.) + bool PrintFlag = true; // TRUE when sizing information is reported in the eio file auto &ZoneEqSizing = state.dataSize->ZoneEqSizing; @@ -7649,7 +7645,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) state.dataSize->CurZoneEqNum); } - zoneHVACIndex = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HVACSizingIndex; + int zoneHVACIndex = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HVACSizingIndex; SizingMethod = CoolingAirflowSizing; PrintFlag = true; @@ -7926,7 +7922,9 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) // initialize capacity sizing variables: cooling SizingMethod = CoolingCapacitySizing; - CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingCapMethod; + // capacity sizing methods (HeatingDesignCapacity, CapacityPerFloorArea, FractionOfAutosizedCoolingCapacity, and + // FractionOfAutosizedHeatingCapacity ) + int CapSizingMethod = state.dataSize->ZoneHVACSizing(zoneHVACIndex).CoolingCapMethod; EqSizing.SizingMethod(SizingMethod) = CapSizingMethod; if (CapSizingMethod == CoolingDesignCapacity || CapSizingMethod == CapacityPerFloorArea || CapSizingMethod == FractionOfAutosizedCoolingCapacity) { @@ -8417,7 +8415,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) bool FoundAll = true; bool errFlag; // temporary variable used for error checking int TUListNum = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).TUListIndex; - for (NumTU = 1; NumTU <= state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).NumTUInList; ++NumTU) { + for (int NumTU = 1; NumTU <= state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).NumTUInList; ++NumTU) { int TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); if (state.dataHVACVarRefFlow->VRFTU(TUIndex).CoolCoilIndex > 0) { DXCoilCap = DXCoils::GetCoilCapacityByIndexType(state, @@ -8877,17 +8875,15 @@ void VRFCondenserEquipment::SizeVRFCondenser(EnergyPlusData &state) static constexpr std::string_view RoutineName("SizeVRFCondenser"); - int PltSizCondNum; // Plant Sizing index for condenser loop Real64 rho; // local fluid density [kg/m3] Real64 Cp; // local fluid specific heat [J/kg-k] Real64 tmpCondVolFlowRate; // local condenser design volume flow rate [m3/s] - bool ErrorsFound; // indicates problem with sizing // save the design water flow rate for use by the water loop sizing algorithms if (this->CondenserType == DataHeatBalance::RefrigCondenserType::Water) { - ErrorsFound = false; - PltSizCondNum = 0; + bool ErrorsFound = false; + int PltSizCondNum = 0; if (this->WaterCondVolFlowRate == DataSizing::AutoSize) { if (this->SourcePlantLoc.loopNum > 0) PltSizCondNum = state.dataPlnt->PlantLoop(this->SourcePlantLoc.loopNum).PlantSizNum; @@ -9057,10 +9053,8 @@ void VRFTerminalUnitEquipment::ControlVRFToLoad(EnergyPlusData &state, int VRFCond = this->VRFSysNum; Real64 FullOutput = 0.0; // unit full output when compressor is operating [W] Real64 TempOutput = 0.0; // unit output when iteration limit exceeded [W] - int SolFla = 0; // Flag of RegulaFalsi solver Real64 TempMinPLR = 0.0; // min PLR used in Regula Falsi call Real64 TempMaxPLR = 0.0; // max PLR used in Regula Falsi call - bool ContinueIter; // used when convergence is an issue Real64 NoCompOutput = 0.0; // output when no active compressor [W] bool VRFCoolingMode = state.dataHVACVarRefFlow->CoolingLoad(VRFCond); bool VRFHeatingMode = state.dataHVACVarRefFlow->HeatingLoad(VRFCond); @@ -9248,6 +9242,7 @@ void VRFTerminalUnitEquipment::ControlVRFToLoad(EnergyPlusData &state, if (SpeedNum == 1) { this->SpeedRatio = 0.0; } + int SolFla = 0; // Flag of RegulaFalsi solver auto f = [&state, VRFTUNum, FirstHVACIteration, QZnReq, OnOffAirFlowRatio](Real64 const PartLoadRatio) { Real64 QZnReqTemp = QZnReq; // denominator representing zone load (W) Real64 ActualOutput; // delivered capacity of VRF terminal unit @@ -9290,7 +9285,7 @@ void VRFTerminalUnitEquipment::ControlVRFToLoad(EnergyPlusData &state, if (SolFla == -1) { // Very low loads may not converge quickly. Tighten PLR boundary and try again. TempMaxPLR = -0.1; - ContinueIter = true; + bool ContinueIter = true; while (ContinueIter && TempMaxPLR < 1.0) { TempMaxPLR += 0.1; From def3f7a68b33480c434aebe90aff0cb550dcc695 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 23:24:05 -0400 Subject: [PATCH 155/164] Reduce scope --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 07ca057fb92..18e68fe7515 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -7531,9 +7531,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) std::string SizingString; // input field sizing description (e.g., Nominal Capacity) Real64 TempSize; // autosized value of coil input field int FieldNum = 2; // IDD numeric field number where input field description is found - int SizingMethod; // Integer representation of sizing method name (e.g., CoolingAirflowSizing, HeatingAirflowSizing, CoolingCapacitySizing, - // HeatingCapacitySizing, etc.) - bool PrintFlag = true; // TRUE when sizing information is reported in the eio file + bool PrintFlag = true; // TRUE when sizing information is reported in the eio file auto &ZoneEqSizing = state.dataSize->ZoneEqSizing; @@ -7647,7 +7645,9 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) int zoneHVACIndex = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HVACSizingIndex; - SizingMethod = CoolingAirflowSizing; + // Integer representation of sizing method name (e.g., CoolingAirflowSizing, HeatingAirflowSizing, CoolingCapacitySizing, + // HeatingCapacitySizing, etc.) + int SizingMethod = CoolingAirflowSizing; PrintFlag = true; bool errorsFound = false; // supply air flow rate sizing method (SupplyAirFlowRate, FlowPerFloorArea, FractionOfAutosizedCoolingAirflow, @@ -8011,7 +8011,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) FieldNum = 3; // N3, \field Supply Air Flow Rate During Heating Operation SizingString = state.dataHVACVarRefFlow->VRFTUNumericFields(VRFTUNum).FieldNames(FieldNum) + " [m3/s]"; - SizingMethod = HeatingAirflowSizing; + int SizingMethod = HeatingAirflowSizing; TempSize = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxHeatAirVolFlow; errorsFound = false; HeatingAirFlowSizer sizingHeatingAirFlow; @@ -8364,7 +8364,6 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DesignSuppHeatingCapacity = sizerWaterHeatingCapacity.size(state, TempSize, ErrorsFound); } } else { - SizingMethod = HVAC::HeatingCapacitySizing; SizingString = "Supplemental Heating Coil Nominal Capacity [W]"; if (TempSize == DataSizing::AutoSize) { IsAutoSize = true; From c6497e78cc4fb66f74f39317367b7056273c4108 Mon Sep 17 00:00:00 2001 From: rraustad Date: Tue, 20 Aug 2024 23:49:31 -0400 Subject: [PATCH 156/164] Reduce scope --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 22 +++++-------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 18e68fe7515..6bb48f857f3 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -7684,7 +7684,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxCoolAirVolFlow = sizingCoolingAirFlow.size(state, TempSize, errorsFound); } else if (SAFMethod == FlowPerCoolingCapacity) { - SizingMethod = CoolingCapacitySizing; + SizingMethod = CoolingCapacitySizing; // either this isn't needed or needs to be assigned to EqSizing TempSize = AutoSize; PrintFlag = false; state.dataSize->DataScalableSizingON = true; @@ -7769,7 +7769,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) sizingHeatingAirFlow.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxHeatAirVolFlow = sizingHeatingAirFlow.size(state, TempSize, errorsFound); } else if (SAFMethod == FlowPerHeatingCapacity) { - SizingMethod = HeatingCapacitySizing; + SizingMethod = HeatingCapacitySizing; // either this isn't needed or needs to be assigned to EqSizing TempSize = AutoSize; PrintFlag = false; state.dataSize->DataScalableSizingON = true; @@ -7783,7 +7783,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) sizerHeatingCapacity.initializeWithinEP(state, CompType, CompName, PrintFlag, RoutineName); state.dataSize->DataAutosizedHeatingCapacity = sizerHeatingCapacity.size(state, TempSize, errorsFound); state.dataSize->DataFlowPerHeatingCapacity = state.dataSize->ZoneHVACSizing(zoneHVACIndex).MaxHeatAirVolFlow; - SizingMethod = HeatingAirflowSizing; + SizingMethod = HeatingAirflowSizing; // either this isn't needed or needs to be assigned to EqSizing PrintFlag = true; TempSize = AutoSize; errorsFound = false; @@ -8011,7 +8011,7 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) FieldNum = 3; // N3, \field Supply Air Flow Rate During Heating Operation SizingString = state.dataHVACVarRefFlow->VRFTUNumericFields(VRFTUNum).FieldNames(FieldNum) + " [m3/s]"; - int SizingMethod = HeatingAirflowSizing; + int SizingMethod = HeatingAirflowSizing; // either this isn't needed or needs to be assigned to EqSizing TempSize = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxHeatAirVolFlow; errorsFound = false; HeatingAirFlowSizer sizingHeatingAirFlow; @@ -8366,7 +8366,6 @@ void SizeVRF(EnergyPlusData &state, int const VRFTUNum) } else { SizingString = "Supplemental Heating Coil Nominal Capacity [W]"; if (TempSize == DataSizing::AutoSize) { - IsAutoSize = true; bool errorsFound = false; HeatingCapacitySizer sizerHeatingCapacity; sizerHeatingCapacity.overrideSizingString(SizingString); @@ -8882,9 +8881,8 @@ void VRFCondenserEquipment::SizeVRFCondenser(EnergyPlusData &state) if (this->CondenserType == DataHeatBalance::RefrigCondenserType::Water) { bool ErrorsFound = false; - int PltSizCondNum = 0; - if (this->WaterCondVolFlowRate == DataSizing::AutoSize) { + int PltSizCondNum = 0; if (this->SourcePlantLoc.loopNum > 0) PltSizCondNum = state.dataPlnt->PlantLoop(this->SourcePlantLoc.loopNum).PlantSizNum; if (PltSizCondNum > 0) { rho = FluidProperties::GetDensityGlycol(state, @@ -9613,8 +9611,6 @@ void ReportVRFTerminalUnit(EnergyPlusData &state, int const VRFTUNum) // index t using namespace DataSizing; - int DXCoolingCoilIndex; // - index to DX cooling coil - int DXHeatingCoilIndex; // - index to DX heating coil Real64 TotalConditioning; // - sum of sensible and latent rates Real64 SensibleConditioning; // - sensible rate Real64 LatentConditioning; // - latent rate @@ -9625,8 +9621,6 @@ void ReportVRFTerminalUnit(EnergyPlusData &state, int const VRFTUNum) // index t bool HRHeatRequestFlag; // - indicates TU could be in heat mode bool HRCoolRequestFlag; // - indicates TU could be in cool mode - DXCoolingCoilIndex = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolCoilIndex; - DXHeatingCoilIndex = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatCoilIndex; VRFCond = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).VRFSysNum; TUListIndex = state.dataHVACVarRefFlow->VRF(VRFCond).ZoneTUListPtr; IndexToTUInTUList = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).IndexToTUInTUList; @@ -10010,7 +10004,6 @@ void InitializeOperatingMode(EnergyPlusData &state, Real64 SPTempHi; // thermostat setpoint high Real64 SPTempLo; // thermostat setpoint low int NumTU; // loop counter, number of TU's in list - int TUIndex; // index to TU Real64 ZoneLoad; // current zone load (W) Real64 LoadToCoolingSP; // thermostat load to cooling setpoint (W) Real64 LoadToHeatingSP; // thermostat load to heating setpoint (W) @@ -10040,7 +10033,7 @@ void InitializeOperatingMode(EnergyPlusData &state, for (NumTU = 1; NumTU <= state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).NumTUInList; ++NumTU) { // make sure TU's have been sized before looping through each one of them to determine operating mode if (any(state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).TerminalUnitNotSizedYet)) break; - TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); + int TUIndex = state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).ZoneTUPtr(NumTU); // check to see if coil is present if (state.dataHVACVarRefFlow->TerminalUnitList(TUListNum).CoolingCoilPresent(NumTU)) { @@ -13990,10 +13983,7 @@ void VRFCondenserEquipment::VRFOU_CalcCompC(EnergyPlusData &state, Real64 CondHeat = Q_evap_req * C_cap_operation0 / this->RatedEvapCapacity; // 150130 To be confirmed int CAPFT = this->OUCoolingCAPFT(CounterCompSpdTemp); - // Update Te' (SmallLoadTe) to meet the required evaporator capacity - MinOutdoorUnitTe = 6; P_discharge = this->refrig->getSatPressure(state, T_discharge, RoutineName); - MinRefriPe = this->refrig->getSatPressure(state, -15, RoutineName); MinOutdoorUnitPe = max(P_discharge - this->CompMaxDeltaP, MinRefriPe); MinOutdoorUnitTe = this->refrig->getSatTemperature(state, max(min(MinOutdoorUnitPe, RefPHigh), RefPLow), RoutineName); From ce1bde5de24876b4617b9b2476c84b854d7075e0 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Wed, 21 Aug 2024 16:25:08 +0200 Subject: [PATCH 157/164] Don't catch std::exception in Debug mode so we can catch array bounds error in debugger cmake will properly define NDEBUG on msvc as well in release mode cf https://gitlab.kitware.com/cmake/cmake/-/blob/1e35163a/Modules/Platform/Windows-MSVC.cmake#L481-483 --- src/EnergyPlus/api/EnergyPlusPgm.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/EnergyPlus/api/EnergyPlusPgm.cc b/src/EnergyPlus/api/EnergyPlusPgm.cc index 88dae209906..800734bc67e 100644 --- a/src/EnergyPlus/api/EnergyPlusPgm.cc +++ b/src/EnergyPlus/api/EnergyPlusPgm.cc @@ -419,10 +419,13 @@ int RunEnergyPlus(EnergyPlus::EnergyPlusData &state, std::string const &filepath EnergyPlus::SimulationManager::ManageSimulation(state); } catch (const EnergyPlus::FatalError &e) { return EnergyPlus::AbortEnergyPlus(state); +#ifdef NDEBUG } catch (const std::exception &e) { ShowSevereError(state, e.what()); return EnergyPlus::AbortEnergyPlus(state); +#endif } + return wrapUpEnergyPlus(state); } From 8cadfea9544ecdcefe63767139d69c595a0b993a Mon Sep 17 00:00:00 2001 From: LipingWang Date: Wed, 21 Aug 2024 19:40:57 -0400 Subject: [PATCH 158/164] Bug fix + Output Variable Reference --- src/EnergyPlus/IndoorGreen.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/IndoorGreen.cc b/src/EnergyPlus/IndoorGreen.cc index 440e3d398ff..af5b6f1beca 100644 --- a/src/EnergyPlus/IndoorGreen.cc +++ b/src/EnergyPlus/IndoorGreen.cc @@ -580,7 +580,7 @@ namespace IndoorGreen { ZoneNewTemp = Twb; ZoneNewHum = ZoneSatHum; } - HMid = Psychrometrics::PsyHFnTdbW(ZoneNewTemp, ZoneNewHum); + HMid = Psychrometrics::PsyHFnTdbW(ZoneNewTemp, ZonePreHum); ig.SensibleRate = (1 - ig.LEDRadFraction) * ig.LEDActualEleP; // convective heat gain from LED lights when LED is on; heat convection from // plants was considered and counted from plant surface heat balance. ig.LatentRate = ZoneAirVol * rhoair * (HCons - HMid) / Timestep; // unit W From 79dd25d1dccf9c9dacd0fe7cd628cf4f6693c76e Mon Sep 17 00:00:00 2001 From: LipingWang Date: Wed, 21 Aug 2024 19:52:26 -0400 Subject: [PATCH 159/164] Bug fix --- src/EnergyPlus/IndoorGreen.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/IndoorGreen.cc b/src/EnergyPlus/IndoorGreen.cc index af5b6f1beca..2dfae769f0e 100644 --- a/src/EnergyPlus/IndoorGreen.cc +++ b/src/EnergyPlus/IndoorGreen.cc @@ -584,7 +584,8 @@ namespace IndoorGreen { ig.SensibleRate = (1 - ig.LEDRadFraction) * ig.LEDActualEleP; // convective heat gain from LED lights when LED is on; heat convection from // plants was considered and counted from plant surface heat balance. ig.LatentRate = ZoneAirVol * rhoair * (HCons - HMid) / Timestep; // unit W - state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(ig.SurfPtr) = -1.0 * ig.LambdaET; + state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(ig.SurfPtr) = + -1.0 * ig.LambdaET+ ig.LEDRadFraction * 0.9 * ig.LEDActualEleP / state.dataSurface->Surface(ig.SurfPtr).Area; //assume the energy from radiation for photosynthesis is only 10%. } } From cd341d64351b696beea4427d928af3e08f7c9c8d Mon Sep 17 00:00:00 2001 From: LipingWang Date: Thu, 22 Aug 2024 11:52:17 -0400 Subject: [PATCH 160/164] Update IO reference. --- ...oup-internal-gains-people-lights-other.tex | 45 ++++++++++++++++++- src/EnergyPlus/IndoorGreen.cc | 4 +- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-internal-gains-people-lights-other.tex b/doc/input-output-reference/src/overview/group-internal-gains-people-lights-other.tex index b28a226c678..526a1be444f 100644 --- a/doc/input-output-reference/src/overview/group-internal-gains-people-lights-other.tex +++ b/doc/input-output-reference/src/overview/group-internal-gains-people-lights-other.tex @@ -2431,7 +2431,7 @@ \subsubsection{Outputs}\label{outputs-indoorlivingwall} \item Zone,Average,Indoor Living Wall Evapotranspiration Rate {[}\si{\evapotranspirationRate}{]} \item - Zone,Average,Indoor Living Wall Energy Required For Evapotranspiration Per Unit Area {[}\si{\watt\per\area}{]} + Zone,Average,Indoor Living Wall Energy Rate Required For Evapotranspiration Per Unit Area {[}\si{\watt\per\area}{]} \item Zone,Average,Indoor Living Wall LED Operational PPFD {[}\si{\umolperAreaperSecond}{]} \item @@ -2446,7 +2446,50 @@ \subsubsection{Outputs}\label{outputs-indoorlivingwall} Zone,Sum,Indoor Living Wall LED Electricity Energy {[}J{]} \end{itemize} +\paragraph{Indoor Living Wall Plant Surface Temperature {[}C{]}}\label{indoor-living-wall-plant-surface-temperature-c} +This output is the plant surface temperature in C. Plant surface temperature is determined using surface heat balance of indoor living walls. + +\paragraph{Indoor Living Wall Sensible Heat Gain Rate {[}W{]}}\label{indoor-living-wall-sensible-heat-gain-rate-w} + +This output is the sensible heat gain rate from indoor living walls in W and determined by surface heat balance. Positive sign represents heat loss from plants or heat gain to indoor space; negative sign represents heat gain to plants or heat loss from indoor space. + +\paragraph{Indoor Living Wall Latent Heat Gain Rate {[}W{]}}\label{indoor-living-wall-latent-heat-gain-rate-w} + +This output is the latent heat gain rate from indoor living walls in W. Latent heat gain is determined based on the increase of enthalpy due to the increase of absolute humidity (or humidity ratio) from plant evapotranspiration. + +\paragraph{Indoor Living Wall Evapotranspiration Rate {[}\si{\evapotranspirationRate}{]}}\label{indoor-living-wall-evapotranspiration-rate} + +This output is evapotranspiration (ET) rate of indoor living walls in \si{\evapotranspirationRate}. The ET rate is directly calculated by ET models(Penman-Monteith model, Stanghellini model or ET model from users). + +\paragraph{Indoor Living Wall Energy Rate Required For Evapotranspiration Per Unit Area {[}\si{\watt\per\area}{]}}\label{indoor-living-wall-evapotranspiration-per-unit-area} + +This output is energy rate per unit area required for plant evapotranspiration (ET) of indoor living walls in \si{\watt\per\area}. The energy rate per unit area for ET is determined by latent heat of vaporization for total ET over time period and surface area. + +\paragraph{Indoor Living Wall LED Operational PPFD {[}\si{\umolperAreaperSecond}{]}}\label{indoor-living-wall-led-operational-ppfd} + +This output is operational photosynthetic photon flux density (PPFD) of LED light in \si{\umolperAreaperSecond}. The operational PPFD of LED light is determined based on lighting method. If lighting method is Daylight, the operational LED PPFD is zero. If lighting method is LED, the operational LED PPFD is nominal LED PPFD. If lighting method is LED-Daylight, the operational LED PPFD is calculated based on targeted PPFD and daylighting level with the consideration of nominal LED PPFD. + +\paragraph{Indoor Living Wall PPFD {[}\si{\umolperAreaperSecond}{]}}\label{indoor-living-wall-ppfd} + +This output is the actual PPFD including LED and/or daylight for indoor living walls in \si{\umolperAreaperSecond}. + +\paragraph{Indoor Living Wall Vapor Pressure Deficit {[}Pa{]}}\label{indoor-living-wall-vpd-pa} + +This output is the vapor pressure deficit in Pa. The output represents the difference between saturated vapor pressure and vapor pressure of the moist air of current condition. + +\paragraph{Indoor Living Wall LED Sensible Heat Gain Rate {[}W{]}}\label{indoor-living-wall-led-sensible-heat-gain-rate-w} + +This output is the LED sensible heat gain rate for indoor living walls in W. The output determines convective heat gain from LED lights when LED lights are on. + +\paragraph{Indoor Living Wall LED Operational Power {[}W{]}}\label{indoor-living-wall-led-operational-power-w} + +This output is LED operational power for indoor living walls in W. The LED operational power is determined by LED nominal power in proportion to the ratio of LED operational PPFD to LED nominal PPFD. + +\paragraph{Indoor Living Wall LED Electricity Energy {[}J{]}}\label{indoor-living-wall-led-electricity-energy-j} + +This output is LED electricity energy for indoor living walls in J. The LED electricity energy is calculated by LED operational power multiplied by time period. + \subsection{ElectricEquipment:ITE:AirCooled}\label{electricequipmentiteaircooled} This object describes air-cooled electric information technology equipment (ITE) which has variable power consumption as a function of loading and temperature. diff --git a/src/EnergyPlus/IndoorGreen.cc b/src/EnergyPlus/IndoorGreen.cc index 2dfae769f0e..8a7ed266283 100644 --- a/src/EnergyPlus/IndoorGreen.cc +++ b/src/EnergyPlus/IndoorGreen.cc @@ -381,7 +381,7 @@ namespace IndoorGreen { state, "Indoor Living Wall Sensible Heat Gain Rate", Constant::Units::W, - state.dataHeatBalSurf->SurfQConvInRep(ig.SurfPtr), // positive sign: heat loss from plants; negative sign: heat gain from plants + state.dataHeatBalSurf->SurfQConvInRep(ig.SurfPtr), // positive sign: heat loss from plants; negative sign: heat gain to plants OutputProcessor::TimeStepType::Zone, OutputProcessor::StoreType::Average, ig.Name); @@ -400,7 +400,7 @@ namespace IndoorGreen { OutputProcessor::StoreType::Average, ig.Name); SetupOutputVariable(state, - "Indoor Living Wall Energy Required For Evapotranspiration Per Unit Area", + "Indoor Living Wall Energy Rate Required For Evapotranspiration Per Unit Area", Constant::Units::W_m2, ig.LambdaET, OutputProcessor::TimeStepType::Zone, From 19b94b8bda9f9fb15edc61c125dd25b3abb8f671 Mon Sep 17 00:00:00 2001 From: LipingWang Date: Thu, 22 Aug 2024 12:26:30 -0400 Subject: [PATCH 161/164] format update --- src/EnergyPlus/IndoorGreen.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/EnergyPlus/IndoorGreen.cc b/src/EnergyPlus/IndoorGreen.cc index 8a7ed266283..19d73bd4366 100644 --- a/src/EnergyPlus/IndoorGreen.cc +++ b/src/EnergyPlus/IndoorGreen.cc @@ -585,7 +585,9 @@ namespace IndoorGreen { // plants was considered and counted from plant surface heat balance. ig.LatentRate = ZoneAirVol * rhoair * (HCons - HMid) / Timestep; // unit W state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(ig.SurfPtr) = - -1.0 * ig.LambdaET+ ig.LEDRadFraction * 0.9 * ig.LEDActualEleP / state.dataSurface->Surface(ig.SurfPtr).Area; //assume the energy from radiation for photosynthesis is only 10%. + -1.0 * ig.LambdaET + + ig.LEDRadFraction * 0.9 * ig.LEDActualEleP / + state.dataSurface->Surface(ig.SurfPtr).Area; // assume the energy from radiation for photosynthesis is only 10%. } } From b58fc29f7769b49fd39d8ca93ea68590f6fe1c19 Mon Sep 17 00:00:00 2001 From: LipingWang Date: Thu, 22 Aug 2024 13:13:48 -0400 Subject: [PATCH 162/164] output variable name --- testfiles/IndoorLivingWall.idf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testfiles/IndoorLivingWall.idf b/testfiles/IndoorLivingWall.idf index caf233196ca..a55b2132e1b 100644 --- a/testfiles/IndoorLivingWall.idf +++ b/testfiles/IndoorLivingWall.idf @@ -3118,7 +3118,7 @@ Output:Variable, Output:Variable, *, !- Key Value - Indoor Living Wall Energy Required For Evapotranspiration Per Unit Are, !- Variable Name + Indoor Living Wall Energy Rate Required For Evapotranspiration Per Unit Area, !- Variable Name Timestep; !- Reporting Frequency Output:Variable, From b74c1c42fbcceb2b63eaf5526130304b144bf322 Mon Sep 17 00:00:00 2001 From: LipingWang Date: Thu, 22 Aug 2024 13:19:42 -0400 Subject: [PATCH 163/164] update the csv & remove meters output --- testfiles/IndoorLivingWall.idf | 86 +--------------------------------- 1 file changed, 2 insertions(+), 84 deletions(-) diff --git a/testfiles/IndoorLivingWall.idf b/testfiles/IndoorLivingWall.idf index a55b2132e1b..5959aee9571 100644 --- a/testfiles/IndoorLivingWall.idf +++ b/testfiles/IndoorLivingWall.idf @@ -2911,6 +2911,8 @@ Output:Table:SummaryReports, OutputControl:Table:Style, HTML; !- Column Separator +OutputControl:Files, + Yes; !- Output CSV !- =========== ALL OBJECTS IN CLASS: OUTPUT:VARIABLE =========== @@ -3211,90 +3213,6 @@ Output:Variable, Indoor Living Wall LED Electricity Energy , !- Variable Name Timestep; !- Reporting Frequency - -!- =========== ALL OBJECTS IN CLASS: OUTPUT:METER:METERFILEONLY =========== - -Output:Meter:MeterFileOnly, - Electricity:Facility, !- Key Name - monthly; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - Electricity:Building, !- Key Name - monthly; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - InteriorLights:Electricity, !- Key Name - monthly; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - Electricity:HVAC, !- Key Name - monthly; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - Electricity:Plant, !- Key Name - monthly; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - NaturalGas:Facility, !- Key Name - monthly; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - NaturalGas:Plant, !- Key Name - monthly; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - Electricity:Facility, !- Key Name - runperiod; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - Electricity:Building, !- Key Name - runperiod; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - InteriorLights:Electricity, !- Key Name - runperiod; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - Electricity:HVAC, !- Key Name - runperiod; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - Electricity:Plant, !- Key Name - runperiod; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - NaturalGas:Facility, !- Key Name - runperiod; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - NaturalGas:Plant, !- Key Name - runperiod; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - MyGeneralLights, !- Key Name - monthly; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - MyGeneralLights, !- Key Name - runperiod; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - MyBuildingElectric, !- Key Name - monthly; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - MyBuildingElectric, !- Key Name - runperiod; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - MyBuildingOther, !- Key Name - monthly; !- Reporting Frequency - -Output:Meter:MeterFileOnly, - MyBuildingOther, !- Key Name - runperiod; !- Reporting Frequency - - !- =========== ALL OBJECTS IN CLASS: METER:CUSTOM =========== ! The following custom meters are set up to illustrate the capabilities From 07785492d8295bb3179cdb76dd828e2d0eb948bd Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Thu, 22 Aug 2024 12:36:52 -0500 Subject: [PATCH 164/164] Output variable transition and warning cleanup --- .../Report Variables 24-1-0 to 24-2-0.csv | 5 +- testfiles/IndoorLivingWall.idf | 284 +----------------- 2 files changed, 9 insertions(+), 280 deletions(-) diff --git a/src/Transition/SupportFiles/Report Variables 24-1-0 to 24-2-0.csv b/src/Transition/SupportFiles/Report Variables 24-1-0 to 24-2-0.csv index cf61cdd9aca..38fb29be621 100644 --- a/src/Transition/SupportFiles/Report Variables 24-1-0 to 24-2-0.csv +++ b/src/Transition/SupportFiles/Report Variables 24-1-0 to 24-2-0.csv @@ -1,5 +1,5 @@ 24.1.0,24.2.0,Transition notes - some of these are EMS variable names -10,10,These numbers should be the number of report variables in the following list (including deletes). Two columns/numbers. +11,11,These numbers should be the number of report variables in the following list (including deletes). Two columns/numbers. Zone Windows Total Transmitted Solar Radiation Rate,Enclosure Windows Total Transmitted Solar Radiation Rate, Zone Exterior Windows Total Transmitted Beam Solar Radiation Rate,Enclosure Exterior Windows Total Transmitted Beam Solar Radiation Rate, Zone Interior Windows Total Transmitted Beam Solar Radiation Rate,Enclosure Interior Windows Total Transmitted Beam Solar Radiation Rate, @@ -10,4 +10,5 @@ Zone Exterior Windows Total Transmitted Beam Solar Radiation Energy,Enclosure Ex Zone Interior Windows Total Transmitted Beam Solar Radiation Energy,Enclosure Interior Windows Total Transmitted Beam Solar Radiation Energy, Zone Exterior Windows Total Transmitted Diffuse Solar Radiation Energy,Enclosure Exterior Windows Total Transmitted Diffuse Solar Radiation Energy, Zone Interior Windows Total Transmitted Diffuse Solar Radiation Energy,Enclosure Interior Windows Total Transmitted Diffuse Solar Radiation Energy, -old variable name,new variable name,-- add variable names (before this line) and leave off units -- to delete \ No newline at end of file +Indoor Living Wall Energy Required For Evapotranspiration Per Unit Area,Indoor Living Wall Energy Rate Required For Evapotranspiration Per Unit Area, +old variable name,new variable name,-- add variable names (before this line) and leave off units -- to delete diff --git a/testfiles/IndoorLivingWall.idf b/testfiles/IndoorLivingWall.idf index 5959aee9571..880c107dcec 100644 --- a/testfiles/IndoorLivingWall.idf +++ b/testfiles/IndoorLivingWall.idf @@ -111,9 +111,9 @@ Version, !- =========== ALL OBJECTS IN CLASS: SIMULATIONCONTROL =========== SimulationControl, - Yes, !- Do Zone Sizing Calculation - Yes, !- Do System Sizing Calculation - Yes, !- Do Plant Sizing Calculation + No, !- Do Zone Sizing Calculation + No, !- Do System Sizing Calculation + No, !- Do Plant Sizing Calculation No, !- Run Simulation for Sizing Periods Yes, !- Run Simulation for Weather File Run Periods No, !- Do HVAC Sizing Simulation for Sizing Periods @@ -308,14 +308,6 @@ ScheduleTypeLimits, !- =========== ALL OBJECTS IN CLASS: SCHEDULE:COMPACT =========== -Schedule:Compact, - AlwaysOff, !- Name - Fraction, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 0; !- Field 4 - Schedule:Compact, AlwaysOn, !- Name Fraction, !- Schedule Type Limits Name @@ -429,241 +421,6 @@ Schedule:Compact, Until: 24:00, !- Field 3 117.239997864; !- Field 4 -Schedule:Compact, - ShadeTransSch, !- Name - Fraction, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 0.0; !- Field 4 - -Schedule:Compact, - Htg-SetP-Sch, !- Name - Temperature, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: SummerDesignDay, !- Field 2 - Until: 24:00, !- Field 3 - 16.7, !- Field 4 - For: WinterDesignDay, !- Field 5 - Until: 24:00, !- Field 6 - 22.2, !- Field 7 - For: WeekDays, !- Field 8 - Until: 6:00, !- Field 9 - 16.7, !- Field 10 - Until: 20:00, !- Field 11 - 22.2, !- Field 12 - Until: 24:00, !- Field 13 - 16.7, !- Field 14 - For: WeekEnds Holiday, !- Field 15 - Until: 24:00, !- Field 16 - 16.7, !- Field 17 - For: AllOtherDays, !- Field 18 - Until: 24:00, !- Field 19 - 16.7; !- Field 20 - -Schedule:Compact, - PlenumHtg-SetP-Sch, !- Name - Temperature, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 12.8; !- Field 4 - -Schedule:Compact, - Clg-SetP-Sch, !- Name - Temperature, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: SummerDesignDay, !- Field 2 - Until: 24:00, !- Field 3 - 23.9, !- Field 4 - For: WinterDesignDay, !- Field 5 - Until: 24:00, !- Field 6 - 29.4, !- Field 7 - For: WeekDays, !- Field 8 - Until: 6:00, !- Field 9 - 29.4, !- Field 10 - Until: 20:00, !- Field 11 - 23.9, !- Field 12 - Until: 24:00, !- Field 13 - 29.4, !- Field 14 - For: WeekEnds Holiday, !- Field 15 - Until: 24:00, !- Field 16 - 29.4, !- Field 17 - For: AllOtherDays, !- Field 18 - Until: 24:00, !- Field 19 - 29.4; !- Field 20 - -Schedule:Compact, - PlenumClg-SetP-Sch, !- Name - Temperature, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 40.0; !- Field 4 - -Schedule:Compact, - Zone Control Type Sched, !- Name - Control Type, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: SummerDesignDay, !- Field 2 - Until: 24:00, !- Field 3 - 2, !- Field 4 - For: WinterDesignDay, !- Field 5 - Until: 24:00, !- Field 6 - 1, !- Field 7 - For: AllOtherDays, !- Field 8 - Until: 24:00, !- Field 9 - 4; !- Field 10 - -Schedule:Compact, - Min OA Sched, !- Name - Fraction, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: Weekdays, !- Field 2 - Until: 6:00, !- Field 3 - 0.02, !- Field 4 - Until: 20:00, !- Field 5 - 1.0, !- Field 6 - Until: 24:00, !- Field 7 - 0.02, !- Field 8 - For: AllOtherDays, !- Field 9 - Until: 24:00, !- Field 10 - 0.02; !- Field 11 - -Schedule:Compact, - FanAvailSched, !- Name - Fraction, !- Schedule Type Limits Name - Through: 3/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 1.0, !- Field 4 - Through: 9/30, !- Field 5 - For: WeekDays, !- Field 6 - Until: 6:00, !- Field 7 - 0.0, !- Field 8 - Until: 20:00, !- Field 9 - 1.0, !- Field 10 - Until: 24:00, !- Field 11 - 0.0, !- Field 12 - For: SummerDesignDay WinterDesignDay, !- Field 13 - Until: 24:00, !- Field 14 - 1.0, !- Field 15 - For: AllOtherDays, !- Field 16 - Until: 24:00, !- Field 17 - 0.0, !- Field 18 - Through: 12/31, !- Field 19 - For: AllDays, !- Field 20 - Until: 24:00, !- Field 21 - 1.0; !- Field 22 - -Schedule:Compact, - CoolingCoilAvailSched, !- Name - Fraction, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: WeekDays, !- Field 2 - Until: 6:00, !- Field 3 - 0.0, !- Field 4 - Until: 20:00, !- Field 5 - 1.0, !- Field 6 - Until: 24:00, !- Field 7 - 0.0, !- Field 8 - For: SummerDesignDay WinterDesignDay, !- Field 9 - Until: 24:00, !- Field 10 - 1.0, !- Field 11 - For: AllOtherDays, !- Field 12 - Until: 24:00, !- Field 13 - 0.0; !- Field 14 - -Schedule:Compact, - CoolingPumpAvailSched, !- Name - Fraction, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 1.0; !- Field 4 - -Schedule:Compact, - ReheatCoilAvailSched, !- Name - Fraction, !- Schedule Type Limits Name - Through: 3/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 1.0, !- Field 4 - Through: 9/30, !- Field 5 - For: WeekDays, !- Field 6 - Until: 6:00, !- Field 7 - 0.0, !- Field 8 - Until: 20:00, !- Field 9 - 1.0, !- Field 10 - Until: 24:00, !- Field 11 - 0.0, !- Field 12 - For: SummerDesignDay WinterDesignDay, !- Field 13 - Until: 24:00, !- Field 14 - 1.0, !- Field 15 - For: AllOtherDays, !- Field 16 - Until: 24:00, !- Field 17 - 0.0, !- Field 18 - Through: 12/31, !- Field 19 - For: AllDays, !- Field 20 - Until: 24:00, !- Field 21 - 1.0; !- Field 22 - -Schedule:Compact, - CW Loop Temp Schedule, !- Name - Temperature, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 7.22; !- Field 4 - -Schedule:Compact, - HW Loop Temp Schedule, !- Name - Temperature, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 82; !- Field 4 - -Schedule:Compact, - PlantOnSched, !- Name - Fraction, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 1.0; !- Field 4 - -Schedule:Compact, - Seasonal Reset Supply Air Temp Sch, !- Name - Temperature, !- Schedule Type Limits Name - Through: 3/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 16.0, !- Field 4 - Through: 9/30, !- Field 5 - For: AllDays, !- Field 6 - Until: 24:00, !- Field 7 - 13.0, !- Field 8 - Through: 12/31, !- Field 9 - For: AllDays, !- Field 10 - Until: 24:00, !- Field 11 - 16.0; !- Field 12 - -Schedule:Compact, - OA Cooling Supply Air Temp Sch, !- Name - Temperature, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 11.5; !- Field 4 - -Schedule:Compact, - OA Heating Supply Air Temp Sch, !- Name - Temperature, !- Schedule Type Limits Name - Through: 12/31, !- Field 1 - For: AllDays, !- Field 2 - Until: 24:00, !- Field 3 - 4.5; !- Field 4 - Schedule:Compact, LightingTarget, !- Name Any Number, !- Schedule Type Limits Name @@ -2414,7 +2171,7 @@ Daylighting:Controls, 1, !- Probability Lighting will be Reset When Needed in Manual Stepped Control , !- Glare Calculation Daylighting Reference Point Name , !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone y-Axis {deg} - 22, !- Maximum Allowable Discomfort Glare Index + , !- Maximum Allowable Discomfort Glare Index , !- DElight Gridding Resolution {m2} ReferenceSouthPartition, !- Daylighting Reference Point 1 Name 1, !- Fraction of Lights Controlled by Reference Point 1 @@ -2865,17 +2622,6 @@ ZoneHVAC:EquipmentConnections, SPACE5-1 Return Outlet; !- Zone Return Air Node or NodeList Name -!- =========== ALL OBJECTS IN CLASS: CURVE:QUADRATIC =========== - -Curve:Quadratic, - BoilerEfficiency, !- Name - 1.0, !- Coefficient1 Constant - 0.0, !- Coefficient2 x - 0.0, !- Coefficient3 x**2 - 0, !- Minimum Value of x - 1; !- Maximum Value of x - - !- =========== ALL OBJECTS IN CLASS: OUTPUT:VARIABLEDICTIONARY =========== Output:VariableDictionary, @@ -2903,7 +2649,7 @@ Output:Surfaces:Drawing, !- =========== ALL OBJECTS IN CLASS: OUTPUT:TABLE:SUMMARYREPORTS =========== Output:Table:SummaryReports, - AllSummaryAndSizingPeriod; !- Report 1 Name + AllSummary; !- Report 1 Name !- =========== ALL OBJECTS IN CLASS: OUTPUTCONTROL:TABLE:STYLE =========== @@ -2911,9 +2657,6 @@ Output:Table:SummaryReports, OutputControl:Table:Style, HTML; !- Column Separator -OutputControl:Files, - Yes; !- Output CSV - !- =========== ALL OBJECTS IN CLASS: OUTPUT:VARIABLE =========== Output:Variable, @@ -3143,21 +2886,6 @@ Output:Variable, Zone Air System Sensible Heating Rate, !- Variable Name Timestep; !- Reporting Frequency -Output:Variable, - *, !- Key Value - Heating Coil Heating Rate, !- Variable Name - Timestep; !- Reporting Frequency - -Output:Variable, - *, !- Key Value - Cooling Coil Total Cooling Rate, !- Variable Name - Timestep; !- Reporting Frequency - -Output:Variable, - *, !- Key Value - Cooling Coil Sensible Cooling Rate, !- Variable Name - Timestep; !- Reporting Frequency - Output:Variable, *, !- Key Value Indoor Living Wall Plant Surface Temperature , !- Variable Name @@ -3195,7 +2923,7 @@ Output:Variable, Output:Variable, *, !- Key Value - Indoor Living Wall VPD , !- Variable Name + Indoor Living Wall Vapor Pressure Deficit , !- Variable Name Timestep; !- Reporting Frequency Output:Variable,