From 9bd214312fbd8eacf38b18946c8bf50f0e1178d9 Mon Sep 17 00:00:00 2001 From: "Michael J. Witte" Date: Tue, 13 Aug 2024 11:43:17 -0500 Subject: [PATCH] Space for IlluminanceMap --- .../src/overview/group-daylighting.tex | 10 +-- idd/Energy+.idd.in | 3 +- src/EnergyPlus/DataDaylighting.hh | 1 + src/EnergyPlus/DaylightingManager.cc | 70 +++++++++++-------- .../InputRulesFiles/Rules24-1-0-to-24-2-0.md | 3 +- 5 files changed, 52 insertions(+), 35 deletions(-) diff --git a/doc/input-output-reference/src/overview/group-daylighting.tex b/doc/input-output-reference/src/overview/group-daylighting.tex index 340e6df8e8d..769bf3ae999 100644 --- a/doc/input-output-reference/src/overview/group-daylighting.tex +++ b/doc/input-output-reference/src/overview/group-daylighting.tex @@ -505,7 +505,7 @@ \subsubsection{Outputs}\label{outputs-1-004} \subsection{Output:IlluminanceMap}\label{outputilluminancemap} -The Output:IlluminanceMap object expands on the reporting capabilities of the daylighting simulation. For any zone simulated with \hyperref[daylightingcontrols-000]{Daylighting:Controls}, the illuminance map can generate up to 2,500 points of additional daylighting illuminance values. The resulting map is output as a comma delimited text file that can be imported into a spreadsheet program for rapid visualization of the daylighting illuminance patterns in a zone. The values are produced on an hourly basis. The Z height of the map is constant (parallel to a flat floor). More than one illuminance map can be created for a zone. IlluminanceMap output is available only when SplitFlux daylighting method is selected in \hyperref[daylightingcontrols-000]{Daylighting:Controls} object. +The Output:IlluminanceMap object expands on the reporting capabilities of the daylighting simulation. For any space or zone simulated with \hyperref[daylightingcontrols-000]{Daylighting:Controls}, the illuminance map can generate up to 2,500 points of additional daylighting illuminance values. The resulting map is output as a comma delimited text file that can be imported into a spreadsheet program for rapid visualization of the daylighting illuminance patterns in a space or zone. The values are produced on an hourly basis. The Z height of the map is constant (parallel to a flat floor). More than one illuminance map can be created for a space or zone. IlluminanceMap output is available only when SplitFlux daylighting method is selected in \hyperref[daylightingcontrols-000]{Daylighting:Controls} object. \subsubsection{Inputs}\label{inputs-4-006} @@ -513,13 +513,13 @@ \subsubsection{Inputs}\label{inputs-4-006} The name of the map object. -\paragraph{Field: Zone Name}\label{field-zone-name-2-000} +\paragraph{Field: Zone or Space Name}\label{field-zone-name-2-000} -Reference to a zone with \hyperref[daylightingcontrols-000]{Daylighting:Controls}. The zone must lie completely within a single solar enclosure. +Reference to a zone or space with \hyperref[daylightingcontrols-000]{Daylighting:Controls}. If a zone name is specified, all spaces in the zone must be within the same solar enclosure. \paragraph{Field: Z Height}\label{field-z-height} -The height or elevation of the grid of daylighting points. +The height or elevation of the grid of daylighting points. Coordinates may be world or relative as specified in the \hyperref[globalgeometryrules]{GlobalGeometryRules} object Daylighting Reference Point CoordinateSystem field. If a space name is specifice for this map, relative coodinates are relative to the origin of the zone that contains the space (spaces do not have a separate origin). \paragraph{Field: X Minimum Coordinate}\label{field-x-minimum-coordinate} @@ -551,7 +551,7 @@ \subsubsection{Inputs}\label{inputs-4-006} Output:IlluminanceMap, Daylit Map, ! Map Name - Daylit Zone, ! Zone Name + Daylit Zone, ! Zone or Space Name 0, ! Z Height [m] 0.1, ! X Minimum Coordinate [m] 4.9, ! X Maximum Coordinate [m] diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index c8c81ed5963..1244abd0c0d 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -23840,10 +23840,11 @@ Output:IlluminanceMap, \memo Daylighting Reference Point CoordinateSystem field A1 , \field Name \required-field - A2 , \field Zone Name + A2 , \field Zone or Space Name \required-field \type object-list \object-list ZoneNames + \object-list SpaceNames N1 , \field Z height \units m \type real diff --git a/src/EnergyPlus/DataDaylighting.hh b/src/EnergyPlus/DataDaylighting.hh index 187e07670bb..9f61690fc42 100644 --- a/src/EnergyPlus/DataDaylighting.hh +++ b/src/EnergyPlus/DataDaylighting.hh @@ -245,6 +245,7 @@ namespace Dayltg { { // Members std::string Name; // Map name + int spaceIndex = 0; // Index to space being mapped int zoneIndex = 0; // Index to zone being mapped int enclIndex = 0; // Index to enclosure for this map Real64 Z = 0.0; // Elevation or height diff --git a/src/EnergyPlus/DaylightingManager.cc b/src/EnergyPlus/DaylightingManager.cc index c06f9dee700..dc7bbaecc4c 100644 --- a/src/EnergyPlus/DaylightingManager.cc +++ b/src/EnergyPlus/DaylightingManager.cc @@ -700,10 +700,15 @@ void CalcDayltgCoeffsRefMapPoints(EnergyPlusData &state) if ((int)dl->illumMaps.size() > 0) { for (int MapNum = 1; MapNum <= (int)dl->illumMaps.size(); ++MapNum) { int mapZoneNum = dl->illumMaps(MapNum).zoneIndex; + std::string name = format("Zone={}", state.dataHeatBal->Zone(mapZoneNum).Name); + int mapSpaceNum = dl->illumMaps(MapNum).spaceIndex; + if (mapSpaceNum > 0) { + name = format("Space={}", state.dataHeatBal->space(mapSpaceNum).Name); + } if (state.dataGlobal->WarmupFlag) { - DisplayString(state, "Calculating Daylighting Coefficients (Map Points), Zone=" + state.dataHeatBal->Zone(mapZoneNum).Name); + DisplayString(state, format("Calculating Daylighting Coefficients (Map Points), {}", name)); } else { - DisplayString(state, "Updating Daylighting Coefficients (Map Points), Zone=" + state.dataHeatBal->Zone(mapZoneNum).Name); + DisplayString(state, format("Updating Daylighting Coefficients (Map Points), {}", name)); } CalcDayltgCoeffsMapPoints(state, MapNum); } @@ -4033,37 +4038,46 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) auto &illumMap = dl->illumMaps(MapNum); illumMap.Name = ipsc->cAlphaArgs(1); - illumMap.zoneIndex = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); - - if (illumMap.zoneIndex == 0) { - ShowSevereError(state, - format("{}=\"{}\", invalid {}=\"{}\".", - ipsc->cCurrentModuleObject, - ipsc->cAlphaArgs(1), - ipsc->cAlphaFieldNames(2), - ipsc->cAlphaArgs(2))); - ErrorsFound = true; + int const spaceNum = Util::FindItemInList(state.dataIPShortCut->cAlphaArgs(2), state.dataHeatBal->space); + if (spaceNum > 0) { + illumMap.spaceIndex = spaceNum; + illumMap.zoneIndex = state.dataHeatBal->space(spaceNum).zoneNum; + illumMap.enclIndex = state.dataHeatBal->space(spaceNum).solarEnclosureNum; + assert(illumMap.enclIndex > 0); } else { - // set enclosure index for first space in zone - int zoneNum = illumMap.zoneIndex; - int enclNum = state.dataHeatBal->space(state.dataHeatBal->Zone(zoneNum).spaceIndexes(1)).solarEnclosureNum; - illumMap.enclIndex = enclNum; - // check that all spaces in the zone are in the same enclosure - for (int spaceCounter = 2; spaceCounter <= state.dataHeatBal->Zone(zoneNum).numSpaces; ++spaceCounter) { - int spaceNum = state.dataHeatBal->Zone(zoneNum).spaceIndexes(spaceCounter); - if (enclNum != state.dataHeatBal->space(spaceNum).solarEnclosureNum) { - ShowSevereError(state, - format("{}=\"{}\" All spaces in the zone must be in the same enclosure for daylighting illuminance maps.", - ipsc->cCurrentModuleObject, - ipsc->cAlphaArgs(1))); - ErrorsFound = true; - break; + illumMap.zoneIndex = Util::FindItemInList(ipsc->cAlphaArgs(2), state.dataHeatBal->Zone); + if (illumMap.zoneIndex == 0) { + ShowSevereError(state, + format("{}=\"{}\", invalid {}=\"{}\".", + ipsc->cCurrentModuleObject, + ipsc->cAlphaArgs(1), + ipsc->cAlphaFieldNames(2), + ipsc->cAlphaArgs(2))); + ErrorsFound = true; + } else { + // set enclosure index for first space in zone + int zoneNum = illumMap.zoneIndex; + int enclNum = state.dataHeatBal->space(state.dataHeatBal->Zone(zoneNum).spaceIndexes(1)).solarEnclosureNum; + illumMap.enclIndex = enclNum; + // check that all spaces in the zone are in the same enclosure + for (int spaceCounter = 2; spaceCounter <= state.dataHeatBal->Zone(zoneNum).numSpaces; ++spaceCounter) { + int spaceNum = state.dataHeatBal->Zone(zoneNum).spaceIndexes(spaceCounter); + if (enclNum != state.dataHeatBal->space(spaceNum).solarEnclosureNum) { + ShowSevereError(state, + format("{}=\"{}\" All spaces in the zone must be in the same enclosure for daylighting illuminance maps.", + ipsc->cCurrentModuleObject, + ipsc->cAlphaArgs(1))); + ShowContinueError( + state, + format("Zone=\"{}\" spans multiple enclosures. Use a Space Name instead.", state.dataHeatBal->Zone(zoneNum).Name)); + ErrorsFound = true; + break; + } } } } illumMap.Z = ipsc->rNumericArgs(1); - illumMap.Xmin = ipsc->rNumericArgs(2); illumMap.Xmax = ipsc->rNumericArgs(3); if (ipsc->rNumericArgs(2) > ipsc->rNumericArgs(3)) { @@ -4308,6 +4322,7 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) } } ZoneMsgDone.deallocate(); + if (ErrorsFound) return; if (TotIllumMaps > 0) { print(state.files.eio, @@ -4330,7 +4345,6 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) illumMap.Z); } - if (ErrorsFound) return; } // GetInputIlluminanceMap() void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) diff --git a/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md b/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md index dd4cf24cda0..ab8d337958b 100644 --- a/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md +++ b/src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md @@ -50,7 +50,8 @@ There are three new optional heat recovery fields at the end which transition wi # Object Change: ObjectStartsWithN -# Object Change: ObjectStartsWithO +# epJSON Field Name Change: Output:IlluminanceMap +`zone_name` --> `zone_or_space_name` # Object Change: ObjectStartsWithP