Skip to content

Commit

Permalink
Space IV.6 - fix ZoneRefrigerationDoorMixing diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Sep 23, 2024
1 parent a9a35c9 commit 634d933
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/EnergyPlus/HVACManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2602,12 +2602,12 @@ void reportAirHeatBal2(EnergyPlusData &state,
if (refDoorMixing.VolRefDoorFlowRate(j) > 0.0) {
// int ZoneB = refDoorMixing.MateZonePtr(j);
// auto const &zoneBHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneB);
Real64 const szBMAT = (refDoorMixing.spaceIndex == 0)
? state.dataZoneTempPredictorCorrector->zoneHeatBalance(refDoorMixing.ZonePtr).MAT
: state.dataZoneTempPredictorCorrector->spaceHeatBalance(refDoorMixing.spaceIndex).MAT;
Real64 const szBMAT = (refDoorMixing.fromSpaceIndex == 0)
? state.dataZoneTempPredictorCorrector->zoneHeatBalance(refDoorMixing.MateZonePtr(j)).MAT
: state.dataZoneTempPredictorCorrector->spaceHeatBalance(refDoorMixing.fromSpaceIndex).MAT;
Real64 const szBHumRat = (refDoorMixing.fromSpaceIndex == 0)
? state.dataZoneTempPredictorCorrector->zoneHeatBalance(refDoorMixing.ZonePtr).airHumRat
: state.dataZoneTempPredictorCorrector->spaceHeatBalance(refDoorMixing.spaceIndex).airHumRat;
? state.dataZoneTempPredictorCorrector->zoneHeatBalance(refDoorMixing.MateZonePtr(j)).airHumRat
: state.dataZoneTempPredictorCorrector->spaceHeatBalance(refDoorMixing.fromSpaceIndex).airHumRat;
AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(state,
state.dataEnvrn->OutBaroPress,
(szHeatBal.MAT + szBMAT) / 2.0,
Expand All @@ -2629,22 +2629,28 @@ void reportAirHeatBal2(EnergyPlusData &state,
} // zone A (zoneptr = zoneNum)
for (int ZoneA = 1; ZoneA <= (zoneNum - 1); ++ZoneA) {
auto &refDoorMixingA = state.dataHeatBal->RefDoorMixing(ZoneA);
auto const &zoneAHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneA);
// Capture impact when zoneNum is the 'mating zone'
// that is, the zone of a pair with the higher zone number(matezoneptr = zoneNum)
if (refDoorMixingA.RefDoorMixFlag) {
for (int j = 1; j <= refDoorMixingA.NumRefDoorConnections; ++j) {
if (((spaceNum == 0) && (refDoorMixingA.MateZonePtr(j) == zoneNum)) ||
((spaceNum == 0) && (refDoorMixingA.fromSpaceIndex == spaceNum))) {
if (refDoorMixingA.VolRefDoorFlowRate(j) > 0.0) {
// auto const &zoneAHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneA);
Real64 const szAMAT = (refDoorMixingA.spaceIndex == 0)
? state.dataZoneTempPredictorCorrector->zoneHeatBalance(refDoorMixingA.ZonePtr).MAT
: state.dataZoneTempPredictorCorrector->spaceHeatBalance(refDoorMixingA.spaceIndex).MAT;
Real64 const szAHumRat =
(refDoorMixingA.spaceIndex == 0)
? state.dataZoneTempPredictorCorrector->zoneHeatBalance(refDoorMixingA.ZonePtr).airHumRat
: state.dataZoneTempPredictorCorrector->spaceHeatBalance(refDoorMixingA.spaceIndex).airHumRat;
AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(state,
state.dataEnvrn->OutBaroPress,
(szHeatBal.MAT + zoneAHB.MAT) / 2.0,
(szHeatBal.airHumRat + zoneAHB.airHumRat) / 2.0,
(szHeatBal.MAT + szAMAT) / 2.0,
(szHeatBal.airHumRat + szAHumRat) / 2.0,
std::string());
CpAir = Psychrometrics::PsyCpAirFnW((szHeatBal.airHumRat + zoneAHB.airHumRat) / 2.0);
H2OHtOfVap = Psychrometrics::PsyHgAirFnWTdb((szHeatBal.airHumRat + zoneAHB.airHumRat) / 2.0,
(szHeatBal.MAT + zoneAHB.MAT) / 2.0);
CpAir = Psychrometrics::PsyCpAirFnW((szHeatBal.airHumRat + szAHumRat) / 2.0);
H2OHtOfVap = Psychrometrics::PsyHgAirFnWTdb((szHeatBal.airHumRat + szAHumRat) / 2.0, (szHeatBal.MAT + szAMAT) / 2.0);
szAirRpt.MixVolume +=
refDoorMixingA.VolRefDoorFlowRate(j) * state.dataHVACGlobal->TimeStepSysSec * ADSCorrectionFactor;
szAirRpt.MixVdotCurDensity += refDoorMixingA.VolRefDoorFlowRate(j) * ADSCorrectionFactor;
Expand All @@ -2653,9 +2659,9 @@ void reportAirHeatBal2(EnergyPlusData &state,
szAirRpt.MixMdot += refDoorMixingA.VolRefDoorFlowRate(j) * AirDensity * ADSCorrectionFactor;
szAirRpt.MixVdotStdDensity +=
refDoorMixingA.VolRefDoorFlowRate(j) * (AirDensity / state.dataEnvrn->StdRhoAir) * ADSCorrectionFactor;
szAirRpt.MixSenLoad += refDoorMixingA.VolRefDoorFlowRate(j) * AirDensity * CpAir * (szHeatBal.MAT - zoneAHB.MAT);
szAirRpt.MixSenLoad += refDoorMixingA.VolRefDoorFlowRate(j) * AirDensity * CpAir * (szHeatBal.MAT - szAMAT);
szAirRpt.MixLatLoad +=
refDoorMixingA.VolRefDoorFlowRate(j) * AirDensity * (szHeatBal.airHumRat - zoneAHB.airHumRat) * H2OHtOfVap;
refDoorMixingA.VolRefDoorFlowRate(j) * AirDensity * (szHeatBal.airHumRat - szAHumRat) * H2OHtOfVap;
} // volflowrate > 0
} // matezoneptr (zoneB) = Zonelooop
} // NumRefDoorConnections
Expand Down

4 comments on commit 634d933

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

spaceCompLoads (mjwitte) - Win64-Windows-10-VisualStudio-16: Tests Failed (0 of 0 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.

spaceCompLoads (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (2913 of 2913 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.

spaceCompLoads (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-RelWithDebInfo: OK (2097 of 2097 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.

spaceCompLoads (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-RelWithDebInfo: OK (799 of 799 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.