-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Space Component Loads Report and Fix Zone Component Loads when Enclosures Differ from Zones #10730
base: develop
Are you sure you want to change the base?
Conversation
|
|
|
auto &spCLDayTS = state.dataOutRptTab->spCompLoads[iSpace - 1].day[state.dataSize->CurOverallSimDay - 1].ts[TimeStepInDay - 1]; | ||
gatherCompLoadIntGain2(state, spCLDayTS, state.dataHeatBal->space(iSpace).zoneNum, iSpace); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall something about if space heat balance is active, then the zone HB results are overwritten with the sum of the spaces. If that's true then why bother processing the zones at all (line 9511) if those results are overwritten by 9516? Is line 9516 iSpace = 1 to NumOfZones, or 1 to numSpaces?
If (state.dataHeatBal->doSpaceHeatBalanceSizing) {
gather spaces, 9516 to 9519
} else {
gather zones, 9511 to 9514
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's possible. Baby steps at this point. Just trying to find all of the places that apply so that the space results are really just for the space.
|
|
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactoring code walkthru . . .
@@ -53,7 +53,6 @@ | |||
|
|||
// ObjexxFCL Headers | |||
#include <ObjexxFCL/Array.functions.hh> | |||
#include <ObjexxFCL/Array3D.hh> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed several stray includes that were no longer being used.
Array1D<Real64> peopleDelaySeqHeat; | ||
Array1D<Real64> peopleDelaySeqCool; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These arrays are temporary and used one at a time, collapsed into a single set to use for both heat and cool.
struct compLoadsSurface | ||
{ | ||
Real64 loadConvectedNormal = 0.0; | ||
Real64 loadConvectedWithPulse = 0.0; | ||
Real64 netSurfRadSeq = 0.0; | ||
Real64 ITABSFseq = 0.0; // used for determining the radiant fraction on each surface | ||
Real64 TMULTseq = 0.0; // used for determining the radiant fraction on each surface | ||
Real64 lightSWRadSeq = 0.0; // short wave visible radiation | ||
Real64 feneSolarRadSeq = 0.0; | ||
}; | ||
|
||
struct compLoadsTimeStepSurfaces | ||
{ | ||
std::vector<compLoadsSurface> surf; | ||
}; | ||
|
||
struct componentLoadsSurf | ||
{ | ||
std::vector<compLoadsTimeStepSurfaces> ts; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New sets of nested vectors to replace a bunch of loose Array3D
. This is for surfaces, similar ones for zone/spaces, and enclosures.
Array3D<Real64> loadConvectedNormal; | ||
Array3D<Real64> loadConvectedWithPulse; | ||
Array3D<Real64> netSurfRadSeq; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced these and many other Array3D
with nested std::vector
.
std::vector<OutputReportTabular::componentLoadsSurf> surfCompLoads; // Surface component loads by day, timestep, then surface | ||
std::vector<OutputReportTabular::componentLoadsSpZn> znCompLoads; // Zone component loads by day, timestep, then zone | ||
std::vector<OutputReportTabular::componentLoadsSpZn> spCompLoads; // Space component loads by day, timestep, then space | ||
std::vector<OutputReportTabular::componentLoadsEncl> enclCompLoads; // Enclosure component loads by day, timestep, then enclsoure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New component loads vectors for surface, zone, space, and enclosure.
int ZoneNumCLCDC = 0; | ||
int SurfNumCLCDC = 0; | ||
int TimeStepCLCDC = 0; | ||
int TimeOfPulseCLCDC = 0; | ||
int CoolDesSelectedCLCDC = 0; // design day selected for cooling | ||
int HeatDesSelectedCLCDC = 0; // design day selected for heating | ||
int iSurfGCLS = 0; | ||
int ZoneNumGCLS = 0; | ||
int TimeStepInDayGCLS = 0; | ||
int iZoneGCLH = 0; | ||
int TimeStepInDayGCLH = 0; | ||
Array3D_bool adjFenDone; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved out of state
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Walkthru for fix #10784 . . .
@@ -9229,6 +9303,32 @@ namespace InternalHeatGains { | |||
return SumRadiationGainRate; | |||
} | |||
|
|||
Real64 SumEnclosureInternalRadiationGainsByTypes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New function to sum radiant gains by enclosure.
for (int iEncl = 1; iEncl <= state.dataViewFactor->NumOfRadiantEnclosures; ++iEncl) { | ||
auto &enclCLDayTS = state.dataOutRptTab->enclCompLoads[state.dataSize->CurOverallSimDay - 1].ts[TimeStepInDay - 1].encl[iEncl - 1]; | ||
enclCLDayTS.peopleRadSeq = SumEnclosureInternalRadiationGainsByTypes(state, iEncl, IntGainTypesPeople); | ||
enclCLDayTS.lightLWRadSeq = SumEnclosureInternalRadiationGainsByTypes(state, iEncl, IntGainTypesLight); | ||
enclCLDayTS.equipRadSeq = SumEnclosureInternalRadiationGainsByTypes(state, iEncl, IntGainTypesEquip); | ||
enclCLDayTS.hvacLossRadSeq = SumEnclosureInternalRadiationGainsByTypes(state, iEncl, IntGainTypesHvacLoss); | ||
enclCLDayTS.powerGenRadSeq = SumEnclosureInternalRadiationGainsByTypes(state, iEncl, IntGainTypesPowerGen); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Save enclosure gain sequences by type for use later in component load calcs.
lightLWConvFromSurf += ort->lightLWRadSeq(desDaySelected, sourceStep, zoneIndex) * thisQRadThermInAbsMult; | ||
auto &compLoadTS = szCLDay.ts[sourceStep - 1].spacezone[szNumMinus1]; | ||
auto const &surfCLDayTS = surfCLDay.ts[sourceStep - 1].surf[jSurf - 1]; | ||
auto const &enclCLDayTS = enclCLDay.ts[sourceStep - 1].encl[radEnclosureNum - 1]; | ||
Real64 thisQRadThermInAbsMult = | ||
surfCLDayTS.TMULTseq * surfCLDayTS.ITABSFseq * state.dataSurface->Surface(jSurf).Area * decayCurve(mStepBack, jSurf); | ||
peopleConvFromSurf += enclCLDayTS.peopleRadSeq * thisQRadThermInAbsMult; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use enclosure gain sequences now. Previously, zone gains were used which could be high or low depending on how the zones/spaces/enclosures align.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space component loads walkthru . . .
for (int zoneNum = 1; zoneNum <= state.dataGlobal->NumOfZones; ++zoneNum) { // Start of zone loads report variable update loop ... | ||
auto &zone = state.dataHeatBal->Zone(zoneNum); | ||
auto &znAirRpt = state.dataHeatBal->ZnAirRpt(zoneNum); | ||
auto &znEquipConfig = state.dataZoneEquip->ZoneEquipConfig(zoneNum); | ||
reportAirHeatBal1(state, znAirRpt, znEquipConfig, zoneNum); | ||
} | ||
if (state.dataHeatBal->doSpaceHeatBalance) { | ||
for (int spaceNum = 1; spaceNum <= state.dataGlobal->numSpaces; ++spaceNum) { | ||
auto &spAirRpt = state.dataHeatBal->spaceAirRpt(spaceNum); | ||
auto &spEquipConfig = state.dataZoneEquip->spaceEquipConfig(spaceNum); | ||
int zoneNum = state.dataHeatBal->space(spaceNum).zoneNum; | ||
reportAirHeatBal1(state, spAirRpt, spEquipConfig, zoneNum, spaceNum); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break up ReportAirHeatBalance
into smaller functions that can be re-used for zones and spaces.
Array1D<Real64> MixSenLoad; // Mixing sensible loss or gain | ||
Array1D<Real64> MixLatLoad; // Mixing latent loss or gain |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to DataHeatBalance::AirReportVars
.
@@ -286,7 +286,7 @@ void GetSimpleAirModelInputs(EnergyPlusData &state, bool &ErrorsFound) // IF err | |||
|
|||
// Following used for reporting | |||
state.dataHeatBal->ZnAirRpt.allocate(state.dataGlobal->NumOfZones); | |||
if (state.dataHeatBal->doSpaceHeatBalanceSimulation) { | |||
if (state.dataHeatBal->doSpaceHeatBalance) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this is wrong, should be doSpaceHeatBalanceSimulation || doSpaceHeatBalanceSizing
. It might be ok, but not safe if sizing is false and simulation is true. Will fix.
for (int iZoneGCLH = 1; iZoneGCLH <= state.dataGlobal->NumOfZones; ++iZoneGCLH) { | ||
auto &znCompLoadDayTSZone = znCompLoadDayTS.spacezone[iZoneGCLH - 1]; | ||
auto &zoneAirRpt = state.dataHeatBal->ZnAirRpt(iZoneGCLH); | ||
gatherSpaceZoneCompLoadsHVAC(znCompLoadDayTSZone, zoneAirRpt, state.dataHVACGlobal->TimeStepSysSec); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another breakup into smaller functions.
int zoneNum = state.dataHeatBal->space(iSpace).zoneNum; | ||
if (!state.dataZoneEquip->ZoneEquipConfig(zoneNum).IsControlled) continue; | ||
if (allocated(state.dataSize->CalcFinalSpaceSizing)) { | ||
computeSpaceZoneCompLoads(state, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pattern repeats several times, called for either space of zone.
|
Pull request overview
Array3D
with nested vectors of structs inOutputReportsTabular
.Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.