honeybee-openstudio 2.17.2 → 2.18.1
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 +4 -4
- data/README.md +1 -2
- data/honeybee-openstudio.gemspec +1 -1
- data/lib/from_openstudio.rb +16 -0
- data/lib/from_openstudio/construction/air.rb +55 -0
- data/lib/from_openstudio/construction/opaque.rb +56 -0
- data/lib/from_openstudio/construction/shade.rb +82 -0
- data/lib/from_openstudio/construction/window.rb +56 -0
- data/lib/from_openstudio/geometry/aperture.rb +4 -1
- data/lib/from_openstudio/geometry/door.rb +6 -1
- data/lib/from_openstudio/geometry/face.rb +6 -3
- data/lib/from_openstudio/geometry/shade.rb +7 -1
- data/lib/from_openstudio/material/opaque_no_mass.rb +17 -12
- data/lib/from_openstudio/model.rb +82 -3
- data/lib/honeybee/_defaults/model.json +123 -127
- data/lib/honeybee/material/opaque_no_mass.rb +1 -1
- data/lib/measures/from_honeybee_model/measure.rb +16 -0
- data/lib/measures/from_honeybee_model_to_gbxml/measure.rb +7 -0
- data/lib/to_openstudio/construction/windowshade.rb +1 -1
- data/lib/to_openstudio/geometry/room.rb +2 -2
- data/lib/to_openstudio/model.rb +7 -0
- metadata +6 -2
@@ -34,6 +34,9 @@
|
|
34
34
|
|
35
35
|
require 'to_openstudio'
|
36
36
|
|
37
|
+
require 'fileutils'
|
38
|
+
require 'pathname'
|
39
|
+
|
37
40
|
# start the measure
|
38
41
|
class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
|
39
42
|
# human readable name
|
@@ -96,6 +99,7 @@ class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
|
|
96
99
|
honeybee_model = Honeybee::Model.read_from_disk(model_json)
|
97
100
|
|
98
101
|
if schedule_csv_dir && !schedule_csv_dir.empty?
|
102
|
+
schedule_csv_dir = Pathname.new(schedule_csv_dir).cleanpath
|
99
103
|
if !Dir.exist?(schedule_csv_dir)
|
100
104
|
runner.registerError("Directory for exported CSV Schedules does not exist '#{schedule_csv_dir}'")
|
101
105
|
return false
|
@@ -106,6 +110,18 @@ class FromHoneybeeModel < OpenStudio::Measure::ModelMeasure
|
|
106
110
|
STDOUT.flush
|
107
111
|
honeybee_model.to_openstudio_model(model)
|
108
112
|
STDOUT.flush
|
113
|
+
|
114
|
+
generated_files_dir = "#{runner.workflow.absoluteRootDir}/generated_files"
|
115
|
+
if schedule_csv_dir && !schedule_csv_dir.empty?
|
116
|
+
if Dir.exist?(schedule_csv_dir)
|
117
|
+
runner.registerInfo("Copying exported schedules from '#{schedule_csv_dir}' to '#{generated_files_dir}'")
|
118
|
+
FileUtils.mkdir_p(generated_files_dir)
|
119
|
+
Dir.glob("#{schedule_csv_dir}/*.csv").each do |file|
|
120
|
+
FileUtils.cp(file, generated_files_dir)
|
121
|
+
end
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
109
125
|
return true
|
110
126
|
end
|
111
127
|
end
|
@@ -90,6 +90,13 @@ class FromHoneybeeModelToGbxml < OpenStudio::Measure::ModelMeasure
|
|
90
90
|
os_model = honeybee_model.to_openstudio_model(model)
|
91
91
|
STDOUT.flush
|
92
92
|
|
93
|
+
# make sure the zone name is different from the space name to comply with gbXML
|
94
|
+
zones = os_model.getThermalZones()
|
95
|
+
zones.each do |zone|
|
96
|
+
zone_name = zone.name.to_s + '_Zone'
|
97
|
+
zone.setName(zone_name)
|
98
|
+
end
|
99
|
+
|
93
100
|
# convert the OpenStudio model into a gbXML Model
|
94
101
|
output_file_path = runner.getStringArgumentValue('output_file_path', user_arguments)
|
95
102
|
if output_file_path && !output_file_path.empty?
|
@@ -45,7 +45,7 @@ module Honeybee
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def to_openstudio(openstudio_model)
|
48
|
-
# write the shaded and unsaded versions of the
|
48
|
+
# write the shaded and unsaded versions of the construction into the model
|
49
49
|
# reverse the shaded and unshaded identifiers so unshaded one is assigned to apertures
|
50
50
|
unshd_id = @hash[:identifier]
|
51
51
|
shd_id = @hash[:window_construction][:identifier]
|
@@ -180,7 +180,7 @@ module Honeybee
|
|
180
180
|
|
181
181
|
if !face[:properties][:energy][:construction]
|
182
182
|
if face[:boundary_condition][:type] == 'Adiabatic'
|
183
|
-
# assign default interior
|
183
|
+
# assign default interior construction for Adiabatic Faces
|
184
184
|
if face[:face_type] != 'Wall'
|
185
185
|
interior_construction = closest_interior_construction(openstudio_model, os_space, face[:face_type])
|
186
186
|
unless interior_construction.nil?
|
@@ -188,7 +188,7 @@ module Honeybee
|
|
188
188
|
end
|
189
189
|
end
|
190
190
|
elsif face[:face_type] == 'AirBoundary'
|
191
|
-
# assign default air boundary
|
191
|
+
# assign default air boundary construction for AirBoundary face types
|
192
192
|
air_construction = closest_air_construction(openstudio_model, os_space)
|
193
193
|
unless air_construction.nil?
|
194
194
|
os_surface.setConstruction(air_construction)
|
data/lib/to_openstudio/model.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: honeybee-openstudio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.18.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanushree Charan
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date: 2021-
|
14
|
+
date: 2021-06-14 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -168,6 +168,10 @@ files:
|
|
168
168
|
- lib/files/reopt_assumptions.json
|
169
169
|
- lib/files/urbanopt_Gemfile
|
170
170
|
- lib/from_openstudio.rb
|
171
|
+
- lib/from_openstudio/construction/air.rb
|
172
|
+
- lib/from_openstudio/construction/opaque.rb
|
173
|
+
- lib/from_openstudio/construction/shade.rb
|
174
|
+
- lib/from_openstudio/construction/window.rb
|
171
175
|
- lib/from_openstudio/geometry/aperture.rb
|
172
176
|
- lib/from_openstudio/geometry/door.rb
|
173
177
|
- lib/from_openstudio/geometry/face.rb
|