-
Notifications
You must be signed in to change notification settings - Fork 461
Fix space sizing output (spsz) when there is no space HVAC equipment #10947
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
Changes from 5 commits
cccac75
21a94a3
7d3f762
b3919bb
1ffab86
ab205cd
3378c6f
40c76ba
fc99428
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -219,25 +219,6 @@ void ManageSizing(EnergyPlusData &state) | |
| state.dataGlobal->ZoneSizingCalc = true; | ||
| Available = true; | ||
|
|
||
| if (state.dataSize->SizingFileColSep == CharComma) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Engineering Ref seems clear: But some I/O Ref changes are needed. |
||
| auto &thisCalcFS = zsCalcFinalSizing(i); | ||
|
|
||
| static constexpr std::string_view ZSizeFmt11("{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{}{}{}{}:{" | ||
|
|
@@ -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}"); | ||
|
|
@@ -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." | ||
|
|
@@ -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; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only if you have any other changes.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 ...
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To add on, the parentheses around |
||
| auto &thisCalcFS = zsCalcFinalSizing(i); | ||
| static constexpr std::string_view ZSizeFmt41("{}{}{}{:12.6E}{}{:12.6E}{}{}{}{:12.6E}{}{:12.6E}{}{}{}{}{}{}{}{}"); | ||
| print(outputFile, | ||
|
|
@@ -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); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
||
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.
How strict shall I be regarding IO changes... need to decide...