Skip to content

Commit

Permalink
Space for IlluminanceMap
Browse files Browse the repository at this point in the history
  • Loading branch information
mjwitte committed Aug 13, 2024
1 parent 52fee4b commit 9bd2143
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 35 deletions.
10 changes: 5 additions & 5 deletions doc/input-output-reference/src/overview/group-daylighting.tex
Original file line number Diff line number Diff line change
Expand Up @@ -505,21 +505,21 @@ \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}

\paragraph{Field: Name}\label{field-name-2-007}

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}

Expand Down Expand Up @@ -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]
Expand Down
3 changes: 2 additions & 1 deletion idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/DataDaylighting.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
70 changes: 42 additions & 28 deletions src/EnergyPlus/DaylightingManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -4308,6 +4322,7 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound)
}
}
ZoneMsgDone.deallocate();
if (ErrorsFound) return;

if (TotIllumMaps > 0) {
print(state.files.eio,
Expand All @@ -4330,7 +4345,6 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound)
illumMap.Z);
}

if (ErrorsFound) return;
} // GetInputIlluminanceMap()

void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound)
Expand Down
3 changes: 2 additions & 1 deletion src/Transition/InputRulesFiles/Rules24-1-0-to-24-2-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

4 comments on commit 9bd2143

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

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

spaceIllumMapInternalMass (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3698 of 3698 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

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

spaceIllumMapInternalMass (mjwitte) - x86_64-MacOS-10.18-clang-15.0.0: OK (3657 of 3657 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

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

spaceIllumMapInternalMass (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2071 of 2071 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

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

spaceIllumMapInternalMass (mjwitte) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (796 of 796 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.