osut 0.8.2 → 0.9.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/osut/utils.rb +100 -14
  3. data/lib/osut/version.rb +1 -1
  4. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cacfd84d1bd88a4d089ceb7f14c9d93f32241a186dc7901e3fdb3553f53c3560
4
- data.tar.gz: f02222e23c157f764250ec6c8a14eeb0759fea878d687852f43be66545575c00
3
+ metadata.gz: d67484d6fd3ebaad383a6c13e74bbb1e18f0aafe0f256e82b75143e8f4111b72
4
+ data.tar.gz: 35fb870a56b7cc8822606033e1193bc879c3accbc0075dfb60474f00ae29d0cf
5
5
  SHA512:
6
- metadata.gz: 1f3f1e8fbcb4aba5019b8d99dcb09dc98313000c5a979fe015813ae7deaa5615127900e19c8821a1805704c5da81632b80ba5256118c29b29ca344fe3bc72407
7
- data.tar.gz: ce5b0075a4996abe645d3f80eeaa8291886ed540c50fd89c941a439802bb961537c6c2e24b655c0112c7acd3a1e1b65913f84e057dcac6020644a7bf846296fc
6
+ metadata.gz: c98c740e66d3b860b094c45b7c8fb61d650f185b2a26cee2e994bc086a81be9356a88f78852c5a06fff40ed0e147c402f49ab09d5c9b92faa3003ff99f81372a
7
+ data.tar.gz: bac75a7581ff73142d09652d20993feff817e692fc59ef2cd99391bb7dd8b93e7c2e48892828b5667ed22f1c1a1b0b41dae6f3eb8631b395139ef511cfdf0e82
data/lib/osut/utils.rb CHANGED
@@ -106,26 +106,28 @@ module OSut
106
106
  # default inside + outside air film resistances (m2.K/W)
107
107
  @@film = {
108
108
  shading: 0.000, # NA
109
- partition: 0.150, # uninsulated wood- or steel-framed wall
110
- wall: 0.150, # un/insulated wall
111
- roof: 0.140, # un/insulated roof
112
- floor: 0.190, # un/insulated (exposed) floor
113
- basement: 0.120, # un/insulated basement wall
114
- slab: 0.160, # un/insulated basement slab or slab-on-grade
109
+ ceiling: 0.266, # interzone floor/ceiling
110
+ partition: 0.239, # interzone wall partition
111
+ wall: 0.150, # exposed wall
112
+ roof: 0.135, # exposed roof
113
+ floor: 0.192, # exposed floor
114
+ basement: 0.120, # basement wall
115
+ slab: 0.162, # basement slab or slab-on-grade
115
116
  door: 0.150, # standard, 45mm insulated steel (opaque) door
116
117
  window: 0.150, # vertical fenestration, e.g. glazed doors, windows
117
- skylight: 0.140 # e.g. domed 4' x 4' skylight
118
+ skylight: 0.135 # e.g. domed 4' x 4' skylight
118
119
  }.freeze
119
120
 
120
121
  # default (~1980s) envelope Uo (W/m2•K), based on surface type
121
122
  @@uo = {
122
123
  shading: nil, # N/A
124
+ ceiling: nil, # N/A
123
125
  partition: nil, # N/A
124
126
  wall: 0.384, # rated R14.8 hr•ft2F/Btu
125
127
  roof: 0.327, # rated R17.6 hr•ft2F/Btu
126
128
  floor: 0.317, # rated R17.9 hr•ft2F/Btu (exposed floor)
127
- basement: nil,
128
- slab: nil,
129
+ basement: nil, # N/A
130
+ slab: nil, # N/A
129
131
  door: 1.800, # insulated, unglazed steel door (single layer)
130
132
  window: 2.800, # e.g. patio doors (simple glazing)
131
133
  skylight: 3.500 # all skylight technologies
@@ -197,6 +199,61 @@ module OSut
197
199
  @@mats[:door ][:rho] = 600.000
198
200
  @@mats[:door ][:cp ] = 1000.000
199
201
 
202
+ ##
203
+ # Returns surface air film resistance(s). Surface tilt-dependent values are
204
+ # returned if a valid surface tilt [0, PI] is provided. Otherwise, generic
205
+ # tilt-independent air film resistances are returned instead.
206
+ #
207
+ # @param [:to_sym] surface type, e.g. :roof, :wall, :partition, :ceiling
208
+ # @param [Numeric] surface tilt (in rad), optional
209
+ #
210
+ # @return [Float] surface air film resistance(s)
211
+ # @return [0.0] if invalid input (see logs)
212
+ def filmResistances(type = :wall, tilt = 2 * Math::PI)
213
+ mth = "OSut::#{__callee__}"
214
+
215
+ unless tilt.is_a?(Numeric)
216
+ return mismatch("tilt", tilt, Float, mth, DBG, 0.0)
217
+ end
218
+
219
+ unless type.respond_to?(:to_sym)
220
+ return mismatch("type", type, Symbol, mth, DBG, 0.0)
221
+ end
222
+
223
+ type = type.to_s.downcase.to_sym
224
+
225
+ unless @@film.key?(type)
226
+ return invalid("type", mth, 1, DBG, 0.0)
227
+ end
228
+
229
+ # Generic, tilt-independent values.
230
+ r = @@film[type]
231
+ return r if type == :shading
232
+
233
+ # Valid tilt?
234
+ if tilt.between?(0, Math::PI)
235
+ r = OpenStudio::Model::PlanarSurface.stillAirFilmResistance(tilt)
236
+ return r if type == :basement || type == :slab
237
+
238
+ if type == :ceiling || type == :partition
239
+ # Interzone. Fetch reciprocal tilt, e.g. if tilt == 0°, tiltx = 180°
240
+ tiltx = tilt + Math::PI
241
+
242
+ # Assuming tilt is contrained [0°, 180°] - constrain tiltx [0° 180°]:
243
+ # e.g. tiltx == 210° if tilt == 30°, so convert tiltx to 150°
244
+ # e.g. tiltx == 330° if tilt == 150°, so convert tiltx to 30°
245
+ # e.g. tiltx == 275° if tilt == 95°, so convert tiltx to 85°
246
+ tiltx = Math::PI - tilt if tiltx > Math::PI
247
+
248
+ r += OpenStudio::Model::PlanarSurface.stillAirFilmResistance(tiltx)
249
+ else
250
+ r += 0.03 # "MOVINGAIR_15MPH"
251
+ end
252
+ end
253
+
254
+ r
255
+ end
256
+
200
257
  ##
201
258
  # Validates if every material in a layered construction is standard & opaque.
202
259
  #
@@ -470,7 +527,7 @@ module OSut
470
527
  ##
471
528
  # Resets a construction's Uo factor by adjusting its insulating layer
472
529
  # thermal conductivity, then if needed its thickness (or its RSi value if
473
- # massless). Unless material uniquness is requested, a matching material is
530
+ # massless). Unless material uniqueness is requested, a matching material is
474
531
  # recovered instead of instantiating a new one. The latter is renamed
475
532
  # according to its adjusted conductivity/thickness (or RSi value).
476
533
  #
@@ -600,10 +657,6 @@ module OSut
600
657
  return mismatch("model", model, cl1, mth) unless model.is_a?(cl1)
601
658
  return mismatch("specs", specs, cl2, mth) unless specs.is_a?(cl2)
602
659
 
603
- specs[:id] = "" unless specs.key?(:id)
604
- id = trim(specs[:id])
605
- id = "OSut:CON:#{specs[:type]}" if id.empty?
606
-
607
660
  if specs.key?(:type)
608
661
  unless @@uo.keys.include?(specs[:type])
609
662
  return invalid("surface type", mth, 2, ERR)
@@ -612,6 +665,10 @@ module OSut
612
665
  specs[:type] = :wall
613
666
  end
614
667
 
668
+ specs[:id] = "" unless specs.key?(:id)
669
+ id = trim(specs[:id])
670
+ id = "OSut:CON:#{specs[:type]}" if id.empty?
671
+
615
672
  specs[:uo] = @@uo[ specs[:type] ] unless specs.key?(:uo) # can be nil
616
673
  u = specs[:uo]
617
674
 
@@ -652,6 +709,35 @@ module OSut
652
709
  a[:compo][:mat] = @@mats[mt]
653
710
  a[:compo][:d ] = d
654
711
  a[:compo][:id ] = "OSut:#{mt}:#{format('%03d', d*1000)[-3..-1]}"
712
+ when :ceiling
713
+ unless specs[:clad] == :none
714
+ mt = :concrete
715
+ mt = :material if specs[:clad] == :light
716
+ d = 0.015
717
+ d = 0.100 if specs[:clad] == :medium
718
+ d = 0.200 if specs[:clad] == :heavy
719
+ a[:clad][:mat] = @@mats[mt]
720
+ a[:clad][:d ] = d
721
+ a[:clad][:id ] = "OSut:#{mt}:#{format('%03d', d*1000)[-3..-1]}"
722
+ end
723
+
724
+ mt = :mineral
725
+ mt = :polyiso if specs[:frame] == :medium
726
+ mt = :cellulose if specs[:frame] == :heavy
727
+ mt = :material unless u
728
+ d = 0.100
729
+ d = 0.015 unless u
730
+ a[:compo][:mat] = @@mats[mt]
731
+ a[:compo][:d ] = d
732
+ a[:compo][:id ] = "OSut:#{mt}:#{format('%03d', d*1000)[-3..-1]}"
733
+
734
+ unless specs[:finish] == :none
735
+ mt = :material
736
+ d = 0.015
737
+ a[:finish][:mat] = @@mats[mt]
738
+ a[:finish][:d ] = d
739
+ a[:finish][:id ] = "OSut:#{mt}:#{format('%03d', d*1000)[-3..-1]}"
740
+ end
655
741
  when :partition
656
742
  unless specs[:clad] == :none
657
743
  d = 0.015
data/lib/osut/version.rb CHANGED
@@ -29,5 +29,5 @@
29
29
  # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
30
 
31
31
  module OSut
32
- VERSION = "0.8.2".freeze
32
+ VERSION = "0.9.0".freeze
33
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osut
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Bourgeois
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-02-03 00:00:00.000000000 Z
11
+ date: 2026-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oslg
@@ -90,7 +90,7 @@ licenses:
90
90
  - BSD-3-Clause
91
91
  metadata:
92
92
  homepage_uri: https://github.com/rd2/osut
93
- source_code_uri: https://github.com/rd2/osut/tree/v0.8.2
93
+ source_code_uri: https://github.com/rd2/osut/tree/v0.9.0
94
94
  bug_tracker_uri: https://github.com/rd2/osut/issues
95
95
  post_install_message:
96
96
  rdoc_options: []