Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lgu1234 committed Jul 19, 2023
1 parent 47bc2ce commit f44c7fe
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 59 deletions.
6 changes: 3 additions & 3 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -36458,7 +36458,7 @@ ZoneHVAC:WaterToAirHeatPump,
A22; \field Design Specification Multispeed Object Name
\type object-list
\object-list UnitarySystemPerformaceNames
\note Enter the name of the performance specification object used to describe the multispeed coil or fan.
\note The name of the performance specification object used to describe the multispeed coil or fan.

ZoneHVAC:Dehumidifier:DX,
\memo This object calculates the performance of zone (room) air dehumidifiers.
Expand Down Expand Up @@ -42362,7 +42362,7 @@ ZoneHVAC:TerminalUnit:VariableRefrigerantFlow,
A21; \field Design Specification Multispeed Object Name
\type object-list
\object-list UnitarySystemPerformaceNames
\note Enter the name of the performance specification object used to describe the multispeed coil or fan.
\note The name of the performance specification object used to describe the multispeed coil or fan.

\group Zone HVAC Radiative/Convective Units

Expand Down Expand Up @@ -63333,7 +63333,7 @@ AirLoopHVAC:UnitarySystem,
A27; \field Design Specification Multispeed Object Name
\type object-list
\object-list UnitarySystemPerformaceNames
\note Enter the name of the performance specification object used to describe the multispeed coil.
\note The name of the performance specification object used to describe the multispeed coil.

UnitarySystemPerformance:Multispeed,
\memo The UnitarySystemPerformance object is used to specify the air flow ratio at each
Expand Down
101 changes: 45 additions & 56 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4472,82 +4472,71 @@ void GetVRFInputData(EnergyPlusData &state, bool &ErrorsFound)
}
}

auto &vrfTU = state.dataHVACVarRefFlow->VRFTU(VRFTUNum);
if (!lAlphaFieldBlanks(20) && !lAlphaFieldBlanks(21)) {
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DesignSpecMultispeedHPType = cAlphaArgs(20);
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DesignSpecMultispeedHPName = cAlphaArgs(21);
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DesignSpecMSHPIndex = UnitarySystems::getDesignSpecMSHPIndex(state, cAlphaArgs(21));
auto &designSpecFan = state.dataUnitarySystems->designSpecMSHP[state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DesignSpecMSHPIndex];
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DXCoolCoilType_Num == DataHVACGlobals::CoilVRF_Cooling) {
vrfTU.DesignSpecMultispeedHPType = cAlphaArgs(20);
vrfTU.DesignSpecMultispeedHPName = cAlphaArgs(21);
vrfTU.DesignSpecMSHPIndex = UnitarySystems::getDesignSpecMSHPIndex(state, cAlphaArgs(21));
auto &designSpecFan = state.dataUnitarySystems->designSpecMSHP[vrfTU.DesignSpecMSHPIndex];
if (vrfTU.DXCoolCoilType_Num == DataHVACGlobals::CoilVRF_Cooling) {
int NumSpeeds = designSpecFan.numOfSpeedCooling;
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedCooling = NumSpeeds;
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolVolumeFlowRate.resize(NumSpeeds + 1);
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolMassFlowRate.resize(NumSpeeds + 1);
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxCoolAirVolFlow != DataSizing::AutoSize) {
Real64 AirFlowRate = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxCoolAirVolFlow;
for (int i = 1; i <= state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedCooling; ++i) {
if (state.dataUnitarySystems->designSpecMSHP[state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DesignSpecMSHPIndex]
.coolingVolFlowRatio[i] == DataSizing::AutoSize) {
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolVolumeFlowRate[i] =
double(i) / double(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedCooling) * AirFlowRate;
vrfTU.NumOfSpeedCooling = NumSpeeds;
vrfTU.CoolVolumeFlowRate.resize(NumSpeeds + 1);
vrfTU.CoolMassFlowRate.resize(NumSpeeds + 1);
if (vrfTU.MaxCoolAirVolFlow != DataSizing::AutoSize) {
Real64 AirFlowRate = vrfTU.MaxCoolAirVolFlow;
for (int i = 1; i <= vrfTU.NumOfSpeedCooling; ++i) {
if (state.dataUnitarySystems->designSpecMSHP[vrfTU.DesignSpecMSHPIndex].coolingVolFlowRatio[i] == DataSizing::AutoSize) {
vrfTU.CoolVolumeFlowRate[i] = double(i) / double(vrfTU.NumOfSpeedCooling) * AirFlowRate;
} else {
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolVolumeFlowRate[i] =
state.dataUnitarySystems->designSpecMSHP[state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DesignSpecMSHPIndex]
.coolingVolFlowRatio[i] *
AirFlowRate;
vrfTU.CoolVolumeFlowRate[i] =
state.dataUnitarySystems->designSpecMSHP[vrfTU.DesignSpecMSHPIndex].coolingVolFlowRatio[i] * AirFlowRate;
}
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolMassFlowRate[i] =
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolVolumeFlowRate[i] * state.dataEnvrn->StdRhoAir;
vrfTU.CoolMassFlowRate[i] = vrfTU.CoolVolumeFlowRate[i] * state.dataEnvrn->StdRhoAir;
}
}
}
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DXHeatCoilType_Num == DataHVACGlobals::CoilVRF_Heating) {
if (vrfTU.DXHeatCoilType_Num == DataHVACGlobals::CoilVRF_Heating) {
int NumSpeeds = designSpecFan.numOfSpeedHeating;
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedHeating = NumSpeeds;
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatVolumeFlowRate.resize(NumSpeeds + 1);
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatMassFlowRate.resize(NumSpeeds + 1);
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxHeatAirVolFlow != DataSizing::AutoSize) {
Real64 AirFlowRate = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxHeatAirVolFlow;
for (int i = 1; i <= state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedHeating; ++i) {
if (state.dataUnitarySystems->designSpecMSHP[state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DesignSpecMSHPIndex]
.heatingVolFlowRatio[i] == DataSizing::AutoSize) {
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatVolumeFlowRate[i] =
double(i) / double(state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedHeating) * AirFlowRate;
vrfTU.NumOfSpeedHeating = NumSpeeds;
vrfTU.HeatVolumeFlowRate.resize(NumSpeeds + 1);
vrfTU.HeatMassFlowRate.resize(NumSpeeds + 1);
if (vrfTU.MaxHeatAirVolFlow != DataSizing::AutoSize) {
Real64 AirFlowRate = vrfTU.MaxHeatAirVolFlow;
for (int i = 1; i <= vrfTU.NumOfSpeedHeating; ++i) {
if (state.dataUnitarySystems->designSpecMSHP[vrfTU.DesignSpecMSHPIndex].heatingVolFlowRatio[i] == DataSizing::AutoSize) {
vrfTU.HeatVolumeFlowRate[i] = double(i) / double(vrfTU.NumOfSpeedHeating) * AirFlowRate;
} else {
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatVolumeFlowRate[i] =
state.dataUnitarySystems->designSpecMSHP[state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DesignSpecMSHPIndex]
.heatingVolFlowRatio[i] *
AirFlowRate;
vrfTU.HeatVolumeFlowRate[i] =
state.dataUnitarySystems->designSpecMSHP[vrfTU.DesignSpecMSHPIndex].heatingVolFlowRatio[i] * AirFlowRate;
}
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatMassFlowRate[i] =
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatVolumeFlowRate[i] * state.dataEnvrn->StdRhoAir;
vrfTU.HeatMassFlowRate[i] = vrfTU.HeatVolumeFlowRate[i] * state.dataEnvrn->StdRhoAir;
}
}
}
} else {
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).fanType_Num == DataHVACGlobals::FanType_SystemModelObject) {
int FanIndex = state.dataHVACVarRefFlow->VRFTU(VRFTUNum).FanIndex;
if (vrfTU.fanType_Num == DataHVACGlobals::FanType_SystemModelObject) {
int FanIndex = vrfTU.FanIndex;
if (state.dataHVACFan->fanObjs[FanIndex]->speedControl == HVACFan::FanSystem::SpeedControlMethod::Discrete) {
int NumSpeeds = state.dataHVACFan->fanObjs[FanIndex]->m_numSpeeds;
if (NumSpeeds > 1) {
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DXCoolCoilType_Num == DataHVACGlobals::CoilVRF_Cooling) {
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedCooling = NumSpeeds;
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolVolumeFlowRate.resize(NumSpeeds + 1);
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).CoolMassFlowRate.resize(NumSpeeds + 1);
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]->m_massFlowAtSpeed[i - 1];
if (vrfTU.DXCoolCoilType_Num == DataHVACGlobals::CoilVRF_Cooling) {
vrfTU.NumOfSpeedCooling = NumSpeeds;
vrfTU.CoolVolumeFlowRate.resize(NumSpeeds + 1);
vrfTU.CoolMassFlowRate.resize(NumSpeeds + 1);
if (vrfTU.MaxCoolAirVolFlow != DataSizing::AutoSize) {
for (int i = 1; i <= vrfTU.NumOfSpeedCooling; ++i) {
vrfTU.CoolMassFlowRate[i] = state.dataHVACFan->fanObjs[FanIndex]->m_massFlowAtSpeed[i - 1];
}
}
}
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).DXHeatCoilType_Num == DataHVACGlobals::CoilVRF_Heating) {
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedHeating = NumSpeeds;
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatVolumeFlowRate.resize(NumSpeeds + 1);
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatMassFlowRate.resize(NumSpeeds + 1);
if (state.dataHVACVarRefFlow->VRFTU(VRFTUNum).MaxHeatAirVolFlow != DataSizing::AutoSize) {
for (int i = 1; i <= state.dataHVACVarRefFlow->VRFTU(VRFTUNum).NumOfSpeedCooling; ++i) {
state.dataHVACVarRefFlow->VRFTU(VRFTUNum).HeatMassFlowRate[i] =
state.dataHVACFan->fanObjs[FanIndex]->m_massFlowAtSpeed[i - 1];
if (vrfTU.DXHeatCoilType_Num == DataHVACGlobals::CoilVRF_Heating) {
vrfTU.NumOfSpeedHeating = NumSpeeds;
vrfTU.HeatVolumeFlowRate.resize(NumSpeeds + 1);
vrfTU.HeatMassFlowRate.resize(NumSpeeds + 1);
if (vrfTU.MaxHeatAirVolFlow != DataSizing::AutoSize) {
for (int i = 1; i <= vrfTU.NumOfSpeedCooling; ++i) {
vrfTU.HeatMassFlowRate[i] = state.dataHVACFan->fanObjs[FanIndex]->m_massFlowAtSpeed[i - 1];
}
}
}
Expand Down

4 comments on commit f44c7fe

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

MultispeedFans (lgu1234) - Win64-Windows-10-VisualStudio-16: OK (2667 of 2667 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

MultispeedFans (lgu1234) - x86_64-Linux-Ubuntu-22.04-gcc-11.3: OK (3441 of 3483 tests passed, 98 test warnings)

Messages:\n

  • 32 tests had: AUD diffs.
  • 2 tests had: EIO diffs.
  • 1 test had: ESO big diffs.
  • 2 tests had: MTR small diffs.
  • 14 tests had: Table big diffs.
  • 34 tests had: MTD diffs.
  • 79 tests had: RDD diffs.
  • 2 tests had: EDD diffs.
  • 17 tests had: MDD diffs.
  • 1 test had: ERR diffs.
  • 1 test had: Table small diffs.

Failures:\n

regression Test Summary

  • Passed: 752
  • Failed: 42

Build Badge Test Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

MultispeedFans (lgu1234) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-UnitTestsCoverage-Debug: OK (1892 of 1892 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

MultispeedFans (lgu1234) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-IntegrationCoverage-Debug: OK (778 of 778 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.