Skip to content

Commit

Permalink
Zone Air Flow Balance Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nigusse committed Feb 8, 2021
1 parent 8a91adc commit c8d6359
Showing 1 changed file with 20 additions and 32 deletions.
52 changes: 20 additions & 32 deletions src/EnergyPlus/ZoneEquipmentManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3830,12 +3830,7 @@ namespace EnergyPlus::ZoneEquipmentManager {

using DataLoopNode::Node;
using namespace DataRoomAirModel; // UCSD
using DataHeatBalance::AddInfiltrationFlow;
using DataHeatBalance::AdjustInfiltrationFlow;
using DataHeatBalance::AllZones;
using DataHeatBalance::Infiltration;
using DataHeatBalance::MassConservation;
using DataHeatBalance::NoInfiltrationFlow;
using DataHeatBalance::Zone;
using DataHeatBalance::ZoneAirMassFlow;
using DataHeatBalFanSys::MixingMassFlowZone;
Expand Down Expand Up @@ -5566,29 +5561,29 @@ namespace EnergyPlus::ZoneEquipmentManager {
// This subroutine updates the receiving zone mixing flow rate to ensures the zone
// air mass balance.

// Using/Aliasing
using DataHeatBalance::MassConservation;
using DataHeatBalance::Mixing;
using DataHeatBalance::TotMixing;
using DataHeatBalFanSys::MixingMassFlowZone;

int Loop;
int MixingNum;
int NumOfReceivingZoneMixingObjects;
Real64 MixingMassFlowRate; // current zone mixing mass flow rate, [kg/s]

MixingMassFlowRate = 0.0;
// distribute the total zone mixing flow rate to the source zones
NumOfReceivingZoneMixingObjects = MassConservation(ZoneNum).NumReceivingZonesMixingObject;
NumOfReceivingZoneMixingObjects = DataHeatBalance::MassConservation(ZoneNum).NumReceivingZonesMixingObject;
if (NumOfReceivingZoneMixingObjects > 0) {
for (Loop = 1; Loop <= NumOfReceivingZoneMixingObjects; ++Loop) {
MixingNum = MassConservation(ZoneNum).ZoneMixingReceivingPtr(Loop);
Mixing(MixingNum).MixingMassFlowRate = MassConservation(ZoneNum).ZoneMixingReceivingFr(Loop) * ZoneMixingMassFlowRate;
MixingMassFlowRate += Mixing(MixingNum).MixingMassFlowRate;
CalcZoneMixingFlowRateOfSourceZone(Mixing(MixingNum).FromZone);
if (DataHeatBalance::ZoneAirMassFlow.BalanceMixing) {
// distribute the total zone mixing flow rate to the source zones
for (Loop = 1; Loop <= NumOfReceivingZoneMixingObjects; ++Loop) {
MixingNum = DataHeatBalance::MassConservation(ZoneNum).ZoneMixingReceivingPtr(Loop);
DataHeatBalance::Mixing(MixingNum).MixingMassFlowRate = DataHeatBalance::MassConservation(ZoneNum).ZoneMixingReceivingFr(Loop) * ZoneMixingMassFlowRate;
MixingMassFlowRate += DataHeatBalance::Mixing(MixingNum).MixingMassFlowRate;
CalcZoneMixingFlowRateOfSourceZone(DataHeatBalance::Mixing(MixingNum).FromZone);
}
} else {
// adjust zone return node air flow
// DataHeatBalance::ZoneAirMassFlow.AdjustZoneReturnFlow

}
}
MassConservation(ZoneNum).MixingMassFlowRate = MixingMassFlowRate;
DataHeatBalance::MassConservation(ZoneNum).MixingMassFlowRate = MixingMassFlowRate;
ZoneMixingMassFlowRate = MixingMassFlowRate;
}

Expand All @@ -5604,33 +5599,26 @@ namespace EnergyPlus::ZoneEquipmentManager {
// PURPOSE OF THIS SUBROUTINE:
// This subroutine calculates the zone mixing flow rate such that it ensures the zone
// air mass balance.

// Using/Aliasing
using DataHeatBalance::MassConservation;
using DataHeatBalance::Mixing;
using DataHeatBalance::TotMixing;
using DataHeatBalance::Zone;
using DataHeatBalFanSys::MixingMassFlowZone;

;
int Loop;
int MixingNum;
int ZoneMixingNum;
int NumOfSourceZoneMixingObjects;
Real64 ZoneSourceMassFlowRate; // current zone as a source mass flow rate for zone mixing in other zones, [kg/s]

ZoneSourceMassFlowRate = 0.0;
NumOfSourceZoneMixingObjects = MassConservation(ZoneNum).NumSourceZonesMixingObject;
NumOfSourceZoneMixingObjects = DataHeatBalance::MassConservation(ZoneNum).NumSourceZonesMixingObject;
if (NumOfSourceZoneMixingObjects > 0) {
for (ZoneMixingNum = 1; ZoneMixingNum <= NumOfSourceZoneMixingObjects; ++ZoneMixingNum) {
MixingNum = MassConservation(ZoneNum).ZoneMixingSourcesPtr(ZoneMixingNum);
for (Loop = 1; Loop <= TotMixing; ++Loop) {
MixingNum = DataHeatBalance::MassConservation(ZoneNum).ZoneMixingSourcesPtr(ZoneMixingNum);
for (Loop = 1; Loop <= DataHeatBalance::TotMixing; ++Loop) {
if (Loop == MixingNum) {
ZoneSourceMassFlowRate += Mixing(Loop).MixingMassFlowRate;
ZoneSourceMassFlowRate += DataHeatBalance::Mixing(Loop).MixingMassFlowRate;
}
}
}
}
MassConservation(ZoneNum).MixingSourceMassFlowRate = ZoneSourceMassFlowRate;
DataHeatBalance::MassConservation(ZoneNum).MixingSourceMassFlowRate = ZoneSourceMassFlowRate;
}

void AutoCalcDOASControlStrategy(EnergyPlusData &state)
Expand Down

4 comments on commit c8d6359

@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.

176230951_AirTransferModel (Unknown) - x86_64-MacOS-10.15-clang-11.0.0: OK (2996 of 2996 tests passed, 2 test warnings)

Messages:\n

  • 2 tests had: EIO diffs.

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.

176230951_AirTransferModel (Unknown) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (3035 of 3036 tests passed, 2 test warnings)

Messages:\n

  • 3 tests had: EIO diffs.
  • 1 test had: ESO small diffs.
  • 1 test had: MTR small diffs.
  • 1 test had: Table big diffs.

Failures:\n

regression Test Summary

  • Passed: 736
  • Failed: 1

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.

176230951_AirTransferModel (Unknown) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1560 of 1560 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.

176230951_AirTransferModel (Unknown) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (722 of 722 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.