-
Notifications
You must be signed in to change notification settings - Fork 4
First round of KIVA fixes/tests #120
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
Conversation
next if surface.outsideBoundaryCondition.capitalize == boundary | ||
next unless surface.outsideBoundaryCondition.capitalize == "Foundation" |
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.
Boils down to either "Ground"-facing or "Foundation"-facing surfaces. If purging KIVA objects WITHOUT starting over, then "Foundation"-facing surfaces have their outside boundary condition reset to "Ground" - much safer. If instead purging KIVA objects THEN starting over, both "Ground"-facing and "Foundation"-facing surfaces are left as is. It's valid to have a model with one space having "Ground"-facing surfaces, with another having "Foundation"-facing surfaces. No longer any need to (re)set constructions.
floors[id][:kiva] = :basement | ||
walls[i ][:kiva] = id | ||
floors[id][:kiva ] = :basement | ||
floors[id][:exposed] += edge[:length] |
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.
1 of 2 lines where "Foundation"-facing wall/slab edge lengths get tallied as exposed foundation perimeter.
walls[ii ][:kiva] = id | ||
floors[id][:kiva ] = :basement | ||
walls[ii ][:kiva ] = id | ||
floors[id][:exposed] += e[:length] |
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.
2nd of 2 lines where "Foundation"-facing wall/slab edge lengths get tallied as exposed foundation perimeter.
spec/tbd_tests_spec.rb
Outdated
expect(kf.isWallHeightAboveGradeDefaulted).to be false | ||
expect(kf.wallHeightAboveGrade.round).to eq(0) | ||
expect(oa15.setWindExposure("NoWind")).to be true | ||
expect(oa15.setSunExposure("NoSun")).to be true |
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.
By default, KIVA foundation objects have a 200mm wall height above grade value, i.e. a top, 8-in section exposed to outdoor air. This seems to generate the following EnergyPlus warning:
** Warning ** BuildingSurface:Detailed="OPENAREA 1 WALL 5", Sun Exposure="SUNEXPOSED".
** ~~~ ** ..This surface is not exposed to External Environment. Sun exposure has no effect.
Initial attempts to get rid of the warning include resetting both wind and sun exposure AFTER setting boundary conditions to "Foundation", e.g.
expect(oa15.setOutsideBoundaryCondition("Foundation")).to be true
expect(oa15.setWindExposure("NoWind")).to be true
expect(oa15.setSunExposure("NoSun")).to be true
Alas, both "exposures" end up being reset in the saved OSM. One solution is to first set the wall height above grade value to 0. Works. More tests needed (to come).
spec/tbd_tests_spec.rb
Outdated
@@ -1248,7 +1275,7 @@ | |||
if id == "Open area 1 Floor" | |||
expect(surface[:kiva]).to eq(:basement) | |||
expect(surface).to have_key(:exposed) | |||
expect(surface[:exposed]).to be_within(TOL).of(8.70) # 12.6 - 3.9 | |||
expect(surface[:exposed]).to be_within(TOL).of(12.59) # not 8.70 |
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.
Exposed perimeter correctly set. Initial EnergyPlus runs (this model, plus others) without warnings or errors.
# North - surfaces eastward of the edge are (0°,180°], while surfaces | ||
# westward of the edge are (180°,360°]. | ||
# North - surfaces eastward of the edge are (0deg,180deg], while surfaces | ||
# westward of the edge are (180deg,360deg]. |
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.
Unexpectedly, the TBD Tests suite generates US-ASCII "\xC2" (°) encoding errors when running GitHub Actions. This seems limited to JSON files, and for Ruby 3 (i.e. SDK v3.8.0 & v3.9.0). Weird - as the very same files are processed when running TBD GitHub Actions, which did not yield any encoding errors. Something of a Hail Mary to get rid of the annoyance.
Not particularly interested in keeping the ° char (instead of "deg", for instance), so either deleting or substituting all instances, in both JSON files and Ruby file comments.
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.
Weird that characters in comments caused an issue, but this must trigger some file level encoding flag, possibly when checked out by GitHub?
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 point. I suspect that the only culprit is the tbd.schema.json file. Just decided to purge/replace ° in ALL files, regardless.
|
||
# Assert 'exposed perimeter' of the Open Area space. | ||
exp = woa13 + woa14 + woa15 + woa16 + woa17 | ||
expect(exp.round(2)).to eq(12.59) |
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.
Regardless of subsequent SEB model changes, exposed perimeter should remain constant.
# Incrementally change Open Area outdoor-facing walls to foundation-facing, | ||
# and ensure KIVA reset works. Exposed perimeter should remain the same. | ||
oaIDs.each_with_index do |oaID, i| | ||
i3 = i + 3 |
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.
5 outdoor-facing walls of the SEB Open Area space == 5 iterations.
|
||
perimeter = model.getSurfacePropertyExposedFoundationPerimeters.first | ||
expect(perimeter.totalExposedPerimeter).to_not be_empty | ||
expect(perimeter.totalExposedPerimeter.get.round(2)).to eq(exp.round(2)) |
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.
Regardless of the number of outdoor-facing vs foundation-facing walls, exposed wall perimeter remains constant.
See Issue.