8000 First round of KIVA fixes/tests by brgix · Pull Request #120 · rd2/tbd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 4 commits into from
Nov 22, 2024
Merged

First round of KIVA fixes/tests #120

merged 4 commits into from
Nov 22, 2024

Conversation

brgix
Copy link
Member
@brgix brgix commented Nov 19, 2024

See Issue.

@brgix brgix added the bug Something isn't working label Nov 19, 2024
@brgix brgix self-assigned this Nov 19, 2024
@brgix brgix linked an issue Nov 19, 2024 that may be closed by this pull request
next if surface.outsideBoundaryCondition.capitalize == boundary
next unless surface.outsideBoundaryCondition.capitalize == "Foundation"
Copy link
Member Author

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]
Copy link
Member Author

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]
Copy link
Member Author

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.

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
Copy link
Member Author

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

8000
@@ -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
Copy link
Member Author

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].
Copy link
Member Author

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.

Copy link
Member
@macumber macumber Nov 22, 2024

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?

Copy link
Member Author

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)
Copy link
Member Author
@brgix brgix Nov 21, 2024

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
Copy link
Member Author
@brgix brgix Nov 21, 2024

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))
Copy link
Member Author

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.

@brgix brgix merged commit 22f7c2c into develop Nov 22, 2024
9 checks passed
@brgix brgix deleted the exposed branch November 22, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

KIVA : incorrect exposed perimeter calculations + resetKIVA needs fixing
2 participants
0