tbd 3.0.3 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fff7235e8a345417b5d6885b6b131f8a3ec91cdcad6cf06a691a5455ad04c842
4
- data.tar.gz: 89b326a95347bcaf4415b6c5643e2ae0841aae2e238cdfc6326bc069fdff1134
3
+ metadata.gz: 3f5a7947fb5c2f96807c924dcb4350198119a9033b35cef4d113e35221b0e61f
4
+ data.tar.gz: caf6856e314609d3d13134c2bcc86a78292ea4deb1c8ab453e3ca386a5bf56e2
5
5
  SHA512:
6
- metadata.gz: c38bdf41f39fccaaed05642f7d4b8e24f13833a120c9b4af152399a9b796a3594574961745de4728e4f4261a75567fb46b4e953ef061453cec94f413ec26583f
7
- data.tar.gz: f4844f96093b176796d1c89c3af61dd8473c6417d1305a64b84abf96eee1328357ff6d34cd2726a4e6bd3617f45ca80c4a6af2309f63772f1acd2dc4dbfc15cb
6
+ metadata.gz: 024b47e38db346d15524df93119a49c93c3a183c063d5635cd823ad21d8a2c6892680cc4b2f76b0299177a1479265650c6efc241d9037cb35043f1395ed312a8
7
+ data.tar.gz: da0b7e03bc5142adc8df613427838114377e5b406c36ab2b9ec506eaf72e972478490d45437018a2a94aeac45547ded1c70babfcec677420594c3dd3f776a867
data/json/tbd_seb_n2.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "schema": "https://github.com/rd2/tbd/blob/master/tbd.schema.json",
3
3
  "description": "testing JSON surface KHI entries",
4
- "psis": [{
4
+ "psis": [
5
+ {
5
6
  "id": "good",
6
7
  "parapet": 0.5,
7
8
  "party": 0.9
@@ -17,7 +18,8 @@
17
18
  "grade": 0.45
18
19
  }
19
20
  ],
20
- "khis": [{
21
+ "khis": [
22
+ {
21
23
  "id": "column",
22
24
  "point": 0.5
23
25
  },
@@ -26,16 +28,19 @@
26
28
  "point": 0.5
27
29
  }
28
30
  ],
29
- "surfaces": [{
30
- "id": "Entryway Wall 5",
31
- "khis": [{
32
- "id": "column",
33
- "count": 3
34
- },
35
- {
36
- "id": "support",
37
- "count": 4
38
- }
39
- ]
40
- }]
31
+ "surfaces": [
32
+ {
33
+ "id": "Entryway Wall 5",
34
+ "khis": [
35
+ {
36
+ "id": "column",
37
+ "count": 3
38
+ },
39
+ {
40
+ "id": "support",
41
+ "count": 4
42
+ }
43
+ ]
44
+ }
45
+ ]
41
46
  }
@@ -3,8 +3,8 @@
3
3
  <schema_version>3.0</schema_version>
4
4
  <name>tbd_measure</name>
5
5
  <uid>8890787b-8c25-4dc8-8641-b6be1b6c2357</uid>
6
- <version_id>3e0bc642-b37c-488f-96d5-e73f4c6d432b</version_id>
7
- <version_modified>20221020T205858Z</version_modified>
6
+ <version_id>4501c26f-1cd4-45d8-8f0e-f1ea907c27df</version_id>
7
+ <version_modified>20221125T130635Z</version_modified>
8
8
  <xml_checksum>99772807</xml_checksum>
9
9
  <class_name>TBDMeasure</class_name>
10
10
  <display_name>Thermal Bridging and Derating - TBD</display_name>
@@ -439,22 +439,22 @@
439
439
  <checksum>36FA11E3</checksum>
440
440
  </file>
441
441
  <file>
442
- <filename>ua.rb</filename>
442
+ <filename>geo.rb</filename>
443
443
  <filetype>rb</filetype>
444
444
  <usage_type>resource</usage_type>
445
- <checksum>7264CA34</checksum>
445
+ <checksum>D999D942</checksum>
446
446
  </file>
447
447
  <file>
448
448
  <filename>psi.rb</filename>
449
449
  <filetype>rb</filetype>
450
450
  <usage_type>resource</usage_type>
451
- <checksum>F31F865A</checksum>
451
+ <checksum>AFC8A549</checksum>
452
452
  </file>
453
453
  <file>
454
- <filename>geo.rb</filename>
454
+ <filename>ua.rb</filename>
455
455
  <filetype>rb</filetype>
456
456
  <usage_type>resource</usage_type>
457
- <checksum>D999D942</checksum>
457
+ <checksum>B39B3BB0</checksum>
458
458
  </file>
459
459
  </files>
460
460
  </measure>
@@ -205,7 +205,7 @@ module TBD
205
205
  rimjoist: 0.300, # *
206
206
  parapet: 0.325, # *
207
207
  fenestration: 0.200, # *
208
- corner: 0.300, # ** "regular (BETBG)", adj. for ext. dimensions
208
+ corner: 0.300, # ** not explicitely stated
209
209
  balcony: 0.500, # *
210
210
  party: 0.450, # *
211
211
  grade: 0.450, # *
@@ -219,7 +219,7 @@ module TBD
219
219
  rimjoist: 0.850, # *
220
220
  parapet: 0.800, # *
221
221
  fenestration: 0.500, # *
222
- corner: 0.850, # ** ... not stated
222
+ corner: 0.850, # ** not explicitely stated
223
223
  balcony: 1.000, # *
224
224
  party: 0.850, # *
225
225
  grade: 0.850, # *
@@ -569,16 +569,21 @@ module TBD
569
569
  return mismatch("argh", s, Hash, mth, DBG, ipt) unless argh.is_a?(Hash)
570
570
  return hashkey("argh", argh, opt, mth, DBG, ipt) unless argh.key?(opt)
571
571
 
572
- argh[:io_path] = nil unless argh.key?(:io_path)
572
+ argh[:io_path ] = nil unless argh.key?(:io_path)
573
573
  argh[:schema_path] = nil unless argh.key?(:schema_path)
574
- pth = argh[:io_path]
574
+
575
+ pth = argh[:io_path ]
575
576
  sch = argh[:schema_path]
576
577
 
577
- if pth
578
- return empty("JSON file", mth, FTL, ipt) unless File.size?(pth)
579
- io = File.read(pth)
580
- io = JSON.parse(io, symbolize_names: true)
581
- return mismatch("io", io, Hash, mth, FTL, ipt) unless io.is_a?(Hash)
578
+ if pth && (pth.is_a?(String) || pth.is_a?(Hash))
579
+ if pth.is_a?(Hash)
580
+ io = pth
581
+ else
582
+ return empty("JSON file", mth, FTL, ipt) unless File.size?(pth)
583
+ io = File.read(pth)
584
+ io = JSON.parse(io, symbolize_names: true)
585
+ return mismatch("io", io, Hash, mth, FTL, ipt) unless io.is_a?(Hash)
586
+ end
582
587
 
583
588
  # Schema validation is not yet supported in the OpenStudio Application.
584
589
  # We nonetheless recommend that users rely on the json-schema gem, or an
@@ -62,30 +62,33 @@ module TBD
62
62
  return zero("'#{id}': net area (m2)", mth, ERR, res) unless area > TOL
63
63
 
64
64
  # First, calculate initial layer RSi to initially meet Ut target.
65
- rt = 1 / ut # target construction Rt
66
- ro = rsi(lc, film) # current construction Ro
67
- new_r = lyr[:r] + (rt - ro) # new, un-derated layer RSi
68
- new_u = 1 / new_r
65
+ rt = 1 / ut # target construction Rt
66
+ ro = rsi(lc, film) # current construction Ro
67
+ new_r = lyr[:r] + (rt - ro) # new, un-derated layer RSi
68
+ new_u = 1 / new_r
69
69
 
70
70
  # Then, uprate (if possible) to counter expected thermal bridging effects.
71
- u_psi = hloss / area # from psi & khi
72
- new_u = new_u - u_psi # uprated layer USi to counter psi & khi
73
- new_r = 1 / new_u # uprated layer RSi to counter psi & khi
71
+ u_psi = hloss / area # from psi & khi
72
+ new_u -= u_psi # uprated layer USi to counter psi & khi
73
+ new_r = 1 / new_u # uprated layer RSi to counter psi & khi
74
74
 
75
75
  return zero("'#{id}': new Rsi", mth, ERR, res) unless new_r > 0.001
76
- loss = 0.0 # residual heatloss (not assigned) [W/K]
76
+
77
+ loss = 0.0 # residual heatloss (not assigned) [W/K]
77
78
 
78
79
  if lyr[:type] == :massless
79
80
  m = lc.getLayer(lyr[:index]).to_MasslessOpaqueMaterial
80
81
  return invalid("'#{id}' massless layer?", mth, 0) if m.empty?
82
+
81
83
  m = m.get.clone(model).to_MasslessOpaqueMaterial.get
82
84
  m.setName("#{id} uprated")
83
85
  new_r = 0.001 unless new_r > 0.001
84
86
  loss = (new_u - 1 / new_r) * area unless new_r > 0.001
85
87
  m.setThermalResistance(new_r)
86
88
  else # type == :standard
87
- m = lc.getLayer(lyr[:index]).to_StandardOpaqueMaterial
89
+ m = lc.getLayer(lyr[:index]).to_StandardOpaqueMaterial
88
90
  return invalid("'#{id}' standard layer?", mth, 0) if m.empty?
91
+
89
92
  m = m.get.clone(model).to_StandardOpaqueMaterial.get
90
93
  m.setName("#{id} uprated")
91
94
  k = m.thermalConductivity
@@ -108,10 +111,12 @@ module TBD
108
111
 
109
112
  ok = m.setThickness(d)
110
113
  return invalid("Can't uprate '#{id}': > 3m", mth, 0, ERR, res) unless ok
114
+
111
115
  m.setThermalConductivity(k) if ok
112
116
  end
113
117
 
114
118
  return invalid("", mth, 0, ERR, res) unless m
119
+
115
120
  lc.setLayer(lyr[:index], m)
116
121
  uo = 1 / rsi(lc, film)
117
122
 
@@ -187,6 +192,7 @@ module TBD
187
192
  next unless sss.outsideBoundaryCondition.downcase == "outdoors"
188
193
  next if sss.construction.empty?
189
194
  next if sss.construction.get.to_LayeredConstruction.empty?
195
+
190
196
  c = sss.construction.get.to_LayeredConstruction.get
191
197
  i = c.nameString
192
198
 
@@ -947,7 +953,7 @@ module TBD
947
953
  model = "* modèle : #{ua[:file]}" if ua.key?(:file) && lang == :fr
948
954
  model += " (v#{ua[:version]})" if ua.key?(:version)
949
955
  report << model unless model.empty?
950
- report << "* TBD : v3.0.3"
956
+ report << "* TBD : v3.1.0"
951
957
  report << "* date : #{ua[:date]}"
952
958
 
953
959
  if lang == :en
data/lib/tbd/psi.rb CHANGED
@@ -205,7 +205,7 @@ module TBD
205
205
  rimjoist: 0.300, # *
206
206
  parapet: 0.325, # *
207
207
  fenestration: 0.200, # *
208
- corner: 0.300, # ** "regular (BETBG)", adj. for ext. dimensions
208
+ corner: 0.300, # ** not explicitely stated
209
209
  balcony: 0.500, # *
210
210
  party: 0.450, # *
211
211
  grade: 0.450, # *
@@ -219,7 +219,7 @@ module TBD
219
219
  rimjoist: 0.850, # *
220
220
  parapet: 0.800, # *
221
221
  fenestration: 0.500, # *
222
- corner: 0.850, # ** ... not stated
222
+ corner: 0.850, # ** not explicitely stated
223
223
  balcony: 1.000, # *
224
224
  party: 0.850, # *
225
225
  grade: 0.850, # *
@@ -569,16 +569,21 @@ module TBD
569
569
  return mismatch("argh", s, Hash, mth, DBG, ipt) unless argh.is_a?(Hash)
570
570
  return hashkey("argh", argh, opt, mth, DBG, ipt) unless argh.key?(opt)
571
571
 
572
- argh[:io_path] = nil unless argh.key?(:io_path)
572
+ argh[:io_path ] = nil unless argh.key?(:io_path)
573
573
  argh[:schema_path] = nil unless argh.key?(:schema_path)
574
- pth = argh[:io_path]
574
+
575
+ pth = argh[:io_path ]
575
576
  sch = argh[:schema_path]
576
577
 
577
- if pth
578
- return empty("JSON file", mth, FTL, ipt) unless File.size?(pth)
579
- io = File.read(pth)
580
- io = JSON.parse(io, symbolize_names: true)
581
- return mismatch("io", io, Hash, mth, FTL, ipt) unless io.is_a?(Hash)
578
+ if pth && (pth.is_a?(String) || pth.is_a?(Hash))
579
+ if pth.is_a?(Hash)
580
+ io = pth
581
+ else
582
+ return empty("JSON file", mth, FTL, ipt) unless File.size?(pth)
583
+ io = File.read(pth)
584
+ io = JSON.parse(io, symbolize_names: true)
585
+ return mismatch("io", io, Hash, mth, FTL, ipt) unless io.is_a?(Hash)
586
+ end
582
587
 
583
588
  # Schema validation is not yet supported in the OpenStudio Application.
584
589
  # We nonetheless recommend that users rely on the json-schema gem, or an
data/lib/tbd/ua.rb CHANGED
@@ -62,30 +62,33 @@ module TBD
62
62
  return zero("'#{id}': net area (m2)", mth, ERR, res) unless area > TOL
63
63
 
64
64
  # First, calculate initial layer RSi to initially meet Ut target.
65
- rt = 1 / ut # target construction Rt
66
- ro = rsi(lc, film) # current construction Ro
67
- new_r = lyr[:r] + (rt - ro) # new, un-derated layer RSi
68
- new_u = 1 / new_r
65
+ rt = 1 / ut # target construction Rt
66
+ ro = rsi(lc, film) # current construction Ro
67
+ new_r = lyr[:r] + (rt - ro) # new, un-derated layer RSi
68
+ new_u = 1 / new_r
69
69
 
70
70
  # Then, uprate (if possible) to counter expected thermal bridging effects.
71
- u_psi = hloss / area # from psi & khi
72
- new_u = new_u - u_psi # uprated layer USi to counter psi & khi
73
- new_r = 1 / new_u # uprated layer RSi to counter psi & khi
71
+ u_psi = hloss / area # from psi & khi
72
+ new_u -= u_psi # uprated layer USi to counter psi & khi
73
+ new_r = 1 / new_u # uprated layer RSi to counter psi & khi
74
74
 
75
75
  return zero("'#{id}': new Rsi", mth, ERR, res) unless new_r > 0.001
76
- loss = 0.0 # residual heatloss (not assigned) [W/K]
76
+
77
+ loss = 0.0 # residual heatloss (not assigned) [W/K]
77
78
 
78
79
  if lyr[:type] == :massless
79
80
  m = lc.getLayer(lyr[:index]).to_MasslessOpaqueMaterial
80
81
  return invalid("'#{id}' massless layer?", mth, 0) if m.empty?
82
+
81
83
  m = m.get.clone(model).to_MasslessOpaqueMaterial.get
82
84
  m.setName("#{id} uprated")
83
85
  new_r = 0.001 unless new_r > 0.001
84
86
  loss = (new_u - 1 / new_r) * area unless new_r > 0.001
85
87
  m.setThermalResistance(new_r)
86
88
  else # type == :standard
87
- m = lc.getLayer(lyr[:index]).to_StandardOpaqueMaterial
89
+ m = lc.getLayer(lyr[:index]).to_StandardOpaqueMaterial
88
90
  return invalid("'#{id}' standard layer?", mth, 0) if m.empty?
91
+
89
92
  m = m.get.clone(model).to_StandardOpaqueMaterial.get
90
93
  m.setName("#{id} uprated")
91
94
  k = m.thermalConductivity
@@ -108,10 +111,12 @@ module TBD
108
111
 
109
112
  ok = m.setThickness(d)
110
113
  return invalid("Can't uprate '#{id}': > 3m", mth, 0, ERR, res) unless ok
114
+
111
115
  m.setThermalConductivity(k) if ok
112
116
  end
113
117
 
114
118
  return invalid("", mth, 0, ERR, res) unless m
119
+
115
120
  lc.setLayer(lyr[:index], m)
116
121
  uo = 1 / rsi(lc, film)
117
122
 
@@ -187,6 +192,7 @@ module TBD
187
192
  next unless sss.outsideBoundaryCondition.downcase == "outdoors"
188
193
  next if sss.construction.empty?
189
194
  next if sss.construction.get.to_LayeredConstruction.empty?
195
+
190
196
  c = sss.construction.get.to_LayeredConstruction.get
191
197
  i = c.nameString
192
198
 
@@ -947,7 +953,7 @@ module TBD
947
953
  model = "* modèle : #{ua[:file]}" if ua.key?(:file) && lang == :fr
948
954
  model += " (v#{ua[:version]})" if ua.key?(:version)
949
955
  report << model unless model.empty?
950
- report << "* TBD : v3.0.3"
956
+ report << "* TBD : v3.1.0"
951
957
  report << "* date : #{ua[:date]}"
952
958
 
953
959
  if lang == :en
data/lib/tbd/version.rb CHANGED
@@ -21,5 +21,5 @@
21
21
  # SOFTWARE.
22
22
 
23
23
  module TBD
24
- VERSION = "3.0.3".freeze
24
+ VERSION = "3.1.0".freeze
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tbd
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.3
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Bourgeois & Dan Macumber
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-21 00:00:00.000000000 Z
11
+ date: 2022-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: topolys
@@ -124,13 +124,11 @@ files:
124
124
  - LICENSE.md
125
125
  - README.md
126
126
  - Rakefile
127
- - json/midrise.json
128
127
  - json/tbd_5ZoneNoHVAC.json
129
128
  - json/tbd_5ZoneNoHVAC_btap.json
130
129
  - json/tbd_seb_n2.json
131
130
  - json/tbd_seb_n4.json
132
131
  - json/tbd_warehouse10.json
133
- - json/tbd_warehouse5.json
134
132
  - lib/measures/tbd/LICENSE.md
135
133
  - lib/measures/tbd/README.md
136
134
  - lib/measures/tbd/README.md.erb
@@ -163,7 +161,7 @@ licenses:
163
161
  - MIT
164
162
  metadata:
165
163
  homepage_uri: https://github.com/rd2/tbd
166
- source_code_uri: https://github.com/rd2/tbd/tree/v3.0.3
164
+ source_code_uri: https://github.com/rd2/tbd/tree/v3.1.0
167
165
  bug_tracker_uri: https://github.com/rd2/tbd/issues
168
166
  post_install_message:
169
167
  rdoc_options: []
data/json/midrise.json DELETED
@@ -1,64 +0,0 @@
1
- {
2
- "schema": "https://github.com/rd2/tbd/blob/master/tbd.schema.json",
3
- "description": "sorting out multiple story PSI sets (midrise)",
4
- "psis": [{
5
- "id": "compliant",
6
- "rimjoist": 0.3,
7
- "parapet": 0.325,
8
- "fenestration": 0.35,
9
- "corner": 0.45,
10
- "balcony": 0.5,
11
- "party": 0.5,
12
- "grade": 0.45
13
- },
14
- {
15
- "id": "Building Story 1",
16
- "rimjoist": 0.501,
17
- "parapet": 0.511,
18
- "fenestration": 0.521,
19
- "cornerconcave": 0.531,
20
- "cornerconvex": 0.541,
21
- "balcony": 0.551,
22
- "party": 0.561,
23
- "grade": 0.571
24
- },
25
- {
26
- "id": "Building Story 2",
27
- "rimjoist": 0.401,
28
- "parapet": 0.411,
29
- "fenestration": 0.421,
30
- "cornerconcave": 0.431,
31
- "cornerconvex": 0.441,
32
- "balcony": 0.451,
33
- "party": 0.461,
34
- "grade": 0.471
35
- },
36
- {
37
- "id": "Building Story 3",
38
- "rimjoist": 0.301,
39
- "parapet": 0.311,
40
- "fenestration": 0.321,
41
- "cornerconcave": 0.331,
42
- "cornerconvex": 0.341,
43
- "balcony": 0.351,
44
- "party": 0.361,
45
- "grade": 0.371
46
- }
47
- ],
48
- "building": {
49
- "psi": "compliant"
50
- },
51
- "stories": [{
52
- "id": "Building Story 1",
53
- "psi": "Building Story 1"
54
- },
55
- {
56
- "id": "Building Story 2",
57
- "psi": "Building Story 2"
58
- },
59
- {
60
- "id": "Building Story 3",
61
- "psi": "Building Story 3"
62
- }
63
- ]
64
- }
@@ -1,37 +0,0 @@
1
- {
2
- "schema": "https://github.com/rd2/tbd/blob/master/tbd.schema.json",
3
- "description": "test_warehouse.osm with spacetype PSI values",
4
- "psis": [{
5
- "id": "Warehouse Office",
6
- "rimjoist": 0.300,
7
- "parapet": 0.300,
8
- "fenestration": 0.300,
9
- "corner": 0.300,
10
- "balcony": 0.300,
11
- "party": 0.300,
12
- "grade": 0.300
13
- },
14
- {
15
- "id": "Warehouse Fine",
16
- "rimjoist": 0.500,
17
- "parapet": 0.500,
18
- "fenestration": 0.500,
19
- "corner": 0.500,
20
- "balcony": 0.500,
21
- "party": 0.500,
22
- "grade": 0.500
23
- }
24
- ],
25
- "building": {
26
- "psi": "regular (BETBG)"
27
- },
28
- "spacetypes": [{
29
- "id": "Warehouse Office",
30
- "psi": "Warehouse Office"
31
- },
32
- {
33
- "id": "Warehouse Fine",
34
- "psi": "Warehouse Fine"
35
- }
36
- ]
37
- }