Skip to content

Commit

Permalink
Space IV.6 - unwind 3D comp loads arrays fix fenestration
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Sep 23, 2024
1 parent 5aa85e3 commit 9d8ee71
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
45 changes: 31 additions & 14 deletions src/EnergyPlus/OutputReportTabular.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14711,14 +14711,27 @@ void GatherComponentLoadsSurface(EnergyPlusData &state)
auto &day = zoneCL.day[state.dataSize->CurOverallSimDay - 1];
day.ts[timeStepInDayGCLS - 1].feneCondInstantSeq = 0.0;
}
if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
for (auto &spaceCL : ort->spCompLoads) {
auto &day = spaceCL.day[state.dataSize->CurOverallSimDay - 1];
day.ts[timeStepInDayGCLS - 1].feneCondInstantSeq = 0.0;
}
}
for (int iSurfGCLS = 1; iSurfGCLS <= state.dataSurface->TotSurfaces; ++iSurfGCLS) {
int zoneNumGCLS = state.dataSurface->Surface(iSurfGCLS).Zone;
if (zoneNumGCLS == 0) continue;
if (state.dataSurface->Surface(iSurfGCLS).Class != DataSurfaces::SurfaceClass::Window) continue;
// IF (.not. ZoneEquipConfig(ZoneNum)%IsControlled) CYCLE
ort->znCompLoads[zoneNumGCLS - 1].day[state.dataSize->CurOverallSimDay - 1].ts[timeStepInDayGCLS - 1].feneCondInstantSeq +=
state.dataSurface->SurfWinGainConvGlazToZoneRep(iSurfGCLS) + state.dataSurface->SurfWinConvHeatFlowNatural(iSurfGCLS) +
state.dataSurface->SurfWinGainConvShadeToZoneRep(iSurfGCLS) + state.dataSurface->SurfWinGainFrameDividerToZoneRep(iSurfGCLS);
Real64 surfCond = state.dataSurface->SurfWinGainConvGlazToZoneRep(iSurfGCLS) + state.dataSurface->SurfWinConvHeatFlowNatural(iSurfGCLS) +
state.dataSurface->SurfWinGainConvShadeToZoneRep(iSurfGCLS) +
state.dataSurface->SurfWinGainFrameDividerToZoneRep(iSurfGCLS);
ort->znCompLoads[zoneNumGCLS - 1].day[state.dataSize->CurOverallSimDay - 1].ts[timeStepInDayGCLS - 1].feneCondInstantSeq += surfCond;

if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
int spaceNum = state.dataSurface->Surface(iSurfGCLS).spaceNum;
ort->spCompLoads[spaceNum - 1].day[state.dataSize->CurOverallSimDay - 1].ts[timeStepInDayGCLS - 1].feneCondInstantSeq += surfCond;
}

// for now assume zero instant solar - may change related
// to how blinds and shades absorb solar radiation and
// convect that heat that timestep.
Expand All @@ -14728,8 +14741,18 @@ void GatherComponentLoadsSurface(EnergyPlusData &state)
for (int izone = 1; izone <= state.dataGlobal->NumOfZones; ++izone) {
Real64 tubularGain = 0.0;
tubularGain = InternalHeatGains::SumInternalConvectionGainsByTypes(state, izone, OutputReportTabular::IntGainTypesTubularGCLS);
Real64 fenCISeq = ort->znCompLoads[izone - 1].day[state.dataSize->CurOverallSimDay - 1].ts[timeStepInDayGCLS - 1].feneCondInstantSeq;
ort->znCompLoads[izone - 1].day[state.dataSize->CurOverallSimDay - 1].ts[timeStepInDayGCLS - 1].feneCondInstantSeq += tubularGain;
}
if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
for (int ispace = 1; ispace <= state.dataGlobal->NumOfZones; ++ispace) {
Real64 tubularGain = 0.0;
int zone = state.dataHeatBal->space(ispace).zoneNum;
tubularGain = InternalHeatGains::SumInternalConvectionGainsByTypes(state, zone, OutputReportTabular::IntGainTypesTubularGCLS, ispace);
Real64 fenCISeq = ort->znCompLoads[ispace - 1].day[state.dataSize->CurOverallSimDay - 1].ts[timeStepInDayGCLS - 1].feneCondInstantSeq;
ort->znCompLoads[ispace - 1].day[state.dataSize->CurOverallSimDay - 1].ts[timeStepInDayGCLS - 1].feneCondInstantSeq += tubularGain;
}
}
}
}

Expand Down Expand Up @@ -15608,14 +15631,6 @@ void GetDelaySequences(EnergyPlusData &state,
// static bool initAdjFenDone(false); moved to anonymous namespace for unit testing
auto &ort = state.dataOutRptTab;

if (!ort->initAdjFenDone) {
state.dataOutRptTab->adjFenDone.allocate(state.dataEnvrn->TotDesDays + state.dataEnvrn->TotRunDesPersDays,
state.dataGlobal->NumOfTimeStepInHour * 24,
state.dataGlobal->NumOfZones);
state.dataOutRptTab->adjFenDone = false;
ort->initAdjFenDone = true;
}

if (desDaySelected != 0) {

Array2D<Real64> decayCurve;
Expand Down Expand Up @@ -15696,9 +15711,11 @@ void GetDelaySequences(EnergyPlusData &state,
lightDelaySeq(kTimeStep) = lightLWConvIntoZone + lightSWConvIntoZone;
feneSolarDelaySeq(kTimeStep) = feneSolarConvIntoZone;
// also remove the net radiant component on the instanteous conduction for fenestration
if (!state.dataOutRptTab->adjFenDone(desDaySelected, kTimeStep, zoneIndex)) {
szCompLoadLoc.day[desDaySelected - 1].ts[kTimeStep - 1].feneCondInstantSeq -= adjFeneSurfNetRadSeq;
state.dataOutRptTab->adjFenDone(desDaySelected, kTimeStep, zoneIndex) = true;
auto &szCompLoadDayTS = szCompLoadLoc.day[desDaySelected - 1].ts[kTimeStep - 1];
if (!szCompLoadDayTS.adjFenDone) {
Real64 fenCISeq = szCompLoadDayTS.feneCondInstantSeq;
szCompLoadDayTS.feneCondInstantSeq -= adjFeneSurfNetRadSeq;
szCompLoadDayTS.adjFenDone = true;
}
} // for kTimeStep

Expand Down
3 changes: 1 addition & 2 deletions src/EnergyPlus/OutputReportTabular.hh
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,7 @@ namespace OutputReportTabular {
Real64 interZoneMixLatentSeq = 0.0;

Real64 feneCondInstantSeq = 0.0;
bool adjFenDone = false;
};
struct compLoadsDay
{
Expand Down Expand Up @@ -1348,7 +1349,6 @@ struct OutputReportTabularData : BaseGlobalStruct
int TimeOfPulseCLCDC = 0;
int CoolDesSelectedCLCDC = 0; // design day selected for cooling
int HeatDesSelectedCLCDC = 0; // design day selected for heating
Array3D_bool adjFenDone;
Real64 BigNumRMG = 0.0;
int foundGsui = 0;
int iUnitGsui = 0;
Expand Down Expand Up @@ -1623,7 +1623,6 @@ struct OutputReportTabularData : BaseGlobalStruct
this->TimeOfPulseCLCDC = 0;
this->CoolDesSelectedCLCDC = 0; // design day selected for cooling
this->HeatDesSelectedCLCDC = 0; // design day selected for heating
this->adjFenDone.clear();
this->BigNumRMG = 0.0;
this->foundGsui = 0;
this->iUnitGsui = 0;
Expand Down

4 comments on commit 9d8ee71

@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: OK (2913 of 2913 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.

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

@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-UnitTestsCoverage-RelWithDebInfo: OK (2097 of 2097 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@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: OK (2891 of 2891 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.