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
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -2772,11 +2772,11 @@ \subsubsection{Inputs}\label{inputs-25-004}

\paragraph{Field: Zone or ZoneList Name}\label{field-zone-or-zonelist-name-14}

This field is the name of the \hyperref[zone]{Zone} or \hyperref[zonelist]{ZoneList} in which the internal mass will be added. When the ZoneList option is used then this internal mass object is applied to each of zone in the list. The name of the actual internal mass object in each zone becomes <Zone Name> <InternalMass Object Name> and should be less than the standard length (100 characters) for a name field. If it is greater than this standard length, it may be difficult to specify in output reporting as it will be truncated. A warning will be shown if the generated name is greater than 100 characters. If it duplicates another such concatenated name, there will be a severe error and terminate the run.
This field is the name of the \hyperref[zone]{Zone} or \hyperref[zonelist]{ZoneList} in which the internal mass will be added. When the ZoneList option is used then this internal mass object is applied to each zone in the list. The name of the actual internal mass object in each zone becomes <Zone Name> <InternalMass Object Name> and should be less than the standard length (100 characters) for a name field. If it is greater than this standard length, it may be difficult to specify in output reporting as it will be truncated. A warning will be shown if the generated name is greater than 100 characters. If it duplicates another such concatenated name, there will be a severe error and terminate the run. This field is ignored when a Space or SpaceList Name is specified.

\paragraph{Field: Space or SpaceList Name}\label{field-space-or-spacelist-name-14}

This field is the name of the \hyperref[space]{Space} or \hyperref[spacelist]{SpaceList} in which the internal mass will be added. When the SpaceList option is used then this internal mass object is applied to each space in the list. The name of the actual internal mass object in each space becomes <Space Name> <InternalMass Object Name> and should be less than the standard length (100 characters) for a name field. If it is greater than this standard length, it may be difficult to specify in output reporting as it will be truncated. A warning will be shown if the generated name is greater than 100 characters. If it duplicates another such concatenated name, there will be a severe error and terminate the run. This field is ignored when a ZoneList Name is specified for Zone or ZoneList Name. If a Space Name is used, then the Space must be part of Zone Name. If a SpaceList Name is used, then the Zone Name is ignored (even though it is a required field), and the surface is assigned to the corresponding Zone(s) for each Space in the SpaceList.
This field is the name of the \hyperref[space]{Space} or \hyperref[spacelist]{SpaceList} in which the internal mass will be added. If this field is blank (or a ZoneList Name is specified), the internal mass will be added to the last space attached to the zone. When the SpaceList option is used then this internal mass object is applied to each space in the list. The name of the actual internal mass object in each space becomes <Space Name> <InternalMass Object Name> and should be less than the standard length (100 characters) for a name field. If it is greater than this standard length, it may be difficult to specify in output reporting as it will be truncated. A warning will be shown if the generated name is greater than 100 characters. If it duplicates another such concatenated name, there will be a severe error and terminate the run. This field is ignored when a ZoneList Name is specified for Zone or ZoneList Name. If this field is entered, then the Zone or ZoneList Name is ignored, and the surface is assigned to the corresponding Zone(s) for the Space(s).

\paragraph{Field: Surface Area}\label{field-surface-area}

Expand All @@ -2789,13 +2789,15 @@ \subsubsection{Inputs}\label{inputs-25-004}
Zn002:IntM001, !- Surface Name
INTERIOR, !- Construction Name
DORM ROOMS AND COMMON AREAS, !- Zone or ZoneList Name
408.7734; !- Total area exposed to Zone {m2}
, !- Space or SpaceList Name
408.7734; !- Surface Area {m2}

InternalMass,
Zn002:IntM002, !- Surface Name
PARTITION02, !- Construction Name
DORM ROOMS AND COMMON AREAS, !- Zone or ZoneList Name
371.6122; !- Total area exposed to Zone {m2}
, !- Space or SpaceList Name
371.6122; !- Surface Area {m2}
\end{lstlisting}

\subsection{Surface Output Variables/Reports}\label{surface-output-variablesreports}
Expand Down
11 changes: 6 additions & 5 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -13371,16 +13371,16 @@ InternalMass,
\type object-list
\object-list ConstructionNames
A3 , \field Zone or ZoneList Name
\required-field
\type object-list
\object-list ZoneAndZoneListNames
\note Zone the surface is a part of.
\note used to be Interior Environment
\note Zone(s) the surface is a part of.
\note This field is ignored when a Space or SpaceList Name is specified.
A4 , \field Space or SpaceList Name
\type object-list
\object-list SpaceAndSpaceListNames
\note Space the surface is a part of (optional, see description of Space object for more details).
\note Space(s) the surface is a part of.
\note This field is ignored when a ZoneList Name is specified for Zone or ZoneList Name.
\note An internal mass surface will be added to every Space in every Zone in the ZoneList.
N1 ; \field Surface Area
\required-field
\units m2
Expand Down 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);
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.

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);
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.

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));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice.

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;
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.


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
22 changes: 7 additions & 15 deletions src/EnergyPlus/SurfaceGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.

if (thisSurf.BaseSurf != surfNum) {
// Set space for subsurfaces
thisSurf.spaceNum = Surfaces(thisSurf.BaseSurf).spaceNum;
Expand Down Expand Up @@ -7192,7 +7193,8 @@ namespace SurfaceGeometry {
state.dataSurface->IntMassObjects(Item).NumOfZones = state.dataHeatBal->ZoneList(ZLItem).NumOfZones;
state.dataSurface->IntMassObjects(Item).ZoneListActive = true;
state.dataSurface->IntMassObjects(Item).ZoneOrZoneListPtr = ZLItem;
} else {
} else if (state.dataIPShortCut->lAlphaFieldBlanks(4)) {
// If Space or SpaceList Name is blank, then throw error.
ShowSevereError(state,
format("{}=\"{}\" invalid {}=\"{}\" not found.",
cCurrentModuleObject,
Expand All @@ -7217,19 +7219,9 @@ namespace SurfaceGeometry {
state.dataSurface->IntMassObjects(Item).numOfSpaces = 1;
state.dataSurface->IntMassObjects(Item).spaceListActive = false;
state.dataSurface->IntMassObjects(Item).spaceOrSpaceListPtr = Item1;
if (!state.dataSurface->IntMassObjects(Item).ZoneListActive) {
if (state.dataHeatBal->space(Item1).zoneNum != state.dataSurface->IntMassObjects(Item).ZoneOrZoneListPtr) {
ShowSevereError(state,
format("{}=\"{}\" invalid {}=\"{}\" is not part of Zone =\"{}\".",
cCurrentModuleObject,
state.dataIPShortCut->cAlphaArgs(1),
state.dataIPShortCut->cAlphaFieldNames(4),
state.dataIPShortCut->cAlphaArgs(4),
state.dataIPShortCut->cAlphaArgs(3)));
ErrorsFound = true;
errFlag = true;
}
}
state.dataSurface->IntMassObjects(Item).NumOfZones = 1;
state.dataSurface->IntMassObjects(Item).ZoneListActive = false;
state.dataSurface->IntMassObjects(Item).ZoneOrZoneListPtr = state.dataHeatBal->space(Item1).zoneNum;
} else if (SLItem > 0) {
int numOfSpaces = int(state.dataHeatBal->spaceList(SLItem).numListSpaces);
NumIntMassSurfaces += numOfSpaces;
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`
Comment on lines +53 to +54
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)


# Object Change: ObjectStartsWithP

Expand Down
Loading
Loading