Skip to content

Commit

Permalink
Initialize SeqNoOA and update DD for non-coincident sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
rraustad committed Jan 25, 2024
1 parent 755d482 commit 0ec2e57
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/EnergyPlus/SimAirServingZones.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6421,6 +6421,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn
SysCoolRetHumRat = 0.0;
SysCoolOutTemp = 0.0;
SysCoolOutHumRat = 0.0;
int saveCoolTUSizingIndex = 0;

for (int ZonesCooledNum = 1; ZonesCooledNum <= NumZonesCooled; ++ZonesCooledNum) { // loop over cooled zones
int TermUnitSizingIndex = state.dataAirLoop->AirToZoneNodeInfo(AirLoopNum).TermUnitCoolSizingIndex(ZonesCooledNum);
Expand All @@ -6443,6 +6444,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn
CoolTimeStepNum = state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).TimeStepNumAtCoolMax;
OutAirTemp += state.dataSize->DesDayWeath(CoolDDNum).Temp(CoolTimeStepNum) * coolMassFlow / (1.0 + termUnitSizing.InducRat);
OutAirHumRat += state.dataSize->DesDayWeath(CoolDDNum).HumRat(CoolTimeStepNum) * coolMassFlow / (1.0 + termUnitSizing.InducRat);
saveCoolTUSizingIndex = TermUnitSizingIndex;
}
if (state.dataSize->CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow > 0.0) {
SysCoolRetTemp /= state.dataSize->CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow;
Expand Down Expand Up @@ -6482,6 +6484,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn
SysHeatRetHumRat = 0.0;
SysHeatOutTemp = 0.0;
SysHeatOutHumRat = 0.0;
int saveHeatTUSizingIndex = 0;

if (NumZonesHeated > 0) { // IF there are centrally heated zones

Expand All @@ -6507,6 +6510,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn
HeatTimeStepNum = state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).TimeStepNumAtHeatMax;
OutAirTemp += state.dataSize->DesDayWeath(HeatDDNum).Temp(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat);
OutAirHumRat += state.dataSize->DesDayWeath(HeatDDNum).HumRat(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat);
saveHeatTUSizingIndex = TermUnitSizingIndex;
}
if (state.dataSize->CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow > 0.0) {
SysHeatRetTemp /= state.dataSize->CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow;
Expand Down Expand Up @@ -6554,6 +6558,7 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn
HeatTimeStepNum = state.dataSize->TermUnitFinalZoneSizing(TermUnitSizingIndex).TimeStepNumAtHeatMax;
OutAirTemp += state.dataSize->DesDayWeath(HeatDDNum).Temp(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat);
OutAirHumRat += state.dataSize->DesDayWeath(HeatDDNum).HumRat(HeatTimeStepNum) * heatMassFlow / (1.0 + termUnitSizing.InducRat);
saveHeatTUSizingIndex = TermUnitSizingIndex;
}
if (state.dataSize->CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow > 0.0) {
SysHeatRetTemp /= state.dataSize->CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow;
Expand Down Expand Up @@ -6591,6 +6596,14 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn
state.dataSize->CalcSysSizing(AirLoopNum).RetHumRatAtCoolPeak = SysCoolRetHumRat;
state.dataSize->CalcSysSizing(AirLoopNum).OutTempAtCoolPeak = SysCoolOutTemp;
state.dataSize->CalcSysSizing(AirLoopNum).OutHumRatAtCoolPeak = SysCoolOutHumRat;
if (state.dataSize->SysSizPeakDDNum(AirLoopNum).SensCoolPeakDD == 0 && saveCoolTUSizingIndex > 0) {
CoolDDNum = state.dataSize->TermUnitFinalZoneSizing(saveCoolTUSizingIndex).CoolDDNum;
CoolTimeStepNum = state.dataSize->TermUnitFinalZoneSizing(saveCoolTUSizingIndex).TimeStepNumAtCoolMax;
state.dataSize->SysSizPeakDDNum(AirLoopNum).SensCoolPeakDD = CoolDDNum;
state.dataSize->SysSizPeakDDNum(AirLoopNum).cSensCoolPeakDDDate = state.dataSize->DesDayWeath(CoolDDNum).DateString;
state.dataSize->SysSizPeakDDNum(AirLoopNum).TimeStepAtSensCoolPk(HeatDDNum) = CoolTimeStepNum;
state.dataSize->CalcSysSizing(AirLoopNum).CoolDesDay = state.dataSize->SysSizing(CoolDDNum, AirLoopNum).CoolDesDay;
}
}
// check to see if the noncoincident result is actually bigger than the coincident (for 100% outside air)
// why is this < 0.0 ? SysHeatCap cannot be < 0 ?? this code will always get executed
Expand All @@ -6603,6 +6616,14 @@ void UpdateSysSizing(EnergyPlusData &state, Constant::CallIndicator const CallIn
state.dataSize->CalcSysSizing(AirLoopNum).HeatRetHumRat = SysHeatRetHumRat;
state.dataSize->CalcSysSizing(AirLoopNum).HeatOutTemp = SysHeatOutTemp;
state.dataSize->CalcSysSizing(AirLoopNum).HeatOutHumRat = SysHeatOutHumRat;
if (state.dataSize->SysSizPeakDDNum(AirLoopNum).HeatPeakDD == 0 && saveHeatTUSizingIndex > 0) {
HeatDDNum = state.dataSize->TermUnitFinalZoneSizing(saveHeatTUSizingIndex).HeatDDNum;
HeatTimeStepNum = state.dataSize->TermUnitFinalZoneSizing(saveHeatTUSizingIndex).TimeStepNumAtHeatMax;
state.dataSize->SysSizPeakDDNum(AirLoopNum).HeatPeakDD = HeatDDNum;
state.dataSize->SysSizPeakDDNum(AirLoopNum).cHeatPeakDDDate = state.dataSize->DesDayWeath(HeatDDNum).DateString;
state.dataSize->SysSizPeakDDNum(AirLoopNum).TimeStepAtHeatPk(HeatDDNum) = HeatTimeStepNum;
state.dataSize->CalcSysSizing(AirLoopNum).HeatDesDay = state.dataSize->SysSizing(HeatDDNum, AirLoopNum).HeatDesDay;
}
}
state.dataSize->CalcSysSizing(AirLoopNum).DesCoolVolFlow =
state.dataSize->CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow / state.dataEnvrn->StdRhoAir;
Expand Down
17 changes: 16 additions & 1 deletion src/EnergyPlus/ZoneEquipmentManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,14 @@ void updateZoneSizingEndZoneSizingCalc7(EnergyPlusData &state,
zoneSizing.DesCoolVolFlowNoOA = zoneSizing.DesCoolVolFlow;
zoneSizing.DesCoolMassFlowNoOA = zoneSizing.DesCoolMassFlow;
}
} else {
for (int DDNum = 1; DDNum <= state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays; ++DDNum) {
// initialize HeatFlowSeqNoOA before any adjustments to HeatFlowSeq
auto &zoneSizing = zsSizing(DDNum, zoneOrSpaceNum);
zoneSizing.CoolFlowSeqNoOA = zoneSizing.CoolFlowSeq;
zoneSizing.DesCoolVolFlowNoOA = zoneSizing.DesCoolVolFlow;
zoneSizing.DesCoolMassFlowNoOA = zoneSizing.DesCoolMassFlow;
}
}
// Save a set of design cooling air flow rates greater than or equal to the specified minimums without MinOA
{
Expand Down Expand Up @@ -2297,7 +2305,6 @@ void updateZoneSizingEndZoneSizingCalc7(EnergyPlusData &state,
zoneSizing.DesCoolMassFlowNoOA = MaxOfMinCoolMassFlowNoOA;
}
for (int TimeStepIndex = 1; TimeStepIndex <= state.dataZoneEquipmentManager->NumOfTimeStepInDay; ++TimeStepIndex) {
zoneSizing.CoolFlowSeqNoOA(TimeStepIndex) = zoneSizing.CoolFlowSeq(TimeStepIndex);
if (MaxOfMinCoolMassFlowNoOA > zoneSizing.CoolFlowSeq(TimeStepIndex)) {
zoneSizing.CoolFlowSeqNoOA(TimeStepIndex) = MaxOfMinCoolMassFlowNoOA;
}
Expand Down Expand Up @@ -2446,6 +2453,14 @@ void updateZoneSizingEndZoneSizingCalc7(EnergyPlusData &state,
zoneSizingDD.DesHeatVolFlowNoOA = zoneSizingDD.DesHeatVolFlow;
zoneSizingDD.DesHeatMassFlowNoOA = zoneSizingDD.DesHeatMassFlow;
}
} else {
for (int DDNum = 1; DDNum <= state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays; ++DDNum) {
// initialize HeatFlowSeqNoOA before any adjustments to HeatFlowSeq
auto &zoneSizing = zsSizing(DDNum, zoneOrSpaceNum);
zoneSizing.HeatFlowSeqNoOA = zoneSizing.HeatFlowSeq;
zoneSizing.DesHeatVolFlowNoOA = zoneSizing.DesHeatVolFlow;
zoneSizing.DesHeatMassFlowNoOA = zoneSizing.DesHeatMassFlow;
}
}

// Save a set of design heating air flow rates before the MinOA adjustment
Expand Down

5 comments on commit 0ec2e57

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

10375-TU-sizing-object (rraustad) - Win64-Windows-10-VisualStudio-16: OK (2758 of 2758 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

10375-TU-sizing-object (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3578 of 3586 tests passed, 6 test warnings)

Messages:\n

  • 9 tests had: EIO diffs.
  • 8 tests had: SSZ big diffs.
  • 3 tests had: Table big diffs.
  • 2 tests had: Table small diffs.

Failures:\n

regression Test Summary

  • Passed: 798
  • Failed: 8

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.

10375-TU-sizing-object (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (1971 of 1971 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

10375-TU-sizing-object (rraustad) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (790 of 790 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

10375-TU-sizing-object (rraustad) - x86_64-MacOS-10.18-clang-15.0.0: OK (3536 of 3545 tests passed, 6 test warnings)

Messages:\n

  • 9 tests had: EIO diffs.
  • 8 tests had: SSZ big diffs.
  • 3 tests had: Table big diffs.
  • 2 tests had: Table small diffs.
  • 1 test had: ERR diffs.

Failures:\n

regression Test Summary

  • Passed: 778
  • Failed: 8

Build Badge Test Badge

Please sign in to comment.