diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 08c09be435f..8425df1fca3 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -4537,7 +4537,7 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxCoolAirVolFlow != DataSizing::AutoSize) { for (int i = 1; i <= state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedCooling; ++i) { state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolMassFlowRate[i] = - state.dataHVACFan->fanObjs[FanIndex]->AirMassFlowRateAtSpeed(i-1); + state.dataHVACFan->fanObjs[FanIndex]->AirMassFlowRateAtSpeed(i - 1); } } } @@ -4552,7 +4552,8 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound) } } } - ShowWarningError(state, cCurrentModuleObject + " = " + thisVrfTU.Name + " with Fan:SystemModel is used in " + cAlphaArgs(8) + "\""); + ShowWarningError(state, + cCurrentModuleObject + " = " + thisVrfTU.Name + " with Fan:SystemModel is used in " + cAlphaArgs(8) + "\""); ShowContinueError(state, format("...The number of speed = {:.0R}.", double(NumSpeeds))); ShowContinueError(state, "...Multiple speed fan will be appiled to this unit. The speed number is determined by load."); } @@ -9488,7 +9489,7 @@ void VRFTerminalUnitEquipment::ControlVRFToLoad(EnergyPlusData &state, if (SpeedNum == 1) { this->SpeedRatio = 0.0; - } + } auto f = [&state, VRFTUNum, FirstHVACIteration, QZnReq, OnOffAirFlowRatio](Real64 const PartLoadRatio) { Real64 QZnReqTemp = QZnReq; // denominator representing zone load (W) Real64 ActualOutput; // delivered capacity of VRF terminal unit @@ -9523,7 +9524,7 @@ void VRFTerminalUnitEquipment::ControlVRFToLoad(EnergyPlusData &state, this->SpeedRatio = 0.0; if (SolFla > 0 && PartLoadRatio <= 1.0) break; } else { - this->CycRatio = 1.0; + this->CycRatio = 1.0; this->SpeedRatio = PartLoadRatio; if (SolFla > 0 && PartLoadRatio <= 1.0) break; } @@ -9636,7 +9637,7 @@ void VRFTerminalUnitEquipment::ControlVRFToLoad(EnergyPlusData &state, } } if (FullOutput - NoCompOutput == 0.0) { - PartLoadRatio = 0.0; + PartLoadRatio = 0.0; } else { PartLoadRatio = min(1.0, max(MinPLF, std::abs(QZnReq - NoCompOutput) / std::abs(FullOutput - NoCompOutput))); } @@ -10191,7 +10192,7 @@ void SetAverageAirFlow(EnergyPlusData &state, } else { state.dataHVACVarRefFlow->FanSpeedRatio = state.dataHVACVarRefFlow->CompOnFlowRatio; } - } + } // if the terminal unit and fan are scheduled on then set flow rate if (GetCurrentScheduleValue(state, state.dataHVACVarRefFlow->VRFTU(VRFTUNum).SchedPtr) > 0.0 && diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh index 556e1c9d236..fe0f7020cdb 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh @@ -701,61 +701,61 @@ namespace HVACVariableRefrigerantFlow { bool SuppHeatingCoilPresent = false; // FALSE if coil not present std::string AvailManagerListName; // Name of an availability manager list object int AvailStatus = 0; - Real64 TerminalUnitSensibleRate = 0.0; // sensible cooling/heating rate of VRF terminal unit (W) - Real64 TerminalUnitLatentRate = 0.0; // latent dehumidification/humidification rate of VRF terminal unit (W) - Real64 TotalCoolingRate = 0.0; // report variable for total cooling rate (W) - Real64 TotalHeatingRate = 0.0; // report variable for total heating rate (W) - Real64 SensibleCoolingRate = 0.0; // report variable for sensible cooling rate (W) - Real64 SensibleHeatingRate = 0.0; // report variable for sensible heating rate (W) - Real64 LatentCoolingRate = 0.0; // report variable for latent cooling rate (W) - Real64 LatentHeatingRate = 0.0; // report variable for latent heating rate (W) - Real64 TotalCoolingEnergy = 0.0; // report variable for total cooling energy (J) - Real64 TotalHeatingEnergy = 0.0; // report variable for total heating energy (J) - Real64 SensibleCoolingEnergy = 0.0; // report variable for sensible cooling energy (J) - Real64 SensibleHeatingEnergy = 0.0; // report variable for sensible heating energy (J) - Real64 LatentCoolingEnergy = 0.0; // report variable for latent cooling energy (J) - Real64 LatentHeatingEnergy = 0.0; // report variable for latent heating energy (J) - bool EMSOverridePartLoadFrac = false; // User defined EMS function - Real64 EMSValueForPartLoadFrac = 0.0; // user defined value for EMS function - int IterLimitExceeded = 0; // index used for warning messages - int FirstIterfailed = 0; // index used for warning messages - int HVACSizingIndex = 0; // index of a HVACSizing object for a VRF terminal - bool ATMixerExists = false; // True if there is an ATMixer - std::string ATMixerName; // name of air terminal mixer - int ATMixerIndex = 0; // index to the air terminal mixer - int ATMixerType = 0; // 1 = inlet side mixer, 2 = supply side mixer - int ATMixerPriNode = 0; // primary inlet air node number for the air terminal mixer - int ATMixerSecNode = 0; // secondary air inlet node number for the air terminal mixer - int ATMixerOutNode = 0; // outlet air node number for the air terminal mixer - int SuppHeatCoilAirInletNode = 0; // supplemental heating coil air inlet node - int SuppHeatCoilAirOutletNode = 0; // supplemental heating coil air outlet node - int SuppHeatCoilFluidInletNode = 0; // supplemental heating coil fluid inlet node - int SuppHeatCoilFluidOutletNode = 0; // supplemental heating coil fluid outlet node - bool firstPass = true; // used to reset global sizing data - PlantLocation SuppHeatCoilPlantLoc{}; // supplemental heating coil plant component index - Real64 coilInNodeT = 0.0; // coil inlet node temp at full flow (C) - Real64 coilInNodeW = 0.0; // coil inlet node humidity ratio at full flow (kg/kg) - int fanInletNode = 0; // fan inlet node index - int fanOutletNode = 0; // fan outlet node index - bool MySuppCoilPlantScanFlag = true; // flag used to initialize plant comp for water and steam heating coils - int airLoopNum = 0; // index to air loop - bool isInOASys = false; // true if TU is configured in outside air system - bool isInAirLoop = false; // true if TU is configured in an air loop - bool isInZone = false; // true if TU is configured as zone equipment - bool isSetPointControlled = false; // TU is controlled via setpoint instead of the standard load control - bool coolSPActive = false; // set point controlled cooling coil active (needs to operate) - bool heatSPActive = false; // set point controlled heating coil active (needs to operate) - Real64 coolLoadToSP = 0.0; // load to set point in cooling mode - Real64 heatLoadToSP = 0.0; // load to set point in heating mode - Real64 coilTempSetPoint = 0.0; // coil control temperature - Real64 suppTempSetPoint = 0.0; // supplemental heating coil control temperature - Real64 controlZoneMassFlowFrac = 1.0; // ratio of control zone air mass flow rate to total zone air mass flow rate - int zoneSequenceCoolingNum = 0; // zone equipment cooling sequence - int zoneSequenceHeatingNum = 0; // zone equipment heating sequence - int coolCoilAirInNode = 0; // cooling coil air inlet node number - int coolCoilAirOutNode = 0; // cooling coil air outlet node number - int heatCoilAirInNode = 0; // heating coil air inlet node number - int heatCoilAirOutNode = 0; // heating coil air outlet node number + Real64 TerminalUnitSensibleRate = 0.0; // sensible cooling/heating rate of VRF terminal unit (W) + Real64 TerminalUnitLatentRate = 0.0; // latent dehumidification/humidification rate of VRF terminal unit (W) + Real64 TotalCoolingRate = 0.0; // report variable for total cooling rate (W) + Real64 TotalHeatingRate = 0.0; // report variable for total heating rate (W) + Real64 SensibleCoolingRate = 0.0; // report variable for sensible cooling rate (W) + Real64 SensibleHeatingRate = 0.0; // report variable for sensible heating rate (W) + Real64 LatentCoolingRate = 0.0; // report variable for latent cooling rate (W) + Real64 LatentHeatingRate = 0.0; // report variable for latent heating rate (W) + Real64 TotalCoolingEnergy = 0.0; // report variable for total cooling energy (J) + Real64 TotalHeatingEnergy = 0.0; // report variable for total heating energy (J) + Real64 SensibleCoolingEnergy = 0.0; // report variable for sensible cooling energy (J) + Real64 SensibleHeatingEnergy = 0.0; // report variable for sensible heating energy (J) + Real64 LatentCoolingEnergy = 0.0; // report variable for latent cooling energy (J) + Real64 LatentHeatingEnergy = 0.0; // report variable for latent heating energy (J) + bool EMSOverridePartLoadFrac = false; // User defined EMS function + Real64 EMSValueForPartLoadFrac = 0.0; // user defined value for EMS function + int IterLimitExceeded = 0; // index used for warning messages + int FirstIterfailed = 0; // index used for warning messages + int HVACSizingIndex = 0; // index of a HVACSizing object for a VRF terminal + bool ATMixerExists = false; // True if there is an ATMixer + std::string ATMixerName; // name of air terminal mixer + int ATMixerIndex = 0; // index to the air terminal mixer + int ATMixerType = 0; // 1 = inlet side mixer, 2 = supply side mixer + int ATMixerPriNode = 0; // primary inlet air node number for the air terminal mixer + int ATMixerSecNode = 0; // secondary air inlet node number for the air terminal mixer + int ATMixerOutNode = 0; // outlet air node number for the air terminal mixer + int SuppHeatCoilAirInletNode = 0; // supplemental heating coil air inlet node + int SuppHeatCoilAirOutletNode = 0; // supplemental heating coil air outlet node + int SuppHeatCoilFluidInletNode = 0; // supplemental heating coil fluid inlet node + int SuppHeatCoilFluidOutletNode = 0; // supplemental heating coil fluid outlet node + bool firstPass = true; // used to reset global sizing data + PlantLocation SuppHeatCoilPlantLoc{}; // supplemental heating coil plant component index + Real64 coilInNodeT = 0.0; // coil inlet node temp at full flow (C) + Real64 coilInNodeW = 0.0; // coil inlet node humidity ratio at full flow (kg/kg) + int fanInletNode = 0; // fan inlet node index + int fanOutletNode = 0; // fan outlet node index + bool MySuppCoilPlantScanFlag = true; // flag used to initialize plant comp for water and steam heating coils + int airLoopNum = 0; // index to air loop + bool isInOASys = false; // true if TU is configured in outside air system + bool isInAirLoop = false; // true if TU is configured in an air loop + bool isInZone = false; // true if TU is configured as zone equipment + bool isSetPointControlled = false; // TU is controlled via setpoint instead of the standard load control + bool coolSPActive = false; // set point controlled cooling coil active (needs to operate) + bool heatSPActive = false; // set point controlled heating coil active (needs to operate) + Real64 coolLoadToSP = 0.0; // load to set point in cooling mode + Real64 heatLoadToSP = 0.0; // load to set point in heating mode + Real64 coilTempSetPoint = 0.0; // coil control temperature + Real64 suppTempSetPoint = 0.0; // supplemental heating coil control temperature + Real64 controlZoneMassFlowFrac = 1.0; // ratio of control zone air mass flow rate to total zone air mass flow rate + int zoneSequenceCoolingNum = 0; // zone equipment cooling sequence + int zoneSequenceHeatingNum = 0; // zone equipment heating sequence + int coolCoilAirInNode = 0; // cooling coil air inlet node number + int coolCoilAirOutNode = 0; // cooling coil air outlet node number + int heatCoilAirInNode = 0; // heating coil air inlet node number + int heatCoilAirOutNode = 0; // heating coil air outlet node number std::string DesignSpecMultispeedHPType; // Multiuple performance object type std::string DesignSpecMultispeedHPName; // Multiuple performance object name int DesignSpecMSHPIndex = -1; // Multiuple performance index diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index b714b0c7175..4d5d4a5ea81 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -3080,18 +3080,18 @@ namespace UnitarySystems { if (this->m_NumOfSpeedCooling > 1) { int FanIndex = this->m_FanIndex; for (int i = 1; i <= this->m_NumOfSpeedCooling; ++i) { - if (this->m_DesignSpecMSHPIndex > -1) { - if (state.dataUnitarySystems->designSpecMSHP[this->m_DesignSpecMSHPIndex].coolingVolFlowRatio[i] == - DataSizing::AutoSize) { - this->m_CoolVolumeFlowRate[i] = double(i) / double(this->m_NumOfSpeedCooling) * AirFlowRate; - } else { - this->m_CoolVolumeFlowRate[i] = - state.dataUnitarySystems->designSpecMSHP[this->m_DesignSpecMSHPIndex].coolingVolFlowRatio[i] * AirFlowRate; - } + if (this->m_DesignSpecMSHPIndex > -1) { + if (state.dataUnitarySystems->designSpecMSHP[this->m_DesignSpecMSHPIndex].coolingVolFlowRatio[i] == + DataSizing::AutoSize) { + this->m_CoolVolumeFlowRate[i] = double(i) / double(this->m_NumOfSpeedCooling) * AirFlowRate; } else { this->m_CoolVolumeFlowRate[i] = - state.dataHVACFan->fanObjs[FanIndex]->AirMassFlowRateAtSpeed(i - 1) / state.dataEnvrn->StdRhoAir; + state.dataUnitarySystems->designSpecMSHP[this->m_DesignSpecMSHPIndex].coolingVolFlowRatio[i] * AirFlowRate; } + } else { + this->m_CoolVolumeFlowRate[i] = + state.dataHVACFan->fanObjs[FanIndex]->AirMassFlowRateAtSpeed(i - 1) / state.dataEnvrn->StdRhoAir; + } this->m_CoolMassFlowRate[i] = this->m_CoolVolumeFlowRate[i] * state.dataEnvrn->StdRhoAir; } } @@ -11846,26 +11846,26 @@ namespace UnitarySystems { } break; case DataHVACGlobals::Coil_CoolingWaterToAirHPSimple: { // WSHP coils do not have a PLF curve and do not adjust fan performance + bool errFlag = false; this->heatPumpRunFrac(PartLoadRatio, errFlag, this->m_WSHPRuntimeFrac); if (PartLoadRatio > 0.0 && this->m_WSHPRuntimeFrac > 0.0 && this->m_FanOpMode == DataHVACGlobals::CycFanCycCoil && this->m_sysType != SysType::PackagedWSHP) { state.dataHVACGlobal->OnOffFanPartLoadFraction = PartLoadRatio / this->m_WSHPRuntimeFrac; } - - WaterToAirHeatPumpSimple::SimWatertoAirHPSimple(state, - blankString, - this->m_CoolingCoilIndex, - this->m_CoolingCoilSensDemand, - this->m_CoolingCoilLatentDemand, - this->m_FanOpMode, - this->m_WSHPRuntimeFrac, - this->m_MaxONOFFCyclesperHour, - this->m_HPTimeConstant, - this->m_FanDelayTime, - CompressorOn, - PartLoadRatio, - FirstHVACIteration); + WaterToAirHeatPumpSimple::SimWatertoAirHPSimple(state, + blankString, + this->m_CoolingCoilIndex, + this->m_CoolingCoilSensDemand, + this->m_CoolingCoilLatentDemand, + this->m_FanOpMode, + this->m_WSHPRuntimeFrac, + this->m_MaxONOFFCyclesperHour, + this->m_HPTimeConstant, + this->m_FanDelayTime, + CompressorOn, + PartLoadRatio, + FirstHVACIteration); } break; case DataHVACGlobals::Coil_CoolingWaterToAirHP: { bool errFlag = false; @@ -12059,6 +12059,7 @@ namespace UnitarySystems { } break; case DataHVACGlobals::Coil_HeatingWaterToAirHPSimple: { // WSHP coils do not have a PLF curve and do not adjust fan performance + bool errFlag = false; this->heatPumpRunFrac(PartLoadRatio, errFlag, this->m_WSHPRuntimeFrac); if (PartLoadRatio > 0.0 && this->m_WSHPRuntimeFrac > 0.0 && this->m_FanOpMode == DataHVACGlobals::CycFanCycCoil && this->m_sysType != SysType::PackagedWSHP) { // used to match up to PTUnit results @@ -15913,7 +15914,7 @@ namespace UnitarySystems { this->m_ElecPower = locFanElecPower; this->m_ElecPowerConsumption = this->m_ElecPower * ReportingConstant; } break; - // May not need + // May not need case DataHVACGlobals::Coil_CoolingWaterToAirHPSimple: { if (this->m_NumOfSpeedCooling > 1) { this->m_CycRatio = max(this->m_CoolingCycRatio, this->m_HeatingCycRatio);