Skip to content
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

Space for IlluminanceMap and Internal Mass #10659

Merged
merged 4 commits into from
Aug 19, 2024

Conversation

mjwitte
Copy link
Contributor

@mjwitte mjwitte commented Aug 13, 2024

Pull request overview

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 Aug 13, 2024
@mjwitte mjwitte added this to the EnergyPlus 24.2 IOFreeze milestone Aug 13, 2024
@mjwitte mjwitte marked this pull request as ready for review August 13, 2024 21:44
Copy link
Contributor Author

@mjwitte mjwitte left a comment

Choose a reason for hiding this comment

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

Code walkthru. Small changes to clean up space handling. Added a new testfile 5ZoneAirCooledWithSpacesDaylightingIntMass.idf to test various applications of these inputs.

ipsc->cAlphaFieldNames(2),
ipsc->cAlphaArgs(2)));
ErrorsFound = true;
int const spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->space);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Accept a Space Name for Output:IlluminanceMap.

Copy link
Contributor

Choose a reason for hiding this comment

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

The way you ordered the if-else ladder seem to imply it would be more common now to use a Space Name rather than a Zone Name. Is that so?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The way you ordered the if-else ladder seem to imply it would be more common now to use a Space Name rather than a Zone Name. Is that so?

Good question. I didn't pay much attention to this.
For Daylighting:Controls space is checked first.
For Daylighting:ReferencePoint zone is first.
For Output:IlluminanceMap space is first.
For internal gains (Lights, People, etc.) it is zone, then space, then zonelist, then spacelist.

I will change Daylighting:Controls and Output:IlluminanceMap to check zone first, then space. That will be consistent with the order in the field name.

ipsc->cAlphaArgs(1)));
ErrorsFound = true;
break;
illumMap.zoneIndex = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If name is not a space, then lookup a zone.

@@ -4308,6 +4322,7 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound)
}
}
ZoneMsgDone.deallocate();
if (ErrorsFound) return;
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 was too late, and could cause an array bounds error in the eio printing below.

@@ -2846,7 +2846,8 @@ namespace SurfaceGeometry {

for (int surfNum = 1; surfNum <= state.dataSurface->TotSurfaces; ++surfNum) {
auto &thisSurf = Surfaces(surfNum);
if (!thisSurf.HeatTransSurf) continue; // ignore shading surfaces
if (!thisSurf.HeatTransSurf) continue; // ignore shading surfaces
if (thisSurf.Class == DataSurfaces::SurfaceClass::IntMass) continue; // skip internal mass surfaces for this check
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When checking the surface space assignments, don't want a stray InternalMass object to trigger adding a new -Remainder space.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really understand this, but it does seem to make sense.

Copy link
Contributor

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

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

Looks good to me!

ipsc->cAlphaFieldNames(2),
ipsc->cAlphaArgs(2)));
ErrorsFound = true;
int const spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->space);
Copy link
Contributor

Choose a reason for hiding this comment

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

The way you ordered the if-else ladder seem to imply it would be more common now to use a Space Name rather than a Zone Name. Is that so?

Comment on lines 4070 to 4072
ShowContinueError(
state,
format("Zone=\"{}\" spans multiple enclosures. Use a Space Name instead.", state.dataHeatBal->Zone(zoneNum).Name));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice.

@@ -2846,7 +2846,8 @@ namespace SurfaceGeometry {

for (int surfNum = 1; surfNum <= state.dataSurface->TotSurfaces; ++surfNum) {
auto &thisSurf = Surfaces(surfNum);
if (!thisSurf.HeatTransSurf) continue; // ignore shading surfaces
if (!thisSurf.HeatTransSurf) continue; // ignore shading surfaces
if (thisSurf.Class == DataSurfaces::SurfaceClass::IntMass) continue; // skip internal mass surfaces for this check
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't really understand this, but it does seem to make sense.

Comment on lines +53 to +54
# epJSON Field Name Change: Output:IlluminanceMap
`zone_name` --> `zone_or_space_name`
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

(And no transition (fortran) needed because field didn't change location, and will continue to work)

@@ -51,6 +51,7 @@ add_simulation_test(IDF_FILE 5ZoneAirCooledConvCoef.idf EPW_FILE USA_CO_Golden-N
add_simulation_test(IDF_FILE 5ZoneAirCooledConvCoef_VSFan.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
add_simulation_test(IDF_FILE 5ZoneAirCooledKeepSiteLocation.idf EPW_FILE USA_CO_Golden-NREL.724666_TMY3.epw)
add_simulation_test(IDF_FILE 5ZoneAirCooledWithSpaces.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
add_simulation_test(IDF_FILE 5ZoneAirCooledWithSpacesDaylightingIntMass.idf EPW_FILE USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw)
Copy link
Contributor

Choose a reason for hiding this comment

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

New test file, nice.

Copy link
Contributor

Choose a reason for hiding this comment

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

I diffed 5ZoneAirCooledWithSpaces.idf and this one.

"Zone 1" and "Space 3" got new Daylighting:Controls, Daylighting:ReferencePoint, and Output:IlluminanceMap.

All Zones, and All Spaces, plus "Space 5 Office" and "Space 5 Conference" specifically, now have an InternalMass object.

--- 5ZoneAirCooledWithSpaces.idf	2024-05-16 17:56:08.849224791 +0200
+++ 5ZoneAirCooledWithSpacesDaylightingIntMass.idf	2024-08-19 11:16:50.565934236 +0200
@@ -126,7 +126,8 @@
   GlobalGeometryRules,
     UpperLeftCorner,         !- Starting Vertex Position
     CounterClockWise,        !- Vertex Entry Direction
-    Relative;                !- Coordinate System
+    Relative,                !- Coordinate System
+    Relative;                !- Daylighting Reference Point Coordinate System
 
   ScheduleTypeLimits,
     Any Number;              !- Name
@@ -924,9 +925,45 @@
     0.2,                     !- Return Air Fraction
     0.59,                    !- Fraction Radiant
     0.2,                     !- Fraction Visible
-    0,                       !- Fraction Replaceable
+    1.0,                     !- Fraction Replaceable
     GeneralLights;           !- End-Use Subcategory
 
+  Daylighting:Controls,
+    Zone 1 Daylighting Control,  !- Name
+    Zone 1,                  !- Zone or Space Name
+    SplitFlux,               !- Daylighting Method
+    ,                        !- Availability Schedule Name
+    Stepped,                 !- Lighting Control Type
+    0.3000,                  !- Minimum Input Power Fraction for Continuous or ContinuousOff Dimming Control
+    0.2000,                  !- Minimum Light Output Fraction for Continuous or ContinuousOff Dimming Control
+    3,                       !- Number of Stepped Control Steps
+    1.0000,                  !- Probability Lighting will be Reset When Needed in Manual Stepped Control
+    Zone 1 Reference Point1,  !- Glare Calculation Daylighting Reference Point Name
+    180,                     !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone y-Axis {deg}
+    20,                      !- Maximum Allowable Discomfort Glare Index
+    ,                        !- DElight Gridding Resolution {m2}
+    Zone 1 Reference Point1,  !- Daylighting Reference Point 1 Name
+    1.0000,                  !- Fraction of Lights Controlled by Reference Point 1
+    400.0000;                !- Illuminance Setpoint at Reference Point 1 {lux}
+
+  Daylighting:ReferencePoint,
+    Zone 1 Reference Point1,  !- Name
+    Zone 1,                  !- Zone or Space Name
+    15.0,                    !- X-Coordinate of Reference Point {m}
+    3.0,                     !- Y-Coordinate of Reference Point {m}
+    0.7;                     !- Z-Coordinate of Reference Point {m}
+
+  Output:IlluminanceMap,
+    Zone 1 Daylit Map,       !- Name
+    Zone 1,                  !- Zone Name
+    0.8,                     !- Z height {m}
+    3.9,                     !- X Minimum Coordinate {m}
+    26.6,                     !- X Maximum Coordinate {m}
+    5,                       !- Number of X Grid Points
+    0.2,                     !- Y Minimum Coordinate {m}
+    3.5,                    !- Y Maximum Coordinate {m}
+    5;                      !- Number of Y Grid Points
+
   ElectricEquipment,
     All Spaces Elec Equip,   !- Name
     AllConditionedSpaces,    !- Zone or ZoneList or Space or SpaceList Name
@@ -1307,9 +1344,45 @@
     0.2,                     !- Return Air Fraction
     0.59,                    !- Fraction Radiant
     0.2,                     !- Fraction Visible
-    0,                       !- Fraction Replaceable
+    1.0,                     !- Fraction Replaceable
     GeneralLights;           !- End-Use Subcategory
 
+  Daylighting:Controls,
+    Space 3 Open Office 1 Daylighting Control,  !- Name
+    Space 3 Open Office 1,   !- Zone or Space Name
+    SplitFlux,               !- Daylighting Method
+    ,                        !- Availability Schedule Name
+    Stepped,                 !- Lighting Control Type
+    0.3000,                  !- Minimum Input Power Fraction for Continuous or ContinuousOff Dimming Control
+    0.2000,                  !- Minimum Light Output Fraction for Continuous or ContinuousOff Dimming Control
+    3,                       !- Number of Stepped Control Steps
+    1.0000,                  !- Probability Lighting will be Reset When Needed in Manual Stepped Control
+    Space 3 Open Office 1 Reference Point1,  !- Glare Calculation Daylighting Reference Point Name
+    180,                     !- Glare Calculation Azimuth Angle of View Direction Clockwise from Zone y-Axis {deg}
+    20,                      !- Maximum Allowable Discomfort Glare Index
+    ,                        !- DElight Gridding Resolution {m2}
+    Space 3 Open Office 1 Reference Point1,  !- Daylighting Reference Point 1 Name
+    1.0000,                  !- Fraction of Lights Controlled by Reference Point 1
+    400.0000;                !- Illuminance Setpoint at Reference Point 1 {lux}
+
+  Daylighting:ReferencePoint,
+    Space 3 Open Office 1 Reference Point1,  !- Name
+    Space 3 Open Office 1,   !- Zone or Space Name
+    8.0,                     !- X-Coordinate of Reference Point {m}
+    12.5,                    !- Y-Coordinate of Reference Point {m}
+    0.7;                     !- Z-Coordinate of Reference Point {m}
+
+  Output:IlluminanceMap,
+    Space 3 Open Office 1 Daylit Map,  !- Name
+    Space 3 Open Office 1,   !- Zone or Space Name
+    0.8,                     !- Z height {m}
+    3.8,                     !- X Minimum Coordinate {m}
+    11.8,                     !- X Maximum Coordinate {m}
+    5,                       !- Number of X Grid Points
+    11.8,                     !- Y Minimum Coordinate {m}
+    15.0,                    !- Y Maximum Coordinate {m}
+    10;                      !- Number of Y Grid Points
+
   Lights,
     Space 3 Open Office 2 Lights,  !- Name
     Space 3 Open Office 2,   !- Zone or ZoneList or Space or SpaceList Name
@@ -1338,6 +1411,31 @@
     0,                       !- Fraction Replaceable
     GeneralLights;           !- End-Use Subcategory
 
+  Construction,
+    Furniture,               !- Name
+    WD10;                    !- Outside Layer
+
+  InternalMass,
+    Zone 3 Furniture,        !- Name
+    Furniture,               !- Construction Name
+    Zone 3,                  !- Zone or ZoneList Name
+    ,                        !- Space or SpaceList Name
+    77;                      !- Surface Area {m2}
+
+  InternalMass,
+    Misc Furniture,          !- Name
+    Furniture,               !- Construction Name
+    ,                        !- Zone or ZoneList Name
+    AllConditionedSpaces,    !- Space or SpaceList Name
+    5.0;                     !- Surface Area {m2}
+
+  InternalMass,
+    Misc Furniture 2,          !- Name
+    Furniture,               !- Construction Name
+    All Zones,               !- Zone or ZoneList Name
+    ,                        !- Space or SpaceList Name
+    2.0;                     !- Surface Area {m2}
+
   BuildingSurface:Detailed,
     BACK-1,                  !- Name
     WALL,                    !- Surface Type
@@ -1898,6 +1996,20 @@
     0,                       !- Fraction Replaceable
     GeneralLights;           !- End-Use Subcategory
 
+  InternalMass,
+    Space 5 Office Furniture,  !- Name
+    Furniture,               !- Construction Name
+    ,                        !- Zone or ZoneList Name
+    Space 5 Office,          !- Space or SpaceList Name
+    10.0;                    !- Surface Area {m2}
+
+  InternalMass,
+    Space 5 Conference Furniture,  !- Name
+    Furniture,               !- Construction Name
+    ,                        !- Zone or ZoneList Name
+    Space 5 Conference,      !- Space or SpaceList Name
+    5.0;                     !- Surface Area {m2}
+
   BuildingSurface:Detailed,
     C5-1,                    !- Name
     CEILING,                 !- Surface Type

ipsc->cCurrentModuleObject));
ErrorsFound = true;
continue;
// Is it a zone or 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.

Reverse the order for consistency with other objects, check for zone name match first, then space name.

Comment on lines +4419 to +4428
if (spaceHasDaylightingControl(zoneSpaceNum)) {
ShowWarningError(state,
format("{}=\"{}\" Space=\"{}\" already has a {} object assigned to it.",
ipsc->cCurrentModuleObject,
daylightControl.Name,
state.dataHeatBal->space(zoneSpaceNum).Name,
ipsc->cCurrentModuleObject));
ShowContinueError(state, "This control will override the lighting power factor for this space.");
}
spaceHasDaylightingControl(zoneSpaceNum) = true;
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 check wasn't working at all before. Fixed the logic and changed to a warning.

}
spaceHasDaylightingControl(spaceNum) = true;
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 here. spaceHasDaylightingControl was never set to true before.

@Myoldmopar
Copy link
Member

This really does seem fine and a minor IO change that would be good to drop in now. Locally it's still all happy, so let's merge this. Thanks @mjwitte

@Myoldmopar Myoldmopar merged commit e1599d2 into develop Aug 19, 2024
15 checks passed
@Myoldmopar Myoldmopar deleted the spaceIllumMapInternalMass branch August 19, 2024 16:00
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output:IlluminanceMap doesn't support Space
8 participants