Skip to content

Commit

Permalink
Space HVAC - NonAirSysOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Aug 17, 2023
1 parent f30f250 commit a1e2fd3
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions src/EnergyPlus/ZoneEquipmentManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,6 @@ void SizeZoneEquipment(EnergyPlusData &state)
sizeZoneSpaceEquipmentPart1(state, zoneEquipConfig, calcZoneSizing, zoneSysEnergyDemand, zoneSysMoistureDemand, zone, ControlledZoneNum);
if (state.dataHeatBal->doSpaceHeatBalance) {
for (int spaceNum : state.dataHeatBal->Zone(ControlledZoneNum).spaceIndexes) {
// SpaceHB ToDo: For now allocate by space volume frac
sizeZoneSpaceEquipmentPart1(state,
zoneEquipConfig,
state.dataSize->CalcSpaceSizing(state.dataSize->CurOverallSimDay, spaceNum),
Expand All @@ -739,7 +738,6 @@ void SizeZoneEquipment(EnergyPlusData &state)
state, zoneEquipConfig, state.dataSize->CalcZoneSizing(state.dataSize->CurOverallSimDay, ControlledZoneNum), ControlledZoneNum);
if (state.dataHeatBal->doSpaceHeatBalance) {
for (int spaceNum : state.dataHeatBal->Zone(ControlledZoneNum).spaceIndexes) {
// SpaceHB ToDo: For now allocate by space volume frac
sizeZoneSpaceEquipmentPart2(
state, zoneEquipConfig, state.dataSize->CalcSpaceSizing(state.dataSize->CurOverallSimDay, spaceNum), ControlledZoneNum, spaceNum);
}
Expand Down Expand Up @@ -3112,11 +3110,11 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
// the type of system being simulated.
// 3. Calculate zone energy requirements

bool SupPathInletChanged(false);
Real64 SysOutputProvided; // sensible output delivered by zone equipment (W)
Real64 LatOutputProvided; // latent output delivered by zone equipment (kg/s)
Real64 AirSysOutput;
Real64 NonAirSysOutput;
bool SupPathInletChanged = false;
Real64 SysOutputProvided = 0.0; // sensible output delivered by zone equipment (W)
Real64 LatOutputProvided = 0.0; // latent output delivered by zone equipment (kg/s)
Real64 AirSysOutput = 0.0;
Real64 NonAirSysOutput = 0.0;

// Determine flow rate and temperature of supply air based on type of damper

Expand Down Expand Up @@ -3195,12 +3193,13 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
zoneEquipConfig.ZoneExhBalanced = 0.0;
zoneEquipConfig.PlenumMassFlow = 0.0;
state.dataSize->CurZoneEqNum = ControlledZoneNum;
if (state.dataHeatBal->doSpaceHeatBalanceSimulation && !state.dataGlobal->SysSizingCalc) {
if (state.dataHeatBal->doSpaceHeatBalanceSimulation && !state.dataGlobal->DoingSizing) {
for (int spaceNum : state.dataHeatBal->Zone(ControlledZoneNum).spaceIndexes) {
auto &thisSpaceHB = state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum);
thisSpaceHB.NonAirSystemResponse = 0.0;
thisSpaceHB.SysDepZoneLoads = 0.0;
auto &thisSpaceEquipConfig = state.dataZoneEquip->spaceEquipConfig(spaceNum);
if (!thisSpaceEquipConfig.IsControlled) continue;
thisSpaceEquipConfig.ZoneExh = 0.0;
thisSpaceEquipConfig.ZoneExhBalanced = 0.0;
thisSpaceEquipConfig.PlenumMassFlow = 0.0;
Expand All @@ -3222,6 +3221,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
const int EquipPtr = state.dataZoneEquipmentManager->PrioritySimOrder(EquipTypeNum).EquipPtr;
SysOutputProvided = 0.0;
LatOutputProvided = 0.0;
NonAirSysOutput = 0.0;
state.dataSize->DataCoolCoilCap = 0.0; // reset global variable used only for heat pumps (i.e., DX cooling and heating coils)

// Reset ZoneEqSizing data (because these may change from one equipment type to the next)
Expand Down Expand Up @@ -3295,7 +3295,6 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
ControlledZoneNum,
zoneEquipList.EquipIndex(EquipPtr));

thisZoneHB.NonAirSystemResponse += NonAirSysOutput;
SysOutputProvided = NonAirSysOutput + AirSysOutput;
} break;

Expand Down Expand Up @@ -3416,7 +3415,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
SysOutputProvided,
zoneEquipList.EquipIndex(EquipPtr));

thisZoneHB.NonAirSystemResponse += SysOutputProvided;
NonAirSysOutput = SysOutputProvided;
LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat
} break;

Expand All @@ -3428,7 +3427,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
SysOutputProvided,
zoneEquipList.EquipIndex(EquipPtr));

thisZoneHB.NonAirSystemResponse += SysOutputProvided;
NonAirSysOutput = SysOutputProvided;
LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat
} break;

Expand All @@ -3440,7 +3439,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
SysOutputProvided,
zoneEquipList.EquipIndex(EquipPtr));

thisZoneHB.NonAirSystemResponse += SysOutputProvided;
NonAirSysOutput = SysOutputProvided;
LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat
} break;

Expand All @@ -3451,7 +3450,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
SysOutputProvided,
zoneEquipList.EquipIndex(EquipPtr));

thisZoneHB.NonAirSystemResponse += SysOutputProvided;
NonAirSysOutput = SysOutputProvided;
LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat
} break;

Expand All @@ -3463,7 +3462,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
SysOutputProvided,
zoneEquipList.EquipIndex(EquipPtr));

thisZoneHB.NonAirSystemResponse += SysOutputProvided;
NonAirSysOutput = SysOutputProvided;
LatOutputProvided = 0.0; // This cooling panel does not add/remove any latent heat
} break;

Expand Down Expand Up @@ -3562,7 +3561,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
SysOutputProvided,
zoneEquipList.EquipIndex(EquipPtr));

thisZoneHB.NonAirSystemResponse += SysOutputProvided;
NonAirSysOutput = SysOutputProvided;
LatOutputProvided = 0.0; // This baseboard does not add/remove any latent heat
} break;

Expand All @@ -3575,7 +3574,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
LatOutputProvided,
zoneEquipList.EquipIndex(EquipPtr));

thisZoneHB.NonAirSystemResponse += SysOutputProvided;
NonAirSysOutput = SysOutputProvided;
} break;

case ZoneEquipType::UserDefinedHVACForcedAir: {
Expand Down Expand Up @@ -3626,12 +3625,13 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
}

// If SpaceHVAC is active and this equipment has a space splitter, distribute the equipment output and update the spaces
if (state.dataHeatBal->doSpaceHeatBalanceSimulation && !state.dataGlobal->SysSizingCalc &&
if (state.dataHeatBal->doSpaceHeatBalanceSimulation && !state.dataGlobal->DoingSizing &&
zoneEquipList.zoneEquipSplitterIndex(EquipPtr) > -1) {
auto &thisZeqSplitter = state.dataZoneEquip->zoneEquipSplitter[zoneEquipList.zoneEquipSplitterIndex(EquipPtr)];
for (auto &space : thisZeqSplitter.spaces) {
Real64 spaceSysOutputProvided = SysOutputProvided * space.outputFraction;
Real64 spaceLatOutputProvided = LatOutputProvided * space.outputFraction;
state.dataZoneTempPredictorCorrector->spaceHeatBalance(space.spaceIndex).NonAirSystemResponse += NonAirSysOutput;
if (thisZeqSplitter.zoneEquipOutletNodeNum > 0 && space.spaceInletNodeNum > 0) {
auto &equipOutletNode = state.dataLoopNodes->Node(thisZeqSplitter.zoneEquipOutletNodeNum);
auto &spaceInletNode = state.dataLoopNodes->Node(space.spaceInletNodeNum);
Expand All @@ -3650,6 +3650,8 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool
state.dataZoneEnergyDemand->spaceSysMoistureDemand(space.spaceIndex),
EquipTypeNum);
}
} else {
thisZoneHB.NonAirSystemResponse += NonAirSysOutput;
}
// Space HVAC TODO: For now, update both spaces and zone, but ultimately update one or the other
updateSystemOutputRequired(state,
Expand All @@ -3662,14 +3664,7 @@ void SimZoneEquipment(EnergyPlusData &state, bool const FirstHVACIteration, bool

state.dataSize->CurTermUnitSizingNum = 0;
} // zone equipment loop
if (state.dataHeatBal->doSpaceHeatBalance) {
for (int spaceNum : state.dataHeatBal->Zone(ControlledZoneNum).spaceIndexes) {
// SpaceHB ToDo: For now allocate by space volume frac
state.dataZoneTempPredictorCorrector->spaceHeatBalance(spaceNum).NonAirSystemResponse =
thisZoneHB.NonAirSystemResponse * state.dataHeatBal->space(spaceNum).fracZoneVolume;
}
}
} // End of controlled zone loop
} // End of controlled zone loop
state.dataSize->CurZoneEqNum = 0;
state.dataZoneEquipmentManager->FirstPassZoneEquipFlag = false;

Expand Down

5 comments on commit a1e2fd3

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

SpaceSizingHVAC (mjwitte) - Win64-Windows-10-VisualStudio-16: OK (2682 of 2682 tests passed, 0 test warnings)

Build Badge Test 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.

SpaceSizingHVAC (mjwitte) - x86_64-MacOS-10.17-clang-13.0.0: OK (3431 of 3459 tests passed, 746 test warnings)

Messages:\n

  • 746 tests had: AUD diffs.
  • 1 test had: BND diffs.
  • 2 tests had: EIO diffs.
  • 1 test had: MTD diffs.

Failures:\n

regression Test Summary

  • Passed: 748
  • Failed: 28

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.

SpaceSizingHVAC (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3472 of 3500 tests passed, 750 test warnings)

Messages:\n

  • 750 tests had: AUD diffs.
  • 1 test had: BND diffs.
  • 2 tests had: EIO diffs.
  • 1 test had: MTD diffs.

Failures:\n

regression Test Summary

  • Passed: 768
  • Failed: 28

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

SpaceSizingHVAC (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (1905 of 1905 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.

SpaceSizingHVAC (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (780 of 780 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.