Skip to content

Commit

Permalink
Merge pull request #7872 from NREL/fix-window-heat-emission
Browse files Browse the repository at this point in the history
Fix heat emission HVAC relief and rejection output:variable reported values
  • Loading branch information
Myoldmopar authored Apr 23, 2020
2 parents b34ffe7 + d043eb1 commit 19bcad6
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 42 deletions.
34 changes: 28 additions & 6 deletions src/EnergyPlus/HVACManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,12 @@ namespace HVACManager {

UpdateInternalGainValues(true, true);

ManageZoneAirUpdates(iPredictStep, ZoneTempChange, ShortenTimeStepSys, UseZoneTimeStepHistory, PriorTimeStep);
ManageZoneAirUpdates(iPredictStep, ZoneTempChange, ShortenTimeStepSys, UseZoneTimeStepHistory,
PriorTimeStep);

if (Contaminant.SimulateContaminants)
ManageZoneContaminanUpdates(iPredictStep, ShortenTimeStepSys, UseZoneTimeStepHistory, PriorTimeStep);
ManageZoneContaminanUpdates(iPredictStep, ShortenTimeStepSys, UseZoneTimeStepHistory,
PriorTimeStep);
SimHVAC();

if (AnyIdealCondEntSetPointInModel && MetersHaveBeenInitialized && !WarmupFlag) {
Expand All @@ -473,13 +475,17 @@ namespace HVACManager {
// Need to set the flag back since we do not need to shift the temps back again in the correct step.
ShortenTimeStepSys = false;

ManageZoneAirUpdates(iCorrectStep, ZoneTempChange, ShortenTimeStepSys, UseZoneTimeStepHistory, PriorTimeStep);
ManageZoneAirUpdates(iCorrectStep, ZoneTempChange, ShortenTimeStepSys, UseZoneTimeStepHistory,
PriorTimeStep);
if (Contaminant.SimulateContaminants)
ManageZoneContaminanUpdates(iCorrectStep, ShortenTimeStepSys, UseZoneTimeStepHistory, PriorTimeStep);
ManageZoneContaminanUpdates(iCorrectStep, ShortenTimeStepSys, UseZoneTimeStepHistory,
PriorTimeStep);

ManageZoneAirUpdates(iPushSystemTimestepHistories, ZoneTempChange, ShortenTimeStepSys, UseZoneTimeStepHistory, PriorTimeStep);
ManageZoneAirUpdates(iPushSystemTimestepHistories, ZoneTempChange, ShortenTimeStepSys,
UseZoneTimeStepHistory, PriorTimeStep);
if (Contaminant.SimulateContaminants)
ManageZoneContaminanUpdates(iPushSystemTimestepHistories, ShortenTimeStepSys, UseZoneTimeStepHistory, PriorTimeStep);
ManageZoneContaminanUpdates(iPushSystemTimestepHistories, ShortenTimeStepSys,
UseZoneTimeStepHistory, PriorTimeStep);
PreviousTimeStep = TimeStepSys;
}

Expand Down Expand Up @@ -507,6 +513,10 @@ namespace HVACManager {
// Update the plant and condenser loop capacitance model temperature history.
UpdateNodeThermalHistory();

if (OutputReportTabular::displayHeatEmissionsSummary) {
OutputReportTabular::CalcHeatEmissionReport();
}

ManageEMS(emsCallFromEndSystemTimestepBeforeHVACReporting, anyEMSRan); // EMS calling point

// This is where output processor data is updated for System Timestep reporting
Expand Down Expand Up @@ -810,6 +820,18 @@ namespace HVACManager {
if (!SimHVACIterSetup) {
SetupOutputVariable("HVAC System Solver Iteration Count", OutputProcessor::Unit::None, HVACManageIteration, "HVAC", "Sum", "SimHVAC");
SetupOutputVariable("Air System Solver Iteration Count", OutputProcessor::Unit::None, RepIterAir, "HVAC", "Sum", "SimHVAC");
SetupOutputVariable("Air System Relief Air Total Heat Loss Energy",
OutputProcessor::Unit::J,
DataHeatBalance::SysTotalHVACReliefHeatLoss,
"HVAC",
"Sum",
"SimHVAC");
SetupOutputVariable("HVAC System Total Heat Rejection Energy",
OutputProcessor::Unit::J,
DataHeatBalance::SysTotalHVACRejectHeatLoss,
"HVAC",
"Sum",
"SimHVAC");
ManageSetPoints(); // need to call this before getting plant loop data so setpoint checks can complete okay
GetPlantLoopData();
GetPlantInput();
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HeatBalanceSurfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ namespace HeatBalanceSurfaceManager {
Surface(SurfNum).WindDir = Node(Surface(SurfNum).LinkedOutAirNode).OutAirWindDir;
}

if (Surface(SurfNum).HasSurroundingSurfProperties) {
if (InitSurfaceHeatBalancefirstTime && Surface(SurfNum).HasSurroundingSurfProperties) {
SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum;
SrdSurfsViewFactor = 0;
if (SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor >= 0) {
Expand Down
64 changes: 42 additions & 22 deletions src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4789,6 +4789,45 @@ namespace OutputReportTabular {
// The routine generates an annual table with the following columns which correspond to
// the output variables and data structures shown.

// Using/Aliasing
using DataGlobals::convertJtoGJ;
using DataHeatBalance::BuildingPreDefRep;

using DataHeatBalance::ZoneTotalExfiltrationHeatLoss;
using DataHeatBalance::ZoneTotalExhaustHeatLoss;
using DataHeatBalSurface::SumSurfaceHeatEmission;

using DataHVACGlobals::TimeStepSys;

SysTotalHVACReliefHeatLoss = 0;
SysTotalHVACRejectHeatLoss = 0;

if (!displayHeatEmissionsSummary) return; // don't gather data if report isn't requested

// Only gather zone report at zone time steps
if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) {
BuildingPreDefRep.emiEnvelopConv += SumSurfaceHeatEmission * convertJtoGJ;
return;
}

CalcHeatEmissionReport();
BuildingPreDefRep.emiZoneExfiltration += ZoneTotalExfiltrationHeatLoss * convertJtoGJ;
BuildingPreDefRep.emiZoneExhaust += ZoneTotalExhaustHeatLoss * convertJtoGJ;
BuildingPreDefRep.emiHVACRelief += SysTotalHVACReliefHeatLoss * convertJtoGJ;
BuildingPreDefRep.emiHVACReject += SysTotalHVACRejectHeatLoss * convertJtoGJ;

BuildingPreDefRep.emiTotHeat = BuildingPreDefRep.emiEnvelopConv + BuildingPreDefRep.emiZoneExfiltration + BuildingPreDefRep.emiZoneExhaust +
BuildingPreDefRep.emiHVACRelief + BuildingPreDefRep.emiHVACReject;
}


void CalcHeatEmissionReport()
{
// PURPOSE OF THIS SUBROUTINE:
// Gathers the data each zone timestep for the heat gain report.
// The routine generates an annual table with the following columns which correspond to
// the output variables and data structures shown.

// Using/Aliasing
using Boilers::Boiler;
using Boilers::NumBoilers;
Expand All @@ -4807,7 +4846,6 @@ namespace OutputReportTabular {
using DataHeatBalance::SysTotalHVACReliefHeatLoss;
using DataHeatBalance::ZoneTotalExfiltrationHeatLoss;
using DataHeatBalance::ZoneTotalExhaustHeatLoss;
using DataHeatBalSurface::SumSurfaceHeatEmission;
using DataHVACGlobals::AirCooled;
using DataHVACGlobals::EvapCooled;
using DataHVACGlobals::TimeStepSys;
Expand Down Expand Up @@ -4855,23 +4893,10 @@ namespace OutputReportTabular {
SysTotalHVACReliefHeatLoss = 0;
SysTotalHVACRejectHeatLoss = 0;

if (!displayHeatEmissionsSummary) return; // don't gather data if report isn't requested

// Only gather zone report at zone time steps
if (t_timeStepType == OutputProcessor::TimeStepType::TimeStepZone) {
BuildingPreDefRep.emiEnvelopConv += SumSurfaceHeatEmission * convertJtoGJ;
return;
}

BuildingPreDefRep.emiZoneExfiltration += ZoneTotalExfiltrationHeatLoss * convertJtoGJ;

BuildingPreDefRep.emiZoneExhaust += ZoneTotalExhaustHeatLoss * convertJtoGJ;

// HVAC relief air
for (iOACtrl = 1; iOACtrl <= NumOAControllers; ++iOACtrl) {
SysTotalHVACReliefHeatLoss += OAController(iOACtrl).RelTotalLossRate * TimeStepSysSec;
}
BuildingPreDefRep.emiHVACRelief += SysTotalHVACReliefHeatLoss * convertJtoGJ;

// Condenser water loop
for (iCooler = 1; iCooler <= NumSimpleTowers; ++iCooler) {
Expand All @@ -4893,17 +4918,17 @@ namespace OutputReportTabular {
}
for (iChiller = 1; iChiller <= NumEngineDrivenChillers; ++iChiller) {
if (EngineDrivenChiller(iChiller).CondenserType != WaterCooled) {
SysTotalHVACRejectHeatLoss += ElectricChiller(iChiller).CondenserEnergy;
SysTotalHVACRejectHeatLoss += EngineDrivenChiller(iChiller).CondenserEnergy;
}
}
for (iChiller = 1; iChiller <= NumGTChillers; ++iChiller) {
if (GTChiller(iChiller).CondenserType != WaterCooled) {
SysTotalHVACRejectHeatLoss += ElectricChiller(iChiller).CondenserEnergy;
SysTotalHVACRejectHeatLoss += GTChiller(iChiller).CondenserEnergy;
}
}
for (iChiller = 1; iChiller <= NumConstCOPChillers; ++iChiller) {
if (ConstCOPChiller(iChiller).CondenserType != WaterCooled) {
SysTotalHVACRejectHeatLoss += ElectricChiller(iChiller).CondenserEnergy;
SysTotalHVACRejectHeatLoss += ConstCOPChiller(iChiller).CondenserEnergy;
}
}
for (iChiller = 1; iChiller <= NumElectricEIRChillers; ++iChiller) {
Expand Down Expand Up @@ -5022,11 +5047,6 @@ namespace OutputReportTabular {
for (iCooler = 1; iCooler <= NumEvapCool; ++iCooler) {
SysTotalHVACRejectHeatLoss += EvapCond(iCooler).EvapWaterConsump * RhoWater * H2OHtOfVap_HVAC + EvapCond(iCooler).EvapCoolerEnergy;
}

BuildingPreDefRep.emiHVACReject += SysTotalHVACRejectHeatLoss * convertJtoGJ;

BuildingPreDefRep.emiTotHeat = BuildingPreDefRep.emiEnvelopConv + BuildingPreDefRep.emiZoneExfiltration + BuildingPreDefRep.emiZoneExhaust +
BuildingPreDefRep.emiHVACRelief + BuildingPreDefRep.emiHVACReject;
}

void GatherHeatGainReport(OutputProcessor::TimeStepType t_timeStepType) // What kind of data to update (Zone, HVAC)
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/OutputReportTabular.hh
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,8 @@ namespace OutputReportTabular {

void GatherHeatEmissionReport(OutputProcessor::TimeStepType t_timeStepType);

void CalcHeatEmissionReport();

//======================================================================================================================
//======================================================================================================================

Expand Down
12 changes: 0 additions & 12 deletions src/EnergyPlus/SystemReports.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2283,18 +2283,6 @@ namespace SystemReports {
PrimaryAirSystem(SysIndex).Name);
}
}
SetupOutputVariable("Air System Relief Air Total Heat Loss Energy",
OutputProcessor::Unit::J,
DataHeatBalance::SysTotalHVACReliefHeatLoss,
"HVAC",
"Sum",
"SimHVAC");
SetupOutputVariable("HVAC System Total Heat Rejection Energy",
OutputProcessor::Unit::J,
DataHeatBalance::SysTotalHVACRejectHeatLoss,
"HVAC",
"Sum",
"SimHVAC");
for (ZoneIndex = 1; ZoneIndex <= NumOfZones; ++ZoneIndex) {
if (!ZoneEquipConfig(ZoneIndex).IsControlled) continue;
// CurrentModuleObject='Zones(Controlled)'
Expand Down
3 changes: 2 additions & 1 deletion src/EnergyPlus/WindowManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2944,6 +2944,7 @@ namespace WindowManager {
if (AnyLocalEnvironmentsInModel) {
if (Surface(SurfNum).HasSurroundingSurfProperties) {
SrdSurfsNum = Surface(SurfNum).SurroundingSurfacesNum;

if (SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor != -1) {
surface.ViewFactorSkyIR = SurroundingSurfsProperty(SrdSurfsNum).SkyViewFactor;
}
Expand All @@ -2954,7 +2955,7 @@ namespace WindowManager {
SrdSurfViewFac = SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).ViewFactor;
SrdSurfTempAbs =
GetCurrentScheduleValue(SurroundingSurfsProperty(SrdSurfsNum).SurroundingSurfs(SrdSurfNum).TempSchNum) + KelvinConv;
OutSrdIR += sigma * SrdSurfViewFac * (pow_4(SrdSurfTempAbs));
OutSrdIR += sigma * SrdSurfViewFac * pow_4(SrdSurfTempAbs);
}
}
}
Expand Down

6 comments on commit 19bcad6

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-custom_check: OK (12 of 12 tests passed, 0 test warnings)

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-cppcheck: OK (0 of 0 tests passed, 0 test warnings)

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2083 of 2083 tests passed, 0 test warnings)

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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1367 of 1367 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.

develop (Myoldmopar) - x86_64-MacOS-10.13-clang: OK (2062 of 2063 tests passed, 0 test warnings)

Failures:\n

EnergyPlusFixture Test Summary

  • Passed: 928
  • Failed: 1

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.

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (699 of 699 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please # to comment.