Skip to content

Commit 852aba8

Browse files
committed
Updates SEB fix tests
1 parent 5be7d46 commit 852aba8

File tree

1 file changed

+62
-4
lines changed

1 file changed

+62
-4
lines changed

spec/osut_tests_spec.rb

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,29 +367,87 @@
367367

368368
it "checks construction thickness" do
369369
translator = OpenStudio::OSVersion::VersionTranslator.new
370+
version = OpenStudio.openStudioVersion.split(".").join.to_i
370371
expect(cls1.clean!).to eq(DBG)
371372

373+
# The v1.11.5 (2016) seb.osm, shipped with OpenStudio, holds (what would now
374+
# be considered as deprecated) a definition of plenum floors (i.e. ceiling
375+
# tiles) generating several warnings with more recent OpenStudio versions.
372376
file = File.join(__dir__, "files/osms/in/seb.osm")
373377
path = OpenStudio::Path.new(file)
374378
model = translator.loadModel(path)
375379
expect(model).to_not be_empty
376380
model = model.get
377381

378-
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- cleanup #
379-
# This is the first test relying on the 'seb.osm' file, which ships with
380-
# OpenStudio. The v1.11.5 model (2016) holds a number of artefacts that
381-
# would be frowned upon today (e.g. plenum floors tagged as roofs/ceilings).
382+
# "Shading Surface 4" is overlapping with a plenum exterior wall.
383+
sh4 = model.getShadingSurfaceByName("Shading Surface 4")
384+
expect(sh4).to_not be_empty
385+
sh4 = sh4.get
386+
sh4.remove
387+
382388
plenum = model.getSpaceByName("Level 0 Ceiling Plenum")
383389
expect(plenum).to_not be_empty
384390
plenum = plenum.get
385391

392+
thzone = plenum.thermalZone
393+
expect(thzone).to_not be_empty
394+
thzone = thzone.get
395+
396+
# Before the fix.
397+
unless version < 350
398+
expect(plenum.isEnclosedVolume).to be true
399+
expect(plenum.isVolumeDefaulted).to be true
400+
expect(plenum.isVolumeAutocalculated).to be true
401+
end
402+
403+
if version > 350 && version < 370
404+
expect(plenum.volume.round(0)).to eq(234)
405+
else
406+
expect(plenum.volume.round(0)).to eq(0)
407+
end
408+
409+
expect(thzone.isVolumeDefaulted).to be true
410+
expect(thzone.isVolumeAutocalculated).to be true
411+
expect(thzone.volume).to be_empty
412+
386413
plenum.surfaces.each do |s|
387414
next if s.outsideBoundaryCondition.downcase == "outdoors"
388415

416+
# If a SEB plenum surface isn't facing outdoors, it's 1 of 4 "floor"
417+
# surfaces (each facing a ceiling surface below).
418+
adj = s.adjacentSurface
419+
expect(adj).to_not be_empty
420+
adj = adj.get
421+
expect(adj.vertices.size).to eq(s.vertices.size)
422+
423+
# Same vertex sequence? Should be in reverse order.
424+
adj.vertices.each_with_index do |vertex, i|
425+
expect(mod1.same?(vertex, s.vertices.at(i))).to be true
426+
end
427+
428+
expect(adj.surfaceType).to eq("RoofCeiling")
429+
expect(s.surfaceType).to eq("RoofCeiling")
389430
expect(s.setSurfaceType("Floor")).to be true
390431
expect(s.setVertices(s.vertices.reverse)).to be true
432+
433+
# Vertices now in reverse order.
434+
adj.vertices.reverse.each_with_index do |vertex, i|
435+
expect(mod1.same?(vertex, s.vertices.at(i))).to be true
436+
end
391437
end
392438

439+
# After the fix.
440+
unless version < 350
441+
expect(plenum.isEnclosedVolume).to be true
442+
expect(plenum.isVolumeDefaulted).to be true
443+
expect(plenum.isVolumeAutocalculated).to be true
444+
end
445+
446+
expect(plenum.volume.round(0)).to eq(50) # right answer
447+
expect(thzone.isVolumeDefaulted).to be true
448+
expect(thzone.isVolumeAutocalculated).to be true
449+
expect(thzone.volume).to be_empty
450+
393451
file = File.join(__dir__, "files/osms/out/seb2.osm")
394452
model.save(file, true)
395453
# --- --- --- --- --- --- --- --- --- --- --- --- --- --- end of cleanup #

0 commit comments

Comments
 (0)