Skip to content

Comments

Support Space for Infiltration and Ventilation#9564

Merged
Myoldmopar merged 32 commits intodevelopfrom
spaceAirFlowsInfVentMix
Aug 6, 2022
Merged

Support Space for Infiltration and Ventilation#9564
Myoldmopar merged 32 commits intodevelopfrom
spaceAirFlowsInfVentMix

Conversation

@mjwitte
Copy link
Contributor

@mjwitte mjwitte commented Jul 26, 2022

Pull request overview

Addresses #9448

  • Allow ZoneInfiltration and ZoneVentilation to be specified by Zone or Space.
  • Simulate ZoneInfiltration and ZoneVentilation at the space level (similar to what's already being done for Lights and Equipment).
  • Add new fields to Space (Volume and Ceiling Height). Addresses Add volume property to space object #9362
  • Move GlobalInternalGainMiscObject struct and related variables from DataHeatBalance to InternalHeatGains.hh. Nearly all arrays that used GlobalInternalGainMiscObject and related Num... variables are now local to their respective getInput functions. Lights and ElectricEquipment are needed for the demand manager, so they're now in state.InternalHeatGains.
  • Needs some unit tests.

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@mjwitte mjwitte added NewFeature Includes code to add a new feature to EnergyPlus IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) labels Jul 26, 2022
@shorowit shorowit linked an issue Jul 26, 2022 that may be closed by this pull request
3 tasks
};

struct ZoneData
struct ZoneData : ZoneSpaceData
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is ZoneData really a subclass of ZoneSpaceData or is ZoneSpaceData a "sub-struct" of ZoneData? Is there any usage in which ZoneSpaceData can be used instead of ZoneData?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is ZoneData really a subclass of ZoneSpaceData or is ZoneSpaceData a "sub-struct" of ZoneData?

Well, no. ZoneData and SpaceData are peers with very similar structs (many of the same field names), but then each one has some additional fields that only apply to one or the other.

Is there any usage in which ZoneSpaceData can be used instead of ZoneData?

Possibly. For calculating things like Volume, FloorArea, CeilingHeight, etc. I was thinking those could be member functions of ZoneSpaceData.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, they aren't peers. Spaces are contained within Zones but they do have many similar attributes.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Okay, so this is kind of a "tweener" idiom. Not exactly an "is-a" (child struct), not exactly a "has-a" (included struct). Both work for now, can keep it this way until/unless a more obvious parent-child relationship reveals itself.

int ListMultiplier = 1; // For Zone Group object: used in reporting and systems calculations
int ListGroup = 0; // used only in Zone Group verification. and for error message.
Real64 RelNorth = 0.0; // Relative North (to building north) [Degrees]
Real64 OriginX = 0.0; // X origin [m]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Vector3<Real64>

Real64 OriginX = 0.0; // X origin [m]
Real64 OriginY = 0.0; // Y origin [m]
Real64 OriginZ = 0.0; // Z origin [m]
int OfType = 1; // 1=Standard Zone, Not yet used:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Make this an enumeration and please don't use Of in variable/type names.

int W5GapMatEQL = 0; // Window5 Equivalent Layer Single-Gas Materials
int TotZoneAirBalance = 0; // Total Zone Air Balance Statements in input
int TotFrameDivider = 0; // Total number of window frame/divider objects
int NumOfZoneLists = 0; // Total number of zone lists
Copy link
Collaborator

Choose a reason for hiding this comment

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

When is something NumOf vs. Tot vs. nothing?

if (zoneVolume > 0.0) {
spaceFrac = thisSpace.Volume / zoneVolume;
} else {
ShowSevereError(state, std::string(RoutineName) + "Zone volume is zero when allocating Infiltration to Spaces.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

I understand that string + literal string is a special case, but this is still at best one reallocation more than format.

"The Minimum Indoor Temperature value and schedule are provided. The scheduled temperature will be used in the " +
cCurrentModuleObject + " object = " + cAlphaArgs(1));
ShowWarningError(state,
std::string{RoutineName} +
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you find yourself doing std::string{RoutineName}, turn around and use format for the whole thing.

for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {

auto &thisZone = state.dataHeatBal->Zone(ZoneNum);
if (!state.dataHeatBal->Zone(ZoneNum).HasFloor) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

thisZone

@@ -12039,7 +12044,7 @@ namespace SurfaceGeometry {

int countNotFullyEnclosedZones = 0;
for (ZoneNum = 1; ZoneNum <= state.dataGlobal->NumOfZones; ++ZoneNum) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you're not going to use ZoneNum for anything other than find thisZone, you may as well define this loop as (thisZone : state.dataHeatBal->Zone). I can't believe I just suggested that. What's happening to me?

@mjwitte mjwitte added this to the EnergyPlus 22.2 IOFreeze milestone Jul 26, 2022
@mjwitte mjwitte added the OutputChange Code changes output in such a way that it cannot be merged after IO freeze label Jul 26, 2022
Test 352a, !- Name
None, !- Fuel Type
ZONE ONE, !- Zone or ZoneList Name
ZONE ONE, !- Zone or ZoneList or Space or SpaceList Name

This comment was marked as resolved.

Test 352a, !- Name
None, !- Fuel Type
试验, !- Zone or ZoneList Name
试验, !- Zone or ZoneList or Space or SpaceList Name
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do not speak this language! Could be right, could be wrong.

People,
ZONE ONE People, !- Name
ZONE ONE, !- Zone or ZoneList Name
ZONE ONE, !- Zone or ZoneList or Space or SpaceList Name
Copy link
Collaborator

Choose a reason for hiding this comment

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

This field name change needs to be described in Rules22-1-0-to-22-2-0.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same for People, Lights, and all *Equipment object. The field names changed before, this just brings the example files up to date, because I ran the entire set through transition so it cleaned up all the field names.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, I see. So these would show up in a previous change log.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lights,
SPACE1-1 Lights 1, !- Name
ZONE ONE, !- Zone or ZoneList Name
ZONE ONE, !- Zone or ZoneList or Space or SpaceList Name

This comment was marked as resolved.

@rraustad
Copy link
Collaborator

rraustad commented Aug 4, 2022

I reviewed everything. Very good changes and a good learning experience in review. I think for this type of change we need to rely on example file results moreso than code review for results accuracy. I tried several variations of input changes to try and break the code. A few numerical differences that should be explained and some editorial work on the docs. Other than that, this feature looks good for a first pass.

  • Local unit tests pass
  • only diff is 5ZoneAirCooledWithSpaces due to input changes to test functionality in this branch, no diffs otherwise
  • unexplained numerical diffs could be posted as issue(s) since they may have been present prior to this branch
  • biggest editorial request is with Rules22-1-0-to-22-2-0.md
  • a unit test will iron out some of these numerical diffs
  • performance shows a 0.12% improvement

Overall nice job.

@rraustad
Copy link
Collaborator

rraustad commented Aug 4, 2022

I ran original 5ZoneAirCooled example file with the same ventilation object applied to Space1-1. The annual ventilation sum matches what is shown in the table above. So there is likely no issue with the table reports as first thought. I still do not understand what is wrong with the hand calc.

image

image

@mjwitte mjwitte self-assigned this Aug 4, 2022
@mjwitte
Copy link
Contributor Author

mjwitte commented Aug 5, 2022

From #9564 (comment)

The answer here said that mechanical ventilation changed because sizing changed. OK, perfectly reasonble answer. However, when I look at the facility electricity, neither of these 2 tests with infiltration and ventilation changed electricity use compared to the original example file. Wouldn't you think that if you added outdoor air to the spaces that the facility electricity use would change?

Looking at the ABUPS report, electricity stays the same, but natural gas increases from 28.34 GJ to 28.55. So, if the OA fraction changes but the overall airflow stays the same, this would make sense. These values are for the file with 2 run periods, Jan 1-31, and July 1-31 (1488.00 hrs).

However, the annual values in the Energy Meters table output are nowhere near the values in ABUPS (even in develop).
Energy Meters Report Annual Electricity:Facility 23.53 GJ, ABUPS 36.25 GJ ?! Similar for Natural Gas.
I'll post a new issue for that. (Interesting, these values agree for 5ZoneAirCooled which has a single full annual RunPeriod. A clue.)

@mjwitte
Copy link
Contributor Author

mjwitte commented Aug 5, 2022

@rraustad Regarding hand calc comment #9564 (comment).
Hand calc was 417,484.8 m3, but the table result is 448,310.29 for a full year simulation.
The reason for the difference is that the ZoneVentilation volume flow rate input is applied to the outdoor air density, but the Outdoor Air Details report is in Standard Density. Even the "Zone Ventilation Current Density Volume Flow Rate" output is the current zone air density. So, there is no way to output the original specified volume flow rate. Thus #4422.

@mjwitte
Copy link
Contributor Author

mjwitte commented Aug 5, 2022

@Myoldmopar I believe that all of @rraustad 's comments have been addressed either in code or in comments. Assuming CI comes back all happy, this will be ready for your final review.

@rraustad
Copy link
Collaborator

rraustad commented Aug 5, 2022

@Myoldmopar I agree with @mjwitte assessment. This should be ready to go.

EXPECT_EQ(thisInfiltration.DesignLevel, flows[itemNum]);
EXPECT_TRUE(UtilityRoutines::SameString(ventNames[itemNum], thisVentilation.Name));
EXPECT_EQ(thisVentilation.DesignLevel, flows[itemNum]);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This unit test that shows inputs to infiltration and ventilation are correctly interpreted/managed at the space level.

Copy link
Collaborator

@rraustad rraustad left a comment

Choose a reason for hiding this comment

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

This is a good addition to E+. Nice job!

@Myoldmopar
Copy link
Member

Let's merge this in and perhaps the folks wanting to leverage this space stuff (@shorowit?) could play with it in their own workflows/tools, leaving us plenty of time to address anything before release. Thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IDDChange Code changes impact the IDD file (cannot be merged after IO freeze) NewFeature Includes code to add a new feature to EnergyPlus OutputChange Code changes output in such a way that it cannot be merged after IO freeze

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow Space-level infiltration/ventilation

9 participants