From bae1625dd03b240c835b93a75287a37662c9a60f Mon Sep 17 00:00:00 2001 From: Amir Roth Date: Thu, 9 Apr 2026 18:58:01 -0400 Subject: [PATCH 1/6] Initial commit --- .../Autosizing/All_Simple_Sizing.cc | 8 +- src/EnergyPlus/Autosizing/Base.cc | 1 + src/EnergyPlus/Autosizing/Base.hh | 1 + .../Autosizing/BaseSizerWithScalableInputs.cc | 5 +- .../Autosizing/CoolingAirFlowSizing.cc | 8 +- .../Autosizing/CoolingCapacitySizing.cc | 43 +- .../CoolingWaterDesAirInletHumRatSizing.cc | 2 +- .../CoolingWaterDesAirInletTempSizing.cc | 3 +- .../CoolingWaterDesAirOutletHumRatSizing.cc | 2 +- .../CoolingWaterDesAirOutletTempSizing.cc | 2 +- .../CoolingWaterDesWaterInletTempSizing.cc | 2 +- .../Autosizing/CoolingWaterflowSizing.cc | 17 +- .../Autosizing/HeatingAirFlowSizing.cc | 3 +- .../Autosizing/HeatingCapacitySizing.cc | 34 +- .../HeatingWaterDesAirInletHumRatSizing.cc | 2 +- .../HeatingWaterDesAirInletTempSizing.cc | 3 +- .../HeatingWaterDesCoilLoadUsedForUASizing.cc | 27 +- ...WaterDesCoilWaterVolFlowUsedForUASizing.cc | 6 +- .../Autosizing/HeatingWaterflowSizing.cc | 13 +- .../Autosizing/SystemAirFlowSizing.cc | 122 +-- .../Autosizing/WaterHeatingCapacitySizing.cc | 4 +- .../Autosizing/WaterHeatingCoilUASizing.cc | 15 +- src/EnergyPlus/Coils/CoilCoolingDX.cc | 55 +- src/EnergyPlus/Coils/CoilCoolingDX.hh | 1 + src/EnergyPlus/DXCoils.cc | 62 +- src/EnergyPlus/DXCoils.hh | 2 + src/EnergyPlus/FanCoilUnits.cc | 8 +- src/EnergyPlus/HeatingCoils.cc | 14 +- src/EnergyPlus/HeatingCoils.hh | 1 + src/EnergyPlus/OutputReportTabular.cc | 11 +- src/EnergyPlus/ReportCoilSelection.cc | 829 ++++++++++++------ src/EnergyPlus/ReportCoilSelection.hh | 252 ++++-- src/EnergyPlus/SimulationManager.cc | 1 - src/EnergyPlus/SingleDuct.cc | 4 +- src/EnergyPlus/SteamCoils.cc | 112 ++- src/EnergyPlus/SteamCoils.hh | 3 + src/EnergyPlus/UnitHeater.cc | 4 +- src/EnergyPlus/UnitVentilator.cc | 9 +- src/EnergyPlus/UnitarySystem.cc | 66 +- src/EnergyPlus/VariableSpeedCoils.cc | 229 +++-- src/EnergyPlus/VariableSpeedCoils.hh | 2 + src/EnergyPlus/WaterCoils.cc | 123 ++- src/EnergyPlus/WaterCoils.hh | 2 + src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 67 +- src/EnergyPlus/WaterToAirHeatPumpSimple.hh | 3 + src/EnergyPlus/WindowAC.cc | 12 +- .../unit/Fixtures/EnergyPlusFixture.cc | 1 - .../unit/OutputReportTabular.unit.cc | 3 - .../unit/ReportCoilSelection.unit.cc | 493 +++++------ tst/EnergyPlus/unit/SZVAVModel.unit.cc | 1 - tst/EnergyPlus/unit/UnitarySystem.unit.cc | 1 - tst/EnergyPlus/unit/WaterCoils.unit.cc | 8 - 52 files changed, 1550 insertions(+), 1152 deletions(-) diff --git a/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc b/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc index d488687e08f..dabf74be76d 100644 --- a/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc +++ b/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc @@ -321,8 +321,8 @@ Real64 HeatingCoilDesAirInletTempSizer::size(EnergyPlusData &state, Real64 _orig } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp( - state, this->compName, this->compType, this->autoSizedValue, this->curSysNum, this->curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp( + state, this->coilReportNum, this->autoSizedValue, this->curSysNum, this->curZoneEqNum); } return this->autoSizedValue; } @@ -355,7 +355,7 @@ Real64 HeatingCoilDesAirOutletTempSizer::size(EnergyPlusData &state, Real64 _ori } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(state, this->compName, this->compType, this->autoSizedValue); + ReportCoilSelection::setCoilLvgAirTemp(state, this->coilReportNum, this->autoSizedValue); } return this->autoSizedValue; } @@ -392,7 +392,7 @@ Real64 HeatingCoilDesAirInletHumRatSizer::size(EnergyPlusData &state, Real64 _or } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(state, this->compName, this->compType, this->autoSizedValue); + ReportCoilSelection::setCoilEntAirHumRat(state, this->coilReportNum, this->autoSizedValue); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/Base.cc b/src/EnergyPlus/Autosizing/Base.cc index 61e70a3fb4c..10a0284b5e3 100644 --- a/src/EnergyPlus/Autosizing/Base.cc +++ b/src/EnergyPlus/Autosizing/Base.cc @@ -108,6 +108,7 @@ void BaseSizer::initializeWithinEP(EnergyPlusData &state, this->airloopDOAS = state.dataAirLoopHVACDOAS->airloopDOAS; if (EnergyPlus::BaseSizer::isValidCoilType(this->compType)) { // coil reports fail if compType is not one of HVAC::cAllCoilTypes this->isCoilReportObject = true; + // this->coilReportNum = ReportCoilSelection::getReportIndex(state, this->compName, this->coilType); } if (EnergyPlus::BaseSizer::isValidFanType(this->compType)) { // fan reports fail if compType is not a valid fan type this->isFanReportObject = true; diff --git a/src/EnergyPlus/Autosizing/Base.hh b/src/EnergyPlus/Autosizing/Base.hh index 776f03f864b..e1e0593b38a 100644 --- a/src/EnergyPlus/Autosizing/Base.hh +++ b/src/EnergyPlus/Autosizing/Base.hh @@ -123,6 +123,7 @@ struct BaseSizer bool dataScalableSizingON = false; bool dataScalableCapSizingON = false; bool isCoilReportObject = false; // provides access to coil reporting + int coilReportNum = -1; // Coil report number for direct access bool isFanReportObject = false; // provides access to fan reporting bool initialized = false; // indicates initializeWithinEP was called AutoSizingResultType errorType = AutoSizingResultType::NoError; diff --git a/src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc b/src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc index 658731242e3..8ee836c4921 100644 --- a/src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc +++ b/src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc @@ -101,10 +101,9 @@ void BaseSizerWithScalableInputs::initializeWithinEP(EnergyPlusData &state, // This should work for both fan types if (this->primaryAirSystem(this->curSysNum).supFanNum > 0) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( + ReportCoilSelection::setCoilSupplyFanInfo( state, - this->compName, - this->compType, + this->coilReportNum, state.dataFans->fans(this->primaryAirSystem(this->curSysNum).supFanNum)->Name, state.dataFans->fans(this->primaryAirSystem(this->curSysNum).supFanNum)->type, this->primaryAirSystem(this->curSysNum).supFanNum); diff --git a/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc b/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc index 0bfba685aac..26f8b4c6b03 100644 --- a/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc @@ -378,8 +378,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b if (this->isCoilReportObject) { // SizingResult is airflow in m3/s - state.dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow( - state, this->compName, this->compType, this->autoSizedValue, this->wasAutoSized); + ReportCoilSelection::setCoilAirFlow(state, this->coilReportNum, this->autoSizedValue, this->wasAutoSized); } if (this->isFanReportObject) { // fill fan peak day and time here @@ -397,8 +396,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (heatingFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && @@ -408,7 +406,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } diff --git a/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc b/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc index aa282a4b737..c8e21e3c0df 100644 --- a/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc @@ -275,12 +275,11 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, CoilOutHumRat = state.dataSize->DataCoilSizingAirOutHumRat; FanCoolLoad = state.dataSize->DataCoilSizingFanCoolLoad; TotCapTempModFac = state.dataSize->DataCoilSizingCapFT; - if (state.dataRptCoilSelection->coilSelectionReportObj->isCompTypeCoil(this->compType)) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(state, this->compName, this->compType, CoilInHumRat); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp( - state, this->compName, this->compType, CoilInTemp, this->curSysNum, this->curZoneEqNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(state, this->compName, this->compType, CoilOutTemp); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirHumRat(state, this->compName, this->compType, CoilOutHumRat); + if (ReportCoilSelection::isCompTypeCoil(this->compType)) { + ReportCoilSelection::setCoilEntAirHumRat(state, this->coilReportNum, CoilInHumRat); + ReportCoilSelection::setCoilEntAirTemp(state, this->coilReportNum, CoilInTemp, this->curSysNum, this->curZoneEqNum); + ReportCoilSelection::setCoilLvgAirTemp(state, this->coilReportNum, CoilOutTemp); + ReportCoilSelection::setCoilLvgAirHumRat(state, this->coilReportNum, CoilOutHumRat); } } else if (this->curOASysNum > 0 && this->outsideAirSys(this->curOASysNum).AirLoopDOASNum > -1) { auto &thisAirloopDOAS = this->airloopDOAS[this->outsideAirSys(this->curOASysNum).AirLoopDOASNum]; @@ -569,26 +568,24 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, if (this->isCoilReportObject && this->curSysNum <= state.dataHVACGlobal->NumPrimaryAirSys) { if (CoilInTemp > -999.0) { // set inlet air properties used during capacity sizing if available, allow for negative winter temps - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp( - state, this->compName, this->compType, CoilInTemp, this->curSysNum, this->curZoneEqNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(state, this->compName, this->compType, CoilInHumRat); + ReportCoilSelection::setCoilEntAirTemp(state, this->coilReportNum, CoilInTemp, this->curSysNum, this->curZoneEqNum); + ReportCoilSelection::setCoilEntAirHumRat(state, this->coilReportNum, CoilInHumRat); } if (CoilOutTemp > -999.0) { // set outlet air properties used during capacity sizing if available - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(state, this->compName, this->compType, CoilOutTemp); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirHumRat(state, this->compName, this->compType, CoilOutHumRat); + ReportCoilSelection::setCoilLvgAirTemp(state, this->coilReportNum, CoilOutTemp); + ReportCoilSelection::setCoilLvgAirHumRat(state, this->coilReportNum, CoilOutHumRat); } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilCoolingCapacity(state, - this->compName, - this->compType, - this->autoSizedValue, - this->wasAutoSized, - this->curSysNum, - this->curZoneEqNum, - this->curOASysNum, - FanCoolLoad, - TotCapTempModFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + ReportCoilSelection::setCoilCoolingCapacity(state, + this->coilReportNum, + this->autoSizedValue, + this->wasAutoSized, + this->curSysNum, + this->curZoneEqNum, + this->curOASysNum, + FanCoolLoad, + TotCapTempModFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/CoolingWaterDesAirInletHumRatSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterDesAirInletHumRatSizing.cc index 0d5cc35cdbf..0b1a6343d26 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterDesAirInletHumRatSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterDesAirInletHumRatSizing.cc @@ -107,7 +107,7 @@ Real64 CoolingWaterDesAirInletHumRatSizer::size(EnergyPlusData &state, Real64 _o } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(state, this->compName, this->compType, this->autoSizedValue); + ReportCoilSelection::setCoilEntAirHumRat(state, this->coilReportNum, this->autoSizedValue); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/CoolingWaterDesAirInletTempSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterDesAirInletTempSizing.cc index 2df208f92cf..835cce9dc1f 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterDesAirInletTempSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterDesAirInletTempSizing.cc @@ -132,8 +132,7 @@ Real64 CoolingWaterDesAirInletTempSizer::size(EnergyPlusData &state, Real64 _ori this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { if (this->curSysNum <= this->numPrimaryAirSys) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp( - state, this->compName, this->compType, this->autoSizedValue, this->curSysNum, this->curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp(state, this->coilReportNum, this->autoSizedValue, this->curSysNum, this->curZoneEqNum); } } return this->autoSizedValue; diff --git a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc index 7105c253db9..569afa8fe8f 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletHumRatSizing.cc @@ -161,7 +161,7 @@ Real64 CoolingWaterDesAirOutletHumRatSizer::size(EnergyPlusData &state, Real64 _ } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirHumRat(state, this->compName, this->compType, this->autoSizedValue); + ReportCoilSelection::setCoilLvgAirHumRat(state, this->coilReportNum, this->autoSizedValue); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc index 41957522c11..98e50703f06 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterDesAirOutletTempSizing.cc @@ -175,7 +175,7 @@ Real64 CoolingWaterDesAirOutletTempSizer::size(EnergyPlusData &state, Real64 _or } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(state, this->compName, this->compType, this->autoSizedValue); + ReportCoilSelection::setCoilLvgAirTemp(state, this->coilReportNum, this->autoSizedValue); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/CoolingWaterDesWaterInletTempSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterDesWaterInletTempSizing.cc index 166bee69edf..7a8b5ec6244 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterDesWaterInletTempSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterDesWaterInletTempSizing.cc @@ -72,7 +72,7 @@ Real64 CoolingWaterDesWaterInletTempSizer::size(EnergyPlusData &state, Real64 _o } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntWaterTemp(state, this->compName, this->compType, this->autoSizedValue); + ReportCoilSelection::setCoilEntWaterTemp(state, this->coilReportNum, this->autoSizedValue); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc b/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc index 9bc1f9c7665..9829fb5b0d7 100644 --- a/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingWaterflowSizing.cc @@ -153,18 +153,15 @@ Real64 CoolingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowPltSizNum( - state, this->compName, this->compType, this->autoSizedValue, this->wasAutoSized, this->dataPltSizCoolNum, this->dataWaterLoopNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterDeltaT(state, this->compName, this->compType, CoilDesWaterDeltaT); + ReportCoilSelection::setCoilWaterFlowPltSizNum( + state, this->coilReportNum, this->autoSizedValue, this->wasAutoSized, this->dataPltSizCoolNum, this->dataWaterLoopNum); + ReportCoilSelection::setCoilWaterDeltaT(state, this->coilReportNum, CoilDesWaterDeltaT); if (this->dataDesInletWaterTemp > 0.0) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntWaterTemp( - state, this->compName, this->compType, this->dataDesInletWaterTemp); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgWaterTemp( - state, this->compName, this->compType, this->dataDesInletWaterTemp + CoilDesWaterDeltaT); + ReportCoilSelection::setCoilEntWaterTemp(state, this->coilReportNum, this->dataDesInletWaterTemp); + ReportCoilSelection::setCoilLvgWaterTemp(state, this->coilReportNum, this->dataDesInletWaterTemp + CoilDesWaterDeltaT); } else { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntWaterTemp(state, this->compName, this->compType, Constant::CWInitConvTemp); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgWaterTemp( - state, this->compName, this->compType, Constant::CWInitConvTemp + CoilDesWaterDeltaT); + ReportCoilSelection::setCoilEntWaterTemp(state, this->coilReportNum, Constant::CWInitConvTemp); + ReportCoilSelection::setCoilLvgWaterTemp(state, this->coilReportNum, Constant::CWInitConvTemp + CoilDesWaterDeltaT); } this->calcCoilWaterFlowRates(state, this->compName, diff --git a/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc b/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc index 7b48bd0978e..5f706f3fb5f 100644 --- a/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingAirFlowSizing.cc @@ -280,8 +280,7 @@ Real64 HeatingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b if (this->isCoilReportObject) { // SizingResult is airflow in m3/s - state.dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow( - state, this->compName, this->compType, this->autoSizedValue, this->wasAutoSized); + ReportCoilSelection::setCoilAirFlow(state, this->coilReportNum, this->autoSizedValue, this->wasAutoSized); } if (this->isFanReportObject) { // fill fan peak day and time here diff --git a/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc b/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc index 2aab698d5f3..7d081b20db2 100644 --- a/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingCapacitySizing.cc @@ -463,29 +463,27 @@ Real64 HeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, if (this->isCoilReportObject) { if (CoilInTemp > -999.0) { // set inlet air properties used during capacity sizing if available, allow for negative winter temps - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp( - state, this->compName, this->compType, CoilInTemp, this->curSysNum, this->curZoneEqNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(state, this->compName, this->compType, CoilInHumRat); + ReportCoilSelection::setCoilEntAirTemp(state, this->coilReportNum, CoilInTemp, this->curSysNum, this->curZoneEqNum); + ReportCoilSelection::setCoilEntAirHumRat(state, this->coilReportNum, CoilInHumRat); } if (CoilOutTemp > -999.0) { // set outlet air properties used during capacity sizing if available - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(state, this->compName, this->compType, CoilOutTemp); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirHumRat(state, this->compName, this->compType, CoilOutHumRat); + ReportCoilSelection::setCoilLvgAirTemp(state, this->coilReportNum, CoilOutTemp); + ReportCoilSelection::setCoilLvgAirHumRat(state, this->coilReportNum, CoilOutHumRat); } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow(state, this->compName, this->compType, DesVolFlow, this->wasAutoSized); + ReportCoilSelection::setCoilAirFlow(state, this->coilReportNum, DesVolFlow, this->wasAutoSized); Real64 constexpr FanCoolLoad = 0.0; Real64 constexpr TotCapTempModFac = 1.0; - state.dataRptCoilSelection->coilSelectionReportObj->setCoilHeatingCapacity(state, - this->compName, - this->compType, - this->autoSizedValue, - this->wasAutoSized, - this->curSysNum, - this->curZoneEqNum, - this->curOASysNum, - FanCoolLoad, - TotCapTempModFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + ReportCoilSelection::setCoilHeatingCapacity(state, + this->coilReportNum, + this->autoSizedValue, + this->wasAutoSized, + this->curSysNum, + this->curZoneEqNum, + this->curOASysNum, + FanCoolLoad, + TotCapTempModFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/HeatingWaterDesAirInletHumRatSizing.cc b/src/EnergyPlus/Autosizing/HeatingWaterDesAirInletHumRatSizing.cc index b07105c82c0..e9bd678110d 100644 --- a/src/EnergyPlus/Autosizing/HeatingWaterDesAirInletHumRatSizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingWaterDesAirInletHumRatSizing.cc @@ -117,7 +117,7 @@ Real64 HeatingWaterDesAirInletHumRatSizer::size(EnergyPlusData &state, Real64 _o } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(state, this->compName, this->compType, this->autoSizedValue); + ReportCoilSelection::setCoilEntAirHumRat(state, this->coilReportNum, this->autoSizedValue); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/HeatingWaterDesAirInletTempSizing.cc b/src/EnergyPlus/Autosizing/HeatingWaterDesAirInletTempSizing.cc index 7fa37f18516..2b61a1afcc7 100644 --- a/src/EnergyPlus/Autosizing/HeatingWaterDesAirInletTempSizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingWaterDesAirInletTempSizing.cc @@ -126,8 +126,7 @@ Real64 HeatingWaterDesAirInletTempSizer::size(EnergyPlusData &state, Real64 _ori // report not written for OA coils and needs to be corrected if (this->curSysNum <= this->numPrimaryAirSys) { if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp( - state, this->compName, this->compType, this->autoSizedValue, this->curSysNum, this->curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp(state, this->coilReportNum, this->autoSizedValue, this->curSysNum, this->curZoneEqNum); } } return this->autoSizedValue; diff --git a/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc b/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc index af9edf957f5..beb35a72bb3 100644 --- a/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingWaterDesCoilLoadUsedForUASizing.cc @@ -74,7 +74,7 @@ Real64 HeatingWaterDesCoilLoadUsedForUASizer::size(EnergyPlusData &state, Real64 Real64 const rho = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getDensity(state, Constant::HWInitConvTemp, this->callingRoutine); this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho; - state.dataRptCoilSelection->coilSelectionReportObj->setCoilReheatMultiplier(state, this->compName, this->compType, 1.0); + ReportCoilSelection::setCoilReheatMultiplier(state, this->coilReportNum, 1.0); } else if ((this->termUnitPIU || this->termUnitIU) && (this->curTermUnitSizingNum > 0)) { Real64 const Cp = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getSpecificHeat(state, Constant::HWInitConvTemp, this->callingRoutine); @@ -88,7 +88,7 @@ Real64 HeatingWaterDesCoilLoadUsedForUASizer::size(EnergyPlusData &state, Real64 Real64 const rho = state.dataPlnt->PlantLoop(this->dataWaterLoopNum).glycol->getDensity(state, Constant::HWInitConvTemp, this->callingRoutine); this->autoSizedValue = this->dataWaterFlowUsedForSizing * this->dataWaterCoilSizHeatDeltaT * Cp * rho; - state.dataRptCoilSelection->coilSelectionReportObj->setCoilReheatMultiplier(state, this->compName, this->compType, 1.0); + ReportCoilSelection::setCoilReheatMultiplier(state, this->coilReportNum, 1.0); } else { Real64 DesMassFlow = 0.0; if (this->zoneEqSizing(this->curZoneEqNum).SystemAirFlow) { @@ -178,18 +178,17 @@ Real64 HeatingWaterDesCoilLoadUsedForUASizer::size(EnergyPlusData &state, Real64 Real64 constexpr TotCapTempModFac = 1.0; Real64 constexpr DXFlowPerCapMinRatio = 1.0; Real64 constexpr DXFlowPerCapMaxRatio = 1.0; - state.dataRptCoilSelection->coilSelectionReportObj->setCoilHeatingCapacity(state, - this->compName, - this->compType, - this->autoSizedValue, - this->wasAutoSized, - this->curSysNum, - this->curZoneEqNum, - this->curOASysNum, - FanCoolLoad, - TotCapTempModFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + ReportCoilSelection::setCoilHeatingCapacity(state, + this->coilReportNum, + this->autoSizedValue, + this->wasAutoSized, + this->curSysNum, + this->curZoneEqNum, + this->curOASysNum, + FanCoolLoad, + TotCapTempModFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/HeatingWaterDesCoilWaterVolFlowUsedForUASizing.cc b/src/EnergyPlus/Autosizing/HeatingWaterDesCoilWaterVolFlowUsedForUASizing.cc index 22fb6fd9bfc..566a6013ba7 100644 --- a/src/EnergyPlus/Autosizing/HeatingWaterDesCoilWaterVolFlowUsedForUASizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingWaterDesCoilWaterVolFlowUsedForUASizing.cc @@ -83,10 +83,10 @@ Real64 HeatingWaterDesCoilWaterVolFlowUsedForUASizer::size(EnergyPlusData &state } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowPltSizNum( - state, this->compName, this->compType, this->autoSizedValue, this->wasAutoSized, this->dataPltSizHeatNum, this->dataWaterLoopNum); + ReportCoilSelection::setCoilWaterFlowPltSizNum( + state, this->coilReportNum, this->autoSizedValue, this->wasAutoSized, this->dataPltSizHeatNum, this->dataWaterLoopNum); if (this->termUnitSingDuct || this->zoneEqFanCoil || ((this->termUnitPIU || this->termUnitIU) && this->curTermUnitSizingNum > 0)) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilReheatMultiplier(state, this->compName, this->compType, 1.0); + ReportCoilSelection::setCoilReheatMultiplier(state, this->coilReportNum, 1.0); } } return this->autoSizedValue; diff --git a/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc b/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc index 95726f1908b..5264a270ad7 100644 --- a/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc +++ b/src/EnergyPlus/Autosizing/HeatingWaterflowSizing.cc @@ -145,14 +145,13 @@ Real64 HeatingWaterflowSizer::size(EnergyPlusData &state, Real64 _originalValue, } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowPltSizNum( - state, this->compName, this->compType, this->autoSizedValue, this->wasAutoSized, this->dataPltSizHeatNum, this->dataWaterLoopNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntWaterTemp(state, this->compName, this->compType, Constant::HWInitConvTemp); + ReportCoilSelection::setCoilWaterFlowPltSizNum( + state, this->coilReportNum, this->autoSizedValue, this->wasAutoSized, this->dataPltSizHeatNum, this->dataWaterLoopNum); + ReportCoilSelection::setCoilEntWaterTemp(state, this->coilReportNum, Constant::HWInitConvTemp); if (!this->plantSizData.empty() && this->dataPltSizHeatNum > 0) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterDeltaT( - state, this->compName, this->compType, this->plantSizData(this->dataPltSizHeatNum).DeltaT); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgWaterTemp( - state, this->compName, this->compType, Constant::HWInitConvTemp - this->plantSizData(this->dataPltSizHeatNum).DeltaT); + ReportCoilSelection::setCoilWaterDeltaT(state, this->coilReportNum, this->plantSizData(this->dataPltSizHeatNum).DeltaT); + ReportCoilSelection::setCoilLvgWaterTemp( + state, this->coilReportNum, Constant::HWInitConvTemp - this->plantSizData(this->dataPltSizHeatNum).DeltaT); } this->calcCoilWaterFlowRates(state, this->compName, diff --git a/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc b/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc index 49ced2b7e91..30464200f6c 100644 --- a/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc @@ -91,7 +91,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -102,7 +102,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).AirVolFlow) { @@ -118,7 +118,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { @@ -130,7 +130,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { @@ -142,7 +142,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -154,7 +154,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -168,7 +168,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { @@ -179,7 +179,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -194,7 +194,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -205,7 +205,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -221,7 +221,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { @@ -233,7 +233,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { @@ -245,7 +245,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -257,7 +257,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -273,7 +273,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == @@ -285,7 +285,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -302,7 +302,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == @@ -314,7 +314,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -329,7 +329,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { @@ -341,7 +341,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { @@ -353,7 +353,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -365,7 +365,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -381,7 +381,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == @@ -393,7 +393,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -410,7 +410,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == @@ -422,7 +422,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -437,7 +437,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { @@ -449,7 +449,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { @@ -461,7 +461,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -473,7 +473,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -487,7 +487,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { @@ -498,7 +498,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -513,7 +513,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { @@ -524,7 +524,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -539,7 +539,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { @@ -551,7 +551,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { @@ -563,7 +563,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -575,7 +575,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -589,7 +589,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { @@ -600,7 +600,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -615,7 +615,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { @@ -626,7 +626,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -641,7 +641,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -653,7 +653,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { @@ -667,7 +667,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { @@ -678,7 +678,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -696,7 +696,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { @@ -708,7 +708,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else { @@ -722,7 +722,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { @@ -733,7 +733,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } @@ -824,7 +824,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo dateTimeFanPeak = EnergyPlus::format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesCoolVolFlow) { @@ -836,7 +836,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, sysSizPeakDDNum.TimeStepAtCoolFlowPk(sysSizPeakDDNum.CoolFlowPeakDD))); } } @@ -856,7 +856,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, sysSizPeakDDNum.TimeStepAtCoolFlowPk(sysSizPeakDDNum.CoolFlowPeakDD))); } @@ -868,7 +868,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo dateTimeFanPeak = EnergyPlus::format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } @@ -881,7 +881,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, sysSizPeakDDNum.TimeStepAtCoolFlowPk(sysSizPeakDDNum.CoolFlowPeakDD))); } } else if (unitarysysEqSizing.HeatingAirFlow) { @@ -893,7 +893,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo dateTimeFanPeak = EnergyPlus::format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } @@ -907,7 +907,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo dateTimeFanPeak = EnergyPlus::format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesCoolVolFlow) { @@ -918,7 +918,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, sysSizPeakDDNum.TimeStepAtCoolFlowPk(sysSizPeakDDNum.CoolFlowPeakDD))); } } @@ -933,7 +933,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo dateTimeFanPeak = EnergyPlus::format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesCoolVolFlow) { @@ -944,7 +944,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo EnergyPlus::format("{}/{} {}", desDayInput.Month, desDayInput.DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText( + ReportCoilSelection::getTimeText( state, sysSizPeakDDNum.TimeStepAtCoolFlowPk(sysSizPeakDDNum.CoolFlowPeakDD))); } } @@ -1009,7 +1009,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->selectSizerOutput(state, errorsFound); if (this->isFanReportObject) { // fill fan peak day and time here - if (state.dataRptCoilSelection->coilSelectionReportObj->isCompTypeFan(this->compType)) { + if (ReportCoilSelection::isCompTypeFan(this->compType)) { if (this->dataScalableSizingON) { DDNameFanPeak = "Scaled size, not from any peak"; dateTimeFanPeak = "Scaled size, not from any peak"; diff --git a/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc b/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc index 7bac6c13fde..fb0a8f14a54 100644 --- a/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/WaterHeatingCapacitySizing.cc @@ -150,8 +150,8 @@ Real64 WaterHeatingCapacitySizer::size(EnergyPlusData &state, Real64 _originalVa } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterHeaterCapacityPltSizNum( - state, this->compName, this->compType, this->autoSizedValue, this->wasAutoSized, this->dataPltSizHeatNum, this->dataWaterLoopNum); + ReportCoilSelection::setCoilWaterHeaterCapacityPltSizNum( + state, this->coilReportNum, this->autoSizedValue, this->wasAutoSized, this->dataPltSizHeatNum, this->dataWaterLoopNum); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/WaterHeatingCoilUASizing.cc b/src/EnergyPlus/Autosizing/WaterHeatingCoilUASizing.cc index bd3bcab3ade..71084f48efe 100644 --- a/src/EnergyPlus/Autosizing/WaterHeatingCoilUASizing.cc +++ b/src/EnergyPlus/Autosizing/WaterHeatingCoilUASizing.cc @@ -408,14 +408,13 @@ Real64 WaterHeatingCoilUASizer::size(EnergyPlusData &state, Real64 _originalValu } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject && this->curSysNum <= state.dataHVACGlobal->NumPrimaryAirSys) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilUA(state, - this->compName, - this->compType, - this->autoSizedValue, - this->dataCapacityUsedForSizing, - this->wasAutoSized, - this->curSysNum, - this->curZoneEqNum); + ReportCoilSelection::setCoilUA(state, + this->coilReportNum, + this->autoSizedValue, + this->dataCapacityUsedForSizing, + this->wasAutoSized, + this->curSysNum, + this->curZoneEqNum); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Coils/CoilCoolingDX.cc b/src/EnergyPlus/Coils/CoilCoolingDX.cc index 42cdba8e0ad..53b0ac6521f 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDX.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDX.cc @@ -803,23 +803,21 @@ void CoilCoolingDX::simulate(EnergyPlusData &state, // report out final coil sizing info Real64 ratedSensCap(0.0); ratedSensCap = this->performance->ratedGrossTotalCap() * this->performance->grossRatedSHR(state); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes(state, - this->name, - state.dataCoilCoolingDX->coilCoolingDXObjectName, - this->performance->ratedGrossTotalCap(), - ratedSensCap, - this->performance->ratedEvapAirFlowRate(state), - -999.0); + ReportCoilSelection::setCoilFinalSizes(state, + this->coilReportNum, + this->performance->ratedGrossTotalCap(), + ratedSensCap, + this->performance->ratedEvapAirFlowRate(state), + -999.0); // report out fan information // should work for all fan types if (this->supplyFanIndex > 0) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo(state, - this->name, - state.dataCoilCoolingDX->coilCoolingDXObjectName, - state.dataFans->fans(this->supplyFanIndex)->Name, - state.dataFans->fans(this->supplyFanIndex)->type, - this->supplyFanIndex); + ReportCoilSelection::setCoilSupplyFanInfo(state, + this->coilReportNum, + state.dataFans->fans(this->supplyFanIndex)->Name, + state.dataFans->fans(this->supplyFanIndex)->type, + this->supplyFanIndex); } // report out coil rating conditions, just create a set of dummy nodes and run calculate on them @@ -899,22 +897,21 @@ void CoilCoolingDX::simulate(EnergyPlusData &state, Real64 const ratedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb( state, dummyEvapOutlet.Temp, dummyEvapOutlet.HumRat, DataEnvironment::StdPressureSeaLevel, "Coil:Cooling:DX::simulate"); - state.dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions(state, - this->name, - state.dataCoilCoolingDX->coilCoolingDXObjectName, - coolingRate, - sensCoolingRate, - ratedInletEvapMassFlowRate, - RatedInletAirTemp, - dummyInletAirHumRat, - RatedInletWetBulbTemp, - dummyEvapOutlet.Temp, - dummyEvapOutlet.HumRat, - ratedOutletWetBulb, - RatedOutdoorAirTemp, - ratedOutdoorAirWetBulb, - this->performance->ratedCBF(state), - -999.0); + ReportCoilSelection::setRatedCoilConditions(state, + this->coilReportNum, + coolingRate, + sensCoolingRate, + ratedInletEvapMassFlowRate, + RatedInletAirTemp, + dummyInletAirHumRat, + RatedInletWetBulbTemp, + dummyEvapOutlet.Temp, + dummyEvapOutlet.HumRat, + ratedOutletWetBulb, + RatedOutdoorAirTemp, + ratedOutdoorAirWetBulb, + this->performance->ratedCBF(state), + -999.0); this->reportCoilFinalSizes = false; } diff --git a/src/EnergyPlus/Coils/CoilCoolingDX.hh b/src/EnergyPlus/Coils/CoilCoolingDX.hh index c2c214e6e78..14f1fbd8b43 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDX.hh +++ b/src/EnergyPlus/Coils/CoilCoolingDX.hh @@ -115,6 +115,7 @@ struct CoilCoolingDX CoilCoolingDXInputSpecification original_input_specs; std::string name; + int coilReportNum = -1; bool myOneTimeInitFlag = true; int evapInletNodeIndex = 0; int evapOutletNodeIndex = 0; diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index a7356afb99f..baeb1d78c3d 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -927,6 +927,9 @@ void GetDXCoils(EnergyPlusData &state) state.dataHeatBal->HeatReclaimDXCoil(DXCoilNum).SourceType = CurrentModuleObject; thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilDX_CoolingSingleSpeed; + + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -1415,6 +1418,9 @@ void GetDXCoils(EnergyPlusData &state) state.dataHeatBal->HeatReclaimDXCoil(DXCoilNum).SourceType = CurrentModuleObject; thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilDX_CoolingTwoStageWHumControl; + + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -1981,6 +1987,9 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.Name = Alphas(1); thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilDX_HeatingEmpirical; + + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -2463,6 +2472,9 @@ void GetDXCoils(EnergyPlusData &state) state.dataHeatBal->HeatReclaimDXCoil(DXCoilNum).SourceType = CurrentModuleObject; thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilDX_CoolingTwoSpeed; + + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -3026,6 +3038,8 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilDX_HeatPumpWaterHeaterPumped; + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + ErrorObjectHeader eoh{routineName, CurrentModuleObject, thisDXCoil.Name}; std::string const availSchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "availability_schedule_name"); @@ -3566,6 +3580,8 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilDX_HeatPumpWaterHeaterWrapped; + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + ErrorObjectHeader eoh{routineName, CurrentModuleObject, thisDXCoil.Name}; std::string const availSchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "availability_schedule_name"); @@ -3998,6 +4014,9 @@ void GetDXCoils(EnergyPlusData &state) state.dataHeatBal->HeatReclaimDXCoil(DXCoilNum).SourceType = CurrentModuleObject; thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilDX_MultiSpeedCooling; + + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -4567,6 +4586,9 @@ void GetDXCoils(EnergyPlusData &state) state.dataHeatBal->HeatReclaimDXCoil(DXCoilNum).SourceType = CurrentModuleObject; thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilDX_MultiSpeedHeating; + + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -5075,6 +5097,8 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilVRF_Cooling; + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -5216,6 +5240,9 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.Name = Alphas(1); thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilVRF_Heating; + + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -5346,6 +5373,9 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.Name = Alphas(1); thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilVRF_FluidTCtrl_Cooling; + + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -5462,6 +5492,9 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.Name = Alphas(1); thisDXCoil.DXCoilType = CurrentModuleObject; thisDXCoil.DXCoilType_Num = HVAC::CoilVRF_FluidTCtrl_Heating; + + // thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -7080,10 +7113,9 @@ void InitDXCoil(EnergyPlusData &state, int const DXCoilNum) // number of the cur RatedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb( state, thisDXCoil.OutletAirTemp, thisDXCoil.OutletAirHumRat, DataEnvironment::StdPressureSeaLevel, RoutineName); - state.dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions( + ReportCoilSelection::setRatedCoilConditions( state, - thisDXCoil.Name, - thisDXCoil.DXCoilType, + thisDXCoil.coilReportNum, thisDXCoil.TotalCoolingEnergyRate, // this is the report variable thisDXCoil.SensCoolingEnergyRate, // this is the report variable thisDXCoil.InletAirMassFlowRate, @@ -7245,10 +7277,9 @@ void InitDXCoil(EnergyPlusData &state, int const DXCoilNum) // number of the cur RatedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb( state, thisDXCoil.OutletAirTemp, thisDXCoil.OutletAirHumRat, DataEnvironment::StdPressureSeaLevel, RoutineName); - state.dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions( + ReportCoilSelection::setRatedCoilConditions( state, - thisDXCoil.Name, - thisDXCoil.DXCoilType, + thisDXCoil.coilReportNum, thisDXCoil.TotalHeatingEnergyRate, // this is the report variable thisDXCoil.TotalHeatingEnergyRate, // this is the report variable thisDXCoil.InletAirMassFlowRate, @@ -7391,8 +7422,8 @@ void InitDXCoil(EnergyPlusData &state, int const DXCoilNum) // number of the cur } // store fan info for coil - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, thisDXCoil.Name, thisDXCoil.DXCoilType, thisDXCoil.SupplyFanName, thisDXCoil.supplyFanType, thisDXCoil.SupplyFanIndex); + ReportCoilSelection::setCoilSupplyFanInfo( + state, thisDXCoil.coilReportNum, thisDXCoil.SupplyFanName, thisDXCoil.supplyFanType, thisDXCoil.SupplyFanIndex); } AirInletNode = thisDXCoil.AirInNode; @@ -14610,8 +14641,8 @@ void ReportDXCoil(EnergyPlusData &state, int const DXCoilNum) // number of the c if (!state.dataGlobal->WarmupFlag && !state.dataGlobal->DoingHVACSizingSimulations && !state.dataGlobal->DoingSizing) { Real64 ratedSensCap(0.0); ratedSensCap = thisDXCoil.RatedTotCap(1) * thisDXCoil.RatedSHR(1); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes( - state, thisDXCoil.Name, thisDXCoil.DXCoilType, thisDXCoil.RatedTotCap(1), ratedSensCap, thisDXCoil.RatedAirVolFlowRate(1), -999.0); + ReportCoilSelection::setCoilFinalSizes( + state, thisDXCoil.coilReportNum, thisDXCoil.RatedTotCap(1), ratedSensCap, thisDXCoil.RatedAirVolFlowRate(1), -999.0); thisDXCoil.reportCoilFinalSizes = false; } } @@ -16399,12 +16430,11 @@ void SetDXCoolingCoilData( if (present(supplyFanType)) { thisDXCoil.supplyFanType = supplyFanType; if (thisDXCoil.SupplyFanIndex > 0) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo(state, - thisDXCoil.Name, - thisDXCoil.DXCoilType, - state.dataFans->fans(thisDXCoil.SupplyFanIndex)->Name, - state.dataFans->fans(thisDXCoil.SupplyFanIndex)->type, - thisDXCoil.SupplyFanIndex); + ReportCoilSelection::setCoilSupplyFanInfo(state, + thisDXCoil.coilReportNum, + state.dataFans->fans(thisDXCoil.SupplyFanIndex)->Name, + state.dataFans->fans(thisDXCoil.SupplyFanIndex)->type, + thisDXCoil.SupplyFanIndex); } } } diff --git a/src/EnergyPlus/DXCoils.hh b/src/EnergyPlus/DXCoils.hh index 08711e26cda..934b75562b1 100644 --- a/src/EnergyPlus/DXCoils.hh +++ b/src/EnergyPlus/DXCoils.hh @@ -110,6 +110,8 @@ namespace DXCoils { std::string Name; // Name of the DX Coil std::string DXCoilType; // type of coil int DXCoilType_Num; // Integer equivalent to DXCoilType + int coilReportNum = -1; + Sched::Schedule *availSched = nullptr; // availability schedule // RatedCoolCap, RatedSHR and RatedCOP do not include the thermal or electrical // effects due to the supply air fan diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index f6880a4bfaa..eefa50c9ba1 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -964,10 +964,10 @@ namespace FanCoilUnits { OutputProcessor::StoreType::Average, fanCoil.Name); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, fanCoil.CCoilName, fanCoil.CCoilType, fanCoil.FanName, fanCoil.fanType, fanCoil.FanIndex); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, fanCoil.HCoilName, fanCoil.HCoilType, fanCoil.FanName, fanCoil.fanType, fanCoil.FanIndex); + // ReportCoilSelection::setCoilSupplyFanInfo(state, ReportCoilSelection::getReportIndex(fanCoil.CCoilName, fanCoil.CCoilType), + // fanCoil.FanName, fanCoil.fanType, fanCoil.FanIndex); + // ReportCoilSelection::setCoilSupplyFanInfo(state, ReportCoilSelection::getReportIndex(fanCoil.HCoilName, fanCoil.HCoilType), + // fanCoil.FanName, fanCoil.fanType, fanCoil.FanIndex); } } diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index 28b644efc44..ed8eabe7247 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -361,6 +361,8 @@ namespace HeatingCoils { heatingCoil.HeatingCoilModel = "Electric"; heatingCoil.HCoilType_Num = HVAC::Coil_HeatingElectric; + // heatingCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, heatingCoil.Name, heatingCoil.coilType); + heatingCoil.Efficiency = Numbers(1); heatingCoil.NominalCapacity = Numbers(2); errFlag = false; @@ -480,6 +482,8 @@ namespace HeatingCoils { heatingCoil.HeatingCoilModel = "Electric:MultiStage"; heatingCoil.HCoilType_Num = HVAC::Coil_HeatingElectric_MultiStage; + // heatingCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, heatingCoil.Name, heatingCoil.coilType); + heatingCoil.NumOfStages = static_cast(Numbers(1)); heatingCoil.MSEfficiency.allocate(heatingCoil.NumOfStages); @@ -607,6 +611,8 @@ namespace HeatingCoils { heatingCoil.HeatingCoilModel = "Fuel"; heatingCoil.HCoilType_Num = HVAC::Coil_HeatingGasOrOtherFuel; + // heatingCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, heatingCoil.Name, heatingCoil.coilType); + heatingCoil.FuelType = static_cast(getEnumValue(Constant::eFuelNamesUC, Alphas(3))); if (!(heatingCoil.FuelType == Constant::eFuel::NaturalGas || heatingCoil.FuelType == Constant::eFuel::Propane || heatingCoil.FuelType == Constant::eFuel::Diesel || heatingCoil.FuelType == Constant::eFuel::Gasoline || @@ -796,6 +802,8 @@ namespace HeatingCoils { heatingCoil.HeatingCoilModel = "Gas:MultiStage"; heatingCoil.HCoilType_Num = HVAC::Coil_HeatingGas_MultiStage; + // heatingCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, heatingCoil.Name, heatingCoil.coilType); + heatingCoil.ParasiticFuelCapacity = Numbers(1); heatingCoil.NumOfStages = static_cast(Numbers(2)); @@ -979,6 +987,8 @@ namespace HeatingCoils { heatingCoil.HeatingCoilModel = "Desuperheater"; heatingCoil.HCoilType_Num = HVAC::Coil_HeatingDesuperheater; + // heatingCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, heatingCoil.Name, heatingCoil.coilType); + // HeatingCoil(CoilNum)%Efficiency = Numbers(1) //(Numbers(1)) error limits checked and defaults applied on efficiency after // identifying source type. @@ -2842,8 +2852,8 @@ namespace HeatingCoils { } if (heatingCoil.reportCoilFinalSizes) { if (!state.dataGlobal->WarmupFlag && !state.dataGlobal->DoingHVACSizingSimulations && !state.dataGlobal->DoingSizing) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes( - state, heatingCoil.Name, coilObjClassName, heatingCoil.NominalCapacity, heatingCoil.NominalCapacity, -999.0, -999.0); + ReportCoilSelection::setCoilFinalSizes( + state, heatingCoil.coilReportNum, heatingCoil.NominalCapacity, heatingCoil.NominalCapacity, -999.0, -999.0); heatingCoil.reportCoilFinalSizes = false; } } diff --git a/src/EnergyPlus/HeatingCoils.hh b/src/EnergyPlus/HeatingCoils.hh index 0c9e3095e4f..015c09e01f7 100644 --- a/src/EnergyPlus/HeatingCoils.hh +++ b/src/EnergyPlus/HeatingCoils.hh @@ -87,6 +87,7 @@ namespace HeatingCoils { std::string HeatingCoilType; // Type of HeatingCoil ie. Heating or Cooling std::string HeatingCoilModel; // Type of HeatingCoil ie. Simple, Detailed, etc. int HCoilType_Num = 0; + int coilReportNum = -1; Constant::eFuel FuelType = Constant::eFuel::Invalid; // Type of fuel used, reference resource type integers Sched::Schedule *availSched = nullptr; // availability schedule int InsuffTemperatureWarn = 0; // Used for recurring error message diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index adb4eaad58c..d11d9bb1a8e 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -5262,8 +5262,7 @@ void WriteTabularReports(EnergyPlusData &state) WriteVisualResilienceTablesRepPeriod(state, i); } - state.dataRptCoilSelection->coilSelectionReportObj->finishCoilSummaryReportTable( - state); // call to write out the coil selection summary table data + ReportCoilSelection::finishCoilSummaryReportTable(state); // call to write out the coil selection summary table data WritePredefinedTables(state); // moved to come after zone load components is finished if (state.dataGlobal->DoWeathSim) { @@ -15932,7 +15931,7 @@ void computeSpaceZoneCompLoads(EnergyPlusData &state, iSpace); CollectPeakZoneConditions(state, coolCompLoadTables, coolDesSelected, timeCoolMax, iZone, true, iSpace); // send latent load info to coil summary report - state.dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadCoolingIdealPeak( + ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(state, iZone, coolCompLoadTables.cells(LoadCompCol::Latent, LoadCompRow::GrdTot)); int heatDesSelected = calcFinalSizing.HeatDDNum; @@ -15971,7 +15970,7 @@ void computeSpaceZoneCompLoads(EnergyPlusData &state, CollectPeakZoneConditions(state, heatCompLoadTables, heatDesSelected, timeHeatMax, iZone, false, iSpace); // send latent load info to coil summary report - state.dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadHeatingIdealPeak( + ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(state, iZone, heatCompLoadTables.cells(LoadCompCol::Latent, LoadCompRow::GrdTot)); AddAreaColumnForZone(componentAreas, coolCompLoadTables); @@ -16432,7 +16431,7 @@ void CollectPeakZoneConditions(EnergyPlusData &state, compLoad.peakDateHrMin = EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(desDaySelected).Month, state.dataWeather->DesDayInput(desDaySelected).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText(state, timeOfMax)); + ReportCoilSelection::getTimeText(state, timeOfMax)); } else { compLoad.peakDateHrMin = szCalcFinalSizing.CoolPeakDateHrMin; } @@ -16484,7 +16483,7 @@ void CollectPeakZoneConditions(EnergyPlusData &state, compLoad.peakDateHrMin = EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(desDaySelected).Month, state.dataWeather->DesDayInput(desDaySelected).DayOfMonth, - state.dataRptCoilSelection->coilSelectionReportObj->getTimeText(state, timeOfMax)); + ReportCoilSelection::getTimeText(state, timeOfMax)); } else { compLoad.peakDateHrMin = szCalcFinalSizing.HeatPeakDateHrMin; } diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index 9f189e6f5bd..c6ea0bedfe7 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -73,10 +73,7 @@ namespace EnergyPlus { -void createCoilSelectionReportObj(EnergyPlusData &state) -{ - state.dataRptCoilSelection->coilSelectionReportObj = std::make_unique(); -} +namespace ReportCoilSelection { CoilSelectionData::CoilSelectionData( // constructor std::string const &coilName) @@ -123,20 +120,20 @@ CoilSelectionData::CoilSelectionData( // constructor fanTypeName = "unknown"; } -void ReportCoilSelection::finishCoilSummaryReportTable(EnergyPlusData &state) +void finishCoilSummaryReportTable(EnergyPlusData &state) { doFinalProcessingOfCoilData(state); writeCoilSelectionOutput(state); writeCoilSelectionOutput2(state); } -void ReportCoilSelection::writeCoilSelectionOutput(EnergyPlusData &state) +void writeCoilSelectionOutput(EnergyPlusData &state) { // make calls to fill out predefined tabular report entries for each coil selection report object - for (auto &c : coilSelectionDataObjs) { + for (auto *c : state.dataRptCoilSelection->coils) { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilType, c->coilName_, c->coilObjName); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilType, c->coilName_, HVAC::coilTypeNamesUC[(int)c->coilType]); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLocation, c->coilName_, c->coilLocation); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACType, c->coilName_, c->typeHVACname); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACName, c->coilName_, c->userNameforHVACsystem); @@ -160,7 +157,7 @@ void ReportCoilSelection::writeCoilSelectionOutput(EnergyPlusData &state) // begin std 229 New coil connections table entries OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilName_CCs, c->coilName_, c->coilName_); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilType_CCs, c->coilName_, c->coilObjName); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilType_CCs, c->coilName_, HVAC::coilTypeNamesUC[(int)c->coilType]); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLoc_CCs, c->coilName_, c->coilLocation); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACType_CCs, c->coilName_, c->typeHVACname); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACName_CCs, c->coilName_, c->userNameforHVACsystem); @@ -429,12 +426,12 @@ void ReportCoilSelection::writeCoilSelectionOutput(EnergyPlusData &state) } } -void ReportCoilSelection::writeCoilSelectionOutput2(EnergyPlusData &state) +void writeCoilSelectionOutput2(EnergyPlusData &state) { // make calls to fill out predefined tabular report entries for each coil selection report object - for (auto &c : coilSelectionDataObjs) { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilType, c->coilName_, c->coilObjName); + for (auto *c : state.dataRptCoilSelection->coils) { + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilType, c->coilName_, HVAC::coilTypeNamesUC[(int)c->coilType]); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilHVACType, c->coilName_, c->typeHVACname); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilHVACName, c->coilName_, c->userNameforHVACsystem); @@ -523,17 +520,34 @@ void ReportCoilSelection::writeCoilSelectionOutput2(EnergyPlusData &state) } } -void ReportCoilSelection::setCoilFinalSizes(EnergyPlusData &state, +void setCoilFinalSizes(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilObjName, // coil object name, e.g., Coil:Cooling:Water + HVAC::CoilType const coilType, // coil object name, e.g., Coil:Cooling:Water + Real64 const totGrossCap, // total capacity [W] + Real64 const sensGrossCap, // sensible capacity [W] + Real64 const airFlowRate, // design or reference or rated air flow rate [m3/s] + Real64 const waterFlowRate // design or reference or rated water flow rate [m3/s] +) +{ + int index = getReportIndex(state, coilName, coilType); + auto *c = state.dataRptCoilSelection->coils[index]; + if (c != nullptr) { + c->coilTotCapFinal = totGrossCap; + c->coilSensCapFinal = sensGrossCap; + c->coilRefAirVolFlowFinal = airFlowRate; + c->coilRefWaterVolFlowFinal = waterFlowRate; + } +} + +void setCoilFinalSizes(EnergyPlusData &state, + int const coilReportNum, Real64 const totGrossCap, // total capacity [W] Real64 const sensGrossCap, // sensible capacity [W] Real64 const airFlowRate, // design or reference or rated air flow rate [m3/s] Real64 const waterFlowRate // design or reference or rated water flow rate [m3/s] ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilObjName); - auto &c(coilSelectionDataObjs[index]); + auto *c = state.dataRptCoilSelection->coils[coilReportNum]; if (c != nullptr) { c->coilTotCapFinal = totGrossCap; c->coilSensCapFinal = sensGrossCap; @@ -542,10 +556,10 @@ void ReportCoilSelection::setCoilFinalSizes(EnergyPlusData &state, } } -void ReportCoilSelection::doAirLoopSetup(EnergyPlusData &state, int const coilVecIndex) +void doAirLoopSetup(EnergyPlusData &state, int const coilVecIndex) { // this routine sets up some things for central air systems, needs to follow setting of an airloop num - auto &c(coilSelectionDataObjs[coilVecIndex]); + auto *c = state.dataRptCoilSelection->coils[coilVecIndex]; if (c->airloopNum > 0 && c->airloopNum <= int(state.dataAirSystemsData->PrimaryAirSystems.size())) { // see if there is an OA controller if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysExists) { @@ -591,9 +605,9 @@ void ReportCoilSelection::doAirLoopSetup(EnergyPlusData &state, int const coilVe } } -void ReportCoilSelection::doZoneEqSetup(EnergyPlusData &state, int const coilVecIndex) +void doZoneEqSetup(EnergyPlusData &state, int const coilVecIndex) { - auto &c(coilSelectionDataObjs[coilVecIndex]); + auto *c = state.dataRptCoilSelection->coils[coilVecIndex]; c->coilLocation = "Zone"; c->zoneNum.resize(1); c->zoneNum[0] = c->zoneEqNum; @@ -620,8 +634,8 @@ void ReportCoilSelection::doZoneEqSetup(EnergyPlusData &state, int const coilVec } // fill out supply fan info auto *fan = state.dataFans->fans(state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).supFanNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, c->coilName_, c->coilObjName, fan->Name, fan->type, state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).supFanNum); + setCoilSupplyFanInfo( + state, coilVecIndex, fan->Name, fan->type, state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).supFanNum); } if (c->zoneEqNum > 0) { @@ -629,10 +643,10 @@ void ReportCoilSelection::doZoneEqSetup(EnergyPlusData &state, int const coilVec } } -void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) +void doFinalProcessingOfCoilData(EnergyPlusData &state) { // this routine does some final processing in preparation for writing out results - for (auto &c : coilSelectionDataObjs) { + for (auto *c : state.dataRptCoilSelection->coils) { // mine final/hard values from coil models @@ -711,14 +725,14 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) // call psych routine to flush out moist air metrics from those available if (c->coilDesEntTemp != -999.0 && c->coilDesEntHumRat != -999.0) { c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::doFinalProcessingOfCoilData"); + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "doFinalProcessingOfCoilData"); if (c->coilDesEntHumRat != -999.0) { c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); } } if (c->oaPeakTemp != -999.0 && c->oaPeakHumRat != -999.0) { c->oaPeakWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->oaPeakTemp, c->oaPeakHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::doFinalProcessingOfCoilData"); + state, c->oaPeakTemp, c->oaPeakHumRat, state.dataEnvrn->StdBaroPress, "doFinalProcessingOfCoilData"); } if (c->waterLoopNum > 0 && c->pltSizNum > 0) { @@ -726,15 +740,15 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) c->plantLoopName = state.dataPlnt->PlantLoop(c->waterLoopNum).Name; if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) { c->rhoFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) - .glycol->getDensity(state, Constant::InitConvTemp, "ReportCoilSelection::doFinalProcessingOfCoilData"); + .glycol->getDensity(state, Constant::InitConvTemp, "doFinalProcessingOfCoilData"); c->cpFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) - .glycol->getSpecificHeat(state, Constant::InitConvTemp, "ReportCoilSelection::doFinalProcessingOfCoilData"); + .glycol->getSpecificHeat(state, Constant::InitConvTemp, "doFinalProcessingOfCoilData"); } else { // steam loop c->rhoFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) - .steam->getSatDensity(state, 100.0, 1.0, "ReportCoilSelection::doFinalProcessingOfCoilData"); + .steam->getSatDensity(state, 100.0, 1.0, "doFinalProcessingOfCoilData"); c->cpFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) - .steam->getSatSpecificHeat(state, 100.0, 0.0, "ReportCoilSelection::doFinalProcessingOfCoilData"); + .steam->getSatSpecificHeat(state, 100.0, 0.0, "doFinalProcessingOfCoilData"); } c->plantDesMaxMassFlowRate = state.dataPlnt->PlantLoop(c->waterLoopNum).MaxMassFlowRate; if (c->plantDesMaxMassFlowRate > 0.0 && c->coilDesWaterMassFlow > 0.0) { @@ -829,58 +843,39 @@ void ReportCoilSelection::doFinalProcessingOfCoilData(EnergyPlusData &state) } // end for loop over each coil } -int ReportCoilSelection::getIndexForOrCreateDataObjFromCoilName(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType // idf input object class name of coil -) +int getReportIndex(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType coilType // idf input object class name of coil + ) { - int index(-1); - for (int i = 0; i < numCoilsReported_; i++) { - if (coilSelectionDataObjs[i] != nullptr) { - if (Util::SameString(coilSelectionDataObjs[i]->coilName_, coilName)) { - if (Util::SameString(coilSelectionDataObjs[i]->coilObjName, coilType)) { - return index = i; - } // throw error coil type does not match coil name, check for unique names across coil types + for (int i = 0; i < (int)state.dataRptCoilSelection->coils.size(); i++) { + auto *c = state.dataRptCoilSelection->coils[i]; + if (c != nullptr) { // Why would this be nullptr? + if (Util::SameString(c->coilName_, coilName)) { + if (c->coilType == coilType) { + return i; + } + // throw error coil type does not match coil name, check for unique names across coil types ShowWarningError(state, EnergyPlus::format("check for unique coil names across different coil types: {} occurs in both {} and {}", - coilName, - coilType, - coilSelectionDataObjs[i]->coilObjName)); + coilName, + HVAC::coilTypeNamesUC[(int)coilType], + HVAC::coilTypeNamesUC[(int)c->coilType])); } } } - if (index == -1) { // then did not find it - // check if really a coil type - bool found(false); - bool locIsCooling(false); - bool locIsHeating(false); - for (int loop = 1; loop <= HVAC::NumAllCoilTypes; ++loop) { - if (Util::SameString(coilType, HVAC::cAllCoilTypes(loop))) { - found = true; - locIsCooling = Util::SameString(coilType, HVAC::cCoolingCoilTypes(loop)); - locIsHeating = Util::SameString(coilType, HVAC::cHeatingCoilTypes(loop)); - break; - } - } - if (found) { - coilSelectionDataObjs.emplace_back(new CoilSelectionData(coilName)); - index = coilSelectionDataObjs.size() - 1; - coilSelectionDataObjs[index]->coilObjName = coilType; - ++numCoilsReported_; - coilSelectionDataObjs[index]->isCooling = locIsCooling; - coilSelectionDataObjs[index]->isHeating = locIsHeating; - } - } - - if (index == -1) { - ShowFatalError(state, - EnergyPlus::format("getIndexForOrCreateDataObjFromCoilName: Developer error - not a coil: {} = {}", coilType, coilName)); - } - return index; + auto *c = new CoilSelectionData(coilName); + + state.dataRptCoilSelection->coils.push_back(c); + c->coilType = coilType; + // c->isCooling = HVAC::coilTypeIsCooling[(int)coilType]; + // c->isHeating = HVAC::coilTypeIsHeating[(int)coilType]; + + return state.dataRptCoilSelection->coils.size() - 1; } -void ReportCoilSelection::associateZoneCoilWithParent(EnergyPlusData &state, std::unique_ptr &c) +void associateZoneCoilWithParent(EnergyPlusData &state, CoilSelectionData *c) { c->coilLocation = "Unknown"; c->typeHVACname = "Unknown"; @@ -977,26 +972,60 @@ void ReportCoilSelection::associateZoneCoilWithParent(EnergyPlusData &state, std } } -void ReportCoilSelection::setRatedCoilConditions(EnergyPlusData &state, - std::string const &coilName, // ! user-defined name of the coil - std::string const &coilObjName, // coil object name, e.g., Coil:Cooling:Water - Real64 const RatedCoilTotCap, // ! rated coil total capacity [W] - Real64 const RatedCoilSensCap, // rated coil sensible capacity [W] - Real64 const RatedAirMassFlow, // rated coil design air mass flow rate [m3/s] - Real64 const RatedCoilInDb, // rated coil inlet air dry bulb at time of peak [C] - Real64 const RatedCoilInHumRat, // rated coil inlet air humidity ratio [kgWater/kgDryAir] - Real64 const RatedCoilInWb, // rated coil inlet air wet bulb [C] - Real64 const RatedCoilOutDb, // rated coil outlet air dry bulb [C] - Real64 const RatedCoilOutHumRat, // rated coil outlet air humidity ratio, [kgWater/kgDryAir] - Real64 const RatedCoilOutWb, // rated coil outlet air wet bulb [C] - Real64 const RatedCoilOadbRef, // rated DX coil outside air dry bulb reference [C] - Real64 const RatedCoilOawbRef, // rated DX coil outside air wet bulb reference [C] - Real64 const RatedCoilBpFactor, // rated coil bypass factor - Real64 const RatedCoilEff // rated coil effectiveness +void setRatedCoilConditions(EnergyPlusData &state, + std::string const &coilName, // ! user-defined name of the coil + HVAC::CoilType const coilType, // coil object name, e.g., Coil:Cooling:Water + Real64 const RatedCoilTotCap, // ! rated coil total capacity [W] + Real64 const RatedCoilSensCap, // rated coil sensible capacity [W] + Real64 const RatedAirMassFlow, // rated coil design air mass flow rate [m3/s] + Real64 const RatedCoilInDb, // rated coil inlet air dry bulb at time of peak [C] + Real64 const RatedCoilInHumRat, // rated coil inlet air humidity ratio [kgWater/kgDryAir] + Real64 const RatedCoilInWb, // rated coil inlet air wet bulb [C] + Real64 const RatedCoilOutDb, // rated coil outlet air dry bulb [C] + Real64 const RatedCoilOutHumRat, // rated coil outlet air humidity ratio, [kgWater/kgDryAir] + Real64 const RatedCoilOutWb, // rated coil outlet air wet bulb [C] + Real64 const RatedCoilOadbRef, // rated DX coil outside air dry bulb reference [C] + Real64 const RatedCoilOawbRef, // rated DX coil outside air wet bulb reference [C] + Real64 const RatedCoilBpFactor, // rated coil bypass factor + Real64 const RatedCoilEff // rated coil effectiveness + ) +{ + int index = getReportIndex(state, coilName, coilType); + setRatedCoilConditions(state, + index, + RatedCoilTotCap, // ! rated coil total capacity [W] + RatedCoilSensCap, // rated coil sensible capacity [W] + RatedAirMassFlow, // rated coil design air mass flow rate [m3/s] + RatedCoilInDb, // rated coil inlet air dry bulb at time of peak [C] + RatedCoilInHumRat, // rated coil inlet air humidity ratio [kgWater/kgDryAir] + RatedCoilInWb, // rated coil inlet air wet bulb [C] + RatedCoilOutDb, // rated coil outlet air dry bulb [C] + RatedCoilOutHumRat, // rated coil outlet air humidity ratio, [kgWater/kgDryAir] + RatedCoilOutWb, // rated coil outlet air wet bulb [C] + RatedCoilOadbRef, // rated DX coil outside air dry bulb reference [C] + RatedCoilOawbRef, // rated DX coil outside air wet bulb reference [C] + RatedCoilBpFactor, // rated coil bypass factor + RatedCoilEff); +} + +void setRatedCoilConditions(EnergyPlusData &state, + int const coilNum, + Real64 const RatedCoilTotCap, // ! rated coil total capacity [W] + Real64 const RatedCoilSensCap, // rated coil sensible capacity [W] + Real64 const RatedAirMassFlow, // rated coil design air mass flow rate [m3/s] + Real64 const RatedCoilInDb, // rated coil inlet air dry bulb at time of peak [C] + Real64 const RatedCoilInHumRat, // rated coil inlet air humidity ratio [kgWater/kgDryAir] + Real64 const RatedCoilInWb, // rated coil inlet air wet bulb [C] + Real64 const RatedCoilOutDb, // rated coil outlet air dry bulb [C] + Real64 const RatedCoilOutHumRat, // rated coil outlet air humidity ratio, [kgWater/kgDryAir] + Real64 const RatedCoilOutWb, // rated coil outlet air wet bulb [C] + Real64 const RatedCoilOadbRef, // rated DX coil outside air dry bulb reference [C] + Real64 const RatedCoilOawbRef, // rated DX coil outside air wet bulb reference [C] + Real64 const RatedCoilBpFactor, // rated coil bypass factor + Real64 const RatedCoilEff // rated coil effectiveness ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilObjName); - auto &c(coilSelectionDataObjs[index]); + auto *c = state.dataRptCoilSelection->coils[coilNum]; c->coilRatedTotCap = RatedCoilTotCap; c->coilRatedSensCap = RatedCoilSensCap; c->ratedAirMassFlow = RatedAirMassFlow; @@ -1025,51 +1054,94 @@ void ReportCoilSelection::setRatedCoilConditions(EnergyPlusData &state, c->ratedCoilOawbRef = RatedCoilOawbRef; } -void ReportCoilSelection::setCoilAirFlow(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil - Real64 const airVdot, // air flow rate in m3/s - bool const isAutoSized // true if air flow was autosized +#ifdef OLD_API +void setCoilAirFlow(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const airVdot, // air flow rate in m3/s + bool const isAutoSized // true if air flow was autosized ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + int index = getReportIndex(state, coilName, coilType); + setCoilAirFlow(state, index, airVdot, isAutoSized); +} +#endif // OLD_API + +void setCoilAirFlow(EnergyPlusData &state, + int const index, + Real64 const airVdot, // air flow rate in m3/s + bool const isAutoSized // true if air flow was autosized +) +{ + assert(index >= 0 && index < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[index]; c->coilDesVolFlow = airVdot; c->volFlowIsAutosized = isAutoSized; c->coilDesMassFlow = airVdot * state.dataEnvrn->StdRhoAir; } -void ReportCoilSelection::setCoilWaterFlowNodeNums(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil - Real64 const waterVdot, // plant fluid flow rate in m3/s - bool const isAutoSized, // true if water flow was autosized - int const inletNodeNum, // coil chw inlet node num - int const outletNodeNum, // coil chw outlet node num - int const plantLoopNum // plant loop structure index +#ifdef OLD_API +void setCoilWaterFlowNodeNums(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const waterVdot, // plant fluid flow rate in m3/s + bool const isAutoSized, // true if water flow was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const plantLoopNum // plant loop structure index ) { + int const coilNum = getReportIndex(state, coilName, coilType); + setCoilWaterFlowNodeNums(state, coilNum, waterVdot, isAutosized, inletNodeNum, outletNodeNum, plantLoopNum); +} +#endif // OLD_API + +void setCoilWaterFlowNodeNums(EnergyPlusData &state, + int const coilNum, + Real64 const waterVdot, // plant fluid flow rate in m3/s + bool const isAutoSized, // true if water flow was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const plantLoopNum // plant loop structure index +) +{ + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + int plantSizNum = -999; if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) { bool errorsfound = false; - plantSizNum = PlantUtilities::MyPlantSizingIndex(state, "water coil", coilName, inletNodeNum, outletNodeNum, errorsfound); + plantSizNum = PlantUtilities::MyPlantSizingIndex(state, "water coil", c->coilName_, inletNodeNum, outletNodeNum, errorsfound); } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowPltSizNum( - state, coilName, coilType, waterVdot, isAutoSized, plantSizNum, plantLoopNum); + setCoilWaterFlowPltSizNum(state, coilNum, waterVdot, isAutoSized, plantSizNum, plantLoopNum); } -void ReportCoilSelection::setCoilWaterFlowPltSizNum(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil - Real64 const waterVdot, // plant fluid flow rate in m3/s - bool const isAutoSized, // true if water flow was autosized - int const plantSizNum, // plant sizing structure index - int const plantLoopNum // plant loop structure index -) +#ifdef OLD_API +void setCoilWaterFlowPltSizNum(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const waterVdot, // plant fluid flow rate in m3/s + bool const isAutoSized, // true if water flow was autosized + int const plantSizNum, // plant sizing structure index + int const plantLoopNum // plant loop structure index + ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + int coilNum = getReportIndex(state, coilName, coilType); + setCoilWaterFlowPltSizNum(state, coilNum, waterVdot, isAutoSized, plantSizNum, plantLoopNum); +} +#endif // OLD_API + +void setCoilWaterFlowPltSizNum(EnergyPlusData &state, + int const coilNum, + Real64 const waterVdot, // plant fluid flow rate in m3/s + bool const isAutoSized, // true if water flow was autosized + int const plantSizNum, // plant sizing structure index + int const plantLoopNum // plant loop structure index + ) +{ + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; c->pltSizNum = plantSizNum; c->waterLoopNum = plantLoopNum; if (c->waterLoopNum > 0) { @@ -1079,14 +1151,14 @@ void ReportCoilSelection::setCoilWaterFlowPltSizNum(EnergyPlusData &state, if (c->waterLoopNum > 0 && c->pltSizNum > 0) { if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) { c->rhoFluid = - state.dataPlnt->PlantLoop(c->waterLoopNum).glycol->getDensity(state, Constant::InitConvTemp, "ReportCoilSelection::setCoilWaterFlow"); + state.dataPlnt->PlantLoop(c->waterLoopNum).glycol->getDensity(state, Constant::InitConvTemp, "setCoilWaterFlow"); c->cpFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) - .glycol->getSpecificHeat(state, Constant::InitConvTemp, "ReportCoilSelection::setCoilWaterFlow"); + .glycol->getSpecificHeat(state, Constant::InitConvTemp, "setCoilWaterFlow"); } else { // steam loop - c->rhoFluid = state.dataPlnt->PlantLoop(c->waterLoopNum).steam->getSatDensity(state, 100.0, 1.0, "ReportCoilSelection::setCoilWaterFlow"); + c->rhoFluid = state.dataPlnt->PlantLoop(c->waterLoopNum).steam->getSatDensity(state, 100.0, 1.0, "setCoilWaterFlow"); c->cpFluid = - state.dataPlnt->PlantLoop(c->waterLoopNum).steam->getSatSpecificHeat(state, 100.0, 0.0, "ReportCoilSelection::setCoilWaterFlow"); + state.dataPlnt->PlantLoop(c->waterLoopNum).steam->getSatSpecificHeat(state, 100.0, 0.0, "setCoilWaterFlow"); } } if (c->rhoFluid > 0.0) { @@ -1099,85 +1171,153 @@ void ReportCoilSelection::setCoilWaterFlowPltSizNum(EnergyPlusData &state, } } -void ReportCoilSelection::setCoilEntAirTemp(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil - Real64 const entAirDryBulbTemp, // degree C air entering coil - int const curSysNum, // airloop system number index, if non zero - int const curZoneEqNum // zone equipment list index, if non-zero +#ifdef OLD_API +void setCoilEntAirTemp(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const entAirDryBulbTemp, // degree C air entering coil + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum // zone equipment list index, if non-zero ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + int index = getReportIndex(state, coilName, coilType); + setCoilEntAirTemp(state, index, entAirDryBulbTemp, curSysNum, curZoneEqNum); +} +#endif // OLD_API + +void setCoilEntAirTemp(EnergyPlusData &state, + int const coilReportNum, + Real64 const entAirDryBulbTemp, // degree C air entering coil + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum // zone equipment list index, if non-zero +) +{ + auto *c = state.dataRptCoilSelection->coils[coilReportNum]; c->coilDesEntTemp = entAirDryBulbTemp; c->airloopNum = curSysNum; - doAirLoopSetup(state, index); + doAirLoopSetup(state, coilReportNum); c->zoneEqNum = curZoneEqNum; } -void ReportCoilSelection::setCoilEntAirHumRat(EnergyPlusData &state, +void setCoilEntAirHumRat(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const entAirHumrat // +) +{ + int index = getReportIndex(state, coilName, coilType); + auto *c = state.dataRptCoilSelection->coils[index]; + c->coilDesEntHumRat = entAirHumrat; +} + +void setCoilEntAirHumRat(EnergyPlusData &state, + int const coilReportNum, Real64 const entAirHumrat // ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + auto *c = state.dataRptCoilSelection->coils[coilReportNum]; c->coilDesEntHumRat = entAirHumrat; } -void ReportCoilSelection::setCoilEntWaterTemp(EnergyPlusData &state, + +void setCoilEntWaterTemp(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType const coilType, // idf input object class name of coil Real64 const entWaterTemp // ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + int index = getReportIndex(state, coilName, coilType); + auto *c = state.dataRptCoilSelection->coils[index]; c->coilDesWaterEntTemp = entWaterTemp; } -void ReportCoilSelection::setCoilLvgWaterTemp(EnergyPlusData &state, +void setCoilEntWaterTemp(EnergyPlusData &state, + int const coilReportNum, + Real64 const entWaterTemp // +) +{ + auto *c = state.dataRptCoilSelection->coils[coilReportNum]; + c->coilDesWaterEntTemp = entWaterTemp; +} + + +void setCoilLvgWaterTemp(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const lvgWaterTemp // +) +{ + int index = getReportIndex(state, coilName, coilType); + auto *c = state.dataRptCoilSelection->coils[index]; + c->coilDesWaterLvgTemp = lvgWaterTemp; +} + +void setCoilLvgWaterTemp(EnergyPlusData &state, + int const coilReportNum, Real64 const lvgWaterTemp // ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + auto *c = state.dataRptCoilSelection->coils[coilReportNum]; c->coilDesWaterLvgTemp = lvgWaterTemp; } -void ReportCoilSelection::setCoilWaterDeltaT(EnergyPlusData &state, +void setCoilWaterDeltaT(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType const coilType, // idf input object class name of coil Real64 const CoilWaterDeltaT // degree C temperature difference used to size coil ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + int index = getReportIndex(state, coilName, coilType); + auto *c = state.dataRptCoilSelection->coils[index]; c->coilDesWaterTempDiff = CoilWaterDeltaT; } -void ReportCoilSelection::setCoilLvgAirTemp(EnergyPlusData &state, +void setCoilWaterDeltaT(EnergyPlusData &state, + int const coilReportNum, + Real64 const CoilWaterDeltaT // degree C temperature difference used to size coil +) +{ + auto *c = state.dataRptCoilSelection->coils[coilReportNum]; + c->coilDesWaterTempDiff = CoilWaterDeltaT; +} + +void setCoilLvgAirTemp(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType const coilType, // idf input object class name of coil Real64 const lvgAirDryBulbTemp // ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + int index = getReportIndex(state, coilName, coilType); + auto *c = state.dataRptCoilSelection->coils[index]; c->coilDesLvgTemp = lvgAirDryBulbTemp; } -void ReportCoilSelection::setCoilLvgAirHumRat(EnergyPlusData &state, +void setCoilLvgAirTemp(EnergyPlusData &state, + int const coilReportNum, + Real64 const lvgAirDryBulbTemp // +) +{ + auto *c = state.dataRptCoilSelection->coils[coilReportNum]; + c->coilDesLvgTemp = lvgAirDryBulbTemp; +} + +void setCoilLvgAirHumRat(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const lvgAirHumRat // +) +{ + int index = getReportIndex(state, coilName, coilType); + auto *c = state.dataRptCoilSelection->coils[index]; + c->coilDesLvgHumRat = lvgAirHumRat; +} + +void setCoilLvgAirHumRat(EnergyPlusData &state, + int const coilReportNum, Real64 const lvgAirHumRat // ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + auto *c = state.dataRptCoilSelection->coils[coilReportNum]; c->coilDesLvgHumRat = lvgAirHumRat; } @@ -1186,13 +1326,41 @@ std::string PeakHrMinString(EnergyPlusData &state, const int designDay, const in return fmt::format("{}/{} {}", state.dataWeather->DesDayInput(designDay).Month, state.dataWeather->DesDayInput(designDay).DayOfMonth, - ReportCoilSelection::getTimeText(state, timeStepAtPeak)); + getTimeText(state, timeStepAtPeak)); } -void ReportCoilSelection::setCoilCoolingCapacity( +void setCoilCoolingCapacity( EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const TotalCoolingCap, // {W} coil cooling capacity, sizing result + bool const isAutoSize, // true if value was autosized + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum, // zone equipment list index, if non-zero + int const curOASysNum, // OA system equipment list index, if non-zero + Real64 const fanCoolLoad, // {W} fan load used in ideal loads coil sizing + Real64 const coilCapFunTempFac, // {W} curve result for modification factor for capacity as a function of temperature + Real64 const DXFlowPerCapMinRatio, // non dimensional ratio, capacity adjustment ratio min + Real64 const DXFlowPerCapMaxRatio // non dimensional ratio, capacity adjustment ratio max +) +{ + int index = getReportIndex(state, coilName, coilType); + setCoilCoolingCapacity(state, + index, + TotalCoolingCap, + isAutoSize, + curSysNum, + curZoneEqNum, + curOASysNum, + fanCoolLoad, + coilCapFunTempFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); +} + +void setCoilCoolingCapacity( + EnergyPlusData &state, + int const coilReportNum, Real64 const TotalCoolingCap, // {W} coil cooling capacity, sizing result bool const isAutoSize, // true if value was autosized int const curSysNum, // airloop system number index, if non zero @@ -1207,8 +1375,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( auto &ZoneEqSizing(state.dataSize->ZoneEqSizing); auto &SysSizPeakDDNum(state.dataSize->SysSizPeakDDNum); - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + auto *c = state.dataRptCoilSelection->coils[coilReportNum]; // no this is adjusted back to ratings c->coilTotCapAtPeak = TotalCoolingCap; c->coilCapFTIdealPeak = coilCapFunTempFac; c->coilTotCapAtPeak = TotalCoolingCap * c->coilCapFTIdealPeak; @@ -1218,7 +1385,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->fanHeatGainIdealPeak = fanCoolLoad; c->airloopNum = curSysNum; - doAirLoopSetup(state, index); + doAirLoopSetup(state, coilReportNum); c->zoneEqNum = curZoneEqNum; // if ( c->zoneEqNum > 0 ) doZoneEqSetup( index ); c->oASysNum = curOASysNum; @@ -1335,7 +1502,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->coilDesEntHumRat = finalSysSizing.OutHumRatAtCoolPeak; } c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); if (c->coilDesLvgTemp == -999.0) { // don't overwrite if already set directly c->coilDesLvgTemp = finalSysSizing.PrecoolTemp; @@ -1344,7 +1511,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->coilDesLvgHumRat = finalSysSizing.PrecoolHumRat; } c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } else { // part of main air loop @@ -1355,7 +1522,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->coilDesEntHumRat = finalSysSizing.MixHumRatAtCoolPeak; } c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); if (c->coilDesLvgTemp == -999.0) { c->coilDesLvgTemp = finalSysSizing.CoolSupTemp; @@ -1364,7 +1531,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->coilDesLvgHumRat = finalSysSizing.CoolSupHumRat; } c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); if (state.dataAirSystemsData->PrimaryAirSystems(curSysNum).NumOACoolCoils > 0) { // there is precooling of the OA stream c->oaPretreated = true; @@ -1448,7 +1615,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->coilDesLvgHumRat = thisFinalZoneSizing.CoolDesHumRat; } c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } else if (curOASysNum > 0 && c->airloopNum > state.dataHVACGlobal->NumPrimaryAirSys) { if (!state.dataAirLoopHVACDOAS->airloopDOAS.empty()) { @@ -1457,14 +1624,14 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->coilDesEntHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].SizingCoolOAHumRat; if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) { c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); } c->coilDesLvgTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PrecoolTemp; c->coilDesLvgHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PrecoolHumRat; if (c->coilDesLvgTemp > -999.0 && c->coilDesLvgHumRat > -999.0) { c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilCoolingCapacity"); + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } DataSizing::SizingConcurrence sizMethod = DataSizing::SizingConcurrence::Invalid; @@ -1493,10 +1660,10 @@ void ReportCoilSelection::setCoilCoolingCapacity( c->cpMoistAir = Psychrometrics::PsyCpAirFnW(c->coilDesEntHumRat); } -void ReportCoilSelection::setCoilHeatingCapacity( +void setCoilHeatingCapacity( EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType const coilType, // idf input object class name of coil Real64 const totalHeatingCap, // {W} coil Heating capacity bool const isAutoSize, // true if value was autosized int const curSysNum, // airloop system number index, if non zero @@ -1508,8 +1675,36 @@ void ReportCoilSelection::setCoilHeatingCapacity( Real64 const DXFlowPerCapMaxRatio // non dimensional ratio, capacity adjustment ratio max ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + int index = getReportIndex(state, coilName, coilType); + setCoilHeatingCapacity( + state, + index, + totalHeatingCap, + isAutoSize, + curSysNum, + curZoneEqNum, + curOASysNum, + fanHeatGain, + coilCapFunTempFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); +} + +void setCoilHeatingCapacity( + EnergyPlusData &state, + int coilReportNum, + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum, // zone equipment list index, if non-zero + int const curOASysNum, // OA system equipment list index, if non-zero + Real64 const fanHeatGain, // {W} fan load used in ideal loads coil sizing + Real64 const coilCapFunTempFac, // {W} curve result for modification factor for capacity as a function of temperature + Real64 const DXFlowPerCapMinRatio, // non dimensional ratio, capacity adjustment ratio min + Real64 const DXFlowPerCapMaxRatio // non dimensional ratio, capacity adjustment ratio max +) +{ + auto *c = state.dataRptCoilSelection->coils[coilReportNum]; c->capIsAutosized = isAutoSize; c->coilCapFTIdealPeak = coilCapFunTempFac; c->coilTotCapAtPeak = totalHeatingCap * c->coilCapFTIdealPeak; @@ -1518,7 +1713,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->fanHeatGainIdealPeak = fanHeatGain; c->airloopNum = curSysNum; - doAirLoopSetup(state, index); + doAirLoopSetup(state, coilReportNum); c->zoneEqNum = curZoneEqNum; // if ( c->zoneEqNum > 0 ) doZoneEqSetup( index ); if (curSysNum > 0 && c->zoneEqNum == 0 && curSysNum <= int(state.dataSize->FinalSysSizing.size())) { @@ -1609,7 +1804,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->coilDesEntHumRat = finalSysSizing.HeatOutHumRat; } c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); if (c->coilDesLvgTemp == -999.0) { c->coilDesLvgTemp = finalSysSizing.PreheatTemp; @@ -1618,7 +1813,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->coilDesLvgHumRat = finalSysSizing.PreheatHumRat; } c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } else { // part of main air loop @@ -1629,7 +1824,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->coilDesEntHumRat = finalSysSizing.HeatMixHumRat; } c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); if (c->coilDesLvgTemp == -999.0) { c->coilDesLvgTemp = finalSysSizing.HeatSupTemp; @@ -1638,7 +1833,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->coilDesLvgHumRat = finalSysSizing.HeatSupHumRat; } c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); if (state.dataAirSystemsData->PrimaryAirSystems(curSysNum).NumOAHeatCoils > 0) { // there is preHeating of the OA stream c->oaPretreated = true; @@ -1751,7 +1946,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) { c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); } @@ -1762,7 +1957,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->coilDesLvgHumRat = finalZoneSizing.HeatDesHumRat; } c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } else if (curOASysNum > 0 && c->airloopNum > int(state.dataSize->FinalSysSizing.size())) { if (!state.dataAirLoopHVACDOAS->airloopDOAS.empty()) { @@ -1772,14 +1967,14 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->coilDesEntHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].HeatOutHumRat; if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) { c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); } c->coilDesLvgTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PreheatTemp; c->coilDesLvgHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PreheatHumRat; if (c->coilDesLvgTemp > -999.0 && c->coilDesLvgHumRat > -999.0) { c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "ReportCoilSelection::setCoilHeatingCapacity"); + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); } DataSizing::SizingConcurrence sizMethod = DataSizing::SizingConcurrence::Invalid; @@ -1871,111 +2066,191 @@ void ReportCoilSelection::setCoilHeatingCapacity( c->coilSensCapAtPeak = min(c->coilSensCapAtPeak, c->coilTotCapAtPeak); } -void ReportCoilSelection::setCoilWaterCoolingCapacity(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil - Real64 const totalCoolingCap, // {W} coil cooling capacity - bool const isAutoSize, // true if value was autosized - int const inletNodeNum, // coil chw inlet node num - int const outletNodeNum, // coil chw outlet node num - int const dataWaterLoopNum // plant loop structure index -) +#ifdef OLD_API +void setCoilWaterCoolingCapacity(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const totalCoolingCap, // {W} coil cooling capacity + bool const isAutoSize, // true if value was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const dataWaterLoopNum // plant loop structure index + ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + int index = getReportIndex(state, coilName, coilType); + setCoilWaterCoolingCapacity(state, coilNum, totalCoolingCap, isAutoSize, inletNodeNum, outletNodeNum, dataWaterLoopNum); +} +#endif // OLD_API + +void setCoilWaterCoolingCapacity(EnergyPlusData &state, + int const coilNum, + Real64 const totalCoolingCap, // {W} coil cooling capacity + bool const isAutoSize, // true if value was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const dataWaterLoopNum // plant loop structure index + ) +{ + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; c->coilTotCapAtPeak = totalCoolingCap; c->capIsAutosized = isAutoSize; if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) { bool errorsfound = false; - c->pltSizNum = PlantUtilities::MyPlantSizingIndex(state, "chilled water coil", coilName, inletNodeNum, outletNodeNum, errorsfound); + c->pltSizNum = PlantUtilities::MyPlantSizingIndex(state, "chilled water coil", c->coilName_, inletNodeNum, outletNodeNum, errorsfound); } else { c->pltSizNum = -999; } c->waterLoopNum = dataWaterLoopNum; } - -void ReportCoilSelection::setCoilWaterHeaterCapacityNodeNums(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil - Real64 const totalHeatingCap, // {W} coil Heating capacity - bool const isAutoSize, // true if value was autosized - int const inletNodeNum, // coil chw inlet node num - int const outletNodeNum, // coil chw outlet node num - int const dataWaterLoopNum // plant loop structure index +#ifdef OLD_API +void setCoilWaterHeaterCapacityNodeNums(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const dataWaterLoopNum // plant loop structure index ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + int index = getReportIndex(state, coilName, coilType); + setCoilWaterHeaterCapacityNodeNums(state, index, totalHeatingCap, isAutoSize, inletNodeNum, outletNodeNum, dataWaterLoopNum); +} +#endif // OLD_API + +void setCoilWaterHeaterCapacityNodeNums(EnergyPlusData &state, + int const coilNum, // user-defined name of the coil + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const dataWaterLoopNum // plant loop structure index +) +{ + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; c->coilTotCapAtPeak = totalHeatingCap; c->capIsAutosized = isAutoSize; if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) { bool errorsfound = false; - c->pltSizNum = PlantUtilities::MyPlantSizingIndex(state, "hot water coil", coilName, inletNodeNum, outletNodeNum, errorsfound); + c->pltSizNum = PlantUtilities::MyPlantSizingIndex(state, "hot water coil", c->coilName_, inletNodeNum, outletNodeNum, errorsfound); } else { c->pltSizNum = -999; } c->waterLoopNum = dataWaterLoopNum; } -void ReportCoilSelection::setCoilWaterHeaterCapacityPltSizNum(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil - Real64 const totalHeatingCap, // {W} coil Heating capacity - bool const isAutoSize, // true if value was autosized - int const dataPltSizNum, // plant sizing structure index - int const dataWaterLoopNum // plant loop structure index -) +#ifdef OLD_API +void setCoilWaterHeaterCapacityPltSizNum(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const dataPltSizNum, // plant sizing structure index + int const dataWaterLoopNum // plant loop structure index + ) +{ + int index = getReportIndex(state, coilName, coilType); + setCoilWaterHeaterCapacityPltSizNum(state, index, totalHeatingCap, isAutoSize, dataPltSizNum, dataWaterLoopNum); +} +#endif // OLD_API + +void setCoilWaterHeaterCapacityPltSizNum(EnergyPlusData &state, + int const coilNum, + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const dataPltSizNum, // plant sizing structure index + int const dataWaterLoopNum // plant loop structure index + ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; c->coilTotCapAtPeak = totalHeatingCap; c->capIsAutosized = isAutoSize; c->pltSizNum = dataPltSizNum; c->waterLoopNum = dataWaterLoopNum; } -void ReportCoilSelection::setCoilUA(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil - Real64 const UAvalue, // [W/k] UA value for coil, - Real64 const dataCapacityUsedForSizing, // [W] sizing global - bool const isAutoSize, // true if value was autosized - int const curSysNum, // airloop system number index, if non zero - int const curZoneEqNum // zone equipment list index, if non-zero +#ifdef OLD_API +void setCoilUA(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const UAvalue, // [W/k] UA value for coil, + Real64 const dataCapacityUsedForSizing, // [W] sizing global + bool const isAutoSize, // true if value was autosized + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum // zone equipment list index, if non-zero ) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + int index = getReportIndex(state, coilName, coilType); + setCoilUA(state, coilNum, UAvalue, dataCapacityUsedForSizing, isAutoSize, curSysNum, curZoneEqNum); +} +#endif // OLD_API + +void setCoilUA(EnergyPlusData &state, + int const coilNum, + Real64 const UAvalue, // [W/k] UA value for coil, + Real64 const dataCapacityUsedForSizing, // [W] sizing global + bool const isAutoSize, // true if value was autosized + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum // zone equipment list index, if non-zero +) +{ + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; c->coilUA = UAvalue; c->coilTotCapAtPeak = dataCapacityUsedForSizing; c->capIsAutosized = isAutoSize; c->airloopNum = curSysNum; - doAirLoopSetup(state, index); + doAirLoopSetup(state, coilNum); c->zoneEqNum = curZoneEqNum; } -void ReportCoilSelection::setCoilReheatMultiplier(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil - Real64 const multiplierReheatLoad) +#ifdef OLD_API +void setCoilReheatMultiplier(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType, // idf input object class name of coil + Real64 const multiplierReheatLoad) +{ + int index = getReportIndex(state, coilName, coilType); + setCoilReheatMultiplier(state, index, multiplierReheatLoad); +} +#endif // OLD_API + +void setCoilReheatMultiplier(EnergyPlusData &state, + int const coilNum, + Real64 const multiplierReheatLoad) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; c->reheatLoadMult = multiplierReheatLoad; } -void ReportCoilSelection::setCoilSupplyFanInfo(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil - std::string const &fanName, - HVAC::FanType fanType, - int fanIndex) +#ifdef OLD_API +void setCoilSupplyFanInfo(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType, // idf input object class name of coil + std::string const &fanName, + HVAC::FanType fanType, + int fanIndex) +{ + int index = getReportIndex(state, coilName, coilType); + setCoilSupplyFanInfo(state, index, fanName, fanType, fanIndex); +} +#endif // OLD_API + +void setCoilSupplyFanInfo(EnergyPlusData &state, + int const coilNum, + std::string const &fanName, + HVAC::FanType fanType, + int fanIndex) { if (fanName.empty()) { return; } - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; c->fanAssociatedWithCoilName = fanName; c->supFanType = fanType; c->supFanNum = fanIndex; @@ -1984,21 +2259,32 @@ void ReportCoilSelection::setCoilSupplyFanInfo(EnergyPlusData &state, } } -void ReportCoilSelection::setCoilEqNum(EnergyPlusData &state, - std::string const &coilName, - std::string const &coilType, - int const curSysNum, - int const curOASysNum, - int const curZoneEqNum) + +void setCoilEqNum(EnergyPlusData &state, + std::string const &coilName, + HVAC::CoilType const coilType, + int const curSysNum, + int const curOASysNum, + int const curZoneEqNum) +{ + int index = getReportIndex(state, coilName, coilType); + setCoilEqNum(state, index, curSysNum, curOASysNum, curZoneEqNum); +} + +void setCoilEqNum(EnergyPlusData &state, + int const index, + int const curSysNum, + int const curOASysNum, + int const curZoneEqNum) { - int index = getIndexForOrCreateDataObjFromCoilName(state, coilName, coilType); - auto &c(coilSelectionDataObjs[index]); + assert(index >= 0 && index < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[index]; c->airloopNum = curSysNum; c->oASysNum = curOASysNum; c->zoneEqNum = curZoneEqNum; } -std::string ReportCoilSelection::getTimeText(EnergyPlusData &state, int const timeStepAtPeak) +std::string getTimeText(EnergyPlusData &state, int const timeStepAtPeak) { std::string returnString; @@ -2021,7 +2307,7 @@ std::string ReportCoilSelection::getTimeText(EnergyPlusData &state, int const ti hourPrint = hourCounter - 1; } if (timeStepIndex == timeStepAtPeak) { - returnString = EnergyPlus::format(DataSizing::PeakHrMinFmt, hourPrint, minutes); + returnString = format(DataSizing::PeakHrMinFmt, hourPrint, minutes); } } } @@ -2029,46 +2315,22 @@ std::string ReportCoilSelection::getTimeText(EnergyPlusData &state, int const ti return returnString; } -bool ReportCoilSelection::isCompTypeFan(std::string const &compType // string component type, input object class name +bool isCompTypeFan(std::string const &compType // string component type, input object class name ) { - // if compType name is one of the fan objects, then return true - if (Util::SameString(compType, "Fan:SystemModel")) { - return true; - } - if (Util::SameString(compType, "Fan:ComponentModel")) { - return true; - } - if (Util::SameString(compType, "Fan:OnOff")) { - return true; - } - if (Util::SameString(compType, "Fan:ConstantVolume")) { - return true; - } - if (Util::SameString(compType, "Fan:VariableVolume")) { - return true; - } - return false; + return getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(compType)) != -1; } -bool ReportCoilSelection::isCompTypeCoil(std::string const &compType // string component type, input object class name +bool isCompTypeCoil(std::string const &compType // string component type, input object class name ) { - // if compType name is one of the coil objects, then return true - bool found(false); - for (int loop = 1; loop <= HVAC::NumAllCoilTypes; ++loop) { - if (Util::SameString(compType, HVAC::cAllCoilTypes(loop))) { - found = true; - break; - } - } - return found; + return getEnumValue(HVAC::coilTypeNamesUC, Util::makeUPPER(compType)) != -1; } -void ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(int const zoneIndex, Real64 const zoneCoolingLatentLoad) +void setZoneLatentLoadCoolingIdealPeak(EnergyPlusData &state, int const zoneIndex, Real64 const zoneCoolingLatentLoad) { // loop over all the coils and the zones in the coils and if this zone index is in the coil - for (auto const &c : coilSelectionDataObjs) { + for (auto const &c : state.dataRptCoilSelection->coils) { if (c->isCooling) { for (std::size_t zoneInd = 0; zoneInd < c->zoneNum.size(); ++zoneInd) { @@ -2081,10 +2343,10 @@ void ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(int const zoneIndex, } } -void ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(int const zoneIndex, Real64 const zoneHeatingLatentLoad) +void setZoneLatentLoadHeatingIdealPeak(EnergyPlusData &state, int const zoneIndex, Real64 const zoneHeatingLatentLoad) { // loop over all the coils and the zones in the coils and if this zone index is in the coil - for (auto const &c : coilSelectionDataObjs) { + for (auto *c : state.dataRptCoilSelection->coils) { if (c->isHeating) { for (std::size_t zoneInd = 0; zoneInd < c->zoneNum.size(); ++zoneInd) { @@ -2097,4 +2359,5 @@ void ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(int const zoneIndex, } } +} // namespace ReportCoilSelection } // namespace EnergyPlus diff --git a/src/EnergyPlus/ReportCoilSelection.hh b/src/EnergyPlus/ReportCoilSelection.hh index dfb8905cb75..4d313f9515e 100644 --- a/src/EnergyPlus/ReportCoilSelection.hh +++ b/src/EnergyPlus/ReportCoilSelection.hh @@ -64,6 +64,9 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; +namespace ReportCoilSelection +{ + class CoilSelectionData // data object, one for each unique coil in simulation { @@ -74,7 +77,7 @@ public: // methods public: // data std::string coilName_; // user-defined coil name - std::string coilObjName; // coil object name, e.g., Coil:Cooling:Water, Coil:Heating:DX:SingleSpeed, etc. + HVAC::CoilType coilType = HVAC::CoilType::Invalid; bool isCooling; // true if this coil is for cooling bool isHeating; // true if this coil is for heating std::string coilLocation; // where is the coil located?, AirLoop or Zone @@ -219,20 +222,11 @@ public: // data }; // end class CoilSelectionData -class ReportCoilSelection - -{ -public: // Creation - ReportCoilSelection() : numCoilsReported_(0) - { - } - -public: // methods void finishCoilSummaryReportTable(EnergyPlusData &state); - +#ifdef OLD_API void setCoilFinalSizes(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilObjName, // coil object name, e.g., Coil:Cooling:Water + HVAC::CoilType const coilType, // coil type, e.g., Coil:Cooling:Water Real64 const totGrossCap, // total capacity [W] Real64 const sensGrossCap, // sensible capacity [W] Real64 const airFlowRate, // design or reference or rated air flow rate [m3/s] @@ -241,7 +235,7 @@ public: // methods void setRatedCoilConditions(EnergyPlusData &state, std::string const &coilName, // ! user-defined name of the coil - std::string const &coilObjName, // coil object name, e.g., Coil:Cooling:Water + HVAC::CoilType const coilType, // coil object name, e.g., Coil:Cooling:Water Real64 const RatedCoilTotCap, // ! rated coil total capacity [W] Real64 const RatedCoilSensCap, // rated coil sensible capacity [W] Real64 const RatedAirMassFlow, // rated coil design air mass flow rate [m3/s] @@ -260,14 +254,14 @@ public: // methods void setCoilAirFlow(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const airVdot, // air flow rate in m3/s bool const isAutoSized // true if air flow was autosized ); void setCoilWaterFlowNodeNums(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const waterVdot, // water flow rate in m3/s bool const isAutoSized, // true if water flow was autosized int const inletNodeNum, // coil chw inlet node num @@ -277,7 +271,7 @@ public: // methods void setCoilWaterFlowPltSizNum(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const waterVdot, // water flow rate in m3/s bool const isAutoSized, // true if water flow was autosized int const DataPltSizNum, // plant sizing structure index @@ -286,7 +280,7 @@ public: // methods void setCoilEntAirTemp(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const entAirDryBulbTemp, // ideal loads sizing result for air entering coil drybulb temp (C) int const curSysNum, // airloop system number index, if non zero int const curZoneEqNum // zone equipment list index, if non-zero @@ -294,42 +288,42 @@ public: // methods void setCoilEntAirHumRat(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const entAirHumRat); void setCoilEntWaterTemp(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const entWaterTemp // degree C ); void setCoilLvgWaterTemp(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const lvgWaterTemp // degree C ); void setCoilWaterDeltaT(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const CoilWaterDeltaT // degree C temperature difference used to size coil ); void setCoilLvgAirTemp(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const lvgAirDryBulbTemp // air temperature leaving coil {C} ); void setCoilLvgAirHumRat(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const lvgAirHumRat // ); void setCoilCoolingCapacity(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const totalCoolingCap, // {W} coil cooling capacity bool const isAutoSize, // true if value was autosized int const curSysNum, // airloop system number index, if non zero @@ -343,7 +337,7 @@ public: // methods void setCoilHeatingCapacity(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const totalHeatingCap, // {W} coil Heating capacity bool const isAutoSize, // true if value was autosized int const curSysNum, // airloop system number index, if non zero @@ -357,7 +351,7 @@ public: // methods void setCoilWaterCoolingCapacity(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const totalCoolingCap, // {W} coil cooling capacity bool const isAutoSize, // true if value was autosized int const inletNodeNum, // coil chw inlet node num @@ -367,7 +361,7 @@ public: // methods void setCoilWaterHeaterCapacityNodeNums(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const totalHeatingCap, // {W} coil Heating capacity bool const isAutoSize, // true if value was autosized int const inletNodeNum, // coil chw inlet node num @@ -377,7 +371,7 @@ public: // methods void setCoilWaterHeaterCapacityPltSizNum(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const totalHeatingCap, // {W} coil Heating capacity bool const isAutoSize, // true if value was autosized int const dataPltSizNum, // plant sizing structure index @@ -386,7 +380,7 @@ public: // methods void setCoilUA(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const UAvalue, // [W/k] UA value for coil, Real64 const dataCapacityUsedForSizing, // [W] sizing global bool const isAutoSize, // true if value was autosized @@ -396,24 +390,187 @@ public: // methods void setCoilReheatMultiplier(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil Real64 const multiplierReheatLoad); void setCoilSupplyFanInfo(EnergyPlusData &state, std::string const &coilName, // user-defined name of the coil - std::string const &coilType, // idf input object class name of coil + HVAC::CoilType coilType, // idf input object class name of coil std::string const &fanName, HVAC::FanType fanType, int fanIndex); void setCoilEqNum(EnergyPlusData &state, std::string const &coilName, - std::string const &coilType, + HVAC::CoilType coilType, int const curSysNum, int const curOASysNum, int const curZoneEqNum); +#endif // OLD_API + + void setCoilFinalSizes(EnergyPlusData &state, + int const coilReportNum, + Real64 const totGrossCap, // total capacity [W] + Real64 const sensGrossCap, // sensible capacity [W] + Real64 const airFlowRate, // design or reference or rated air flow rate [m3/s] + Real64 const waterFlowRate // design or reference or rated water flow rate [m3/s] + ); + + void setRatedCoilConditions(EnergyPlusData &state, + int const coilReportNum, + Real64 const RatedCoilTotCap, // ! rated coil total capacity [W] + Real64 const RatedCoilSensCap, // rated coil sensible capacity [W] + Real64 const RatedAirMassFlow, // rated coil design air mass flow rate [m3/s] + Real64 const RatedCoilInDb, // rated coil inlet air dry bulb at time of peak [C] + Real64 const RatedCoilInHumRat, // rated coil inlet air humidity ratio [kgWater/kgDryAir] + Real64 const RatedCoilInWb, // rated coil inlet air wet bulb [C] + Real64 const RatedCoilOutDb, // rated coil outlet air dry bulb [C] + Real64 const RatedCoilOutHumRat, // rated coil outlet air humidity ratio, [kgWater/kgDryAir] + Real64 const RatedCoilOutWb, // rated coil outlet air wet bulb [C] + + Real64 const RatedCoilOadbRef, // rated DX coil outside air dry bulb reference [C] + Real64 const RatedCoilOawbRef, // rated DX coil outside air wet bulb reference [C] + Real64 const RatedCoilBpFactor, // rated coil bypass factor + Real64 const RatedCoilEff // rated coil effectiveness + ); + + void setCoilAirFlow(EnergyPlusData &state, + int const coilReportNum, + Real64 const airVdot, // air flow rate in m3/s + bool const isAutoSized // true if air flow was autosized + ); + + void setCoilWaterFlowNodeNums(EnergyPlusData &state, + int const coilReportNum, + Real64 const waterVdot, // water flow rate in m3/s + bool const isAutoSized, // true if water flow was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const DataWaterLoopNum // plant loop structure index + ); + + void setCoilWaterFlowPltSizNum(EnergyPlusData &state, + int const coilReportNum, + Real64 const waterVdot, // water flow rate in m3/s + bool const isAutoSized, // true if water flow was autosized + int const DataPltSizNum, // plant sizing structure index + int const DataWaterLoopNum // plant loop structure index + ); + + void setCoilEntAirTemp(EnergyPlusData &state, + int const coilReportNum, + Real64 const entAirDryBulbTemp, // ideal loads sizing result for air entering coil drybulb temp (C) + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum // zone equipment list index, if non-zero + ); - static std::string getTimeText(EnergyPlusData &state, int const timeStepAtPeak); + void setCoilEntAirHumRat(EnergyPlusData &state, + int const coilReportNum, + Real64 const entAirHumRat); + + void setCoilEntWaterTemp(EnergyPlusData &state, + int const coilReportNum, + Real64 const entWaterTemp // degree C + ); + + void setCoilLvgWaterTemp(EnergyPlusData &state, + int const coilReportNum, + Real64 const lvgWaterTemp // degree C + ); + + void setCoilWaterDeltaT(EnergyPlusData &state, + int const coilReportNum, + Real64 const CoilWaterDeltaT // degree C temperature difference used to size coil + ); + + void setCoilLvgAirTemp(EnergyPlusData &state, + int const coilReportNum, + Real64 const lvgAirDryBulbTemp // air temperature leaving coil {C} + ); + + void setCoilLvgAirHumRat(EnergyPlusData &state, + int const coilReportNum, + Real64 const lvgAirHumRat // + ); + + void setCoilCoolingCapacity(EnergyPlusData &state, + int const coilReportNum, + Real64 const totalCoolingCap, // {W} coil cooling capacity + bool const isAutoSize, // true if value was autosized + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum, // zone equipment list index, if non-zero + int const curOASysNum, // OA system equipment list index, if non-zero + Real64 const fanCoolLoad, // {W} fan load used in ideal loads coil sizing + Real64 const coilCapFunTempFac, // {W} curve result for modification factor for capacity as a function of temperature + Real64 const DXFlowPerCapMinRatio, // non dimensional ratio, capacity adjustment ratio min + Real64 const DXFlowPerCapMaxRatio // non dimensional ratio, capacity adjustment ratio max + ); + + void setCoilHeatingCapacity(EnergyPlusData &state, + int const coilReportNum, + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum, // zone equipment list index, if non-zero + int const curOASysNum, // OA system equipment list index, if non-zero + Real64 const fanHeatGain, // {W} fan load used in ideal loads coil sizing + Real64 const coilCapFunTempFac, // {W} curve result for modification factor for capacity as a function of temperature + Real64 const DXFlowPerCapMinRatio, // non dimensional ratio, capacity adjustment ratio min + Real64 const DXFlowPerCapMaxRatio // non dimensional ratio, capacity adjustment ratio max + ); + + void setCoilWaterCoolingCapacity(EnergyPlusData &state, + int const coilReportNum, + Real64 const totalCoolingCap, // {W} coil cooling capacity + bool const isAutoSize, // true if value was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const dataWaterLoopNum // plant loop structure index + ); + + void setCoilWaterHeaterCapacityNodeNums(EnergyPlusData &state, + int const coilReportNum, + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const dataWaterLoopNum // plant loop structure index + ); + + void setCoilWaterHeaterCapacityPltSizNum(EnergyPlusData &state, + int const coilReportNum, + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const dataPltSizNum, // plant sizing structure index + int const dataWaterLoopNum // plant loop structure index + ); + + void setCoilUA(EnergyPlusData &state, + int const coilReportNum, + Real64 const UAvalue, // [W/k] UA value for coil, + Real64 const dataCapacityUsedForSizing, // [W] sizing global + bool const isAutoSize, // true if value was autosized + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum // zone equipment list index, if non-zero + ); + + void setCoilReheatMultiplier(EnergyPlusData &state, + int const coilReportNum, + Real64 const multiplierReheatLoad); + + void setCoilSupplyFanInfo(EnergyPlusData &state, + int const coilReportNum, + std::string const &fanName, + HVAC::FanType fanType, + int fanIndex); + + void setCoilEqNum(EnergyPlusData &state, + int const coilReportNum, + int const curSysNum, + int const curOASysNum, + int const curZoneEqNum); + + std::string getTimeText(EnergyPlusData &state, int const timeStepAtPeak); bool isCompTypeFan(std::string const &compType // string component type, input object class name ); @@ -421,11 +578,10 @@ public: // methods bool isCompTypeCoil(std::string const &compType // string component type, input object class name ); - void setZoneLatentLoadCoolingIdealPeak(int const zoneIndex, Real64 const zoneCoolingLatentLoad); + void setZoneLatentLoadCoolingIdealPeak(EnergyPlusData &state, int const zoneIndex, Real64 const zoneCoolingLatentLoad); - void setZoneLatentLoadHeatingIdealPeak(int const zoneIndex, Real64 const zoneHeatingLatentLoad); + void setZoneLatentLoadHeatingIdealPeak(EnergyPlusData &state, int const zoneIndex, Real64 const zoneHeatingLatentLoad); -private: // methods void doAirLoopSetup(EnergyPlusData &state, int const coilVecIndex); void doZoneEqSetup(EnergyPlusData &state, int const coilVecIndex); @@ -436,25 +592,18 @@ private: // methods void writeCoilSelectionOutput2(EnergyPlusData &state); - int getIndexForOrCreateDataObjFromCoilName(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - std::string const &coilType // idf input object class name of coil + int getReportIndex(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType // idf input object class name of coil ); - void associateZoneCoilWithParent(EnergyPlusData &state, std::unique_ptr &c); - -public: // data - int numCoilsReported_; - std::vector> coilSelectionDataObjs; - -}; // end ReportCoilSelection class - -void createCoilSelectionReportObj(EnergyPlusData &state); + void associateZoneCoilWithParent(EnergyPlusData &state, CoilSelectionData *c); +} // namespace ReportCoilSelection + struct ReportCoilSelectionData : BaseGlobalStruct { - - std::unique_ptr coilSelectionReportObj; + std::vector coils; void init_constant_state([[maybe_unused]] EnergyPlusData &state) override { @@ -466,7 +615,8 @@ struct ReportCoilSelectionData : BaseGlobalStruct void clear_state() override { - this->coilSelectionReportObj.release(); + for (int i = 0; i < (int)this->coils.size(); ++i) delete this->coils[i]; + this->coils.clear(); } }; diff --git a/src/EnergyPlus/SimulationManager.cc b/src/EnergyPlus/SimulationManager.cc index 75bd5a30c37..69e61049cc9 100644 --- a/src/EnergyPlus/SimulationManager.cc +++ b/src/EnergyPlus/SimulationManager.cc @@ -220,7 +220,6 @@ namespace SimulationManager { OutputProcessor::SetupTimePointers(state, OutputProcessor::TimeStepType::System, state.dataHVACGlobal->TimeStepSys); createFacilityElectricPowerServiceObject(state); - createCoilSelectionReportObj(state); // read object information early in simulation isInputObjectUsed(state); diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 2d06eefd8d6..33c32406f2a 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -3130,8 +3130,8 @@ void SingleDuctAirTerminal::SizeSys(EnergyPlusData &state) TermUnitSizing(state.dataSize->CurTermUnitSizingNum).ReheatLoadMult = 1.0; } if (this->ReheatComp_Index > 0) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilReheatMultiplier( - state, this->ReheatName, this->ReheatComp, TermUnitSizing(state.dataSize->CurTermUnitSizingNum).ReheatLoadMult); + // ReportCoilSelection::setCoilReheatMultiplier(state, ReportCoilSelection::getReportIndex(this->ReheatName, this->ReheatComp), + // TermUnitSizing(state.dataSize->CurTermUnitSizingNum).ReheatLoadMult); } } diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index 1bd98a4869d..0abb29d1d5e 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -278,6 +278,10 @@ namespace SteamCoils { state.dataSteamCoils->SteamCoil(CoilNum).Name = AlphArray(1); + // state.dataSteamCoils->SteamCoil(CoilNum).coilReportNum = ReportCoilSelection::getReportIndex(state, + // state.dataSteamCoils->SteamCoil(CoilNum).Name, state.dataSteamCoils->SteamCoil(CoilNum).coilType); + + if (lAlphaBlanks(2)) { state.dataSteamCoils->SteamCoil(CoilNum).availSched = Sched::GetScheduleAlwaysOn(state); } else if ((state.dataSteamCoils->SteamCoil(CoilNum).availSched = Sched::GetSchedule(state, AlphArray(2))) == nullptr) { @@ -822,10 +826,9 @@ namespace SteamCoils { // Coil report, set fan info for airloopnum if (state.dataAirSystemsData->PrimaryAirSystems(state.dataSize->CurSysNum).supFanNum > 0) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( + ReportCoilSelection::setCoilSupplyFanInfo( state, - state.dataSteamCoils->SteamCoil(CoilNum).Name, - "Coil:Heating:Steam", + state.dataSteamCoils->SteamCoil(CoilNum).coilReportNum, state.dataFans->fans(state.dataAirSystemsData->PrimaryAirSystems(state.dataSize->CurSysNum).supFanNum)->Name, state.dataFans->fans(state.dataAirSystemsData->PrimaryAirSystems(state.dataSize->CurSysNum).supFanNum)->type, state.dataAirSystemsData->PrimaryAirSystems(state.dataSize->CurSysNum).supFanNum); @@ -904,47 +907,37 @@ namespace SteamCoils { RegisterPlantCompDesignFlow( state, state.dataSteamCoils->SteamCoil(CoilNum).SteamInletNodeNum, state.dataSteamCoils->SteamCoil(CoilNum).MaxSteamVolFlowRate); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilHeatingCapacity(state, - state.dataSteamCoils->SteamCoil(CoilNum).Name, - "Coil:Heating:Steam", - DesCoilLoad, - coilWasAutosized, - state.dataSize->CurSysNum, - state.dataSize->CurZoneEqNum, - state.dataSize->CurOASysNum, - 0.0, - 1.0, - -999.0, - -999.0); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowNodeNums(state, - state.dataSteamCoils->SteamCoil(CoilNum).Name, - "Coil:Heating:Steam", - state.dataSteamCoils->SteamCoil(CoilNum).MaxSteamVolFlowRate, - coilWasAutosized, - state.dataSteamCoils->SteamCoil(CoilNum).SteamInletNodeNum, - state.dataSteamCoils->SteamCoil(CoilNum).SteamOutletNodeNum, - state.dataSteamCoils->SteamCoil(CoilNum).plantLoc.loopNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterHeaterCapacityNodeNums( - state, - state.dataSteamCoils->SteamCoil(CoilNum).Name, - "Coil:Heating:Steam", - DesCoilLoad, - coilWasAutosized, - state.dataSteamCoils->SteamCoil(CoilNum).SteamInletNodeNum, - state.dataSteamCoils->SteamCoil(CoilNum).SteamOutletNodeNum, - state.dataSteamCoils->SteamCoil(CoilNum).plantLoc.loopNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntWaterTemp( - state, state.dataSteamCoils->SteamCoil(CoilNum).Name, "Coil:Heating:Steam", TempSteamIn); // coil report - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgWaterTemp( - state, - state.dataSteamCoils->SteamCoil(CoilNum).Name, - "Coil:Heating:Steam", - TempSteamIn - state.dataSteamCoils->SteamCoil(CoilNum).DegOfSubcooling); // coil report - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterDeltaT( - state, - state.dataSteamCoils->SteamCoil(CoilNum).Name, - "Coil:Heating:Steam", - state.dataSteamCoils->SteamCoil(CoilNum).DegOfSubcooling); // coil report + ReportCoilSelection::setCoilHeatingCapacity(state, + state.dataSteamCoils->SteamCoil(CoilNum).coilReportNum, + DesCoilLoad, + coilWasAutosized, + state.dataSize->CurSysNum, + state.dataSize->CurZoneEqNum, + state.dataSize->CurOASysNum, + 0.0, + 1.0, + -999.0, + -999.0); + ReportCoilSelection::setCoilWaterFlowNodeNums(state, + state.dataSteamCoils->SteamCoil(CoilNum).coilReportNum, + state.dataSteamCoils->SteamCoil(CoilNum).MaxSteamVolFlowRate, + coilWasAutosized, + state.dataSteamCoils->SteamCoil(CoilNum).SteamInletNodeNum, + state.dataSteamCoils->SteamCoil(CoilNum).SteamOutletNodeNum, + state.dataSteamCoils->SteamCoil(CoilNum).plantLoc.loopNum); + ReportCoilSelection::setCoilWaterHeaterCapacityNodeNums(state, + state.dataSteamCoils->SteamCoil(CoilNum).coilReportNum, + DesCoilLoad, + coilWasAutosized, + state.dataSteamCoils->SteamCoil(CoilNum).SteamInletNodeNum, + state.dataSteamCoils->SteamCoil(CoilNum).SteamOutletNodeNum, + state.dataSteamCoils->SteamCoil(CoilNum).plantLoc.loopNum); + ReportCoilSelection::setCoilEntWaterTemp(state, state.dataSteamCoils->SteamCoil(CoilNum).coilReportNum, TempSteamIn); // coil report + ReportCoilSelection::setCoilLvgWaterTemp(state, state.dataSteamCoils->SteamCoil(CoilNum).coilReportNum, + TempSteamIn - state.dataSteamCoils->SteamCoil(CoilNum).DegOfSubcooling); // coil report + ReportCoilSelection::setCoilWaterDeltaT(state, + state.dataSteamCoils->SteamCoil(CoilNum).coilReportNum, + state.dataSteamCoils->SteamCoil(CoilNum).DegOfSubcooling); // coil report state.dataSteamCoils->SteamCoil(CoilNum).DesCoilCapacity = DesCoilLoad; state.dataSteamCoils->SteamCoil(CoilNum).DesAirVolFlow = DesVolFlow; if (ErrorsFound) { @@ -952,22 +945,21 @@ namespace SteamCoils { } // There is no standard rating for heating coils at this point, so fill with dummy flag values - state.dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions(state, - state.dataSteamCoils->SteamCoil(CoilNum).Name, - "Coil:Heating:Steam", - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0); + ReportCoilSelection::setRatedCoilConditions(state, + state.dataSteamCoils->SteamCoil(CoilNum).coilReportNum, + -999.0, + -999.0, + -999.0, + -999.0, + -999.0, + -999.0, + -999.0, + -999.0, + -999.0, + -999.0, + -999.0, + -999.0, + -999.0); } // End Initialization Section of the Module diff --git a/src/EnergyPlus/SteamCoils.hh b/src/EnergyPlus/SteamCoils.hh index bf7c3a35a81..196496555bf 100644 --- a/src/EnergyPlus/SteamCoils.hh +++ b/src/EnergyPlus/SteamCoils.hh @@ -81,6 +81,9 @@ namespace SteamCoils { std::string SteamCoilTypeA; // Type of SteamCoil ie. Heating or Cooling int SteamCoilType; // Type of SteamCoil ie. Heating or Cooling int SteamCoilModel; // Type of SteamCoil ie. Simple, Detailed, etc. + + int coilReportNum = -1; + Sched::Schedule *availSched = nullptr; // operating schedule Real64 InletAirMassFlowRate; // MassFlow through the SteamCoil being Simulated [kg/s] Real64 OutletAirMassFlowRate; // MassFlow throught the SteamCoil being Simulated[kg/s] diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index 5827485c106..26ae98a944d 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -563,8 +563,8 @@ namespace UnitHeater { OutputProcessor::StoreType::Average, unitHeat.Name); } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, unitHeat.HCoilName, unitHeat.HCoilTypeCh, unitHeat.FanName, unitHeat.fanType, unitHeat.Fan_Index); + // ReportCoilSelection::setCoilSupplyFanInfo(state, ReportCoilSelection::getReportIndex(unitHeat.HCoilName, unitHeat.HCoilTypeCh), + // unitHeat.FanName, unitHeat.fanType, unitHeat.Fan_Index); } } diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index 700d18327d7..8ce27fdbf4a 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -902,7 +902,6 @@ namespace UnitVentilator { for (int UnitVentNum = 1; UnitVentNum <= state.dataUnitVentilators->NumOfUnitVents; ++UnitVentNum) { auto &unitVent = state.dataUnitVentilators->UnitVent(UnitVentNum); - auto &coilReportObj = state.dataRptCoilSelection->coilSelectionReportObj; SetupOutputVariable(state, "Zone Unit Ventilator Heating Rate", @@ -979,12 +978,12 @@ namespace UnitVentilator { } if (unitVent.HCoilPresent) { - coilReportObj->setCoilSupplyFanInfo( - state, unitVent.HCoilName, unitVent.HCoilTypeCh, unitVent.FanName, unitVent.fanType, unitVent.Fan_Index); + // ReportCoilSelection::setCoilSupplyFanInfo( + // state, ReportCoilSelection::getReportIndex(unitVent.HCoilName, unitVent.HCoilTypeCh), unitVent.FanName, unitVent.fanType, unitVent.Fan_Index); } if (unitVent.CCoilPresent) { - coilReportObj->setCoilSupplyFanInfo( - state, unitVent.CCoilName, unitVent.CCoilTypeCh, unitVent.FanName, unitVent.fanType, unitVent.Fan_Index); + // ReportCoilSelection::setCoilSupplyFanInfo( + // state, ReportCoilSelection::getReportIndex(unitVent.CCoilName, unitVent.CCoilTypeCh), unitVent.FanName, unitVent.fanType, unitVent.Fan_Index); } } } diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 06bd75e2ca5..e41533a56ea 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -427,33 +427,30 @@ namespace UnitarySystems { // associates an air loop fan on main branch with a coil on main branch where parent does not have a fan if (!this->m_FanExists) { if (state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum).supFanType != HVAC::FanType::Invalid) { - auto &primaryAirSystems = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum); + // auto &primaryAirSystems = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum); if (this->m_CoolCoilExists) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, - this->m_CoolingCoilName, - HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num), - state.dataFans->fans(primaryAirSystems.supFanNum)->Name, - state.dataFans->fans(primaryAirSystems.supFanNum)->type, - primaryAirSystems.supFanNum); + // ReportCoilSelection::setCoilSupplyFanInfo( + // state, + // ReportCoilSelection::getReportIndex(this->m_CoolingCoilName, HVAC::cAllCoilTypes(this->m_CoolingCoilType_Num)), + // state.dataFans->fans(primaryAirSystems.supFanNum)->Name, + // state.dataFans->fans(primaryAirSystems.supFanNum)->type, + // primaryAirSystems.supFanNum); } if (this->m_HeatCoilExists) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, - this->m_HeatingCoilName, - HVAC::cAllCoilTypes(this->m_HeatingCoilType_Num), - state.dataFans->fans(primaryAirSystems.supFanNum)->Name, - state.dataFans->fans(primaryAirSystems.supFanNum)->type, - primaryAirSystems.supFanNum); + // ReportCoilSelection::setCoilSupplyFanInfo( + // state, + // ReportCoilSelection::getReportIndex(this->m_HeatingCoilName, HVAC::cAllCoilTypes(this->m_HeatingCoilType_Num)), + // state.dataFans->fans(primaryAirSystems.supFanNum)->Name, + // state.dataFans->fans(primaryAirSystems.supFanNum)->type, + // primaryAirSystems.supFanNum); } if (this->m_SuppCoilExists) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, - this->m_SuppHeatCoilName, - HVAC::cAllCoilTypes(this->m_SuppHeatCoilType_Num), - state.dataFans->fans(primaryAirSystems.supFanNum)->Name, - state.dataFans->fans(primaryAirSystems.supFanNum)->type, - primaryAirSystems.supFanNum); + // ReportCoilSelection::setCoilSupplyFanInfo( + // state, + // ReportCoilSelection::getReportIndex(this->m_SuppHeatCoilName, HVAC::cAllCoilTypes(this->m_SuppHeatCoilType_Num)), + // state.dataFans->fans(primaryAirSystems.supFanNum)->Name, + // state.dataFans->fans(primaryAirSystems.supFanNum)->type, + // primaryAirSystems.supFanNum); } } } @@ -4827,13 +4824,12 @@ namespace UnitarySystems { thisCoolCoil.SupplyFanIndex = this->m_FanIndex; thisCoolCoil.supplyFanType = this->m_FanType; if (this->m_FanType != HVAC::FanType::Invalid) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, - thisCoolCoil.Name, - thisCoolCoil.DXCoilType, - state.dataFans->fans(thisCoolCoil.SupplyFanIndex)->Name, - this->m_FanType, - thisCoolCoil.SupplyFanIndex); + // ReportCoilSelection::setCoilSupplyFanInfo( + // state, + // ReportCoilSelection::getReportIndex(thisCoolCoil.Name, thisCoolCoil.DXCoilType), + // state.dataFans->fans(thisCoolCoil.SupplyFanIndex)->Name, + // this->m_FanType, + // thisCoolCoil.SupplyFanIndex); } } if (this->m_HeatCoilExists) { @@ -5795,8 +5791,8 @@ namespace UnitarySystems { // set fan info for supplemental heating coils if (this->m_SuppCoilExists && this->m_FanExists) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, this->m_SuppHeatCoilName, this->m_SuppHeatCoilTypeName, this->m_FanName, this->m_FanType, this->m_FanIndex); + // ReportCoilSelection::setCoilSupplyFanInfo( + // state, ReportCoilSelection::getReportIndex(this->m_SuppHeatCoilName, this->m_SuppHeatCoilTypeName), this->m_FanName, this->m_FanType, this->m_FanIndex); } // Users may not provide SA flow input fields (below) and leave them blank. Check if other coil is AutoSized first to @@ -6418,8 +6414,8 @@ namespace UnitarySystems { } } // set fan info for cooling coils - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, this->m_CoolingCoilName, input_data.cooling_coil_object_type, this->m_FanName, this->m_FanType, this->m_FanIndex); + // ReportCoilSelection::setCoilSupplyFanInfo( + // state, ReportCoilSelection::getReportIndex(this->m_CoolingCoilName, input_data.cooling_coil_object_type), this->m_FanName, this->m_FanType, this->m_FanIndex); } if (this->m_HeatCoilExists) { if (loc_m_HeatingSAFMethod.empty()) { @@ -6440,8 +6436,8 @@ namespace UnitarySystems { } } // set fan info for heating coils - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo( - state, this->m_HeatingCoilName, this->m_HeatingCoilTypeName, this->m_FanName, this->m_FanType, this->m_FanIndex); + // ReportCoilSelection::setCoilSupplyFanInfo( + // state, ReportCoilSelection::getCoilIndex(this->m_HeatingCoilName, this->m_HeatingCoilTypeName), this->m_FanName, this->m_FanType, this->m_FanIndex); } } diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index 81eaabb93c0..626786ea436 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -279,6 +279,9 @@ namespace VariableSpeedCoils { state.dataHeatBal->HeatReclaimVS_Coil(DXCoilNum).SourceType = CurrentModuleObject; varSpeedCoil.VSCoilType = HVAC::Coil_CoolingWaterToAirHPVSEquationFit; varSpeedCoil.VarSpeedCoilType = HVAC::cAllCoilTypes(varSpeedCoil.VSCoilType); + + // varSpeedCoil.coilReportNum = ReportCoilSelection::getReportIndex(statate, varSpeedCoil.Name, varSpeedCoil.coilType); + std::string const availSchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "availability_schedule_name"); if (availSchedName.empty()) { varSpeedCoil.availSched = Sched::GetScheduleAlwaysOn(state); @@ -722,6 +725,9 @@ namespace VariableSpeedCoils { varSpeedCoil.CoolHeatType = "COOLING"; varSpeedCoil.VSCoilType = HVAC::Coil_CoolingAirToAirVariableSpeed; varSpeedCoil.VarSpeedCoilType = HVAC::cAllCoilTypes(varSpeedCoil.VSCoilType); + + // varSpeedCoil.coilReportNum = ReportCoilSelection::getReportIndex(statate, varSpeedCoil.Name, varSpeedCoil.coilType); + std::string const availSchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "availability_schedule_name"); if (availSchedName.empty()) { varSpeedCoil.availSched = Sched::GetScheduleAlwaysOn(state); @@ -1208,6 +1214,9 @@ namespace VariableSpeedCoils { varSpeedCoil.CoolHeatType = "HEATING"; varSpeedCoil.VSCoilType = HVAC::Coil_HeatingWaterToAirHPVSEquationFit; varSpeedCoil.VarSpeedCoilType = HVAC::cAllCoilTypes(varSpeedCoil.VSCoilType); + + // varSpeedCoil.coilReportNum = ReportCoilSelection::getReportIndex(statate, varSpeedCoil.Name, varSpeedCoil.coilType); + varSpeedCoil.CondenserType = DataHeatBalance::RefrigCondenserType::Water; std::string const availSchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "availability_schedule_name"); if (availSchedName.empty()) { @@ -1622,6 +1631,9 @@ namespace VariableSpeedCoils { varSpeedCoil.CoolHeatType = "HEATING"; varSpeedCoil.VSCoilType = HVAC::Coil_HeatingAirToAirVariableSpeed; varSpeedCoil.VarSpeedCoilType = HVAC::cAllCoilTypes(HVAC::Coil_HeatingAirToAirVariableSpeed); + + // varSpeedCoil.coilReportNum = ReportCoilSelection::getReportIndex(statate, varSpeedCoil.Name, varSpeedCoil.coilType); + std::string const availSchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "availability_schedule_name"); if (availSchedName.empty()) { varSpeedCoil.availSched = Sched::GetScheduleAlwaysOn(state); @@ -2037,6 +2049,8 @@ namespace VariableSpeedCoils { varSpeedCoil.VSCoilType = HVAC::CoilDX_HeatPumpWaterHeaterVariableSpeed; varSpeedCoil.VarSpeedCoilType = HVAC::cAllCoilTypes(HVAC::CoilDX_HeatPumpWaterHeaterVariableSpeed); + // varSpeedCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, varSpeedCoil.Name, varSpeedCoil.coilType); + ErrorObjectHeader eoh{routineName, CurrentModuleObject, varSpeedCoil.Name}; // ErrorsFound will be set to True if problem was found, left untouched otherwise @@ -3556,22 +3570,21 @@ namespace VariableSpeedCoils { Real64 RatedOutletWetBulb(0.0); RatedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb( state, varSpeedCoil.OutletAirDBTemp, varSpeedCoil.OutletAirHumRat, DataEnvironment::StdPressureSeaLevel, RoutineName); - state.dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions(state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, - varSpeedCoil.QLoadTotal, // this is the report variable - varSpeedCoil.QSensible, // this is the report variable - varSpeedCoil.AirMassFlowRate, - varSpeedCoil.InletAirDBTemp, - varSpeedCoil.InletAirHumRat, - RatedInletWetBulbTemp, - varSpeedCoil.OutletAirDBTemp, - varSpeedCoil.OutletAirHumRat, - RatedOutletWetBulb, - RatedAmbAirTemp, - ratedOutdoorAirWetBulb, - varSpeedCoil.MSRatedCBF(varSpeedCoil.NumOfSpeeds), - -999.0); // coil effectiveness not define for DX + ReportCoilSelection::setRatedCoilConditions(state, + varSpeedCoil.coilReportNum, + varSpeedCoil.QLoadTotal, // this is the report variable + varSpeedCoil.QSensible, // this is the report variable + varSpeedCoil.AirMassFlowRate, + varSpeedCoil.InletAirDBTemp, + varSpeedCoil.InletAirHumRat, + RatedInletWetBulbTemp, + varSpeedCoil.OutletAirDBTemp, + varSpeedCoil.OutletAirHumRat, + RatedOutletWetBulb, + RatedAmbAirTemp, + ratedOutdoorAirWetBulb, + varSpeedCoil.MSRatedCBF(varSpeedCoil.NumOfSpeeds), + -999.0); // coil effectiveness not define for DX // now replace the outdoor air conditions set above for one time rating point calc state.dataEnvrn->OutDryBulbTemp = holdOutDryBulbTemp; @@ -3642,22 +3655,21 @@ namespace VariableSpeedCoils { Real64 RatedOutletWetBulb(0.0); RatedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb( state, varSpeedCoil.OutletAirDBTemp, varSpeedCoil.OutletAirHumRat, DataEnvironment::StdPressureSeaLevel, RoutineName); - state.dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions(state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, - varSpeedCoil.QLoadTotal, // this is the report variable - varSpeedCoil.QSensible, // this is the report variable - varSpeedCoil.AirMassFlowRate, - varSpeedCoil.InletAirDBTemp, - varSpeedCoil.InletAirHumRat, - RatedInletWetBulbTemp, - varSpeedCoil.OutletAirDBTemp, - varSpeedCoil.OutletAirHumRat, - RatedOutletWetBulb, - RatedAmbAirTempHeat, - RatedAmbAirWBHeat, - varSpeedCoil.MSRatedCBF(varSpeedCoil.NumOfSpeeds), - -999.0); // coil effectiveness not define for DX + ReportCoilSelection::setRatedCoilConditions(state, + varSpeedCoil.coilReportNum, + varSpeedCoil.QLoadTotal, // this is the report variable + varSpeedCoil.QSensible, // this is the report variable + varSpeedCoil.AirMassFlowRate, + varSpeedCoil.InletAirDBTemp, + varSpeedCoil.InletAirHumRat, + RatedInletWetBulbTemp, + varSpeedCoil.OutletAirDBTemp, + varSpeedCoil.OutletAirHumRat, + RatedOutletWetBulb, + RatedAmbAirTempHeat, + RatedAmbAirWBHeat, + varSpeedCoil.MSRatedCBF(varSpeedCoil.NumOfSpeeds), + -999.0); // coil effectiveness not define for DX // now replace the outdoor air conditions set above for one time rating point calc state.dataEnvrn->OutDryBulbTemp = holdOutDryBulbTemp; @@ -3668,12 +3680,11 @@ namespace VariableSpeedCoils { // store fan info for coil if (varSpeedCoil.SupplyFanIndex > 0) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo(state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, - varSpeedCoil.SupplyFanName, - varSpeedCoil.supplyFanType, - varSpeedCoil.SupplyFanIndex); + ReportCoilSelection::setCoilSupplyFanInfo(state, + varSpeedCoil.coilReportNum, + varSpeedCoil.SupplyFanName, + varSpeedCoil.supplyFanType, + varSpeedCoil.SupplyFanIndex); } } @@ -3998,8 +4009,8 @@ namespace VariableSpeedCoils { varSpeedCoil.RatedCapWH * varSpeedCoil.MSRatedAirVolFlowRate(NormSpeed) / varSpeedCoil.MSRatedTotCap(NormSpeed); // 0.00005035; varSpeedCoil.AirVolFlowAutoSized = true; } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow( - state, varSpeedCoil.Name, varSpeedCoil.VarSpeedCoilType, varSpeedCoil.RatedAirVolFlowRate, varSpeedCoil.AirVolFlowAutoSized); + ReportCoilSelection::setCoilAirFlow( + state, varSpeedCoil.coilReportNum, varSpeedCoil.RatedAirVolFlowRate, varSpeedCoil.AirVolFlowAutoSized); if (varSpeedCoil.RatedWaterVolFlowRate == Constant::AutoCalculate) { varSpeedCoil.RatedHPWHCondWaterFlow = varSpeedCoil.RatedCapWH * varSpeedCoil.MSRatedWaterVolFlowRate(NormSpeed) / @@ -4007,13 +4018,12 @@ namespace VariableSpeedCoils { varSpeedCoil.RatedWaterVolFlowRate = varSpeedCoil.RatedHPWHCondWaterFlow; varSpeedCoil.WaterVolFlowAutoSized = true; } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowPltSizNum(state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, - varSpeedCoil.RatedWaterVolFlowRate, - varSpeedCoil.WaterVolFlowAutoSized, - -999, - varSpeedCoil.plantLoc.loopNum); + ReportCoilSelection::setCoilWaterFlowPltSizNum(state, + varSpeedCoil.coilReportNum, + varSpeedCoil.RatedWaterVolFlowRate, + varSpeedCoil.WaterVolFlowAutoSized, + -999, + varSpeedCoil.plantLoc.loopNum); } if (varSpeedCoil.RatedAirVolFlowRate == DataSizing::AutoSize) { @@ -4339,27 +4349,22 @@ namespace VariableSpeedCoils { } } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp( - state, varSpeedCoil.Name, varSpeedCoil.VarSpeedCoilType, MixTemp, state.dataSize->CurSysNum, state.dataSize->CurZoneEqNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat( - state, varSpeedCoil.Name, varSpeedCoil.VarSpeedCoilType, MixHumRat); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(state, varSpeedCoil.Name, varSpeedCoil.VarSpeedCoilType, SupTemp); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirHumRat( - state, varSpeedCoil.Name, varSpeedCoil.VarSpeedCoilType, SupHumRat); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow( - state, varSpeedCoil.Name, varSpeedCoil.VarSpeedCoilType, varSpeedCoil.RatedAirVolFlowRate, RatedAirFlowAutoSized); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilCoolingCapacity(state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, - RatedCapCoolTotalDes, - RatedCapCoolTotalAutoSized, - state.dataSize->CurSysNum, - state.dataSize->CurZoneEqNum, - state.dataSize->CurOASysNum, - 0.0, // no fan load included in sizing - TotCapTempModFac, - -999.0, - -999.0); // VS model doesn't limit, double check + ReportCoilSelection::setCoilEntAirTemp(state, varSpeedCoil.coilReportNum, MixTemp, state.dataSize->CurSysNum, state.dataSize->CurZoneEqNum); + ReportCoilSelection::setCoilEntAirHumRat(state, varSpeedCoil.coilReportNum, MixHumRat); + ReportCoilSelection::setCoilLvgAirTemp(state, varSpeedCoil.coilReportNum, SupTemp); + ReportCoilSelection::setCoilLvgAirHumRat(state, varSpeedCoil.coilReportNum, SupHumRat); + ReportCoilSelection::setCoilAirFlow(state, varSpeedCoil.coilReportNum, varSpeedCoil.RatedAirVolFlowRate, RatedAirFlowAutoSized); + ReportCoilSelection::setCoilCoolingCapacity(state, + varSpeedCoil.coilReportNum, + RatedCapCoolTotalDes, + RatedCapCoolTotalAutoSized, + state.dataSize->CurSysNum, + state.dataSize->CurZoneEqNum, + state.dataSize->CurOASysNum, + 0.0, // no fan load included in sizing + TotCapTempModFac, + -999.0, + -999.0); // VS model doesn't limit, double check } // Set the global DX cooling coil capacity variable for use by other objects @@ -4410,18 +4415,17 @@ namespace VariableSpeedCoils { if (RatedCapHeatDes < HVAC::SmallLoad) { RatedCapHeatDes = 0.0; } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilHeatingCapacity(state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, - RatedCapHeatDes, - RatedCapHeatAutoSized, - state.dataSize->CurSysNum, - state.dataSize->CurZoneEqNum, - state.dataSize->CurOASysNum, - 0.0, - 1.0, - -999.0, - -999.0); + ReportCoilSelection::setCoilHeatingCapacity(state, + varSpeedCoil.coilReportNum, + RatedCapHeatDes, + RatedCapHeatAutoSized, + state.dataSize->CurSysNum, + state.dataSize->CurZoneEqNum, + state.dataSize->CurOASysNum, + 0.0, + 1.0, + -999.0, + -999.0); } if (RatedCapHeatAutoSized) { varSpeedCoil.RatedCapHeat = RatedCapHeatDes; @@ -4513,8 +4517,8 @@ namespace VariableSpeedCoils { } } } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow( - state, varSpeedCoil.Name, varSpeedCoil.VarSpeedCoilType, RatedAirVolFlowRateDes, RatedAirFlowAutoSized); + ReportCoilSelection::setCoilAirFlow( + state, varSpeedCoil.coilReportNum, RatedAirVolFlowRateDes, RatedAirFlowAutoSized); } // Check that heat pump heating capacity is within 20% of cooling capacity. Check only for heating coil and report both. @@ -4682,10 +4686,9 @@ namespace VariableSpeedCoils { RatedWaterVolFlowRateDes = varSpeedCoil.RatedCapHeat / (state.dataSize->PlantSizData(PltSizNum).DeltaT * cp * rho); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgWaterTemp( + ReportCoilSelection::setCoilLvgWaterTemp( state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, + varSpeedCoil.coilReportNum, state.dataSize->PlantSizData(PltSizNum).ExitTemp + state.dataSize->PlantSizData(PltSizNum).DeltaT); // TRACE 3D Plus coil selection report @@ -4701,24 +4704,21 @@ namespace VariableSpeedCoils { RatedWaterVolFlowRateDes = SystemCapacity / (state.dataSize->PlantSizData(PltSizNum).DeltaT * cp * rho); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgWaterTemp( + ReportCoilSelection::setCoilLvgWaterTemp( state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, + varSpeedCoil.coilReportNum, state.dataSize->PlantSizData(PltSizNum).ExitTemp - state.dataSize->PlantSizData(PltSizNum).DeltaT); // TRACE 3D Plus coil selection report } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntWaterTemp( + ReportCoilSelection::setCoilEntWaterTemp( state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, + varSpeedCoil.coilReportNum, state.dataSize->PlantSizData(PltSizNum).ExitTemp); // TRACE 3D Plus coil selection report - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterDeltaT( + ReportCoilSelection::setCoilWaterDeltaT( state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, + varSpeedCoil.coilReportNum, state.dataSize->PlantSizData(PltSizNum).DeltaT); // TRACE 3D Plus coil selection report } else { ShowSevereError(state, "Autosizing of water flow requires a loop Sizing:Plant object"); @@ -4735,14 +4735,13 @@ namespace VariableSpeedCoils { } else if (RatedCapHeatAutoSized) { RatedWaterVolFlowRateDes = varSpeedCoil.RatedCapHeat * varSpeedCoil.MSRatedWaterVolFlowPerRatedTotCap(NormSpeed); } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowNodeNums(state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, - RatedWaterVolFlowRateDes, - RatedWaterFlowAutoSized, - varSpeedCoil.WaterInletNodeNum, - varSpeedCoil.WaterOutletNodeNum, - varSpeedCoil.plantLoc.loopNum); + ReportCoilSelection::setCoilWaterFlowNodeNums(state, + varSpeedCoil.coilReportNum, + RatedWaterVolFlowRateDes, + RatedWaterFlowAutoSized, + varSpeedCoil.WaterInletNodeNum, + varSpeedCoil.WaterOutletNodeNum, + varSpeedCoil.plantLoc.loopNum); varSpeedCoil.RatedWaterVolFlowRate = RatedWaterVolFlowRateDes; BaseSizer::reportSizerOutput(state, EnergyPlus::format("COIL:{}{}", varSpeedCoil.CoolHeatType, CurrentObjSubfix), @@ -7646,22 +7645,20 @@ namespace VariableSpeedCoils { if (!state.dataGlobal->WarmupFlag && !state.dataGlobal->DoingHVACSizingSimulations && !state.dataGlobal->DoingSizing) { if (varSpeedCoil.VSCoilType == HVAC::Coil_CoolingWaterToAirHPVSEquationFit || varSpeedCoil.VSCoilType == HVAC::Coil_CoolingAirToAirVariableSpeed) { // cooling coil - state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes(state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, - varSpeedCoil.RatedCapCoolTotal, - varSpeedCoil.RatedCapCoolSens, - varSpeedCoil.RatedAirVolFlowRate, - varSpeedCoil.RatedWaterMassFlowRate); + ReportCoilSelection::setCoilFinalSizes(state, + varSpeedCoil.coilReportNum, + varSpeedCoil.RatedCapCoolTotal, + varSpeedCoil.RatedCapCoolSens, + varSpeedCoil.RatedAirVolFlowRate, + varSpeedCoil.RatedWaterMassFlowRate); } else if (varSpeedCoil.VSCoilType == HVAC::Coil_HeatingWaterToAirHPVSEquationFit || varSpeedCoil.VSCoilType == HVAC::Coil_HeatingAirToAirVariableSpeed) { // heating coil - state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes(state, - varSpeedCoil.Name, - varSpeedCoil.VarSpeedCoilType, - varSpeedCoil.RatedCapHeat, - varSpeedCoil.RatedCapHeat, - varSpeedCoil.RatedAirVolFlowRate, - varSpeedCoil.RatedWaterMassFlowRate); + ReportCoilSelection::setCoilFinalSizes(state, + varSpeedCoil.coilReportNum, + varSpeedCoil.RatedCapHeat, + varSpeedCoil.RatedCapHeat, + varSpeedCoil.RatedAirVolFlowRate, + varSpeedCoil.RatedWaterMassFlowRate); } varSpeedCoil.reportCoilFinalSizes = false; } diff --git a/src/EnergyPlus/VariableSpeedCoils.hh b/src/EnergyPlus/VariableSpeedCoils.hh index 9f0eb74fe09..6bce532c1b6 100644 --- a/src/EnergyPlus/VariableSpeedCoils.hh +++ b/src/EnergyPlus/VariableSpeedCoils.hh @@ -75,6 +75,8 @@ namespace VariableSpeedCoils { std::string Name; // Name of the Coil Sched::Schedule *availSched = nullptr; // availability schedule std::string VarSpeedCoilType; // type of coil + + int coilReportNum = -1; int NumOfSpeeds; // Number of speeds int NormSpedLevel; // Nominal speed level Real64 RatedWaterVolFlowRate; // Rated/Ref Water Volumetric Flow Rate [m3/s] diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index 5be86a9ebc6..51c7b0fceb3 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -335,6 +335,9 @@ void GetWaterCoilInput(EnergyPlusData &state) auto &waterCoil = state.dataWaterCoils->WaterCoil(CoilNum); waterCoil.Name = AlphArray(1); + + // waterCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, waterCoil.Name, waterCoil.coilType); + if (lAlphaBlanks(2)) { waterCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((waterCoil.availSched = Sched::GetSchedule(state, AlphArray(2))) == nullptr) { @@ -505,6 +508,8 @@ void GetWaterCoilInput(EnergyPlusData &state) auto &waterCoil = state.dataWaterCoils->WaterCoil(CoilNum); waterCoil.Name = AlphArray(1); + // waterCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, waterCoil.Name, waterCoil.coilType); + if (lAlphaBlanks(2)) { waterCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((waterCoil.availSched = Sched::GetSchedule(state, AlphArray(2))) == nullptr) { @@ -731,6 +736,8 @@ void GetWaterCoilInput(EnergyPlusData &state) auto &waterCoil = state.dataWaterCoils->WaterCoil(CoilNum); waterCoil.Name = AlphArray(1); + // waterCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, waterCoil.Name, waterCoil.coilType); + if (lAlphaBlanks(2)) { waterCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((waterCoil.availSched = Sched::GetSchedule(state, AlphArray(2))) == nullptr) { @@ -1289,10 +1296,8 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA } else { CompType = HVAC::cAllCoilTypes(HVAC::Coil_CoolingWater); } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp( - state, waterCoil.Name, CompType, state.dataWaterCoils->TOutNew); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirHumRat( - state, waterCoil.Name, CompType, state.dataWaterCoils->WOutNew); + ReportCoilSelection::setCoilLvgAirTemp(state, waterCoil.coilReportNum, state.dataWaterCoils->TOutNew); + ReportCoilSelection::setCoilLvgAirHumRat(state, waterCoil.coilReportNum, state.dataWaterCoils->WOutNew); // end update outlet air conditions used for sizing } } @@ -1624,12 +1629,11 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA "Water Heating Coil Capacity Information,Coil:Heating:Water", waterCoil.Name, waterCoil.TotWaterHeatingCoilRate); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow( - state, waterCoil.Name, "Coil:Heating:Water", waterCoil.DesAirVolFlowRate, waterCoil.RequestingAutoSize); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterHeaterCapacityNodeNums( + ReportCoilSelection::setCoilAirFlow( + state, waterCoil.coilReportNum, waterCoil.DesAirVolFlowRate, waterCoil.RequestingAutoSize); + ReportCoilSelection::setCoilWaterHeaterCapacityNodeNums( state, - waterCoil.Name, - "Coil:Heating:Water", + waterCoil.coilReportNum, waterCoil.DesWaterHeatingCoilRate, waterCoil.RequestingAutoSize, waterCoil.WaterInletNodeNum, @@ -1673,19 +1677,17 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA waterCoil.SenWaterCoolingCoilRate, state.dataWaterCoils->RatedLatentCapacity, state.dataWaterCoils->RatedSHR); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow(state, - waterCoil.Name, - "Coil:Cooling:Water:DetailedGeometry", - waterCoil.DesAirVolFlowRate, - waterCoil.RequestingAutoSize); // Coil Report - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterCoolingCapacity(state, - waterCoil.Name, - "Coil:Cooling:Water:DetailedGeometry", - waterCoil.DesWaterCoolingCoilRate, - waterCoil.RequestingAutoSize, - waterCoil.WaterInletNodeNum, - waterCoil.WaterOutletNodeNum, - waterCoil.WaterPlantLoc.loopNum); // Coil Report + ReportCoilSelection::setCoilAirFlow(state, + waterCoil.coilReportNum, + waterCoil.DesAirVolFlowRate, + waterCoil.RequestingAutoSize); // Coil Report + ReportCoilSelection::setCoilWaterCoolingCapacity(state, + waterCoil.coilReportNum, + waterCoil.DesWaterCoolingCoilRate, + waterCoil.RequestingAutoSize, + waterCoil.WaterInletNodeNum, + waterCoil.WaterOutletNodeNum, + waterCoil.WaterPlantLoc.loopNum); // Coil Report break; } case DataPlant::PlantEquipmentType::CoilWaterCooling: { @@ -1729,19 +1731,17 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA state.dataWaterCoils->RatedSHR, state.dataWaterCoils->UATotal, state.dataWaterCoils->SurfaceArea); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow(state, - waterCoil.Name, - "Coil:Cooling:Water", - waterCoil.DesAirVolFlowRate, - waterCoil.RequestingAutoSize); // Coil Report - state.dataRptCoilSelection->coilSelectionReportObj->setCoilWaterCoolingCapacity(state, - waterCoil.Name, - "Coil:Cooling:Water", - waterCoil.DesWaterCoolingCoilRate, - waterCoil.RequestingAutoSize, - waterCoil.WaterInletNodeNum, - waterCoil.WaterOutletNodeNum, - waterCoil.WaterPlantLoc.loopNum); // Coil Report + ReportCoilSelection::setCoilAirFlow(state, + waterCoil.coilReportNum, + waterCoil.DesAirVolFlowRate, + waterCoil.RequestingAutoSize); // Coil Report + ReportCoilSelection::setCoilWaterCoolingCapacity(state, + waterCoil.coilReportNum, + waterCoil.DesWaterCoolingCoilRate, + waterCoil.RequestingAutoSize, + waterCoil.WaterInletNodeNum, + waterCoil.WaterOutletNodeNum, + waterCoil.WaterPlantLoc.loopNum); // Coil Report break; } default: @@ -1784,8 +1784,8 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA CalcSimpleHeatingCoil(state, CoilNum, HVAC::FanOp::Continuous, 1.0, state.dataWaterCoils->SimCalc); coilTypeName = "Coil:Heating:Water"; } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEqNum( - state, waterCoil.Name, coilTypeName, state.dataSize->CurSysNum, state.dataSize->CurOASysNum, state.dataSize->CurZoneEqNum); + ReportCoilSelection::setCoilEqNum( + state, waterCoil.coilReportNum, state.dataSize->CurSysNum, state.dataSize->CurOASysNum, state.dataSize->CurZoneEqNum); // coil outlets Real64 RatedOutletWetBulb(0.0); @@ -1795,10 +1795,9 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA // call set routine in coil report if (waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling || waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { - state.dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions( + ReportCoilSelection::setRatedCoilConditions( state, - waterCoil.Name, - coilTypeName, + waterCoil.coilReportNum, waterCoil.TotWaterCoolingCoilRate, // this is the report variable waterCoil.SenWaterCoolingCoilRate, // this is the report variable waterCoil.InletAirMassFlowRate, @@ -1813,10 +1812,9 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA -999.0, -999.0); // coil effectiveness } else if (waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { - state.dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions( + ReportCoilSelection::setRatedCoilConditions( state, - waterCoil.Name, - coilTypeName, + waterCoil.coilReportNum, waterCoil.TotWaterHeatingCoilRate, // this is the report variable waterCoil.TotWaterHeatingCoilRate, // this is the report variable waterCoil.InletAirMassFlowRate, @@ -4662,33 +4660,30 @@ void ReportWaterCoil(EnergyPlusData &state, int const CoilNum) std::string coilObjClassName; if (waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { coilObjClassName = "Coil:Heating:Water"; - state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes(state, - waterCoil.Name, - coilObjClassName, - waterCoil.DesWaterHeatingCoilRate, - waterCoil.DesWaterHeatingCoilRate, - waterCoil.DesAirVolFlowRate, - waterCoil.MaxWaterVolFlowRate); + ReportCoilSelection::setCoilFinalSizes(state, + waterCoil.coilReportNum, + waterCoil.DesWaterHeatingCoilRate, + waterCoil.DesWaterHeatingCoilRate, + waterCoil.DesAirVolFlowRate, + waterCoil.MaxWaterVolFlowRate); waterCoil.reportCoilFinalSizes = false; } else if (waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling) { coilObjClassName = "Coil:Cooling:Water:DetailedGeometry"; - state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes(state, - waterCoil.Name, - coilObjClassName, - waterCoil.DesWaterCoolingCoilRate, - -999.0, - waterCoil.DesAirVolFlowRate, - waterCoil.MaxWaterVolFlowRate); + ReportCoilSelection::setCoilFinalSizes(state, + waterCoil.coilReportNum, + waterCoil.DesWaterCoolingCoilRate, + -999.0, + waterCoil.DesAirVolFlowRate, + waterCoil.MaxWaterVolFlowRate); waterCoil.reportCoilFinalSizes = false; } else if (waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { coilObjClassName = "Coil:Cooling:Water"; - state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes(state, - waterCoil.Name, - coilObjClassName, - waterCoil.DesWaterCoolingCoilRate, - -999.0, - waterCoil.DesAirVolFlowRate, - waterCoil.MaxWaterVolFlowRate); + ReportCoilSelection::setCoilFinalSizes(state, + waterCoil.coilReportNum, + waterCoil.DesWaterCoolingCoilRate, + -999.0, + waterCoil.DesAirVolFlowRate, + waterCoil.MaxWaterVolFlowRate); waterCoil.reportCoilFinalSizes = false; } } diff --git a/src/EnergyPlus/WaterCoils.hh b/src/EnergyPlus/WaterCoils.hh index 09ae05b4036..46856d4940b 100644 --- a/src/EnergyPlus/WaterCoils.hh +++ b/src/EnergyPlus/WaterCoils.hh @@ -89,6 +89,8 @@ namespace WaterCoils { std::string WaterCoilTypeA; // Type of WaterCoil ie. Heating or Cooling std::string WaterCoilModelA; // Type of WaterCoil ie. Simple, Detailed, etc. DataPlant::PlantEquipmentType WaterCoilType; // Type of WaterCoil ie. Heating or Cooling + + int coilReportNum = -1; CoilModel WaterCoilModel; // Type of WaterCoil ie. Simple, Detailed, etc. Sched::Schedule *availSched = nullptr; // availability schedule bool RequestingAutoSize; // True if this coil has appropriate autosize fields diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index 74b00d60ede..a8984fe696a 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -267,6 +267,9 @@ namespace WaterToAirHeatPumpSimple { state, CurrentModuleObject, simpleWAHP.Name, ErrorsFound, EnergyPlus::format("{} Name", CurrentModuleObject)); simpleWAHP.WAHPType = WatertoAirHP::Cooling; simpleWAHP.WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit; + + // simpleWAHP.coilReportNum = ReportCoilSelection::getReportIndex(state, simpleWAHP.Name, simpleWAHP.coilType); + std::string const availSchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "availability_schedule_name"); if (availSchedName.empty()) { simpleWAHP.availSched = Sched::GetScheduleAlwaysOn(state); @@ -502,8 +505,12 @@ namespace WaterToAirHeatPumpSimple { // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueCoilName( state, CurrentModuleObject, simpleWAHP.Name, ErrorsFound, EnergyPlus::format("{} Name", CurrentModuleObject)); + simpleWAHP.WAHPType = WatertoAirHP::Heating; simpleWAHP.WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit; + + // simpleWAHP.coilReportNum = ReportCoilSelection::getReportIndex(state, simpleWAHP.Name, simpleWAHP.coilType); + std::string const availSchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "availability_schedule_name"); if (availSchedName.empty()) { simpleWAHP.availSched = Sched::GetScheduleAlwaysOn(state); @@ -1560,11 +1567,11 @@ namespace WaterToAirHeatPumpSimple { // conditions RatedCapCoolTotalDes = (PeakTotCapTempModFac > 0.0) ? CoolCapAtPeak / PeakTotCapTempModFac : CoolCapAtPeak; // reporting - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp( - state, simpleWatertoAirHP.Name, CompType, MixTemp, state.dataSize->CurSysNum, state.dataSize->CurZoneEqNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(state, simpleWatertoAirHP.Name, CompType, MixHumRat); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(state, simpleWatertoAirHP.Name, CompType, SupTemp); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirHumRat(state, simpleWatertoAirHP.Name, CompType, SupHumRat); + ReportCoilSelection::setCoilEntAirTemp( + state, simpleWatertoAirHP.coilReportNum, MixTemp, state.dataSize->CurSysNum, state.dataSize->CurZoneEqNum); + ReportCoilSelection::setCoilEntAirHumRat(state, simpleWatertoAirHP.coilReportNum, MixHumRat); + ReportCoilSelection::setCoilLvgAirTemp(state, simpleWatertoAirHP.coilReportNum, SupTemp); + ReportCoilSelection::setCoilLvgAirHumRat(state, simpleWatertoAirHP.coilReportNum, SupHumRat); } else { RatedCapCoolTotalDes = 0.0; } @@ -1691,11 +1698,11 @@ namespace WaterToAirHeatPumpSimple { // conditions RatedCapCoolTotalDes = (PeakTotCapTempModFac > 0.0) ? CoolCapAtPeak / PeakTotCapTempModFac : CoolCapAtPeak; // reporting - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp( - state, simpleWatertoAirHP.Name, CompType, MixTemp, state.dataSize->CurSysNum, state.dataSize->CurZoneEqNum); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(state, simpleWatertoAirHP.Name, CompType, MixHumRat); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(state, simpleWatertoAirHP.Name, CompType, SupTemp); - state.dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirHumRat(state, simpleWatertoAirHP.Name, CompType, SupHumRat); + ReportCoilSelection::setCoilEntAirTemp( + state, simpleWatertoAirHP.coilReportNum, MixTemp, state.dataSize->CurSysNum, state.dataSize->CurZoneEqNum); + ReportCoilSelection::setCoilEntAirHumRat(state, simpleWatertoAirHP.coilReportNum, MixHumRat); + ReportCoilSelection::setCoilLvgAirTemp(state, simpleWatertoAirHP.coilReportNum, SupTemp); + ReportCoilSelection::setCoilLvgAirHumRat(state, simpleWatertoAirHP.coilReportNum, SupHumRat); } else { RatedCapCoolTotalDes = 0.0; } @@ -2116,18 +2123,17 @@ namespace WaterToAirHeatPumpSimple { OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoolCoilNomEff, simpleWatertoAirHP.Name, 0.0); } if (simpleWatertoAirHP.RatedCapCoolTotal != DataSizing::AutoSize) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilCoolingCapacity(state, - simpleWatertoAirHP.Name, - CompType, - simpleWatertoAirHP.RatedCapCoolTotal, - RatedCapCoolTotalAutoSized, - state.dataSize->CurSysNum, - state.dataSize->CurZoneEqNum, - state.dataSize->CurOASysNum, - FanCoolLoad, - PeakTotCapTempModFac, - -999.0, - -999.0); + ReportCoilSelection::setCoilCoolingCapacity(state, + simpleWatertoAirHP.coilReportNum, + simpleWatertoAirHP.RatedCapCoolTotal, + RatedCapCoolTotalAutoSized, + state.dataSize->CurSysNum, + state.dataSize->CurZoneEqNum, + state.dataSize->CurOASysNum, + FanCoolLoad, + PeakTotCapTempModFac, + -999.0, + -999.0); } if (!HardSizeNoDesRun) { if (RatedCapCoolSensAutoSized) { @@ -2749,10 +2755,9 @@ namespace WaterToAirHeatPumpSimple { } } - state.dataRptCoilSelection->coilSelectionReportObj->setCoilHeatingCapacity( + ReportCoilSelection::setCoilHeatingCapacity( state, - simpleWatertoAirHP.Name, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWatertoAirHP.WAHPType)]), + simpleWatertoAirHP.coilReportNum, RatedCapHeatDes, IsAutoSize, state.dataSize->CurSysNum, @@ -3600,21 +3605,17 @@ namespace WaterToAirHeatPumpSimple { if (!state.dataGlobal->WarmupFlag && !state.dataGlobal->DoingHVACSizingSimulations && !state.dataGlobal->DoingSizing) { if (simpleWatertoAirHP.WAHPType == WatertoAirHP::Cooling) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes( + ReportCoilSelection::setCoilFinalSizes( state, - simpleWatertoAirHP.Name, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", - WatertoAirHPNamesUC[static_cast(simpleWatertoAirHP.WAHPType)]), + simpleWatertoAirHP.coilReportNum, simpleWatertoAirHP.RatedCapCoolTotal, simpleWatertoAirHP.RatedCapCoolSens, simpleWatertoAirHP.RatedAirVolFlowRate, simpleWatertoAirHP.RatedWaterVolFlowRate); } else if (simpleWatertoAirHP.WAHPType == WatertoAirHP::Heating) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes( + ReportCoilSelection::setCoilFinalSizes( state, - simpleWatertoAirHP.Name, - EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", - WatertoAirHPNamesUC[static_cast(simpleWatertoAirHP.WAHPType)]), + simpleWatertoAirHP.coilReportNum, simpleWatertoAirHP.RatedCapHeat, simpleWatertoAirHP.RatedCapHeat, simpleWatertoAirHP.RatedAirVolFlowRate, diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh index 7edd6c14207..5fa3f8b5c4a 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh @@ -81,6 +81,9 @@ namespace WaterToAirHeatPumpSimple { { // Members std::string Name; // Name of the Water to Air Heat pump + + int coilReportNum = -1; + Sched::Schedule *availSched = nullptr; // availability schedule WatertoAirHP WAHPType = WatertoAirHP::Invalid; // Type of WatertoAirHP ie. Heating or Cooling DataPlant::PlantEquipmentType WAHPPlantType = DataPlant::PlantEquipmentType::Invalid; // type of component in plant diff --git a/src/EnergyPlus/WindowAC.cc b/src/EnergyPlus/WindowAC.cc index 21b920710d1..782ed7c898f 100644 --- a/src/EnergyPlus/WindowAC.cc +++ b/src/EnergyPlus/WindowAC.cc @@ -698,12 +698,12 @@ namespace WindowAC { } } for (WindACNum = 1; WindACNum <= state.dataWindowAC->NumWindAC; ++WindACNum) { - state.dataRptCoilSelection->coilSelectionReportObj->setCoilSupplyFanInfo(state, - state.dataWindowAC->WindAC(WindACNum).DXCoilName, - state.dataWindowAC->WindAC(WindACNum).DXCoilType, - state.dataWindowAC->WindAC(WindACNum).FanName, - state.dataWindowAC->WindAC(WindACNum).fanType, - state.dataWindowAC->WindAC(WindACNum).FanIndex); + // ReportCoilSelection::setCoilSupplyFanInfo(state, + // ReportCoilSelection::getReportIndex(state.dataWindowAC->WindAC(WindACNum).DXCoilName, + // state.dataWindowAC->WindAC(WindACNum).DXCoilType), + // state.dataWindowAC->WindAC(WindACNum).FanName, + // state.dataWindowAC->WindAC(WindACNum).fanType, + // state.dataWindowAC->WindAC(WindACNum).FanIndex); } } diff --git a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc index 714aba13047..dbce47cca65 100644 --- a/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc +++ b/tst/EnergyPlus/unit/Fixtures/EnergyPlusFixture.cc @@ -119,7 +119,6 @@ void EnergyPlusFixture::SetUp() state->dataUtilityRoutines->outputErrorHeader = false; state->init_constant_state(*state); - createCoilSelectionReportObj(*state); // So random state->dataEnvrn->StdRhoAir = 1.2; } diff --git a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc index f49e97a0478..fe245cc2865 100644 --- a/tst/EnergyPlus/unit/OutputReportTabular.unit.cc +++ b/tst/EnergyPlus/unit/OutputReportTabular.unit.cc @@ -6549,7 +6549,6 @@ TEST_F(EnergyPlusFixture, OutputReportTabularMonthly_invalidAggregationOrder) TEST_F(EnergyPlusFixture, OutputReportTabularTest_CollectPeakZoneConditions_test) { state->init_state(*state); - createCoilSelectionReportObj(*state); CompLoadTablesType compLoad; int timeOfMax = 63; @@ -7045,8 +7044,6 @@ TEST_F(SQLiteFixture, OutputReportTabular_WriteLoadComponentSummaryTables_AirLoo state->dataOutRptTab->displayFacilityComponentLoadSummary = true; state->dataGlobal->CompLoadReportIsReq = true; - createCoilSelectionReportObj(*state); - // Two design days int numDesDays = 2; state->dataEnvrn->TotDesDays = numDesDays; diff --git a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc index 3d69ace496f..656c13bf3ec 100644 --- a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc +++ b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc @@ -71,7 +71,7 @@ using namespace EnergyPlus; TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) { std::string coil1Name("Coil 1"); // user-defined name of the coil - std::string coil1Type("Coil:Cooling:Water"); // idf input object class name of coil + HVAC::CoilType coil1Type = HVAC::CoilType::CoolingWater; // idf input object class name of coil int chWInletNodeNum = 9; int chWOutletNodeNum = 15; @@ -99,10 +99,10 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) Real64 airVdot(0.052); // air flow rate in m3/s bool isAutoSized(false); // true if autosized - state->dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow(*state, coil1Name, coil1Type, airVdot, isAutoSized); - auto &c1(state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[0]); + ReportCoilSelection::setCoilAirFlow(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), airVdot, isAutoSized); + auto &c1(state->dataRptCoilSelection->coils[0]); EXPECT_EQ(coil1Name, c1->coilName_); - EXPECT_EQ(coil1Type, c1->coilObjName); + EXPECT_EQ(coil1Type, c1->coilType); EXPECT_EQ(airVdot, c1->coilDesVolFlow); EXPECT_EQ(isAutoSized, c1->volFlowIsAutosized); @@ -110,8 +110,8 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) Real64 waterVdot = 0.05; // First with no plant sizing objects defined isAutoSized = false; // true if autosized - state->dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowNodeNums( - *state, coil1Name, coil1Type, waterVdot, isAutoSized, chWInletNodeNum, chWOutletNodeNum, loopNum); + ReportCoilSelection::setCoilWaterFlowNodeNums( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), waterVdot, isAutoSized, chWInletNodeNum, chWOutletNodeNum, loopNum); EXPECT_EQ(-999, c1->pltSizNum); EXPECT_EQ(loopNum, c1->waterLoopNum); EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c1->plantLoopName); @@ -121,15 +121,15 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) EXPECT_EQ("No", c1->coilWaterFlowAutoMsg); // Exercise report writing with mostly defaults - state->dataRptCoilSelection->coilSelectionReportObj->finishCoilSummaryReportTable(*state); + ReportCoilSelection::finishCoilSummaryReportTable(*state); // Use the other form for coil 2 std::string coil2Name("Coil 2"); // user-defined name of the coil - std::string coil2Type("Coil:Cooling:Water"); // idf input object class name of coil + HVAC::CoilType coil2Type = HVAC::CoilType::CoolingWater; // idf input object class name of coil int pltSizNum = -999; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowPltSizNum( - *state, coil2Name, coil2Type, waterVdot, isAutoSized, pltSizNum, loopNum); - auto &c2(state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[1]); + ReportCoilSelection::setCoilWaterFlowPltSizNum( + *state, ReportCoilSelection::getReportIndex(*state, coil2Name, coil2Type), waterVdot, isAutoSized, pltSizNum, loopNum); + auto &c2(state->dataRptCoilSelection->coils[1]); EXPECT_EQ(-999, c2->pltSizNum); EXPECT_EQ(loopNum, c2->waterLoopNum); EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c2->plantLoopName); @@ -143,9 +143,9 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) state->dataSize->PlantSizData.allocate(1); state->dataSize->PlantSizData(1).PlantLoopName = "Chilled Water Loop"; isAutoSized = true; // true if autosized - state->dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowNodeNums( - *state, coil1Name, coil1Type, waterVdot, isAutoSized, chWInletNodeNum, chWOutletNodeNum, loopNum); - auto &c1b(state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[0]); + ReportCoilSelection::setCoilWaterFlowNodeNums( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), waterVdot, isAutoSized, chWInletNodeNum, chWOutletNodeNum, loopNum); + auto &c1b(state->dataRptCoilSelection->coils[0]); EXPECT_EQ(1, c1b->pltSizNum); EXPECT_EQ(loopNum, c1b->waterLoopNum); EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c1b->plantLoopName); @@ -173,7 +173,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) state->dataHeatBal->Zone(3).Name = "Zone 3"; // This triggers doAirLoopSetUp - state->dataRptCoilSelection->coilSelectionReportObj->setCoilUA(*state, coil2Name, coil2Type, uA, sizingCap, isAutoSized, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilUA(*state, ReportCoilSelection::getReportIndex(*state, coil2Name, coil2Type), uA, sizingCap, isAutoSized, curSysNum, curZoneEqNum); EXPECT_EQ(uA, c2->coilUA); EXPECT_EQ(sizingCap, c2->coilTotCapAtPeak); EXPECT_EQ(curSysNum, c2->airloopNum); @@ -182,26 +182,26 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) // This coil serves zones 2 and 3 - rmLatentAtPeak is summed for all applicable zones Real64 zoneCoolingLatentLoad = 1000.0; int zoneNum = 1; - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadCoolingIdealPeak(zoneNum, zoneCoolingLatentLoad); + ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(*state, zoneNum, zoneCoolingLatentLoad); EXPECT_EQ(0.0, c2->rmLatentAtPeak); zoneNum = 2; - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadCoolingIdealPeak(zoneNum, zoneCoolingLatentLoad); + ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(*state, zoneNum, zoneCoolingLatentLoad); EXPECT_EQ(1000.0, c2->rmLatentAtPeak); zoneNum = 3; - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadCoolingIdealPeak(zoneNum, zoneCoolingLatentLoad); + ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(*state, zoneNum, zoneCoolingLatentLoad); EXPECT_EQ(2000.0, c2->rmLatentAtPeak); // Add a heating coil std::string coil3Name("Coil 3"); // user-defined name of the coil - std::string coil3Type("Coil:Heating:Electric"); // idf input object class name of coil + HVAC::CoilType coil3Type = HVAC::CoilType::HeatingElectric; // idf input object class name of coil uA = -999.0; sizingCap = 500.0; curSysNum = 1; curZoneEqNum = 0; isAutoSized = false; // true if autosized // This triggers doAirLoopSetUp - state->dataRptCoilSelection->coilSelectionReportObj->setCoilUA(*state, coil3Name, coil3Type, uA, sizingCap, isAutoSized, curSysNum, curZoneEqNum); - auto &c3(state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[2]); + ReportCoilSelection::setCoilUA(*state, ReportCoilSelection::getReportIndex(*state, coil3Name, coil3Type), uA, sizingCap, isAutoSized, curSysNum, curZoneEqNum); + auto &c3(state->dataRptCoilSelection->coils[2]); EXPECT_EQ(uA, c3->coilUA); EXPECT_EQ(sizingCap, c3->coilTotCapAtPeak); EXPECT_EQ(curSysNum, c3->airloopNum); @@ -210,23 +210,23 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) // This coil serves zones 2 and 3 - rmLatentAtPeak is summed for all applicable zones Real64 zoneHeatingLatentLoad = 100.0; zoneNum = 1; - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadHeatingIdealPeak(zoneNum, zoneHeatingLatentLoad); + ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(*state, zoneNum, zoneHeatingLatentLoad); EXPECT_EQ(0.0, c3->rmLatentAtPeak); zoneNum = 2; - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadHeatingIdealPeak(zoneNum, zoneHeatingLatentLoad); + ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(*state, zoneNum, zoneHeatingLatentLoad); EXPECT_EQ(100.0, c3->rmLatentAtPeak); zoneNum = 3; - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadHeatingIdealPeak(zoneNum, zoneHeatingLatentLoad); + ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(*state, zoneNum, zoneHeatingLatentLoad); EXPECT_EQ(200.0, c3->rmLatentAtPeak); // Exercise report writing again - state->dataRptCoilSelection->coilSelectionReportObj->finishCoilSummaryReportTable(*state); + ReportCoilSelection::finishCoilSummaryReportTable(*state); } TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) { std::string coil1Name("Coil 1"); // user-defined name of the coil - std::string coil1Type("Coil:Heating:Steam"); // idf input object class name of coil + HVAC::CoilType coil1Type = HVAC::CoilType::HeatingSteam; // idf input object class name of coil int wInletNodeNum = 9; int wOutletNodeNum = 15; @@ -256,10 +256,10 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) Real64 airVdot(0.052); // air flow rate in m3/s bool isAutoSized(false); // true if autosized - state->dataRptCoilSelection->coilSelectionReportObj->setCoilAirFlow(*state, coil1Name, coil1Type, airVdot, isAutoSized); - auto &c1(state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[0]); + ReportCoilSelection::setCoilAirFlow(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), airVdot, isAutoSized); + auto &c1(state->dataRptCoilSelection->coils[0]); EXPECT_EQ(coil1Name, c1->coilName_); - EXPECT_EQ(coil1Type, c1->coilObjName); + EXPECT_ENUM_EQ(coil1Type, c1->coilType); EXPECT_EQ(airVdot, c1->coilDesVolFlow); EXPECT_EQ(isAutoSized, c1->volFlowIsAutosized); @@ -267,8 +267,8 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) Real64 waterVdot = 0.05; // First with no plant sizing objects defined isAutoSized = false; // true if autosized - state->dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowNodeNums( - *state, coil1Name, coil1Type, waterVdot, isAutoSized, wInletNodeNum, wOutletNodeNum, loopNum); + ReportCoilSelection::setCoilWaterFlowNodeNums( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), waterVdot, isAutoSized, wInletNodeNum, wOutletNodeNum, loopNum); EXPECT_EQ(-999, c1->pltSizNum); EXPECT_EQ(loopNum, c1->waterLoopNum); EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c1->plantLoopName); @@ -283,9 +283,9 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) state->dataSize->PlantSizData(1).PlantLoopName = "Steam Loop"; state->dataSize->PlantSizData(1).LoopType = DataSizing::TypeOfPlantLoop::Steam; isAutoSized = true; // true if autosized - state->dataRptCoilSelection->coilSelectionReportObj->setCoilWaterFlowNodeNums( - *state, coil1Name, coil1Type, waterVdot, isAutoSized, wInletNodeNum, wOutletNodeNum, loopNum); - auto &c1b(state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[0]); + ReportCoilSelection::setCoilWaterFlowNodeNums( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), waterVdot, isAutoSized, wInletNodeNum, wOutletNodeNum, loopNum); + auto &c1b(state->dataRptCoilSelection->coils[0]); EXPECT_EQ(1, c1b->pltSizNum); EXPECT_EQ(loopNum, c1b->waterLoopNum); EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c1b->plantLoopName); @@ -296,13 +296,13 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) EXPECT_EQ("Yes", c1b->coilWaterFlowAutoMsg); // Exercise report writing again - state->dataRptCoilSelection->coilSelectionReportObj->finishCoilSummaryReportTable(*state); + ReportCoilSelection::finishCoilSummaryReportTable(*state); } TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) { std::string coil1Name("Coil 1"); // user-defined name of the coil - std::string coil1Type("Coil:Heating:Fuel"); // idf input object class name of coil + HVAC::CoilType coil1Type = HVAC::CoilType::HeatingGasOrOtherFuel; // idf input object class name of coil state->dataGlobal->NumOfZones = 3; state->dataHeatBal->Zone.allocate(state->dataGlobal->NumOfZones); @@ -331,9 +331,9 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) Real64 airFlowRate = 0.11; Real64 waterFlowRate = 0.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes( - *state, coil1Name, coil1Type, totGrossCap, sensGrossCap, airFlowRate, waterFlowRate); - auto &c1(state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[0]); + ReportCoilSelection::setCoilFinalSizes( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), totGrossCap, sensGrossCap, airFlowRate, waterFlowRate); + auto &c1(state->dataRptCoilSelection->coils[0]); EXPECT_EQ(totGrossCap, c1->coilTotCapFinal); EXPECT_EQ(sensGrossCap, c1->coilSensCapFinal); EXPECT_EQ(airFlowRate, c1->coilRefAirVolFlowFinal); @@ -354,22 +354,21 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) Real64 RatedCoilEff = 0.8; // First without setting coil inlet/outlet conditions - state->dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - RatedCoilSensCap, - RatedAirMassFlow, - RatedCoilInDb, - RatedCoilInHumRat, - RatedCoilInWb, - RatedCoilOutDb, - RatedCoilOutHumRat, - RatedCoilOutWb, - RatedCoilOadbRef, - RatedCoilOawbRef, - RatedCoilBpFactor, - RatedCoilEff); + ReportCoilSelection::setRatedCoilConditions(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + RatedCoilSensCap, + RatedAirMassFlow, + RatedCoilInDb, + RatedCoilInHumRat, + RatedCoilInWb, + RatedCoilOutDb, + RatedCoilOutHumRat, + RatedCoilOutWb, + RatedCoilOadbRef, + RatedCoilOawbRef, + RatedCoilBpFactor, + RatedCoilEff); EXPECT_EQ(RatedCoilTotCap, c1->coilRatedTotCap); EXPECT_NEAR(c1->coilCapFTIdealPeak, 1.0, 0.000001); @@ -393,22 +392,21 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) RatedCoilInHumRat = 0.008; RatedCoilOutDb = 40.0; RatedCoilOutHumRat = 0.009; - state->dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - RatedCoilSensCap, - RatedAirMassFlow, - RatedCoilInDb, - RatedCoilInHumRat, - RatedCoilInWb, - RatedCoilOutDb, - RatedCoilOutHumRat, - RatedCoilOutWb, - RatedCoilOadbRef, - RatedCoilOawbRef, - RatedCoilBpFactor, - RatedCoilEff); + ReportCoilSelection::setRatedCoilConditions(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + RatedCoilSensCap, + RatedAirMassFlow, + RatedCoilInDb, + RatedCoilInHumRat, + RatedCoilInWb, + RatedCoilOutDb, + RatedCoilOutHumRat, + RatedCoilOutWb, + RatedCoilOadbRef, + RatedCoilOawbRef, + RatedCoilBpFactor, + RatedCoilEff); EXPECT_EQ(RatedCoilInDb, c1->ratedCoilInDb); EXPECT_EQ(RatedCoilInHumRat, c1->ratedCoilInHumRat); EXPECT_NEAR(43460.9, c1->ratedCoilInEnth, 0.1); @@ -417,48 +415,48 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) EXPECT_NEAR(63371.3, c1->ratedCoilOutEnth, 0.1); Real64 entAirDryBulbTemp = 24.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp(*state, coil1Name, coil1Type, entAirDryBulbTemp, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); EXPECT_EQ(entAirDryBulbTemp, c1->coilDesEntTemp); EXPECT_EQ(curSysNum, c1->airloopNum); EXPECT_EQ(curZoneEqNum, c1->zoneEqNum); Real64 entAirHumRat = 0.004; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(*state, coil1Name, coil1Type, entAirHumRat); + ReportCoilSelection::setCoilEntAirHumRat(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirHumRat); EXPECT_EQ(entAirHumRat, c1->coilDesEntHumRat); Real64 entWaterTemp = 60.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilEntWaterTemp(*state, coil1Name, coil1Type, entWaterTemp); + ReportCoilSelection::setCoilEntWaterTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entWaterTemp); EXPECT_EQ(entWaterTemp, c1->coilDesWaterEntTemp); Real64 lvgWaterTemp = 50.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilLvgWaterTemp(*state, coil1Name, coil1Type, lvgWaterTemp); + ReportCoilSelection::setCoilLvgWaterTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), lvgWaterTemp); EXPECT_EQ(lvgWaterTemp, c1->coilDesWaterLvgTemp); Real64 CoilWaterDeltaT = 50.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilWaterDeltaT(*state, coil1Name, coil1Type, CoilWaterDeltaT); + ReportCoilSelection::setCoilWaterDeltaT(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), CoilWaterDeltaT); EXPECT_EQ(CoilWaterDeltaT, c1->coilDesWaterTempDiff); Real64 lvgAirDryBulbTemp = 12.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(*state, coil1Name, coil1Type, lvgAirDryBulbTemp); + ReportCoilSelection::setCoilLvgAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), lvgAirDryBulbTemp); EXPECT_EQ(lvgAirDryBulbTemp, c1->coilDesLvgTemp); Real64 lvgAirHumRat = 0.006; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirHumRat(*state, coil1Name, coil1Type, lvgAirHumRat); + ReportCoilSelection::setCoilLvgAirHumRat(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), lvgAirHumRat); EXPECT_EQ(lvgAirHumRat, c1->coilDesLvgHumRat); int zoneNum = 1; Real64 zoneCoolingLatentLoad = 1234.0; - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadCoolingIdealPeak(zoneNum, zoneCoolingLatentLoad); + ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(*state, zoneNum, zoneCoolingLatentLoad); // Expect zero because it's a heating coil EXPECT_EQ(0.0, c1->rmLatentAtPeak); Real64 zoneHeatingLatentLoad = 4321.0; - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadHeatingIdealPeak(zoneNum, zoneHeatingLatentLoad); + ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(*state, zoneNum, zoneHeatingLatentLoad); // Expect zero because doZoneEqSetup isn't currently executed EXPECT_EQ(0.0, c1->rmLatentAtPeak); // Exercise report writing again - state->dataRptCoilSelection->coilSelectionReportObj->finishCoilSummaryReportTable(*state); + ReportCoilSelection::finishCoilSummaryReportTable(*state); // Test coil reporting curZoneEqNum = 1; @@ -488,29 +486,28 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) state->dataSize->DataFlowUsedForSizing = airFlowRate / state->dataEnvrn->StdRhoAir; // setCoilHeatingCapacity will not overwrite previously set temperature data - state->dataRptCoilSelection->coilSelectionReportObj->setCoilHeatingCapacity(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - false, - curSysNum, - curZoneEqNum, - curOASysNum, - fanHeatGain, - coilCapFunTempFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + ReportCoilSelection::setCoilHeatingCapacity(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + false, + curSysNum, + curZoneEqNum, + curOASysNum, + fanHeatGain, + coilCapFunTempFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); EXPECT_EQ(entAirDryBulbTemp, c1->coilDesEntTemp); - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadHeatingIdealPeak(zoneNum, zoneHeatingLatentLoad); + ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(*state, zoneNum, zoneHeatingLatentLoad); // Expect non-zero because this is a heating coil EXPECT_LT(0.0, zoneHeatingLatentLoad); EXPECT_NEAR(zoneHeatingLatentLoad, c1->rmLatentAtPeak, 0.000001); entAirDryBulbTemp = 21.0; // change coil entering air temp - state->dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp(*state, coil1Name, coil1Type, entAirDryBulbTemp, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); lvgAirDryBulbTemp = 30.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(*state, coil1Name, coil1Type, lvgAirDryBulbTemp); + ReportCoilSelection::setCoilLvgAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), lvgAirDryBulbTemp); EXPECT_EQ(entAirDryBulbTemp, c1->coilDesEntTemp); EXPECT_EQ(lvgAirDryBulbTemp, c1->coilDesLvgTemp); @@ -521,18 +518,17 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) c1->coilDesEntHumRat = -999.0; c1->coilDesLvgTemp = -999.0; c1->coilDesLvgHumRat = -999.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilHeatingCapacity(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - false, - curSysNum, - curZoneEqNum, - curOASysNum, - fanHeatGain, - coilCapFunTempFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + ReportCoilSelection::setCoilHeatingCapacity(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + false, + curSysNum, + curZoneEqNum, + curOASysNum, + fanHeatGain, + coilCapFunTempFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); EXPECT_EQ(RatedCoilInDb, c1->coilDesEntTemp); EXPECT_EQ(RatedCoilInHumRat, c1->coilDesEntHumRat); EXPECT_EQ(state->dataSize->FinalZoneSizing(curZoneEqNum).HeatDesTemp, c1->coilDesLvgTemp); @@ -544,18 +540,17 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) EXPECT_NEAR(RatedCoilTotCap, c1->coilTotCapAtPeak, 0.000001); // test heating capacity adjustment with a CapFT curve coilCapFunTempFac = 1.15; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilHeatingCapacity(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - false, - curSysNum, - curZoneEqNum, - curOASysNum, - fanHeatGain, - coilCapFunTempFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + ReportCoilSelection::setCoilHeatingCapacity(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + false, + curSysNum, + curZoneEqNum, + curOASysNum, + fanHeatGain, + coilCapFunTempFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); EXPECT_NEAR(RatedCoilTotCap * coilCapFunTempFac, c1->coilTotCapAtPeak, 0.000001); EXPECT_LT(RatedCoilTotCap, c1->coilTotCapAtPeak); } @@ -563,7 +558,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) { std::string coil1Name("Coil 1"); // user-defined name of the coil - std::string coil1Type("Coil:Cooling:DX"); // idf input object class name of coil + HVAC::CoilType coil1Type = HVAC::CoilType::DXCooling; // idf input object class name of coil state->dataGlobal->NumOfZones = 3; state->dataHeatBal->Zone.allocate(state->dataGlobal->NumOfZones); @@ -592,9 +587,9 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) Real64 airFlowRate = 0.11; Real64 waterFlowRate = 0.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes( - *state, coil1Name, coil1Type, totGrossCap, sensGrossCap, airFlowRate, waterFlowRate); - auto &c1(state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[0]); + ReportCoilSelection::setCoilFinalSizes( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), totGrossCap, sensGrossCap, airFlowRate, waterFlowRate); + auto &c1(state->dataRptCoilSelection->coils[0]); EXPECT_EQ(totGrossCap, c1->coilTotCapFinal); EXPECT_EQ(sensGrossCap, c1->coilSensCapFinal); EXPECT_EQ(airFlowRate, c1->coilRefAirVolFlowFinal); @@ -615,23 +610,22 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) Real64 RatedCoilEff = 0.8; // First without setting coil inlet/outlet conditions - state->dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - RatedCoilSensCap, - RatedAirMassFlow, - RatedCoilInDb, - RatedCoilInHumRat, - RatedCoilInWb, - RatedCoilOutDb, - RatedCoilOutHumRat, - RatedCoilOutWb, - RatedCoilOadbRef, - RatedCoilOawbRef, - RatedCoilBpFactor, - RatedCoilEff); - + ReportCoilSelection::setRatedCoilConditions(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + RatedCoilSensCap, + RatedAirMassFlow, + RatedCoilInDb, + RatedCoilInHumRat, + RatedCoilInWb, + RatedCoilOutDb, + RatedCoilOutHumRat, + RatedCoilOutWb, + RatedCoilOadbRef, + RatedCoilOawbRef, + RatedCoilBpFactor, + RatedCoilEff); + EXPECT_EQ(RatedCoilTotCap, c1->coilRatedTotCap); EXPECT_NEAR(c1->coilCapFTIdealPeak, 1.0, 0.000001); EXPECT_EQ(RatedCoilSensCap, c1->coilRatedSensCap); @@ -654,22 +648,21 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) RatedCoilInHumRat = 0.008; RatedCoilOutDb = 12.0; RatedCoilOutHumRat = 0.006; - state->dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - RatedCoilSensCap, - RatedAirMassFlow, - RatedCoilInDb, - RatedCoilInHumRat, - RatedCoilInWb, - RatedCoilOutDb, - RatedCoilOutHumRat, - RatedCoilOutWb, - RatedCoilOadbRef, - RatedCoilOawbRef, - RatedCoilBpFactor, - RatedCoilEff); + ReportCoilSelection::setRatedCoilConditions(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + RatedCoilSensCap, + RatedAirMassFlow, + RatedCoilInDb, + RatedCoilInHumRat, + RatedCoilInWb, + RatedCoilOutDb, + RatedCoilOutHumRat, + RatedCoilOutWb, + RatedCoilOadbRef, + RatedCoilOawbRef, + RatedCoilBpFactor, + RatedCoilEff); EXPECT_EQ(RatedCoilInDb, c1->ratedCoilInDb); EXPECT_EQ(RatedCoilInHumRat, c1->ratedCoilInHumRat); EXPECT_NEAR(43460.9, c1->ratedCoilInEnth, 0.1); @@ -678,36 +671,36 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) EXPECT_NEAR(27197.5, c1->ratedCoilOutEnth, 0.1); Real64 entAirDryBulbTemp = 24.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp(*state, coil1Name, coil1Type, entAirDryBulbTemp, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); EXPECT_EQ(entAirDryBulbTemp, c1->coilDesEntTemp); EXPECT_EQ(curSysNum, c1->airloopNum); EXPECT_EQ(curZoneEqNum, c1->zoneEqNum); Real64 entAirHumRat = 0.004; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirHumRat(*state, coil1Name, coil1Type, entAirHumRat); + ReportCoilSelection::setCoilEntAirHumRat(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirHumRat); EXPECT_EQ(entAirHumRat, c1->coilDesEntHumRat); Real64 lvgAirDryBulbTemp = 14.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(*state, coil1Name, coil1Type, lvgAirDryBulbTemp); + ReportCoilSelection::setCoilLvgAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), lvgAirDryBulbTemp); EXPECT_EQ(lvgAirDryBulbTemp, c1->coilDesLvgTemp); Real64 lvgAirHumRat = 0.005; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirHumRat(*state, coil1Name, coil1Type, lvgAirHumRat); + ReportCoilSelection::setCoilLvgAirHumRat(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), lvgAirHumRat); EXPECT_EQ(lvgAirHumRat, c1->coilDesLvgHumRat); int zoneNum = 1; Real64 zoneCoolingLatentLoad = 1234.0; - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadCoolingIdealPeak(zoneNum, zoneCoolingLatentLoad); + ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(*state, zoneNum, zoneCoolingLatentLoad); // Expect zero because doZoneEqSetup isn't currently executed EXPECT_EQ(0.0, c1->rmLatentAtPeak); Real64 zoneHeatingLatentLoad = 4321.0; - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadHeatingIdealPeak(zoneNum, zoneHeatingLatentLoad); + ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(*state, zoneNum, zoneHeatingLatentLoad); // Expect zero because doZoneEqSetup isn't currently executed EXPECT_EQ(0.0, c1->rmLatentAtPeak); // Exercise report writing again - state->dataRptCoilSelection->coilSelectionReportObj->finishCoilSummaryReportTable(*state); + ReportCoilSelection::finishCoilSummaryReportTable(*state); // Test coil reporting curZoneEqNum = 1; @@ -732,18 +725,17 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) state->dataSize->DataFlowUsedForSizing = airFlowRate / state->dataEnvrn->StdRhoAir; // setCoilCoolingCapacity will not overwrite previously set temperature data - state->dataRptCoilSelection->coilSelectionReportObj->setCoilCoolingCapacity(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - false, - curSysNum, - curZoneEqNum, - curOASysNum, - fanHeatGain, - coilCapFunTempFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + ReportCoilSelection::setCoilCoolingCapacity(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + false, + curSysNum, + curZoneEqNum, + curOASysNum, + fanHeatGain, + coilCapFunTempFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); EXPECT_EQ(entAirDryBulbTemp, c1->coilDesEntTemp); EXPECT_EQ(entAirHumRat, c1->coilDesEntHumRat); EXPECT_EQ(lvgAirDryBulbTemp, c1->coilDesLvgTemp); @@ -752,14 +744,14 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) EXPECT_EQ(CpMoistAir, c1->cpMoistAir); EXPECT_NEAR(c1->fanHeatGainIdealPeak, fanHeatGain, 0.000001); - state->dataRptCoilSelection->coilSelectionReportObj->setZoneLatentLoadCoolingIdealPeak(zoneNum, zoneCoolingLatentLoad); + ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(*state, zoneNum, zoneCoolingLatentLoad); // Expect non-zero zone cooling latent load EXPECT_EQ(zoneCoolingLatentLoad, c1->rmLatentAtPeak); entAirDryBulbTemp = 21.0; // change coil entering air temp - state->dataRptCoilSelection->coilSelectionReportObj->setCoilEntAirTemp(*state, coil1Name, coil1Type, entAirDryBulbTemp, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); lvgAirDryBulbTemp = 12.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilLvgAirTemp(*state, coil1Name, coil1Type, lvgAirDryBulbTemp); + ReportCoilSelection::setCoilLvgAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), lvgAirDryBulbTemp); EXPECT_EQ(entAirDryBulbTemp, c1->coilDesEntTemp); EXPECT_EQ(lvgAirDryBulbTemp, c1->coilDesLvgTemp); @@ -769,18 +761,17 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) c1->coilDesEntHumRat = -999.0; c1->coilDesLvgTemp = -999.0; c1->coilDesLvgHumRat = -999.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilCoolingCapacity(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - false, - curSysNum, - curZoneEqNum, - curOASysNum, - fanHeatGain, - coilCapFunTempFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + ReportCoilSelection::setCoilCoolingCapacity(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + false, + curSysNum, + curZoneEqNum, + curOASysNum, + fanHeatGain, + coilCapFunTempFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); EXPECT_EQ(state->dataSize->FinalZoneSizing(curZoneEqNum).DesCoolCoilInTemp, c1->coilDesEntTemp); EXPECT_EQ(state->dataSize->FinalZoneSizing(curZoneEqNum).DesCoolCoilInHumRat, c1->coilDesEntHumRat); EXPECT_EQ(state->dataSize->FinalZoneSizing(curZoneEqNum).CoolDesTemp, c1->coilDesLvgTemp); @@ -793,18 +784,17 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) // test cooling capacity adjustment with a CapFT curve != 1 coilCapFunTempFac = 1.15; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilCoolingCapacity(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - false, - curSysNum, - curZoneEqNum, - curOASysNum, - fanHeatGain, - coilCapFunTempFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + ReportCoilSelection::setCoilCoolingCapacity(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + false, + curSysNum, + curZoneEqNum, + curOASysNum, + fanHeatGain, + coilCapFunTempFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); EXPECT_NEAR(RatedCoilTotCap * coilCapFunTempFac, c1->coilTotCapAtPeak, 0.000001); EXPECT_LT(RatedCoilTotCap, c1->coilTotCapAtPeak); } @@ -812,7 +802,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) TEST_F(EnergyPlusFixture, ReportCoilSelection_4PipeFCU_ElecHeatingCoil) { std::string coil1Name("ElecHeatCoil"); // user-defined name of the coil - std::string coil1Type("Coil:Heating:Electric"); // idf input object class name of coil + HVAC::CoilType coil1Type = HVAC::CoilType::HeatingElectric; // idf input object class name of coil state->dataGlobal->NumOfZones = 1; state->dataHeatBal->Zone.allocate(state->dataGlobal->NumOfZones); @@ -837,9 +827,9 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_4PipeFCU_ElecHeatingCoil) Real64 airVolFlowRate = 0.1385; Real64 waterFlowRate = 0.0; - state->dataRptCoilSelection->coilSelectionReportObj->setCoilFinalSizes( - *state, coil1Name, coil1Type, totGrossCap, sensGrossCap, airVolFlowRate, waterFlowRate); - auto &c1 = state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[0]; + ReportCoilSelection::setCoilFinalSizes( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), totGrossCap, sensGrossCap, airVolFlowRate, waterFlowRate); + auto &c1 = state->dataRptCoilSelection->coils[0]; EXPECT_EQ(totGrossCap, c1->coilTotCapFinal); EXPECT_EQ(sensGrossCap, c1->coilSensCapFinal); @@ -864,22 +854,21 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_4PipeFCU_ElecHeatingCoil) Real64 result_coilDesEntEnth = Psychrometrics::PsyHFnTdbW(RatedCoilInDb, RatedCoilInHumRat); Real64 result_coilDesOutEnth = Psychrometrics::PsyHFnTdbW(RatedCoilOutDb, RatedCoilOutHumRat); // set coil inlet/outlet conditions - state->dataRptCoilSelection->coilSelectionReportObj->setRatedCoilConditions(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - RatedCoilSensCap, - RatedAirMassFlow, - RatedCoilInDb, - RatedCoilInHumRat, - RatedCoilInWb, - RatedCoilOutDb, - RatedCoilOutHumRat, - RatedCoilOutWb, - RatedCoilOadbRef, - RatedCoilOawbRef, - RatedCoilBpFactor, - RatedCoilEff); + ReportCoilSelection::setRatedCoilConditions(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + RatedCoilSensCap, + RatedAirMassFlow, + RatedCoilInDb, + RatedCoilInHumRat, + RatedCoilInWb, + RatedCoilOutDb, + RatedCoilOutHumRat, + RatedCoilOutWb, + RatedCoilOadbRef, + RatedCoilOawbRef, + RatedCoilBpFactor, + RatedCoilEff); // check coil inlet/outlet conditions set correctly EXPECT_EQ(RatedCoilInDb, c1->ratedCoilInDb); EXPECT_EQ(RatedCoilInHumRat, c1->ratedCoilInHumRat); @@ -926,18 +915,17 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_4PipeFCU_ElecHeatingCoil) c1->coilDesLvgTemp = -999.0; c1->coilDesLvgHumRat = -999.0; // check setCoilHeatingCapacity calculations and coil conditions are set correctly - state->dataRptCoilSelection->coilSelectionReportObj->setCoilHeatingCapacity(*state, - coil1Name, - coil1Type, - RatedCoilTotCap, - false, - curSysNum, - curZoneEqNum, - curOASysNum, - fanHeatGain, - coilCapFunTempFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + ReportCoilSelection::setCoilHeatingCapacity(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + RatedCoilTotCap, + false, + curSysNum, + curZoneEqNum, + curOASysNum, + fanHeatGain, + coilCapFunTempFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); // check design outlet conditions EXPECT_EQ(finalZoneSizing.HeatDesTemp, c1->coilDesLvgTemp); EXPECT_EQ(finalZoneSizing.HeatDesHumRat, c1->coilDesLvgHumRat); @@ -956,13 +944,12 @@ TEST_F(EnergyPlusFixture, Test_finishCoilSummaryReportTable) Real64 constexpr mult = 1.0; int curZoneEqNum = 1; std::string coil1Name = "ElecHeatCoil"; // user-defined name of the coil - std::string coil1Type = "Coil:Heating:Electric"; // idf input object class name of coil + HVAC::CoilType coil1Type = HVAC::CoilType::HeatingElectric; // idf input object class name of coil // set up coil selection report object by calling a public function (i.e., calls getIndexForOrCreateDataObjFromCoilName) - state->dataRptCoilSelection->coilSelectionReportObj->setCoilReheatMultiplier(*state, coil1Name, coil1Type, mult); - bool isValidCoilType = state->dataRptCoilSelection->coilSelectionReportObj->isCompTypeCoil(coil1Type); - EXPECT_TRUE(isValidCoilType); - auto &c1 = state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[0]; + ReportCoilSelection::setCoilReheatMultiplier(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), mult); + + auto &c1 = state->dataRptCoilSelection->coils[0]; c1->zoneEqNum = curZoneEqNum; state->dataHeatBal->Zone.allocate(1); @@ -991,7 +978,7 @@ TEST_F(EnergyPlusFixture, Test_finishCoilSummaryReportTable) EXPECT_TRUE(Util::SameString(c1->typeHVACname, "unknown")); EXPECT_TRUE(Util::SameString(c1->userNameforHVACsystem, "unknown")); - state->dataRptCoilSelection->coilSelectionReportObj->finishCoilSummaryReportTable(*state); + ReportCoilSelection::finishCoilSummaryReportTable(*state); EXPECT_TRUE(Util::SameString(c1->coilLocation, "Zone Equipment")); EXPECT_TRUE(Util::SameString(c1->typeHVACname, "ZoneHVAC:FourPipeFanCoil")); @@ -1013,7 +1000,7 @@ TEST_F(EnergyPlusFixture, Test_finishCoilSummaryReportTable) // test that 2 equipment in the equipment list will fill coil selection data std::string coil2Name = "ElecHeatCoil 2"; // user-defined name of the coil - std::string coil2Type = "Coil:Heating:Electric"; // idf input object class name of coil + HVAC::CoilType coil2Type = HVAC::CoilType::HeatingElectric; // idf input object class name of coil zoneEquipList.EquipName(1) = "Zone 1 FCU"; zoneEquipList.EquipTypeName(1) = "ZoneHVAC:FourPipeFanCoil"; @@ -1037,16 +1024,16 @@ TEST_F(EnergyPlusFixture, Test_finishCoilSummaryReportTable) zoneEquipList.EquipData(2).SubEquipData(1).SubSubEquipData(1).Name = coil2Name; // set up coil selection report object by calling a public function that calls getIndexForOrCreateDataObjFromCoilName - state->dataRptCoilSelection->coilSelectionReportObj->setCoilReheatMultiplier(*state, coil2Name, coil2Type, mult); - auto &c1a = state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[0]; - auto &c2a = state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[1]; + ReportCoilSelection::setCoilReheatMultiplier(*state, ReportCoilSelection::getReportIndex(*state, coil2Name, coil2Type), mult); + auto &c1a = state->dataRptCoilSelection->coils[0]; + auto &c2a = state->dataRptCoilSelection->coils[1]; c2a->zoneEqNum = curZoneEqNum; EXPECT_TRUE(Util::SameString(c2a->coilLocation, "unknown")); EXPECT_TRUE(Util::SameString(c2a->typeHVACname, "unknown")); EXPECT_TRUE(Util::SameString(c2a->userNameforHVACsystem, "unknown")); - state->dataRptCoilSelection->coilSelectionReportObj->finishCoilSummaryReportTable(*state); + ReportCoilSelection::finishCoilSummaryReportTable(*state); EXPECT_TRUE(Util::SameString(c1a->coilLocation, "Zone Equipment")); EXPECT_TRUE(Util::SameString(c1a->typeHVACname, "ZoneHVAC:FourPipeFanCoil")); @@ -1069,15 +1056,13 @@ TEST_F(EnergyPlusFixture, Test_finishCoilSummaryReportTable) EXPECT_TRUE(Util::SameString(zoneEquipList.EquipData(2).SubEquipData(1).SubSubEquipData(1).Name, coil2Name)); // delete coil report objects to start from scratch - state->dataRptCoilSelection->coilSelectionReportObj->numCoilsReported_ = 0; - state->dataRptCoilSelection->coilSelectionReportObj.reset(nullptr); - createCoilSelectionReportObj(*state); + state->dataRptCoilSelection->clear_state(); // switch coil order in coil reports to try to find issues - state->dataRptCoilSelection->coilSelectionReportObj->setCoilReheatMultiplier(*state, coil2Name, coil2Type, mult); - state->dataRptCoilSelection->coilSelectionReportObj->setCoilReheatMultiplier(*state, coil1Name, coil1Type, mult); - auto &c1b = state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[0]; - auto &c2b = state->dataRptCoilSelection->coilSelectionReportObj->coilSelectionDataObjs[1]; + ReportCoilSelection::setCoilReheatMultiplier(*state, ReportCoilSelection::getReportIndex(*state, coil2Name, coil2Type), mult); + ReportCoilSelection::setCoilReheatMultiplier(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), mult); + auto &c1b = state->dataRptCoilSelection->coils[0]; + auto &c2b = state->dataRptCoilSelection->coils[1]; c1b->zoneEqNum = curZoneEqNum; c2b->zoneEqNum = curZoneEqNum; @@ -1103,7 +1088,7 @@ TEST_F(EnergyPlusFixture, Test_finishCoilSummaryReportTable) EXPECT_ENUM_EQ(zoneEquipList.EquipType(2), DataZoneEquipment::ZoneEquipType::FourPipeFanCoil); EXPECT_TRUE(Util::SameString(zoneEquipList.EquipData(2).SubEquipData(1).Name, coil1Name)); - state->dataRptCoilSelection->coilSelectionReportObj->finishCoilSummaryReportTable(*state); + ReportCoilSelection::finishCoilSummaryReportTable(*state); EXPECT_TRUE(Util::SameString(c1b->coilLocation, "Zone Equipment")); EXPECT_TRUE(Util::SameString(c1b->typeHVACname, "ZoneHVAC:AirDistributionUnit")); diff --git a/tst/EnergyPlus/unit/SZVAVModel.unit.cc b/tst/EnergyPlus/unit/SZVAVModel.unit.cc index 26dc8568272..6ffc3d7d813 100644 --- a/tst/EnergyPlus/unit/SZVAVModel.unit.cc +++ b/tst/EnergyPlus/unit/SZVAVModel.unit.cc @@ -270,7 +270,6 @@ TEST_F(EnergyPlusFixture, SZVAV_PTUnit_Testing) state->dataEnvrn->OutDryBulbTemp = 30.0; state->dataEnvrn->OutBaroPress = 101325.0; OutputReportPredefined::SetPredefinedTables(*state); - createCoilSelectionReportObj(*state); int UnitNum = 0; bool FirstHVACIteration = true; diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index d181ba081cb..15d0b70d03e 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -391,7 +391,6 @@ TEST_F(AirloopUnitarySysTest, MultipleWaterCoolingCoilSizing) state->dataWaterCoils->WaterCoil(CoilNum).Name; state->dataSize->DataWaterLoopNum = 1; - createCoilSelectionReportObj(*state); WaterCoils::SizeWaterCoil(*state, CoilNum); EXPECT_DOUBLE_EQ(0.159, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 71b773df78e..f1bddd5736c 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -227,7 +227,6 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) state->dataSize->FinalSysSizing(1).MassFlowAtCoolPeak = state->dataSize->FinalSysSizing(1).DesMainVolFlow * state->dataEnvrn->StdRhoAir; state->dataSize->DataWaterLoopNum = 1; - createCoilSelectionReportObj(*state); SizeWaterCoil(*state, CoilNum); EXPECT_DOUBLE_EQ(0.00159, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); @@ -468,7 +467,6 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) state->dataWaterCoils->MySizeFlag(1) = true; // run water coil sizing - createCoilSelectionReportObj(*state); SizeWaterCoil(*state, CoilNum); EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); @@ -621,7 +619,6 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) state->dataWaterCoils->MySizeFlag(1) = true; // run water coil sizing - createCoilSelectionReportObj(*state); SizeWaterCoil(*state, CoilNum); EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); @@ -778,7 +775,6 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) state->dataWaterCoils->MySizeFlag(1) = true; // run water coil sizing - createCoilSelectionReportObj(*state); SizeWaterCoil(*state, CoilNum); EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); @@ -889,7 +885,6 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) state->dataSize->DataWaterLoopNum = 1; // run water coil sizing - createCoilSelectionReportObj(*state); SizeWaterCoil(*state, CoilNum); EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); @@ -1004,7 +999,6 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) state->dataSize->DataWaterLoopNum = 1; // run water coil sizing - createCoilSelectionReportObj(*state); SizeWaterCoil(*state, CoilNum); EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); @@ -1129,7 +1123,6 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) OutputReportPredefined::SetPredefinedTables(*state); // run water coil sizing - createCoilSelectionReportObj(*state); SizeWaterCoil(*state, CoilNum); EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); @@ -1282,7 +1275,6 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) state->dataSize->DataWaterLoopNum = 1; // run water coil sizing - createCoilSelectionReportObj(*state); SizeWaterCoil(*state, CoilNum); EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); From 500478a48f5ba0ce3ac1e78eaa02d21869090276 Mon Sep 17 00:00:00 2001 From: Amir Roth Date: Sat, 11 Apr 2026 11:47:05 -0400 Subject: [PATCH 2/6] Fix some unit tests --- .../unit/HVACUnitaryBypassVAV.unit.cc | 81 ++++++++++--------- .../unit/HVACVariableRefrigerantFlow.unit.cc | 61 +++++++------- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 68 ++++++++-------- 3 files changed, 112 insertions(+), 98 deletions(-) diff --git a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc index f3c37f75ba1..975aebf19ea 100644 --- a/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc +++ b/tst/EnergyPlus/unit/HVACUnitaryBypassVAV.unit.cc @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -202,33 +203,35 @@ class CBVAVSys : public EnergyPlusFixture state->dataDXCoils->DXCoilNumericFields.allocate(1); state->dataDXCoils->DXCoilNumericFields(1).PerfMode.allocate(1); state->dataDXCoils->DXCoilNumericFields(1).PerfMode(1).FieldNames.allocate(20); - state->dataDXCoils->DXCoil(1).Name = "MyDXCoolCoil"; - state->dataDXCoils->DXCoil(1).coilType = HVAC::CoilType::CoolingDXSingleSpeed; + auto &dxCoil1 = state->dataDXCoils->DXCoil(1); + dxCoil1.Name = "MyDXCoolCoil"; + dxCoil1.coilType = HVAC::CoilType::CoolingDXSingleSpeed; + dxCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, dxCoil1.Name, dxCoil1.coilType); state->dataDXCoils->NumDXCoils = 1; state->dataDXCoils->CheckEquipName.dimension(1, true); state->dataDXCoils->GetCoilsInputFlag = false; - state->dataDXCoils->DXCoil(1).CCapFFlow.allocate(1); - state->dataDXCoils->DXCoil(1).CCapFFlow(1) = 1; - state->dataDXCoils->DXCoil(1).CCapFTemp.allocate(1); - state->dataDXCoils->DXCoil(1).CCapFTemp(1) = 1; - state->dataDXCoils->DXCoil(1).EIRFFlow.allocate(1); - state->dataDXCoils->DXCoil(1).EIRFFlow(1) = 1; - state->dataDXCoils->DXCoil(1).EIRFTemp.allocate(1); - state->dataDXCoils->DXCoil(1).EIRFTemp(1) = 1; - state->dataDXCoils->DXCoil(1).PLFFPLR.allocate(1); - state->dataDXCoils->DXCoil(1).PLFFPLR(1) = 1; + dxCoil1.CCapFFlow.allocate(1); + dxCoil1.CCapFFlow(1) = 1; + dxCoil1.CCapFTemp.allocate(1); + dxCoil1.CCapFTemp(1) = 1; + dxCoil1.EIRFFlow.allocate(1); + dxCoil1.EIRFFlow(1) = 1; + dxCoil1.EIRFTemp.allocate(1); + dxCoil1.EIRFTemp(1) = 1; + dxCoil1.PLFFPLR.allocate(1); + dxCoil1.PLFFPLR(1) = 1; state->dataDXCoils->DXCoilFullLoadOutAirTemp.allocate(1); state->dataDXCoils->DXCoilFullLoadOutAirHumRat.allocate(1); - state->dataDXCoils->DXCoil(1).RatedAirVolFlowRate.allocate(1); - state->dataDXCoils->DXCoil(1).RatedAirVolFlowRate(1) = 0.5; - state->dataDXCoils->DXCoil(1).RatedTotCap.allocate(1); - state->dataDXCoils->DXCoil(1).RatedTotCap(1) = 10000.0; - state->dataDXCoils->DXCoil(1).RatedCOP(1) = 3.3333; - state->dataDXCoils->DXCoil(1).RatedEIR.allocate(1); - state->dataDXCoils->DXCoil(1).RatedEIR(1) = 0.3; - state->dataDXCoils->DXCoil(1).RatedSHR.allocate(1); - state->dataDXCoils->DXCoil(1).RatedSHR(1) = 0.7; - state->dataDXCoils->DXCoil(1).availSched = Sched::GetScheduleAlwaysOn(*state); + dxCoil1.RatedAirVolFlowRate.allocate(1); + dxCoil1.RatedAirVolFlowRate(1) = 0.5; + dxCoil1.RatedTotCap.allocate(1); + dxCoil1.RatedTotCap(1) = 10000.0; + dxCoil1.RatedCOP(1) = 3.3333; + dxCoil1.RatedEIR.allocate(1); + dxCoil1.RatedEIR(1) = 0.3; + dxCoil1.RatedSHR.allocate(1); + dxCoil1.RatedSHR(1) = 0.7; + dxCoil1.availSched = Sched::GetScheduleAlwaysOn(*state); state->dataDXCoils->DXCoilOutletTemp.allocate(1); state->dataDXCoils->DXCoilOutletHumRat.allocate(1); state->dataDXCoils->DXCoilPartLoadRatio.allocate(1); @@ -236,12 +239,16 @@ class CBVAVSys : public EnergyPlusFixture state->dataHeatBal->HeatReclaimDXCoil.allocate(1); cbvav.DXCoolCoilName = "MyDXCoolCoil"; - state->dataDXCoils->DXCoil(1).coilType = HVAC::CoilType::CoolingDXSingleSpeed; + dxCoil1.coilType = HVAC::CoilType::CoolingDXSingleSpeed; + dxCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, dxCoil1.Name, dxCoil1.coilType); + state->dataHeatingCoils->HeatingCoil.allocate(1); state->dataHeatingCoils->HeatingCoilNumericFields.allocate(1); state->dataHeatingCoils->HeatingCoilNumericFields(1).FieldNames.allocate(20); - state->dataHeatingCoils->HeatingCoil(1).Name = "MyHeatingCoil"; - state->dataHeatingCoils->HeatingCoil(1).coilType = HVAC::CoilType::HeatingElectric; + auto &heatingCoil1 = state->dataHeatingCoils->HeatingCoil(1); + heatingCoil1.Name = "MyHeatingCoil"; + heatingCoil1.coilType = HVAC::CoilType::HeatingElectric; + heatingCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, heatingCoil1.Name, heatingCoil1.coilType); state->dataHeatingCoils->NumHeatingCoils = 1; state->dataHeatingCoils->ValidSourceType.dimension(state->dataHeatingCoils->NumHeatingCoils, false); state->dataHeatingCoils->GetCoilsInputFlag = false; @@ -274,18 +281,18 @@ class CBVAVSys : public EnergyPlusFixture state->dataMixedAir->OAMixer(1).RelNode = 4; state->dataMixedAir->OAMixer(1).RetNode = 6; state->dataMixedAir->OAMixer(1).MixNode = 7; - state->dataDXCoils->DXCoil(1).AirInNode = 7; - cbvav.DXCoilInletNode = state->dataDXCoils->DXCoil(1).AirInNode; - state->dataDXCoils->DXCoil(1).AirOutNode = 8; - cbvav.DXCoilOutletNode = state->dataDXCoils->DXCoil(1).AirOutNode; - state->dataHeatingCoils->HeatingCoil(1).AirInletNodeNum = 8; - cbvav.HeatingCoilInletNode = state->dataHeatingCoils->HeatingCoil(1).AirInletNodeNum; - state->dataHeatingCoils->HeatingCoil(1).AirOutletNodeNum = 9; - state->dataHeatingCoils->HeatingCoil(1).TempSetPointNodeNum = 9; - cbvav.HeatingCoilOutletNode = state->dataHeatingCoils->HeatingCoil(1).AirOutletNodeNum; - state->dataHeatingCoils->HeatingCoil(1).NominalCapacity = 10000.0; - state->dataHeatingCoils->HeatingCoil(1).Efficiency = 1.0; - state->dataHeatingCoils->HeatingCoil(1).availSched = Sched::GetScheduleAlwaysOn(*state); + dxCoil1.AirInNode = 7; + cbvav.DXCoilInletNode = dxCoil1.AirInNode; + dxCoil1.AirOutNode = 8; + cbvav.DXCoilOutletNode = dxCoil1.AirOutNode; + heatingCoil1.AirInletNodeNum = 8; + cbvav.HeatingCoilInletNode = heatingCoil1.AirInletNodeNum; + heatingCoil1.AirOutletNodeNum = 9; + heatingCoil1.TempSetPointNodeNum = 9; + cbvav.HeatingCoilOutletNode = heatingCoil1.AirOutletNodeNum; + heatingCoil1.NominalCapacity = 10000.0; + heatingCoil1.Efficiency = 1.0; + heatingCoil1.availSched = Sched::GetScheduleAlwaysOn(*state); cbvav.CBVAVBoxOutletNode.allocate(1); cbvav.CBVAVBoxOutletNode(1) = 11; diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index a6956f26279..163c119edc1 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -478,37 +478,42 @@ class AirLoopFixture : public EnergyPlusFixture // DX coil set up state->dataDXCoils->DXCoilNumericFields(1).PerfMode.allocate(5); state->dataDXCoils->DXCoilNumericFields(1).PerfMode(1).FieldNames.allocate(30); - state->dataDXCoils->DXCoil(1).Name = "VRFTUDXCOOLCOIL"; - state->dataDXCoils->DXCoil(1).AirInNode = coolCoilAirInNode; - state->dataDXCoils->DXCoil(1).AirOutNode = coolCoilAirOutNode; - state->dataDXCoils->DXCoil(1).coilType = HVAC::CoilType::CoolingVRF; - state->dataDXCoils->DXCoil(1).RatedAirVolFlowRate = DataSizing::AutoSize; - state->dataDXCoils->DXCoil(1).RatedTotCap = DataSizing::AutoSize; - state->dataDXCoils->DXCoil(1).RatedSHR = DataSizing::AutoSize; - state->dataDXCoils->DXCoil(1).availSched = sched1; - state->dataDXCoils->DXCoil(1).CCapFTemp.allocate(1); - state->dataDXCoils->DXCoil(1).CCapFTemp(1) = Sch1; - state->dataDXCoils->DXCoil(1).CCapFFlow.allocate(1); - state->dataDXCoils->DXCoil(1).CCapFFlow(1) = Sch1; - state->dataDXCoils->DXCoil(1).PLFFPLR.allocate(1); - state->dataDXCoils->DXCoil(1).PLFFPLR(1) = Sch1; + auto &dxCoil1 = state->dataDXCoils->DXCoil(1); + dxCoil1.Name = "VRFTUDXCOOLCOIL"; + dxCoil1.AirInNode = coolCoilAirInNode; + dxCoil1.AirOutNode = coolCoilAirOutNode; + dxCoil1.coilType = HVAC::CoilType::CoolingVRF; + dxCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, dxCoil1.Name, dxCoil1.coilType); + + dxCoil1.RatedAirVolFlowRate = DataSizing::AutoSize; + dxCoil1.RatedTotCap = DataSizing::AutoSize; + dxCoil1.RatedSHR = DataSizing::AutoSize; + dxCoil1.availSched = sched1; + dxCoil1.CCapFTemp.allocate(1); + dxCoil1.CCapFTemp(1) = Sch1; + dxCoil1.CCapFFlow.allocate(1); + dxCoil1.CCapFFlow(1) = Sch1; + dxCoil1.PLFFPLR.allocate(1); + dxCoil1.PLFFPLR(1) = Sch1; state->dataDXCoils->DXCoilNumericFields(2).PerfMode.allocate(5); state->dataDXCoils->DXCoilNumericFields(2).PerfMode(1).FieldNames.allocate(30); - state->dataDXCoils->DXCoil(2).Name = "VRFTUDXHEATCOIL"; - state->dataDXCoils->DXCoil(2).coilType = HVAC::CoilType::HeatingVRF; - state->dataDXCoils->DXCoil(2).AirInNode = heatCoilAirInNode; - state->dataDXCoils->DXCoil(2).AirOutNode = heatCoilAirOutNode; - state->dataDXCoils->DXCoil(2).RatedAirVolFlowRate = DataSizing::AutoSize; - state->dataDXCoils->DXCoil(2).RatedTotCap = DataSizing::AutoSize; - state->dataDXCoils->DXCoil(2).RatedSHR = DataSizing::AutoSize; - state->dataDXCoils->DXCoil(2).availSched = sched1; - state->dataDXCoils->DXCoil(2).CCapFTemp.allocate(1); - state->dataDXCoils->DXCoil(2).CCapFTemp(1) = Sch1; - state->dataDXCoils->DXCoil(2).CCapFFlow.allocate(1); - state->dataDXCoils->DXCoil(2).CCapFFlow(1) = Sch1; - state->dataDXCoils->DXCoil(2).PLFFPLR.allocate(1); - state->dataDXCoils->DXCoil(2).PLFFPLR(1) = Sch1; + auto &dxCoil2 = state->dataDXCoils->DXCoil(2); + dxCoil2.Name = "VRFTUDXHEATCOIL"; + dxCoil2.coilType = HVAC::CoilType::HeatingVRF; + dxCoil2.coilReportNum = ReportCoilSelection::getReportIndex(*state, dxCoil2.Name, dxCoil2.coilType); + dxCoil2.AirInNode = heatCoilAirInNode; + dxCoil2.AirOutNode = heatCoilAirOutNode; + dxCoil2.RatedAirVolFlowRate = DataSizing::AutoSize; + dxCoil2.RatedTotCap = DataSizing::AutoSize; + dxCoil2.RatedSHR = DataSizing::AutoSize; + dxCoil2.availSched = sched1; + dxCoil2.CCapFTemp.allocate(1); + dxCoil2.CCapFTemp(1) = Sch1; + dxCoil2.CCapFFlow.allocate(1); + dxCoil2.CCapFFlow(1) = Sch1; + dxCoil2.PLFFPLR.allocate(1); + dxCoil2.PLFFPLR(1) = Sch1; } virtual void TearDown() diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 9ddd137ac3f..ccd5c28494a 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -22997,49 +22997,51 @@ TEST_F(AirloopUnitarySysTest, WSHPVariableSpeedCoilSizing) state->dataVariableSpeedCoils->VarSpeedCoil.allocate(2); state->dataVariableSpeedCoils->NumVarSpeedCoils = 2; int CoilNum1 = 1; + auto &vsCoil1 = state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1); state->dataVariableSpeedCoils->GetCoilsInputFlag = false; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).Name = "WSHPVSCooling"; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).coilType = HVAC::CoilType::CoolingWAHPVariableSpeedEquationFit; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).NumOfSpeeds = 10; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).NormSpedLevel = 10; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).VarSpeedCoilType = "Coil:Cooling:WaterToAirHeatPump:VariableSpeedEquationFit"; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).CondenserType = DataHeatBalance::RefrigCondenserType::Water; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).CoolHeatType = "Cooling"; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSRatedWaterVolFlowPerRatedTotCap(10) = 0.00000001; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).AirInletNodeNum = 1; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).AirOutletNodeNum = 2; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).WaterInletNodeNum = 3; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).WaterOutletNodeNum = 4; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).availSched = Sched::GetScheduleAlwaysOn(*state); + vsCoil1.Name = "WSHPVSCooling"; + vsCoil1.coilType = HVAC::CoilType::CoolingWAHPVariableSpeedEquationFit; + vsCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, vsCoil1.Name, vsCoil1.coilType); + vsCoil1.NumOfSpeeds = 10; + vsCoil1.NormSpedLevel = 10; + vsCoil1.VarSpeedCoilType = "Coil:Cooling:WaterToAirHeatPump:VariableSpeedEquationFit"; + vsCoil1.CondenserType = DataHeatBalance::RefrigCondenserType::Water; + vsCoil1.CoolHeatType = "Cooling"; + vsCoil1.MSRatedWaterVolFlowPerRatedTotCap(10) = 0.00000001; + vsCoil1.AirInletNodeNum = 1; + vsCoil1.AirOutletNodeNum = 2; + vsCoil1.WaterInletNodeNum = 3; + vsCoil1.WaterOutletNodeNum = 4; + vsCoil1.availSched = Sched::GetScheduleAlwaysOn(*state); for (int spdNum = 1; spdNum <= 10; ++spdNum) { // all speeds have same flow per capacity ratio - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSRatedAirVolFlowPerRatedTotCap(spdNum) = 0.000036791; + vsCoil1.MSRatedAirVolFlowPerRatedTotCap(spdNum) = 0.000036791; // each speed as a percentage of total capacity, spd 1 = 0.1, spd 2 = 0.2, spd 10 = 1.0 - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSRatedPercentTotCap(spdNum) = - spdNum / Real64(state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).NumOfSpeeds); + vsCoil1.MSRatedPercentTotCap(spdNum) = + spdNum / Real64(vsCoil1.NumOfSpeeds); // all speeds have same parameters - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSRatedCOP(spdNum) = 3.0; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSRatedWaterVolFlowPerRatedTotCap(spdNum) = 1.0E-7; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSRatedSHR(spdNum) = 0.67; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSCCapFTemp(spdNum) = 1; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSRatedTotCap(spdNum) = 2; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSCCapAirFFlow(spdNum) = 2; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSCCapWaterFFlow(spdNum) = 2; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSEIRFTemp(spdNum) = 2; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSEIRAirFFlow(spdNum) = 2; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSEIRWaterFFlow(spdNum) = 2; - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSWasteHeat(spdNum) = 2; + vsCoil1.MSRatedCOP(spdNum) = 3.0; + vsCoil1.MSRatedWaterVolFlowPerRatedTotCap(spdNum) = 1.0E-7; + vsCoil1.MSRatedSHR(spdNum) = 0.67; + vsCoil1.MSCCapFTemp(spdNum) = 1; + vsCoil1.MSRatedTotCap(spdNum) = 2; + vsCoil1.MSCCapAirFFlow(spdNum) = 2; + vsCoil1.MSCCapWaterFFlow(spdNum) = 2; + vsCoil1.MSEIRFTemp(spdNum) = 2; + vsCoil1.MSEIRAirFFlow(spdNum) = 2; + vsCoil1.MSEIRWaterFFlow(spdNum) = 2; + vsCoil1.MSWasteHeat(spdNum) = 2; } state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilVSWAHPCoolingEquationFit; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).Name; + vsCoil1.Name; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).WaterInletNodeNum; + vsCoil1.WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).WaterOutletNodeNum; + vsCoil1.WaterOutletNodeNum; // use pseudo real CapFT curve, use unity curves for all others auto *curve1 = Curve::AddCurve(*state, "Curve1"); curve1->curveType = Curve::CurveType::BiQuadratic; @@ -23064,7 +23066,7 @@ TEST_F(AirloopUnitarySysTest, WSHPVariableSpeedCoilSizing) thisSys.m_sysType = UnitarySys::SysType::Unitary; thisSys.Name = compName; thisSys.m_CoolCoilExists = true; - thisSys.m_CoolingCoilName = state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).Name; + thisSys.m_CoolingCoilName = vsCoil1.Name; thisSys.m_coolCoilType = HVAC::CoilType::CoolingWAHPVariableSpeedEquationFit; thisSys.m_CoolingCoilIndex = CoilNum1; thisSys.m_CoolingSAFMethod = DataSizing::SupplyAirFlowRate; @@ -23095,7 +23097,7 @@ TEST_F(AirloopUnitarySysTest, WSHPVariableSpeedCoilSizing) Real64 MixWetBulb = Psychrometrics::PsyTwbFnTdbWPb(*state, MixTemp, MixHumRat, state->dataEnvrn->StdBaroPress); Real64 constexpr RatedInletWaterTemp = 29.4444; // 85 F cooling mode Real64 capFT_water = - Curve::CurveValue(*state, state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSCCapFTemp(10), MixWetBulb, RatedInletWaterTemp); + Curve::CurveValue(*state, vsCoil1.MSCCapFTemp(10), MixWetBulb, RatedInletWaterTemp); // these curve results are very near 1 EXPECT_NEAR(state->dataSize->DataCoilSizingCapFT, capFT_water, 0.0001); @@ -23103,7 +23105,7 @@ TEST_F(AirloopUnitarySysTest, WSHPVariableSpeedCoilSizing) // OAT at cooling peak was set = 0 C Real64 capFT_OAT = Curve::CurveValue(*state, - state->dataVariableSpeedCoils->VarSpeedCoil(CoilNum1).MSCCapFTemp(10), + vsCoil1.MSCCapFTemp(10), MixWetBulb, state->dataSize->FinalSysSizing(1).OutTempAtCoolPeak); // this value is certainly not used in the capacity calculation as shown below From f035ced79cdb8e7ca356d90918122c2125972049 Mon Sep 17 00:00:00 2001 From: Amir Roth Date: Sat, 11 Apr 2026 13:43:20 -0400 Subject: [PATCH 3/6] Fix unit tests --- src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 36 +- tst/EnergyPlus/unit/Furnaces.unit.cc | 78 +- tst/EnergyPlus/unit/WaterCoils.unit.cc | 699 +++++++++--------- .../unit/WaterToAirHeatPumpSimple.unit.cc | 125 ++-- 4 files changed, 488 insertions(+), 450 deletions(-) diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index b079b78d37b..e8666947fec 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -508,13 +508,12 @@ namespace WaterToAirHeatPumpSimple { // ErrorsFound will be set to True if problem was found, left untouched otherwise GlobalNames::VerifyUniqueCoilName( state, CurrentModuleObject, simpleWAHP.Name, ErrorsFound, EnergyPlus::format("{} Name", CurrentModuleObject)); - simpleWAHP.WAHPType = WatertoAirHP::Heating; simpleWAHP.WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit; simpleWAHP.coilType = HVAC::CoilType::HeatingWAHPSimple; simpleWAHP.coilReportNum = ReportCoilSelection::getReportIndex(state, simpleWAHP.Name, simpleWAHP.coilType); - + std::string const availSchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "availability_schedule_name"); if (availSchedName.empty()) { simpleWAHP.availSched = Sched::GetScheduleAlwaysOn(state); @@ -1069,7 +1068,7 @@ namespace WaterToAirHeatPumpSimple { PlantUtilities::InitComponentNodes( state, 0.0, simpleWAHP.DesignWaterMassFlowRate, simpleWAHP.WaterInletNodeNum, simpleWAHP.WaterOutletNodeNum); - if (simpleWAHP.coilType == HVAC::CoilType::HeatingWAHPSimple && simpleWAHP.CompanionCoolingCoilNum > 0) { + if (simpleWAHP.WAHPType == WatertoAirHP::Heating && simpleWAHP.CompanionCoolingCoilNum > 0) { state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(simpleWAHP.CompanionCoolingCoilNum).DesignWaterMassFlowRate = rho * state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(simpleWAHP.CompanionCoolingCoilNum).RatedWaterVolFlowRate; PlantUtilities::InitComponentNodes( @@ -1318,7 +1317,7 @@ namespace WaterToAirHeatPumpSimple { RatedCapHeatUser = 0.0; RatedWaterVolFlowRateDes = 0.0; RatedWaterVolFlowRateUser = 0.0; - std::string CompType = + std::string CompType = EnergyPlus::format("COIL:{}:WATERTOAIRHEATPUMP:EQUATIONFIT", WatertoAirHPNamesUC[static_cast(simpleWAHP.WAHPType)]); if (simpleWAHP.RatedAirVolFlowRate == DataSizing::AutoSize) { @@ -1430,7 +1429,7 @@ namespace WaterToAirHeatPumpSimple { Real64 FanCoolLoad = 0.0; Real64 FanHeatLoad = FanCoolLoad; - if (simpleWAHP.coilType == HVAC::CoilType::CoolingWAHPSimple) { + if (simpleWAHP.WAHPType == WatertoAirHP::Cooling) { // size rated total cooling capacity if (simpleWAHP.RatedCapCoolTotal == DataSizing::AutoSize) { RatedCapCoolTotalAutoSized = true; @@ -1700,7 +1699,7 @@ namespace WaterToAirHeatPumpSimple { } } // size rated sensible cooling capacity - if (simpleWAHP.RatedCapCoolSens == DataSizing::AutoSize && simpleWAHP.coilType == HVAC::CoilType::CoolingWAHPSimple) { + if (simpleWAHP.RatedCapCoolSens == DataSizing::AutoSize && simpleWAHP.WAHPType == WatertoAirHP::Cooling) { RatedCapCoolSensAutoSized = true; } if (SizingDesRunThisAirSys || SizingDesRunThisZone) { @@ -2100,7 +2099,6 @@ namespace WaterToAirHeatPumpSimple { OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoolCoilSHR, simpleWAHP.Name, 0.0); OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoolCoilNomEff, simpleWAHP.Name, 0.0); } - if (simpleWAHP.RatedCapCoolTotal != DataSizing::AutoSize) { ReportCoilSelection::setCoilCoolingCapacity(state, simpleWAHP.coilReportNum, @@ -2277,7 +2275,7 @@ namespace WaterToAirHeatPumpSimple { } // Cooling Coil - if (simpleWAHP.coilType == HVAC::CoilType::HeatingWAHPSimple) { + if (simpleWAHP.WAHPType == WatertoAirHP::Heating) { // size rated heating capacity IsAutoSize = false; if (simpleWAHP.RatedCapHeat == DataSizing::AutoSize) { @@ -2690,7 +2688,7 @@ namespace WaterToAirHeatPumpSimple { simpleWAHP.RatedPowerHeatAtRatedCdts = 0; // should be RatedPowerHeat? } // Check that heat pump heating capacity is within 20% of cooling capacity. Check only for heating coil and report both. - if (simpleWAHP.coilType == HVAC::CoilType::HeatingWAHPSimple && simpleWAHP.CompanionCoolingCoilNum > 0) { + if (simpleWAHP.WAHPType == WatertoAirHP::Heating && simpleWAHP.CompanionCoolingCoilNum > 0) { auto &companionCoolingCoil(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(simpleWAHP.CompanionCoolingCoilNum)); if (companionCoolingCoil.RatedCapCoolTotal > 0.0) { @@ -2729,7 +2727,7 @@ namespace WaterToAirHeatPumpSimple { // size/report rated efficiency and power Real64 RatedCoolCOP = 0.0; Real64 RatedHeatCOP = 0.0; - if (simpleWAHP.coilType == HVAC::CoilType::CoolingWAHPSimple) { + if (simpleWAHP.WAHPType == WatertoAirHP::Cooling) { if (simpleWAHP.RatedPowerCool > 0) { RatedCoolCOP = simpleWAHP.RatedCapCoolTotal / simpleWAHP.RatedPowerCool; OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoolCoilNomEff, simpleWAHP.Name, RatedCoolCOP); @@ -2744,7 +2742,7 @@ namespace WaterToAirHeatPumpSimple { simpleWAHP.RatedCapCoolAtRatedCdts / simpleWAHP.RatedPowerCoolAtRatedCdts); } } - } else if (simpleWAHP.coilType == HVAC::CoilType::HeatingWAHPSimple) { + } else if (simpleWAHP.WAHPType == WatertoAirHP::Heating) { // heating coil power simpleWAHP.RatedPowerHeatAtRatedCdts = simpleWAHP.RatedCapHeatAtRatedCdts / simpleWAHP.RatedCOPHeatAtRatedCdts; if (simpleWAHP.RatedPowerHeat > 0) { @@ -2809,7 +2807,7 @@ namespace WaterToAirHeatPumpSimple { rho = simpleWAHP.plantLoc.loop->glycol->getDensity(state, state.dataSize->PlantSizData(PltSizNum).ExitTemp, RoutineNameAlt); Cp = simpleWAHP.plantLoc.loop->glycol->getSpecificHeat(state, state.dataSize->PlantSizData(PltSizNum).ExitTemp, RoutineNameAlt); - if (simpleWAHP.coilType == HVAC::CoilType::HeatingWAHPSimple) { + if (simpleWAHP.WAHPType == WatertoAirHP::Heating) { RatedWaterVolFlowRateDes = (1 - 1 / RatedHeatCOP) * simpleWAHP.RatedCapHeat / (state.dataSize->PlantSizData(PltSizNum).DeltaT * Cp * rho); if (simpleWAHP.CompanionCoolingCoilNum > 0) { @@ -2832,7 +2830,7 @@ namespace WaterToAirHeatPumpSimple { } } } - } else if (simpleWAHP.coilType == HVAC::CoilType::CoolingWAHPSimple) { + } else if (simpleWAHP.WAHPType == WatertoAirHP::Cooling) { // use companion heating coil capacity to calculate volumetric flow rate if (simpleWAHP.CompanionHeatingCoilNum > 0) { auto const &companionHeatingCoil = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(simpleWAHP.CompanionHeatingCoilNum); @@ -2866,7 +2864,7 @@ namespace WaterToAirHeatPumpSimple { simpleWAHP.Name, "Design Size Rated Water Flow Rate [m3/s]", RatedWaterVolFlowRateDes); - if (simpleWAHP.coilType == HVAC::CoilType::HeatingWAHPSimple && simpleWAHP.CompanionCoolingCoilNum > 0) { + if (simpleWAHP.WAHPType == WatertoAirHP::Heating && simpleWAHP.CompanionCoolingCoilNum > 0) { auto &companionCoolingCoil(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(simpleWAHP.CompanionCoolingCoilNum)); companionCoolingCoil.RatedWaterVolFlowRate = RatedWaterVolFlowRateDes; BaseSizer::reportSizerOutput(state, @@ -2875,7 +2873,7 @@ namespace WaterToAirHeatPumpSimple { companionCoolingCoil.Name, "Design Size Rated Water Flow Rate [m3/s]", RatedWaterVolFlowRateDes); - } else if (simpleWAHP.coilType == HVAC::CoilType::CoolingWAHPSimple && simpleWAHP.CompanionHeatingCoilNum > 0) { + } else if (simpleWAHP.WAHPType == WatertoAirHP::Cooling && simpleWAHP.CompanionHeatingCoilNum > 0) { auto &companionHeatingCoil(state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(simpleWAHP.CompanionHeatingCoilNum)); companionHeatingCoil.RatedWaterVolFlowRate = RatedWaterVolFlowRateDes; BaseSizer::reportSizerOutput(state, @@ -3532,7 +3530,7 @@ namespace WaterToAirHeatPumpSimple { if (simpleWAHP.reportCoilFinalSizes) { if (!state.dataGlobal->WarmupFlag && !state.dataGlobal->DoingHVACSizingSimulations && !state.dataGlobal->DoingSizing) { - if (simpleWAHP.coilType == HVAC::CoilType::CoolingWAHPSimple) { + if (simpleWAHP.WAHPType == WatertoAirHP::Cooling) { ReportCoilSelection::setCoilFinalSizes( state, simpleWAHP.coilReportNum, @@ -3540,7 +3538,7 @@ namespace WaterToAirHeatPumpSimple { simpleWAHP.RatedCapCoolSens, simpleWAHP.RatedAirVolFlowRate, simpleWAHP.RatedWaterVolFlowRate); - } else if (simpleWAHP.coilType == HVAC::CoilType::HeatingWAHPSimple) { + } else if (simpleWAHP.WAHPType == WatertoAirHP::Heating) { ReportCoilSelection::setCoilFinalSizes( state, simpleWAHP.coilReportNum, @@ -3985,7 +3983,7 @@ namespace WaterToAirHeatPumpSimple { } auto &wahp = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(WhichCoil); - if (wahp.coilType == HVAC::CoilType::CoolingWAHPSimple) { + if (wahp.WAHPType == WatertoAirHP::Cooling) { if (wahp.RatedEntAirWetbulbTemp != DataSizing::AutoSize && wahp.TotalCoolCapCurve != nullptr && wahp.CoolPowCurve != nullptr) { Real64 RatedratioTWB = (wahp.RatedEntAirWetbulbTemp + Constant::Kelvin) / Tref; Real64 RatedratioTS = (wahp.RatedEntWaterTemp + Constant::Kelvin) / Tref; @@ -4022,7 +4020,7 @@ namespace WaterToAirHeatPumpSimple { } } - } else if (wahp.coilType == HVAC::CoilType::HeatingWAHPSimple) { + } else if (wahp.WAHPType == WatertoAirHP::Heating) { if (wahp.RatedEntAirDrybulbTemp != DataSizing::AutoSize && wahp.HeatCapCurve != nullptr && wahp.HeatPowCurve != nullptr) { Real64 RatedHeatratioTDB = (wahp.RatedEntAirDrybulbTemp + Constant::Kelvin) / Tref; Real64 RatedHeatratioTS = (wahp.RatedEntWaterTemp + Constant::Kelvin) / Tref; diff --git a/tst/EnergyPlus/unit/Furnaces.unit.cc b/tst/EnergyPlus/unit/Furnaces.unit.cc index a385357eb23..bee1af03f75 100644 --- a/tst/EnergyPlus/unit/Furnaces.unit.cc +++ b/tst/EnergyPlus/unit/Furnaces.unit.cc @@ -68,6 +68,7 @@ #include #include #include +#include #include #include #include @@ -278,42 +279,51 @@ TEST_F(EnergyPlusFixture, SetVSHPAirFlowTest_VSFurnaceFlowTest) firstHVACIteration = false; // now the coils will be called state->dataFurnaces->Furnace(FurnaceNum).CoolingCoilIndex = 1; state->dataFurnaces->Furnace(FurnaceNum).HeatingCoilIndex = 2; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP.allocate(2); state->dataWaterToAirHeatPumpSimple->NumWatertoAirHPs = 2; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).Name = "WATERCOOLINGCOIL"; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).WAHPType = WaterToAirHeatPumpSimple::WatertoAirHP::Cooling; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).availSched = Sched::GetScheduleAlwaysOn(*state); - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).Name = "WATERHEATINGCOIL"; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).WAHPType = WaterToAirHeatPumpSimple::WatertoAirHP::Heating; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).availSched = Sched::GetScheduleAlwaysOn(*state); + state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP.allocate(2); + + auto &wahpSimple1 = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1); + wahpSimple1.Name = "WATERCOOLINGCOIL"; + wahpSimple1.WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit; + wahpSimple1.WAHPType = WaterToAirHeatPumpSimple::WatertoAirHP::Cooling; + wahpSimple1.coilType = HVAC::CoilType::CoolingWAHPSimple; + wahpSimple1.coilReportNum = ReportCoilSelection::getReportIndex(*state, wahpSimple1.Name, wahpSimple1.coilType); + wahpSimple1.availSched = Sched::GetScheduleAlwaysOn(*state); + + auto &wahpSimple2 = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2); + wahpSimple2.Name = "WATERHEATINGCOIL"; + wahpSimple2.WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit; + wahpSimple2.WAHPType = WaterToAirHeatPumpSimple::WatertoAirHP::Heating; + wahpSimple2.coilType = HVAC::CoilType::HeatingWAHPSimple; + wahpSimple2.coilReportNum = ReportCoilSelection::getReportIndex(*state, wahpSimple2.Name, wahpSimple2.coilType); + wahpSimple2.availSched = Sched::GetScheduleAlwaysOn(*state); + state->dataWaterToAirHeatPumpSimple->SimpleHPTimeStepFlag.allocate(2); - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).AirInletNodeNum = 1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).AirOutletNodeNum = 3; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).WaterInletNodeNum = 5; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).WaterOutletNodeNum = 6; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).plantLoc.loopNum = 1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).plantLoc.loopSideNum = DataPlant::LoopSideLocation::Demand; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).plantLoc.branchNum = 1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).plantLoc.compNum = 1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedCapCoolTotal = 30000.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedCOPCoolAtRatedCdts = 3.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedCapHeat = 30000.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedCOPHeatAtRatedCdts = 3.0; - - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).AirInletNodeNum = 3; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).AirOutletNodeNum = 2; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).WaterInletNodeNum = 7; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).WaterOutletNodeNum = 8; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).plantLoc.loopNum = 2; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).plantLoc.loopSideNum = DataPlant::LoopSideLocation::Demand; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).plantLoc.branchNum = 1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).plantLoc.compNum = 1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatedCapCoolTotal = 30000.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatedCOPCoolAtRatedCdts = 3.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatedCapHeat = 30000.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatedCOPHeatAtRatedCdts = 3.0; + wahpSimple1.AirInletNodeNum = 1; + wahpSimple1.AirOutletNodeNum = 3; + wahpSimple1.WaterInletNodeNum = 5; + wahpSimple1.WaterOutletNodeNum = 6; + wahpSimple1.plantLoc.loopNum = 1; + wahpSimple1.plantLoc.loopSideNum = DataPlant::LoopSideLocation::Demand; + wahpSimple1.plantLoc.branchNum = 1; + wahpSimple1.plantLoc.compNum = 1; + wahpSimple1.RatedCapCoolTotal = 30000.0; + wahpSimple1.RatedCOPCoolAtRatedCdts = 3.0; + wahpSimple1.RatedCapHeat = 30000.0; + wahpSimple1.RatedCOPHeatAtRatedCdts = 3.0; + + wahpSimple2.AirInletNodeNum = 3; + wahpSimple2.AirOutletNodeNum = 2; + wahpSimple2.WaterInletNodeNum = 7; + wahpSimple2.WaterOutletNodeNum = 8; + wahpSimple2.plantLoc.loopNum = 2; + wahpSimple2.plantLoc.loopSideNum = DataPlant::LoopSideLocation::Demand; + wahpSimple2.plantLoc.branchNum = 1; + wahpSimple2.plantLoc.compNum = 1; + wahpSimple2.RatedCapCoolTotal = 30000.0; + wahpSimple2.RatedCOPCoolAtRatedCdts = 3.0; + wahpSimple2.RatedCapHeat = 30000.0; + wahpSimple2.RatedCOPHeatAtRatedCdts = 3.0; // set up plant loop state->dataPlnt->TotNumLoops = 2; diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index f1bddd5736c..0c0c0a7f7db 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -200,23 +200,27 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) // set up water coil int CoilNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Water Cooling Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc.loopNum = 1; - PlantUtilities::SetPlantLocationLinks(*state, state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc); - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; - state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; + auto &waterCoil1 = state->dataWaterCoils->WaterCoil(CoilNum); + waterCoil1.Name = "Test Water Cooling Coil"; + waterCoil1.coilType = HVAC::CoilType::CoolingWater; + waterCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, waterCoil1.Name, waterCoil1.coilType); + + waterCoil1.WaterPlantLoc.loopNum = 1; + PlantUtilities::SetPlantLocationLinks(*state, waterCoil1.WaterPlantLoc); + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; + waterCoil1.RequestingAutoSize = true; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(3) = "Maximum Flow Rate"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; + waterCoil1.WaterInletNodeNum = 1; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -229,7 +233,7 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(0.00159, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(0.00159, waterCoil1.DesAirVolFlowRate); // Check that all Data* variables have been reset EXPECT_EQ(0, state->dataSize->DataPltSizCoolNum); EXPECT_EQ(0, state->dataSize->DataWaterLoopNum); @@ -249,18 +253,18 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) state->dataSize->FinalSysSizing(1).DesMainVolFlow = 0.00259; state->dataSize->FinalSysSizing(1).MassFlowAtCoolPeak = state->dataSize->FinalSysSizing(1).DesMainVolFlow * state->dataEnvrn->StdRhoAir; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Water Cooling Coil 2"; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; + waterCoil1.Name = "Test Water Cooling Coil 2"; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(0.00259, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(0.00259, waterCoil1.DesAirVolFlowRate); EXPECT_EQ(0, state->dataSize->DataPltSizCoolNum); EXPECT_EQ(0, state->dataSize->DataWaterLoopNum); EXPECT_DOUBLE_EQ(0.0, state->dataSize->DataConstantUsedForSizing); @@ -283,19 +287,19 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) state->dataSize->FinalSysSizing(1).MassFlowAtCoolPeak = state->dataSize->FinalSysSizing(1).DesMainVolFlow * state->dataEnvrn->StdRhoAir; state->dataAirLoop->AirLoopControlInfo(1).UnitarySys = true; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Water Heating Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; + waterCoil1.Name = "Test Water Heating Coil"; + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(0.00359, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(0.00359, waterCoil1.DesAirVolFlowRate); EXPECT_EQ(0, state->dataSize->DataPltSizCoolNum); EXPECT_EQ(0, state->dataSize->DataWaterLoopNum); EXPECT_DOUBLE_EQ(0.0, state->dataSize->DataConstantUsedForSizing); @@ -314,19 +318,19 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) state->dataSize->FinalSysSizing(1).DesMainVolFlow = 0.00459; state->dataSize->FinalSysSizing(1).MassFlowAtCoolPeak = state->dataSize->FinalSysSizing(1).DesMainVolFlow * state->dataEnvrn->StdRhoAir; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Water Heating Coil 2"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; + waterCoil1.Name = "Test Water Heating Coil 2"; + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(0.00459, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(0.00459, waterCoil1.DesAirVolFlowRate); EXPECT_EQ(0, state->dataSize->DataPltSizCoolNum); EXPECT_EQ(0, state->dataSize->DataWaterLoopNum); EXPECT_DOUBLE_EQ(0.0, state->dataSize->DataConstantUsedForSizing); @@ -365,21 +369,21 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) state->dataWaterCoils->MyUAAndFlowCalcFlag.allocate(1); state->dataWaterCoils->MyUAAndFlowCalcFlag(CoilNum) = true; - state->dataWaterCoils->WaterCoil(CoilNum).UACoil = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesTotWaterCoilLoad = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; + waterCoil1.UACoil = AutoSize; + waterCoil1.DesTotWaterCoilLoad = AutoSize; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; SizeWaterCoil(*state, CoilNum); - EXPECT_NEAR(state->dataWaterCoils->WaterCoil(CoilNum).InletAirTemp, 16.0, 0.0001); // a mixture of zone air (20 C) and 10% OA (-20 C) = 16 C - EXPECT_NEAR(state->dataWaterCoils->WaterCoil(CoilNum).DesTotWaterCoilLoad, 1709.8638, 0.0001); - EXPECT_NEAR(state->dataWaterCoils->WaterCoil(CoilNum).UACoil, 51.2456, 0.0001); - EXPECT_NEAR(state->dataWaterCoils->WaterCoil(CoilNum).OutletAirTemp, 30.1302, 0.0001); // reasonable delta T above inlet air temp + EXPECT_NEAR(waterCoil1.InletAirTemp, 16.0, 0.0001); // a mixture of zone air (20 C) and 10% OA (-20 C) = 16 C + EXPECT_NEAR(waterCoil1.DesTotWaterCoilLoad, 1709.8638, 0.0001); + EXPECT_NEAR(waterCoil1.UACoil, 51.2456, 0.0001); + EXPECT_NEAR(waterCoil1.OutletAirTemp, 30.1302, 0.0001); // reasonable delta T above inlet air temp } TEST_F(WaterCoilsTest, TdbFnHRhPbTest) @@ -432,28 +436,29 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) // set up water coil int CoilNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Water Heating Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc.loopNum = 1; - PlantUtilities::SetPlantLocationLinks(*state, state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc); - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::CoilModel::HeatingSimple; - state->dataWaterCoils->WaterCoil(CoilNum).availSched = Sched::GetScheduleAlwaysOn(*state); - - state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).UACoil = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; + auto &waterCoil1 = state->dataWaterCoils->WaterCoil(CoilNum); + waterCoil1.Name = "Water Heating Coil"; + waterCoil1.WaterPlantLoc.loopNum = 1; + PlantUtilities::SetPlantLocationLinks(*state, waterCoil1.WaterPlantLoc); + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; + waterCoil1.WaterCoilModel = WaterCoils::CoilModel::HeatingSimple; + waterCoil1.availSched = Sched::GetScheduleAlwaysOn(*state); + + waterCoil1.RequestingAutoSize = true; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.UACoil = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; + waterCoil1.CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; + waterCoil1.WaterInletNodeNum = 1; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -468,18 +473,18 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) // run water coil sizing SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(1.0, waterCoil1.DesAirVolFlowRate); Real64 CpAirStd = 0.0; Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; CpAirStd = PsyCpAirFnW(0.0); - DesMassFlow = state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate * state->dataEnvrn->StdRhoAir; + DesMassFlow = waterCoil1.DesAirVolFlowRate * state->dataEnvrn->StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); // check heating coil design load - EXPECT_DOUBLE_EQ(DesCoilHeatingLoad, state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate); + EXPECT_DOUBLE_EQ(DesCoilHeatingLoad, waterCoil1.DesWaterHeatingCoilRate); Real64 Cp = 0; Real64 rho = 0; @@ -487,13 +492,13 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) Cp = state->dataPlnt->PlantLoop(1).glycol->getSpecificHeat(*state, Constant::HWInitConvTemp, "Unit Test"); rho = state->dataPlnt->PlantLoop(1).glycol->getDensity(*state, Constant::HWInitConvTemp, "Unit Test"); - DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (10.0 * Cp * rho); + DesWaterFlowRate = waterCoil1.DesWaterHeatingCoilRate / (10.0 * Cp * rho); // check heating coil design water flow rate - EXPECT_DOUBLE_EQ(DesWaterFlowRate, state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); + EXPECT_DOUBLE_EQ(DesWaterFlowRate, waterCoil1.MaxWaterVolFlowRate); // check coil UA-value sizing - EXPECT_NEAR(1435.01, state->dataWaterCoils->WaterCoil(CoilNum).UACoil, 0.01); + EXPECT_NEAR(1435.01, waterCoil1.UACoil, 0.01); // test single zone VAV reheat coil sizing state->dataSize->CurZoneEqNum = 1; @@ -502,21 +507,21 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) state->dataSize->TermUnitSizing.allocate(1); state->dataSize->TermUnitFinalZoneSizing.allocate(1); state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).AirVolFlow = - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate / 3.0; // DesAirVolFlowRate = 1.0 + waterCoil1.DesAirVolFlowRate / 3.0; // DesAirVolFlowRate = 1.0 state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).MaxHWVolFlow = - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate / 3.0; + waterCoil1.MaxWaterVolFlowRate / 3.0; state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).MinPriFlowFrac = 0.5; state->dataSize->TermUnitSingDuct = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).UACoil = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.UACoil = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; + waterCoil1.CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; state->dataSize->SysSizingRunDone = false; state->dataSize->ZoneSizingRunDone = true; @@ -543,7 +548,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) SizeWaterCoil(*state, CoilNum); // check coil UA-value sizing - EXPECT_NEAR(577.686, state->dataWaterCoils->WaterCoil(CoilNum).UACoil, 0.01); // smaller UA than result above at 1435.00 + EXPECT_NEAR(577.686, waterCoil1.UACoil, 0.01); // smaller UA than result above at 1435.00 } TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) @@ -583,29 +588,30 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) state->dataSize->FinalSysSizing(1).HeatOAOption = DataSizing::OAControl::AllOA; // set up water coil - int CoilNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Water Heating Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc.loopNum = 1; - PlantUtilities::SetPlantLocationLinks(*state, state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc); - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::CoilModel::HeatingSimple; - state->dataWaterCoils->WaterCoil(CoilNum).availSched = Sched::GetScheduleAlwaysOn(*state); - - state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).UACoil = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; + int CoilNum = 1; + auto &waterCoil1 = state->dataWaterCoils->WaterCoil(CoilNum); + waterCoil1.Name = "Water Heating Coil"; + waterCoil1.WaterPlantLoc.loopNum = 1; + PlantUtilities::SetPlantLocationLinks(*state, waterCoil1.WaterPlantLoc); + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; + waterCoil1.WaterCoilModel = WaterCoils::CoilModel::HeatingSimple; + waterCoil1.availSched = Sched::GetScheduleAlwaysOn(*state); + + waterCoil1.RequestingAutoSize = true; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.UACoil = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; + waterCoil1.CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; + waterCoil1.WaterInletNodeNum = 1; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -620,18 +626,18 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) // run water coil sizing SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(1.0, waterCoil1.DesAirVolFlowRate); Real64 CpAirStd = 0.0; Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; CpAirStd = PsyCpAirFnW(0.0); - DesMassFlow = state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate * state->dataEnvrn->StdRhoAir; + DesMassFlow = waterCoil1.DesAirVolFlowRate * state->dataEnvrn->StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); // check heating coil design load - EXPECT_DOUBLE_EQ(DesCoilHeatingLoad, state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate); + EXPECT_DOUBLE_EQ(DesCoilHeatingLoad, waterCoil1.DesWaterHeatingCoilRate); Real64 Cp = 0; Real64 rho = 0; @@ -639,13 +645,13 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) Cp = state->dataPlnt->PlantLoop(1).glycol->getSpecificHeat(*state, Constant::HWInitConvTemp, "Unit Test"); rho = state->dataPlnt->PlantLoop(1).glycol->getDensity(*state, Constant::HWInitConvTemp, "Unit Test"); - DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (10.0 * Cp * rho); + DesWaterFlowRate = waterCoil1.DesWaterHeatingCoilRate / (10.0 * Cp * rho); // check heating coil design water flow rate - EXPECT_DOUBLE_EQ(DesWaterFlowRate, state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); + EXPECT_DOUBLE_EQ(DesWaterFlowRate, waterCoil1.MaxWaterVolFlowRate); // check coil UA-value sizing - EXPECT_NEAR(1435.01, state->dataWaterCoils->WaterCoil(CoilNum).UACoil, 0.01); + EXPECT_NEAR(1435.01, waterCoil1.UACoil, 0.01); // test single zone VAV reheat coil sizing state->dataSize->CurZoneEqNum = 1; @@ -654,21 +660,21 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) state->dataSize->TermUnitSizing.allocate(1); state->dataSize->TermUnitFinalZoneSizing.allocate(1); state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).AirVolFlow = - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate / 1500.0; // DesAirVolFlowRate = 1.0 so TU air flow = 0.00067 (lower than 0.001) + waterCoil1.DesAirVolFlowRate / 1500.0; // DesAirVolFlowRate = 1.0 so TU air flow = 0.00067 (lower than 0.001) state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).MaxHWVolFlow = - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate / 1500.0; + waterCoil1.MaxWaterVolFlowRate / 1500.0; state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).MinPriFlowFrac = 0.5; state->dataSize->TermUnitSingDuct = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).UACoil = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.UACoil = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; + waterCoil1.CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; state->dataSize->SysSizingRunDone = false; state->dataSize->ZoneSizingRunDone = true; @@ -695,10 +701,10 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) SizeWaterCoil(*state, CoilNum); // water flow rate should be non-zero, and air flow rate being so small will get set to 0 during sizing - EXPECT_GT(state->dataWaterCoils->WaterCoil(CoilNum).InletWaterMassFlowRate, 0.0); - EXPECT_EQ(0.0, state->dataWaterCoils->WaterCoil(CoilNum).InletAirMassFlowRate); + EXPECT_GT(waterCoil1.InletWaterMassFlowRate, 0.0); + EXPECT_EQ(0.0, waterCoil1.InletAirMassFlowRate); // check coil UA-value sizing - EXPECT_NEAR(1.0, state->dataWaterCoils->WaterCoil(CoilNum).UACoil, 0.0001); // TU air flow is too low to size, set to 0, so UA is set to 1.0 + EXPECT_NEAR(1.0, waterCoil1.UACoil, 0.0001); // TU air flow is too low to size, set to 0, so UA is set to 1.0 } TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) @@ -739,28 +745,29 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) // set up water coil int CoilNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Water Heating Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc.loopNum = 1; - PlantUtilities::SetPlantLocationLinks(*state, state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc); - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::CoilModel::HeatingSimple; - state->dataWaterCoils->WaterCoil(CoilNum).availSched = Sched::GetScheduleAlwaysOn(*state); - - state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).UACoil = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; + auto &waterCoil1 = state->dataWaterCoils->WaterCoil(CoilNum); + waterCoil1.Name = "Water Heating Coil"; + waterCoil1.WaterPlantLoc.loopNum = 1; + PlantUtilities::SetPlantLocationLinks(*state, waterCoil1.WaterPlantLoc); + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; + waterCoil1.WaterCoilModel = WaterCoils::CoilModel::HeatingSimple; + waterCoil1.availSched = Sched::GetScheduleAlwaysOn(*state); + + waterCoil1.RequestingAutoSize = true; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.UACoil = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; + waterCoil1.CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; + waterCoil1.WaterInletNodeNum = 1; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -776,18 +783,18 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) // run water coil sizing SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(1.0, waterCoil1.DesAirVolFlowRate); Real64 CpAirStd = 0.0; Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; CpAirStd = PsyCpAirFnW(0.0); - DesMassFlow = state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate * state->dataEnvrn->StdRhoAir; + DesMassFlow = waterCoil1.DesAirVolFlowRate * state->dataEnvrn->StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); // check heating coil design load - EXPECT_DOUBLE_EQ(DesCoilHeatingLoad, state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate); + EXPECT_DOUBLE_EQ(DesCoilHeatingLoad, waterCoil1.DesWaterHeatingCoilRate); Real64 Cp = 0; Real64 rho = 0; @@ -795,17 +802,17 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) Cp = state->dataPlnt->PlantLoop(1).glycol->getSpecificHeat(*state, Constant::HWInitConvTemp, "Unit Test"); rho = state->dataPlnt->PlantLoop(1).glycol->getDensity(*state, Constant::HWInitConvTemp, "Unit Test"); - DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (10.0 * Cp * rho); + DesWaterFlowRate = waterCoil1.DesWaterHeatingCoilRate / (10.0 * Cp * rho); // check heating coil design water flow rate - EXPECT_DOUBLE_EQ(DesWaterFlowRate, state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); + EXPECT_DOUBLE_EQ(DesWaterFlowRate, waterCoil1.MaxWaterVolFlowRate); // check coil UA-value sizing for low design loop exit temp - EXPECT_NEAR(2479.27, state->dataWaterCoils->WaterCoil(CoilNum).UACoil, 0.01); + EXPECT_NEAR(2479.27, waterCoil1.UACoil, 0.01); Real64 DesCoilInletWaterTempUsed = 0.0; HVAC::FanOp fanOp = HVAC::FanOp::Continuous; - Real64 UAMax = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate; + Real64 UAMax = waterCoil1.DesWaterHeatingCoilRate; // check if coil design inlet water temperature is increased above the plant loop exit temp EstimateCoilInletWaterTemp(*state, CoilNum, fanOp, 1.0, UAMax, DesCoilInletWaterTempUsed); @@ -852,28 +859,29 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) // set up water coil int CoilNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Simple Water Cooling Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc.loopNum = 1; - PlantUtilities::SetPlantLocationLinks(*state, state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc); - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::CoilModel::CoolingSimple; - - state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; - - state->dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp = 6.67; - state->dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp = true; + auto &waterCoil1 = state->dataWaterCoils->WaterCoil(CoilNum); + waterCoil1.Name = "Test Simple Water Cooling Coil"; + waterCoil1.WaterPlantLoc.loopNum = 1; + PlantUtilities::SetPlantLocationLinks(*state, waterCoil1.WaterPlantLoc); + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; + waterCoil1.WaterCoilModel = WaterCoils::CoilModel::CoolingSimple; + + waterCoil1.RequestingAutoSize = true; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; + + waterCoil1.DesignWaterDeltaTemp = 6.67; + waterCoil1.UseDesignWaterDeltaTemp = true; state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(1) = "Design Water Flow Rate"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; + waterCoil1.WaterInletNodeNum = 1; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -886,7 +894,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) // run water coil sizing SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(1.0, waterCoil1.DesAirVolFlowRate); Real64 DesCoilCoolingLoad = 0.0; Real64 CoilInEnth = 0.0; @@ -894,10 +902,10 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) CoilInEnth = PsyHFnTdbW(20.0, 0.01); CoilOutEnth = PsyHFnTdbW(10.0, 0.0085); - DesCoilCoolingLoad = state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate * state->dataEnvrn->StdRhoAir * (CoilInEnth - CoilOutEnth); + DesCoilCoolingLoad = waterCoil1.DesAirVolFlowRate * state->dataEnvrn->StdRhoAir * (CoilInEnth - CoilOutEnth); // check cooling coil design load - EXPECT_DOUBLE_EQ(DesCoilCoolingLoad, state->dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate); + EXPECT_DOUBLE_EQ(DesCoilCoolingLoad, waterCoil1.DesWaterCoolingCoilRate); Real64 Cp = 0; Real64 rho = 0; @@ -905,11 +913,11 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) Cp = state->dataPlnt->PlantLoop(1).glycol->getSpecificHeat(*state, Constant::CWInitConvTemp, "Unit Test"); rho = state->dataPlnt->PlantLoop(1).glycol->getDensity(*state, Constant::CWInitConvTemp, "Unit Test"); - DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate / - (state->dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp * Cp * rho); + DesWaterFlowRate = waterCoil1.DesWaterCoolingCoilRate / + (waterCoil1.DesignWaterDeltaTemp * Cp * rho); // check cooling coil design water flow rate - EXPECT_DOUBLE_EQ(DesWaterFlowRate, state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); + EXPECT_DOUBLE_EQ(DesWaterFlowRate, waterCoil1.MaxWaterVolFlowRate); } TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) @@ -951,44 +959,45 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) // set up water coil int CoilNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Detailed Water Cooling Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc.loopNum = 1; - PlantUtilities::SetPlantLocationLinks(*state, state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc); - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::CoilModel::CoolingDetailed; - - state->dataWaterCoils->WaterCoil(CoilNum).TubeOutsideSurfArea = 6.23816; - state->dataWaterCoils->WaterCoil(CoilNum).TotTubeInsideArea = 6.20007018; - state->dataWaterCoils->WaterCoil(CoilNum).FinSurfArea = 101.7158224; - state->dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea = 0.810606367; - state->dataWaterCoils->WaterCoil(CoilNum).CoilDepth = 0.165097968; - state->dataWaterCoils->WaterCoil(CoilNum).FinDiam = 0.43507152; - state->dataWaterCoils->WaterCoil(CoilNum).FinThickness = 0.001499982; - state->dataWaterCoils->WaterCoil(CoilNum).TubeInsideDiam = 0.014449958; - state->dataWaterCoils->WaterCoil(CoilNum).TubeOutsideDiam = 0.015879775; - state->dataWaterCoils->WaterCoil(CoilNum).TubeThermConductivity = 385.764854; - state->dataWaterCoils->WaterCoil(CoilNum).FinThermConductivity = 203.882537; - state->dataWaterCoils->WaterCoil(CoilNum).FinSpacing = 0.001814292; - state->dataWaterCoils->WaterCoil(CoilNum).TubeDepthSpacing = 0.02589977; - state->dataWaterCoils->WaterCoil(CoilNum).NumOfTubeRows = 6; - state->dataWaterCoils->WaterCoil(CoilNum).NumOfTubesPerRow = 16; - state->dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp = 6.67; - state->dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp = true; - - state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; + auto &waterCoil1 = state->dataWaterCoils->WaterCoil(CoilNum); + waterCoil1.Name = "Test Detailed Water Cooling Coil"; + waterCoil1.WaterPlantLoc.loopNum = 1; + PlantUtilities::SetPlantLocationLinks(*state, waterCoil1.WaterPlantLoc); + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; + waterCoil1.WaterCoilModel = WaterCoils::CoilModel::CoolingDetailed; + + waterCoil1.TubeOutsideSurfArea = 6.23816; + waterCoil1.TotTubeInsideArea = 6.20007018; + waterCoil1.FinSurfArea = 101.7158224; + waterCoil1.MinAirFlowArea = 0.810606367; + waterCoil1.CoilDepth = 0.165097968; + waterCoil1.FinDiam = 0.43507152; + waterCoil1.FinThickness = 0.001499982; + waterCoil1.TubeInsideDiam = 0.014449958; + waterCoil1.TubeOutsideDiam = 0.015879775; + waterCoil1.TubeThermConductivity = 385.764854; + waterCoil1.FinThermConductivity = 203.882537; + waterCoil1.FinSpacing = 0.001814292; + waterCoil1.TubeDepthSpacing = 0.02589977; + waterCoil1.NumOfTubeRows = 6; + waterCoil1.NumOfTubesPerRow = 16; + waterCoil1.DesignWaterDeltaTemp = 6.67; + waterCoil1.UseDesignWaterDeltaTemp = true; + + waterCoil1.RequestingAutoSize = true; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(1) = "Design Water Flow Rate"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; + waterCoil1.WaterInletNodeNum = 1; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -1000,7 +1009,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) // run water coil sizing SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(1.0, waterCoil1.DesAirVolFlowRate); Real64 DesCoilCoolingLoad = 0.0; Real64 CoilInEnth = 0.0; @@ -1008,9 +1017,9 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) CoilInEnth = PsyHFnTdbW(state->dataSize->FinalSysSizing(1).MixTempAtCoolPeak, state->dataSize->FinalSysSizing(1).MixHumRatAtCoolPeak); CoilOutEnth = PsyHFnTdbW(state->dataSize->FinalSysSizing(1).CoolSupTemp, state->dataSize->FinalSysSizing(1).CoolSupHumRat); - DesCoilCoolingLoad = state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate * state->dataEnvrn->StdRhoAir * (CoilInEnth - CoilOutEnth); + DesCoilCoolingLoad = waterCoil1.DesAirVolFlowRate * state->dataEnvrn->StdRhoAir * (CoilInEnth - CoilOutEnth); // check cooling coil design load - EXPECT_DOUBLE_EQ(DesCoilCoolingLoad, state->dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate); + EXPECT_DOUBLE_EQ(DesCoilCoolingLoad, waterCoil1.DesWaterCoolingCoilRate); Real64 Cp = 0; Real64 rho = 0; @@ -1018,9 +1027,9 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) Cp = state->dataPlnt->PlantLoop(1).glycol->getSpecificHeat(*state, Constant::CWInitConvTemp, "Unit Test"); rho = state->dataPlnt->PlantLoop(1).glycol->getDensity(*state, Constant::CWInitConvTemp, "Unit Test"); - DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate / (6.67 * Cp * rho); + DesWaterFlowRate = waterCoil1.DesWaterCoolingCoilRate / (6.67 * Cp * rho); // check cooling coil design water flow rate - EXPECT_DOUBLE_EQ(DesWaterFlowRate, state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); + EXPECT_DOUBLE_EQ(DesWaterFlowRate, waterCoil1.MaxWaterVolFlowRate); } TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) @@ -1060,57 +1069,61 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) // set up water coil int CoilNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Detailed Water Cooling Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).availSched = Sched::GetScheduleAlwaysOff(*state); - - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::CoilModel::CoolingDetailed; - - state->dataWaterCoils->WaterCoil(CoilNum).TubeOutsideSurfArea = 6.23816; - state->dataWaterCoils->WaterCoil(CoilNum).TotTubeInsideArea = 6.20007018; - state->dataWaterCoils->WaterCoil(CoilNum).FinSurfArea = 101.7158224; - state->dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea = 0.810606367; - state->dataWaterCoils->WaterCoil(CoilNum).CoilDepth = 0.165097968; - state->dataWaterCoils->WaterCoil(CoilNum).FinDiam = 0.43507152; - state->dataWaterCoils->WaterCoil(CoilNum).FinThickness = 0.001499982; - state->dataWaterCoils->WaterCoil(CoilNum).TubeInsideDiam = 0.014449958; - state->dataWaterCoils->WaterCoil(CoilNum).TubeOutsideDiam = 0.015879775; - state->dataWaterCoils->WaterCoil(CoilNum).TubeThermConductivity = 385.764854; - state->dataWaterCoils->WaterCoil(CoilNum).FinThermConductivity = 203.882537; - state->dataWaterCoils->WaterCoil(CoilNum).FinSpacing = 0.001814292; - state->dataWaterCoils->WaterCoil(CoilNum).TubeDepthSpacing = 0.02589977; - state->dataWaterCoils->WaterCoil(CoilNum).NumOfTubeRows = 6; - state->dataWaterCoils->WaterCoil(CoilNum).NumOfTubesPerRow = 16; - state->dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp = 6.67; - state->dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp = true; - - state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; + auto &waterCoil1 = state->dataWaterCoils->WaterCoil(CoilNum); + waterCoil1.Name = "Test Detailed Water Cooling Coil"; + waterCoil1.coilType = HVAC::CoilType::CoolingWaterDetailed; + waterCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, waterCoil1.Name, waterCoil1.coilType); + + waterCoil1.availSched = Sched::GetScheduleAlwaysOff(*state); + + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; + waterCoil1.WaterCoilModel = WaterCoils::CoilModel::CoolingDetailed; + + waterCoil1.TubeOutsideSurfArea = 6.23816; + waterCoil1.TotTubeInsideArea = 6.20007018; + waterCoil1.FinSurfArea = 101.7158224; + waterCoil1.MinAirFlowArea = 0.810606367; + waterCoil1.CoilDepth = 0.165097968; + waterCoil1.FinDiam = 0.43507152; + waterCoil1.FinThickness = 0.001499982; + waterCoil1.TubeInsideDiam = 0.014449958; + waterCoil1.TubeOutsideDiam = 0.015879775; + waterCoil1.TubeThermConductivity = 385.764854; + waterCoil1.FinThermConductivity = 203.882537; + waterCoil1.FinSpacing = 0.001814292; + waterCoil1.TubeDepthSpacing = 0.02589977; + waterCoil1.NumOfTubeRows = 6; + waterCoil1.NumOfTubesPerRow = 16; + waterCoil1.DesignWaterDeltaTemp = 6.67; + waterCoil1.UseDesignWaterDeltaTemp = true; + + waterCoil1.RequestingAutoSize = true; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(1) = "Design Water Flow Rate"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).WaterOutletNodeNum = 2; - state->dataWaterCoils->WaterCoil(CoilNum).AirInletNodeNum = 3; - state->dataWaterCoils->WaterCoil(CoilNum).AirOutletNodeNum = 4; - state->dataWaterCoils->WaterCoil(1).WaterPlantLoc.loopNum = 1; - state->dataWaterCoils->WaterCoil(1).WaterPlantLoc.loopSideNum = DataPlant::LoopSideLocation::Demand; - state->dataWaterCoils->WaterCoil(1).WaterPlantLoc.branchNum = 1; - state->dataWaterCoils->WaterCoil(1).WaterPlantLoc.compNum = 1; - PlantUtilities::SetPlantLocationLinks(*state, state->dataWaterCoils->WaterCoil(1).WaterPlantLoc); - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = state->dataWaterCoils->WaterCoil(1).Name; + waterCoil1.WaterInletNodeNum = 1; + waterCoil1.WaterOutletNodeNum = 2; + waterCoil1.AirInletNodeNum = 3; + waterCoil1.AirOutletNodeNum = 4; + waterCoil1.WaterPlantLoc.loopNum = 1; + waterCoil1.WaterPlantLoc.loopSideNum = DataPlant::LoopSideLocation::Demand; + waterCoil1.WaterPlantLoc.branchNum = 1; + waterCoil1.WaterPlantLoc.compNum = 1; + PlantUtilities::SetPlantLocationLinks(*state, waterCoil1.WaterPlantLoc); + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = waterCoil1.Name; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataWaterCoils->WaterCoil(1).WaterInletNodeNum; + waterCoil1.WaterInletNodeNum; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = - state->dataWaterCoils->WaterCoil(1).WaterOutletNodeNum; + waterCoil1.WaterOutletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -1124,7 +1137,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) // run water coil sizing SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(1.0, waterCoil1.DesAirVolFlowRate); Real64 DesCoilCoolingLoad = 0.0; Real64 CoilInEnth = 0.0; @@ -1132,9 +1145,9 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) CoilInEnth = PsyHFnTdbW(state->dataSize->FinalSysSizing(1).MixTempAtCoolPeak, state->dataSize->FinalSysSizing(1).MixHumRatAtCoolPeak); CoilOutEnth = PsyHFnTdbW(state->dataSize->FinalSysSizing(1).CoolSupTemp, state->dataSize->FinalSysSizing(1).CoolSupHumRat); - DesCoilCoolingLoad = state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate * state->dataEnvrn->StdRhoAir * (CoilInEnth - CoilOutEnth); + DesCoilCoolingLoad = waterCoil1.DesAirVolFlowRate * state->dataEnvrn->StdRhoAir * (CoilInEnth - CoilOutEnth); // check cooling coil design load - EXPECT_DOUBLE_EQ(DesCoilCoolingLoad, state->dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate); + EXPECT_DOUBLE_EQ(DesCoilCoolingLoad, waterCoil1.DesWaterCoolingCoilRate); Real64 Cp = 0; Real64 rho = 0; @@ -1142,9 +1155,9 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) Cp = state->dataPlnt->PlantLoop(1).glycol->getSpecificHeat(*state, Constant::CWInitConvTemp, "Unit Test"); rho = state->dataPlnt->PlantLoop(1).glycol->getDensity(*state, Constant::CWInitConvTemp, "Unit Test"); - DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterCoolingCoilRate / (6.67 * Cp * rho); + DesWaterFlowRate = waterCoil1.DesWaterCoolingCoilRate / (6.67 * Cp * rho); // check cooling coil design water flow rate - EXPECT_DOUBLE_EQ(DesWaterFlowRate, state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); + EXPECT_DOUBLE_EQ(DesWaterFlowRate, waterCoil1.MaxWaterVolFlowRate); state->dataLoopNodes->Node.allocate(10); @@ -1152,24 +1165,24 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) // Force getting the warning Real64 PartLoadRatio = 1.0; - Real64 TempAirIn = state->dataWaterCoils->WaterCoil(CoilNum).InletAirTemp; - Real64 InletAirHumRat = state->dataWaterCoils->WaterCoil(CoilNum).InletAirHumRat; - Real64 TempWaterIn = state->dataWaterCoils->WaterCoil(CoilNum).InletWaterTemp; + Real64 TempAirIn = waterCoil1.InletAirTemp; + Real64 InletAirHumRat = waterCoil1.InletAirHumRat; + Real64 TempWaterIn = waterCoil1.InletWaterTemp; Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, TempAirIn, InletAirHumRat, "RoutineName"); - Real64 MinAirMassFlow = 5.0 * state->dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea * AirDensity; - state->dataWaterCoils->WaterCoil(CoilNum).InletAirMassFlowRate = 1.1 * MinAirMassFlow; - Real64 AirMassFlow = state->dataWaterCoils->WaterCoil(CoilNum).InletAirMassFlowRate / PartLoadRatio; + Real64 MinAirMassFlow = 5.0 * waterCoil1.MinAirFlowArea * AirDensity; + waterCoil1.InletAirMassFlowRate = 1.1 * MinAirMassFlow; + Real64 AirMassFlow = waterCoil1.InletAirMassFlowRate / PartLoadRatio; - EXPECT_EQ(0.81060636699999999, state->dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea); + EXPECT_EQ(0.81060636699999999, waterCoil1.MinAirFlowArea); std::string expected_error = delimited_string({ EnergyPlus::format(" ** Warning ** Version: missing in IDF, processing for EnergyPlus version=\"{}\"", DataStringGlobals::MatchVersion), " ** Warning ** Coil:Cooling:Water:DetailedGeometry in Coil =Test Detailed Water Cooling Coil", " ** ~~~ ** Air Flow Rate Velocity has greatly exceeded upper design guidelines of ~2.5 m/s", - EnergyPlus::format(" ** ~~~ ** Air Mass Flow Rate[kg/s]={:.6T}", state->dataWaterCoils->WaterCoil(CoilNum).InletAirMassFlowRate), + EnergyPlus::format(" ** ~~~ ** Air Mass Flow Rate[kg/s]={:.6T}", waterCoil1.InletAirMassFlowRate), EnergyPlus::format(" ** ~~~ ** Air Face Velocity[m/s]={:.6T}", - AirMassFlow / (state->dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea * AirDensity)), + AirMassFlow / (waterCoil1.MinAirFlowArea * AirDensity)), EnergyPlus::format(" ** ~~~ ** Approximate Mass Flow Rate limit for Face Area[kg/s]={:.6T}", - 2.5 * state->dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea * AirDensity), + 2.5 * waterCoil1.MinAirFlowArea * AirDensity), " ** ~~~ ** Coil:Cooling:Water:DetailedGeometry could be resized/autosized to handle capacity", }); @@ -1177,23 +1190,23 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) compare_err_stream(expected_error, true); - AirMassFlow = state->dataWaterCoils->WaterCoil(CoilNum).InletAirMassFlowRate / PartLoadRatio; - TempAirIn = state->dataWaterCoils->WaterCoil(CoilNum).InletAirTemp; - InletAirHumRat = state->dataWaterCoils->WaterCoil(CoilNum).InletAirHumRat; - TempWaterIn = state->dataWaterCoils->WaterCoil(CoilNum).InletWaterTemp; + AirMassFlow = waterCoil1.InletAirMassFlowRate / PartLoadRatio; + TempAirIn = waterCoil1.InletAirTemp; + InletAirHumRat = waterCoil1.InletAirHumRat; + TempWaterIn = waterCoil1.InletWaterTemp; AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(*state, state->dataEnvrn->OutBaroPress, TempAirIn, InletAirHumRat, "RoutineName"); - MinAirMassFlow = 44.7 * state->dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea * AirDensity; - state->dataWaterCoils->WaterCoil(CoilNum).InletAirMassFlowRate = 1.1 * MinAirMassFlow; - AirMassFlow = state->dataWaterCoils->WaterCoil(CoilNum).InletAirMassFlowRate / PartLoadRatio; + MinAirMassFlow = 44.7 * waterCoil1.MinAirFlowArea * AirDensity; + waterCoil1.InletAirMassFlowRate = 1.1 * MinAirMassFlow; + AirMassFlow = waterCoil1.InletAirMassFlowRate / PartLoadRatio; std::string expected_fatal_error = delimited_string({ " ** Severe ** Coil:Cooling:Water:DetailedGeometry in Coil =Test Detailed Water Cooling Coil", " ** ~~~ ** Air Flow Rate Velocity is > 100MPH (44.7m/s) and simulation cannot continue", - EnergyPlus::format(" ** ~~~ ** Air Mass Flow Rate[kg/s]={:.6T}", state->dataWaterCoils->WaterCoil(CoilNum).InletAirMassFlowRate), + EnergyPlus::format(" ** ~~~ ** Air Mass Flow Rate[kg/s]={:.6T}", waterCoil1.InletAirMassFlowRate), EnergyPlus::format(" ** ~~~ ** Air Face Velocity[m/s]={:.6T}", - AirMassFlow / (state->dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea * AirDensity)), + AirMassFlow / (waterCoil1.MinAirFlowArea * AirDensity)), EnergyPlus::format(" ** ~~~ ** Approximate Mass Flow Rate limit for Face Area[kg/s]={:.6T}", - 44.7 * state->dataWaterCoils->WaterCoil(CoilNum).MinAirFlowArea * AirDensity), + 44.7 * waterCoil1.MinAirFlowArea * AirDensity), " ** Fatal ** Coil:Cooling:Water:DetailedGeometry needs to be resized/autosized to handle capacity", " ...Summary of Errors that led to program termination:", " ..... Reference severe error count=1", @@ -1242,28 +1255,29 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) // set up water coil int CoilNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Test Simple Water Heating Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc.loopNum = 1; - PlantUtilities::SetPlantLocationLinks(*state, state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc); - - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::CoilModel::HeatingSimple; - state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; - - state->dataWaterCoils->WaterCoil(CoilNum).DesignWaterDeltaTemp = 11.0; - state->dataWaterCoils->WaterCoil(CoilNum).UseDesignWaterDeltaTemp = true; + auto &waterCoil1 = state->dataWaterCoils->WaterCoil(CoilNum); + waterCoil1.Name = "Test Simple Water Heating Coil"; + waterCoil1.WaterPlantLoc.loopNum = 1; + PlantUtilities::SetPlantLocationLinks(*state, waterCoil1.WaterPlantLoc); + + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; + waterCoil1.WaterCoilModel = WaterCoils::CoilModel::HeatingSimple; + waterCoil1.RequestingAutoSize = true; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; + + waterCoil1.DesignWaterDeltaTemp = 11.0; + waterCoil1.UseDesignWaterDeltaTemp = true; state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; + waterCoil1.WaterInletNodeNum = 1; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -1276,7 +1290,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) // run water coil sizing SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(1.0, waterCoil1.DesAirVolFlowRate); Real64 CpAirStd = 0.0; Real64 DesMassFlow = 0.0; @@ -1287,7 +1301,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); // check heating coil design load - EXPECT_DOUBLE_EQ(DesCoilHeatingLoad, state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate); + EXPECT_DOUBLE_EQ(DesCoilHeatingLoad, waterCoil1.DesWaterHeatingCoilRate); Real64 Cp = 0; Real64 rho = 0; @@ -1295,10 +1309,10 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) Cp = state->dataPlnt->PlantLoop(1).glycol->getSpecificHeat(*state, Constant::HWInitConvTemp, "Unit Test"); rho = state->dataPlnt->PlantLoop(1).glycol->getDensity(*state, Constant::HWInitConvTemp, "Unit Test"); - DesWaterFlowRate = state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate / (11.0 * Cp * rho); + DesWaterFlowRate = waterCoil1.DesWaterHeatingCoilRate / (11.0 * Cp * rho); // check heating coil design water flow rate - EXPECT_DOUBLE_EQ(DesWaterFlowRate, state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); + EXPECT_DOUBLE_EQ(DesWaterFlowRate, waterCoil1.MaxWaterVolFlowRate); } TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) { @@ -1337,28 +1351,31 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) // set up water coil int CoilNum = 1; - state->dataWaterCoils->WaterCoil(CoilNum).Name = "Water Heating Coil"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc.loopNum = 1; - PlantUtilities::SetPlantLocationLinks(*state, state->dataWaterCoils->WaterCoil(CoilNum).WaterPlantLoc); - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilModel = WaterCoils::CoilModel::HeatingSimple; - state->dataWaterCoils->WaterCoil(CoilNum).WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; - state->dataWaterCoils->WaterCoil(CoilNum).availSched = Sched::GetScheduleAlwaysOn(*state); - - state->dataWaterCoils->WaterCoil(CoilNum).RequestingAutoSize = true; - state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).UACoil = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletWaterTemp = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesInletAirHumRat = AutoSize; - state->dataWaterCoils->WaterCoil(CoilNum).DesOutletAirHumRat = AutoSize; + auto &waterCoil1 = state->dataWaterCoils->WaterCoil(CoilNum); + waterCoil1.Name = "Water Heating Coil"; + waterCoil1.coilType = HVAC::CoilType::HeatingWater; + waterCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, waterCoil1.Name, waterCoil1.coilType); + waterCoil1.WaterPlantLoc.loopNum = 1; + PlantUtilities::SetPlantLocationLinks(*state, waterCoil1.WaterPlantLoc); + waterCoil1.WaterCoilModel = WaterCoils::CoilModel::HeatingSimple; + waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterSimpleHeating; + waterCoil1.availSched = Sched::GetScheduleAlwaysOn(*state); + + waterCoil1.RequestingAutoSize = true; + waterCoil1.DesAirVolFlowRate = AutoSize; + waterCoil1.UACoil = AutoSize; + waterCoil1.MaxWaterVolFlowRate = AutoSize; + waterCoil1.CoilPerfInpMeth = state->dataWaterCoils->UAandFlow; + waterCoil1.DesInletAirTemp = AutoSize; + waterCoil1.DesOutletAirTemp = AutoSize; + waterCoil1.DesInletWaterTemp = AutoSize; + waterCoil1.DesInletAirHumRat = AutoSize; + waterCoil1.DesOutletAirHumRat = AutoSize; state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum = 1; + waterCoil1.WaterInletNodeNum = 1; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataWaterCoils->WaterCoil(CoilNum).WaterInletNodeNum; + waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -1374,18 +1391,18 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) // run water coil sizing SizeWaterCoil(*state, CoilNum); - EXPECT_DOUBLE_EQ(1.0, state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate); + EXPECT_DOUBLE_EQ(1.0, waterCoil1.DesAirVolFlowRate); Real64 CpAirStd(0.0); Real64 DesMassFlow(0.0); Real64 DesCoilHeatingLoad(0.0); CpAirStd = PsyCpAirFnW(0.0); - DesMassFlow = state->dataWaterCoils->WaterCoil(CoilNum).DesAirVolFlowRate * state->dataEnvrn->StdRhoAir; + DesMassFlow = waterCoil1.DesAirVolFlowRate * state->dataEnvrn->StdRhoAir; DesCoilHeatingLoad = DesMassFlow * CpAirStd * (40.0 - 5.0); // check heating coil design load - EXPECT_DOUBLE_EQ(DesCoilHeatingLoad, state->dataWaterCoils->WaterCoil(CoilNum).DesWaterHeatingCoilRate); + EXPECT_DOUBLE_EQ(DesCoilHeatingLoad, waterCoil1.DesWaterHeatingCoilRate); Real64 Cp(0.0); Real64 rho(0.0); @@ -1397,7 +1414,7 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) DesWaterFlowRate = DesCoilHeatingLoad / (state->dataSize->PlantSizData(1).DeltaT * Cp * rho); // check heating coil design water flow rate calculated here and sizing results are identical - EXPECT_DOUBLE_EQ(DesWaterFlowRate, state->dataWaterCoils->WaterCoil(CoilNum).MaxWaterVolFlowRate); + EXPECT_DOUBLE_EQ(DesWaterFlowRate, waterCoil1.MaxWaterVolFlowRate); } TEST_F(WaterCoilsTest, FanCoilCoolingWaterFlowTest) diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc index 807931398e7..13707b39140 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc @@ -64,6 +64,7 @@ #include #include #include +#include #include using namespace EnergyPlus; @@ -95,13 +96,17 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) state->dataSize->DesDayWeath.allocate(1); state->dataSize->DesDayWeath(1).Temp.allocate(24); - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPType = WatertoAirHP::Cooling; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedAirVolFlowRate = AutoSize; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal = AutoSize; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens = AutoSize; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedWaterVolFlowRate = 0.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum = 1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterOutletNodeNum = 2; + auto &wahpSimple1 = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum); + wahpSimple1.WAHPType = WatertoAirHP::Cooling; + wahpSimple1.coilType = HVAC::CoilType::CoolingWAHPSimple; + wahpSimple1.coilReportNum = ReportCoilSelection::getReportIndex(*state, wahpSimple1.Name, wahpSimple1.coilType); + + wahpSimple1.RatedAirVolFlowRate = AutoSize; + wahpSimple1.RatedCapCoolTotal = AutoSize; + wahpSimple1.RatedCapCoolSens = AutoSize; + wahpSimple1.RatedWaterVolFlowRate = 0.0; + wahpSimple1.WaterInletNodeNum = 1; + wahpSimple1.WaterOutletNodeNum = 2; state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).DesCoolVolFlow = 0.20; state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).DesHeatVolFlow = 0.20; @@ -167,11 +172,11 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) curve3->inputLimits[3].max = 38; // performance curve coefficients - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCapCurve = curve1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCapCurve = curve2; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPowCurve = curve3; + wahpSimple1.TotalCoolCapCurve = curve1; + wahpSimple1.SensCoolCapCurve = curve2; + wahpSimple1.CoolPowCurve = curve3; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCOPCoolAtRatedCdts = 5.12; + wahpSimple1.RatedCOPCoolAtRatedCdts = 5.12; state->dataSize->DesDayWeath(1).Temp(15) = 32.0; state->dataEnvrn->StdBaroPress = 101325.0; @@ -190,13 +195,13 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name; + wahpSimple1.Name; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type = - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WAHPPlantType; + wahpSimple1.WAHPPlantType; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).plantLoc.loopNum = 1; - PlantUtilities::SetPlantLocationLinks(*state, state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).plantLoc); + wahpSimple1.WaterInletNodeNum; + wahpSimple1.plantLoc.loopNum = 1; + PlantUtilities::SetPlantLocationLinks(*state, wahpSimple1.plantLoc); // plant loop design leaving water temperature (design entering water temperature for WAHP coil) state->dataSize->PlantSizData.allocate(1); @@ -208,14 +213,14 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) EXPECT_DOUBLE_EQ(0.0075, state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).CoolDesHumRat); // check that the total cooling capacity is >= the sensible cooling capacity - EXPECT_GE(state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal, - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens); + EXPECT_GE(wahpSimple1.RatedCapCoolTotal, + wahpSimple1.RatedCapCoolSens); - if (state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal != 0.0) { + if (wahpSimple1.RatedCapCoolTotal != 0.0) { ShowMessage(*state, format("SizeHVACWaterToAir: Rated Sensible Heat Ratio = {:.2R} [-]", - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens / - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal)); + wahpSimple1.RatedCapCoolSens / + wahpSimple1.RatedCapCoolTotal)); } EXPECT_TRUE(compare_eio_stream_substring("Design Size Rated Air Flow Rate", false)); EXPECT_TRUE(compare_eio_stream_substring("Design Size Rated Total Cooling Capacity", false)); @@ -1111,32 +1116,38 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAirRatedCo state->dataSize->DesDayWeath.allocate(1); state->dataSize->DesDayWeath(1).Temp.allocate(24); - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).WAHPType = WatertoAirHP::Cooling; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedAirVolFlowRate = AutoSize; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedCapCoolTotal = AutoSize; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedCapCoolSens = AutoSize; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedWaterVolFlowRate = AutoSize; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).WaterInletNodeNum = 1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).WaterOutletNodeNum = 2; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedEntWaterTemp = 30.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedEntAirWetbulbTemp = 19.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedEntAirDrybulbTemp = 27.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).CompanionHeatingCoilNum = 2; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).availSched = Sched::GetScheduleAlwaysOn(*state); - - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).WAHPType = WatertoAirHP::Heating; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatedAirVolFlowRate = AutoSize; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatedCapHeat = AutoSize; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatedWaterVolFlowRate = AutoSize; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).WaterInletNodeNum = 3; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).WaterOutletNodeNum = 4; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatedEntWaterTemp = 20.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatedEntAirDrybulbTemp = 20.0; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).CompanionCoolingCoilNum = 1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatioRatedHeatRatedTotCoolCap = 1.23; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).availSched = Sched::GetScheduleAlwaysOn(*state); + auto &wahpSimple1 = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1); + wahpSimple1.WAHPType = WatertoAirHP::Cooling; + wahpSimple1.coilType = HVAC::CoilType::CoolingWAHPSimple; + wahpSimple1.coilReportNum = ReportCoilSelection::getReportIndex(*state, wahpSimple1.Name, wahpSimple1.coilType); + wahpSimple1.RatedAirVolFlowRate = AutoSize; + wahpSimple1.RatedCapCoolTotal = AutoSize; + wahpSimple1.RatedCapCoolSens = AutoSize; + wahpSimple1.RatedWaterVolFlowRate = AutoSize; + wahpSimple1.WaterInletNodeNum = 1; + wahpSimple1.WaterOutletNodeNum = 2; + wahpSimple1.RatedEntWaterTemp = 30.0; + wahpSimple1.RatedEntAirWetbulbTemp = 19.0; + wahpSimple1.RatedEntAirDrybulbTemp = 27.0; + wahpSimple1.CompanionHeatingCoilNum = 2; + wahpSimple1.WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPCoolingEquationFit; + wahpSimple1.availSched = Sched::GetScheduleAlwaysOn(*state); + + auto &wahpSimple2 = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2); + wahpSimple2.WAHPType = WatertoAirHP::Heating; + wahpSimple2.coilType = HVAC::CoilType::HeatingWAHPSimple; + wahpSimple2.coilReportNum = ReportCoilSelection::getReportIndex(*state, wahpSimple2.Name, wahpSimple2.coilType); + wahpSimple2.RatedAirVolFlowRate = AutoSize; + wahpSimple2.RatedCapHeat = AutoSize; + wahpSimple2.RatedWaterVolFlowRate = AutoSize; + wahpSimple2.WaterInletNodeNum = 3; + wahpSimple2.WaterOutletNodeNum = 4; + wahpSimple2.RatedEntWaterTemp = 20.0; + wahpSimple2.RatedEntAirDrybulbTemp = 20.0; + wahpSimple2.CompanionCoolingCoilNum = 1; + wahpSimple2.WAHPPlantType = DataPlant::PlantEquipmentType::CoilWAHPHeatingEquationFit; + wahpSimple2.RatioRatedHeatRatedTotCoolCap = 1.23; + wahpSimple2.availSched = Sched::GetScheduleAlwaysOn(*state); state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).DesCoolVolFlow = 0.20; state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).DesHeatVolFlow = 0.20; @@ -1240,14 +1251,14 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAirRatedCo curve5->inputLimits[3].max = 38; // performance curve coefficients - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).TotalCoolCapCurve = curve1; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).SensCoolCapCurve = curve2; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).CoolPowCurve = curve3; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).HeatCapCurve = curve4; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).HeatPowCurve = curve5; + wahpSimple1.TotalCoolCapCurve = curve1; + wahpSimple1.SensCoolCapCurve = curve2; + wahpSimple1.CoolPowCurve = curve3; + wahpSimple2.HeatCapCurve = curve4; + wahpSimple2.HeatPowCurve = curve5; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1).RatedCOPCoolAtRatedCdts = 5.12; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2).RatedCOPHeatAtRatedCdts = 3.0; + wahpSimple1.RatedCOPCoolAtRatedCdts = 5.12; + wahpSimple2.RatedCOPHeatAtRatedCdts = 3.0; state->dataSize->DesDayWeath(1).Temp(15) = 32.0; state->dataEnvrn->StdBaroPress = 101325.0; @@ -1270,14 +1281,12 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAirRatedCo branch.TotalComponents = 2; branch.Comp.allocate(2); - auto &wahpSimple1 = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1); branch.Comp(1).Name = wahpSimple1.Name; branch.Comp(1).Type = wahpSimple1.WAHPPlantType; branch.Comp(1).NodeNumIn = wahpSimple1.WaterInletNodeNum; wahpSimple1.plantLoc.loopNum = 1; PlantUtilities::SetPlantLocationLinks(*state, wahpSimple1.plantLoc); - auto &wahpSimple2 = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2); branch.Comp(2).Name = wahpSimple2.Name; branch.Comp(2).Type = wahpSimple2.WAHPPlantType; branch.Comp(2).NodeNumIn = wahpSimple2.WaterInletNodeNum; @@ -1332,6 +1341,8 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAirRatedCo auto &wahpSimple1 = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(1); wahpSimple1.WAHPType = WatertoAirHP::Cooling; + wahpSimple1.coilType = HVAC::CoilType::CoolingWAHPSimple; + wahpSimple1.coilReportNum = ReportCoilSelection::getReportIndex(*state, wahpSimple1.Name, wahpSimple1.coilType); wahpSimple1.RatedAirVolFlowRate = AutoSize; wahpSimple1.RatedCapCoolTotal = AutoSize; wahpSimple1.RatedCapCoolSens = AutoSize; @@ -1346,6 +1357,8 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAirRatedCo auto &wahpSimple2 = state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(2); wahpSimple2.WAHPType = WatertoAirHP::Heating; + wahpSimple2.coilType = HVAC::CoilType::CoolingWAHPSimple; + wahpSimple2.coilReportNum = ReportCoilSelection::getReportIndex(*state, wahpSimple2.Name, wahpSimple2.coilType); wahpSimple2.RatedAirVolFlowRate = AutoSize; wahpSimple2.RatedCapHeat = AutoSize; wahpSimple2.RatedWaterVolFlowRate = 0.000185; From c890edbede9e074da9f4113e162690646dc966cb Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 14 Apr 2026 10:26:11 -0600 Subject: [PATCH 4/6] bump ci --- .github/actions/configure-and-build/action.yml | 4 ++-- .../workflows/run_and_cache_regressions_develop.yml | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/actions/configure-and-build/action.yml b/.github/actions/configure-and-build/action.yml index 45722c54865..ebf3a4b7b70 100644 --- a/.github/actions/configure-and-build/action.yml +++ b/.github/actions/configure-and-build/action.yml @@ -104,11 +104,11 @@ runs: ../ if [ "${{ inputs.minimal-targets }}" == "true" ]; then - begin_group "Builing only energyplus and fortran targets" + begin_group "Building only energyplus and Fortran targets" ninja energyplus ExpandObjects ReadVarsESO Slab Basement AppGPostProcess ParametricPreprocessor echo "::endgroup::" else - begin_group "Builing full energyplus" + begin_group "Building full energyplus" ninja echo "::endgroup::" fi; diff --git a/.github/workflows/run_and_cache_regressions_develop.yml b/.github/workflows/run_and_cache_regressions_develop.yml index 7597c348b59..3d96c3de6de 100644 --- a/.github/workflows/run_and_cache_regressions_develop.yml +++ b/.github/workflows/run_and_cache_regressions_develop.yml @@ -7,6 +7,7 @@ on: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FC: gfortran-13 + Python_REQUIRED_VERSION: 3.12.3 # 3.12.2 not available on Ubuntu 24 GHA jobs: build_and_test: @@ -20,29 +21,29 @@ jobs: matrix: include: - os: macos-14 - macos_dev_target: 13.0 + macos_dev_target: 14.0 arch: arm64 python-arch: arm64 pretty: "Mac arm64" - python-version: 3.12.3 # 3.12.2 not available on Ubuntu 24 GHA + python-version: ${{ env.Python_REQUIRED_VERSION }} allow_failure: false - os: ubuntu-24.04 arch: x86_64 python-arch: x64 pretty: "Ubuntu 24.04" - python-version: 3.12.3 # 3.12.2 not available on Ubuntu 24 GHA + python-version: ${{ env.Python_REQUIRED_VERSION }} allow_failure: false - os: windows-2022 arch: x86_64 python-arch: x64 pretty: "Windows x64" - python-version: 3.12.3 # 3.12.2 not available on Ubuntu 24 GHA + python-version: ${{ env.Python_REQUIRED_VERSION }} allow_failure: false - os: ubuntu-24.04-arm arch: arm64 python-arch: arm64 pretty: "Ubuntu 24.04 arm64" - python-version: 3.12.3 # 3.12.2 not available on Ubuntu 24 GHA + python-version: ${{ env.Python_REQUIRED_VERSION }} allow_failure: true - os: windows-11-arm arch: arm64 From 2c16ebf79998559d938de768449d04712d34697a Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 14 Apr 2026 11:07:04 -0600 Subject: [PATCH 5/6] partially revert c890edbede9e074da9f4113e162690646dc966cb --- .github/workflows/run_and_cache_regressions_develop.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/run_and_cache_regressions_develop.yml b/.github/workflows/run_and_cache_regressions_develop.yml index 3d96c3de6de..c31524451e9 100644 --- a/.github/workflows/run_and_cache_regressions_develop.yml +++ b/.github/workflows/run_and_cache_regressions_develop.yml @@ -7,7 +7,6 @@ on: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} FC: gfortran-13 - Python_REQUIRED_VERSION: 3.12.3 # 3.12.2 not available on Ubuntu 24 GHA jobs: build_and_test: @@ -25,25 +24,25 @@ jobs: arch: arm64 python-arch: arm64 pretty: "Mac arm64" - python-version: ${{ env.Python_REQUIRED_VERSION }} + python-version: 3.12.3 allow_failure: false - os: ubuntu-24.04 arch: x86_64 python-arch: x64 pretty: "Ubuntu 24.04" - python-version: ${{ env.Python_REQUIRED_VERSION }} + python-version: 3.12.3 allow_failure: false - os: windows-2022 arch: x86_64 python-arch: x64 pretty: "Windows x64" - python-version: ${{ env.Python_REQUIRED_VERSION }} + python-version: 3.12.3 allow_failure: false - os: ubuntu-24.04-arm arch: arm64 python-arch: arm64 pretty: "Ubuntu 24.04 arm64" - python-version: ${{ env.Python_REQUIRED_VERSION }} + python-version: 3.12.3 allow_failure: true - os: windows-11-arm arch: arm64 From eb47f7e7296f57f43dcab9d9548605047ba721d0 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 14 Apr 2026 13:22:53 -0600 Subject: [PATCH 6/6] format --- .../Autosizing/All_Simple_Sizing.cc | 3 +- .../Autosizing/BaseSizerWithScalableInputs.cc | 11 +- .../Autosizing/CoolingAirFlowSizing.cc | 3 +- .../Autosizing/CoolingCapacitySizing.cc | 20 +- .../Autosizing/SystemAirFlowSizing.cc | 552 ++- src/EnergyPlus/Coils/CoilCoolingDX.cc | 12 +- src/EnergyPlus/DXCoils.cc | 74 +- src/EnergyPlus/DXCoils.hh | 2 +- src/EnergyPlus/DataHVACGlobals.cc | 1 - src/EnergyPlus/FanCoilUnits.cc | 14 +- src/EnergyPlus/HeatingCoils.cc | 17 +- src/EnergyPlus/OutputReportTabular.cc | 8 +- src/EnergyPlus/ReportCoilSelection.cc | 3439 +++++++++-------- src/EnergyPlus/ReportCoilSelection.hh | 387 +- src/EnergyPlus/SingleDuct.cc | 3 +- src/EnergyPlus/SteamCoils.cc | 27 +- src/EnergyPlus/SteamCoils.hh | 24 +- src/EnergyPlus/UnitHeater.cc | 7 +- src/EnergyPlus/UnitVentilator.cc | 14 +- src/EnergyPlus/UnitarySystem.cc | 65 +- src/EnergyPlus/VariableSpeedCoils.cc | 31 +- src/EnergyPlus/VariableSpeedCoils.hh | 18 +- src/EnergyPlus/WaterCoils.cc | 82 +- src/EnergyPlus/WaterCoils.hh | 48 +- src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 49 +- src/EnergyPlus/WaterToAirHeatPumpSimple.hh | 26 +- .../unit/HVACDXHeatPumpSystem.unit.cc | 4 +- .../unit/HVACVariableRefrigerantFlow.unit.cc | 12 +- .../unit/PackagedTerminalHeatPump.unit.cc | 4 +- .../unit/ReportCoilSelection.unit.cc | 58 +- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 20 +- tst/EnergyPlus/unit/WaterCoils.unit.cc | 54 +- .../unit/WaterToAirHeatPumpSimple.unit.cc | 21 +- 33 files changed, 2519 insertions(+), 2591 deletions(-) diff --git a/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc b/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc index dabf74be76d..b936aa41c2e 100644 --- a/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc +++ b/src/EnergyPlus/Autosizing/All_Simple_Sizing.cc @@ -321,8 +321,7 @@ Real64 HeatingCoilDesAirInletTempSizer::size(EnergyPlusData &state, Real64 _orig } this->selectSizerOutput(state, errorsFound); if (this->isCoilReportObject) { - ReportCoilSelection::setCoilEntAirTemp( - state, this->coilReportNum, this->autoSizedValue, this->curSysNum, this->curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp(state, this->coilReportNum, this->autoSizedValue, this->curSysNum, this->curZoneEqNum); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc b/src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc index 8ee836c4921..c5651a8133a 100644 --- a/src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc +++ b/src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc @@ -101,12 +101,11 @@ void BaseSizerWithScalableInputs::initializeWithinEP(EnergyPlusData &state, // This should work for both fan types if (this->primaryAirSystem(this->curSysNum).supFanNum > 0) { - ReportCoilSelection::setCoilSupplyFanInfo( - state, - this->coilReportNum, - state.dataFans->fans(this->primaryAirSystem(this->curSysNum).supFanNum)->Name, - state.dataFans->fans(this->primaryAirSystem(this->curSysNum).supFanNum)->type, - this->primaryAirSystem(this->curSysNum).supFanNum); + ReportCoilSelection::setCoilSupplyFanInfo(state, + this->coilReportNum, + state.dataFans->fans(this->primaryAirSystem(this->curSysNum).supFanNum)->Name, + state.dataFans->fans(this->primaryAirSystem(this->curSysNum).supFanNum)->type, + this->primaryAirSystem(this->curSysNum).supFanNum); } } diff --git a/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc b/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc index 93423fec4f3..afe0c7db4ca 100644 --- a/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingAirFlowSizing.cc @@ -406,8 +406,7 @@ Real64 CoolingAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, b EnergyPlus::format("{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } diff --git a/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc b/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc index c2b32a6b066..37434d5d799 100644 --- a/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc +++ b/src/EnergyPlus/Autosizing/CoolingCapacitySizing.cc @@ -576,16 +576,16 @@ Real64 CoolingCapacitySizer::size(EnergyPlusData &state, Real64 _originalValue, ReportCoilSelection::setCoilLvgAirHumRat(state, this->coilReportNum, CoilOutHumRat); } ReportCoilSelection::setCoilCoolingCapacity(state, - this->coilReportNum, - this->autoSizedValue, - this->wasAutoSized, - this->curSysNum, - this->curZoneEqNum, - this->curOASysNum, - FanCoolLoad, - TotCapTempModFac, - DXFlowPerCapMinRatio, - DXFlowPerCapMaxRatio); + this->coilReportNum, + this->autoSizedValue, + this->wasAutoSized, + this->curSysNum, + this->curZoneEqNum, + this->curOASysNum, + FanCoolLoad, + TotCapTempModFac, + DXFlowPerCapMinRatio, + DXFlowPerCapMaxRatio); } return this->autoSizedValue; } diff --git a/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc b/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc index 30464200f6c..e9c3562406e 100644 --- a/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc +++ b/src/EnergyPlus/Autosizing/SystemAirFlowSizing.cc @@ -87,23 +87,21 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).AirVolFlow) { DDNameFanPeak = "Unknown"; @@ -114,48 +112,44 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow, @@ -168,8 +162,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && @@ -179,8 +172,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -194,8 +186,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && @@ -205,8 +196,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -217,48 +207,44 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -269,24 +255,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -298,24 +282,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -325,48 +307,44 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedCoolingAirflow * this->zoneEqSizing(this->curZoneEqNum).CoolingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -377,24 +355,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -406,24 +382,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFracOfAutosizedHeatingAirflow * this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -433,48 +407,44 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity, @@ -483,23 +453,21 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -509,23 +477,21 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -535,48 +501,44 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow) { this->autoSizedValue = this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = max(this->dataFlowPerCoolingCapacity * this->dataAutosizedCoolingCapacity, @@ -585,23 +547,21 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -611,23 +571,21 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->dataFlowPerHeatingCapacity * this->dataAutosizedHeatingCapacity) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -637,24 +595,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && !this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else if (this->zoneEqSizing(this->curZoneEqNum).HeatingAirFlow && this->zoneEqSizing(this->curZoneEqNum).CoolingAirFlow) { this->autoSizedValue = @@ -663,23 +619,21 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->zoneEqSizing(this->curZoneEqNum).HeatingAirVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } else { @@ -692,24 +646,22 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo if (this->finalZoneSizing(this->curZoneEqNum).CoolDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).CoolDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->zoneHeatingOnlyFan) { this->autoSizedValue = this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow; if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && this->finalZoneSizing(this->curZoneEqNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { DDNameFanPeak = state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Title; - dateTimeFanPeak = - EnergyPlus::format("{}/{} {}", - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, - state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, + state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } else { this->autoSizedValue = max(this->finalZoneSizing(this->curZoneEqNum).DesCoolVolFlow, @@ -722,8 +674,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).CoolDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtCoolMax)); } } else if (this->autoSizedValue == this->finalZoneSizing(this->curZoneEqNum).DesHeatVolFlow) { if (this->finalZoneSizing(this->curZoneEqNum).HeatDDNum > 0 && @@ -733,8 +684,7 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo "{}/{} {}", state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).Month, state.dataWeather->DesDayInput(this->finalZoneSizing(this->curZoneEqNum).HeatDDNum).DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); + ReportCoilSelection::getTimeText(state, this->finalZoneSizing(this->curZoneEqNum).TimeStepNumAtHeatMax)); } } } @@ -821,11 +771,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalSysSizing(this->curSysNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { auto &desDayInput = state.dataWeather->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); DDNameFanPeak = desDayInput.Title; - dateTimeFanPeak = EnergyPlus::format("{}/{} {}", - desDayInput.Month, - desDayInput.DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + desDayInput.Month, + desDayInput.DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesCoolVolFlow) { auto &sysSizPeakDDNum = state.dataSize->SysSizPeakDDNum(this->curSysNum); @@ -865,11 +815,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalSysSizing(this->curSysNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { auto &desDayInput = state.dataWeather->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); DDNameFanPeak = desDayInput.Title; - dateTimeFanPeak = EnergyPlus::format("{}/{} {}", - desDayInput.Month, - desDayInput.DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + desDayInput.Month, + desDayInput.DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } } else if (unitarysysEqSizing.CoolingAirFlow) { @@ -890,11 +840,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalSysSizing(this->curSysNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { auto &desDayInput = state.dataWeather->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); DDNameFanPeak = desDayInput.Title; - dateTimeFanPeak = EnergyPlus::format("{}/{} {}", - desDayInput.Month, - desDayInput.DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + desDayInput.Month, + desDayInput.DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else { @@ -904,11 +854,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalSysSizing(this->curSysNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { auto &desDayInput = state.dataWeather->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); DDNameFanPeak = desDayInput.Title; - dateTimeFanPeak = EnergyPlus::format("{}/{} {}", - desDayInput.Month, - desDayInput.DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + desDayInput.Month, + desDayInput.DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesCoolVolFlow) { if (sysSizPeakDDNum.CoolFlowPeakDD > 0 && sysSizPeakDDNum.CoolFlowPeakDD <= state.dataEnvrn->TotDesDays) { @@ -930,11 +880,11 @@ Real64 SystemAirFlowSizer::size(EnergyPlusData &state, Real64 _originalValue, bo this->finalSysSizing(this->curSysNum).HeatDDNum <= state.dataEnvrn->TotDesDays) { auto &desDayInput = state.dataWeather->DesDayInput(this->finalSysSizing(this->curSysNum).HeatDDNum); DDNameFanPeak = desDayInput.Title; - dateTimeFanPeak = EnergyPlus::format("{}/{} {}", - desDayInput.Month, - desDayInput.DayOfMonth, - ReportCoilSelection::getTimeText( - state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); + dateTimeFanPeak = EnergyPlus::format( + "{}/{} {}", + desDayInput.Month, + desDayInput.DayOfMonth, + ReportCoilSelection::getTimeText(state, this->finalSysSizing(this->curSysNum).SysHeatAirTimeStepPk)); } } else if (this->autoSizedValue == this->finalSysSizing(this->curSysNum).DesCoolVolFlow) { if (sysSizPeakDDNum.CoolFlowPeakDD > 0 && sysSizPeakDDNum.CoolFlowPeakDD <= state.dataEnvrn->TotDesDays) { diff --git a/src/EnergyPlus/Coils/CoilCoolingDX.cc b/src/EnergyPlus/Coils/CoilCoolingDX.cc index e7a89a66679..6fdde79077a 100644 --- a/src/EnergyPlus/Coils/CoilCoolingDX.cc +++ b/src/EnergyPlus/Coils/CoilCoolingDX.cc @@ -160,7 +160,7 @@ void CoilCoolingDX::instantiateFromInputSpec(EnergyPlusData &state, const CoilCo this->name = input_data.name; this->coilType = HVAC::CoilType::CoolingDX; this->coilReportNum = ReportCoilSelection::getReportIndex(state, this->name, this->coilType); - + // initialize reclaim heat parameters this->reclaimHeat.Name = this->name; this->reclaimHeat.SourceType = state.dataCoilCoolingDX->coilCoolingDXObjectName; @@ -815,11 +815,11 @@ void CoilCoolingDX::simulate(EnergyPlusData &state, // report out fan information // should work for all fan types if (this->supplyFanIndex > 0) { - ReportCoilSelection::setCoilSupplyFanInfo(state, - this->coilReportNum, - state.dataFans->fans(this->supplyFanIndex)->Name, - state.dataFans->fans(this->supplyFanIndex)->type, - this->supplyFanIndex); + ReportCoilSelection::setCoilSupplyFanInfo(state, + this->coilReportNum, + state.dataFans->fans(this->supplyFanIndex)->Name, + state.dataFans->fans(this->supplyFanIndex)->type, + this->supplyFanIndex); } // report out coil rating conditions, just create a set of dummy nodes and run calculate on them diff --git a/src/EnergyPlus/DXCoils.cc b/src/EnergyPlus/DXCoils.cc index ce2ded97dee..6b4486631c5 100644 --- a/src/EnergyPlus/DXCoils.cc +++ b/src/EnergyPlus/DXCoils.cc @@ -1979,7 +1979,7 @@ void GetDXCoils(EnergyPlusData &state) thisDXCoil.coilType = HVAC::CoilType::HeatingDXSingleSpeed; thisDXCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, thisDXCoil.Name, thisDXCoil.coilType); - + if (lAlphaBlanks(2)) { thisDXCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((thisDXCoil.availSched = Sched::GetSchedule(state, Alphas(2))) == nullptr) { @@ -7097,22 +7097,21 @@ void InitDXCoil(EnergyPlusData &state, int const DXCoilNum) // number of the cur RatedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb( state, thisDXCoil.OutletAirTemp, thisDXCoil.OutletAirHumRat, DataEnvironment::StdPressureSeaLevel, RoutineName); - ReportCoilSelection::setRatedCoilConditions( - state, - thisDXCoil.coilReportNum, - thisDXCoil.TotalCoolingEnergyRate, // this is the report variable - thisDXCoil.SensCoolingEnergyRate, // this is the report variable - thisDXCoil.InletAirMassFlowRate, - thisDXCoil.InletAirTemp, - thisDXCoil.InletAirHumRat, - RatedInletWetBulbTemp, - thisDXCoil.OutletAirTemp, - thisDXCoil.OutletAirHumRat, - RatedOutletWetBulb, - RatedOutdoorAirTemp, - ratedOutdoorAirWetBulb, - thisDXCoil.RatedCBF(Mode), - -999.0); // coil effectiveness not define for DX + ReportCoilSelection::setRatedCoilConditions(state, + thisDXCoil.coilReportNum, + thisDXCoil.TotalCoolingEnergyRate, // this is the report variable + thisDXCoil.SensCoolingEnergyRate, // this is the report variable + thisDXCoil.InletAirMassFlowRate, + thisDXCoil.InletAirTemp, + thisDXCoil.InletAirHumRat, + RatedInletWetBulbTemp, + thisDXCoil.OutletAirTemp, + thisDXCoil.OutletAirHumRat, + RatedOutletWetBulb, + RatedOutdoorAirTemp, + ratedOutdoorAirWetBulb, + thisDXCoil.RatedCBF(Mode), + -999.0); // coil effectiveness not define for DX // now replace the outdoor air conditions set above for one time rating point calc state.dataEnvrn->OutDryBulbTemp = holdOutDryBulbTemp; @@ -7269,22 +7268,21 @@ void InitDXCoil(EnergyPlusData &state, int const DXCoilNum) // number of the cur RatedOutletWetBulb = Psychrometrics::PsyTwbFnTdbWPb( state, thisDXCoil.OutletAirTemp, thisDXCoil.OutletAirHumRat, DataEnvironment::StdPressureSeaLevel, RoutineName); - ReportCoilSelection::setRatedCoilConditions( - state, - thisDXCoil.coilReportNum, - thisDXCoil.TotalHeatingEnergyRate, // this is the report variable - thisDXCoil.TotalHeatingEnergyRate, // this is the report variable - thisDXCoil.InletAirMassFlowRate, - thisDXCoil.InletAirTemp, - thisDXCoil.InletAirHumRat, - RatedInletWetBulbTempHeat, - thisDXCoil.OutletAirTemp, - thisDXCoil.OutletAirHumRat, - RatedOutletWetBulb, - RatedOutdoorAirTempHeat, - ratedOutdoorAirWetBulb, - thisDXCoil.RatedCBF(Mode), - -999.0); // coil effectiveness not define for DX + ReportCoilSelection::setRatedCoilConditions(state, + thisDXCoil.coilReportNum, + thisDXCoil.TotalHeatingEnergyRate, // this is the report variable + thisDXCoil.TotalHeatingEnergyRate, // this is the report variable + thisDXCoil.InletAirMassFlowRate, + thisDXCoil.InletAirTemp, + thisDXCoil.InletAirHumRat, + RatedInletWetBulbTempHeat, + thisDXCoil.OutletAirTemp, + thisDXCoil.OutletAirHumRat, + RatedOutletWetBulb, + RatedOutdoorAirTempHeat, + ratedOutdoorAirWetBulb, + thisDXCoil.RatedCBF(Mode), + -999.0); // coil effectiveness not define for DX // now replace the outdoor air conditions set above for one time rating point calc state.dataEnvrn->OutDryBulbTemp = holdOutDryBulbTemp; @@ -16518,11 +16516,11 @@ void SetDXCoolingCoilData( thisDXCoil.supplyFanType = supplyFanType; if (thisDXCoil.SupplyFanIndex > 0) { - ReportCoilSelection::setCoilSupplyFanInfo(state, - thisDXCoil.coilReportNum, - state.dataFans->fans(thisDXCoil.SupplyFanIndex)->Name, - state.dataFans->fans(thisDXCoil.SupplyFanIndex)->type, - thisDXCoil.SupplyFanIndex); + ReportCoilSelection::setCoilSupplyFanInfo(state, + thisDXCoil.coilReportNum, + state.dataFans->fans(thisDXCoil.SupplyFanIndex)->Name, + state.dataFans->fans(thisDXCoil.SupplyFanIndex)->type, + thisDXCoil.SupplyFanIndex); } } } diff --git a/src/EnergyPlus/DXCoils.hh b/src/EnergyPlus/DXCoils.hh index 8c0b068ac66..3697ed24815 100644 --- a/src/EnergyPlus/DXCoils.hh +++ b/src/EnergyPlus/DXCoils.hh @@ -111,7 +111,7 @@ namespace DXCoils { std::string Name; // Name of the DX Coil HVAC::CoilType coilType = HVAC::CoilType::Invalid; // Integer equivalent to DXCoilType int coilReportNum = -1; - Sched::Schedule *availSched = nullptr; // availability schedule + Sched::Schedule *availSched = nullptr; // availability schedule // RatedCoolCap, RatedSHR and RatedCOP do not include the thermal or electrical // effects due to the supply air fan diff --git a/src/EnergyPlus/DataHVACGlobals.cc b/src/EnergyPlus/DataHVACGlobals.cc index 2832364931c..b9a502b6bf9 100644 --- a/src/EnergyPlus/DataHVACGlobals.cc +++ b/src/EnergyPlus/DataHVACGlobals.cc @@ -315,7 +315,6 @@ namespace HVAC { #endif // GET_OUT }; - constexpr std::array hxTypeNames = { "HeatExchanger:AirToAir:FlatPlate", "HeatExchanger:AirToAir:SensibleAndLatent", "HeatExchanger:Desiccant:BalancedFlow"}; diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 0e711d6b2cd..e0467a91bbb 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -964,10 +964,16 @@ namespace FanCoilUnits { OutputProcessor::StoreType::Average, fanCoil.Name); - ReportCoilSelection::setCoilSupplyFanInfo(state, ReportCoilSelection::getReportIndex(state, fanCoil.CCoilName, fanCoil.coolCoilType), - fanCoil.FanName, fanCoil.fanType, fanCoil.FanIndex); - ReportCoilSelection::setCoilSupplyFanInfo(state, ReportCoilSelection::getReportIndex(state, fanCoil.HCoilName, fanCoil.heatCoilType), - fanCoil.FanName, fanCoil.fanType, fanCoil.FanIndex); + ReportCoilSelection::setCoilSupplyFanInfo(state, + ReportCoilSelection::getReportIndex(state, fanCoil.CCoilName, fanCoil.coolCoilType), + fanCoil.FanName, + fanCoil.fanType, + fanCoil.FanIndex); + ReportCoilSelection::setCoilSupplyFanInfo(state, + ReportCoilSelection::getReportIndex(state, fanCoil.HCoilName, fanCoil.heatCoilType), + fanCoil.FanName, + fanCoil.fanType, + fanCoil.FanIndex); } } diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index 7e73d628e8e..c4abb44b1ef 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -803,7 +803,7 @@ namespace HeatingCoils { heatingCoil.coilType = HVAC::CoilType::HeatingGasMultiStage; heatingCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, heatingCoil.Name, heatingCoil.coilType); - + heatingCoil.ParasiticFuelCapacity = Numbers(1); heatingCoil.NumOfStages = static_cast(Numbers(2)); @@ -1341,8 +1341,7 @@ namespace HeatingCoils { } if (QCoilRequired == Node::SensedLoadFlagValue && state.dataHeatingCoils->MySPTestFlag(CoilNum) && - heatingCoil.coilType != HVAC::CoilType::HeatingElectricMultiStage && - heatingCoil.coilType != HVAC::CoilType::HeatingGasMultiStage) { + heatingCoil.coilType != HVAC::CoilType::HeatingElectricMultiStage && heatingCoil.coilType != HVAC::CoilType::HeatingGasMultiStage) { // If the coil is temperature controlled (QCoilReq == -999.0), both a control node and setpoint are required. if (!state.dataGlobal->SysSizingCalc && state.dataHVACGlobal->DoSetPointTest) { @@ -1362,8 +1361,7 @@ namespace HeatingCoils { auto const &controlNode = state.dataLoopNodes->Node(ControlNodeNum); if (controlNode.TempSetPoint == Node::SensedNodeFlagValue) { if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { - ShowSevereError(state, - EnergyPlus::format("{} \"{}\"", HVAC::coilTypeNames[(int)heatingCoil.coilType], heatingCoil.Name)); + ShowSevereError(state, EnergyPlus::format("{} \"{}\"", HVAC::coilTypeNames[(int)heatingCoil.coilType], heatingCoil.Name)); ShowContinueError(state, "... Missing temperature setpoint for heating coil."); ShowContinueError(state, "... use a Setpoint Manager to establish a setpoint at the coil temperature setpoint node."); state.dataHeatingCoils->HeatingCoilFatalError = true; @@ -1371,8 +1369,8 @@ namespace HeatingCoils { EMSManager::CheckIfNodeSetPointManagedByEMS( state, ControlNodeNum, HVAC::CtrlVarType::Temp, state.dataHeatingCoils->HeatingCoilFatalError); if (state.dataHeatingCoils->HeatingCoilFatalError) { - ShowSevereError( - state, EnergyPlus::format("{} \"{}\"", HVAC::coilTypeNames[(int)heatingCoil.coilType], heatingCoil.Name)); + ShowSevereError(state, + EnergyPlus::format("{} \"{}\"", HVAC::coilTypeNames[(int)heatingCoil.coilType], heatingCoil.Name)); ShowContinueError(state, "... Missing temperature setpoint for heating coil."); ShowContinueError(state, "... use a Setpoint Manager to establish a setpoint at the coil temperature setpoint node."); ShowContinueError(state, "... or use an EMS Actuator to establish a setpoint at the coil temperature setpoint node."); @@ -1648,8 +1646,7 @@ namespace HeatingCoils { state.dataSize->DataDesInletAirTemp = 0.0; // reset global data to zero so other heating coils are not state.dataSize->DataDesOutletAirTemp = 0.0; // reset global data to zero so other heating coils are not affected - if (heatingCoil.coilType == HVAC::CoilType::HeatingElectricMultiStage || - heatingCoil.coilType == HVAC::CoilType::HeatingGasMultiStage) { + if (heatingCoil.coilType == HVAC::CoilType::HeatingElectricMultiStage || heatingCoil.coilType == HVAC::CoilType::HeatingGasMultiStage) { heatingCoil.MSNominalCapacity(heatingCoil.NumOfStages) = TempCap; bool IsAutoSize = false; int NumOfStages; // total number of stages of multi-stage heating coil @@ -2837,7 +2834,7 @@ namespace HeatingCoils { if (heatingCoil.reportCoilFinalSizes) { if (!state.dataGlobal->WarmupFlag && !state.dataGlobal->DoingHVACSizingSimulations && !state.dataGlobal->DoingSizing) { - ReportCoilSelection::setCoilFinalSizes( + ReportCoilSelection::setCoilFinalSizes( state, heatingCoil.coilReportNum, heatingCoil.NominalCapacity, heatingCoil.NominalCapacity, -999.0, -999.0); heatingCoil.reportCoilFinalSizes = false; } diff --git a/src/EnergyPlus/OutputReportTabular.cc b/src/EnergyPlus/OutputReportTabular.cc index 52026a0d22e..55900950b94 100644 --- a/src/EnergyPlus/OutputReportTabular.cc +++ b/src/EnergyPlus/OutputReportTabular.cc @@ -5263,7 +5263,7 @@ void WriteTabularReports(EnergyPlusData &state) } ReportCoilSelection::finishCoilSummaryReportTable(state); // call to write out the coil selection summary table data - WritePredefinedTables(state); // moved to come after zone load components is finished + WritePredefinedTables(state); // moved to come after zone load components is finished if (state.dataGlobal->DoWeathSim) { WriteMonthlyTables(state); @@ -15931,8 +15931,7 @@ void computeSpaceZoneCompLoads(EnergyPlusData &state, iSpace); CollectPeakZoneConditions(state, coolCompLoadTables, coolDesSelected, timeCoolMax, iZone, true, iSpace); // send latent load info to coil summary report - ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(state, - iZone, coolCompLoadTables.cells(LoadCompCol::Latent, LoadCompRow::GrdTot)); + ReportCoilSelection::setZoneLatentLoadCoolingIdealPeak(state, iZone, coolCompLoadTables.cells(LoadCompCol::Latent, LoadCompRow::GrdTot)); int heatDesSelected = calcFinalSizing.HeatDDNum; heatCompLoadTables.desDayNum = heatDesSelected; @@ -15970,8 +15969,7 @@ void computeSpaceZoneCompLoads(EnergyPlusData &state, CollectPeakZoneConditions(state, heatCompLoadTables, heatDesSelected, timeHeatMax, iZone, false, iSpace); // send latent load info to coil summary report - ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(state, - iZone, heatCompLoadTables.cells(LoadCompCol::Latent, LoadCompRow::GrdTot)); + ReportCoilSelection::setZoneLatentLoadHeatingIdealPeak(state, iZone, heatCompLoadTables.cells(LoadCompCol::Latent, LoadCompRow::GrdTot)); AddAreaColumnForZone(componentAreas, coolCompLoadTables); AddAreaColumnForZone(componentAreas, heatCompLoadTables); diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index a5ce00954e2..2aee659808f 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -75,1977 +75,1988 @@ namespace EnergyPlus { namespace ReportCoilSelection { -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), - - 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), - plantDesDeltaTemp(-999.0), plantDesCapacity(-999.0), coilCapPrcntPlantCap(-999.0), coilFlowPrcntPlantFlow(-999.0), coilUA(-999.0) -{ - coilName_ = coilName; - coilLocation = "unknown"; - desDayNameAtSensPeak = "unknown"; - coilSensePeakHrMin = "unknown"; - desDayNameAtTotalPeak = "unknown"; - coilTotalPeakHrMin = "unknown"; - desDayNameAtAirFlowPeak = "unknown"; - airPeakHrMin = "unknown"; - typeHVACname = "unknown"; - userNameforHVACsystem = "unknown"; - coilSizingMethodConcurrenceName = "N/A"; - coilSizingMethodCapacityName = "N/A"; - coilSizingMethodAirFlowName = "N/A"; - coilPeakLoadTypeToSizeOnName = "N/A"; - coilCapAutoMsg = "unknown"; - coilVolFlowAutoMsg = "unknown"; - coilWaterFlowAutoMsg = "unknown"; - coilOAPretreatMsg = "unknown"; - plantLoopName = "unknown"; - fanAssociatedWithCoilName = "unknown"; - fanTypeName = "unknown"; -} - -void finishCoilSummaryReportTable(EnergyPlusData &state) -{ - doFinalProcessingOfCoilData(state); - writeCoilSelectionOutput(state); - writeCoilSelectionOutput2(state); -} - -void writeCoilSelectionOutput(EnergyPlusData &state) -{ - - // make calls to fill out predefined tabular report entries for each coil selection report object - for (auto *c : state.dataRptCoilSelection->coils) { - - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilType, c->coilName_, HVAC::coilTypeNamesUC[(int)c->coilType]); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLocation, c->coilName_, c->coilLocation); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACType, c->coilName_, c->typeHVACname); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACName, c->coilName_, c->userNameforHVACsystem); - - // begin std 229 existing heating coil table adding new variables - if (c->isHeating) { + 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), + + 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), plantDesDeltaTemp(-999.0), plantDesCapacity(-999.0), coilCapPrcntPlantCap(-999.0), coilFlowPrcntPlantFlow(-999.0), + coilUA(-999.0) + { + coilName_ = coilName; + coilLocation = "unknown"; + desDayNameAtSensPeak = "unknown"; + coilSensePeakHrMin = "unknown"; + desDayNameAtTotalPeak = "unknown"; + coilTotalPeakHrMin = "unknown"; + desDayNameAtAirFlowPeak = "unknown"; + airPeakHrMin = "unknown"; + typeHVACname = "unknown"; + userNameforHVACsystem = "unknown"; + coilSizingMethodConcurrenceName = "N/A"; + coilSizingMethodCapacityName = "N/A"; + coilSizingMethodAirFlowName = "N/A"; + coilPeakLoadTypeToSizeOnName = "N/A"; + coilCapAutoMsg = "unknown"; + coilVolFlowAutoMsg = "unknown"; + coilWaterFlowAutoMsg = "unknown"; + coilOAPretreatMsg = "unknown"; + plantLoopName = "unknown"; + fanAssociatedWithCoilName = "unknown"; + fanTypeName = "unknown"; + } + + void finishCoilSummaryReportTable(EnergyPlusData &state) + { + doFinalProcessingOfCoilData(state); + writeCoilSelectionOutput(state); + writeCoilSelectionOutput2(state); + } + + void writeCoilSelectionOutput(EnergyPlusData &state) + { + + // make calls to fill out predefined tabular report entries for each coil selection report object + for (auto *c : state.dataRptCoilSelection->coils) { + OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchHeatCoilUsedAsSupHeat, c->coilName_, c->isSupplementalHeater ? "Yes" : "No"); - OutputReportPredefined::PreDefTableEntry(state, - state.dataOutRptPredefined->pdchHeatCoilAirloopName, - c->coilName_, - c->airloopNum > 0 && c->airloopNum <= state.dataHVACGlobal->NumPrimaryAirSys - ? state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name - : "N/A"); - OutputReportPredefined::PreDefTableEntry(state, - state.dataOutRptPredefined->pdchHeatCoilPlantloopName, - c->coilName_, - c->waterLoopNum > 0 ? state.dataPlnt->PlantLoop(c->waterLoopNum).Name : "N/A"); - } - // end std 229 existing heating coil table adding new variables - - // begin std 229 New coil connections table entries - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilName_CCs, c->coilName_, c->coilName_); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilType_CCs, c->coilName_, HVAC::coilTypeNamesUC[(int)c->coilType]); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLoc_CCs, c->coilName_, c->coilLocation); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACType_CCs, c->coilName_, c->typeHVACname); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACName_CCs, c->coilName_, c->userNameforHVACsystem); - // end of std 229 New coil connections table entries - - if (c->zoneName.size() == 1) { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneName, c->coilName_, c->zoneName[0]); - // begin std 229 New coil connections table entries - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneNames_CCs, c->coilName_, c->zoneName[0]); - // end of std 229 New coil connections table entries - } else if (c->zoneName.size() > 1) { - // make list of zone names - std::string tmpZoneList; - for (const auto &vecLoop : c->zoneName) { - tmpZoneList += vecLoop + "; "; + state, state.dataOutRptPredefined->pdchCoilType, c->coilName_, HVAC::coilTypeNamesUC[(int)c->coilType]); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLocation, c->coilName_, c->coilLocation); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACType, c->coilName_, c->typeHVACname); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACName, c->coilName_, c->userNameforHVACsystem); + + // begin std 229 existing heating coil table adding new variables + if (c->isHeating) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchHeatCoilUsedAsSupHeat, c->coilName_, c->isSupplementalHeater ? "Yes" : "No"); + OutputReportPredefined::PreDefTableEntry(state, + state.dataOutRptPredefined->pdchHeatCoilAirloopName, + c->coilName_, + c->airloopNum > 0 && c->airloopNum <= state.dataHVACGlobal->NumPrimaryAirSys + ? state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name + : "N/A"); + OutputReportPredefined::PreDefTableEntry(state, + state.dataOutRptPredefined->pdchHeatCoilPlantloopName, + c->coilName_, + c->waterLoopNum > 0 ? state.dataPlnt->PlantLoop(c->waterLoopNum).Name : "N/A"); } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneName, c->coilName_, tmpZoneList); - // begin std 229 New coil connections table entries - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneNames_CCs, c->coilName_, tmpZoneList); - // end of std 229 New coil connections table entries - } else { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneName, c->coilName_, "N/A"); + // end std 229 existing heating coil table adding new variables + // begin std 229 New coil connections table entries - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneNames_CCs, c->coilName_, "N/A"); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilName_CCs, c->coilName_, c->coilName_); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilType_CCs, c->coilName_, HVAC::coilTypeNamesUC[(int)c->coilType]); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLoc_CCs, c->coilName_, c->coilLocation); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACType_CCs, c->coilName_, c->typeHVACname); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilHVACName_CCs, c->coilName_, c->userNameforHVACsystem); // end of std 229 New coil connections table entries - } - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchSysSizingMethCoinc, c->coilName_, c->coilSizingMethodConcurrenceName); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchSysSizingMethCap, c->coilName_, c->coilSizingMethodCapacityName); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchSysSizingMethAir, c->coilName_, c->coilSizingMethodAirFlowName); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilIsCapAutosized, c->coilName_, c->coilCapAutoMsg); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilIsAirFlowAutosized, c->coilName_, c->coilVolFlowAutoMsg); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilIsWaterFlowAutosized, c->coilName_, c->coilWaterFlowAutoMsg); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilIsOATreated, c->coilName_, c->coilOAPretreatMsg); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilFinalTotalCap, c->coilName_, c->coilTotCapFinal, 3); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilFinalSensCap, c->coilName_, c->coilSensCapFinal, 3); - if (c->coilRefAirVolFlowFinal == -999.0 || c->coilRefAirVolFlowFinal == -99999.0) { + if (c->zoneName.size() == 1) { + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneName, c->coilName_, c->zoneName[0]); + // begin std 229 New coil connections table entries + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneNames_CCs, c->coilName_, c->zoneName[0]); + // end of std 229 New coil connections table entries + } else if (c->zoneName.size() > 1) { + // make list of zone names + std::string tmpZoneList; + for (const auto &vecLoop : c->zoneName) { + tmpZoneList += vecLoop + "; "; + } + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneName, c->coilName_, tmpZoneList); + // begin std 229 New coil connections table entries + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneNames_CCs, c->coilName_, tmpZoneList); + // end of std 229 New coil connections table entries + } else { + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneName, c->coilName_, "N/A"); + // begin std 229 New coil connections table entries + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilZoneNames_CCs, c->coilName_, "N/A"); + // end of std 229 New coil connections table entries + } + OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 1); - } else { + state, state.dataOutRptPredefined->pdchSysSizingMethCoinc, c->coilName_, c->coilSizingMethodConcurrenceName); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 6); - } + state, state.dataOutRptPredefined->pdchSysSizingMethCap, c->coilName_, c->coilSizingMethodCapacityName); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchSysSizingMethAir, c->coilName_, c->coilSizingMethodAirFlowName); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilIsCapAutosized, c->coilName_, c->coilCapAutoMsg); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilIsAirFlowAutosized, c->coilName_, c->coilVolFlowAutoMsg); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilIsWaterFlowAutosized, c->coilName_, c->coilWaterFlowAutoMsg); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilIsOATreated, c->coilName_, c->coilOAPretreatMsg); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilFinalTotalCap, c->coilName_, c->coilTotCapFinal, 3); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilFinalSensCap, c->coilName_, c->coilSensCapFinal, 3); + if (c->coilRefAirVolFlowFinal == -999.0 || c->coilRefAirVolFlowFinal == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 6); + } + + if (c->coilRefWaterVolFlowFinal == -999.0 || c->coilRefWaterVolFlowFinal == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 8); + } - if (c->coilRefWaterVolFlowFinal == -999.0 || c->coilRefWaterVolFlowFinal == -99999.0) { OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 1); - } else { + state, state.dataOutRptPredefined->pdchFanAssociatedWithCoilName, c->coilName_, c->fanAssociatedWithCoilName); + // begin std 229 New coil connections table entries OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 8); - } + state, state.dataOutRptPredefined->pdchCoilSupFanName_CCs, c->coilName_, c->fanAssociatedWithCoilName); + // end of std 229 New coil connections table entries - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchFanAssociatedWithCoilName, c->coilName_, c->fanAssociatedWithCoilName); - // begin std 229 New coil connections table entries - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilSupFanName_CCs, c->coilName_, c->fanAssociatedWithCoilName); - // end of std 229 New coil connections table entries + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchFanAssociatedWithCoilType, c->coilName_, c->fanTypeName); + // begin std 229 New coil connections table entries + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilSupFanType_CCs, c->coilName_, c->fanTypeName); + // end of std 229 New coil connections table entries + + if (c->fanSizeMaxAirVolumeFlow == -999.0 || c->fanSizeMaxAirVolumeFlow == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchFanAssociatedVdotSize, c->coilName_, c->fanSizeMaxAirVolumeFlow, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchFanAssociatedVdotSize, c->coilName_, c->fanSizeMaxAirVolumeFlow, 6); + } + if (c->fanSizeMaxAirMassFlow == -999.0 || c->fanSizeMaxAirMassFlow == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchFanAssociatedMdotSize, c->coilName_, c->fanSizeMaxAirMassFlow, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchFanAssociatedMdotSize, c->coilName_, c->fanSizeMaxAirMassFlow, 8); + } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchFanAssociatedWithCoilType, c->coilName_, c->fanTypeName); - // begin std 229 New coil connections table entries - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilSupFanType_CCs, c->coilName_, c->fanTypeName); - // end of std 229 New coil connections table entries + // begin std 229 New coil connections table entries + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilPlantName_CCs, c->coilName_, c->plantLoopName); + OutputReportPredefined::PreDefTableEntry(state, + state.dataOutRptPredefined->pdchCoilAirloopName_CCs, + c->coilName_, + c->airloopNum > 0 && c->airloopNum <= state.dataHVACGlobal->NumPrimaryAirSys + ? state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name + : "N/A"); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilPlantloopName_CCs, c->coilName_, c->plantLoopName); + // end of std 229 New coil connections table entries - if (c->fanSizeMaxAirVolumeFlow == -999.0 || c->fanSizeMaxAirVolumeFlow == -99999.0) { OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchFanAssociatedVdotSize, c->coilName_, c->fanSizeMaxAirVolumeFlow, 1); - } else { + state, state.dataOutRptPredefined->pdchCoilDDnameSensIdealPeak, c->coilName_, c->desDayNameAtSensPeak); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchFanAssociatedVdotSize, c->coilName_, c->fanSizeMaxAirVolumeFlow, 6); - } - if (c->fanSizeMaxAirMassFlow == -999.0 || c->fanSizeMaxAirMassFlow == -99999.0) { + state, state.dataOutRptPredefined->pdchCoilDateTimeSensIdealPeak, c->coilName_, c->coilSensePeakHrMin); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchFanAssociatedMdotSize, c->coilName_, c->fanSizeMaxAirMassFlow, 1); - } else { + state, state.dataOutRptPredefined->pdchCoilDDnameTotIdealPeak, c->coilName_, c->desDayNameAtTotalPeak); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchFanAssociatedMdotSize, c->coilName_, c->fanSizeMaxAirMassFlow, 8); - } - - // begin std 229 New coil connections table entries - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilPlantName_CCs, c->coilName_, c->plantLoopName); - OutputReportPredefined::PreDefTableEntry(state, - state.dataOutRptPredefined->pdchCoilAirloopName_CCs, - c->coilName_, - c->airloopNum > 0 && c->airloopNum <= state.dataHVACGlobal->NumPrimaryAirSys - ? state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name - : "N/A"); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilPlantloopName_CCs, c->coilName_, c->plantLoopName); - // end of std 229 New coil connections table entries - - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilDDnameSensIdealPeak, c->coilName_, c->desDayNameAtSensPeak); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilDateTimeSensIdealPeak, c->coilName_, c->coilSensePeakHrMin); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilDDnameTotIdealPeak, c->coilName_, c->desDayNameAtTotalPeak); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilDateTimeTotIdealPeak, c->coilName_, c->coilTotalPeakHrMin); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilDDnameAirFlowIdealPeak, c->coilName_, c->desDayNameAtAirFlowPeak); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilDateTimeAirFlowIdealPeak, c->coilName_, c->airPeakHrMin); - - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilPeakLoadTypeToSizeOn, c->coilName_, c->coilPeakLoadTypeToSizeOnName); - - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilTotalCapIdealPeak, c->coilName_, c->coilTotCapAtPeak, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilSensCapIdealPeak, c->coilName_, c->coilSensCapAtPeak, 2); - if (c->coilDesMassFlow == -999.0 || c->coilDesMassFlow == -99999.0) { + state, state.dataOutRptPredefined->pdchCoilDateTimeTotIdealPeak, c->coilName_, c->coilTotalPeakHrMin); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilAirMassFlowIdealPeak, c->coilName_, c->coilDesMassFlow, 1); - } else { + state, state.dataOutRptPredefined->pdchCoilDDnameAirFlowIdealPeak, c->coilName_, c->desDayNameAtAirFlowPeak); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilAirMassFlowIdealPeak, c->coilName_, c->coilDesMassFlow, 8); - } - if (c->coilDesVolFlow == -999.0 || c->coilDesVolFlow == -99999.0) { + state, state.dataOutRptPredefined->pdchCoilDateTimeAirFlowIdealPeak, c->coilName_, c->airPeakHrMin); + OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 1); - } else { + state, state.dataOutRptPredefined->pdchCoilPeakLoadTypeToSizeOn, c->coilName_, c->coilPeakLoadTypeToSizeOnName); + OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 6); - } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilEntDryBulbIdealPeak, c->coilName_, c->coilDesEntTemp, 2); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilEntWetBulbIdealPeak, c->coilName_, c->coilDesEntWetBulb, 2); - if (c->coilDesEntHumRat == -999.0 || c->coilDesEntHumRat == -99999.0) { + state, state.dataOutRptPredefined->pdchCoilTotalCapIdealPeak, c->coilName_, c->coilTotCapAtPeak, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 1); - } else { + state, state.dataOutRptPredefined->pdchCoilSensCapIdealPeak, c->coilName_, c->coilSensCapAtPeak, 2); + if (c->coilDesMassFlow == -999.0 || c->coilDesMassFlow == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilAirMassFlowIdealPeak, c->coilName_, c->coilDesMassFlow, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilAirMassFlowIdealPeak, c->coilName_, c->coilDesMassFlow, 8); + } + if (c->coilDesVolFlow == -999.0 || c->coilDesVolFlow == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 6); + } OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 8); - } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilEntEnthalpyIdealPeak, c->coilName_, c->coilDesEntEnth, 1); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLvgDryBulbIdealPeak, c->coilName_, c->coilDesLvgTemp, 2); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilLvgWetBulbIdealPeak, c->coilName_, c->coilDesLvgWetBulb, 2); - if (c->coilDesLvgHumRat == -999.0 || c->coilDesLvgHumRat == -99999.0) { + state, state.dataOutRptPredefined->pdchCoilEntDryBulbIdealPeak, c->coilName_, c->coilDesEntTemp, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 1); - } else { + state, state.dataOutRptPredefined->pdchCoilEntWetBulbIdealPeak, c->coilName_, c->coilDesEntWetBulb, 2); + if (c->coilDesEntHumRat == -999.0 || c->coilDesEntHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 8); + } OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 8); - } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilLvgEnthalpyIdealPeak, c->coilName_, c->coilDesLvgEnth, 1); - if (c->coilDesWaterMassFlow == -999.0 || c->coilDesWaterMassFlow == -99999.0) { + state, state.dataOutRptPredefined->pdchCoilEntEnthalpyIdealPeak, c->coilName_, c->coilDesEntEnth, 1); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilWaterMassFlowIdealPeak, c->coilName_, c->coilDesWaterMassFlow, 1); - } else { + state, state.dataOutRptPredefined->pdchCoilLvgDryBulbIdealPeak, c->coilName_, c->coilDesLvgTemp, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilWaterMassFlowIdealPeak, c->coilName_, c->coilDesWaterMassFlow, 8); - } - - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilEntWaterTempIdealPeak, c->coilName_, c->coilDesWaterEntTemp, 2); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilLvgWaterTempIdealPeak, c->coilName_, c->coilDesWaterLvgTemp, 2); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilWaterDeltaTempIdealPeak, c->coilName_, c->coilDesWaterTempDiff, 2); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchFanHeatGainIdealPeak, c->coilName_, c->fanHeatGainIdealPeak, 3); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilNetTotalCapacityIdealPeak, c->coilName_, c->coilAndFanNetTotalCapacityIdealPeak, 2); - - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedTotalCap, c->coilName_, c->coilRatedTotCap, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedSensCap, c->coilName_, c->coilRatedSensCap, 2); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilOffRatingCapacityModifierIdealPeak, c->coilName_, c->coilCapFTIdealPeak, 4); - if (c->ratedAirMassFlow == -999.0 || c->ratedAirMassFlow == -99999.0) { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedAirMass, c->coilName_, c->ratedAirMassFlow, 1); - } else { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedAirMass, c->coilName_, c->ratedAirMassFlow, 8); - } + state, state.dataOutRptPredefined->pdchCoilLvgWetBulbIdealPeak, c->coilName_, c->coilDesLvgWetBulb, 2); + if (c->coilDesLvgHumRat == -999.0 || c->coilDesLvgHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 8); + } + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilLvgEnthalpyIdealPeak, c->coilName_, c->coilDesLvgEnth, 1); + if (c->coilDesWaterMassFlow == -999.0 || c->coilDesWaterMassFlow == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilWaterMassFlowIdealPeak, c->coilName_, c->coilDesWaterMassFlow, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilWaterMassFlowIdealPeak, c->coilName_, c->coilDesWaterMassFlow, 8); + } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedEntDryBulb, c->coilName_, c->ratedCoilInDb, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedEntWetBulb, c->coilName_, c->ratedCoilInWb, 2); - if (c->ratedCoilInHumRat == -999.0 || c->ratedCoilInHumRat == -99999.0) { OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilRatedEntHumRat, c->coilName_, c->ratedCoilInHumRat, 1); - } else { + state, state.dataOutRptPredefined->pdchCoilEntWaterTempIdealPeak, c->coilName_, c->coilDesWaterEntTemp, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilRatedEntHumRat, c->coilName_, c->ratedCoilInHumRat, 8); - } - - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedEntEnthalpy, c->coilName_, c->ratedCoilInEnth, 1); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedLvgDryBulb, c->coilName_, c->ratedCoilOutDb, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedLvgWetBulb, c->coilName_, c->ratedCoilOutWb, 2); - if (c->ratedCoilOutHumRat == -999.0 || c->ratedCoilOutHumRat == -99999.0) { + state, state.dataOutRptPredefined->pdchCoilLvgWaterTempIdealPeak, c->coilName_, c->coilDesWaterLvgTemp, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilRatedLvgHumRat, c->coilName_, c->ratedCoilOutHumRat, 1); - } else { + state, state.dataOutRptPredefined->pdchCoilWaterDeltaTempIdealPeak, c->coilName_, c->coilDesWaterTempDiff, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilRatedLvgHumRat, c->coilName_, c->ratedCoilOutHumRat, 8); - } + state, state.dataOutRptPredefined->pdchFanHeatGainIdealPeak, c->coilName_, c->fanHeatGainIdealPeak, 3); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilNetTotalCapacityIdealPeak, c->coilName_, c->coilAndFanNetTotalCapacityIdealPeak, 2); + + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedTotalCap, c->coilName_, c->coilRatedTotCap, 2); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedSensCap, c->coilName_, c->coilRatedSensCap, 2); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilOffRatingCapacityModifierIdealPeak, c->coilName_, c->coilCapFTIdealPeak, 4); + if (c->ratedAirMassFlow == -999.0 || c->ratedAirMassFlow == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilRatedAirMass, c->coilName_, c->ratedAirMassFlow, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilRatedAirMass, c->coilName_, c->ratedAirMassFlow, 8); + } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedLvgEnthalpy, c->coilName_, c->ratedCoilOutEnth, 1); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedEntDryBulb, c->coilName_, c->ratedCoilInDb, 2); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedEntWetBulb, c->coilName_, c->ratedCoilInWb, 2); + if (c->ratedCoilInHumRat == -999.0 || c->ratedCoilInHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilRatedEntHumRat, c->coilName_, c->ratedCoilInHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilRatedEntHumRat, c->coilName_, c->ratedCoilInHumRat, 8); + } - if (c->plantDesMaxMassFlowRate == -999.0 || c->plantDesMaxMassFlowRate == -99999.0) { OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchPlantMassFlowMaximum, c->coilName_, c->plantDesMaxMassFlowRate, 1); - } else { + state, state.dataOutRptPredefined->pdchCoilRatedEntEnthalpy, c->coilName_, c->ratedCoilInEnth, 1); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedLvgDryBulb, c->coilName_, c->ratedCoilOutDb, 2); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilRatedLvgWetBulb, c->coilName_, c->ratedCoilOutWb, 2); + if (c->ratedCoilOutHumRat == -999.0 || c->ratedCoilOutHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilRatedLvgHumRat, c->coilName_, c->ratedCoilOutHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilRatedLvgHumRat, c->coilName_, c->ratedCoilOutHumRat, 8); + } + OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchPlantMassFlowMaximum, c->coilName_, c->plantDesMaxMassFlowRate, 8); - } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantRetTempDesign, c->coilName_, c->plantDesRetTemp, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSupTempDesign, c->coilName_, c->plantDesSupTemp, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantDeltaTempDesign, c->coilName_, c->plantDesDeltaTemp, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantCapacity, c->coilName_, c->plantDesCapacity, 2); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilCapPrcntPlantCapacity, c->coilName_, c->coilCapPrcntPlantCap, 4); - if (c->coilFlowPrcntPlantFlow == -999.0 || c->coilFlowPrcntPlantFlow == -99999.0) { + state, state.dataOutRptPredefined->pdchCoilRatedLvgEnthalpy, c->coilName_, c->ratedCoilOutEnth, 1); + + if (c->plantDesMaxMassFlowRate == -999.0 || c->plantDesMaxMassFlowRate == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchPlantMassFlowMaximum, c->coilName_, c->plantDesMaxMassFlowRate, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchPlantMassFlowMaximum, c->coilName_, c->plantDesMaxMassFlowRate, 8); + } + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantRetTempDesign, c->coilName_, c->plantDesRetTemp, 2); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantSupTempDesign, c->coilName_, c->plantDesSupTemp, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilFlowPrcntPlantFlow, c->coilName_, c->coilFlowPrcntPlantFlow, 1); - } else { + state, state.dataOutRptPredefined->pdchPlantDeltaTempDesign, c->coilName_, c->plantDesDeltaTemp, 2); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantCapacity, c->coilName_, c->plantDesCapacity, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchCoilFlowPrcntPlantFlow, c->coilName_, c->coilFlowPrcntPlantFlow, 6); - } + state, state.dataOutRptPredefined->pdchCoilCapPrcntPlantCapacity, c->coilName_, c->coilCapPrcntPlantCap, 4); + if (c->coilFlowPrcntPlantFlow == -999.0 || c->coilFlowPrcntPlantFlow == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilFlowPrcntPlantFlow, c->coilName_, c->coilFlowPrcntPlantFlow, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchCoilFlowPrcntPlantFlow, c->coilName_, c->coilFlowPrcntPlantFlow, 6); + } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOADryBulbIdealPeak, c->coilName_, c->oaPeakTemp, 2); - if (c->oaPeakHumRat == -999.0 || c->oaPeakHumRat == -99999.0) { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 1); - } else { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 8); - } + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOADryBulbIdealPeak, c->coilName_, c->oaPeakTemp, 2); + if (c->oaPeakHumRat == -999.0 || c->oaPeakHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 8); + } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAWetBulbatIdealPeak, c->coilName_, c->oaPeakWetBulb, 2); - if (c->oaPeakVolFlow == -999.0 || c->oaPeakVolFlow == -99999.0) { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAVolFlowIdealPeak, c->coilName_, c->oaPeakVolFlow, 1); - } else { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAVolFlowIdealPeak, c->coilName_, c->oaPeakVolFlow, 8); - } + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAWetBulbatIdealPeak, c->coilName_, c->oaPeakWetBulb, 2); + if (c->oaPeakVolFlow == -999.0 || c->oaPeakVolFlow == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchOAVolFlowIdealPeak, c->coilName_, c->oaPeakVolFlow, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchOAVolFlowIdealPeak, c->coilName_, c->oaPeakVolFlow, 8); + } + + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAFlowPrcntIdealPeak, c->coilName_, c->oaPeakVolFrac, 4); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchAirSysRADryBulbIdealPeak, c->coilName_, c->raPeakTemp, 2); + if (c->raPeakHumRat == -999.0 || c->raPeakHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchAirSysRAHumRatIdealPeak, c->coilName_, c->raPeakHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchAirSysRAHumRatIdealPeak, c->coilName_, c->raPeakHumRat, 8); + } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchOAFlowPrcntIdealPeak, c->coilName_, c->oaPeakVolFrac, 4); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchAirSysRADryBulbIdealPeak, c->coilName_, c->raPeakTemp, 2); - if (c->raPeakHumRat == -999.0 || c->raPeakHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneAirDryBulbIdealPeak, c->coilName_, c->rmPeakTemp, 2); + if (c->rmPeakHumRat == -999.0 || c->rmPeakHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 8); + } + + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneAirRelHumIdealPeak, c->coilName_, c->rmPeakRelHum, 4); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilUA, c->coilName_, c->coilUA, 3); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchAirSysRAHumRatIdealPeak, c->coilName_, c->raPeakHumRat, 1); - } else { + state, state.dataOutRptPredefined->pdchZoneSensibleLoadIdealPeak, c->coilName_, c->rmSensibleAtPeak, 2); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneLatentLoadIdealPeak, c->coilName_, c->rmLatentAtPeak); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchReheatCoilMultiplier, c->coilName_, c->reheatLoadMult, 4); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchAirSysRAHumRatIdealPeak, c->coilName_, c->raPeakHumRat, 8); - } - - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneAirDryBulbIdealPeak, c->coilName_, c->rmPeakTemp, 2); - if (c->rmPeakHumRat == -999.0 || c->rmPeakHumRat == -99999.0) { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 1); - } else { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 8); + state, state.dataOutRptPredefined->pdchFlowCapRatioLowCapIncreaseRatio, c->coilName_, c->maxRatio, 5); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdchFlowCapRatioHiCapDecreaseRatio, c->coilName_, c->minRatio, 5); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantFluidSpecificHeat, c->coilName_, c->cpFluid, 4); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantFluidDensity, c->coilName_, c->rhoFluid, 4); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMoistAirSpecificHeat, c->coilName_, c->cpMoistAir, 4); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDryAirSpecificHeat, c->coilName_, c->cpDryAir, 4); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchStandRhoAir, c->coilName_, c->rhoStandAir, 4); } - - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneAirRelHumIdealPeak, c->coilName_, c->rmPeakRelHum, 4); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchCoilUA, c->coilName_, c->coilUA, 3); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchZoneSensibleLoadIdealPeak, c->coilName_, c->rmSensibleAtPeak, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchZoneLatentLoadIdealPeak, c->coilName_, c->rmLatentAtPeak); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchReheatCoilMultiplier, c->coilName_, c->reheatLoadMult, 4); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdchFlowCapRatioLowCapIncreaseRatio, c->coilName_, c->maxRatio, 5); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchFlowCapRatioHiCapDecreaseRatio, c->coilName_, c->minRatio, 5); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantFluidSpecificHeat, c->coilName_, c->cpFluid, 4); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchPlantFluidDensity, c->coilName_, c->rhoFluid, 4); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchMoistAirSpecificHeat, c->coilName_, c->cpMoistAir, 4); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchDryAirSpecificHeat, c->coilName_, c->cpDryAir, 4); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdchStandRhoAir, c->coilName_, c->rhoStandAir, 4); } -} -void writeCoilSelectionOutput2(EnergyPlusData &state) -{ + void writeCoilSelectionOutput2(EnergyPlusData &state) + { + + // make calls to fill out predefined tabular report entries for each coil selection report object + for (auto *c : state.dataRptCoilSelection->coils) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilType, c->coilName_, HVAC::coilTypeNamesUC[(int)c->coilType]); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilHVACType, c->coilName_, c->typeHVACname); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilHVACName, c->coilName_, c->userNameforHVACsystem); + + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilFinalTotalCap, c->coilName_, c->coilTotCapFinal, 3); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilFinalSensCap, c->coilName_, c->coilSensCapFinal, 3); + if (c->coilRefAirVolFlowFinal == -999.0 || c->coilRefAirVolFlowFinal == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 6); + } - // make calls to fill out predefined tabular report entries for each coil selection report object - for (auto *c : state.dataRptCoilSelection->coils) { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilType, c->coilName_, HVAC::coilTypeNamesUC[(int)c->coilType]); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilHVACType, c->coilName_, c->typeHVACname); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilHVACName, c->coilName_, c->userNameforHVACsystem); + if (c->coilRefWaterVolFlowFinal == -999.0 || c->coilRefWaterVolFlowFinal == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 8); + } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilFinalTotalCap, c->coilName_, c->coilTotCapFinal, 3); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilFinalSensCap, c->coilName_, c->coilSensCapFinal, 3); - if (c->coilRefAirVolFlowFinal == -999.0 || c->coilRefAirVolFlowFinal == -99999.0) { OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 1); - } else { + state, state.dataOutRptPredefined->pdch2CoilDDnameSensIdealPeak, c->coilName_, c->desDayNameAtSensPeak); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilFinalAirVolFlowRate, c->coilName_, c->coilRefAirVolFlowFinal, 6); - } - - if (c->coilRefWaterVolFlowFinal == -999.0 || c->coilRefWaterVolFlowFinal == -99999.0) { + state, state.dataOutRptPredefined->pdch2CoilDateTimeSensIdealPeak, c->coilName_, c->coilSensePeakHrMin); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 1); - } else { + state, state.dataOutRptPredefined->pdch2CoilDDnameAirFlowIdealPeak, c->coilName_, c->desDayNameAtAirFlowPeak); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilFinalPlantVolFlowRate, c->coilName_, c->coilRefWaterVolFlowFinal, 8); - } - - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilDDnameSensIdealPeak, c->coilName_, c->desDayNameAtSensPeak); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilDateTimeSensIdealPeak, c->coilName_, c->coilSensePeakHrMin); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilDDnameAirFlowIdealPeak, c->coilName_, c->desDayNameAtAirFlowPeak); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilDateTimeAirFlowIdealPeak, c->coilName_, c->airPeakHrMin); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilTotalCapIdealPeak, c->coilName_, c->coilTotCapAtPeak, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilSensCapIdealPeak, c->coilName_, c->coilSensCapAtPeak, 2); - if (c->coilDesVolFlow == -999.0 || c->coilDesVolFlow == -99999.0) { + state, state.dataOutRptPredefined->pdch2CoilDateTimeAirFlowIdealPeak, c->coilName_, c->airPeakHrMin); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 1); - } else { + state, state.dataOutRptPredefined->pdch2CoilTotalCapIdealPeak, c->coilName_, c->coilTotCapAtPeak, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 6); - } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilEntDryBulbIdealPeak, c->coilName_, c->coilDesEntTemp, 2); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilEntWetBulbIdealPeak, c->coilName_, c->coilDesEntWetBulb, 2); - if (c->coilDesEntHumRat == -999.0 || c->coilDesEntHumRat == -99999.0) { + state, state.dataOutRptPredefined->pdch2CoilSensCapIdealPeak, c->coilName_, c->coilSensCapAtPeak, 2); + if (c->coilDesVolFlow == -999.0 || c->coilDesVolFlow == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilAirVolumeFlowIdealPeak, c->coilName_, c->coilDesVolFlow, 6); + } OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 1); - } else { + state, state.dataOutRptPredefined->pdch2CoilEntDryBulbIdealPeak, c->coilName_, c->coilDesEntTemp, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 8); - } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilLvgDryBulbIdealPeak, c->coilName_, c->coilDesLvgTemp, 2); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilLvgWetBulbIdealPeak, c->coilName_, c->coilDesLvgWetBulb, 2); - if (c->coilDesLvgHumRat == -999.0 || c->coilDesLvgHumRat == -99999.0) { + state, state.dataOutRptPredefined->pdch2CoilEntWetBulbIdealPeak, c->coilName_, c->coilDesEntWetBulb, 2); + if (c->coilDesEntHumRat == -999.0 || c->coilDesEntHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilEntHumRatIdealPeak, c->coilName_, c->coilDesEntHumRat, 8); + } OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 1); - } else { + state, state.dataOutRptPredefined->pdch2CoilLvgDryBulbIdealPeak, c->coilName_, c->coilDesLvgTemp, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2CoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 8); - } + state, state.dataOutRptPredefined->pdch2CoilLvgWetBulbIdealPeak, c->coilName_, c->coilDesLvgWetBulb, 2); + if (c->coilDesLvgHumRat == -999.0 || c->coilDesLvgHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2CoilLvgHumRatIdealPeak, c->coilName_, c->coilDesLvgHumRat, 8); + } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilRatedTotalCap, c->coilName_, c->coilRatedTotCap, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilRatedSensCap, c->coilName_, c->coilRatedSensCap, 2); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilRatedTotalCap, c->coilName_, c->coilRatedTotCap, 2); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilRatedSensCap, c->coilName_, c->coilRatedSensCap, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OADryBulbIdealPeak, c->coilName_, c->oaPeakTemp, 2); - if (c->oaPeakHumRat == -999.0 || c->oaPeakHumRat == -99999.0) { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 1); - } else { - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 8); - } + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OADryBulbIdealPeak, c->coilName_, c->oaPeakTemp, 2); + if (c->oaPeakHumRat == -999.0 || c->oaPeakHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAHumRatIdealPeak, c->coilName_, c->oaPeakHumRat, 8); + } + + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAWetBulbatIdealPeak, c->coilName_, c->oaPeakWetBulb, 2); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAFlowPrcntIdealPeak, c->coilName_, c->oaPeakVolFrac, 4); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAWetBulbatIdealPeak, c->coilName_, c->oaPeakWetBulb, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2OAFlowPrcntIdealPeak, c->coilName_, c->oaPeakVolFrac, 4); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2ZoneAirDryBulbIdealPeak, c->coilName_, c->rmPeakTemp, 2); + if (c->rmPeakHumRat == -999.0 || c->rmPeakHumRat == -99999.0) { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2ZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 1); + } else { + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2ZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 8); + } - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2ZoneAirDryBulbIdealPeak, c->coilName_, c->rmPeakTemp, 2); - if (c->rmPeakHumRat == -999.0 || c->rmPeakHumRat == -99999.0) { OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2ZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 1); - } else { + state, state.dataOutRptPredefined->pdch2ZoneAirRelHumIdealPeak, c->coilName_, c->rmPeakRelHum, 4); + OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilUA, c->coilName_, c->coilUA, 3); + OutputReportPredefined::PreDefTableEntry( + state, state.dataOutRptPredefined->pdch2ZoneSensibleLoadIdealPeak, c->coilName_, c->rmSensibleAtPeak, 2); OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2ZoneAirHumRatIdealPeak, c->coilName_, c->rmPeakHumRat, 8); + state, state.dataOutRptPredefined->pdch2ZoneLatentLoadIdealPeak, c->coilName_, c->rmLatentAtPeak); } - - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2ZoneAirRelHumIdealPeak, c->coilName_, c->rmPeakRelHum, 4); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2CoilUA, c->coilName_, c->coilUA, 3); - OutputReportPredefined::PreDefTableEntry( - state, state.dataOutRptPredefined->pdch2ZoneSensibleLoadIdealPeak, c->coilName_, c->rmSensibleAtPeak, 2); - OutputReportPredefined::PreDefTableEntry(state, state.dataOutRptPredefined->pdch2ZoneLatentLoadIdealPeak, c->coilName_, c->rmLatentAtPeak); } -} - -void setCoilFinalSizes(EnergyPlusData &state, - int const coilNum, - Real64 const totGrossCap, // total capacity [W] - Real64 const sensGrossCap, // sensible capacity [W] - Real64 const airFlowRate, // design or reference or rated air flow rate [m3/s] - Real64 const waterFlowRate // design or reference or rated water flow rate [m3/s] -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - if (c != nullptr) { - c->coilTotCapFinal = totGrossCap; - c->coilSensCapFinal = sensGrossCap; - c->coilRefAirVolFlowFinal = airFlowRate; - c->coilRefWaterVolFlowFinal = waterFlowRate; + + void setCoilFinalSizes(EnergyPlusData &state, + int const coilNum, + Real64 const totGrossCap, // total capacity [W] + Real64 const sensGrossCap, // sensible capacity [W] + Real64 const airFlowRate, // design or reference or rated air flow rate [m3/s] + Real64 const waterFlowRate // design or reference or rated water flow rate [m3/s] + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + if (c != nullptr) { + c->coilTotCapFinal = totGrossCap; + c->coilSensCapFinal = sensGrossCap; + c->coilRefAirVolFlowFinal = airFlowRate; + c->coilRefWaterVolFlowFinal = waterFlowRate; + } } -} - - -void doAirLoopSetup(EnergyPlusData &state, int const coilVecIndex) -{ - // this routine sets up some things for central air systems, needs to follow setting of an airloop num - auto *c = state.dataRptCoilSelection->coils[coilVecIndex]; - if (c->airloopNum > 0 && c->airloopNum <= int(state.dataAirSystemsData->PrimaryAirSystems.size())) { - // see if there is an OA controller - if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysExists) { - // loop over OA controllers and match node num ? - for (int loop = 1; loop <= state.dataMixedAir->NumOAControllers; ++loop) { - if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysInletNodeNum == state.dataMixedAir->OAController(loop).RetNode) { - c->oaControllerNum = loop; + + void doAirLoopSetup(EnergyPlusData &state, int const coilVecIndex) + { + // this routine sets up some things for central air systems, needs to follow setting of an airloop num + auto *c = state.dataRptCoilSelection->coils[coilVecIndex]; + if (c->airloopNum > 0 && c->airloopNum <= int(state.dataAirSystemsData->PrimaryAirSystems.size())) { + // see if there is an OA controller + if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysExists) { + // loop over OA controllers and match node num ? + for (int loop = 1; loop <= state.dataMixedAir->NumOAControllers; ++loop) { + if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysInletNodeNum == + state.dataMixedAir->OAController(loop).RetNode) { + c->oaControllerNum = loop; + } } } - } - // fill list of zones connected to this air loop - // this could be reworked to use different structure which is available now since std 62.1 changes - if (allocated(state.dataAirLoop->AirToZoneNodeInfo)) { - if (state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesCooled > 0) { - int zoneCount = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesCooled; - c->zoneNum.resize(zoneCount); - c->zoneName.resize(zoneCount); - for (int loopZone = 1; loopZone <= state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesCooled; ++loopZone) { - c->zoneNum[loopZone - 1] = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).CoolCtrlZoneNums(loopZone); - c->zoneName[loopZone - 1] = state.dataHeatBal->Zone(c->zoneNum[loopZone - 1]).Name; + // fill list of zones connected to this air loop + // this could be reworked to use different structure which is available now since std 62.1 changes + if (allocated(state.dataAirLoop->AirToZoneNodeInfo)) { + if (state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesCooled > 0) { + int zoneCount = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesCooled; + c->zoneNum.resize(zoneCount); + c->zoneName.resize(zoneCount); + for (int loopZone = 1; loopZone <= state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesCooled; ++loopZone) { + c->zoneNum[loopZone - 1] = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).CoolCtrlZoneNums(loopZone); + c->zoneName[loopZone - 1] = state.dataHeatBal->Zone(c->zoneNum[loopZone - 1]).Name; + } } - } - if (state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesHeated > 0) { - int zoneCount = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesHeated; - for (int loopZone = 1; loopZone <= zoneCount; ++loopZone) { - int zoneIndex = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).HeatCtrlZoneNums(loopZone); - // see if this zone is new or already in list - bool found = false; - for (auto const &z : c->zoneNum) { - if (z == zoneIndex) { - found = true; - break; + if (state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesHeated > 0) { + int zoneCount = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).NumZonesHeated; + for (int loopZone = 1; loopZone <= zoneCount; ++loopZone) { + int zoneIndex = state.dataAirLoop->AirToZoneNodeInfo(c->airloopNum).HeatCtrlZoneNums(loopZone); + // see if this zone is new or already in list + bool found = false; + for (auto const &z : c->zoneNum) { + if (z == zoneIndex) { + found = true; + break; + } + } + if (!found) { // add it + c->zoneNum.emplace_back(zoneIndex); + c->zoneName.emplace_back(state.dataHeatBal->Zone(zoneIndex).Name); } - } - if (!found) { // add it - c->zoneNum.emplace_back(zoneIndex); - c->zoneName.emplace_back(state.dataHeatBal->Zone(zoneIndex).Name); } } } } } -} -void doZoneEqSetup(EnergyPlusData &state, int const coilNum) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilLocation = "Zone"; - c->zoneNum.resize(1); - c->zoneNum[0] = c->zoneEqNum; - c->zoneName.resize(1); - c->zoneName[0] = state.dataHeatBal->Zone(c->zoneNum[0]).Name; - c->typeHVACname = "Zone Equipment"; // init + void doZoneEqSetup(EnergyPlusData &state, int const coilNum) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilLocation = "Zone"; + c->zoneNum.resize(1); + c->zoneNum[0] = c->zoneEqNum; + c->zoneName.resize(1); + c->zoneName[0] = state.dataHeatBal->Zone(c->zoneNum[0]).Name; + c->typeHVACname = "Zone Equipment"; // init - // find the system and get c->oaControllerNum + // find the system and get c->oaControllerNum - // need to rework for new multiple air handler in zone + // need to rework for new multiple air handler in zone - // going to need the zone inlet node index for this now... how to find it?? + // going to need the zone inlet node index for this now... how to find it?? - // maybe not needed, would be set in other calls c->airloopNum = DataZoneEquipment::ZoneEquipConfig( c->zoneEqNum ).AirLoopNum; + // maybe not needed, would be set in other calls c->airloopNum = DataZoneEquipment::ZoneEquipConfig( c->zoneEqNum ).AirLoopNum; - if (c->airloopNum > 0) { - if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysExists) { - // loop over OA controllers and match node num ? - for (int loop = 1; loop <= state.dataMixedAir->NumOAControllers; ++loop) { - if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysInletNodeNum == state.dataMixedAir->OAController(loop).RetNode) { - c->oaControllerNum = loop; + if (c->airloopNum > 0) { + if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysExists) { + // loop over OA controllers and match node num ? + for (int loop = 1; loop <= state.dataMixedAir->NumOAControllers; ++loop) { + if (state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).OASysInletNodeNum == + state.dataMixedAir->OAController(loop).RetNode) { + c->oaControllerNum = loop; + } } } + // fill out supply fan info + auto *fan = state.dataFans->fans(state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).supFanNum); + setCoilSupplyFanInfo(state, coilNum, fan->Name, fan->type, state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).supFanNum); } - // fill out supply fan info - auto *fan = state.dataFans->fans(state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).supFanNum); - setCoilSupplyFanInfo( - state, coilNum, fan->Name, fan->type, state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).supFanNum); - } - - if (c->zoneEqNum > 0) { - associateZoneCoilWithParent(state, c); - } -} - -void doFinalProcessingOfCoilData(EnergyPlusData &state) -{ - // this routine does some final processing in preparation for writing out results - for (auto *c : state.dataRptCoilSelection->coils) { - - // mine final/hard values from coil models if (c->zoneEqNum > 0) { associateZoneCoilWithParent(state, c); } + } - if (c->airloopNum > state.dataHVACGlobal->NumPrimaryAirSys && c->oASysNum > 0) { - c->coilLocation = "DOAS AirLoop"; - c->typeHVACname = "AirLoopHVAC:DedicatedOutdoorAirSystem"; - int DOASSysNum = state.dataAirLoop->OutsideAirSys(c->oASysNum).AirLoopDOASNum; - c->userNameforHVACsystem = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].Name; - } else if (c->airloopNum > 0 && c->zoneEqNum == 0) { - c->coilLocation = "AirLoop"; - c->typeHVACname = "AirLoopHVAC"; - c->userNameforHVACsystem = state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name; - } else if (c->zoneEqNum > 0 && c->airloopNum > 0) { // e.g. reheat coil, has a system and is zone equipment - c->userNameforHVACsystem += " on air system named " + state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name; - c->coilLocation = "Zone Equipment"; - } + void doFinalProcessingOfCoilData(EnergyPlusData &state) + { + // this routine does some final processing in preparation for writing out results + for (auto *c : state.dataRptCoilSelection->coils) { - if (c->coilDesVolFlow > 0) { - c->oaPeakVolFrac = (c->oaPeakVolFlow / c->coilDesVolFlow) * 100.0; // make into percentage - } else { - c->oaPeakVolFrac = -999.0; - } + // mine final/hard values from coil models - c->coilSizingMethodConcurrenceName = DataSizing::CoilSizingConcurrenceNames[(int)c->coilSizingMethodConcurrence]; - - if (c->coilSizingMethodCapacity == DataSizing::CoolingDesignCapacity) { - c->coilSizingMethodCapacityName = "CoolingDesignCapacity"; - } else if (c->coilSizingMethodCapacity == DataSizing::HeatingDesignCapacity) { - c->coilSizingMethodCapacityName = "HeatingDesignCapacity"; - } else if (c->coilSizingMethodCapacity == DataSizing::CapacityPerFloorArea) { - c->coilSizingMethodCapacityName = "CapacityPerFloorArea"; - } else if (c->coilSizingMethodCapacity == DataSizing::FractionOfAutosizedCoolingCapacity) { - c->coilSizingMethodCapacityName = "FractionOfAutosizedCoolingCapacity"; - } else if (c->coilSizingMethodCapacity == DataSizing::FractionOfAutosizedHeatingCapacity) { - c->coilSizingMethodCapacityName = "FractionOfAutosizedHeatingCapacity"; - } + if (c->zoneEqNum > 0) { + associateZoneCoilWithParent(state, c); + } - if (c->coilSizingMethodAirFlow == DataSizing::SupplyAirFlowRate) { - c->coilSizingMethodAirFlowName = "SupplyAirFlowRate"; - } else if (c->coilSizingMethodAirFlow == DataSizing::FlowPerFloorArea) { - c->coilSizingMethodAirFlowName = "FlowPerFloorArea"; - } else if (c->coilSizingMethodAirFlow == DataSizing::FractionOfAutosizedCoolingAirflow) { - c->coilSizingMethodAirFlowName = "FractionOfAutosizedCoolingAirflow"; - } else if (c->coilSizingMethodAirFlow == DataSizing::FractionOfAutosizedHeatingAirflow) { - c->coilSizingMethodAirFlowName = "FractionOfAutosizedHeatingAirflow"; - } + if (c->airloopNum > state.dataHVACGlobal->NumPrimaryAirSys && c->oASysNum > 0) { + c->coilLocation = "DOAS AirLoop"; + c->typeHVACname = "AirLoopHVAC:DedicatedOutdoorAirSystem"; + int DOASSysNum = state.dataAirLoop->OutsideAirSys(c->oASysNum).AirLoopDOASNum; + c->userNameforHVACsystem = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].Name; + } else if (c->airloopNum > 0 && c->zoneEqNum == 0) { + c->coilLocation = "AirLoop"; + c->typeHVACname = "AirLoopHVAC"; + c->userNameforHVACsystem = state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name; + } else if (c->zoneEqNum > 0 && c->airloopNum > 0) { // e.g. reheat coil, has a system and is zone equipment + c->userNameforHVACsystem += " on air system named " + state.dataAirSystemsData->PrimaryAirSystems(c->airloopNum).Name; + c->coilLocation = "Zone Equipment"; + } - if (c->isCoilSizingForTotalLoad) { - c->coilPeakLoadTypeToSizeOnName = "Total"; - } else { - c->coilPeakLoadTypeToSizeOnName = "Sensible"; - } + if (c->coilDesVolFlow > 0) { + c->oaPeakVolFrac = (c->oaPeakVolFlow / c->coilDesVolFlow) * 100.0; // make into percentage + } else { + c->oaPeakVolFrac = -999.0; + } - if (c->capIsAutosized) { - c->coilCapAutoMsg = "Yes"; - } else { - c->coilCapAutoMsg = "No"; - } + c->coilSizingMethodConcurrenceName = DataSizing::CoilSizingConcurrenceNames[(int)c->coilSizingMethodConcurrence]; + + if (c->coilSizingMethodCapacity == DataSizing::CoolingDesignCapacity) { + c->coilSizingMethodCapacityName = "CoolingDesignCapacity"; + } else if (c->coilSizingMethodCapacity == DataSizing::HeatingDesignCapacity) { + c->coilSizingMethodCapacityName = "HeatingDesignCapacity"; + } else if (c->coilSizingMethodCapacity == DataSizing::CapacityPerFloorArea) { + c->coilSizingMethodCapacityName = "CapacityPerFloorArea"; + } else if (c->coilSizingMethodCapacity == DataSizing::FractionOfAutosizedCoolingCapacity) { + c->coilSizingMethodCapacityName = "FractionOfAutosizedCoolingCapacity"; + } else if (c->coilSizingMethodCapacity == DataSizing::FractionOfAutosizedHeatingCapacity) { + c->coilSizingMethodCapacityName = "FractionOfAutosizedHeatingCapacity"; + } - if (c->volFlowIsAutosized) { - c->coilVolFlowAutoMsg = "Yes"; - } else { - c->coilVolFlowAutoMsg = "No"; - } + if (c->coilSizingMethodAirFlow == DataSizing::SupplyAirFlowRate) { + c->coilSizingMethodAirFlowName = "SupplyAirFlowRate"; + } else if (c->coilSizingMethodAirFlow == DataSizing::FlowPerFloorArea) { + c->coilSizingMethodAirFlowName = "FlowPerFloorArea"; + } else if (c->coilSizingMethodAirFlow == DataSizing::FractionOfAutosizedCoolingAirflow) { + c->coilSizingMethodAirFlowName = "FractionOfAutosizedCoolingAirflow"; + } else if (c->coilSizingMethodAirFlow == DataSizing::FractionOfAutosizedHeatingAirflow) { + c->coilSizingMethodAirFlowName = "FractionOfAutosizedHeatingAirflow"; + } - if (c->oaPretreated) { - c->coilOAPretreatMsg = "Yes"; - } else { - c->coilOAPretreatMsg = "No"; - } + if (c->isCoilSizingForTotalLoad) { + c->coilPeakLoadTypeToSizeOnName = "Total"; + } else { + c->coilPeakLoadTypeToSizeOnName = "Sensible"; + } - // call psych routine to flush out moist air metrics from those available - if (c->coilDesEntTemp != -999.0 && c->coilDesEntHumRat != -999.0) { - c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "doFinalProcessingOfCoilData"); - if (c->coilDesEntHumRat != -999.0) { - c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); + if (c->capIsAutosized) { + c->coilCapAutoMsg = "Yes"; + } else { + c->coilCapAutoMsg = "No"; } - } - if (c->oaPeakTemp != -999.0 && c->oaPeakHumRat != -999.0) { - c->oaPeakWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->oaPeakTemp, c->oaPeakHumRat, state.dataEnvrn->StdBaroPress, "doFinalProcessingOfCoilData"); - } - if (c->waterLoopNum > 0 && c->pltSizNum > 0) { + if (c->volFlowIsAutosized) { + c->coilVolFlowAutoMsg = "Yes"; + } else { + c->coilVolFlowAutoMsg = "No"; + } - c->plantLoopName = state.dataPlnt->PlantLoop(c->waterLoopNum).Name; - if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) { - c->rhoFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) - .glycol->getDensity(state, Constant::InitConvTemp, "doFinalProcessingOfCoilData"); + if (c->oaPretreated) { + c->coilOAPretreatMsg = "Yes"; + } else { + c->coilOAPretreatMsg = "No"; + } - c->cpFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) - .glycol->getSpecificHeat(state, Constant::InitConvTemp, "doFinalProcessingOfCoilData"); - } else { // steam loop - c->rhoFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) - .steam->getSatDensity(state, 100.0, 1.0, "doFinalProcessingOfCoilData"); - c->cpFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) - .steam->getSatSpecificHeat(state, 100.0, 0.0, "doFinalProcessingOfCoilData"); + // call psych routine to flush out moist air metrics from those available + if (c->coilDesEntTemp != -999.0 && c->coilDesEntHumRat != -999.0) { + c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "doFinalProcessingOfCoilData"); + if (c->coilDesEntHumRat != -999.0) { + c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); + } } - c->plantDesMaxMassFlowRate = state.dataPlnt->PlantLoop(c->waterLoopNum).MaxMassFlowRate; - if (c->plantDesMaxMassFlowRate > 0.0 && c->coilDesWaterMassFlow > 0.0) { - c->coilFlowPrcntPlantFlow = (c->coilDesWaterMassFlow / c->plantDesMaxMassFlowRate) * 100.0; // convert to percentage. + if (c->oaPeakTemp != -999.0 && c->oaPeakHumRat != -999.0) { + c->oaPeakWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->oaPeakTemp, c->oaPeakHumRat, state.dataEnvrn->StdBaroPress, "doFinalProcessingOfCoilData"); } - } - // fill out some fan information - HVAC::FanType locFanType = HVAC::FanType::Invalid; - if (c->supFanNum == 0) { - c->supFanNum = Fans::GetFanIndex(state, c->fanAssociatedWithCoilName); - } - if (c->supFanNum != 0) { - auto *fan = state.dataFans->fans(c->supFanNum); - locFanType = fan->type; - c->fanTypeName = HVAC::fanTypeNames[(int)locFanType]; - c->fanSizeMaxAirVolumeFlow = fan->maxAirFlowRate; - c->fanSizeMaxAirMassFlow = fan->maxAirMassFlowRate; - } + if (c->waterLoopNum > 0 && c->pltSizNum > 0) { - c->coilAndFanNetTotalCapacityIdealPeak = c->coilTotCapAtPeak - c->fanHeatGainIdealPeak; + c->plantLoopName = state.dataPlnt->PlantLoop(c->waterLoopNum).Name; + if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) { + c->rhoFluid = + state.dataPlnt->PlantLoop(c->waterLoopNum).glycol->getDensity(state, Constant::InitConvTemp, "doFinalProcessingOfCoilData"); - // fill out some plant design info - if (c->pltSizNum > 0) { - c->plantDesSupTemp = state.dataSize->PlantSizData(c->pltSizNum).ExitTemp; - c->plantDesDeltaTemp = state.dataSize->PlantSizData(c->pltSizNum).DeltaT; - if (state.dataSize->PlantSizData(c->pltSizNum).LoopType == DataSizing::TypeOfPlantLoop::Heating) { - c->plantDesRetTemp = c->plantDesSupTemp - c->plantDesDeltaTemp; - } else if (state.dataSize->PlantSizData(c->pltSizNum).LoopType == DataSizing::TypeOfPlantLoop::Cooling || - state.dataSize->PlantSizData(c->pltSizNum).LoopType == DataSizing::TypeOfPlantLoop::Condenser) { - c->plantDesRetTemp = c->plantDesSupTemp + c->plantDesDeltaTemp; + c->cpFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) + .glycol->getSpecificHeat(state, Constant::InitConvTemp, "doFinalProcessingOfCoilData"); + } else { // steam loop + c->rhoFluid = state.dataPlnt->PlantLoop(c->waterLoopNum).steam->getSatDensity(state, 100.0, 1.0, "doFinalProcessingOfCoilData"); + c->cpFluid = + state.dataPlnt->PlantLoop(c->waterLoopNum).steam->getSatSpecificHeat(state, 100.0, 0.0, "doFinalProcessingOfCoilData"); + } + c->plantDesMaxMassFlowRate = state.dataPlnt->PlantLoop(c->waterLoopNum).MaxMassFlowRate; + if (c->plantDesMaxMassFlowRate > 0.0 && c->coilDesWaterMassFlow > 0.0) { + c->coilFlowPrcntPlantFlow = (c->coilDesWaterMassFlow / c->plantDesMaxMassFlowRate) * 100.0; // convert to percentage. + } + } + // fill out some fan information + HVAC::FanType locFanType = HVAC::FanType::Invalid; + if (c->supFanNum == 0) { + c->supFanNum = Fans::GetFanIndex(state, c->fanAssociatedWithCoilName); } - if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) { - c->plantDesCapacity = c->cpFluid * c->rhoFluid * state.dataSize->PlantSizData(c->pltSizNum).DeltaT * - state.dataSize->PlantSizData(c->pltSizNum).DesVolFlowRate; - } else { - // find boiler on this plant loop and get capacity from it - if (allocated(state.dataBoilerSteam->Boiler)) { - for (int boilerIndex = 1; boilerIndex <= (int)state.dataBoilerSteam->Boiler.size(); ++boilerIndex) { - if (state.dataBoilerSteam->Boiler(boilerIndex).plantLoc.loopNum == c->waterLoopNum) { // steam boiler on this loop - c->plantDesSupTemp = state.dataBoilerSteam->Boiler(boilerIndex).TempUpLimitBoilerOut; - c->plantDesRetTemp = state.dataBoilerSteam->Boiler(boilerIndex).TempUpLimitBoilerOut - c->plantDesDeltaTemp; - c->plantDesCapacity = state.dataBoilerSteam->Boiler(boilerIndex).NomCap; + if (c->supFanNum != 0) { + auto *fan = state.dataFans->fans(c->supFanNum); + locFanType = fan->type; + c->fanTypeName = HVAC::fanTypeNames[(int)locFanType]; + c->fanSizeMaxAirVolumeFlow = fan->maxAirFlowRate; + c->fanSizeMaxAirMassFlow = fan->maxAirMassFlowRate; + } + + c->coilAndFanNetTotalCapacityIdealPeak = c->coilTotCapAtPeak - c->fanHeatGainIdealPeak; + + // fill out some plant design info + if (c->pltSizNum > 0) { + c->plantDesSupTemp = state.dataSize->PlantSizData(c->pltSizNum).ExitTemp; + c->plantDesDeltaTemp = state.dataSize->PlantSizData(c->pltSizNum).DeltaT; + if (state.dataSize->PlantSizData(c->pltSizNum).LoopType == DataSizing::TypeOfPlantLoop::Heating) { + c->plantDesRetTemp = c->plantDesSupTemp - c->plantDesDeltaTemp; + } else if (state.dataSize->PlantSizData(c->pltSizNum).LoopType == DataSizing::TypeOfPlantLoop::Cooling || + state.dataSize->PlantSizData(c->pltSizNum).LoopType == DataSizing::TypeOfPlantLoop::Condenser) { + c->plantDesRetTemp = c->plantDesSupTemp + c->plantDesDeltaTemp; + } + + if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) { + c->plantDesCapacity = c->cpFluid * c->rhoFluid * state.dataSize->PlantSizData(c->pltSizNum).DeltaT * + state.dataSize->PlantSizData(c->pltSizNum).DesVolFlowRate; + } else { + // find boiler on this plant loop and get capacity from it + if (allocated(state.dataBoilerSteam->Boiler)) { + for (int boilerIndex = 1; boilerIndex <= (int)state.dataBoilerSteam->Boiler.size(); ++boilerIndex) { + if (state.dataBoilerSteam->Boiler(boilerIndex).plantLoc.loopNum == c->waterLoopNum) { // steam boiler on this loop + c->plantDesSupTemp = state.dataBoilerSteam->Boiler(boilerIndex).TempUpLimitBoilerOut; + c->plantDesRetTemp = state.dataBoilerSteam->Boiler(boilerIndex).TempUpLimitBoilerOut - c->plantDesDeltaTemp; + c->plantDesCapacity = state.dataBoilerSteam->Boiler(boilerIndex).NomCap; + } } } } - } - if (c->plantDesCapacity > 0.0) { - c->coilCapPrcntPlantCap = (c->coilTotCapAtPeak / c->plantDesCapacity) * 100.0; // convert to percentage. + if (c->plantDesCapacity > 0.0) { + c->coilCapPrcntPlantCap = (c->coilTotCapAtPeak / c->plantDesCapacity) * 100.0; // convert to percentage. + } } - } - if (c->pltSizNum == 0 && c->waterLoopNum == 0) { - c->rhoFluid = -999.0; - c->cpFluid = -999.0; - c->plantDesMaxMassFlowRate = -999.0; - c->coilFlowPrcntPlantFlow = -999.0; - c->plantDesSupTemp = -999.0; - c->plantDesDeltaTemp = -999.0; - c->plantDesRetTemp = -999.0; - c->coilDesWaterMassFlow = -999.0; - c->coilDesWaterEntTemp = -999.0; - c->coilDesWaterLvgTemp = -999.0; - c->coilDesWaterTempDiff = -999.0; - c->plantDesCapacity = -999.0; - c->coilCapPrcntPlantCap = -999.0; - } + if (c->pltSizNum == 0 && c->waterLoopNum == 0) { + c->rhoFluid = -999.0; + c->cpFluid = -999.0; + c->plantDesMaxMassFlowRate = -999.0; + c->coilFlowPrcntPlantFlow = -999.0; + c->plantDesSupTemp = -999.0; + c->plantDesDeltaTemp = -999.0; + c->plantDesRetTemp = -999.0; + c->coilDesWaterMassFlow = -999.0; + c->coilDesWaterEntTemp = -999.0; + c->coilDesWaterLvgTemp = -999.0; + c->coilDesWaterTempDiff = -999.0; + c->plantDesCapacity = -999.0; + c->coilCapPrcntPlantCap = -999.0; + } - c->cpDryAir = Psychrometrics::PsyCpAirFnW(0.0); - c->rhoStandAir = state.dataEnvrn->StdRhoAir; - - // apply ADP method to find an SHR for Ideal loads peak, calculate sensible capacity for cooling coils - if (c->coilDesEntTemp > c->coilDesLvgTemp) { // cooling coil - Real64 CoilADPTemp = - Psychrometrics::PsyTdpFnWPb(state, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress); // apparatus dewpoint temperature - Real64 CoilADPHumRat = - Psychrometrics::PsyWFnTdpPb(state, CoilADPTemp, state.dataEnvrn->StdBaroPress); // humidity ratio at apparatus dewpoint temperaure - Real64 CoilTinwADPEnthalpy = Psychrometrics::PsyHFnTdbW( - c->coilDesEntTemp, CoilADPHumRat); // Enthalpy at inlet drybulb and humidity ratio at apparatus dewpoint temperature - Real64 CoilADPEnthalpy = - Psychrometrics::PsyHFnTdbW(CoilADPTemp, CoilADPHumRat); // Enthalpy at apparatus dewpoint, with Tdb set at apparatus dewpoint - Real64 SHRatIdealPeak(1.0); - if ((c->coilDesEntEnth - CoilADPEnthalpy) > 1.e-10) { - SHRatIdealPeak = min((CoilTinwADPEnthalpy - CoilADPEnthalpy) / (c->coilDesEntEnth - CoilADPEnthalpy), 1.0); // calculate SHR - } else { - SHRatIdealPeak = 1.0; + c->cpDryAir = Psychrometrics::PsyCpAirFnW(0.0); + c->rhoStandAir = state.dataEnvrn->StdRhoAir; + + // apply ADP method to find an SHR for Ideal loads peak, calculate sensible capacity for cooling coils + if (c->coilDesEntTemp > c->coilDesLvgTemp) { // cooling coil + Real64 CoilADPTemp = + Psychrometrics::PsyTdpFnWPb(state, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress); // apparatus dewpoint temperature + Real64 CoilADPHumRat = + Psychrometrics::PsyWFnTdpPb(state, CoilADPTemp, state.dataEnvrn->StdBaroPress); // humidity ratio at apparatus dewpoint temperaure + Real64 CoilTinwADPEnthalpy = Psychrometrics::PsyHFnTdbW( + c->coilDesEntTemp, CoilADPHumRat); // Enthalpy at inlet drybulb and humidity ratio at apparatus dewpoint temperature + Real64 CoilADPEnthalpy = + Psychrometrics::PsyHFnTdbW(CoilADPTemp, CoilADPHumRat); // Enthalpy at apparatus dewpoint, with Tdb set at apparatus dewpoint + Real64 SHRatIdealPeak(1.0); + if ((c->coilDesEntEnth - CoilADPEnthalpy) > 1.e-10) { + SHRatIdealPeak = min((CoilTinwADPEnthalpy - CoilADPEnthalpy) / (c->coilDesEntEnth - CoilADPEnthalpy), 1.0); // calculate SHR + } else { + SHRatIdealPeak = 1.0; + } + c->coilSensCapAtPeak = SHRatIdealPeak * c->coilTotCapAtPeak; } - c->coilSensCapAtPeak = SHRatIdealPeak * c->coilTotCapAtPeak; - } - } // end for loop over each coil -} - -int getReportIndex(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - HVAC::CoilType coilType // idf input object class name of coil - ) -{ - for (int i = 0; i < (int)state.dataRptCoilSelection->coils.size(); i++) { - auto *c = state.dataRptCoilSelection->coils[i]; - if (c != nullptr) { // Why would this be nullptr? - if (Util::SameString(c->coilName_, coilName)) { - if (c->coilType == coilType) { - return i; + } // end for loop over each coil + } + + int getReportIndex(EnergyPlusData &state, + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType coilType // idf input object class name of coil + ) + { + for (int i = 0; i < (int)state.dataRptCoilSelection->coils.size(); i++) { + auto *c = state.dataRptCoilSelection->coils[i]; + if (c != nullptr) { // Why would this be nullptr? + if (Util::SameString(c->coilName_, coilName)) { + if (c->coilType == coilType) { + return i; + } + // throw error coil type does not match coil name, check for unique names across coil types + ShowWarningError(state, + EnergyPlus::format("check for unique coil names across different coil types: {} occurs in both {} and {}", + coilName, + HVAC::coilTypeNamesUC[(int)coilType], + HVAC::coilTypeNamesUC[(int)c->coilType])); } - // throw error coil type does not match coil name, check for unique names across coil types - ShowWarningError(state, - EnergyPlus::format("check for unique coil names across different coil types: {} occurs in both {} and {}", - coilName, - HVAC::coilTypeNamesUC[(int)coilType], - HVAC::coilTypeNamesUC[(int)c->coilType])); } } + + auto *c = new CoilSelectionData(coilName); + + state.dataRptCoilSelection->coils.push_back(c); + c->coilType = coilType; + c->isCooling = HVAC::coilTypeIsCooling[(int)coilType]; + c->isHeating = HVAC::coilTypeIsHeating[(int)coilType]; + + return state.dataRptCoilSelection->coils.size() - 1; } - auto *c = new CoilSelectionData(coilName); - - state.dataRptCoilSelection->coils.push_back(c); - c->coilType = coilType; - c->isCooling = HVAC::coilTypeIsCooling[(int)coilType]; - c->isHeating = HVAC::coilTypeIsHeating[(int)coilType]; - - return state.dataRptCoilSelection->coils.size() - 1; -} - -void associateZoneCoilWithParent(EnergyPlusData &state, CoilSelectionData *c) -{ - c->coilLocation = "Unknown"; - c->typeHVACname = "Unknown"; - c->userNameforHVACsystem = "Unknown"; - // now search equipment - auto const &zoneEquipList = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum); - bool coilFound = false; - std::string fanType; - std::string fanName; - auto thisSubCoilLambda = [&c](const DataZoneEquipment::SubEquipmentData &myCoil) { return myCoil.Name == c->coilName_; }; - auto thisSubFanLambda = [](const DataZoneEquipment::SubEquipmentData &myFan) { return myFan.TypeOf.rfind("FAN:", 0) == 0; }; - auto thisSubSubCoilLambda = [&c](const DataZoneEquipment::SubSubEquipmentData &myCoil) { return myCoil.Name == c->coilName_; }; - auto thisSubSubFanLambda = [](const DataZoneEquipment::SubSubEquipmentData &myFan) { return myFan.TypeOf.rfind("FAN:", 0) == 0; }; - - for (int equipLoop = 1; equipLoop <= zoneEquipList.NumOfEquipTypes; ++equipLoop) { - // coil should be found only once, fan could be found multiple times, reset here - // for each type of equipment (equipLoop) only one coil and fan could be found as a pair - bool fanFound = false; - auto &thisSubEq = zoneEquipList.EquipData(equipLoop).SubEquipData; - - // search for coil and fan SubEquipData and return parent type/name and fan type/name for coil reports. - if (std::find_if(thisSubEq.begin(), thisSubEq.end(), thisSubCoilLambda) != thisSubEq.end()) { - c->typeHVACname = zoneEquipList.EquipTypeName(equipLoop); - c->userNameforHVACsystem = zoneEquipList.EquipName(equipLoop); - c->coilLocation = "Zone Equipment"; - int zoneEqListIndex = Util::FindItemInList(zoneEquipList.Name, state.dataZoneEquip->ZoneEquipList); - if (c->zoneNum.empty()) { - c->zoneNum.resize(1); - } - c->zoneNum[0] = zoneEqListIndex; - if (c->zoneName.empty()) { - c->zoneName.resize(1); - } - c->zoneName[0] = state.dataHeatBal->Zone(zoneEqListIndex).Name; - coilFound = true; - } - auto const &fanIterator = std::find_if(thisSubEq.begin(), thisSubEq.end(), thisSubFanLambda); - if (fanIterator != thisSubEq.end()) { - unsigned int fanIndex = fanIterator - thisSubEq.begin(); - // notice the brackets on the Array1D for [fanIndex] - fanType = thisSubEq[fanIndex].TypeOf; - fanName = thisSubEq[fanIndex].Name; - fanFound = true; - } - // if coil not found in SubEquipData then maybe it's HXAssisted and in SubSubEquipData. Fan is usually already found if exists. - if (!coilFound || !fanFound) { - for (int subEq = 1; subEq <= zoneEquipList.EquipData(equipLoop).NumSubEquip; ++subEq) { - auto &thisSubSubEq = zoneEquipList.EquipData(equipLoop).SubEquipData(subEq).SubSubEquipData; - if (!coilFound) { - auto const &coilIterator2 = std::find_if(thisSubSubEq.begin(), thisSubSubEq.end(), thisSubSubCoilLambda); - if (coilIterator2 != thisSubSubEq.end()) { - c->typeHVACname = zoneEquipList.EquipTypeName(equipLoop); - c->userNameforHVACsystem = zoneEquipList.EquipName(equipLoop); - c->coilLocation = "Zone Equipment"; - int zoneEqListIndex = Util::FindItemInList(zoneEquipList.Name, state.dataZoneEquip->ZoneEquipList); - if (c->zoneNum.empty()) { - c->zoneNum.resize(1); + void associateZoneCoilWithParent(EnergyPlusData &state, CoilSelectionData *c) + { + c->coilLocation = "Unknown"; + c->typeHVACname = "Unknown"; + c->userNameforHVACsystem = "Unknown"; + // now search equipment + auto const &zoneEquipList = state.dataZoneEquip->ZoneEquipList(c->zoneEqNum); + bool coilFound = false; + std::string fanType; + std::string fanName; + auto thisSubCoilLambda = [&c](const DataZoneEquipment::SubEquipmentData &myCoil) { return myCoil.Name == c->coilName_; }; + auto thisSubFanLambda = [](const DataZoneEquipment::SubEquipmentData &myFan) { return myFan.TypeOf.rfind("FAN:", 0) == 0; }; + auto thisSubSubCoilLambda = [&c](const DataZoneEquipment::SubSubEquipmentData &myCoil) { return myCoil.Name == c->coilName_; }; + auto thisSubSubFanLambda = [](const DataZoneEquipment::SubSubEquipmentData &myFan) { return myFan.TypeOf.rfind("FAN:", 0) == 0; }; + + for (int equipLoop = 1; equipLoop <= zoneEquipList.NumOfEquipTypes; ++equipLoop) { + // coil should be found only once, fan could be found multiple times, reset here + // for each type of equipment (equipLoop) only one coil and fan could be found as a pair + bool fanFound = false; + auto &thisSubEq = zoneEquipList.EquipData(equipLoop).SubEquipData; + + // search for coil and fan SubEquipData and return parent type/name and fan type/name for coil reports. + if (std::find_if(thisSubEq.begin(), thisSubEq.end(), thisSubCoilLambda) != thisSubEq.end()) { + c->typeHVACname = zoneEquipList.EquipTypeName(equipLoop); + c->userNameforHVACsystem = zoneEquipList.EquipName(equipLoop); + c->coilLocation = "Zone Equipment"; + int zoneEqListIndex = Util::FindItemInList(zoneEquipList.Name, state.dataZoneEquip->ZoneEquipList); + if (c->zoneNum.empty()) { + c->zoneNum.resize(1); + } + c->zoneNum[0] = zoneEqListIndex; + if (c->zoneName.empty()) { + c->zoneName.resize(1); + } + c->zoneName[0] = state.dataHeatBal->Zone(zoneEqListIndex).Name; + coilFound = true; + } + auto const &fanIterator = std::find_if(thisSubEq.begin(), thisSubEq.end(), thisSubFanLambda); + if (fanIterator != thisSubEq.end()) { + unsigned int fanIndex = fanIterator - thisSubEq.begin(); + // notice the brackets on the Array1D for [fanIndex] + fanType = thisSubEq[fanIndex].TypeOf; + fanName = thisSubEq[fanIndex].Name; + fanFound = true; + } + // if coil not found in SubEquipData then maybe it's HXAssisted and in SubSubEquipData. Fan is usually already found if exists. + if (!coilFound || !fanFound) { + for (int subEq = 1; subEq <= zoneEquipList.EquipData(equipLoop).NumSubEquip; ++subEq) { + auto &thisSubSubEq = zoneEquipList.EquipData(equipLoop).SubEquipData(subEq).SubSubEquipData; + if (!coilFound) { + auto const &coilIterator2 = std::find_if(thisSubSubEq.begin(), thisSubSubEq.end(), thisSubSubCoilLambda); + if (coilIterator2 != thisSubSubEq.end()) { + c->typeHVACname = zoneEquipList.EquipTypeName(equipLoop); + c->userNameforHVACsystem = zoneEquipList.EquipName(equipLoop); + c->coilLocation = "Zone Equipment"; + int zoneEqListIndex = Util::FindItemInList(zoneEquipList.Name, state.dataZoneEquip->ZoneEquipList); + if (c->zoneNum.empty()) { + c->zoneNum.resize(1); + } + c->zoneNum[0] = zoneEqListIndex; + if (c->zoneName.empty()) { + c->zoneName.resize(1); + } + c->zoneName[0] = state.dataHeatBal->Zone(zoneEqListIndex).Name; + coilFound = true; } - c->zoneNum[0] = zoneEqListIndex; - if (c->zoneName.empty()) { - c->zoneName.resize(1); + } + if (!fanFound) { + auto const &fanIterator2 = std::find_if(thisSubSubEq.begin(), thisSubSubEq.end(), thisSubSubFanLambda); + if (fanIterator2 != thisSubSubEq.end()) { + unsigned int fanIndex = fanIterator2 - thisSubSubEq.begin(); + // notice the brackets on the Array1D for [fanIndex] + fanType = thisSubSubEq[fanIndex].TypeOf; + fanName = thisSubSubEq[fanIndex].Name; + fanFound = true; } - c->zoneName[0] = state.dataHeatBal->Zone(zoneEqListIndex).Name; - coilFound = true; } - } - if (!fanFound) { - auto const &fanIterator2 = std::find_if(thisSubSubEq.begin(), thisSubSubEq.end(), thisSubSubFanLambda); - if (fanIterator2 != thisSubSubEq.end()) { - unsigned int fanIndex = fanIterator2 - thisSubSubEq.begin(); - // notice the brackets on the Array1D for [fanIndex] - fanType = thisSubSubEq[fanIndex].TypeOf; - fanName = thisSubSubEq[fanIndex].Name; - fanFound = true; + if (coilFound && fanFound) { + break; } } - if (coilFound && fanFound) { - break; + } + if (coilFound) { + if (fanFound) { + c->fanTypeName = fanType; + c->fanAssociatedWithCoilName = fanName; } + break; } + + } // for (equipLoop) + + if (c->typeHVACname == "Unknown") { + ShowWarningError(state, EnergyPlus::format("Parent object not found for zone coil = {}", c->coilName_)); } - if (coilFound) { - if (fanFound) { - c->fanTypeName = fanType; - c->fanAssociatedWithCoilName = fanName; - } - break; + } + + void setRatedCoilConditions(EnergyPlusData &state, + int const coilNum, + Real64 const RatedCoilTotCap, // ! rated coil total capacity [W] + Real64 const RatedCoilSensCap, // rated coil sensible capacity [W] + Real64 const RatedAirMassFlow, // rated coil design air mass flow rate [m3/s] + Real64 const RatedCoilInDb, // rated coil inlet air dry bulb at time of peak [C] + Real64 const RatedCoilInHumRat, // rated coil inlet air humidity ratio [kgWater/kgDryAir] + Real64 const RatedCoilInWb, // rated coil inlet air wet bulb [C] + Real64 const RatedCoilOutDb, // rated coil outlet air dry bulb [C] + Real64 const RatedCoilOutHumRat, // rated coil outlet air humidity ratio, [kgWater/kgDryAir] + Real64 const RatedCoilOutWb, // rated coil outlet air wet bulb [C] + Real64 const RatedCoilOadbRef, // rated DX coil outside air dry bulb reference [C] + Real64 const RatedCoilOawbRef, // rated DX coil outside air wet bulb reference [C] + Real64 const RatedCoilBpFactor, // rated coil bypass factor + Real64 const RatedCoilEff // rated coil effectiveness + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilRatedTotCap = RatedCoilTotCap; + c->coilRatedSensCap = RatedCoilSensCap; + c->ratedAirMassFlow = RatedAirMassFlow; + c->ratedCoilInDb = RatedCoilInDb; + c->ratedCoilInWb = RatedCoilInWb; + c->ratedCoilInHumRat = RatedCoilInHumRat; + if ((RatedCoilInDb == -999.0) || (RatedCoilInHumRat == -999.0)) { + c->ratedCoilInEnth = -999.0; + } else { + c->ratedCoilInEnth = Psychrometrics::PsyHFnTdbW(RatedCoilInDb, RatedCoilInHumRat); } - } // for (equipLoop) + c->ratedCoilOutDb = RatedCoilOutDb; + c->ratedCoilOutWb = RatedCoilOutWb; + c->ratedCoilOutHumRat = RatedCoilOutHumRat; + if ((RatedCoilOutDb == -999.0) || (RatedCoilOutHumRat == -999.0)) { + c->ratedCoilOutEnth = -999.0; + } else { + c->ratedCoilOutEnth = Psychrometrics::PsyHFnTdbW(RatedCoilOutDb, RatedCoilOutHumRat); + } - if (c->typeHVACname == "Unknown") { - ShowWarningError(state, EnergyPlus::format("Parent object not found for zone coil = {}", c->coilName_)); + c->ratedCoilEff = RatedCoilEff; + c->ratedCoilBpFactor = RatedCoilBpFactor; + // TODO //c->ratedCoilAppDewPt = + c->ratedCoilOadbRef = RatedCoilOadbRef; + c->ratedCoilOawbRef = RatedCoilOawbRef; } -} -void setRatedCoilConditions(EnergyPlusData &state, - int const coilNum, - Real64 const RatedCoilTotCap, // ! rated coil total capacity [W] - Real64 const RatedCoilSensCap, // rated coil sensible capacity [W] - Real64 const RatedAirMassFlow, // rated coil design air mass flow rate [m3/s] - Real64 const RatedCoilInDb, // rated coil inlet air dry bulb at time of peak [C] - Real64 const RatedCoilInHumRat, // rated coil inlet air humidity ratio [kgWater/kgDryAir] - Real64 const RatedCoilInWb, // rated coil inlet air wet bulb [C] - Real64 const RatedCoilOutDb, // rated coil outlet air dry bulb [C] - Real64 const RatedCoilOutHumRat, // rated coil outlet air humidity ratio, [kgWater/kgDryAir] - Real64 const RatedCoilOutWb, // rated coil outlet air wet bulb [C] - Real64 const RatedCoilOadbRef, // rated DX coil outside air dry bulb reference [C] - Real64 const RatedCoilOawbRef, // rated DX coil outside air wet bulb reference [C] - Real64 const RatedCoilBpFactor, // rated coil bypass factor - Real64 const RatedCoilEff // rated coil effectiveness -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilRatedTotCap = RatedCoilTotCap; - c->coilRatedSensCap = RatedCoilSensCap; - c->ratedAirMassFlow = RatedAirMassFlow; - c->ratedCoilInDb = RatedCoilInDb; - c->ratedCoilInWb = RatedCoilInWb; - c->ratedCoilInHumRat = RatedCoilInHumRat; - if ((RatedCoilInDb == -999.0) || (RatedCoilInHumRat == -999.0)) { - c->ratedCoilInEnth = -999.0; - } else { - c->ratedCoilInEnth = Psychrometrics::PsyHFnTdbW(RatedCoilInDb, RatedCoilInHumRat); + void setCoilAirFlow(EnergyPlusData &state, + int const coilNum, + Real64 const airVdot, // air flow rate in m3/s + bool const isAutoSized // true if air flow was autosized + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilDesVolFlow = airVdot; + c->volFlowIsAutosized = isAutoSized; + + c->coilDesMassFlow = airVdot * state.dataEnvrn->StdRhoAir; } - c->ratedCoilOutDb = RatedCoilOutDb; - c->ratedCoilOutWb = RatedCoilOutWb; - c->ratedCoilOutHumRat = RatedCoilOutHumRat; - if ((RatedCoilOutDb == -999.0) || (RatedCoilOutHumRat == -999.0)) { - c->ratedCoilOutEnth = -999.0; - } else { - c->ratedCoilOutEnth = Psychrometrics::PsyHFnTdbW(RatedCoilOutDb, RatedCoilOutHumRat); + void setCoilWaterFlowNodeNums(EnergyPlusData &state, + int const coilNum, + Real64 const waterVdot, // plant fluid flow rate in m3/s + bool const isAutoSized, // true if water flow was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const plantLoopNum // plant loop structure index + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + + int plantSizNum = -999; + if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) { + bool errorsfound = false; + plantSizNum = PlantUtilities::MyPlantSizingIndex(state, "water coil", c->coilName_, inletNodeNum, outletNodeNum, errorsfound); + } + setCoilWaterFlowPltSizNum(state, coilNum, waterVdot, isAutoSized, plantSizNum, plantLoopNum); } - c->ratedCoilEff = RatedCoilEff; - c->ratedCoilBpFactor = RatedCoilBpFactor; - // TODO //c->ratedCoilAppDewPt = - c->ratedCoilOadbRef = RatedCoilOadbRef; - c->ratedCoilOawbRef = RatedCoilOawbRef; -} - -void setCoilAirFlow(EnergyPlusData &state, - int const coilNum, - Real64 const airVdot, // air flow rate in m3/s - bool const isAutoSized // true if air flow was autosized -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilDesVolFlow = airVdot; - c->volFlowIsAutosized = isAutoSized; - - c->coilDesMassFlow = airVdot * state.dataEnvrn->StdRhoAir; -} - -void setCoilWaterFlowNodeNums(EnergyPlusData &state, - int const coilNum, - Real64 const waterVdot, // plant fluid flow rate in m3/s - bool const isAutoSized, // true if water flow was autosized - int const inletNodeNum, // coil chw inlet node num - int const outletNodeNum, // coil chw outlet node num - int const plantLoopNum // plant loop structure index -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - - int plantSizNum = -999; - if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) { - bool errorsfound = false; - plantSizNum = PlantUtilities::MyPlantSizingIndex(state, "water coil", c->coilName_, inletNodeNum, outletNodeNum, errorsfound); + void setCoilWaterFlowPltSizNum(EnergyPlusData &state, + int const coilNum, + Real64 const waterVdot, // plant fluid flow rate in m3/s + bool const isAutoSized, // true if water flow was autosized + int const plantSizNum, // plant sizing structure index + int const plantLoopNum) // plant loop structure index + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->pltSizNum = plantSizNum; + c->waterLoopNum = plantLoopNum; + if (c->waterLoopNum > 0) { + c->plantLoopName = state.dataPlnt->PlantLoop(c->waterLoopNum).Name; + } + + if (c->waterLoopNum > 0 && c->pltSizNum > 0) { + if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) { + c->rhoFluid = state.dataPlnt->PlantLoop(c->waterLoopNum).glycol->getDensity(state, Constant::InitConvTemp, "setCoilWaterFlow"); + + c->cpFluid = state.dataPlnt->PlantLoop(c->waterLoopNum).glycol->getSpecificHeat(state, Constant::InitConvTemp, "setCoilWaterFlow"); + } else { // steam loop + c->rhoFluid = state.dataPlnt->PlantLoop(c->waterLoopNum).steam->getSatDensity(state, 100.0, 1.0, "setCoilWaterFlow"); + c->cpFluid = state.dataPlnt->PlantLoop(c->waterLoopNum).steam->getSatSpecificHeat(state, 100.0, 0.0, "setCoilWaterFlow"); + } + } + if (c->rhoFluid > 0.0) { + c->coilDesWaterMassFlow = waterVdot * c->rhoFluid; + } + if (isAutoSized) { + c->coilWaterFlowAutoMsg = "Yes"; + } else { + c->coilWaterFlowAutoMsg = "No"; + } } - setCoilWaterFlowPltSizNum(state, coilNum, waterVdot, isAutoSized, plantSizNum, plantLoopNum); -} - -void setCoilWaterFlowPltSizNum(EnergyPlusData &state, - int const coilNum, - Real64 const waterVdot, // plant fluid flow rate in m3/s - bool const isAutoSized, // true if water flow was autosized - int const plantSizNum, // plant sizing structure index - int const plantLoopNum) // plant loop structure index -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->pltSizNum = plantSizNum; - c->waterLoopNum = plantLoopNum; - if (c->waterLoopNum > 0) { - c->plantLoopName = state.dataPlnt->PlantLoop(c->waterLoopNum).Name; + + void setCoilEntAirTemp(EnergyPlusData &state, + int const coilNum, + Real64 const entAirDryBulbTemp, // degree C air entering coil + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum // zone equipment list index, if non-zero + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilDesEntTemp = entAirDryBulbTemp; + c->airloopNum = curSysNum; + doAirLoopSetup(state, coilNum); + c->zoneEqNum = curZoneEqNum; } - if (c->waterLoopNum > 0 && c->pltSizNum > 0) { - if (state.dataSize->PlantSizData(c->pltSizNum).LoopType != DataSizing::TypeOfPlantLoop::Steam) { - c->rhoFluid = - state.dataPlnt->PlantLoop(c->waterLoopNum).glycol->getDensity(state, Constant::InitConvTemp, "setCoilWaterFlow"); - - c->cpFluid = state.dataPlnt->PlantLoop(c->waterLoopNum) - .glycol->getSpecificHeat(state, Constant::InitConvTemp, "setCoilWaterFlow"); - } else { // steam loop - c->rhoFluid = state.dataPlnt->PlantLoop(c->waterLoopNum).steam->getSatDensity(state, 100.0, 1.0, "setCoilWaterFlow"); - c->cpFluid = - state.dataPlnt->PlantLoop(c->waterLoopNum).steam->getSatSpecificHeat(state, 100.0, 0.0, "setCoilWaterFlow"); - } + void setCoilEntAirHumRat(EnergyPlusData &state, int const coilNum, Real64 const entAirHumrat) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilDesEntHumRat = entAirHumrat; } - if (c->rhoFluid > 0.0) { - c->coilDesWaterMassFlow = waterVdot * c->rhoFluid; + + void setCoilEntWaterTemp(EnergyPlusData &state, + int const coilNum, + Real64 const entWaterTemp // + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilDesWaterEntTemp = entWaterTemp; } - if (isAutoSized) { - c->coilWaterFlowAutoMsg = "Yes"; - } else { - c->coilWaterFlowAutoMsg = "No"; + + void setCoilLvgWaterTemp(EnergyPlusData &state, + int const coilNum, + Real64 const lvgWaterTemp // + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilDesWaterLvgTemp = lvgWaterTemp; } -} - -void setCoilEntAirTemp(EnergyPlusData &state, - int const coilNum, - Real64 const entAirDryBulbTemp, // degree C air entering coil - int const curSysNum, // airloop system number index, if non zero - int const curZoneEqNum // zone equipment list index, if non-zero -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilDesEntTemp = entAirDryBulbTemp; - c->airloopNum = curSysNum; - doAirLoopSetup(state, coilNum); - c->zoneEqNum = curZoneEqNum; -} - -void setCoilEntAirHumRat(EnergyPlusData &state, - int const coilNum, - Real64 const entAirHumrat) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilDesEntHumRat = entAirHumrat; -} - -void setCoilEntWaterTemp(EnergyPlusData &state, - int const coilNum, - Real64 const entWaterTemp // -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilDesWaterEntTemp = entWaterTemp; -} - -void setCoilLvgWaterTemp(EnergyPlusData &state, - int const coilNum, - Real64 const lvgWaterTemp // -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilDesWaterLvgTemp = lvgWaterTemp; -} - -void setCoilWaterDeltaT(EnergyPlusData &state, - int const coilNum, - Real64 const CoilWaterDeltaT // degree C temperature difference used to size coil -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilDesWaterTempDiff = CoilWaterDeltaT; -} - -void setCoilLvgAirTemp(EnergyPlusData &state, - int const coilNum, - Real64 const lvgAirDryBulbTemp // -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilDesLvgTemp = lvgAirDryBulbTemp; -} - -void setCoilLvgAirHumRat(EnergyPlusData &state, - int const coilNum, - Real64 const lvgAirHumRat // -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilDesLvgHumRat = lvgAirHumRat; -} - -std::string PeakHrMinString(EnergyPlusData &state, const int designDay, const int timeStepAtPeak) -{ - return fmt::format("{}/{} {}", - state.dataWeather->DesDayInput(designDay).Month, - state.dataWeather->DesDayInput(designDay).DayOfMonth, - getTimeText(state, timeStepAtPeak)); -} - -void setCoilCoolingCapacity( - EnergyPlusData &state, - int const coilNum, - Real64 const TotalCoolingCap, // {W} coil cooling capacity, sizing result - bool const isAutoSize, // true if value was autosized - int const curSysNum, // airloop system number index, if non zero - int const curZoneEqNum, // zone equipment list index, if non-zero - int const curOASysNum, // OA system equipment list index, if non-zero - Real64 const fanCoolLoad, // {W} fan load used in ideal loads coil sizing - Real64 const coilCapFunTempFac, // {W} curve result for modification factor for capacity as a function of temperature - Real64 const DXFlowPerCapMinRatio, // non dimensional ratio, capacity adjustment ratio min - Real64 const DXFlowPerCapMaxRatio // non dimensional ratio, capacity adjustment ratio max -) -{ - auto &ZoneEqSizing(state.dataSize->ZoneEqSizing); - auto &SysSizPeakDDNum(state.dataSize->SysSizPeakDDNum); - - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - // no this is adjusted back to ratings c->coilTotCapAtPeak = TotalCoolingCap; - c->coilCapFTIdealPeak = coilCapFunTempFac; - c->coilTotCapAtPeak = TotalCoolingCap * c->coilCapFTIdealPeak; - c->capIsAutosized = isAutoSize; - c->minRatio = DXFlowPerCapMinRatio; - c->maxRatio = DXFlowPerCapMaxRatio; - - c->fanHeatGainIdealPeak = fanCoolLoad; - c->airloopNum = curSysNum; - doAirLoopSetup(state, coilNum); - c->zoneEqNum = curZoneEqNum; - // if ( c->zoneEqNum > 0 ) doZoneEqSetup( index ); - c->oASysNum = curOASysNum; - - if (curSysNum > 0 && c->zoneEqNum == 0 && allocated(state.dataSize->FinalSysSizing) && allocated(SysSizPeakDDNum) && - curSysNum <= state.dataHVACGlobal->NumPrimaryAirSys) { - - // These next blocks does not always work with SizingPeriod:WeatherFileDays or SizingPeriod:WeatherFileConditionType, protect against hard - // crash - if (SysSizPeakDDNum(curSysNum).SensCoolPeakDD > 0 && SysSizPeakDDNum(curSysNum).SensCoolPeakDD <= state.dataEnvrn->TotDesDays) { - c->desDayNameAtSensPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).SensCoolPeakDD).Title; - c->coilSensePeakHrMin = PeakHrMinString(state, - SysSizPeakDDNum(curSysNum).SensCoolPeakDD, - SysSizPeakDDNum(curSysNum).TimeStepAtSensCoolPk(SysSizPeakDDNum(curSysNum).SensCoolPeakDD)); - } - if (SysSizPeakDDNum(curSysNum).TotCoolPeakDD > 0 && SysSizPeakDDNum(curSysNum).TotCoolPeakDD <= state.dataEnvrn->TotDesDays) { - c->desDayNameAtTotalPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).TotCoolPeakDD).Title; - c->coilTotalPeakHrMin = PeakHrMinString(state, - SysSizPeakDDNum(curSysNum).TotCoolPeakDD, - SysSizPeakDDNum(curSysNum).TimeStepAtTotCoolPk(SysSizPeakDDNum(curSysNum).TotCoolPeakDD)); - } - if (SysSizPeakDDNum(curSysNum).CoolFlowPeakDD > 0 && SysSizPeakDDNum(curSysNum).CoolFlowPeakDD <= state.dataEnvrn->TotDesDays) { - c->desDayNameAtAirFlowPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).CoolFlowPeakDD).Title; - c->airPeakHrMin = PeakHrMinString(state, - SysSizPeakDDNum(curSysNum).CoolFlowPeakDD, - SysSizPeakDDNum(curSysNum).TimeStepAtCoolFlowPk(SysSizPeakDDNum(curSysNum).CoolFlowPeakDD)); - } + void setCoilWaterDeltaT(EnergyPlusData &state, + int const coilNum, + Real64 const CoilWaterDeltaT // degree C temperature difference used to size coil + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilDesWaterTempDiff = CoilWaterDeltaT; + } - auto const &finalSysSizing = state.dataSize->FinalSysSizing(curSysNum); - c->isCoilSizingForTotalLoad = (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::TotalCooling); - c->oaPeakTemp = finalSysSizing.OutTempAtCoolPeak; - c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow; - c->oaPeakHumRat = finalSysSizing.OutHumRatAtCoolPeak; - c->raPeakTemp = finalSysSizing.RetTempAtCoolPeak; - c->raPeakHumRat = finalSysSizing.RetHumRatAtCoolPeak; - c->coilSizingMethodConcurrence = static_cast(finalSysSizing.SizingOption); - c->coilSizingMethodCapacity = finalSysSizing.CoolingCapMethod; - c->coilSizingMethodAirFlow = finalSysSizing.ScaleCoolSAFMethod; - // DesOutAirVolFlow - - // loop over cooled zones attached to this airloop to find average Room condition - // change weighting to use supply air flow rate rather than zone air volume for all the zones on this coil's air system - Real64 sumT_Vdot(0.0); // numerator for average zone temperature, zone temperature values times zone supply air volume flow rate - Real64 sumW_Vdot(0.0); // numerator average zone humidity ratio, zone hum rat value times zone supply air volume flow rate - Real64 sumSensLoad(0.0); // straight total for zone design loads - Real64 sumVdot(0.0); // denominator for supply air flow rate weighted averages - - // Decide what day and time to use for zone/room averages - int SysPeakDDnum(0); - int SysPeakTimeStepInDay(0); - if (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::TotalCooling) { - SysPeakDDnum = SysSizPeakDDNum(curSysNum).TotCoolPeakDD; - if (SysPeakDDnum > 0) { - SysPeakTimeStepInDay = SysSizPeakDDNum(curSysNum).TimeStepAtTotCoolPk(SysSizPeakDDNum(curSysNum).TotCoolPeakDD); - } - } else if (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::SensibleCooling) { - SysPeakDDnum = SysSizPeakDDNum(curSysNum).SensCoolPeakDD; - if (SysPeakDDnum > 0) { - SysPeakTimeStepInDay = SysSizPeakDDNum(curSysNum).TimeStepAtSensCoolPk(SysSizPeakDDNum(curSysNum).SensCoolPeakDD); - } - } + void setCoilLvgAirTemp(EnergyPlusData &state, + int const coilNum, + Real64 const lvgAirDryBulbTemp // + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilDesLvgTemp = lvgAirDryBulbTemp; + } - if (SysPeakDDnum > 0 && SysPeakTimeStepInDay > 0) { - for (auto &z : c->zoneNum) { - auto const &thisCalcZoneSizing = state.dataSize->CalcZoneSizing(SysPeakDDnum, z); - auto const &thisFinalZoneSizing = state.dataSize->FinalZoneSizing(z); - Real64 mult = state.dataHeatBal->Zone(z).Multiplier * state.dataHeatBal->Zone(z).ListMultiplier; - Real64 Tz = thisCalcZoneSizing.CoolZoneTempSeq(SysPeakTimeStepInDay); - Real64 Vdot_z = thisCalcZoneSizing.CoolFlowSeq(SysPeakTimeStepInDay); - if (Vdot_z == 0.0) { // take value from final zone sizing - Vdot_z = thisFinalZoneSizing.CoolMassFlow; - if (Vdot_z == 0.0) { - Vdot_z = finalSysSizing.DesCoolVolFlow * state.dataEnvrn->StdRhoAir / c->zoneNum.size(); - } - } - Real64 Wz = thisCalcZoneSizing.CoolZoneHumRatSeq(SysPeakTimeStepInDay); - sumT_Vdot += Tz * Vdot_z * mult; - sumW_Vdot += Wz * Vdot_z * mult; - sumVdot += Vdot_z * mult; - Real64 Qdot_z = thisCalcZoneSizing.CoolLoadSeq(SysPeakTimeStepInDay); - if (Qdot_z > 0.0) { - sumSensLoad += Qdot_z * mult; - } else { - sumSensLoad += thisFinalZoneSizing.DesCoolLoad * mult; - } - } - } - if (!c->zoneNum.empty() && sumVdot > 0.0) { - c->rmPeakTemp = (sumT_Vdot / sumVdot); - c->rmPeakHumRat = (sumW_Vdot / sumVdot); - c->rmPeakRelHum = - Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * 100.0; // convert to percentage - } else { - c->rmPeakTemp = -999.0; - c->rmPeakHumRat = -999.0; - c->rmPeakRelHum = -999.0; - } + void setCoilLvgAirHumRat(EnergyPlusData &state, + int const coilNum, + Real64 const lvgAirHumRat // + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilDesLvgHumRat = lvgAirHumRat; + } - if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::Coincident) { - c->rmSensibleAtPeak = finalSysSizing.SysCoolCoinSpaceSens; - } else if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::NonCoincident) { - c->rmSensibleAtPeak = sumSensLoad; - } else { // DataSizing::Combination or other - c->rmSensibleAtPeak = sumSensLoad; - } + std::string PeakHrMinString(EnergyPlusData &state, const int designDay, const int timeStepAtPeak) + { + return fmt::format("{}/{} {}", + state.dataWeather->DesDayInput(designDay).Month, + state.dataWeather->DesDayInput(designDay).DayOfMonth, + getTimeText(state, timeStepAtPeak)); + } - // now set Coil Ent And Lvg Conditions - if (curOASysNum > 0) { // then this system coil is part of OA system - if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly - c->coilDesEntTemp = finalSysSizing.OutTempAtCoolPeak; - } - if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly - c->coilDesEntHumRat = finalSysSizing.OutHumRatAtCoolPeak; - } - c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); - c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); - if (c->coilDesLvgTemp == -999.0) { // don't overwrite if already set directly - c->coilDesLvgTemp = finalSysSizing.PrecoolTemp; + void setCoilCoolingCapacity(EnergyPlusData &state, + int const coilNum, + Real64 const TotalCoolingCap, // {W} coil cooling capacity, sizing result + bool const isAutoSize, // true if value was autosized + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum, // zone equipment list index, if non-zero + int const curOASysNum, // OA system equipment list index, if non-zero + Real64 const fanCoolLoad, // {W} fan load used in ideal loads coil sizing + Real64 const coilCapFunTempFac, // {W} curve result for modification factor for capacity as a function of temperature + Real64 const DXFlowPerCapMinRatio, // non dimensional ratio, capacity adjustment ratio min + Real64 const DXFlowPerCapMaxRatio // non dimensional ratio, capacity adjustment ratio max + ) + { + auto &ZoneEqSizing(state.dataSize->ZoneEqSizing); + auto &SysSizPeakDDNum(state.dataSize->SysSizPeakDDNum); + + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + // no this is adjusted back to ratings c->coilTotCapAtPeak = TotalCoolingCap; + c->coilCapFTIdealPeak = coilCapFunTempFac; + c->coilTotCapAtPeak = TotalCoolingCap * c->coilCapFTIdealPeak; + c->capIsAutosized = isAutoSize; + c->minRatio = DXFlowPerCapMinRatio; + c->maxRatio = DXFlowPerCapMaxRatio; + + c->fanHeatGainIdealPeak = fanCoolLoad; + c->airloopNum = curSysNum; + doAirLoopSetup(state, coilNum); + c->zoneEqNum = curZoneEqNum; + // if ( c->zoneEqNum > 0 ) doZoneEqSetup( index ); + c->oASysNum = curOASysNum; + + if (curSysNum > 0 && c->zoneEqNum == 0 && allocated(state.dataSize->FinalSysSizing) && allocated(SysSizPeakDDNum) && + curSysNum <= state.dataHVACGlobal->NumPrimaryAirSys) { + + // These next blocks does not always work with SizingPeriod:WeatherFileDays or SizingPeriod:WeatherFileConditionType, protect against hard + // crash + if (SysSizPeakDDNum(curSysNum).SensCoolPeakDD > 0 && SysSizPeakDDNum(curSysNum).SensCoolPeakDD <= state.dataEnvrn->TotDesDays) { + c->desDayNameAtSensPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).SensCoolPeakDD).Title; + c->coilSensePeakHrMin = PeakHrMinString(state, + SysSizPeakDDNum(curSysNum).SensCoolPeakDD, + SysSizPeakDDNum(curSysNum).TimeStepAtSensCoolPk(SysSizPeakDDNum(curSysNum).SensCoolPeakDD)); } - if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly - c->coilDesLvgHumRat = finalSysSizing.PrecoolHumRat; + if (SysSizPeakDDNum(curSysNum).TotCoolPeakDD > 0 && SysSizPeakDDNum(curSysNum).TotCoolPeakDD <= state.dataEnvrn->TotDesDays) { + c->desDayNameAtTotalPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).TotCoolPeakDD).Title; + c->coilTotalPeakHrMin = PeakHrMinString(state, + SysSizPeakDDNum(curSysNum).TotCoolPeakDD, + SysSizPeakDDNum(curSysNum).TimeStepAtTotCoolPk(SysSizPeakDDNum(curSysNum).TotCoolPeakDD)); } - c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); - c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); - } else { // part of main air loop - if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly - c->coilDesEntTemp = finalSysSizing.MixTempAtCoolPeak; - } - if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly - c->coilDesEntHumRat = finalSysSizing.MixHumRatAtCoolPeak; + if (SysSizPeakDDNum(curSysNum).CoolFlowPeakDD > 0 && SysSizPeakDDNum(curSysNum).CoolFlowPeakDD <= state.dataEnvrn->TotDesDays) { + c->desDayNameAtAirFlowPeak = state.dataWeather->DesDayInput(SysSizPeakDDNum(curSysNum).CoolFlowPeakDD).Title; + c->airPeakHrMin = PeakHrMinString(state, + SysSizPeakDDNum(curSysNum).CoolFlowPeakDD, + SysSizPeakDDNum(curSysNum).TimeStepAtCoolFlowPk(SysSizPeakDDNum(curSysNum).CoolFlowPeakDD)); } - c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); - c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); - if (c->coilDesLvgTemp == -999.0) { - c->coilDesLvgTemp = finalSysSizing.CoolSupTemp; + + auto const &finalSysSizing = state.dataSize->FinalSysSizing(curSysNum); + c->isCoilSizingForTotalLoad = (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::TotalCooling); + c->oaPeakTemp = finalSysSizing.OutTempAtCoolPeak; + c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow; + c->oaPeakHumRat = finalSysSizing.OutHumRatAtCoolPeak; + c->raPeakTemp = finalSysSizing.RetTempAtCoolPeak; + c->raPeakHumRat = finalSysSizing.RetHumRatAtCoolPeak; + c->coilSizingMethodConcurrence = static_cast(finalSysSizing.SizingOption); + c->coilSizingMethodCapacity = finalSysSizing.CoolingCapMethod; + c->coilSizingMethodAirFlow = finalSysSizing.ScaleCoolSAFMethod; + // DesOutAirVolFlow + + // loop over cooled zones attached to this airloop to find average Room condition + // change weighting to use supply air flow rate rather than zone air volume for all the zones on this coil's air system + Real64 sumT_Vdot(0.0); // numerator for average zone temperature, zone temperature values times zone supply air volume flow rate + Real64 sumW_Vdot(0.0); // numerator average zone humidity ratio, zone hum rat value times zone supply air volume flow rate + Real64 sumSensLoad(0.0); // straight total for zone design loads + Real64 sumVdot(0.0); // denominator for supply air flow rate weighted averages + + // Decide what day and time to use for zone/room averages + int SysPeakDDnum(0); + int SysPeakTimeStepInDay(0); + if (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::TotalCooling) { + SysPeakDDnum = SysSizPeakDDNum(curSysNum).TotCoolPeakDD; + if (SysPeakDDnum > 0) { + SysPeakTimeStepInDay = SysSizPeakDDNum(curSysNum).TimeStepAtTotCoolPk(SysSizPeakDDNum(curSysNum).TotCoolPeakDD); + } + } else if (finalSysSizing.coolingPeakLoad == DataSizing::PeakLoad::SensibleCooling) { + SysPeakDDnum = SysSizPeakDDNum(curSysNum).SensCoolPeakDD; + if (SysPeakDDnum > 0) { + SysPeakTimeStepInDay = SysSizPeakDDNum(curSysNum).TimeStepAtSensCoolPk(SysSizPeakDDNum(curSysNum).SensCoolPeakDD); + } } - if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly - c->coilDesLvgHumRat = finalSysSizing.CoolSupHumRat; + + if (SysPeakDDnum > 0 && SysPeakTimeStepInDay > 0) { + for (auto &z : c->zoneNum) { + auto const &thisCalcZoneSizing = state.dataSize->CalcZoneSizing(SysPeakDDnum, z); + auto const &thisFinalZoneSizing = state.dataSize->FinalZoneSizing(z); + Real64 mult = state.dataHeatBal->Zone(z).Multiplier * state.dataHeatBal->Zone(z).ListMultiplier; + Real64 Tz = thisCalcZoneSizing.CoolZoneTempSeq(SysPeakTimeStepInDay); + Real64 Vdot_z = thisCalcZoneSizing.CoolFlowSeq(SysPeakTimeStepInDay); + if (Vdot_z == 0.0) { // take value from final zone sizing + Vdot_z = thisFinalZoneSizing.CoolMassFlow; + if (Vdot_z == 0.0) { + Vdot_z = finalSysSizing.DesCoolVolFlow * state.dataEnvrn->StdRhoAir / c->zoneNum.size(); + } + } + Real64 Wz = thisCalcZoneSizing.CoolZoneHumRatSeq(SysPeakTimeStepInDay); + sumT_Vdot += Tz * Vdot_z * mult; + sumW_Vdot += Wz * Vdot_z * mult; + sumVdot += Vdot_z * mult; + Real64 Qdot_z = thisCalcZoneSizing.CoolLoadSeq(SysPeakTimeStepInDay); + if (Qdot_z > 0.0) { + sumSensLoad += Qdot_z * mult; + } else { + sumSensLoad += thisFinalZoneSizing.DesCoolLoad * mult; + } + } } - c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); - c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); - if (state.dataAirSystemsData->PrimaryAirSystems(curSysNum).NumOACoolCoils > 0) { // there is precooling of the OA stream - c->oaPretreated = true; + if (!c->zoneNum.empty() && sumVdot > 0.0) { + c->rmPeakTemp = (sumT_Vdot / sumVdot); + c->rmPeakHumRat = (sumW_Vdot / sumVdot); + c->rmPeakRelHum = Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * + 100.0; // convert to percentage + } else { + c->rmPeakTemp = -999.0; + c->rmPeakHumRat = -999.0; + c->rmPeakRelHum = -999.0; } - } - } else if (curZoneEqNum > 0 && allocated(state.dataSize->FinalZoneSizing)) { - c->zoneNum.resize(1); - c->zoneName.resize(1); - c->zoneNum[0] = curZoneEqNum; - if (allocated(state.dataZoneEquip->ZoneEquipConfig)) { - c->zoneName[0] = state.dataZoneEquip->ZoneEquipConfig(curZoneEqNum).ZoneName; - } - auto const &thisFinalZoneSizing = state.dataSize->FinalZoneSizing(curZoneEqNum); - c->desDayNameAtSensPeak = thisFinalZoneSizing.CoolDesDay; - c->oaPeakTemp = thisFinalZoneSizing.OutTempAtCoolPeak; - c->oaPeakHumRat = thisFinalZoneSizing.OutHumRatAtCoolPeak; - c->raPeakTemp = thisFinalZoneSizing.ZoneTempAtCoolPeak; - c->raPeakHumRat = thisFinalZoneSizing.ZoneHumRatAtCoolPeak; - c->rmPeakTemp = thisFinalZoneSizing.ZoneTempAtCoolPeak; - c->rmPeakHumRat = thisFinalZoneSizing.ZoneHumRatAtCoolPeak; - c->rmPeakRelHum = - Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * 100.0; // convert to percentage - if (thisFinalZoneSizing.CoolDDNum > 0 && thisFinalZoneSizing.CoolDDNum <= state.dataEnvrn->TotDesDays) { - c->coilSensePeakHrMin = PeakHrMinString(state, thisFinalZoneSizing.CoolDDNum, thisFinalZoneSizing.TimeStepNumAtCoolMax); - c->airPeakHrMin = PeakHrMinString(state, thisFinalZoneSizing.CoolDDNum, thisFinalZoneSizing.TimeStepNumAtCoolMax); - } - - c->rmSensibleAtPeak = thisFinalZoneSizing.DesCoolLoad; + if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::Coincident) { + c->rmSensibleAtPeak = finalSysSizing.SysCoolCoinSpaceSens; + } else if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::NonCoincident) { + c->rmSensibleAtPeak = sumSensLoad; + } else { // DataSizing::Combination or other + c->rmSensibleAtPeak = sumSensLoad; + } - if (ZoneEqSizing(curZoneEqNum).OAVolFlow > 0.0) { - c->oaPeakVolFlow = ZoneEqSizing(curZoneEqNum).OAVolFlow; - } else { - c->oaPeakVolFlow = 0.0; - } - // coil entering conditions depend on the type of zone equipment involved - // set typeof_Coil integer - if (state.dataSize->TermUnitIU) { // an unpowered induction terminal unit - // should be picked up by CoolingWaterDesAirInletHumRatSizing and CoolingWaterDesWaterInletTempSizing - // c->coilDesEntTemp = DataSizing::FinalZoneSizing( curZoneEqNum ).ZoneTempAtCoolPeak; - // c->coilDesEntHumRat = DataSizing::FinalZoneSizing( curZoneEqNum ).ZoneHumRatAtCoolPeak; - } else if (state.dataSize->ZoneEqFanCoil) { - // should be picked up by CoolingWaterDesAirInletHumRatSizing and CoolingWaterDesWaterInletTempSizing - // if ( DataSizing::FinalZoneSizing( curZoneEqNum ).DesCoolMassFlow > 0.0 ) { - // c->oaPeakVolFrac = min( (DataEnvironment::StdRhoAir * c->oaPeakVolFlow)/DataSizing::FinalZoneSizing( curZoneEqNum - //).DesCoolMassFlow, 1.0 ); } else { c->oaPeakVolFrac = 0.0; - //} - // c->coilDesEntTemp = c->oaPeakVolFrac * DataSizing::FinalZoneSizing( curZoneEqNum ).OutTempAtCoolPeak + ( 1.0 - c->oaPeakVolFrac ) * - // DataSizing::FinalZoneSizing( curZoneEqNum ).ZoneTempAtCoolPeak; c->coilDesEntHumRat = c->oaPeakVolFrac * - // DataSizing::FinalZoneSizing( curZoneEqNum ).OutHumRatAtCoolPeak + ( 1.0 - c->oaPeakVolFrac ) * DataSizing::FinalZoneSizing( - // curZoneEqNum ).ZoneHumRatAtCoolPeak; - } else if (state.dataSize->ZoneEqDXCoil) { - if (ZoneEqSizing(curZoneEqNum).OAVolFlow > 0.0) { - if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp - c->coilDesEntTemp = thisFinalZoneSizing.DesCoolCoilInTemp; + // now set Coil Ent And Lvg Conditions + if (curOASysNum > 0) { // then this system coil is part of OA system + if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly + c->coilDesEntTemp = finalSysSizing.OutTempAtCoolPeak; } - if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat - c->coilDesEntHumRat = thisFinalZoneSizing.DesCoolCoilInHumRat; + if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly + c->coilDesEntHumRat = finalSysSizing.OutHumRatAtCoolPeak; } - } else { - if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp - c->coilDesEntTemp = thisFinalZoneSizing.ZoneTempAtCoolPeak; + c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); + c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); + if (c->coilDesLvgTemp == -999.0) { // don't overwrite if already set directly + c->coilDesLvgTemp = finalSysSizing.PrecoolTemp; } - if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat - c->coilDesEntHumRat = thisFinalZoneSizing.ZoneHumRatAtCoolPeak; + if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly + c->coilDesLvgHumRat = finalSysSizing.PrecoolHumRat; } - } - } else { - if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp - c->coilDesEntTemp = thisFinalZoneSizing.DesCoolCoilInTemp; - } - if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat - c->coilDesEntHumRat = thisFinalZoneSizing.DesCoolCoilInHumRat; - } - } + c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); + c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); - if (c->coilDesLvgTemp == -999.0) { // don't overwrite if already set directly by setCoilLvgAirTemp - c->coilDesLvgTemp = thisFinalZoneSizing.CoolDesTemp; - } - if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly by setCoilLvgAirHumRat - c->coilDesLvgHumRat = thisFinalZoneSizing.CoolDesHumRat; - } - c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); - c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); - } else if (curOASysNum > 0 && c->airloopNum > state.dataHVACGlobal->NumPrimaryAirSys) { - if (!state.dataAirLoopHVACDOAS->airloopDOAS.empty()) { - int DOASSysNum = state.dataAirLoop->OutsideAirSys(curOASysNum).AirLoopDOASNum; - c->coilDesEntTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].SizingCoolOATemp; - c->coilDesEntHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].SizingCoolOAHumRat; - if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) { + } else { // part of main air loop + if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly + c->coilDesEntTemp = finalSysSizing.MixTempAtCoolPeak; + } + if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly + c->coilDesEntHumRat = finalSysSizing.MixHumRatAtCoolPeak; + } c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); - } - c->coilDesLvgTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PrecoolTemp; - c->coilDesLvgHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PrecoolHumRat; - if (c->coilDesLvgTemp > -999.0 && c->coilDesLvgHumRat > -999.0) { + if (c->coilDesLvgTemp == -999.0) { + c->coilDesLvgTemp = finalSysSizing.CoolSupTemp; + } + if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly + c->coilDesLvgHumRat = finalSysSizing.CoolSupHumRat; + } c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); + if (state.dataAirSystemsData->PrimaryAirSystems(curSysNum).NumOACoolCoils > 0) { // there is precooling of the OA stream + c->oaPretreated = true; + } } - 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]; - if (airLoopNum == 0) { - sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; + + } else if (curZoneEqNum > 0 && allocated(state.dataSize->FinalZoneSizing)) { + c->zoneNum.resize(1); + c->zoneName.resize(1); + c->zoneNum[0] = curZoneEqNum; + if (allocated(state.dataZoneEquip->ZoneEquipConfig)) { + c->zoneName[0] = state.dataZoneEquip->ZoneEquipConfig(curZoneEqNum).ZoneName; + } + auto const &thisFinalZoneSizing = state.dataSize->FinalZoneSizing(curZoneEqNum); + c->desDayNameAtSensPeak = thisFinalZoneSizing.CoolDesDay; + c->oaPeakTemp = thisFinalZoneSizing.OutTempAtCoolPeak; + c->oaPeakHumRat = thisFinalZoneSizing.OutHumRatAtCoolPeak; + c->raPeakTemp = thisFinalZoneSizing.ZoneTempAtCoolPeak; + c->raPeakHumRat = thisFinalZoneSizing.ZoneHumRatAtCoolPeak; + c->rmPeakTemp = thisFinalZoneSizing.ZoneTempAtCoolPeak; + c->rmPeakHumRat = thisFinalZoneSizing.ZoneHumRatAtCoolPeak; + c->rmPeakRelHum = + Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * 100.0; // convert to percentage + if (thisFinalZoneSizing.CoolDDNum > 0 && thisFinalZoneSizing.CoolDDNum <= state.dataEnvrn->TotDesDays) { + c->coilSensePeakHrMin = PeakHrMinString(state, thisFinalZoneSizing.CoolDDNum, thisFinalZoneSizing.TimeStepNumAtCoolMax); + c->airPeakHrMin = PeakHrMinString(state, thisFinalZoneSizing.CoolDDNum, thisFinalZoneSizing.TimeStepNumAtCoolMax); + } + + c->rmSensibleAtPeak = thisFinalZoneSizing.DesCoolLoad; + + if (ZoneEqSizing(curZoneEqNum).OAVolFlow > 0.0) { + c->oaPeakVolFlow = ZoneEqSizing(curZoneEqNum).OAVolFlow; + } else { + c->oaPeakVolFlow = 0.0; + } + // coil entering conditions depend on the type of zone equipment involved + // set typeof_Coil integer + if (state.dataSize->TermUnitIU) { // an unpowered induction terminal unit + // should be picked up by CoolingWaterDesAirInletHumRatSizing and CoolingWaterDesWaterInletTempSizing + // c->coilDesEntTemp = DataSizing::FinalZoneSizing( curZoneEqNum ).ZoneTempAtCoolPeak; + // c->coilDesEntHumRat = DataSizing::FinalZoneSizing( curZoneEqNum ).ZoneHumRatAtCoolPeak; + } else if (state.dataSize->ZoneEqFanCoil) { + // should be picked up by CoolingWaterDesAirInletHumRatSizing and CoolingWaterDesWaterInletTempSizing + // if ( DataSizing::FinalZoneSizing( curZoneEqNum ).DesCoolMassFlow > 0.0 ) { + // c->oaPeakVolFrac = min( (DataEnvironment::StdRhoAir * c->oaPeakVolFlow)/DataSizing::FinalZoneSizing( curZoneEqNum + //).DesCoolMassFlow, 1.0 ); } else { c->oaPeakVolFrac = 0.0; + //} + // c->coilDesEntTemp = c->oaPeakVolFrac * DataSizing::FinalZoneSizing( curZoneEqNum ).OutTempAtCoolPeak + ( 1.0 - c->oaPeakVolFrac ) * + // DataSizing::FinalZoneSizing( curZoneEqNum ).ZoneTempAtCoolPeak; c->coilDesEntHumRat = c->oaPeakVolFrac * + // DataSizing::FinalZoneSizing( curZoneEqNum ).OutHumRatAtCoolPeak + ( 1.0 - c->oaPeakVolFrac ) * DataSizing::FinalZoneSizing( + // curZoneEqNum ).ZoneHumRatAtCoolPeak; + } else if (state.dataSize->ZoneEqDXCoil) { + if (ZoneEqSizing(curZoneEqNum).OAVolFlow > 0.0) { + if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp + c->coilDesEntTemp = thisFinalZoneSizing.DesCoolCoilInTemp; + } + if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat + c->coilDesEntHumRat = thisFinalZoneSizing.DesCoolCoilInHumRat; + } } else { - if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { - sizMethodsAreTheSame = false; + if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp + c->coilDesEntTemp = thisFinalZoneSizing.ZoneTempAtCoolPeak; + } + if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat + c->coilDesEntHumRat = thisFinalZoneSizing.ZoneHumRatAtCoolPeak; } } - } - if (sizMethodsAreTheSame) { - c->coilSizingMethodConcurrence = static_cast(sizMethod); } else { - c->coilSizingMethodConcurrence = DataSizing::CoilSizingConcurrence::Combination; + if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp + c->coilDesEntTemp = thisFinalZoneSizing.DesCoolCoilInTemp; + } + if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat + c->coilDesEntHumRat = thisFinalZoneSizing.DesCoolCoilInHumRat; + } } - } - } else { - // do nothing - } - // calc sensible capacity from inlet outlet - c->cpMoistAir = Psychrometrics::PsyCpAirFnW(c->coilDesEntHumRat); -} - -void setCoilHeatingCapacity( - EnergyPlusData &state, - int coilNum, - Real64 const totalHeatingCap, // {W} coil Heating capacity - bool const isAutoSize, // true if value was autosized - int const curSysNum, // airloop system number index, if non zero - int const curZoneEqNum, // zone equipment list index, if non-zero - int const curOASysNum, // OA system equipment list index, if non-zero - Real64 const fanHeatGain, // {W} fan load used in ideal loads coil sizing - Real64 const coilCapFunTempFac, // {W} curve result for modification factor for capacity as a function of temperature - Real64 const DXFlowPerCapMinRatio, // non dimensional ratio, capacity adjustment ratio min - Real64 const DXFlowPerCapMaxRatio // non dimensional ratio, capacity adjustment ratio max -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->capIsAutosized = isAutoSize; - c->coilCapFTIdealPeak = coilCapFunTempFac; - c->coilTotCapAtPeak = totalHeatingCap * c->coilCapFTIdealPeak; - c->minRatio = DXFlowPerCapMinRatio; - c->maxRatio = DXFlowPerCapMaxRatio; - - c->fanHeatGainIdealPeak = fanHeatGain; - c->airloopNum = curSysNum; - doAirLoopSetup(state, coilNum); - c->zoneEqNum = curZoneEqNum; - // if ( c->zoneEqNum > 0 ) doZoneEqSetup( index ); - if (curSysNum > 0 && c->zoneEqNum == 0 && curSysNum <= int(state.dataSize->FinalSysSizing.size())) { - auto &finalSysSizing = state.dataSize->FinalSysSizing(curSysNum); - c->desDayNameAtSensPeak = finalSysSizing.HeatDesDay; - - c->oaPeakTemp = finalSysSizing.HeatOutTemp; - c->oaPeakHumRat = finalSysSizing.HeatOutHumRat; - c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow; - c->raPeakTemp = finalSysSizing.HeatRetTemp; - c->raPeakHumRat = finalSysSizing.HeatRetHumRat; - c->coilSizingMethodConcurrence = static_cast(finalSysSizing.SizingOption); - c->coilSizingMethodCapacity = finalSysSizing.HeatingCapMethod; - c->coilSizingMethodAirFlow = finalSysSizing.ScaleHeatSAFMethod; - - // Central Heating Coils are always sized at the conditions at the peak Sensible Heating Load - c->isCoilSizingForTotalLoad = false; - - // DesOutAirVolFlow - - // loop over heated zones attached to this airloop to find average Room condition, if none heated use cooled zones - // weighted average by zone supply air volume flow rate for all the zones on this coil's air system - Real64 sumT_Vdot(0.0); // numerator for average zone temperature, zone temperature values times zone air volume - Real64 sumW_Vdot(0.0); // numerator average zone humidity ratio, zone hum rat value times zone air volume - Real64 sumLoad(0.0); // straight total for zone design loads - Real64 sumVdot(0.0); // denominator for zone-volume weighted averages - - int SysPeakDDnum = finalSysSizing.HeatDDNum; - int SysPeakTimeStepInDay = finalSysSizing.SysHeatCoilTimeStepPk; - if (SysPeakDDnum > 0 && SysPeakTimeStepInDay > 0) { // may be zero if no peak found because of zero system load - for (auto &z : c->zoneNum) { - auto const &thisCalcZoneSizing = state.dataSize->CalcZoneSizing(SysPeakDDnum, z); - auto const &thisFinalZoneSizing = state.dataSize->FinalZoneSizing(z); - Real64 mult = state.dataHeatBal->Zone(z).Multiplier * state.dataHeatBal->Zone(z).ListMultiplier; - Real64 Tz = thisCalcZoneSizing.HeatZoneTempSeq(SysPeakTimeStepInDay); - Real64 Vdot_z = thisCalcZoneSizing.HeatFlowSeq(SysPeakTimeStepInDay); - if (Vdot_z == 0.0) { // take value from final zone sizing - Vdot_z = thisFinalZoneSizing.HeatMassFlow; - if (Vdot_z == 0.0) { - Vdot_z = finalSysSizing.DesHeatVolFlow * state.dataEnvrn->StdRhoAir / c->zoneNum.size(); + if (c->coilDesLvgTemp == -999.0) { // don't overwrite if already set directly by setCoilLvgAirTemp + c->coilDesLvgTemp = thisFinalZoneSizing.CoolDesTemp; + } + if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly by setCoilLvgAirHumRat + c->coilDesLvgHumRat = thisFinalZoneSizing.CoolDesHumRat; + } + c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); + c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); + } else if (curOASysNum > 0 && c->airloopNum > state.dataHVACGlobal->NumPrimaryAirSys) { + if (!state.dataAirLoopHVACDOAS->airloopDOAS.empty()) { + int DOASSysNum = state.dataAirLoop->OutsideAirSys(curOASysNum).AirLoopDOASNum; + c->coilDesEntTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].SizingCoolOATemp; + c->coilDesEntHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].SizingCoolOAHumRat; + if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) { + c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); + c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); + } + c->coilDesLvgTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PrecoolTemp; + c->coilDesLvgHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PrecoolHumRat; + if (c->coilDesLvgTemp > -999.0 && c->coilDesLvgHumRat > -999.0) { + c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilCoolingCapacity"); + c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); + } + 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]; + if (airLoopNum == 0) { + sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; + } else { + if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { + sizMethodsAreTheSame = false; + } } } - Real64 Wz = thisCalcZoneSizing.HeatZoneHumRatSeq(SysPeakTimeStepInDay); - sumT_Vdot += Tz * Vdot_z * mult; - sumW_Vdot += Wz * Vdot_z * mult; - sumVdot += Vdot_z * mult; - Real64 Qdot_z = thisCalcZoneSizing.HeatLoadSeq(SysPeakTimeStepInDay); - if (Qdot_z > 0.0) { - sumLoad += Qdot_z * mult; + if (sizMethodsAreTheSame) { + c->coilSizingMethodConcurrence = static_cast(sizMethod); } else { - sumLoad += thisFinalZoneSizing.DesHeatLoad * mult; + c->coilSizingMethodConcurrence = DataSizing::CoilSizingConcurrence::Combination; } } - } - - if (!c->zoneNum.empty() && sumVdot > 0.0) { - c->rmPeakTemp = (sumT_Vdot / sumVdot); - c->rmPeakHumRat = (sumW_Vdot / sumVdot); - c->rmPeakRelHum = - Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * 100.0; // convert to percentage } else { - c->rmPeakTemp = -999.0; - c->rmPeakHumRat = -999.0; - c->rmPeakRelHum = -999.0; + // do nothing } - if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::Coincident) { - c->rmSensibleAtPeak = finalSysSizing.SysHeatCoinSpaceSens; - } else if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::NonCoincident) { - c->rmSensibleAtPeak = sumLoad; - } + // calc sensible capacity from inlet outlet + c->cpMoistAir = Psychrometrics::PsyCpAirFnW(c->coilDesEntHumRat); + } + + void setCoilHeatingCapacity(EnergyPlusData &state, + int coilNum, + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum, // zone equipment list index, if non-zero + int const curOASysNum, // OA system equipment list index, if non-zero + Real64 const fanHeatGain, // {W} fan load used in ideal loads coil sizing + Real64 const coilCapFunTempFac, // {W} curve result for modification factor for capacity as a function of temperature + Real64 const DXFlowPerCapMinRatio, // non dimensional ratio, capacity adjustment ratio min + Real64 const DXFlowPerCapMaxRatio // non dimensional ratio, capacity adjustment ratio max + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->capIsAutosized = isAutoSize; + c->coilCapFTIdealPeak = coilCapFunTempFac; + c->coilTotCapAtPeak = totalHeatingCap * c->coilCapFTIdealPeak; + c->minRatio = DXFlowPerCapMinRatio; + c->maxRatio = DXFlowPerCapMaxRatio; + + c->fanHeatGainIdealPeak = fanHeatGain; + c->airloopNum = curSysNum; + doAirLoopSetup(state, coilNum); + c->zoneEqNum = curZoneEqNum; + // if ( c->zoneEqNum > 0 ) doZoneEqSetup( index ); + if (curSysNum > 0 && c->zoneEqNum == 0 && curSysNum <= int(state.dataSize->FinalSysSizing.size())) { + auto &finalSysSizing = state.dataSize->FinalSysSizing(curSysNum); + c->desDayNameAtSensPeak = finalSysSizing.HeatDesDay; + + c->oaPeakTemp = finalSysSizing.HeatOutTemp; + c->oaPeakHumRat = finalSysSizing.HeatOutHumRat; + c->oaPeakVolFlow = finalSysSizing.DesOutAirVolFlow; + c->raPeakTemp = finalSysSizing.HeatRetTemp; + c->raPeakHumRat = finalSysSizing.HeatRetHumRat; + c->coilSizingMethodConcurrence = static_cast(finalSysSizing.SizingOption); + c->coilSizingMethodCapacity = finalSysSizing.HeatingCapMethod; + c->coilSizingMethodAirFlow = finalSysSizing.ScaleHeatSAFMethod; + + // Central Heating Coils are always sized at the conditions at the peak Sensible Heating Load + c->isCoilSizingForTotalLoad = false; + + // DesOutAirVolFlow + + // loop over heated zones attached to this airloop to find average Room condition, if none heated use cooled zones + // weighted average by zone supply air volume flow rate for all the zones on this coil's air system + Real64 sumT_Vdot(0.0); // numerator for average zone temperature, zone temperature values times zone air volume + Real64 sumW_Vdot(0.0); // numerator average zone humidity ratio, zone hum rat value times zone air volume + Real64 sumLoad(0.0); // straight total for zone design loads + Real64 sumVdot(0.0); // denominator for zone-volume weighted averages + + int SysPeakDDnum = finalSysSizing.HeatDDNum; + int SysPeakTimeStepInDay = finalSysSizing.SysHeatCoilTimeStepPk; + if (SysPeakDDnum > 0 && SysPeakTimeStepInDay > 0) { // may be zero if no peak found because of zero system load + for (auto &z : c->zoneNum) { + auto const &thisCalcZoneSizing = state.dataSize->CalcZoneSizing(SysPeakDDnum, z); + auto const &thisFinalZoneSizing = state.dataSize->FinalZoneSizing(z); + Real64 mult = state.dataHeatBal->Zone(z).Multiplier * state.dataHeatBal->Zone(z).ListMultiplier; + Real64 Tz = thisCalcZoneSizing.HeatZoneTempSeq(SysPeakTimeStepInDay); + Real64 Vdot_z = thisCalcZoneSizing.HeatFlowSeq(SysPeakTimeStepInDay); + if (Vdot_z == 0.0) { // take value from final zone sizing + Vdot_z = thisFinalZoneSizing.HeatMassFlow; + if (Vdot_z == 0.0) { + Vdot_z = finalSysSizing.DesHeatVolFlow * state.dataEnvrn->StdRhoAir / c->zoneNum.size(); + } + } + Real64 Wz = thisCalcZoneSizing.HeatZoneHumRatSeq(SysPeakTimeStepInDay); + sumT_Vdot += Tz * Vdot_z * mult; + sumW_Vdot += Wz * Vdot_z * mult; + sumVdot += Vdot_z * mult; + Real64 Qdot_z = thisCalcZoneSizing.HeatLoadSeq(SysPeakTimeStepInDay); + if (Qdot_z > 0.0) { + sumLoad += Qdot_z * mult; + } else { + sumLoad += thisFinalZoneSizing.DesHeatLoad * mult; + } + } + } - if (finalSysSizing.HeatDDNum > 0 && finalSysSizing.HeatDDNum <= state.dataEnvrn->TotDesDays) { - c->coilSensePeakHrMin = PeakHrMinString(state, finalSysSizing.HeatDDNum, finalSysSizing.SysHeatCoilTimeStepPk); + if (!c->zoneNum.empty() && sumVdot > 0.0) { + c->rmPeakTemp = (sumT_Vdot / sumVdot); + c->rmPeakHumRat = (sumW_Vdot / sumVdot); + c->rmPeakRelHum = Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * + 100.0; // convert to percentage + } else { + c->rmPeakTemp = -999.0; + c->rmPeakHumRat = -999.0; + c->rmPeakRelHum = -999.0; + } - c->airPeakHrMin = PeakHrMinString(state, finalSysSizing.HeatDDNum, finalSysSizing.SysHeatAirTimeStepPk); + if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::Coincident) { + c->rmSensibleAtPeak = finalSysSizing.SysHeatCoinSpaceSens; + } else if (c->coilSizingMethodConcurrence == DataSizing::CoilSizingConcurrence::NonCoincident) { + c->rmSensibleAtPeak = sumLoad; + } - c->desDayNameAtAirFlowPeak = state.dataWeather->DesDayInput(finalSysSizing.HeatDDNum).Title; - } + if (finalSysSizing.HeatDDNum > 0 && finalSysSizing.HeatDDNum <= state.dataEnvrn->TotDesDays) { + c->coilSensePeakHrMin = PeakHrMinString(state, finalSysSizing.HeatDDNum, finalSysSizing.SysHeatCoilTimeStepPk); - // now set Coil Ent And Lvg Conditions + c->airPeakHrMin = PeakHrMinString(state, finalSysSizing.HeatDDNum, finalSysSizing.SysHeatAirTimeStepPk); - if (curOASysNum > 0) { // then this system coil is part of OA system - if (c->coilDesEntTemp == -999.0) { - c->coilDesEntTemp = finalSysSizing.HeatOutTemp; - } - if (c->coilDesEntHumRat == -999.0) { - c->coilDesEntHumRat = finalSysSizing.HeatOutHumRat; + c->desDayNameAtAirFlowPeak = state.dataWeather->DesDayInput(finalSysSizing.HeatDDNum).Title; } - c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); - c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); - if (c->coilDesLvgTemp == -999.0) { - c->coilDesLvgTemp = finalSysSizing.PreheatTemp; - } - if (c->coilDesLvgHumRat == -999.0) { - c->coilDesLvgHumRat = finalSysSizing.PreheatHumRat; - } - c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); - c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); - } else { // part of main air loop - if (c->coilDesEntTemp == -999.0) { - c->coilDesEntTemp = finalSysSizing.HeatMixTemp; - } - if (c->coilDesEntHumRat == -999.0) { - c->coilDesEntHumRat = finalSysSizing.HeatMixHumRat; - } - c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); - c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); - if (c->coilDesLvgTemp == -999.0) { - c->coilDesLvgTemp = finalSysSizing.HeatSupTemp; + // now set Coil Ent And Lvg Conditions + + if (curOASysNum > 0) { // then this system coil is part of OA system + if (c->coilDesEntTemp == -999.0) { + c->coilDesEntTemp = finalSysSizing.HeatOutTemp; + } + if (c->coilDesEntHumRat == -999.0) { + c->coilDesEntHumRat = finalSysSizing.HeatOutHumRat; + } + c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); + c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); + if (c->coilDesLvgTemp == -999.0) { + c->coilDesLvgTemp = finalSysSizing.PreheatTemp; + } + if (c->coilDesLvgHumRat == -999.0) { + c->coilDesLvgHumRat = finalSysSizing.PreheatHumRat; + } + c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); + c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); + + } else { // part of main air loop + if (c->coilDesEntTemp == -999.0) { + c->coilDesEntTemp = finalSysSizing.HeatMixTemp; + } + if (c->coilDesEntHumRat == -999.0) { + c->coilDesEntHumRat = finalSysSizing.HeatMixHumRat; + } + c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); + c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); + if (c->coilDesLvgTemp == -999.0) { + c->coilDesLvgTemp = finalSysSizing.HeatSupTemp; + } + if (c->coilDesLvgHumRat == -999.0) { + c->coilDesLvgHumRat = finalSysSizing.HeatSupHumRat; + } + c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); + c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); + if (state.dataAirSystemsData->PrimaryAirSystems(curSysNum).NumOAHeatCoils > 0) { // there is preHeating of the OA stream + c->oaPretreated = true; + } } - if (c->coilDesLvgHumRat == -999.0) { - c->coilDesLvgHumRat = finalSysSizing.HeatSupHumRat; + + } else if (curZoneEqNum > 0 && allocated(state.dataSize->FinalZoneSizing)) { + auto const &finalZoneSizing = state.dataSize->FinalZoneSizing(curZoneEqNum); + c->zoneNum.resize(1); + c->zoneName.resize(1); + c->zoneNum[0] = curZoneEqNum; + if (allocated(state.dataZoneEquip->ZoneEquipConfig)) { + c->zoneName[0] = state.dataZoneEquip->ZoneEquipConfig(curZoneEqNum).ZoneName; } - c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); - c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); - if (state.dataAirSystemsData->PrimaryAirSystems(curSysNum).NumOAHeatCoils > 0) { // there is preHeating of the OA stream - c->oaPretreated = true; + c->desDayNameAtSensPeak = finalZoneSizing.HeatDesDay; + c->oaPeakTemp = finalZoneSizing.OutTempAtHeatPeak; + c->oaPeakHumRat = finalZoneSizing.OutHumRatAtHeatPeak; + c->raPeakTemp = finalZoneSizing.ZoneRetTempAtHeatPeak; + c->raPeakHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak; + c->rmPeakTemp = finalZoneSizing.ZoneTempAtHeatPeak; + c->rmPeakHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak; + c->rmPeakRelHum = + Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * 100.0; // convert to percentage + if (finalZoneSizing.HeatDDNum > 0 && finalZoneSizing.HeatDDNum <= state.dataEnvrn->TotDesDays) { + c->coilSensePeakHrMin = PeakHrMinString(state, finalZoneSizing.HeatDDNum, finalZoneSizing.TimeStepNumAtHeatMax); + c->airPeakHrMin = PeakHrMinString(state, finalZoneSizing.HeatDDNum, finalZoneSizing.TimeStepNumAtHeatMax); } - } + c->desDayNameAtAirFlowPeak = finalZoneSizing.HeatDesDay; - } else if (curZoneEqNum > 0 && allocated(state.dataSize->FinalZoneSizing)) { - auto const &finalZoneSizing = state.dataSize->FinalZoneSizing(curZoneEqNum); - c->zoneNum.resize(1); - c->zoneName.resize(1); - c->zoneNum[0] = curZoneEqNum; - if (allocated(state.dataZoneEquip->ZoneEquipConfig)) { - c->zoneName[0] = state.dataZoneEquip->ZoneEquipConfig(curZoneEqNum).ZoneName; - } - c->desDayNameAtSensPeak = finalZoneSizing.HeatDesDay; - c->oaPeakTemp = finalZoneSizing.OutTempAtHeatPeak; - c->oaPeakHumRat = finalZoneSizing.OutHumRatAtHeatPeak; - c->raPeakTemp = finalZoneSizing.ZoneRetTempAtHeatPeak; - c->raPeakHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak; - c->rmPeakTemp = finalZoneSizing.ZoneTempAtHeatPeak; - c->rmPeakHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak; - c->rmPeakRelHum = - Psychrometrics::PsyRhFnTdbWPb(state, c->rmPeakTemp, c->rmPeakHumRat, state.dataEnvrn->StdBaroPress) * 100.0; // convert to percentage - if (finalZoneSizing.HeatDDNum > 0 && finalZoneSizing.HeatDDNum <= state.dataEnvrn->TotDesDays) { - c->coilSensePeakHrMin = PeakHrMinString(state, finalZoneSizing.HeatDDNum, finalZoneSizing.TimeStepNumAtHeatMax); - c->airPeakHrMin = PeakHrMinString(state, finalZoneSizing.HeatDDNum, finalZoneSizing.TimeStepNumAtHeatMax); - } - c->desDayNameAtAirFlowPeak = finalZoneSizing.HeatDesDay; + c->rmSensibleAtPeak = finalZoneSizing.DesHeatLoad; - c->rmSensibleAtPeak = finalZoneSizing.DesHeatLoad; - - auto const &zoneEqSizing = state.dataSize->ZoneEqSizing(curZoneEqNum); - if (zoneEqSizing.OAVolFlow > 0.0) { - c->oaPeakVolFlow = zoneEqSizing.OAVolFlow; - } else if (zoneEqSizing.ATMixerVolFlow > 0.0) { - c->oaPeakVolFlow = zoneEqSizing.ATMixerVolFlow; - } else { - c->oaPeakVolFlow = 0.0; - } - // coil entering conditions depend on the type of zone equipment involved - // set typeof_Coil integer - if (state.dataSize->TermUnitIU) { // an unpowered induction terminal unit - if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp - auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum); - c->coilDesEntTemp = thisTermUnitFinalZoneSizing.DesHeatCoilInTempTU; - c->coilDesEntHumRat = thisTermUnitFinalZoneSizing.DesHeatCoilInHumRatTU; - } - } else if (state.dataSize->TermUnitSingDuct) { - if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp - auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum); - c->coilDesEntTemp = thisTermUnitFinalZoneSizing.DesHeatCoilInTempTU; - c->coilDesEntHumRat = thisTermUnitFinalZoneSizing.DesHeatCoilInHumRatTU; - } - } else if (state.dataSize->TermUnitPIU) { - auto const &thisTermUnitSizing = state.dataSize->TermUnitSizing(state.dataSize->CurTermUnitSizingNum); - Real64 MinPriFlowFrac = thisTermUnitSizing.MinPriFlowFrac; - if (thisTermUnitSizing.InducesPlenumAir) { + auto const &zoneEqSizing = state.dataSize->ZoneEqSizing(curZoneEqNum); + if (zoneEqSizing.OAVolFlow > 0.0) { + c->oaPeakVolFlow = zoneEqSizing.OAVolFlow; + } else if (zoneEqSizing.ATMixerVolFlow > 0.0) { + c->oaPeakVolFlow = zoneEqSizing.ATMixerVolFlow; + } else { + c->oaPeakVolFlow = 0.0; + } + // coil entering conditions depend on the type of zone equipment involved + // set typeof_Coil integer + if (state.dataSize->TermUnitIU) { // an unpowered induction terminal unit if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp - auto const &termUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum); - c->coilDesEntTemp = (termUnitFinalZoneSizing.DesHeatCoilInTempTU * MinPriFlowFrac) + - (termUnitFinalZoneSizing.ZoneRetTempAtHeatPeak * (1.0 - MinPriFlowFrac)); - c->coilDesEntHumRat = (termUnitFinalZoneSizing.DesHeatCoilInHumRatTU * MinPriFlowFrac) + - (termUnitFinalZoneSizing.ZoneHumRatAtHeatPeak * (1.0 - MinPriFlowFrac)); + auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum); + c->coilDesEntTemp = thisTermUnitFinalZoneSizing.DesHeatCoilInTempTU; + c->coilDesEntHumRat = thisTermUnitFinalZoneSizing.DesHeatCoilInHumRatTU; } - } else { + } else if (state.dataSize->TermUnitSingDuct) { if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum); - c->coilDesEntTemp = (thisTermUnitFinalZoneSizing.DesHeatCoilInTempTU * MinPriFlowFrac) + - (thisTermUnitFinalZoneSizing.ZoneTempAtHeatPeak * (1.0 - MinPriFlowFrac)); - c->coilDesEntHumRat = (thisTermUnitFinalZoneSizing.DesHeatCoilInHumRatTU * MinPriFlowFrac) + - (thisTermUnitFinalZoneSizing.ZoneHumRatAtHeatPeak * (1.0 - MinPriFlowFrac)); + c->coilDesEntTemp = thisTermUnitFinalZoneSizing.DesHeatCoilInTempTU; + c->coilDesEntHumRat = thisTermUnitFinalZoneSizing.DesHeatCoilInHumRatTU; } - } - } else if (state.dataSize->ZoneEqFanCoil) { - if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp - Real64 desOAFlowFrac = 0.0; - if (zoneEqSizing.OAVolFlow > 0.0 && finalZoneSizing.DesHeatMassFlow > 0.0) { - desOAFlowFrac = std::min(state.dataEnvrn->StdRhoAir * zoneEqSizing.OAVolFlow / finalZoneSizing.DesHeatMassFlow, 1.0); + } else if (state.dataSize->TermUnitPIU) { + auto const &thisTermUnitSizing = state.dataSize->TermUnitSizing(state.dataSize->CurTermUnitSizingNum); + Real64 MinPriFlowFrac = thisTermUnitSizing.MinPriFlowFrac; + if (thisTermUnitSizing.InducesPlenumAir) { + if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp + auto const &termUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum); + c->coilDesEntTemp = (termUnitFinalZoneSizing.DesHeatCoilInTempTU * MinPriFlowFrac) + + (termUnitFinalZoneSizing.ZoneRetTempAtHeatPeak * (1.0 - MinPriFlowFrac)); + c->coilDesEntHumRat = (termUnitFinalZoneSizing.DesHeatCoilInHumRatTU * MinPriFlowFrac) + + (termUnitFinalZoneSizing.ZoneHumRatAtHeatPeak * (1.0 - MinPriFlowFrac)); + } } else { - desOAFlowFrac = finalZoneSizing.DesHeatOAFlowFrac; + if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp + auto const &thisTermUnitFinalZoneSizing = state.dataSize->TermUnitFinalZoneSizing(state.dataSize->CurTermUnitSizingNum); + c->coilDesEntTemp = (thisTermUnitFinalZoneSizing.DesHeatCoilInTempTU * MinPriFlowFrac) + + (thisTermUnitFinalZoneSizing.ZoneTempAtHeatPeak * (1.0 - MinPriFlowFrac)); + c->coilDesEntHumRat = (thisTermUnitFinalZoneSizing.DesHeatCoilInHumRatTU * MinPriFlowFrac) + + (thisTermUnitFinalZoneSizing.ZoneHumRatAtHeatPeak * (1.0 - MinPriFlowFrac)); + } } - c->coilDesEntTemp = desOAFlowFrac * finalZoneSizing.OutTempAtHeatPeak + (1.0 - desOAFlowFrac) * finalZoneSizing.ZoneTempAtHeatPeak; - c->coilDesEntHumRat = - desOAFlowFrac * finalZoneSizing.OutHumRatAtHeatPeak + (1.0 - desOAFlowFrac) * finalZoneSizing.ZoneHumRatAtHeatPeak; - } - } else if (state.dataSize->ZoneEqDXCoil) { - if (zoneEqSizing.OAVolFlow > 0.0) { + } else if (state.dataSize->ZoneEqFanCoil) { if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp - c->coilDesEntTemp = finalZoneSizing.DesHeatCoilInTemp; + Real64 desOAFlowFrac = 0.0; + if (zoneEqSizing.OAVolFlow > 0.0 && finalZoneSizing.DesHeatMassFlow > 0.0) { + desOAFlowFrac = std::min(state.dataEnvrn->StdRhoAir * zoneEqSizing.OAVolFlow / finalZoneSizing.DesHeatMassFlow, 1.0); + } else { + desOAFlowFrac = finalZoneSizing.DesHeatOAFlowFrac; + } + c->coilDesEntTemp = + desOAFlowFrac * finalZoneSizing.OutTempAtHeatPeak + (1.0 - desOAFlowFrac) * finalZoneSizing.ZoneTempAtHeatPeak; + c->coilDesEntHumRat = + desOAFlowFrac * finalZoneSizing.OutHumRatAtHeatPeak + (1.0 - desOAFlowFrac) * finalZoneSizing.ZoneHumRatAtHeatPeak; } - if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat - c->coilDesEntHumRat = finalZoneSizing.DesHeatCoilInHumRat; + } else if (state.dataSize->ZoneEqDXCoil) { + if (zoneEqSizing.OAVolFlow > 0.0) { + if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp + c->coilDesEntTemp = finalZoneSizing.DesHeatCoilInTemp; + } + if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat + c->coilDesEntHumRat = finalZoneSizing.DesHeatCoilInHumRat; + } + } else { + if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp + c->coilDesEntTemp = finalZoneSizing.ZoneTempAtHeatPeak; + } + if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat + c->coilDesEntHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak; + } } } else { if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp - c->coilDesEntTemp = finalZoneSizing.ZoneTempAtHeatPeak; + c->coilDesEntTemp = finalZoneSizing.DesHeatCoilInTemp; } if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat - c->coilDesEntHumRat = finalZoneSizing.ZoneHumRatAtHeatPeak; + c->coilDesEntHumRat = finalZoneSizing.DesHeatCoilInHumRat; } } - } else { - if (c->coilDesEntTemp == -999.0) { // don't overwrite if already set directly by setCoilEntAirTemp - c->coilDesEntTemp = finalZoneSizing.DesHeatCoilInTemp; - } - if (c->coilDesEntHumRat == -999.0) { // don't overwrite if already set directly by setCoilEntAirHumRat - c->coilDesEntHumRat = finalZoneSizing.DesHeatCoilInHumRat; - } - } - - if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) { - c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); - c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); - } - if (c->coilDesLvgTemp == -999.0) { // don't overwrite if already set directly by setCoilLvgAirTemp - c->coilDesLvgTemp = finalZoneSizing.HeatDesTemp; - } - if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly by setCoilLvgAirHumRat - c->coilDesLvgHumRat = finalZoneSizing.HeatDesHumRat; - } - c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); - c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); - } else if (curOASysNum > 0 && c->airloopNum > int(state.dataSize->FinalSysSizing.size())) { - if (!state.dataAirLoopHVACDOAS->airloopDOAS.empty()) { - c->oASysNum = curOASysNum; // where should this get set? It's -999 here. - int DOASSysNum = state.dataAirLoop->OutsideAirSys(curOASysNum).AirLoopDOASNum; - c->coilDesEntTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].HeatOutTemp; - c->coilDesEntHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].HeatOutHumRat; if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) { c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); } - c->coilDesLvgTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PreheatTemp; - c->coilDesLvgHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PreheatHumRat; - if (c->coilDesLvgTemp > -999.0 && c->coilDesLvgHumRat > -999.0) { - c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( - state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); - c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); + + if (c->coilDesLvgTemp == -999.0) { // don't overwrite if already set directly by setCoilLvgAirTemp + c->coilDesLvgTemp = finalZoneSizing.HeatDesTemp; } - 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]; - if (airLoopNum == 0) { - sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; - } else { - if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { - sizMethodsAreTheSame = false; + if (c->coilDesLvgHumRat == -999.0) { // don't overwrite if already set directly by setCoilLvgAirHumRat + c->coilDesLvgHumRat = finalZoneSizing.HeatDesHumRat; + } + c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); + c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); + } else if (curOASysNum > 0 && c->airloopNum > int(state.dataSize->FinalSysSizing.size())) { + if (!state.dataAirLoopHVACDOAS->airloopDOAS.empty()) { + c->oASysNum = curOASysNum; // where should this get set? It's -999 here. + int DOASSysNum = state.dataAirLoop->OutsideAirSys(curOASysNum).AirLoopDOASNum; + c->coilDesEntTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].HeatOutTemp; + c->coilDesEntHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].HeatOutHumRat; + if (c->coilDesEntTemp > -999.0 && c->coilDesEntHumRat > -999.0) { + c->coilDesEntWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesEntTemp, c->coilDesEntHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); + c->coilDesEntEnth = Psychrometrics::PsyHFnTdbW(c->coilDesEntTemp, c->coilDesEntHumRat); + } + c->coilDesLvgTemp = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PreheatTemp; + c->coilDesLvgHumRat = state.dataAirLoopHVACDOAS->airloopDOAS[DOASSysNum].PreheatHumRat; + if (c->coilDesLvgTemp > -999.0 && c->coilDesLvgHumRat > -999.0) { + c->coilDesLvgWetBulb = Psychrometrics::PsyTwbFnTdbWPb( + state, c->coilDesLvgTemp, c->coilDesLvgHumRat, state.dataEnvrn->StdBaroPress, "setCoilHeatingCapacity"); + c->coilDesLvgEnth = Psychrometrics::PsyHFnTdbW(c->coilDesLvgTemp, c->coilDesLvgHumRat); + } + 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]; + if (airLoopNum == 0) { + sizMethod = state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption; + } else { + if (sizMethod != state.dataSize->FinalSysSizing(actualAirLoopNum).SizingOption) { + sizMethodsAreTheSame = false; + } } } + if (sizMethodsAreTheSame) { + c->coilSizingMethodConcurrence = static_cast(sizMethod); + } else { + c->coilSizingMethodConcurrence = DataSizing::CoilSizingConcurrence::Combination; + } } - if (sizMethodsAreTheSame) { - c->coilSizingMethodConcurrence = static_cast(sizMethod); - } else { - c->coilSizingMethodConcurrence = DataSizing::CoilSizingConcurrence::Combination; - } + } else { + // do nothing } - } else { - // do nothing - } - if (state.dataSize->DataCoilIsSuppHeater) { - c->isSupplementalHeater = true; - } - // some heating coils only use this routine, so set air flow if not yet set - if (c->coilDesVolFlow <= 0.0) { - if (state.dataSize->DataFlowUsedForSizing > 0.0) { // flow has been set in global, so use it - c->coilDesVolFlow = state.dataSize->DataFlowUsedForSizing; - } else if (curZoneEqNum > 0 && allocated(state.dataSize->FinalZoneSizing)) { - auto const &finalZoneSizing = state.dataSize->FinalZoneSizing(curZoneEqNum); - if (finalZoneSizing.DesHeatMassFlow >= HVAC::SmallMassFlow) { - c->coilDesMassFlow = finalZoneSizing.DesHeatMassFlow; - c->coilDesVolFlow = c->coilDesMassFlow / state.dataEnvrn->StdRhoAir; - } - } else if (curSysNum > 0 && curSysNum <= int(state.dataSize->FinalSysSizing.size())) { - auto const &finalSysSizing = state.dataSize->FinalSysSizing(curSysNum); - if (curOASysNum > 0 && allocated(state.dataSize->OASysEqSizing)) { - auto const &oASysEqSizing = state.dataSize->OASysEqSizing(curSysNum); - if (oASysEqSizing.AirFlow) { - c->coilDesVolFlow = oASysEqSizing.AirVolFlow; - } else if (oASysEqSizing.HeatingAirFlow) { - c->coilDesVolFlow = oASysEqSizing.HeatingAirVolFlow; - } else { - c->coilDesVolFlow = finalSysSizing.DesOutAirVolFlow; + if (state.dataSize->DataCoilIsSuppHeater) { + c->isSupplementalHeater = true; + } + // some heating coils only use this routine, so set air flow if not yet set + if (c->coilDesVolFlow <= 0.0) { + if (state.dataSize->DataFlowUsedForSizing > 0.0) { // flow has been set in global, so use it + c->coilDesVolFlow = state.dataSize->DataFlowUsedForSizing; + } else if (curZoneEqNum > 0 && allocated(state.dataSize->FinalZoneSizing)) { + auto const &finalZoneSizing = state.dataSize->FinalZoneSizing(curZoneEqNum); + if (finalZoneSizing.DesHeatMassFlow >= HVAC::SmallMassFlow) { + c->coilDesMassFlow = finalZoneSizing.DesHeatMassFlow; + c->coilDesVolFlow = c->coilDesMassFlow / state.dataEnvrn->StdRhoAir; } - } else { - if (state.dataSize->DataFlowUsedForSizing > 0.0) { - c->coilDesVolFlow = state.dataSize->DataFlowUsedForSizing; - } else if (curSysNum > 0 && allocated(state.dataSize->UnitarySysEqSizing)) { - auto const &unitarySysEqSizing = state.dataSize->UnitarySysEqSizing(curSysNum); - if (unitarySysEqSizing.AirFlow) { - c->coilDesVolFlow = unitarySysEqSizing.AirVolFlow; - } else if (unitarySysEqSizing.HeatingAirFlow) { - c->coilDesVolFlow = unitarySysEqSizing.HeatingAirVolFlow; + } else if (curSysNum > 0 && curSysNum <= int(state.dataSize->FinalSysSizing.size())) { + auto const &finalSysSizing = state.dataSize->FinalSysSizing(curSysNum); + if (curOASysNum > 0 && allocated(state.dataSize->OASysEqSizing)) { + auto const &oASysEqSizing = state.dataSize->OASysEqSizing(curSysNum); + if (oASysEqSizing.AirFlow) { + c->coilDesVolFlow = oASysEqSizing.AirVolFlow; + } else if (oASysEqSizing.HeatingAirFlow) { + c->coilDesVolFlow = oASysEqSizing.HeatingAirVolFlow; + } else { + c->coilDesVolFlow = finalSysSizing.DesOutAirVolFlow; } } else { - if (state.dataSize->CurDuctType == HVAC::AirDuctType::Main) { - if (finalSysSizing.SysAirMinFlowRat > 0.0 && !state.dataSize->DataDesicRegCoil) { - c->coilDesVolFlow = finalSysSizing.SysAirMinFlowRat * finalSysSizing.DesMainVolFlow; - } else { - c->coilDesVolFlow = finalSysSizing.DesMainVolFlow; + if (state.dataSize->DataFlowUsedForSizing > 0.0) { + c->coilDesVolFlow = state.dataSize->DataFlowUsedForSizing; + } else if (curSysNum > 0 && allocated(state.dataSize->UnitarySysEqSizing)) { + auto const &unitarySysEqSizing = state.dataSize->UnitarySysEqSizing(curSysNum); + if (unitarySysEqSizing.AirFlow) { + c->coilDesVolFlow = unitarySysEqSizing.AirVolFlow; + } else if (unitarySysEqSizing.HeatingAirFlow) { + c->coilDesVolFlow = unitarySysEqSizing.HeatingAirVolFlow; } - } else if (state.dataSize->CurDuctType == HVAC::AirDuctType::Cooling) { - if (finalSysSizing.SysAirMinFlowRat > 0.0 && !state.dataSize->DataDesicRegCoil) { - c->coilDesVolFlow = finalSysSizing.SysAirMinFlowRat * finalSysSizing.DesCoolVolFlow; + } else { + if (state.dataSize->CurDuctType == HVAC::AirDuctType::Main) { + if (finalSysSizing.SysAirMinFlowRat > 0.0 && !state.dataSize->DataDesicRegCoil) { + c->coilDesVolFlow = finalSysSizing.SysAirMinFlowRat * finalSysSizing.DesMainVolFlow; + } else { + c->coilDesVolFlow = finalSysSizing.DesMainVolFlow; + } + } else if (state.dataSize->CurDuctType == HVAC::AirDuctType::Cooling) { + if (finalSysSizing.SysAirMinFlowRat > 0.0 && !state.dataSize->DataDesicRegCoil) { + c->coilDesVolFlow = finalSysSizing.SysAirMinFlowRat * finalSysSizing.DesCoolVolFlow; + } else { + c->coilDesVolFlow = finalSysSizing.DesCoolVolFlow; + } + } else if (state.dataSize->CurDuctType == HVAC::AirDuctType::Heating) { + c->coilDesVolFlow = finalSysSizing.DesHeatVolFlow; + } else if (state.dataSize->CurDuctType == HVAC::AirDuctType::Other) { + c->coilDesVolFlow = finalSysSizing.DesMainVolFlow; } else { - c->coilDesVolFlow = finalSysSizing.DesCoolVolFlow; + c->coilDesVolFlow = finalSysSizing.DesMainVolFlow; } - } else if (state.dataSize->CurDuctType == HVAC::AirDuctType::Heating) { - c->coilDesVolFlow = finalSysSizing.DesHeatVolFlow; - } else if (state.dataSize->CurDuctType == HVAC::AirDuctType::Other) { - c->coilDesVolFlow = finalSysSizing.DesMainVolFlow; - } else { - c->coilDesVolFlow = finalSysSizing.DesMainVolFlow; } } } + c->coilDesMassFlow = c->coilDesVolFlow * state.dataEnvrn->StdRhoAir; } - c->coilDesMassFlow = c->coilDesVolFlow * state.dataEnvrn->StdRhoAir; + + // calc sensible capacity from inlet outlet + c->cpMoistAir = Psychrometrics::PsyCpAirFnW(c->coilDesLvgHumRat); + // this is not generally correct but okay for heating coils + c->coilSensCapAtPeak = std::abs(c->cpMoistAir * c->coilDesMassFlow * (c->coilDesLvgTemp - c->coilDesEntTemp)); + c->coilSensCapAtPeak = min(c->coilSensCapAtPeak, c->coilTotCapAtPeak); } - // calc sensible capacity from inlet outlet - c->cpMoistAir = Psychrometrics::PsyCpAirFnW(c->coilDesLvgHumRat); - // this is not generally correct but okay for heating coils - c->coilSensCapAtPeak = std::abs(c->cpMoistAir * c->coilDesMassFlow * (c->coilDesLvgTemp - c->coilDesEntTemp)); - c->coilSensCapAtPeak = min(c->coilSensCapAtPeak, c->coilTotCapAtPeak); -} - -void setCoilWaterCoolingCapacity(EnergyPlusData &state, - int const coilNum, - Real64 const totalCoolingCap, // {W} coil cooling capacity - bool const isAutoSize, // true if value was autosized - int const inletNodeNum, // coil chw inlet node num - int const outletNodeNum, // coil chw outlet node num - int const dataWaterLoopNum // plant loop structure index - ) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilTotCapAtPeak = totalCoolingCap; - c->capIsAutosized = isAutoSize; - if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) { - bool errorsfound = false; - c->pltSizNum = PlantUtilities::MyPlantSizingIndex(state, "chilled water coil", c->coilName_, inletNodeNum, outletNodeNum, errorsfound); - } else { - c->pltSizNum = -999; + void setCoilWaterCoolingCapacity(EnergyPlusData &state, + int const coilNum, + Real64 const totalCoolingCap, // {W} coil cooling capacity + bool const isAutoSize, // true if value was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const dataWaterLoopNum // plant loop structure index + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilTotCapAtPeak = totalCoolingCap; + c->capIsAutosized = isAutoSize; + if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) { + bool errorsfound = false; + c->pltSizNum = PlantUtilities::MyPlantSizingIndex(state, "chilled water coil", c->coilName_, inletNodeNum, outletNodeNum, errorsfound); + } else { + c->pltSizNum = -999; + } + c->waterLoopNum = dataWaterLoopNum; } - c->waterLoopNum = dataWaterLoopNum; -} - -void setCoilWaterHeaterCapacityNodeNums(EnergyPlusData &state, - int const coilNum, // user-defined name of the coil - Real64 const totalHeatingCap, // {W} coil Heating capacity - bool const isAutoSize, // true if value was autosized - int const inletNodeNum, // coil chw inlet node num - int const outletNodeNum, // coil chw outlet node num - int const dataWaterLoopNum // plant loop structure index -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilTotCapAtPeak = totalHeatingCap; - c->capIsAutosized = isAutoSize; - if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) { - bool errorsfound = false; - c->pltSizNum = PlantUtilities::MyPlantSizingIndex(state, "hot water coil", c->coilName_, inletNodeNum, outletNodeNum, errorsfound); - } else { - c->pltSizNum = -999; + + void setCoilWaterHeaterCapacityNodeNums(EnergyPlusData &state, + int const coilNum, // user-defined name of the coil + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const dataWaterLoopNum // plant loop structure index + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilTotCapAtPeak = totalHeatingCap; + c->capIsAutosized = isAutoSize; + if ((state.dataSize->NumPltSizInput > 0) && (inletNodeNum > 0) && (outletNodeNum > 0)) { + bool errorsfound = false; + c->pltSizNum = PlantUtilities::MyPlantSizingIndex(state, "hot water coil", c->coilName_, inletNodeNum, outletNodeNum, errorsfound); + } else { + c->pltSizNum = -999; + } + c->waterLoopNum = dataWaterLoopNum; } - c->waterLoopNum = dataWaterLoopNum; -} - -void setCoilWaterHeaterCapacityPltSizNum(EnergyPlusData &state, - int const coilNum, - Real64 const totalHeatingCap, // {W} coil Heating capacity - bool const isAutoSize, // true if value was autosized - int const dataPltSizNum, // plant sizing structure index - int const dataWaterLoopNum // plant loop structure index - ) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilTotCapAtPeak = totalHeatingCap; - c->capIsAutosized = isAutoSize; - c->pltSizNum = dataPltSizNum; - c->waterLoopNum = dataWaterLoopNum; -} - - -void setCoilUA(EnergyPlusData &state, - int const coilNum, - Real64 const UAvalue, // [W/k] UA value for coil, - Real64 const dataCapacityUsedForSizing, // [W] sizing global - bool const isAutoSize, // true if value was autosized - int const curSysNum, // airloop system number index, if non zero - int const curZoneEqNum // zone equipment list index, if non-zero -) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->coilUA = UAvalue; - c->coilTotCapAtPeak = dataCapacityUsedForSizing; - c->capIsAutosized = isAutoSize; - c->airloopNum = curSysNum; - doAirLoopSetup(state, coilNum); - c->zoneEqNum = curZoneEqNum; -} - - -void setCoilReheatMultiplier(EnergyPlusData &state, - int const coilNum, - Real64 const multiplierReheatLoad) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->reheatLoadMult = multiplierReheatLoad; -} - -void setCoilSupplyFanInfo(EnergyPlusData &state, - int const coilNum, - std::string const &fanName, - HVAC::FanType fanType, - int fanIndex) -{ - assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); - if (fanName.empty()) { - return; + + void setCoilWaterHeaterCapacityPltSizNum(EnergyPlusData &state, + int const coilNum, + Real64 const totalHeatingCap, // {W} coil Heating capacity + bool const isAutoSize, // true if value was autosized + int const dataPltSizNum, // plant sizing structure index + int const dataWaterLoopNum // plant loop structure index + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilTotCapAtPeak = totalHeatingCap; + c->capIsAutosized = isAutoSize; + c->pltSizNum = dataPltSizNum; + c->waterLoopNum = dataWaterLoopNum; } - auto *c = state.dataRptCoilSelection->coils[coilNum]; - c->fanAssociatedWithCoilName = fanName; - c->supFanType = fanType; - c->supFanNum = fanIndex; - if (c->supFanNum == 0) { - c->supFanNum = Fans::GetFanIndex(state, fanName); + void setCoilUA(EnergyPlusData &state, + int const coilNum, + Real64 const UAvalue, // [W/k] UA value for coil, + Real64 const dataCapacityUsedForSizing, // [W] sizing global + bool const isAutoSize, // true if value was autosized + int const curSysNum, // airloop system number index, if non zero + int const curZoneEqNum // zone equipment list index, if non-zero + ) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->coilUA = UAvalue; + c->coilTotCapAtPeak = dataCapacityUsedForSizing; + c->capIsAutosized = isAutoSize; + c->airloopNum = curSysNum; + doAirLoopSetup(state, coilNum); + c->zoneEqNum = curZoneEqNum; } -} - -void setCoilEqNum(EnergyPlusData &state, - std::string const &coilName, - HVAC::CoilType const coilType, - int const curSysNum, - int const curOASysNum, - int const curZoneEqNum) -{ - int index = getReportIndex(state, coilName, coilType); - setCoilEqNum(state, index, curSysNum, curOASysNum, curZoneEqNum); -} - -void setCoilEqNum(EnergyPlusData &state, - int const index, - int const curSysNum, - int const curOASysNum, - int const curZoneEqNum) -{ - assert(index >= 0 && index < (int)state.dataRptCoilSelection->coils.size()); - auto *c = state.dataRptCoilSelection->coils[index]; - c->airloopNum = curSysNum; - c->oASysNum = curOASysNum; - c->zoneEqNum = curZoneEqNum; -} - -std::string getTimeText(EnergyPlusData &state, int const timeStepAtPeak) -{ - std::string returnString; - - if (timeStepAtPeak == 0) { - return returnString; + + void setCoilReheatMultiplier(EnergyPlusData &state, int const coilNum, Real64 const multiplierReheatLoad) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->reheatLoadMult = multiplierReheatLoad; } - // Scan timesteps of 24-hr day to match up correct hour and minute - int minutes(0); - int timeStepIndex(0); - int hourPrint; - for (int hourCounter = 1; hourCounter <= 24; ++hourCounter) { - for (int timeStepCounter = 1; timeStepCounter <= state.dataGlobal->TimeStepsInHour; ++timeStepCounter) { - ++timeStepIndex; - minutes += state.dataGlobal->MinutesInTimeStep; - if (minutes == 60) { - minutes = 0; - hourPrint = hourCounter; - } else { - hourPrint = hourCounter - 1; - } - if (timeStepIndex == timeStepAtPeak) { - returnString = format(DataSizing::PeakHrMinFmt, hourPrint, minutes); + void setCoilSupplyFanInfo(EnergyPlusData &state, int const coilNum, std::string const &fanName, HVAC::FanType fanType, int fanIndex) + { + assert(coilNum >= 0 && coilNum < (int)state.dataRptCoilSelection->coils.size()); + if (fanName.empty()) { + return; + } + + auto *c = state.dataRptCoilSelection->coils[coilNum]; + c->fanAssociatedWithCoilName = fanName; + c->supFanType = fanType; + c->supFanNum = fanIndex; + if (c->supFanNum == 0) { + c->supFanNum = Fans::GetFanIndex(state, fanName); + } + } + + void setCoilEqNum(EnergyPlusData &state, + std::string const &coilName, + HVAC::CoilType const coilType, + int const curSysNum, + int const curOASysNum, + int const curZoneEqNum) + { + int index = getReportIndex(state, coilName, coilType); + setCoilEqNum(state, index, curSysNum, curOASysNum, curZoneEqNum); + } + + void setCoilEqNum(EnergyPlusData &state, int const index, int const curSysNum, int const curOASysNum, int const curZoneEqNum) + { + assert(index >= 0 && index < (int)state.dataRptCoilSelection->coils.size()); + auto *c = state.dataRptCoilSelection->coils[index]; + c->airloopNum = curSysNum; + c->oASysNum = curOASysNum; + c->zoneEqNum = curZoneEqNum; + } + + std::string getTimeText(EnergyPlusData &state, int const timeStepAtPeak) + { + std::string returnString; + + if (timeStepAtPeak == 0) { + return returnString; + } + + // Scan timesteps of 24-hr day to match up correct hour and minute + int minutes(0); + int timeStepIndex(0); + int hourPrint; + for (int hourCounter = 1; hourCounter <= 24; ++hourCounter) { + for (int timeStepCounter = 1; timeStepCounter <= state.dataGlobal->TimeStepsInHour; ++timeStepCounter) { + ++timeStepIndex; + minutes += state.dataGlobal->MinutesInTimeStep; + if (minutes == 60) { + minutes = 0; + hourPrint = hourCounter; + } else { + hourPrint = hourCounter - 1; + } + if (timeStepIndex == timeStepAtPeak) { + returnString = format(DataSizing::PeakHrMinFmt, hourPrint, minutes); + } } } + + return returnString; } - return returnString; -} - -bool isCompTypeFan(std::string const &compType // string component type, input object class name -) -{ - return getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(compType)) != -1; -} - -bool isCompTypeCoil(std::string const &compType // string component type, input object class name -) -{ - // if compType name is one of the coil objects, then return true - return getEnumValue(HVAC::coilTypeNamesUC, Util::makeUPPER(compType)) != -1; -} - -void setZoneLatentLoadCoolingIdealPeak(EnergyPlusData &state, int const zoneIndex, Real64 const zoneCoolingLatentLoad) -{ - // loop over all the coils and the zones in the coils and if this zone index is in the coil - for (auto const &c : state.dataRptCoilSelection->coils) { - - if (c->isCooling) { - for (std::size_t zoneInd = 0; zoneInd < c->zoneNum.size(); ++zoneInd) { - if (zoneIndex == c->zoneNum[zoneInd]) { - c->rmLatentAtPeak += zoneCoolingLatentLoad; - break; + bool isCompTypeFan(std::string const &compType // string component type, input object class name + ) + { + return getEnumValue(HVAC::fanTypeNamesUC, Util::makeUPPER(compType)) != -1; + } + + bool isCompTypeCoil(std::string const &compType // string component type, input object class name + ) + { + // if compType name is one of the coil objects, then return true + return getEnumValue(HVAC::coilTypeNamesUC, Util::makeUPPER(compType)) != -1; + } + + void setZoneLatentLoadCoolingIdealPeak(EnergyPlusData &state, int const zoneIndex, Real64 const zoneCoolingLatentLoad) + { + // loop over all the coils and the zones in the coils and if this zone index is in the coil + for (auto const &c : state.dataRptCoilSelection->coils) { + + if (c->isCooling) { + for (std::size_t zoneInd = 0; zoneInd < c->zoneNum.size(); ++zoneInd) { + if (zoneIndex == c->zoneNum[zoneInd]) { + c->rmLatentAtPeak += zoneCoolingLatentLoad; + break; + } } } } } -} - -void setZoneLatentLoadHeatingIdealPeak(EnergyPlusData &state, int const zoneIndex, Real64 const zoneHeatingLatentLoad) -{ - // loop over all the coils and the zones in the coils and if this zone index is in the coil - for (auto *c : state.dataRptCoilSelection->coils) { - - if (c->isHeating) { - for (std::size_t zoneInd = 0; zoneInd < c->zoneNum.size(); ++zoneInd) { - if (zoneIndex == c->zoneNum[zoneInd]) { - c->rmLatentAtPeak += zoneHeatingLatentLoad; - break; + + void setZoneLatentLoadHeatingIdealPeak(EnergyPlusData &state, int const zoneIndex, Real64 const zoneHeatingLatentLoad) + { + // loop over all the coils and the zones in the coils and if this zone index is in the coil + for (auto *c : state.dataRptCoilSelection->coils) { + + if (c->isHeating) { + for (std::size_t zoneInd = 0; zoneInd < c->zoneNum.size(); ++zoneInd) { + if (zoneIndex == c->zoneNum[zoneInd]) { + c->rmLatentAtPeak += zoneHeatingLatentLoad; + break; + } } } } } -} } // namespace ReportCoilSelection } // namespace EnergyPlus diff --git a/src/EnergyPlus/ReportCoilSelection.hh b/src/EnergyPlus/ReportCoilSelection.hh index 0ee678019d3..d7fe1c2fbfa 100644 --- a/src/EnergyPlus/ReportCoilSelection.hh +++ b/src/EnergyPlus/ReportCoilSelection.hh @@ -64,172 +64,171 @@ namespace EnergyPlus { // Forward declarations struct EnergyPlusData; -namespace ReportCoilSelection -{ - -class CoilSelectionData -// data object, one for each unique coil in simulation -{ +namespace ReportCoilSelection { -public: // methods - // Constructor - explicit CoilSelectionData(std::string const &coilName); - -public: // data - std::string coilName_; // user-defined coil name - HVAC::CoilType coilType = HVAC::CoilType::Invalid; - bool isCooling; // true if this coil is for cooling - bool isHeating; // true if this coil is for heating - std::string coilLocation; // where is the coil located?, AirLoop or Zone - std::string desDayNameAtSensPeak; // the name of the design day that produced the sensible Ideal Loads peak - std::string coilSensePeakHrMin; // time stamp of the sensible coil peak during Ideal Loads Simulation - std::string desDayNameAtTotalPeak; // the name of the design day that produced the total Ideal Loads peak - std::string coilTotalPeakHrMin; // time stamp of the sensible coil peak during Ideal Loads Simulation - std::string desDayNameAtAirFlowPeak; // the name of the design day that produced the air flow Ideal Loads peak - std::string airPeakHrMin; // time stamp of the airflow peak during Ideal Loads Simulation - - int coilNum; // coil array index associated with WaterCoil(), DXCoil(), or HeatingCoil() array structures - int airloopNum; // Coil index to AirLoop - int oaControllerNum; // Coil index to OAController - int zoneEqNum; // Coil index to CurZoneEqNum, for zone coils - int oASysNum; // Coil index to OASysEqSizing - std::vector zoneNum; // list of zone indexes associated with this coil - std::vector zoneName; // list of zone names associated with this coil, if any - std::string typeHVACname; // this coil is in what sort of HVAC system, parent object types - std::string userNameforHVACsystem; // this coil is an HVAC system named by the user. - int zoneHVACTypeNum; // store type num if zoneHVAC - int zoneHVACIndex; // store component index for zone HVAC - int typeof_Coil; // type of coil, e.g., PlantEquipmentType::CoilWaterSimpleHeating, PlantEquipmentType::CoilWaterDetailedFlatCooling, - // PlantEquipmentType::CoilWaterCooling - - 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 - std::string coilSizingMethodCapacityName; - - int coilSizingMethodAirFlow; // choice of how to get system design air flow rates; - // 2=SupplyAirFlowRate, 3=FlowPerFloorArea, 4=FractionOfAutosizedCoolingAirflow, - // 5=FractionOfAutosizedHeatingAirflow, 6=FlowPerCoolingCapacity, 7=FlowPerHeatingCapacity - std::string coilSizingMethodAirFlowName; - - bool isCoilSizingForTotalLoad; // Type of peak to size (cooling) coils on: True is TotalCoolingLoad, False is sensible - std::string coilPeakLoadTypeToSizeOnName; - - // Real64 coilDesCapUser; // coil capacity original input value [W]; -999 means field not applicable to this coil - bool capIsAutosized; // true if the coil's capacity was autosized - std::string coilCapAutoMsg; // Yes if user cap was autosized, No if hard value entered - - bool volFlowIsAutosized; // true if the coil's flow was autosized - std::string coilVolFlowAutoMsg; // Yes if user flow was autosized, no if hard value; - Real64 coilWaterFlowUser; // coil water flow original input value [m3/s]; -999 means field not applicable to this coil - std::string coilWaterFlowAutoMsg; // Yes if user water flow was autosized - - bool oaPretreated; // Was the outside air pretreated prior to inlet of coil [True or False] - std::string coilOAPretreatMsg; // Yes if the entering air OA was pretreated before mixing, No otherwise - - bool isSupplementalHeater; // true if heating coil is a supplemental heater. - Real64 coilTotCapFinal; - Real64 coilSensCapFinal; - Real64 coilRefAirVolFlowFinal; - Real64 coilRefWaterVolFlowFinal; - - // Values from time of Ideal Load Sizing Peak - Real64 coilTotCapAtPeak; // coil total capacity at peak [W] - Real64 coilSensCapAtPeak; // coil sensible capacity at peak [W] - Real64 coilDesMassFlow; // coil design air mass flow rate [kg/s] - Real64 coilDesVolFlow; // coil design air volume flow rate [m3/s] - Real64 coilDesEntTemp; // coil entering dry bulb at peak [C] - Real64 coilDesEntWetBulb; // coil design entering wet bulb [C] - Real64 coilDesEntHumRat; // coil entering humidity ratio at peak [kgWater/kgDryAir] - Real64 coilDesEntEnth; // coil entering enthalpy [J/kg-C] - Real64 coilDesLvgTemp; // coil leaving dry bulb at peak [C] - Real64 coilDesLvgWetBulb; // coil design leaving wet bulb [C] - Real64 coilDesLvgHumRat; // coil leaving humidity ratio at peak [kgWater/kgDryAir] - Real64 coilDesLvgEnth; // coil leaving enthalpy [J/kg-C] - Real64 coilDesWaterMassFlow; // coil design water mass flow rate [m3/s] - Real64 coilDesWaterEntTemp; // coil design entering water temperature[C] - Real64 coilDesWaterLvgTemp; // coil design leaving water temperature [C] - Real64 coilDesWaterTempDiff; // coil plant design delta T [ delta C] - - int pltSizNum; // index to PlantSizData() array if this coil attached to a plant - int waterLoopNum; // Plant loop index if this (water) coil attached to a plant - std::string plantLoopName; // user name of the plant loop - Real64 oaPeakTemp; // outside air dry bulb at ideal loads peak [C] - Real64 oaPeakHumRat; // outside air humidity ratio at ideal loads peak [kgWater/kgDryAir] - Real64 oaPeakWetBulb; // outside air wet bulb at peak [C] - Real64 oaPeakVolFlow; // outside air volume flow rate at peak [m3/s] - Real64 oaPeakVolFrac; // fraction of outside air volume flow rate at peak - Real64 oaDoaTemp; // DOA unit design supply air dry bulb [C] - Real64 oaDoaHumRat; // DOA unit design supply air humidity ratio [kgWater/kgDryAir] - Real64 raPeakTemp; // return air dry bulb at peak [C] - Real64 raPeakHumRat; // return air humidity ratio at peak [kgWater/kgDryAir] - Real64 rmPeakTemp; // room air dry bulb (setpoint) at peak [C] - Real64 rmPeakHumRat; // room air humidity ratio (setpoint) at peak [kgWater/kgDryAir] - Real64 rmPeakRelHum; // room air relative humidity (setpoint) at peak [%] - Real64 rmSensibleAtPeak; // space sensible zone load at peak [W] - Real64 rmLatentAtPeak; // space latent zone load at ideal loads peak [W] - Real64 coilIdealSizCapOverSimPeakCap; // capacity at rated conditions subtracted by capacity at simulation peak, zero if under sized [W] - Real64 coilIdealSizCapUnderSimPeakCap; // capacity at simulation peak subtracted by capacity at rated conditions, zero if oversized [W] - Real64 reheatLoadMult; // reheat coil multiplier due to over/undersizing of coil airflow - Real64 minRatio; // Flow/capacity ratio too low so reducing capacity by ratio - Real64 maxRatio; // Flow/capacity ratio too high so increasing capacity by ratio - Real64 cpMoistAir; // specific heat capacity of moist air through coil [J/kg-C] - Real64 cpDryAir; // specific heat capacity of dry air (at elevation) [J/kg-C] - Real64 rhoStandAir; // density of dry air at a standard temp and at eleveation [kg/m3] - Real64 rhoFluid; // density of coil plant fluid [kg/m3] - Real64 cpFluid; // specific heat capacity of coil plant fluid [J/kg-K] - Real64 coilCapFTIdealPeak; // coil capacity multiplier at Ideal Peak conditions, func of temperature only, to the input rating point (usually - // for a DX coil) [W] - Real64 coilRatedTotCap; // rated coil total capacity [W] - Real64 coilRatedSensCap; // rated coil sensible capacity [W] - Real64 ratedAirMassFlow; // rated coil design air mass flow rate [m3/s] - Real64 ratedCoilInDb; // rated coil inlet air dry bulb [C] - Real64 ratedCoilInWb; // rated coil inlet air wet bulb [C] - Real64 ratedCoilInHumRat; // rated coil inlet air humidity ratio [kgWater/kgDryAir] - Real64 ratedCoilInEnth; // rated coil inlet air enthalpy [J/kg-C] - Real64 ratedCoilOutDb; // rated coil outlet air dry bulb [C] - Real64 ratedCoilOutWb; // rated coil outlet air wet bulb [C] - Real64 ratedCoilOutHumRat; // rated coil outlet air humidity ratio, [kgWater/kgDryAir] - Real64 ratedCoilOutEnth; // rated coil outlet air enthalpy [J/kg-C] - Real64 ratedCoilEff; // rated coil effectiveness - Real64 ratedCoilBpFactor; // rated coil bypass factor - Real64 ratedCoilAppDewPt; // rated coil apparatus dew point [C] - Real64 ratedCoilOadbRef; // rated DX coil outside air dry bulb reference [C] - Real64 ratedCoilOawbRef; // rated DX coil outside air wet bulb reference [C] - - std::string fanAssociatedWithCoilName; // name of fan found to be associated with this coil - std::string fanTypeName; // type of fan found to be associated with this coil - HVAC::FanType supFanType; // indicates which type of fan model for supply fan, legacy or new OO - int supFanNum = 0; // index pointing to this fan in legacy fan data structure, 1-based struct array - Real64 fanSizeMaxAirVolumeFlow; // the size of the fan in terms of volume flow rate [m3/s] - Real64 fanSizeMaxAirMassFlow; // the size of the fan in terms of mass flow rate [kg/s] - Real64 fanHeatGainIdealPeak; // Fan heat gain to air during Ideal loads peak sizing [W] - Real64 coilAndFanNetTotalCapacityIdealPeak; // coil net total capacity including fan heat gain for ideal loads peak sizing [W] - - // static plant info - Real64 plantDesMaxMassFlowRate; // this coil's plant loop overall design flow rate [kg/s] - Real64 plantDesRetTemp; // this coil's plant loop design return temperature - Real64 plantDesSupTemp; // this coil's plant loop design supply temperature - Real64 plantDesDeltaTemp; // this coil's plant loop design temperature difference (delta C) - Real64 plantDesCapacity; // this coil's plant loop capacity [W] - Real64 coilCapPrcntPlantCap; // this coil's capacity as a percentage of the overall loop's capacity - Real64 coilFlowPrcntPlantFlow; // this coil's design flow rate as a percentage the overall loop's design flow rate - // misc - Real64 coilUA; // U-value times Area, coil sizing result for UA [ ] - -}; // end class CoilSelectionData + class CoilSelectionData + // data object, one for each unique coil in simulation + { + + public: // methods + // Constructor + explicit CoilSelectionData(std::string const &coilName); + + public: // data + std::string coilName_; // user-defined coil name + HVAC::CoilType coilType = HVAC::CoilType::Invalid; + bool isCooling; // true if this coil is for cooling + bool isHeating; // true if this coil is for heating + std::string coilLocation; // where is the coil located?, AirLoop or Zone + std::string desDayNameAtSensPeak; // the name of the design day that produced the sensible Ideal Loads peak + std::string coilSensePeakHrMin; // time stamp of the sensible coil peak during Ideal Loads Simulation + std::string desDayNameAtTotalPeak; // the name of the design day that produced the total Ideal Loads peak + std::string coilTotalPeakHrMin; // time stamp of the sensible coil peak during Ideal Loads Simulation + std::string desDayNameAtAirFlowPeak; // the name of the design day that produced the air flow Ideal Loads peak + std::string airPeakHrMin; // time stamp of the airflow peak during Ideal Loads Simulation + + int coilNum; // coil array index associated with WaterCoil(), DXCoil(), or HeatingCoil() array structures + int airloopNum; // Coil index to AirLoop + int oaControllerNum; // Coil index to OAController + int zoneEqNum; // Coil index to CurZoneEqNum, for zone coils + int oASysNum; // Coil index to OASysEqSizing + std::vector zoneNum; // list of zone indexes associated with this coil + std::vector zoneName; // list of zone names associated with this coil, if any + std::string typeHVACname; // this coil is in what sort of HVAC system, parent object types + std::string userNameforHVACsystem; // this coil is an HVAC system named by the user. + int zoneHVACTypeNum; // store type num if zoneHVAC + int zoneHVACIndex; // store component index for zone HVAC + int typeof_Coil; // type of coil, e.g., PlantEquipmentType::CoilWaterSimpleHeating, PlantEquipmentType::CoilWaterDetailedFlatCooling, + // PlantEquipmentType::CoilWaterCooling + + 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 + std::string coilSizingMethodCapacityName; + + int coilSizingMethodAirFlow; // choice of how to get system design air flow rates; + // 2=SupplyAirFlowRate, 3=FlowPerFloorArea, 4=FractionOfAutosizedCoolingAirflow, + // 5=FractionOfAutosizedHeatingAirflow, 6=FlowPerCoolingCapacity, 7=FlowPerHeatingCapacity + std::string coilSizingMethodAirFlowName; + + bool isCoilSizingForTotalLoad; // Type of peak to size (cooling) coils on: True is TotalCoolingLoad, False is sensible + std::string coilPeakLoadTypeToSizeOnName; + + // Real64 coilDesCapUser; // coil capacity original input value [W]; -999 means field not applicable to this coil + bool capIsAutosized; // true if the coil's capacity was autosized + std::string coilCapAutoMsg; // Yes if user cap was autosized, No if hard value entered + + bool volFlowIsAutosized; // true if the coil's flow was autosized + std::string coilVolFlowAutoMsg; // Yes if user flow was autosized, no if hard value; + Real64 coilWaterFlowUser; // coil water flow original input value [m3/s]; -999 means field not applicable to this coil + std::string coilWaterFlowAutoMsg; // Yes if user water flow was autosized + + bool oaPretreated; // Was the outside air pretreated prior to inlet of coil [True or False] + std::string coilOAPretreatMsg; // Yes if the entering air OA was pretreated before mixing, No otherwise + + bool isSupplementalHeater; // true if heating coil is a supplemental heater. + Real64 coilTotCapFinal; + Real64 coilSensCapFinal; + Real64 coilRefAirVolFlowFinal; + Real64 coilRefWaterVolFlowFinal; + + // Values from time of Ideal Load Sizing Peak + Real64 coilTotCapAtPeak; // coil total capacity at peak [W] + Real64 coilSensCapAtPeak; // coil sensible capacity at peak [W] + Real64 coilDesMassFlow; // coil design air mass flow rate [kg/s] + Real64 coilDesVolFlow; // coil design air volume flow rate [m3/s] + Real64 coilDesEntTemp; // coil entering dry bulb at peak [C] + Real64 coilDesEntWetBulb; // coil design entering wet bulb [C] + Real64 coilDesEntHumRat; // coil entering humidity ratio at peak [kgWater/kgDryAir] + Real64 coilDesEntEnth; // coil entering enthalpy [J/kg-C] + Real64 coilDesLvgTemp; // coil leaving dry bulb at peak [C] + Real64 coilDesLvgWetBulb; // coil design leaving wet bulb [C] + Real64 coilDesLvgHumRat; // coil leaving humidity ratio at peak [kgWater/kgDryAir] + Real64 coilDesLvgEnth; // coil leaving enthalpy [J/kg-C] + Real64 coilDesWaterMassFlow; // coil design water mass flow rate [m3/s] + Real64 coilDesWaterEntTemp; // coil design entering water temperature[C] + Real64 coilDesWaterLvgTemp; // coil design leaving water temperature [C] + Real64 coilDesWaterTempDiff; // coil plant design delta T [ delta C] + + int pltSizNum; // index to PlantSizData() array if this coil attached to a plant + int waterLoopNum; // Plant loop index if this (water) coil attached to a plant + std::string plantLoopName; // user name of the plant loop + Real64 oaPeakTemp; // outside air dry bulb at ideal loads peak [C] + Real64 oaPeakHumRat; // outside air humidity ratio at ideal loads peak [kgWater/kgDryAir] + Real64 oaPeakWetBulb; // outside air wet bulb at peak [C] + Real64 oaPeakVolFlow; // outside air volume flow rate at peak [m3/s] + Real64 oaPeakVolFrac; // fraction of outside air volume flow rate at peak + Real64 oaDoaTemp; // DOA unit design supply air dry bulb [C] + Real64 oaDoaHumRat; // DOA unit design supply air humidity ratio [kgWater/kgDryAir] + Real64 raPeakTemp; // return air dry bulb at peak [C] + Real64 raPeakHumRat; // return air humidity ratio at peak [kgWater/kgDryAir] + Real64 rmPeakTemp; // room air dry bulb (setpoint) at peak [C] + Real64 rmPeakHumRat; // room air humidity ratio (setpoint) at peak [kgWater/kgDryAir] + Real64 rmPeakRelHum; // room air relative humidity (setpoint) at peak [%] + Real64 rmSensibleAtPeak; // space sensible zone load at peak [W] + Real64 rmLatentAtPeak; // space latent zone load at ideal loads peak [W] + Real64 coilIdealSizCapOverSimPeakCap; // capacity at rated conditions subtracted by capacity at simulation peak, zero if under sized [W] + Real64 coilIdealSizCapUnderSimPeakCap; // capacity at simulation peak subtracted by capacity at rated conditions, zero if oversized [W] + Real64 reheatLoadMult; // reheat coil multiplier due to over/undersizing of coil airflow + Real64 minRatio; // Flow/capacity ratio too low so reducing capacity by ratio + Real64 maxRatio; // Flow/capacity ratio too high so increasing capacity by ratio + Real64 cpMoistAir; // specific heat capacity of moist air through coil [J/kg-C] + Real64 cpDryAir; // specific heat capacity of dry air (at elevation) [J/kg-C] + Real64 rhoStandAir; // density of dry air at a standard temp and at eleveation [kg/m3] + Real64 rhoFluid; // density of coil plant fluid [kg/m3] + Real64 cpFluid; // specific heat capacity of coil plant fluid [J/kg-K] + Real64 coilCapFTIdealPeak; // coil capacity multiplier at Ideal Peak conditions, func of temperature only, to the input rating point + // (usually for a DX coil) [W] + Real64 coilRatedTotCap; // rated coil total capacity [W] + Real64 coilRatedSensCap; // rated coil sensible capacity [W] + Real64 ratedAirMassFlow; // rated coil design air mass flow rate [m3/s] + Real64 ratedCoilInDb; // rated coil inlet air dry bulb [C] + Real64 ratedCoilInWb; // rated coil inlet air wet bulb [C] + Real64 ratedCoilInHumRat; // rated coil inlet air humidity ratio [kgWater/kgDryAir] + Real64 ratedCoilInEnth; // rated coil inlet air enthalpy [J/kg-C] + Real64 ratedCoilOutDb; // rated coil outlet air dry bulb [C] + Real64 ratedCoilOutWb; // rated coil outlet air wet bulb [C] + Real64 ratedCoilOutHumRat; // rated coil outlet air humidity ratio, [kgWater/kgDryAir] + Real64 ratedCoilOutEnth; // rated coil outlet air enthalpy [J/kg-C] + Real64 ratedCoilEff; // rated coil effectiveness + Real64 ratedCoilBpFactor; // rated coil bypass factor + Real64 ratedCoilAppDewPt; // rated coil apparatus dew point [C] + Real64 ratedCoilOadbRef; // rated DX coil outside air dry bulb reference [C] + Real64 ratedCoilOawbRef; // rated DX coil outside air wet bulb reference [C] + + std::string fanAssociatedWithCoilName; // name of fan found to be associated with this coil + std::string fanTypeName; // type of fan found to be associated with this coil + HVAC::FanType supFanType; // indicates which type of fan model for supply fan, legacy or new OO + int supFanNum = 0; // index pointing to this fan in legacy fan data structure, 1-based struct array + Real64 fanSizeMaxAirVolumeFlow; // the size of the fan in terms of volume flow rate [m3/s] + Real64 fanSizeMaxAirMassFlow; // the size of the fan in terms of mass flow rate [kg/s] + Real64 fanHeatGainIdealPeak; // Fan heat gain to air during Ideal loads peak sizing [W] + Real64 coilAndFanNetTotalCapacityIdealPeak; // coil net total capacity including fan heat gain for ideal loads peak sizing [W] + + // static plant info + Real64 plantDesMaxMassFlowRate; // this coil's plant loop overall design flow rate [kg/s] + Real64 plantDesRetTemp; // this coil's plant loop design return temperature + Real64 plantDesSupTemp; // this coil's plant loop design supply temperature + Real64 plantDesDeltaTemp; // this coil's plant loop design temperature difference (delta C) + Real64 plantDesCapacity; // this coil's plant loop capacity [W] + Real64 coilCapPrcntPlantCap; // this coil's capacity as a percentage of the overall loop's capacity + Real64 coilFlowPrcntPlantFlow; // this coil's design flow rate as a percentage the overall loop's design flow rate + // misc + Real64 coilUA; // U-value times Area, coil sizing result for UA [ ] + + }; // end class CoilSelectionData void finishCoilSummaryReportTable(EnergyPlusData &state); - + void setCoilFinalSizes(EnergyPlusData &state, int const coilReportNum, - Real64 const totGrossCap, // total capacity [W] - Real64 const sensGrossCap, // sensible capacity [W] - Real64 const airFlowRate, // design or reference or rated air flow rate [m3/s] - Real64 const waterFlowRate // design or reference or rated water flow rate [m3/s] + Real64 const totGrossCap, // total capacity [W] + Real64 const sensGrossCap, // sensible capacity [W] + Real64 const airFlowRate, // design or reference or rated air flow rate [m3/s] + Real64 const waterFlowRate // design or reference or rated water flow rate [m3/s] ); void setRatedCoilConditions(EnergyPlusData &state, @@ -252,25 +251,25 @@ public: // data void setCoilAirFlow(EnergyPlusData &state, int const coilReportNum, - Real64 const airVdot, // air flow rate in m3/s - bool const isAutoSized // true if air flow was autosized + Real64 const airVdot, // air flow rate in m3/s + bool const isAutoSized // true if air flow was autosized ); void setCoilWaterFlowNodeNums(EnergyPlusData &state, int const coilReportNum, - Real64 const waterVdot, // water flow rate in m3/s - bool const isAutoSized, // true if water flow was autosized - int const inletNodeNum, // coil chw inlet node num - int const outletNodeNum, // coil chw outlet node num - int const DataWaterLoopNum // plant loop structure index + Real64 const waterVdot, // water flow rate in m3/s + bool const isAutoSized, // true if water flow was autosized + int const inletNodeNum, // coil chw inlet node num + int const outletNodeNum, // coil chw outlet node num + int const DataWaterLoopNum // plant loop structure index ); void setCoilWaterFlowPltSizNum(EnergyPlusData &state, int const coilReportNum, - Real64 const waterVdot, // water flow rate in m3/s - bool const isAutoSized, // true if water flow was autosized - int const DataPltSizNum, // plant sizing structure index - int const DataWaterLoopNum // plant loop structure index + Real64 const waterVdot, // water flow rate in m3/s + bool const isAutoSized, // true if water flow was autosized + int const DataPltSizNum, // plant sizing structure index + int const DataWaterLoopNum // plant loop structure index ); void setCoilEntAirTemp(EnergyPlusData &state, @@ -280,18 +279,16 @@ public: // data int const curZoneEqNum // zone equipment list index, if non-zero ); - void setCoilEntAirHumRat(EnergyPlusData &state, - int const coilReportNum, - Real64 const entAirHumRat); + void setCoilEntAirHumRat(EnergyPlusData &state, int const coilReportNum, Real64 const entAirHumRat); void setCoilEntWaterTemp(EnergyPlusData &state, int const coilReportNum, - Real64 const entWaterTemp // degree C + Real64 const entWaterTemp // degree C ); void setCoilLvgWaterTemp(EnergyPlusData &state, int const coilReportNum, - Real64 const lvgWaterTemp // degree C + Real64 const lvgWaterTemp // degree C ); void setCoilWaterDeltaT(EnergyPlusData &state, @@ -306,7 +303,7 @@ public: // data void setCoilLvgAirHumRat(EnergyPlusData &state, int const coilReportNum, - Real64 const lvgAirHumRat // + Real64 const lvgAirHumRat // ); void setCoilCoolingCapacity(EnergyPlusData &state, @@ -370,22 +367,12 @@ public: // data int const curZoneEqNum // zone equipment list index, if non-zero ); - void setCoilReheatMultiplier(EnergyPlusData &state, - int const coilReportNum, - Real64 const multiplierReheatLoad); - - void setCoilSupplyFanInfo(EnergyPlusData &state, - int const coilReportNum, - std::string const &fanName, - HVAC::FanType fanType, - int fanIndex); - - void setCoilEqNum(EnergyPlusData &state, - int const coilReportNum, - int const curSysNum, - int const curOASysNum, - int const curZoneEqNum); - + void setCoilReheatMultiplier(EnergyPlusData &state, int const coilReportNum, Real64 const multiplierReheatLoad); + + void setCoilSupplyFanInfo(EnergyPlusData &state, int const coilReportNum, std::string const &fanName, HVAC::FanType fanType, int fanIndex); + + void setCoilEqNum(EnergyPlusData &state, int const coilReportNum, int const curSysNum, int const curOASysNum, int const curZoneEqNum); + std::string getTimeText(EnergyPlusData &state, int const timeStepAtPeak); bool isCompTypeFan(std::string const &compType // string component type, input object class name @@ -409,17 +396,17 @@ public: // data void writeCoilSelectionOutput2(EnergyPlusData &state); int getReportIndex(EnergyPlusData &state, - std::string const &coilName, // user-defined name of the coil - HVAC::CoilType const coilType // idf input object class name of coil + std::string const &coilName, // user-defined name of the coil + HVAC::CoilType const coilType // idf input object class name of coil ); void associateZoneCoilWithParent(EnergyPlusData &state, CoilSelectionData *c); } // namespace ReportCoilSelection - + struct ReportCoilSelectionData : BaseGlobalStruct { - std::vector coils; + std::vector coils; void init_constant_state([[maybe_unused]] EnergyPlusData &state) override { @@ -431,7 +418,9 @@ struct ReportCoilSelectionData : BaseGlobalStruct void clear_state() override { - for (int i = 0; i < (int)this->coils.size(); ++i) delete this->coils[i]; + for (int i = 0; i < (int)this->coils.size(); ++i) { + delete this->coils[i]; + } this->coils.clear(); } }; diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index f0ca47a0047..6b996c4a6ba 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -3130,7 +3130,8 @@ void SingleDuctAirTerminal::SizeSys(EnergyPlusData &state) TermUnitSizing(state.dataSize->CurTermUnitSizingNum).ReheatLoadMult = 1.0; } if (this->ReheatComp_Index > 0) { - ReportCoilSelection::setCoilReheatMultiplier(state, ReportCoilSelection::getReportIndex(state, this->ReheatName, this->reheatCoilType), + ReportCoilSelection::setCoilReheatMultiplier(state, + ReportCoilSelection::getReportIndex(state, this->ReheatName, this->reheatCoilType), TermUnitSizing(state.dataSize->CurTermUnitSizingNum).ReheatLoadMult); } } diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index bdfe3f6db32..5f6273e96a7 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -279,7 +279,7 @@ namespace SteamCoils { auto &steamCoil = state.dataSteamCoils->SteamCoil(CoilNum); steamCoil.Name = AlphArray(1); steamCoil.coilType = HVAC::CoilType::HeatingSteam; - steamCoil.coilReportNum = ReportCoilSelection::getReportIndex(state,steamCoil.Name, steamCoil.coilType); + steamCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, steamCoil.Name, steamCoil.coilType); if (lAlphaBlanks(2)) { steamCoil.availSched = Sched::GetScheduleAlwaysOn(state); @@ -702,7 +702,7 @@ namespace SteamCoils { if (steamCoil.DesiccantRegenerationCoil) { state.dataSize->DataDesicRegCoil = true; state.dataSize->DataDesicDehumNum = steamCoil.DesiccantDehumNum; - CompType = HVAC::coilTypeNames[(int)steamCoil.coilType]; + CompType = HVAC::coilTypeNames[(int)steamCoil.coilType]; CompName = steamCoil.Name; bPRINT = false; HeatingCoilDesAirInletTempSizer sizerHeatingDesInletTemp; @@ -900,10 +900,10 @@ namespace SteamCoils { steamCoil.SteamInletNodeNum, steamCoil.SteamOutletNodeNum, steamCoil.plantLoc.loopNum); - ReportCoilSelection::setCoilEntWaterTemp(state, steamCoil.coilReportNum, TempSteamIn); - ReportCoilSelection::setCoilLvgWaterTemp(state, steamCoil.coilReportNum, TempSteamIn - steamCoil.DegOfSubcooling); + ReportCoilSelection::setCoilEntWaterTemp(state, steamCoil.coilReportNum, TempSteamIn); + ReportCoilSelection::setCoilLvgWaterTemp(state, steamCoil.coilReportNum, TempSteamIn - steamCoil.DegOfSubcooling); ReportCoilSelection::setCoilWaterDeltaT(state, steamCoil.coilReportNum, steamCoil.DegOfSubcooling); - + steamCoil.DesCoilCapacity = DesCoilLoad; steamCoil.DesAirVolFlow = DesVolFlow; if (ErrorsFound) { @@ -911,21 +911,8 @@ namespace SteamCoils { } // There is no standard rating for heating coils at this point, so fill with dummy flag values - ReportCoilSelection::setRatedCoilConditions(state, - steamCoil.coilReportNum, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0, - -999.0); + ReportCoilSelection::setRatedCoilConditions( + state, steamCoil.coilReportNum, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0, -999.0); } // End Initialization Section of the Module diff --git a/src/EnergyPlus/SteamCoils.hh b/src/EnergyPlus/SteamCoils.hh index 5253f89589d..dc1166da14c 100644 --- a/src/EnergyPlus/SteamCoils.hh +++ b/src/EnergyPlus/SteamCoils.hh @@ -77,11 +77,11 @@ namespace SteamCoils { struct SteamCoilEquipConditions { // Members - std::string Name; // Name of the SteamCoil + std::string Name; // Name of the SteamCoil HVAC::CoilType coilType = HVAC::CoilType::Invalid; int coilReportNum = -1; - + Sched::Schedule *availSched = nullptr; // operating schedule Real64 InletAirMassFlowRate; // MassFlow through the SteamCoil being Simulated [kg/s] Real64 OutletAirMassFlowRate; // MassFlow throught the SteamCoil being Simulated[kg/s] @@ -137,16 +137,16 @@ namespace SteamCoils { // Default Constructor SteamCoilEquipConditions() - : InletAirMassFlowRate(0.0), OutletAirMassFlowRate(0.0), InletAirTemp(0.0), OutletAirTemp(0.0), - InletAirHumRat(0.0), OutletAirHumRat(0.0), InletAirEnthalpy(0.0), OutletAirEnthalpy(0.0), TotSteamCoilLoad(0.0), SenSteamCoilLoad(0.0), - TotSteamHeatingCoilEnergy(0.0), TotSteamCoolingCoilEnergy(0.0), SenSteamCoolingCoilEnergy(0.0), TotSteamHeatingCoilRate(0.0), - LoopLoss(0.0), TotSteamCoolingCoilRate(0.0), SenSteamCoolingCoilRate(0.0), LeavingRelHum(0.0), DesiredOutletTemp(0.0), - DesiredOutletHumRat(0.0), InletSteamTemp(0.0), OutletSteamTemp(0.0), InletSteamMassFlowRate(0.0), OutletSteamMassFlowRate(0.0), - MaxSteamVolFlowRate(0.0), MaxSteamMassFlowRate(0.0), InletSteamEnthalpy(0.0), OutletWaterEnthalpy(0.0), InletSteamPress(0.0), - InletSteamQuality(0.0), OutletSteamQuality(0.0), DegOfSubcooling(0.0), LoopSubcoolReturn(0.0), AirInletNodeNum(0), AirOutletNodeNum(0), - SteamInletNodeNum(0), SteamOutletNodeNum(0), TempSetPointNodeNum(0), plantLoc{}, CoilType(DataPlant::PlantEquipmentType::Invalid), - OperatingCapacity(0.0), DesiccantRegenerationCoil(false), DesiccantDehumNum(0), FaultyCoilSATFlag(false), FaultyCoilSATIndex(0), - FaultyCoilSATOffset(0.0), reportCoilFinalSizes(true), DesCoilCapacity(0.0), DesAirVolFlow(0.0) + : InletAirMassFlowRate(0.0), OutletAirMassFlowRate(0.0), InletAirTemp(0.0), OutletAirTemp(0.0), InletAirHumRat(0.0), OutletAirHumRat(0.0), + InletAirEnthalpy(0.0), OutletAirEnthalpy(0.0), TotSteamCoilLoad(0.0), SenSteamCoilLoad(0.0), TotSteamHeatingCoilEnergy(0.0), + TotSteamCoolingCoilEnergy(0.0), SenSteamCoolingCoilEnergy(0.0), TotSteamHeatingCoilRate(0.0), LoopLoss(0.0), + TotSteamCoolingCoilRate(0.0), SenSteamCoolingCoilRate(0.0), LeavingRelHum(0.0), DesiredOutletTemp(0.0), DesiredOutletHumRat(0.0), + InletSteamTemp(0.0), OutletSteamTemp(0.0), InletSteamMassFlowRate(0.0), OutletSteamMassFlowRate(0.0), MaxSteamVolFlowRate(0.0), + MaxSteamMassFlowRate(0.0), InletSteamEnthalpy(0.0), OutletWaterEnthalpy(0.0), InletSteamPress(0.0), InletSteamQuality(0.0), + OutletSteamQuality(0.0), DegOfSubcooling(0.0), LoopSubcoolReturn(0.0), AirInletNodeNum(0), AirOutletNodeNum(0), SteamInletNodeNum(0), + SteamOutletNodeNum(0), TempSetPointNodeNum(0), plantLoc{}, CoilType(DataPlant::PlantEquipmentType::Invalid), OperatingCapacity(0.0), + DesiccantRegenerationCoil(false), DesiccantDehumNum(0), FaultyCoilSATFlag(false), FaultyCoilSATIndex(0), FaultyCoilSATOffset(0.0), + reportCoilFinalSizes(true), DesCoilCapacity(0.0), DesAirVolFlow(0.0) { } }; diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index 9c6eb189e9d..978c00b492d 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -563,8 +563,11 @@ namespace UnitHeater { OutputProcessor::StoreType::Average, unitHeat.Name); } - ReportCoilSelection::setCoilSupplyFanInfo(state, ReportCoilSelection::getReportIndex(state, unitHeat.HCoilName, unitHeat.heatCoilType), - unitHeat.FanName, unitHeat.fanType, unitHeat.Fan_Index); + ReportCoilSelection::setCoilSupplyFanInfo(state, + ReportCoilSelection::getReportIndex(state, unitHeat.HCoilName, unitHeat.heatCoilType), + unitHeat.FanName, + unitHeat.fanType, + unitHeat.Fan_Index); } } diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index d0284120d60..11690752286 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -976,12 +976,18 @@ namespace UnitVentilator { } if (unitVent.HCoilPresent) { - ReportCoilSelection::setCoilSupplyFanInfo( - state, ReportCoilSelection::getReportIndex(state, unitVent.HCoilName, unitVent.heatCoilType), unitVent.FanName, unitVent.fanType, unitVent.Fan_Index); + ReportCoilSelection::setCoilSupplyFanInfo(state, + ReportCoilSelection::getReportIndex(state, unitVent.HCoilName, unitVent.heatCoilType), + unitVent.FanName, + unitVent.fanType, + unitVent.Fan_Index); } if (unitVent.CCoilPresent) { - ReportCoilSelection::setCoilSupplyFanInfo( - state, ReportCoilSelection::getReportIndex(state, unitVent.CCoilName, unitVent.coolCoilType), unitVent.FanName, unitVent.fanType, unitVent.Fan_Index); + ReportCoilSelection::setCoilSupplyFanInfo(state, + ReportCoilSelection::getReportIndex(state, unitVent.CCoilName, unitVent.coolCoilType), + unitVent.FanName, + unitVent.fanType, + unitVent.Fan_Index); } } } diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 4a499c54563..02760d25774 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -430,25 +430,28 @@ namespace UnitarySystems { auto &primaryAirSystems = state.dataAirSystemsData->PrimaryAirSystems(AirLoopNum); if (this->m_CoolCoilExists) { - ReportCoilSelection::setCoilSupplyFanInfo(state, - ReportCoilSelection::getReportIndex(state, this->m_CoolingCoilName, this->m_coolCoilType), - state.dataFans->fans(primaryAirSystems.supFanNum)->Name, - state.dataFans->fans(primaryAirSystems.supFanNum)->type, - primaryAirSystems.supFanNum); + ReportCoilSelection::setCoilSupplyFanInfo( + state, + ReportCoilSelection::getReportIndex(state, this->m_CoolingCoilName, this->m_coolCoilType), + state.dataFans->fans(primaryAirSystems.supFanNum)->Name, + state.dataFans->fans(primaryAirSystems.supFanNum)->type, + primaryAirSystems.supFanNum); } if (this->m_HeatCoilExists) { - ReportCoilSelection::setCoilSupplyFanInfo(state, - ReportCoilSelection::getReportIndex(state, this->m_HeatingCoilName, this->m_heatCoilType), - state.dataFans->fans(primaryAirSystems.supFanNum)->Name, - state.dataFans->fans(primaryAirSystems.supFanNum)->type, - primaryAirSystems.supFanNum); + ReportCoilSelection::setCoilSupplyFanInfo( + state, + ReportCoilSelection::getReportIndex(state, this->m_HeatingCoilName, this->m_heatCoilType), + state.dataFans->fans(primaryAirSystems.supFanNum)->Name, + state.dataFans->fans(primaryAirSystems.supFanNum)->type, + primaryAirSystems.supFanNum); } if (this->m_SuppCoilExists) { - ReportCoilSelection::setCoilSupplyFanInfo(state, - ReportCoilSelection::getReportIndex(state, this->m_SuppHeatCoilName, this->m_suppHeatCoilType), - state.dataFans->fans(primaryAirSystems.supFanNum)->Name, - state.dataFans->fans(primaryAirSystems.supFanNum)->type, - primaryAirSystems.supFanNum); + ReportCoilSelection::setCoilSupplyFanInfo( + state, + ReportCoilSelection::getReportIndex(state, this->m_SuppHeatCoilName, this->m_suppHeatCoilType), + state.dataFans->fans(primaryAirSystems.supFanNum)->Name, + state.dataFans->fans(primaryAirSystems.supFanNum)->type, + primaryAirSystems.supFanNum); } } } @@ -4817,11 +4820,12 @@ namespace UnitarySystems { thisCoolCoil.SupplyFanIndex = this->m_FanIndex; thisCoolCoil.supplyFanType = this->m_FanType; if (this->m_FanType != HVAC::FanType::Invalid) { - ReportCoilSelection::setCoilSupplyFanInfo(state, - ReportCoilSelection::getReportIndex(state, thisCoolCoil.Name, thisCoolCoil.coilType), - state.dataFans->fans(thisCoolCoil.SupplyFanIndex)->Name, - this->m_FanType, - thisCoolCoil.SupplyFanIndex); + ReportCoilSelection::setCoilSupplyFanInfo( + state, + ReportCoilSelection::getReportIndex(state, thisCoolCoil.Name, thisCoolCoil.coilType), + state.dataFans->fans(thisCoolCoil.SupplyFanIndex)->Name, + this->m_FanType, + thisCoolCoil.SupplyFanIndex); } } if (this->m_HeatCoilExists) { @@ -5769,8 +5773,11 @@ namespace UnitarySystems { // set fan info for supplemental heating coils if (this->m_SuppCoilExists && this->m_FanExists) { - ReportCoilSelection::setCoilSupplyFanInfo( - state, ReportCoilSelection::getReportIndex(state, this->m_SuppHeatCoilName, this->m_suppHeatCoilType), this->m_FanName, this->m_FanType, this->m_FanIndex); + ReportCoilSelection::setCoilSupplyFanInfo(state, + ReportCoilSelection::getReportIndex(state, this->m_SuppHeatCoilName, this->m_suppHeatCoilType), + this->m_FanName, + this->m_FanType, + this->m_FanIndex); } // Users may not provide SA flow input fields (below) and leave them blank. Check if other coil is AutoSized first to @@ -6392,8 +6399,11 @@ namespace UnitarySystems { } } // set fan info for cooling coils - ReportCoilSelection::setCoilSupplyFanInfo( - state, ReportCoilSelection::getReportIndex(state, this->m_CoolingCoilName, this->m_coolCoilType), this->m_FanName, this->m_FanType, this->m_FanIndex); + ReportCoilSelection::setCoilSupplyFanInfo(state, + ReportCoilSelection::getReportIndex(state, this->m_CoolingCoilName, this->m_coolCoilType), + this->m_FanName, + this->m_FanType, + this->m_FanIndex); } if (this->m_HeatCoilExists) { if (loc_m_HeatingSAFMethod.empty()) { @@ -6414,8 +6424,11 @@ namespace UnitarySystems { } } // set fan info for heating coils - ReportCoilSelection::setCoilSupplyFanInfo( - state, ReportCoilSelection::getReportIndex(state, this->m_HeatingCoilName, this->m_heatCoilType), this->m_FanName, this->m_FanType, this->m_FanIndex); + ReportCoilSelection::setCoilSupplyFanInfo(state, + ReportCoilSelection::getReportIndex(state, this->m_HeatingCoilName, this->m_heatCoilType), + this->m_FanName, + this->m_FanType, + this->m_FanIndex); } } diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index 7b8f79e5992..862e9eff0e6 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -727,7 +727,7 @@ namespace VariableSpeedCoils { varSpeedCoil.coilType = HVAC::CoilType::CoolingDXVariableSpeed; varSpeedCoil.VarSpeedCoilType = HVAC::coilTypeNames[(int)varSpeedCoil.coilType]; varSpeedCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, varSpeedCoil.Name, varSpeedCoil.coilType); - + std::string const availSchedName = s_ip->getAlphaFieldValue(fields, schemaProps, "availability_schedule_name"); if (availSchedName.empty()) { varSpeedCoil.availSched = Sched::GetScheduleAlwaysOn(state); @@ -2049,7 +2049,7 @@ namespace VariableSpeedCoils { varSpeedCoil.VarSpeedCoilType = HVAC::coilTypeNames[(int)HVAC::CoilType::WaterHeatingAWHPVariableSpeed]; varSpeedCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, varSpeedCoil.Name, varSpeedCoil.coilType); - + ErrorObjectHeader eoh{routineName, CurrentModuleObject, varSpeedCoil.Name}; // ErrorsFound will be set to True if problem was found, left untouched otherwise @@ -3679,11 +3679,8 @@ namespace VariableSpeedCoils { // store fan info for coil if (varSpeedCoil.SupplyFanIndex > 0) { - ReportCoilSelection::setCoilSupplyFanInfo(state, - varSpeedCoil.coilReportNum, - varSpeedCoil.SupplyFanName, - varSpeedCoil.supplyFanType, - varSpeedCoil.SupplyFanIndex); + ReportCoilSelection::setCoilSupplyFanInfo( + state, varSpeedCoil.coilReportNum, varSpeedCoil.SupplyFanName, varSpeedCoil.supplyFanType, varSpeedCoil.SupplyFanIndex); } } @@ -4348,7 +4345,8 @@ namespace VariableSpeedCoils { } } - ReportCoilSelection::setCoilEntAirTemp(state, varSpeedCoil.coilReportNum, MixTemp, state.dataSize->CurSysNum, state.dataSize->CurZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp( + state, varSpeedCoil.coilReportNum, MixTemp, state.dataSize->CurSysNum, state.dataSize->CurZoneEqNum); ReportCoilSelection::setCoilEntAirHumRat(state, varSpeedCoil.coilReportNum, MixHumRat); ReportCoilSelection::setCoilLvgAirTemp(state, varSpeedCoil.coilReportNum, SupTemp); ReportCoilSelection::setCoilLvgAirHumRat(state, varSpeedCoil.coilReportNum, SupHumRat); @@ -4516,8 +4514,7 @@ namespace VariableSpeedCoils { } } } - ReportCoilSelection::setCoilAirFlow( - state, varSpeedCoil.coilReportNum, RatedAirVolFlowRateDes, RatedAirFlowAutoSized); + ReportCoilSelection::setCoilAirFlow(state, varSpeedCoil.coilReportNum, RatedAirVolFlowRateDes, RatedAirFlowAutoSized); } // Check that heat pump heating capacity is within 20% of cooling capacity. Check only for heating coil and report both. @@ -4714,15 +4711,13 @@ namespace VariableSpeedCoils { state.dataSize->PlantSizData(PltSizNum).DeltaT); // TRACE 3D Plus coil selection report } - ReportCoilSelection::setCoilEntWaterTemp( - state, - varSpeedCoil.coilReportNum, - state.dataSize->PlantSizData(PltSizNum).ExitTemp); // TRACE 3D Plus coil selection report + ReportCoilSelection::setCoilEntWaterTemp(state, + varSpeedCoil.coilReportNum, + state.dataSize->PlantSizData(PltSizNum).ExitTemp); // TRACE 3D Plus coil selection report - ReportCoilSelection::setCoilWaterDeltaT( - state, - varSpeedCoil.coilReportNum, - state.dataSize->PlantSizData(PltSizNum).DeltaT); // TRACE 3D Plus coil selection report + ReportCoilSelection::setCoilWaterDeltaT(state, + varSpeedCoil.coilReportNum, + state.dataSize->PlantSizData(PltSizNum).DeltaT); // TRACE 3D Plus coil selection report } else { ShowSevereError(state, "Autosizing of water flow requires a loop Sizing:Plant object"); ShowContinueError(state, "Autosizing also requires physical connection to a plant or condenser loop."); diff --git a/src/EnergyPlus/VariableSpeedCoils.hh b/src/EnergyPlus/VariableSpeedCoils.hh index eef247e246f..a47bb54b93e 100644 --- a/src/EnergyPlus/VariableSpeedCoils.hh +++ b/src/EnergyPlus/VariableSpeedCoils.hh @@ -77,15 +77,15 @@ namespace VariableSpeedCoils { std::string VarSpeedCoilType; // type of coil int coilReportNum = -1; - int NumOfSpeeds; // Number of speeds - int NormSpedLevel; // Nominal speed level - Real64 RatedWaterVolFlowRate; // Rated/Ref Water Volumetric Flow Rate [m3/s] - Real64 RatedWaterMassFlowRate; // Rated/Ref Water Volumetric Flow Rate [m3/s] - Real64 RatedAirVolFlowRate; // Rated/Ref Air Volumetric Flow Rate [m3/s] - Real64 RatedCapHeat; // Rated/Ref Heating Capacity [W] - Real64 RatedCapCoolTotal; // Rated/Ref Total Cooling Capacity [W] - Real64 MaxONOFFCyclesperHour; // Maximum ON/OFF cycles per hour for the compressor (cycles/hour) - Real64 Twet_Rated; // Nominal time for condensate to begin leaving the coil's + int NumOfSpeeds; // Number of speeds + int NormSpedLevel; // Nominal speed level + Real64 RatedWaterVolFlowRate; // Rated/Ref Water Volumetric Flow Rate [m3/s] + Real64 RatedWaterMassFlowRate; // Rated/Ref Water Volumetric Flow Rate [m3/s] + Real64 RatedAirVolFlowRate; // Rated/Ref Air Volumetric Flow Rate [m3/s] + Real64 RatedCapHeat; // Rated/Ref Heating Capacity [W] + Real64 RatedCapCoolTotal; // Rated/Ref Total Cooling Capacity [W] + Real64 MaxONOFFCyclesperHour; // Maximum ON/OFF cycles per hour for the compressor (cycles/hour) + Real64 Twet_Rated; // Nominal time for condensate to begin leaving the coil's // condensate drain line (sec) Real64 Gamma_Rated; // Initial moisture evaporation rate divided by steady-state // AC latent capacity (dimensionless) diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index dab47f455f0..caa4656c995 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -737,7 +737,7 @@ void GetWaterCoilInput(EnergyPlusData &state) waterCoil.Name = AlphArray(1); waterCoil.coilType = HVAC::CoilType::CoolingWater; waterCoil.coilReportNum = ReportCoilSelection::getReportIndex(state, waterCoil.Name, waterCoil.coilType); - + if (lAlphaBlanks(2)) { waterCoil.availSched = Sched::GetScheduleAlwaysOn(state); } else if ((waterCoil.availSched = Sched::GetSchedule(state, AlphArray(2))) == nullptr) { @@ -1629,16 +1629,14 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA "Water Heating Coil Capacity Information,Coil:Heating:Water", waterCoil.Name, waterCoil.TotWaterHeatingCoilRate); - ReportCoilSelection::setCoilAirFlow( - state, waterCoil.coilReportNum, waterCoil.DesAirVolFlowRate, waterCoil.RequestingAutoSize); - ReportCoilSelection::setCoilWaterHeaterCapacityNodeNums( - state, - waterCoil.coilReportNum, - waterCoil.DesWaterHeatingCoilRate, - waterCoil.RequestingAutoSize, - waterCoil.WaterInletNodeNum, - waterCoil.WaterOutletNodeNum, - waterCoil.WaterPlantLoc.loopNum); // coil report + ReportCoilSelection::setCoilAirFlow(state, waterCoil.coilReportNum, waterCoil.DesAirVolFlowRate, waterCoil.RequestingAutoSize); + ReportCoilSelection::setCoilWaterHeaterCapacityNodeNums(state, + waterCoil.coilReportNum, + waterCoil.DesWaterHeatingCoilRate, + waterCoil.RequestingAutoSize, + waterCoil.WaterInletNodeNum, + waterCoil.WaterOutletNodeNum, + waterCoil.WaterPlantLoc.loopNum); // coil report break; } case DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling: { @@ -1795,39 +1793,37 @@ void InitWaterCoil(EnergyPlusData &state, int const CoilNum, bool const FirstHVA // call set routine in coil report if (waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling || waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterCooling) { - ReportCoilSelection::setRatedCoilConditions( - state, - waterCoil.coilReportNum, - waterCoil.TotWaterCoolingCoilRate, // this is the report variable - waterCoil.SenWaterCoolingCoilRate, // this is the report variable - waterCoil.InletAirMassFlowRate, - waterCoil.InletAirTemp, - waterCoil.InletAirHumRat, - DesInletWetBulb, - waterCoil.OutletAirTemp, - waterCoil.OutletAirHumRat, - RatedOutletWetBulb, - -999.0, - -999.0, - -999.0, - -999.0); // coil effectiveness + ReportCoilSelection::setRatedCoilConditions(state, + waterCoil.coilReportNum, + waterCoil.TotWaterCoolingCoilRate, // this is the report variable + waterCoil.SenWaterCoolingCoilRate, // this is the report variable + waterCoil.InletAirMassFlowRate, + waterCoil.InletAirTemp, + waterCoil.InletAirHumRat, + DesInletWetBulb, + waterCoil.OutletAirTemp, + waterCoil.OutletAirHumRat, + RatedOutletWetBulb, + -999.0, + -999.0, + -999.0, + -999.0); // coil effectiveness } else if (waterCoil.WaterCoilType == DataPlant::PlantEquipmentType::CoilWaterSimpleHeating) { - ReportCoilSelection::setRatedCoilConditions( - state, - waterCoil.coilReportNum, - waterCoil.TotWaterHeatingCoilRate, // this is the report variable - waterCoil.TotWaterHeatingCoilRate, // this is the report variable - waterCoil.InletAirMassFlowRate, - waterCoil.InletAirTemp, - waterCoil.InletAirHumRat, - DesInletWetBulb, - waterCoil.OutletAirTemp, - waterCoil.OutletAirHumRat, - RatedOutletWetBulb, - -999.0, - -999.0, - -999.0, - -999.0); // coil effectiveness + ReportCoilSelection::setRatedCoilConditions(state, + waterCoil.coilReportNum, + waterCoil.TotWaterHeatingCoilRate, // this is the report variable + waterCoil.TotWaterHeatingCoilRate, // this is the report variable + waterCoil.InletAirMassFlowRate, + waterCoil.InletAirTemp, + waterCoil.InletAirHumRat, + DesInletWetBulb, + waterCoil.OutletAirTemp, + waterCoil.OutletAirHumRat, + RatedOutletWetBulb, + -999.0, + -999.0, + -999.0, + -999.0); // coil effectiveness } // now replace the outdoor air conditions set above for one time rating point calc state.dataEnvrn->OutBaroPress = holdOutBaroPress; diff --git a/src/EnergyPlus/WaterCoils.hh b/src/EnergyPlus/WaterCoils.hh index d9990d5c4f3..c911cf0649e 100644 --- a/src/EnergyPlus/WaterCoils.hh +++ b/src/EnergyPlus/WaterCoils.hh @@ -90,31 +90,31 @@ namespace WaterCoils { std::string WaterCoilModelA; // Type of WaterCoil ie. Simple, Detailed, etc. DataPlant::PlantEquipmentType WaterCoilType; // Type of WaterCoil ie. Heating or Cooling - HVAC::CoilType coilType = HVAC::CoilType::Invalid; + HVAC::CoilType coilType = HVAC::CoilType::Invalid; int coilReportNum = -1; - CoilModel WaterCoilModel; // Type of WaterCoil ie. Simple, Detailed, etc. - Sched::Schedule *availSched = nullptr; // availability schedule - bool RequestingAutoSize; // True if this coil has appropriate autosize fields - Real64 InletAirMassFlowRate; // MassFlow through the WaterCoil being Simulated [kg/s] - Real64 OutletAirMassFlowRate; // MassFlow through the WaterCoil being Simulated[kg/s] - Real64 InletAirTemp; // Inlet Air Temperature Operating Condition [C] - Real64 OutletAirTemp; // Outlet Air Temperature Operating Condition [C] - Real64 InletAirHumRat; // Inlet Air Humidity Ratio Operating Condition - Real64 OutletAirHumRat; // Outlet Air Humidity Ratio Calculated Condition - Real64 InletAirEnthalpy; // Inlet Air enthalpy [J/kg] - Real64 OutletAirEnthalpy; // Outlet Air enthalpy [J/kg] - Real64 TotWaterCoilLoad; // Total Load on the Coil [W] - Real64 SenWaterCoilLoad; // Sensible Load on the Coil [W] - Real64 TotWaterHeatingCoilEnergy; // Total Heating Coil energy of the Coil [J] - Real64 TotWaterCoolingCoilEnergy; // Total Cooling Coil energy of the Coil [J] - Real64 SenWaterCoolingCoilEnergy; // Sensible Cooling Coil energy of the Coil [J] - Real64 DesWaterHeatingCoilRate; // Design Heating Coil Rate used for sizing [W] - Real64 TotWaterHeatingCoilRate; // Total Heating Coil Rate on the Coil [W] - Real64 DesWaterCoolingCoilRate; // Design Cooling Coil Rate used for sizing [W] - Real64 TotWaterCoolingCoilRate; // Total Cooling Coil Rate on the Coil [W] - Real64 SenWaterCoolingCoilRate; // Sensible Cooling Coil Rate on the Coil [W] - Real64 UACoil; // WaterCoil UA Value - Real64 LeavingRelHum; // Simple Coil Latent Model requires User input for leaving RH + CoilModel WaterCoilModel; // Type of WaterCoil ie. Simple, Detailed, etc. + Sched::Schedule *availSched = nullptr; // availability schedule + bool RequestingAutoSize; // True if this coil has appropriate autosize fields + Real64 InletAirMassFlowRate; // MassFlow through the WaterCoil being Simulated [kg/s] + Real64 OutletAirMassFlowRate; // MassFlow through the WaterCoil being Simulated[kg/s] + Real64 InletAirTemp; // Inlet Air Temperature Operating Condition [C] + Real64 OutletAirTemp; // Outlet Air Temperature Operating Condition [C] + Real64 InletAirHumRat; // Inlet Air Humidity Ratio Operating Condition + Real64 OutletAirHumRat; // Outlet Air Humidity Ratio Calculated Condition + Real64 InletAirEnthalpy; // Inlet Air enthalpy [J/kg] + Real64 OutletAirEnthalpy; // Outlet Air enthalpy [J/kg] + Real64 TotWaterCoilLoad; // Total Load on the Coil [W] + Real64 SenWaterCoilLoad; // Sensible Load on the Coil [W] + Real64 TotWaterHeatingCoilEnergy; // Total Heating Coil energy of the Coil [J] + Real64 TotWaterCoolingCoilEnergy; // Total Cooling Coil energy of the Coil [J] + Real64 SenWaterCoolingCoilEnergy; // Sensible Cooling Coil energy of the Coil [J] + Real64 DesWaterHeatingCoilRate; // Design Heating Coil Rate used for sizing [W] + Real64 TotWaterHeatingCoilRate; // Total Heating Coil Rate on the Coil [W] + Real64 DesWaterCoolingCoilRate; // Design Cooling Coil Rate used for sizing [W] + Real64 TotWaterCoolingCoilRate; // Total Cooling Coil Rate on the Coil [W] + Real64 SenWaterCoolingCoilRate; // Sensible Cooling Coil Rate on the Coil [W] + Real64 UACoil; // WaterCoil UA Value + Real64 LeavingRelHum; // Simple Coil Latent Model requires User input for leaving RH Real64 DesiredOutletTemp; Real64 DesiredOutletHumRat; Real64 InletWaterTemp; // Inlet Water Temperature [C] diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index e8666947fec..6d3de5a393b 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -2709,18 +2709,17 @@ namespace WaterToAirHeatPumpSimple { } } - ReportCoilSelection::setCoilHeatingCapacity( - state, - simpleWAHP.coilReportNum, - RatedCapHeatDes, - IsAutoSize, - state.dataSize->CurSysNum, - state.dataSize->CurZoneEqNum, - state.dataSize->CurOASysNum, - FanCoolLoad, - 1.0, // RatedHeatCapTempModFac, - -999.0, - -999.0); + ReportCoilSelection::setCoilHeatingCapacity(state, + simpleWAHP.coilReportNum, + RatedCapHeatDes, + IsAutoSize, + state.dataSize->CurSysNum, + state.dataSize->CurZoneEqNum, + state.dataSize->CurOASysNum, + FanCoolLoad, + 1.0, // RatedHeatCapTempModFac, + -999.0, + -999.0); } // Heating @@ -3531,21 +3530,19 @@ namespace WaterToAirHeatPumpSimple { if (!state.dataGlobal->WarmupFlag && !state.dataGlobal->DoingHVACSizingSimulations && !state.dataGlobal->DoingSizing) { if (simpleWAHP.WAHPType == WatertoAirHP::Cooling) { - ReportCoilSelection::setCoilFinalSizes( - state, - simpleWAHP.coilReportNum, - simpleWAHP.RatedCapCoolTotal, - simpleWAHP.RatedCapCoolSens, - simpleWAHP.RatedAirVolFlowRate, - simpleWAHP.RatedWaterVolFlowRate); + ReportCoilSelection::setCoilFinalSizes(state, + simpleWAHP.coilReportNum, + simpleWAHP.RatedCapCoolTotal, + simpleWAHP.RatedCapCoolSens, + simpleWAHP.RatedAirVolFlowRate, + simpleWAHP.RatedWaterVolFlowRate); } else if (simpleWAHP.WAHPType == WatertoAirHP::Heating) { - ReportCoilSelection::setCoilFinalSizes( - state, - simpleWAHP.coilReportNum, - simpleWAHP.RatedCapHeat, - simpleWAHP.RatedCapHeat, - simpleWAHP.RatedAirVolFlowRate, - simpleWAHP.RatedWaterVolFlowRate); + ReportCoilSelection::setCoilFinalSizes(state, + simpleWAHP.coilReportNum, + simpleWAHP.RatedCapHeat, + simpleWAHP.RatedCapHeat, + simpleWAHP.RatedAirVolFlowRate, + simpleWAHP.RatedWaterVolFlowRate); } simpleWAHP.reportCoilFinalSizes = false; } diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh index d91e1e9659c..7158e9caa6c 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh @@ -80,11 +80,11 @@ namespace WaterToAirHeatPumpSimple { struct SimpleWatertoAirHPConditions { // Members - std::string Name; // Name of the Water to Air Heat pump + std::string Name; // Name of the Water to Air Heat pump HVAC::CoilType coilType = HVAC::CoilType::Invalid; int coilReportNum = -1; - + Sched::Schedule *availSched = nullptr; // availability schedule WatertoAirHP WAHPType = WatertoAirHP::Invalid; // Type of WatertoAirHP ie. Heating or Cooling DataPlant::PlantEquipmentType WAHPPlantType = DataPlant::PlantEquipmentType::Invalid; // type of component in plant @@ -137,17 +137,17 @@ namespace WaterToAirHeatPumpSimple { Real64 RatedEntAirDrybulbTemp = 0.0; // Rated Entering Air Drybulb Temperature [C] Real64 RatioRatedHeatRatedTotCoolCap = 0.0; // Ratio of Rated Heating Capacity to Rated Cooling Capacity [-] - Curve::Curve *HeatCapCurve = nullptr; // Index of the heating capacity performance curve - Curve::Curve *HeatPowCurve = nullptr; // Index of the heating power consumption curve - Curve::Curve *TotalCoolCapCurve = nullptr; // Index of the Total Cooling capacity performance curve - Curve::Curve *SensCoolCapCurve = nullptr; // Index of the Sensible Cooling capacity performance curve - Curve::Curve *CoolPowCurve = nullptr; // Index of the Cooling power consumption curve - Curve::Curve *PLFCurve = nullptr; // Index of the Part Load Factor curve - - int AirInletNodeNum = 0; // Node Number of the Air Inlet - int AirOutletNodeNum = 0; // Node Number of the Air Outlet - int WaterInletNodeNum = 0; // Node Number of the Water Onlet - int WaterOutletNodeNum = 0; // Node Number of the Water Outlet + Curve::Curve *HeatCapCurve = nullptr; // Index of the heating capacity performance curve + Curve::Curve *HeatPowCurve = nullptr; // Index of the heating power consumption curve + Curve::Curve *TotalCoolCapCurve = nullptr; // Index of the Total Cooling capacity performance curve + Curve::Curve *SensCoolCapCurve = nullptr; // Index of the Sensible Cooling capacity performance curve + Curve::Curve *CoolPowCurve = nullptr; // Index of the Cooling power consumption curve + Curve::Curve *PLFCurve = nullptr; // Index of the Part Load Factor curve + + int AirInletNodeNum = 0; // Node Number of the Air Inlet + int AirOutletNodeNum = 0; // Node Number of the Air Outlet + int WaterInletNodeNum = 0; // Node Number of the Water Onlet + int WaterOutletNodeNum = 0; // Node Number of the Water Outlet PlantLocation plantLoc; HVAC::WaterFlow WaterCyclingMode = HVAC::WaterFlow::Invalid; // Heat Pump Coil water flow mode; See definitions in DataHVACGlobals, diff --git a/tst/EnergyPlus/unit/HVACDXHeatPumpSystem.unit.cc b/tst/EnergyPlus/unit/HVACDXHeatPumpSystem.unit.cc index a112c0c49cd..5a78dabbb7b 100644 --- a/tst/EnergyPlus/unit/HVACDXHeatPumpSystem.unit.cc +++ b/tst/EnergyPlus/unit/HVACDXHeatPumpSystem.unit.cc @@ -115,8 +115,8 @@ TEST_F(EnergyPlusFixture, ExerciseHVACDXHeatPumpSystem) state->dataDXCoils->DXCoil(1).AirInNode = 1; state->dataDXCoils->DXCoil(1).AirOutNode = 2; state->dataDXCoils->DXCoil(1).coilType = HVAC::CoilType::HeatingDXSingleSpeed; - state->dataDXCoils->DXCoil(1).coilReportNum = ReportCoilSelection::getReportIndex(*state, state->dataDXCoils->DXCoil(1).Name, - state->dataDXCoils->DXCoil(1).coilType); + state->dataDXCoils->DXCoil(1).coilReportNum = + ReportCoilSelection::getReportIndex(*state, state->dataDXCoils->DXCoil(1).Name, state->dataDXCoils->DXCoil(1).coilType); state->dataDXCoils->DXCoil(1).RatedTotCap(1) = 1; state->dataDXCoils->DXCoil(1).RatedCOP(1) = 1; state->dataDXCoils->DXCoil(1).CCapFFlow(1) = 1; diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 163c119edc1..4b9a2fff0e7 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -484,7 +484,7 @@ class AirLoopFixture : public EnergyPlusFixture dxCoil1.AirOutNode = coolCoilAirOutNode; dxCoil1.coilType = HVAC::CoilType::CoolingVRF; dxCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, dxCoil1.Name, dxCoil1.coilType); - + dxCoil1.RatedAirVolFlowRate = DataSizing::AutoSize; dxCoil1.RatedTotCap = DataSizing::AutoSize; dxCoil1.RatedSHR = DataSizing::AutoSize; @@ -8256,9 +8256,8 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilElectric) state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).MassFlowRate = 1.0; state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).Temp = 15.0; state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).HumRat = 0.0070; - state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).Enthalpy = - Psychrometrics::PsyHFnTdbW(state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).Temp, - state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).HumRat); + state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW( + state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).Temp, state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).HumRat); bool FirstHVACIteration(false); Real64 SuppHeatCoilLoad = 10000.0; @@ -8322,9 +8321,8 @@ TEST_F(EnergyPlusFixture, VRFTU_CalcVRFSupplementalHeatingCoilFuel) state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).MassFlowRate = 1.0; state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).Temp = 15.0; state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).HumRat = 0.0070; - state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).Enthalpy = - Psychrometrics::PsyHFnTdbW(state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).Temp, - state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).HumRat); + state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW( + state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).Temp, state->dataLoopNodes->Node(heatingCoil.AirInletNodeNum).HumRat); bool FirstHVACIteration(false); Real64 SuppHeatCoilLoad = 10000.0; diff --git a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc index b09dc736a43..7bfd1e226ef 100644 --- a/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc +++ b/tst/EnergyPlus/unit/PackagedTerminalHeatPump.unit.cc @@ -855,8 +855,8 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctMixer_SimPTAC_HeatingCoilTest) //// get input test for terminal air single duct mixer on inlet side of PTAC ASSERT_EQ(1, state->dataUnitarySystems->numUnitarySystems); - EXPECT_EQ("ZoneHVAC:PackagedTerminalAirConditioner", thisSys.UnitType); // zoneHVAC equipment type - EXPECT_EQ("COIL:HEATING:FUEL", thisSys.m_HeatingCoilTypeName); // PTAC heating coil type + EXPECT_EQ("ZoneHVAC:PackagedTerminalAirConditioner", thisSys.UnitType); // zoneHVAC equipment type + EXPECT_EQ("COIL:HEATING:FUEL", thisSys.m_HeatingCoilTypeName); // PTAC heating coil type EXPECT_EQ(state->dataHeatingCoils->HeatingCoil(1).coilType, HVAC::CoilType::HeatingGasOrOtherFuel); // gas heating coil type state->dataGlobal->BeginEnvrnFlag = false; diff --git a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc index c0128590eee..e638873703b 100644 --- a/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc +++ b/tst/EnergyPlus/unit/ReportCoilSelection.unit.cc @@ -70,7 +70,7 @@ using namespace EnergyPlus; TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) { - std::string coil1Name("Coil 1"); // user-defined name of the coil + std::string coil1Name("Coil 1"); // user-defined name of the coil HVAC::CoilType coil1Type = HVAC::CoilType::CoolingWater; // idf input object class name of coil int chWInletNodeNum = 9; int chWOutletNodeNum = 15; @@ -110,8 +110,13 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) Real64 waterVdot = 0.05; // First with no plant sizing objects defined isAutoSized = false; // true if autosized - ReportCoilSelection::setCoilWaterFlowNodeNums( - *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), waterVdot, isAutoSized, chWInletNodeNum, chWOutletNodeNum, loopNum); + ReportCoilSelection::setCoilWaterFlowNodeNums(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + waterVdot, + isAutoSized, + chWInletNodeNum, + chWOutletNodeNum, + loopNum); EXPECT_EQ(-999, c1->pltSizNum); EXPECT_EQ(loopNum, c1->waterLoopNum); EXPECT_EQ(state->dataPlnt->PlantLoop(1).Name, c1->plantLoopName); @@ -124,7 +129,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) ReportCoilSelection::finishCoilSummaryReportTable(*state); // Use the other form for coil 2 - std::string coil2Name("Coil 2"); // user-defined name of the coil + std::string coil2Name("Coil 2"); // user-defined name of the coil HVAC::CoilType coil2Type = HVAC::CoilType::CoolingWater; // idf input object class name of coil int pltSizNum = -999; ReportCoilSelection::setCoilWaterFlowPltSizNum( @@ -143,8 +148,13 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) state->dataSize->PlantSizData.allocate(1); state->dataSize->PlantSizData(1).PlantLoopName = "Chilled Water Loop"; isAutoSized = true; // true if autosized - ReportCoilSelection::setCoilWaterFlowNodeNums( - *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), waterVdot, isAutoSized, chWInletNodeNum, chWOutletNodeNum, loopNum); + ReportCoilSelection::setCoilWaterFlowNodeNums(*state, + ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), + waterVdot, + isAutoSized, + chWInletNodeNum, + chWOutletNodeNum, + loopNum); auto &c1b(state->dataRptCoilSelection->coils[0]); EXPECT_EQ(1, c1b->pltSizNum); EXPECT_EQ(loopNum, c1b->waterLoopNum); @@ -173,7 +183,8 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) state->dataHeatBal->Zone(3).Name = "Zone 3"; // This triggers doAirLoopSetUp - ReportCoilSelection::setCoilUA(*state, ReportCoilSelection::getReportIndex(*state, coil2Name, coil2Type), uA, sizingCap, isAutoSized, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilUA( + *state, ReportCoilSelection::getReportIndex(*state, coil2Name, coil2Type), uA, sizingCap, isAutoSized, curSysNum, curZoneEqNum); EXPECT_EQ(uA, c2->coilUA); EXPECT_EQ(sizingCap, c2->coilTotCapAtPeak); EXPECT_EQ(curSysNum, c2->airloopNum); @@ -192,7 +203,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) EXPECT_EQ(2000.0, c2->rmLatentAtPeak); // Add a heating coil - std::string coil3Name("Coil 3"); // user-defined name of the coil + std::string coil3Name("Coil 3"); // user-defined name of the coil HVAC::CoilType coil3Type = HVAC::CoilType::HeatingElectric; // idf input object class name of coil uA = -999.0; sizingCap = 500.0; @@ -200,7 +211,8 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) curZoneEqNum = 0; isAutoSized = false; // true if autosized // This triggers doAirLoopSetUp - ReportCoilSelection::setCoilUA(*state, ReportCoilSelection::getReportIndex(*state, coil3Name, coil3Type), uA, sizingCap, isAutoSized, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilUA( + *state, ReportCoilSelection::getReportIndex(*state, coil3Name, coil3Type), uA, sizingCap, isAutoSized, curSysNum, curZoneEqNum); auto &c3(state->dataRptCoilSelection->coils[2]); EXPECT_EQ(uA, c3->coilUA); EXPECT_EQ(sizingCap, c3->coilTotCapAtPeak); @@ -225,7 +237,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ChWCoil) TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) { - std::string coil1Name("Coil 1"); // user-defined name of the coil + std::string coil1Name("Coil 1"); // user-defined name of the coil HVAC::CoilType coil1Type = HVAC::CoilType::HeatingSteam; // idf input object class name of coil int wInletNodeNum = 9; int wOutletNodeNum = 15; @@ -284,7 +296,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) state->dataSize->PlantSizData(1).LoopType = DataSizing::TypeOfPlantLoop::Steam; isAutoSized = true; // true if autosized ReportCoilSelection::setCoilWaterFlowNodeNums( - *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), waterVdot, isAutoSized, wInletNodeNum, wOutletNodeNum, loopNum); + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), waterVdot, isAutoSized, wInletNodeNum, wOutletNodeNum, loopNum); auto &c1b(state->dataRptCoilSelection->coils[0]); EXPECT_EQ(1, c1b->pltSizNum); EXPECT_EQ(loopNum, c1b->waterLoopNum); @@ -301,7 +313,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_SteamCoil) TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) { - std::string coil1Name("Coil 1"); // user-defined name of the coil + std::string coil1Name("Coil 1"); // user-defined name of the coil HVAC::CoilType coil1Type = HVAC::CoilType::HeatingGasOrOtherFuel; // idf input object class name of coil state->dataGlobal->NumOfZones = 3; @@ -415,7 +427,8 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) EXPECT_NEAR(63371.3, c1->ratedCoilOutEnth, 0.1); Real64 entAirDryBulbTemp = 24.0; - ReportCoilSelection::setCoilEntAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); EXPECT_EQ(entAirDryBulbTemp, c1->coilDesEntTemp); EXPECT_EQ(curSysNum, c1->airloopNum); EXPECT_EQ(curZoneEqNum, c1->zoneEqNum); @@ -505,7 +518,8 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) EXPECT_NEAR(zoneHeatingLatentLoad, c1->rmLatentAtPeak, 0.000001); entAirDryBulbTemp = 21.0; // change coil entering air temp - ReportCoilSelection::setCoilEntAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); lvgAirDryBulbTemp = 30.0; ReportCoilSelection::setCoilLvgAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), lvgAirDryBulbTemp); EXPECT_EQ(entAirDryBulbTemp, c1->coilDesEntTemp); @@ -557,7 +571,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoil) TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) { - std::string coil1Name("Coil 1"); // user-defined name of the coil + std::string coil1Name("Coil 1"); // user-defined name of the coil HVAC::CoilType coil1Type = HVAC::CoilType::CoolingDX; // idf input object class name of coil state->dataGlobal->NumOfZones = 3; @@ -625,7 +639,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) RatedCoilOawbRef, RatedCoilBpFactor, RatedCoilEff); - + EXPECT_EQ(RatedCoilTotCap, c1->coilRatedTotCap); EXPECT_NEAR(c1->coilCapFTIdealPeak, 1.0, 0.000001); EXPECT_EQ(RatedCoilSensCap, c1->coilRatedSensCap); @@ -671,7 +685,8 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) EXPECT_NEAR(27197.5, c1->ratedCoilOutEnth, 0.1); Real64 entAirDryBulbTemp = 24.0; - ReportCoilSelection::setCoilEntAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); EXPECT_EQ(entAirDryBulbTemp, c1->coilDesEntTemp); EXPECT_EQ(curSysNum, c1->airloopNum); EXPECT_EQ(curZoneEqNum, c1->zoneEqNum); @@ -749,7 +764,8 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) EXPECT_EQ(zoneCoolingLatentLoad, c1->rmLatentAtPeak); entAirDryBulbTemp = 21.0; // change coil entering air temp - ReportCoilSelection::setCoilEntAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); + ReportCoilSelection::setCoilEntAirTemp( + *state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), entAirDryBulbTemp, curSysNum, curZoneEqNum); lvgAirDryBulbTemp = 12.0; ReportCoilSelection::setCoilLvgAirTemp(*state, ReportCoilSelection::getReportIndex(*state, coil1Name, coil1Type), lvgAirDryBulbTemp); EXPECT_EQ(entAirDryBulbTemp, c1->coilDesEntTemp); @@ -801,7 +817,7 @@ TEST_F(EnergyPlusFixture, ReportCoilSelection_ZoneEqCoolingCoil) TEST_F(EnergyPlusFixture, ReportCoilSelection_4PipeFCU_ElecHeatingCoil) { - std::string coil1Name("ElecHeatCoil"); // user-defined name of the coil + std::string coil1Name("ElecHeatCoil"); // user-defined name of the coil HVAC::CoilType coil1Type = HVAC::CoilType::HeatingElectric; // idf input object class name of coil state->dataGlobal->NumOfZones = 1; @@ -943,7 +959,7 @@ TEST_F(EnergyPlusFixture, Test_finishCoilSummaryReportTable) { Real64 constexpr mult = 1.0; int curZoneEqNum = 1; - std::string coil1Name = "ElecHeatCoil"; // user-defined name of the coil + std::string coil1Name = "ElecHeatCoil"; // user-defined name of the coil HVAC::CoilType coil1Type = HVAC::CoilType::HeatingElectric; // idf input object class name of coil // set up coil selection report object by calling a public function (i.e., calls getIndexForOrCreateDataObjFromCoilName) @@ -999,7 +1015,7 @@ TEST_F(EnergyPlusFixture, Test_finishCoilSummaryReportTable) EXPECT_TRUE(Util::SameString(zoneEquipList.EquipName(2), "")); // test that 2 equipment in the equipment list will fill coil selection data - std::string coil2Name = "ElecHeatCoil 2"; // user-defined name of the coil + std::string coil2Name = "ElecHeatCoil 2"; // user-defined name of the coil HVAC::CoilType coil2Type = HVAC::CoilType::HeatingElectric; // idf input object class name of coil zoneEquipList.EquipName(1) = "Zone 1 FCU"; diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index ccd5c28494a..d03296392d7 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -23018,8 +23018,7 @@ TEST_F(AirloopUnitarySysTest, WSHPVariableSpeedCoilSizing) // all speeds have same flow per capacity ratio vsCoil1.MSRatedAirVolFlowPerRatedTotCap(spdNum) = 0.000036791; // each speed as a percentage of total capacity, spd 1 = 0.1, spd 2 = 0.2, spd 10 = 1.0 - vsCoil1.MSRatedPercentTotCap(spdNum) = - spdNum / Real64(vsCoil1.NumOfSpeeds); + vsCoil1.MSRatedPercentTotCap(spdNum) = spdNum / Real64(vsCoil1.NumOfSpeeds); // all speeds have same parameters vsCoil1.MSRatedCOP(spdNum) = 3.0; vsCoil1.MSRatedWaterVolFlowPerRatedTotCap(spdNum) = 1.0E-7; @@ -23036,12 +23035,9 @@ TEST_F(AirloopUnitarySysTest, WSHPVariableSpeedCoilSizing) state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilVSWAHPCoolingEquationFit; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = - vsCoil1.Name; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - vsCoil1.WaterInletNodeNum; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = - vsCoil1.WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = vsCoil1.Name; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = vsCoil1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = vsCoil1.WaterOutletNodeNum; // use pseudo real CapFT curve, use unity curves for all others auto *curve1 = Curve::AddCurve(*state, "Curve1"); curve1->curveType = Curve::CurveType::BiQuadratic; @@ -23096,18 +23092,14 @@ TEST_F(AirloopUnitarySysTest, WSHPVariableSpeedCoilSizing) // now prove the correct CapFT value was used Real64 MixWetBulb = Psychrometrics::PsyTwbFnTdbWPb(*state, MixTemp, MixHumRat, state->dataEnvrn->StdBaroPress); Real64 constexpr RatedInletWaterTemp = 29.4444; // 85 F cooling mode - Real64 capFT_water = - Curve::CurveValue(*state, vsCoil1.MSCCapFTemp(10), MixWetBulb, RatedInletWaterTemp); + Real64 capFT_water = Curve::CurveValue(*state, vsCoil1.MSCCapFTemp(10), MixWetBulb, RatedInletWaterTemp); // these curve results are very near 1 EXPECT_NEAR(state->dataSize->DataCoilSizingCapFT, capFT_water, 0.0001); EXPECT_NEAR(capFT_water, 0.9994, 0.0001); // OAT at cooling peak was set = 0 C - Real64 capFT_OAT = Curve::CurveValue(*state, - vsCoil1.MSCCapFTemp(10), - MixWetBulb, - state->dataSize->FinalSysSizing(1).OutTempAtCoolPeak); + Real64 capFT_OAT = Curve::CurveValue(*state, vsCoil1.MSCCapFTemp(10), MixWetBulb, state->dataSize->FinalSysSizing(1).OutTempAtCoolPeak); // this value is certainly not used in the capacity calculation as shown below EXPECT_NEAR(capFT_OAT, 1.5, 0.0001); diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 0c0c0a7f7db..3a5d4e49b2b 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -204,7 +204,7 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) waterCoil1.Name = "Test Water Cooling Coil"; waterCoil1.coilType = HVAC::CoilType::CoolingWater; waterCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, waterCoil1.Name, waterCoil1.coilType); - + waterCoil1.WaterPlantLoc.loopNum = 1; PlantUtilities::SetPlantLocationLinks(*state, waterCoil1.WaterPlantLoc); waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterCooling; @@ -219,8 +219,7 @@ TEST_F(WaterCoilsTest, WaterCoolingCoilSizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(3) = "Maximum Flow Rate"; waterCoil1.WaterInletNodeNum = 1; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - waterCoil1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -457,8 +456,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; waterCoil1.WaterInletNodeNum = 1; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - waterCoil1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -506,10 +504,8 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) state->dataSize->CurSysNum = 0; state->dataSize->TermUnitSizing.allocate(1); state->dataSize->TermUnitFinalZoneSizing.allocate(1); - state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).AirVolFlow = - waterCoil1.DesAirVolFlowRate / 3.0; // DesAirVolFlowRate = 1.0 - state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).MaxHWVolFlow = - waterCoil1.MaxWaterVolFlowRate / 3.0; + state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).AirVolFlow = waterCoil1.DesAirVolFlowRate / 3.0; // DesAirVolFlowRate = 1.0 + state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).MaxHWVolFlow = waterCoil1.MaxWaterVolFlowRate / 3.0; state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).MinPriFlowFrac = 0.5; state->dataSize->TermUnitSingDuct = true; @@ -588,7 +584,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) state->dataSize->FinalSysSizing(1).HeatOAOption = DataSizing::OAControl::AllOA; // set up water coil - int CoilNum = 1; + int CoilNum = 1; auto &waterCoil1 = state->dataWaterCoils->WaterCoil(CoilNum); waterCoil1.Name = "Water Heating Coil"; waterCoil1.WaterPlantLoc.loopNum = 1; @@ -610,8 +606,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; waterCoil1.WaterInletNodeNum = 1; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - waterCoil1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -661,8 +656,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) state->dataSize->TermUnitFinalZoneSizing.allocate(1); state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).AirVolFlow = waterCoil1.DesAirVolFlowRate / 1500.0; // DesAirVolFlowRate = 1.0 so TU air flow = 0.00067 (lower than 0.001) - state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).MaxHWVolFlow = - waterCoil1.MaxWaterVolFlowRate / 1500.0; + state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).MaxHWVolFlow = waterCoil1.MaxWaterVolFlowRate / 1500.0; state->dataSize->TermUnitSizing(state->dataSize->CurTermUnitSizingNum).MinPriFlowFrac = 0.5; state->dataSize->TermUnitSingDuct = true; @@ -766,8 +760,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; waterCoil1.WaterInletNodeNum = 1; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - waterCoil1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -880,8 +873,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(1) = "Design Water Flow Rate"; waterCoil1.WaterInletNodeNum = 1; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - waterCoil1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -913,8 +905,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterSimpleSizing) Cp = state->dataPlnt->PlantLoop(1).glycol->getSpecificHeat(*state, Constant::CWInitConvTemp, "Unit Test"); rho = state->dataPlnt->PlantLoop(1).glycol->getDensity(*state, Constant::CWInitConvTemp, "Unit Test"); - DesWaterFlowRate = waterCoil1.DesWaterCoolingCoilRate / - (waterCoil1.DesignWaterDeltaTemp * Cp * rho); + DesWaterFlowRate = waterCoil1.DesWaterCoolingCoilRate / (waterCoil1.DesignWaterDeltaTemp * Cp * rho); // check cooling coil design water flow rate EXPECT_DOUBLE_EQ(DesWaterFlowRate, waterCoil1.MaxWaterVolFlowRate); @@ -996,8 +987,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailedSizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(1) = "Design Water Flow Rate"; waterCoil1.WaterInletNodeNum = 1; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - waterCoil1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -1073,7 +1063,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) waterCoil1.Name = "Test Detailed Water Cooling Coil"; waterCoil1.coilType = HVAC::CoilType::CoolingWaterDetailed; waterCoil1.coilReportNum = ReportCoilSelection::getReportIndex(*state, waterCoil1.Name, waterCoil1.coilType); - + waterCoil1.availSched = Sched::GetScheduleAlwaysOff(*state); waterCoil1.WaterCoilType = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; @@ -1120,10 +1110,8 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = waterCoil1.Name; state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type = DataPlant::PlantEquipmentType::CoilWaterDetailedFlatCooling; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - waterCoil1.WaterInletNodeNum; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = - waterCoil1.WaterOutletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = waterCoil1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumOut = waterCoil1.WaterOutletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -1179,8 +1167,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) " ** Warning ** Coil:Cooling:Water:DetailedGeometry in Coil =Test Detailed Water Cooling Coil", " ** ~~~ ** Air Flow Rate Velocity has greatly exceeded upper design guidelines of ~2.5 m/s", EnergyPlus::format(" ** ~~~ ** Air Mass Flow Rate[kg/s]={:.6T}", waterCoil1.InletAirMassFlowRate), - EnergyPlus::format(" ** ~~~ ** Air Face Velocity[m/s]={:.6T}", - AirMassFlow / (waterCoil1.MinAirFlowArea * AirDensity)), + EnergyPlus::format(" ** ~~~ ** Air Face Velocity[m/s]={:.6T}", AirMassFlow / (waterCoil1.MinAirFlowArea * AirDensity)), EnergyPlus::format(" ** ~~~ ** Approximate Mass Flow Rate limit for Face Area[kg/s]={:.6T}", 2.5 * waterCoil1.MinAirFlowArea * AirDensity), " ** ~~~ ** Coil:Cooling:Water:DetailedGeometry could be resized/autosized to handle capacity", @@ -1203,8 +1190,7 @@ TEST_F(WaterCoilsTest, CoilCoolingWaterDetailed_WarningMath) " ** Severe ** Coil:Cooling:Water:DetailedGeometry in Coil =Test Detailed Water Cooling Coil", " ** ~~~ ** Air Flow Rate Velocity is > 100MPH (44.7m/s) and simulation cannot continue", EnergyPlus::format(" ** ~~~ ** Air Mass Flow Rate[kg/s]={:.6T}", waterCoil1.InletAirMassFlowRate), - EnergyPlus::format(" ** ~~~ ** Air Face Velocity[m/s]={:.6T}", - AirMassFlow / (waterCoil1.MinAirFlowArea * AirDensity)), + EnergyPlus::format(" ** ~~~ ** Air Face Velocity[m/s]={:.6T}", AirMassFlow / (waterCoil1.MinAirFlowArea * AirDensity)), EnergyPlus::format(" ** ~~~ ** Approximate Mass Flow Rate limit for Face Area[kg/s]={:.6T}", 44.7 * waterCoil1.MinAirFlowArea * AirDensity), " ** Fatal ** Coil:Cooling:Water:DetailedGeometry needs to be resized/autosized to handle capacity", @@ -1276,8 +1262,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; waterCoil1.WaterInletNodeNum = 1; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - waterCoil1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; @@ -1374,8 +1359,7 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) state->dataWaterCoils->WaterCoilNumericFields(CoilNum).FieldNames(2) = "Maximum Water Flow Rate"; waterCoil1.WaterInletNodeNum = 1; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - waterCoil1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = waterCoil1.WaterInletNodeNum; state->dataSize->CurZoneEqNum = 0; state->dataSize->CurSysNum = 1; diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc index 13707b39140..54f610534ee 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc @@ -100,7 +100,7 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) wahpSimple1.WAHPType = WatertoAirHP::Cooling; wahpSimple1.coilType = HVAC::CoilType::CoolingWAHPSimple; wahpSimple1.coilReportNum = ReportCoilSelection::getReportIndex(*state, wahpSimple1.Name, wahpSimple1.coilType); - + wahpSimple1.RatedAirVolFlowRate = AutoSize; wahpSimple1.RatedCapCoolTotal = AutoSize; wahpSimple1.RatedCapCoolSens = AutoSize; @@ -194,12 +194,9 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) auto &loopsidebranch(state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1)); loopsidebranch.TotalComponents = 1; loopsidebranch.Comp.allocate(1); - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = - wahpSimple1.Name; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type = - wahpSimple1.WAHPPlantType; - state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = - wahpSimple1.WaterInletNodeNum; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Name = wahpSimple1.Name; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).Type = wahpSimple1.WAHPPlantType; + state->dataPlnt->PlantLoop(1).LoopSide(DataPlant::LoopSideLocation::Demand).Branch(1).Comp(1).NodeNumIn = wahpSimple1.WaterInletNodeNum; wahpSimple1.plantLoc.loopNum = 1; PlantUtilities::SetPlantLocationLinks(*state, wahpSimple1.plantLoc); @@ -213,14 +210,12 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) EXPECT_DOUBLE_EQ(0.0075, state->dataSize->FinalZoneSizing(state->dataSize->CurZoneEqNum).CoolDesHumRat); // check that the total cooling capacity is >= the sensible cooling capacity - EXPECT_GE(wahpSimple1.RatedCapCoolTotal, - wahpSimple1.RatedCapCoolSens); + EXPECT_GE(wahpSimple1.RatedCapCoolTotal, wahpSimple1.RatedCapCoolSens); if (wahpSimple1.RatedCapCoolTotal != 0.0) { - ShowMessage(*state, - format("SizeHVACWaterToAir: Rated Sensible Heat Ratio = {:.2R} [-]", - wahpSimple1.RatedCapCoolSens / - wahpSimple1.RatedCapCoolTotal)); + ShowMessage( + *state, + format("SizeHVACWaterToAir: Rated Sensible Heat Ratio = {:.2R} [-]", wahpSimple1.RatedCapCoolSens / wahpSimple1.RatedCapCoolTotal)); } EXPECT_TRUE(compare_eio_stream_substring("Design Size Rated Air Flow Rate", false)); EXPECT_TRUE(compare_eio_stream_substring("Design Size Rated Total Cooling Capacity", false));