Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -50617,7 +50617,7 @@ SpaceHVAC:EquipmentConnections,
\memo Specifies the HVAC equipment connections for a space. Node names are specified for the
\memo space air node, air inlet nodes, air exhaust nodes, and the air return node.
\memo If any space in a zone has a SpaceHVAC:EquipmentConnections object, then all spaces in the zone must have one.
\memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Sizing"is Yes.
\memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Simulation" is Yes.
Copy link
Member

Choose a reason for hiding this comment

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

How strict shall I be regarding IO changes... need to decide...

\min-fields 4
A1 , \field Space Name
\required-field
Expand Down Expand Up @@ -50650,7 +50650,7 @@ SpaceHVAC:ZoneEquipmentSplitter,
\memo Distributes the output from a piece of zone equipment to one or more Spaces in the Zone.
\memo If any equipment in a zone has a SpaceHVAC:ZoneEquipmentSplitter, then all equipment in the zone must have one.
\memo except Fan:ZoneExhaust. All spaces in the zone must also have a SpaceHVAC:EquipmentConnections object.
\memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Sizing" = Yes.
\memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Simulation" is Yes.
\min-fields 10
A1, \field Name
\required-field
Expand Down Expand Up @@ -50774,7 +50774,7 @@ SpaceHVAC:ZoneEquipmentMixer,
\extensible:3
\memo Mixes the airflow from one or more Spaces into a piece of zone equipment.
\memo All spaces in the zone must also have a SpaceHVAC:EquipmentConnections object.
\memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Sizing" = Yes.
\memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Simulation" is Yes.
\min-fields 7
A1, \field Name
\required-field
Expand Down Expand Up @@ -50845,7 +50845,7 @@ SpaceHVAC:ZoneReturnMixer,
\extensible:2
\memo Mixes the return airflow from one or more Spaces into a zone return node.
\memo All spaces in the zone must also have a SpaceHVAC:EquipmentConnections object.
\memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Sizing" = Yes.
\memo Used only when ZoneAirHeatBalanceAlgorithm "Do Space Heat Balance for Simulation" is Yes.
\min-fields 5
A1, \field Name
\required-field
Expand Down
19 changes: 0 additions & 19 deletions src/EnergyPlus/SizingManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,25 +219,6 @@ void ManageSizing(EnergyPlusData &state)
state.dataGlobal->ZoneSizingCalc = true;
Available = true;

if (state.dataSize->SizingFileColSep == CharComma) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Move to ZoneEquipmentManager to avoid creating an empty spsz output file. Can't make that decision here yet, because the project data (with Do Space Heat Balance flags) has not been read yet.

Copy link
Member

Choose a reason for hiding this comment

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

👍

state.files.zsz.filePath = state.files.outputZszCsvFilePath;
} else if (state.dataSize->SizingFileColSep == CharTab) {
state.files.zsz.filePath = state.files.outputZszTabFilePath;
} else {
state.files.zsz.filePath = state.files.outputZszTxtFilePath;
}

if (state.dataSize->SizingFileColSep == CharComma) {
state.files.spsz.filePath = state.files.outputSpszCsvFilePath;
} else if (state.dataSize->SizingFileColSep == CharTab) {
state.files.spsz.filePath = state.files.outputSpszTabFilePath;
} else {
state.files.spsz.filePath = state.files.outputSpszTxtFilePath;
}

state.files.zsz.ensure_open(state, "ManageSizing", state.files.outputControl.zsz);
state.files.spsz.ensure_open(state, "ManageSizing", state.files.outputControl.spsz);

ShowMessage(state, "Beginning Zone Sizing Calculations");

Weather::ResetEnvironmentCounter(state);
Expand Down
50 changes: 36 additions & 14 deletions src/EnergyPlus/ZoneEquipmentManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2346,14 +2346,15 @@ std::string sizingPeakTimeStamp(EnergyPlusData const &state, int timeStepIndex)
void writeZszSpsz(EnergyPlusData &state,
EnergyPlus::InputOutputFile &outputFile,
int const numSpacesOrZones,
Array1D<DataZoneEquipment::EquipConfiguration> const &zsEquipConfig,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is no longer needed.

EPVector<DataSizing::ZoneSizingData> const &zsCalcFinalSizing,
Array2D<DataSizing::ZoneSizingData> const &zsCalcSizing)
Array2D<DataSizing::ZoneSizingData> const &zsCalcSizing,
bool const forSpaces)
{
char const colSep = state.dataSize->SizingFileColSep;
print(outputFile, "Time");
for (int i = 1; i <= numSpacesOrZones; ++i) {
if (!zsEquipConfig(i).IsControlled) continue;
int zoneNum = (forSpaces) ? state.dataHeatBal->space(i).zoneNum : i;
if (!state.dataHeatBal->Zone(zoneNum).IsControlled) continue;
Comment on lines -2356 to +2357
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For sizing output, check if the parent zone is controlled instead of checking zsEquipConfig(i).IsControlled (which is only true if there are SpaceHVAC:* objects).

Copy link
Member

Choose a reason for hiding this comment

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

And if there are SpaceHVAC objects, that implies that the parent zone IsControlled flag will be set to true, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, it should be. SpaceHVAC objects don't work without corresponding ZoneHVAC objects for the parent zone. I see a check for that in some of the SpaceHVAC objects, but not for SpaceHVAC:EquipmentConnections. I'll add that and remove the IDD changes and stash them (somewhere) for later.

Copy link
Collaborator

Choose a reason for hiding this comment

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

How does this code in SizeZoneEquipment know the space is controlled? and if this isn't working as expected for spaces then uncontrolled spaces will be held to the Tstat temp and not float?

    auto &zoneEquipConfig = state.dataZoneEquip->ZoneEquipConfig(ControlledZoneNum);
    if (!zoneEquipConfig.IsControlled) continue;
    sizeZoneSpaceEquipmentPart2(
        state, zoneEquipConfig, state.dataSize->CalcZoneSizing(state.dataSize->CurOverallSimDay, ControlledZoneNum), ControlledZoneNum);
    if (state.dataHeatBal->doSpaceHeatBalance) {
        for (int spaceNum : state.dataHeatBal->Zone(ControlledZoneNum).spaceIndexes) {
            sizeZoneSpaceEquipmentPart2(
                state, zoneEquipConfig, state.dataSize->CalcSpaceSizing(state.dataSize->CurOverallSimDay, spaceNum), ControlledZoneNum, spaceNum);
        }
    }

Copy link
Collaborator

@rraustad rraustad Feb 26, 2025

Choose a reason for hiding this comment

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

I just checked 5ZoneAirCooledWithSpacesHVAC and ZONE 5-REMAINDER has a heating and cooling load showing in eplusspsz.csv. This is a different issue than the original and is scope creeping.

UPDATE: ZONE 5-REMAINDER does have an equipment connections object so it should show loads. I suspect an uncontrolled space would also show loads but that's a different issue than this.

SpaceHVAC:EquipmentConnections,
  Zone 5-Remainder,        !- Space Name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For sizing, the assumption is that all spaces in a zone are controlled to the zone thermostat setpoint. That's intentional, I'll have to check and see if the docs are clear (or cloudy, or dark as night) on that.

Copy link
Contributor Author

@mjwitte mjwitte Feb 26, 2025

Choose a reason for hiding this comment

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

The Engineering Ref seems clear:

\subsection{Space Sizing}\label{space-sizing}
When ZoneAirHeatBalanceAlgorithm ``Do Space Heat Balance for Sizing'' is ``Yes'', the same sizing calculations 
described above will be performed for each space that is part of a controlled zone, using the same thermostat
 setpoints as the parent zone. The space sizing results will be reported the same as zone sizing results (eio, table,
 and spsz outputs).

\subsection{NonCoincident Zone Sizing}\label{noncoincident-zone-sizing}
Sizing:Zone has an option for  ``Type of Space Sum to Use'', ``Coincident'' or ``NonCoincident''. Coincident zone 
sizing (the default) is always calculated first, with all spaces in the zone lumped together. For ``NonCoincident'' zone 
sizing, if the zone contains more than one space, the zone sizing results will be overwritten using the sums and
 averages of the space sizing results. If all spaces for a given load type (heating or cooling) peak on the same design 
day, then that day will be reported as the zone peak day, otherwise the zone design day will be "N/A". The zone 
peak time will be determined by scanning the peak zone sequential loads which are calculated by summing the 
space peak day sequential loads.

But some I/O Ref changes are needed.

auto &thisCalcFS = zsCalcFinalSizing(i);

static constexpr std::string_view ZSizeFmt11("{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{"
Expand Down Expand Up @@ -2441,7 +2442,8 @@ void writeZszSpsz(EnergyPlusData &state,
static constexpr std::string_view ZSizeFmt20("{:02}:{:02}:00");
print(outputFile, ZSizeFmt20, HourPrint, Minutes);
for (int i = 1; i <= numSpacesOrZones; ++i) {
if (!zsEquipConfig(i).IsControlled) continue;
int zoneNum = (forSpaces) ? state.dataHeatBal->space(i).zoneNum : i;
if (!state.dataHeatBal->Zone(zoneNum).IsControlled) continue;
auto &thisCalcFS = zsCalcFinalSizing(i);
static constexpr std::string_view ZSizeFmt21("{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12."
"6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}");
Expand Down Expand Up @@ -2506,7 +2508,8 @@ void writeZszSpsz(EnergyPlusData &state,
print(outputFile, "Peak");

for (int i = 1; i <= numSpacesOrZones; ++i) {
if (!zsEquipConfig(i).IsControlled) continue;
int zoneNum = (forSpaces) ? state.dataHeatBal->space(i).zoneNum : i;
if (!state.dataHeatBal->Zone(zoneNum).IsControlled) continue;
auto &thisCalcFS = zsCalcFinalSizing(i);

static constexpr std::string_view ZSizeFmt31("{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12.6E}{}{:12."
Expand Down Expand Up @@ -2546,7 +2549,8 @@ void writeZszSpsz(EnergyPlusData &state,

print(outputFile, "\nPeak Vol Flow (m3/s)");
for (int i = 1; i <= numSpacesOrZones; ++i) {
if (!zsEquipConfig(i).IsControlled) continue;
int zoneNum = (forSpaces) ? state.dataHeatBal->space(i).zoneNum : i;
if (!state.dataHeatBal->Zone(zoneNum).IsControlled) continue;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only if you have any other changes.

int zoneNum = (forSpaces) ? state.dataHeatBal->space(i).zoneNum : i;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, of course. That construct still is not my first thought, or second, or ...

Copy link
Member

Choose a reason for hiding this comment

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

To add on, the parentheses around forSpaces is not needed unless you need it for order of operations. (Ternary has a very low operation precedence, so most things will be evaluated before it is applied.)

auto &thisCalcFS = zsCalcFinalSizing(i);
static constexpr std::string_view ZSizeFmt41("{}{}{}{:12.6E}{}{:12.6E}{}{}{}{:12.6E}{}{:12.6E}{}{}{}{}{}{}{}{}");
print(outputFile,
Expand Down Expand Up @@ -3302,19 +3306,37 @@ void UpdateZoneSizing(EnergyPlusData &state, Constant::CallIndicator const CallI
}
}

writeZszSpsz(state,
state.files.zsz,
state.dataGlobal->NumOfZones,
state.dataZoneEquip->ZoneEquipConfig,
state.dataSize->CalcFinalZoneSizing,
state.dataSize->CalcZoneSizing);
// Write zone sizing (zsz) and space sizing (spsz) outputs
if (state.dataSize->SizingFileColSep == DataStringGlobals::CharComma) {
state.files.zsz.filePath = state.files.outputZszCsvFilePath;
} else if (state.dataSize->SizingFileColSep == DataStringGlobals::CharTab) {
state.files.zsz.filePath = state.files.outputZszTabFilePath;
} else {
state.files.zsz.filePath = state.files.outputZszTxtFilePath;
}
state.files.zsz.ensure_open(state, "UpdateZoneSizing", state.files.outputControl.zsz);

bool forSpaces = false;
writeZszSpsz(
state, state.files.zsz, state.dataGlobal->NumOfZones, state.dataSize->CalcFinalZoneSizing, state.dataSize->CalcZoneSizing, forSpaces);

if (state.dataHeatBal->doSpaceHeatBalanceSizing) {
if (state.dataSize->SizingFileColSep == DataStringGlobals::CharComma) {
state.files.spsz.filePath = state.files.outputSpszCsvFilePath;
} else if (state.dataSize->SizingFileColSep == DataStringGlobals::CharTab) {
state.files.spsz.filePath = state.files.outputSpszTabFilePath;
} else {
state.files.spsz.filePath = state.files.outputSpszTxtFilePath;
}
state.files.spsz.ensure_open(state, "UpdateZoneSizing", state.files.outputControl.spsz);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wait until here to open zsz and spsz files. At this point we know if doSpaceHeatBalanceSizing is active.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Actually glad you fixed this. I saw the 0 kB files but wasn't sure how to avoid that. This is a perfect fix.


forSpaces = true;
writeZszSpsz(state,
state.files.spsz,
state.dataGlobal->numSpaces,
state.dataZoneEquip->spaceEquipConfig,
state.dataSize->CalcFinalSpaceSizing,
state.dataSize->CalcSpaceSizing);
state.dataSize->CalcSpaceSizing,
forSpaces);
}

// Move sizing data into final sizing array according to sizing method
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/ZoneEquipmentManager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ namespace ZoneEquipmentManager {
void writeZszSpsz(EnergyPlusData &state,
EnergyPlus::InputOutputFile &outputFile,
int const numSpacesOrZones,
Array1D<DataZoneEquipment::EquipConfiguration> const &zsEquipConfig,
EPVector<DataSizing::ZoneSizingData> const &zsCalcFinalSizing,
Array2D<DataSizing::ZoneSizingData> const &zsCalcSizing);
Array2D<DataSizing::ZoneSizingData> const &zsCalcSizing,
bool const forSpaces);

std::string sizingPeakTimeStamp(EnergyPlusData const &state, int timeStepIndex);

Expand Down