-
Notifications
You must be signed in to change notification settings - Fork 390
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)) { | ||
|
@@ -4308,6 +4322,7 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) | |
} | ||
} | ||
ZoneMsgDone.deallocate(); | ||
if (ErrorsFound) return; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
|
@@ -4330,7 +4345,6 @@ void GetInputIlluminanceMap(EnergyPlusData &state, bool &ErrorsFound) | |
illumMap.Z); | ||
} | ||
|
||
if (ErrorsFound) return; | ||
} // GetInputIlluminanceMap() | ||
|
||
void GetDaylightingControls(EnergyPlusData &state, bool &ErrorsFound) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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; | ||
|
@@ -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, | ||
|
@@ -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; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
andOutput:IlluminanceMap
to check zone first, then space. That will be consistent with the order in the field name.