honeybee-openstudio 2.26.0 → 2.28.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 +4 -4
- data/.github/workflows/ci.yaml +2 -2
- data/Gemfile +1 -1
- data/honeybee-openstudio.gemspec +3 -3
- data/lib/files/urbanopt_Gemfile +1 -1
- data/lib/from_openstudio/construction/air.rb +3 -0
- data/lib/from_openstudio/construction/opaque.rb +3 -0
- data/lib/from_openstudio/construction/shade.rb +3 -0
- data/lib/from_openstudio/construction/window.rb +3 -0
- data/lib/from_openstudio/construction_set.rb +3 -0
- data/lib/from_openstudio/material/opaque.rb +16 -1
- data/lib/from_openstudio/material/opaque_no_mass.rb +16 -1
- data/lib/from_openstudio/material/window_blind.rb +3 -0
- data/lib/from_openstudio/material/window_gas.rb +3 -0
- data/lib/from_openstudio/material/window_gas_custom.rb +3 -0
- data/lib/from_openstudio/material/window_gas_mixture.rb +3 -0
- data/lib/from_openstudio/material/window_glazing.rb +3 -0
- data/lib/from_openstudio/material/window_simpleglazsys.rb +3 -0
- data/lib/from_openstudio/schedule/fixed_interval.rb +3 -0
- data/lib/from_openstudio/schedule/ruleset.rb +3 -0
- data/lib/from_openstudio/schedule/type_limit.rb +3 -0
- data/lib/honeybee/model.rb +2 -1
- data/lib/honeybee/model_object.rb +32 -1
- data/lib/honeybee/simulation/parameter_model.rb +2 -1
- data/lib/measures/from_honeybee_model_to_gbxml/measure.rb +0 -7
- data/lib/to_openstudio/construction/air.rb +3 -0
- data/lib/to_openstudio/construction/opaque.rb +3 -0
- data/lib/to_openstudio/construction/shade.rb +3 -0
- data/lib/to_openstudio/construction/window.rb +3 -1
- data/lib/to_openstudio/construction/windowshade.rb +3 -2
- data/lib/to_openstudio/construction_set.rb +3 -2
- data/lib/to_openstudio/geometry/aperture.rb +4 -0
- data/lib/to_openstudio/geometry/door.rb +4 -0
- data/lib/to_openstudio/geometry/face.rb +3 -0
- data/lib/to_openstudio/geometry/room.rb +5 -2
- data/lib/to_openstudio/geometry/shade.rb +3 -1
- data/lib/to_openstudio/hvac/ideal_air.rb +3 -1
- data/lib/to_openstudio/load/electric_equipment.rb +3 -0
- data/lib/to_openstudio/load/gas_equipment.rb +3 -0
- data/lib/to_openstudio/load/infiltration.rb +3 -1
- data/lib/to_openstudio/load/lighting.rb +3 -0
- data/lib/to_openstudio/load/people.rb +3 -0
- data/lib/to_openstudio/load/process.rb +3 -0
- data/lib/to_openstudio/load/service_hot_water.rb +1 -1
- data/lib/to_openstudio/load/ventilation.rb +3 -0
- data/lib/to_openstudio/material/opaque.rb +3 -0
- data/lib/to_openstudio/material/opaque_no_mass.rb +3 -1
- data/lib/to_openstudio/material/window_blind.rb +3 -1
- data/lib/to_openstudio/material/window_gas.rb +3 -1
- data/lib/to_openstudio/material/window_gas_custom.rb +3 -0
- data/lib/to_openstudio/material/window_gas_mixture.rb +3 -1
- data/lib/to_openstudio/material/window_glazing.rb +3 -1
- data/lib/to_openstudio/material/window_shade.rb +3 -1
- data/lib/to_openstudio/material/window_simpleglazsys.rb +3 -1
- data/lib/to_openstudio/model.rb +0 -3
- data/lib/to_openstudio/program_type.rb +3 -1
- data/lib/to_openstudio/schedule/fixed_interval.rb +6 -1
- data/lib/to_openstudio/schedule/ruleset.rb +6 -1
- data/lib/to_openstudio/schedule/type_limit.rb +3 -1
- data/lib/to_openstudio/simulation/parameter_model.rb +11 -3
- metadata +6 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 68d5909ca4defd67e4437a988537724db7f6b1ae5691342278eb0c13c47cc033
|
|
4
|
+
data.tar.gz: ada6cbf89e0813172a16b4ffb1ac7fa78a26c6018e4b5a439586d886816a55e4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5e0eee873af2b06907cfed7ca2124d27ab9396f0d43eb8b1cf7895910d4645bd26b3dd84357f6954bfa85502fa4b61332fd7d2e2171d33a5a3797ede14e3ef3e
|
|
7
|
+
data.tar.gz: 1a784987d9db719a4cb703f2e47041f2612003fa3b1595a5c6bf017a2f895d9edbf494462cfd0141c9783f929a3c3450fd691f7457882427642acef706a9f528
|
data/.github/workflows/ci.yaml
CHANGED
|
@@ -15,8 +15,8 @@ jobs:
|
|
|
15
15
|
run: |
|
|
16
16
|
echo $(pwd)
|
|
17
17
|
echo $(ls)
|
|
18
|
-
docker pull nrel/openstudio:3.
|
|
19
|
-
docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.
|
|
18
|
+
docker pull nrel/openstudio:3.3.0
|
|
19
|
+
docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.3.0
|
|
20
20
|
docker exec -t test pwd
|
|
21
21
|
docker exec -t test ls
|
|
22
22
|
docker exec -t test bundle update
|
data/Gemfile
CHANGED
|
@@ -7,7 +7,7 @@ gemspec
|
|
|
7
7
|
if File.exist?('../OpenStudio-extension-gem') # local development copy
|
|
8
8
|
gem 'openstudio-extension', path: '../OpenStudio-extension-gem'
|
|
9
9
|
else # get it from rubygems.org
|
|
10
|
-
gem 'openstudio-extension', '0.
|
|
10
|
+
gem 'openstudio-extension', '0.5.1'
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
# coveralls gem is used to generate coverage reports through CI
|
data/honeybee-openstudio.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'honeybee-openstudio'
|
|
7
|
-
spec.version = '2.
|
|
7
|
+
spec.version = '2.28.0'
|
|
8
8
|
spec.authors = ['Tanushree Charan', 'Dan Macumber', 'Chris Mackey', 'Mostapha Sadeghipour Roudsari']
|
|
9
9
|
spec.email = ['tanushree.charan@nrel.gov', 'chris@ladybug.tools']
|
|
10
10
|
|
|
@@ -33,6 +33,6 @@ Gem::Specification.new do |spec|
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
spec.add_dependency 'json_pure'
|
|
36
|
-
spec.add_dependency 'openstudio-extension', '0.
|
|
37
|
-
spec.add_dependency 'openstudio-standards', '~> 0.2.
|
|
36
|
+
spec.add_dependency 'openstudio-extension', '0.5.1'
|
|
37
|
+
spec.add_dependency 'openstudio-standards', '~> 0.2.15'
|
|
38
38
|
end
|
data/lib/files/urbanopt_Gemfile
CHANGED
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'AirBoundaryConstructionAbridged'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(construction.nameString)
|
|
44
|
+
unless construction.displayName.empty?
|
|
45
|
+
hash[:display_name] = (construction.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
# check if boost optional object is empty
|
|
45
48
|
unless construction.simpleMixingSchedule.empty?
|
|
46
49
|
schedule = construction.simpleMixingSchedule.get
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'OpaqueConstructionAbridged'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(construction.nameString)
|
|
44
|
+
unless construction.displayName.empty?
|
|
45
|
+
hash[:display_name] = (construction.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:materials] = []
|
|
45
48
|
# get construction layers
|
|
46
49
|
layers = construction.layers
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'ShadeConstruction'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(construction.nameString)
|
|
44
|
+
unless construction.displayName.empty?
|
|
45
|
+
hash[:display_name] = (construction.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
# get outermost construction layers
|
|
45
48
|
layer = construction.layers[0]
|
|
46
49
|
if layer.to_StandardGlazing.is_initialized
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'WindowConstructionAbridged'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(construction.nameString)
|
|
44
|
+
unless construction.displayName.empty?
|
|
45
|
+
hash[:display_name] = (construction.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:materials] = []
|
|
45
48
|
# get construction layers
|
|
46
49
|
layers = construction.layers
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'ConstructionSetAbridged'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(construction_set.nameString)
|
|
44
|
+
unless construction_set.displayName.empty?
|
|
45
|
+
hash[:display_name] = (construction_set.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:wall_set] = {}
|
|
45
48
|
hash[:floor_set] = {}
|
|
46
49
|
hash[:aperture_set] = {}
|
|
@@ -41,11 +41,26 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'EnergyMaterial'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(material.nameString)
|
|
44
|
+
unless material.displayName.empty?
|
|
45
|
+
hash[:display_name] = (material.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:thickness] = material.thickness
|
|
45
48
|
hash[:conductivity] = material.conductivity
|
|
46
49
|
hash[:density] = material.density
|
|
47
50
|
hash[:specific_heat] = material.specificHeat
|
|
48
|
-
|
|
51
|
+
case material.roughness.downcase
|
|
52
|
+
when 'veryrough'
|
|
53
|
+
hash[:roughness] == 'VeryRough'
|
|
54
|
+
when 'mediumrough'
|
|
55
|
+
hash[:roughness] == 'MediumRough'
|
|
56
|
+
when 'mediumsmooth'
|
|
57
|
+
hash[:roughness] == 'MediumSmooth'
|
|
58
|
+
when 'verysmooth'
|
|
59
|
+
hash[:roughness] == 'VerySmooth'
|
|
60
|
+
# In case of Rough or Smooth
|
|
61
|
+
else
|
|
62
|
+
hash[:roughness] = material.roughness.titleize
|
|
63
|
+
end
|
|
49
64
|
hash[:thermal_absorptance] = material.thermalAbsorptance
|
|
50
65
|
hash[:solar_absorptance] = material.solarAbsorptance
|
|
51
66
|
hash[:visible_absorptance] = material.visibleAbsorptance
|
|
@@ -41,12 +41,27 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'EnergyMaterialNoMass'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(material.nameString)
|
|
44
|
+
unless material.displayName.empty?
|
|
45
|
+
hash[:display_name] = (material.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:r_value] = material.thermalResistance
|
|
45
48
|
|
|
46
49
|
if material.to_MasslessOpaqueMaterial.is_initialized
|
|
47
50
|
# Roughness is a required property for OS MasslessOpaqueMaterial but isn't a listed
|
|
48
51
|
# property for OS AirGap
|
|
49
|
-
|
|
52
|
+
case material.roughness.downcase
|
|
53
|
+
when 'veryrough'
|
|
54
|
+
hash[:roughness] == 'VeryRough'
|
|
55
|
+
when 'mediumrough'
|
|
56
|
+
hash[:roughness] == 'MediumRough'
|
|
57
|
+
when 'mediumsmooth'
|
|
58
|
+
hash[:roughness] == 'MediumSmooth'
|
|
59
|
+
when 'verysmooth'
|
|
60
|
+
hash[:roughness] == 'VerySmooth'
|
|
61
|
+
# In case of Rough or Smooth
|
|
62
|
+
else
|
|
63
|
+
hash[:roughness] = material.roughness.titleize
|
|
64
|
+
end
|
|
50
65
|
# check if boost optional object is empty
|
|
51
66
|
unless material.thermalAbsorptance.empty?
|
|
52
67
|
hash[:thermal_absorptance] = material.thermalAbsorptance.get
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'EnergyWindowMaterialBlind'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(material.nameString)
|
|
44
|
+
unless material.displayName.empty?
|
|
45
|
+
hash[:display_name] = (material.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:slat_orientation] = material.slatOrientation
|
|
45
48
|
hash[:slat_width] = material.slatWidth
|
|
46
49
|
hash[:slat_separation] = material.slatSeparation
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'EnergyWindowMaterialGas'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(material.nameString)
|
|
44
|
+
unless material.displayName.empty?
|
|
45
|
+
hash[:display_name] = (material.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:thickness] = material.thickness
|
|
45
48
|
hash[:gas_type] = material.gasType
|
|
46
49
|
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'EnergyWindowMaterialGasCustom'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(material.nameString)
|
|
44
|
+
unless material.displayName.empty?
|
|
45
|
+
hash[:display_name] = (material.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:thickness] = material.thickness
|
|
45
48
|
# check if boost optional object is empty
|
|
46
49
|
unless material.customConductivityCoefficientA.empty?
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'EnergyWindowMaterialGasMixture'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(material.nameString)
|
|
44
|
+
unless material.displayName.empty?
|
|
45
|
+
hash[:display_name] = (material.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:thickness] = material.thickness
|
|
45
48
|
hash[:gas_types] = []
|
|
46
49
|
hash[:gas_fractions] = []
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'EnergyWindowMaterialGlazing'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(material.nameString)
|
|
44
|
+
unless material.displayName.empty?
|
|
45
|
+
hash[:display_name] = (material.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:thickness] = material.thickness
|
|
45
48
|
hash[:solar_transmittance] = material.solarTransmittance
|
|
46
49
|
# check if boost optional object is empty
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'EnergyWindowMaterialSimpleGlazSys'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(material.nameString)
|
|
44
|
+
unless material.displayName.empty?
|
|
45
|
+
hash[:display_name] = (material.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:u_factor] = material.uFactor
|
|
45
48
|
hash[:shgc] = material.solarHeatGainCoefficient
|
|
46
49
|
# check if boost optional object is empty
|
|
@@ -40,6 +40,9 @@ module Honeybee
|
|
|
40
40
|
hash = {}
|
|
41
41
|
hash[:type] = 'ScheduleFixedIntervalAbridged'
|
|
42
42
|
hash[:identifier] = clean_name(schedule_fixedinterval.nameString)
|
|
43
|
+
unless schedule_fixedinterval.displayName.empty?
|
|
44
|
+
hash[:display_name] = (schedule_fixedinterval.displayName.get).force_encoding("UTF-8")
|
|
45
|
+
end
|
|
43
46
|
start_month = schedule_fixedinterval.startMonth
|
|
44
47
|
start_day = schedule_fixedinterval.startDay
|
|
45
48
|
if is_leap_year
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'ScheduleRulesetAbridged'
|
|
42
42
|
# set the primary (required) day schedules of the object
|
|
43
43
|
hash[:identifier] = clean_name(schedule_ruleset.nameString)
|
|
44
|
+
unless schedule_ruleset.displayName.empty?
|
|
45
|
+
hash[:display_name] = (schedule_ruleset.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
hash[:default_day_schedule] = clean_name(schedule_ruleset.defaultDaySchedule.nameString)
|
|
45
48
|
hash[:summer_designday_schedule] = clean_name(schedule_ruleset.summerDesignDaySchedule.nameString)
|
|
46
49
|
hash[:winter_designday_schedule] = clean_name(schedule_ruleset.winterDesignDaySchedule.nameString)
|
|
@@ -41,6 +41,9 @@ module Honeybee
|
|
|
41
41
|
hash[:type] = 'ScheduleTypeLimit'
|
|
42
42
|
# set hash values from OpenStudio Object
|
|
43
43
|
hash[:identifier] = clean_name(schedule_type_limit.nameString)
|
|
44
|
+
unless schedule_type_limit.displayName.empty?
|
|
45
|
+
hash[:display_name] = (schedule_type_limit.displayName.get).force_encoding("UTF-8")
|
|
46
|
+
end
|
|
44
47
|
# check if boost optional object is empty
|
|
45
48
|
unless schedule_type_limit.lowerLimitValue.empty?
|
|
46
49
|
hash[:lower_limit] = schedule_type_limit.lowerLimitValue.get
|
data/lib/honeybee/model.rb
CHANGED
|
@@ -40,7 +40,8 @@ module Honeybee
|
|
|
40
40
|
def self.read_from_disk(file)
|
|
41
41
|
hash = nil
|
|
42
42
|
File.open(File.join(file), 'r') do |f|
|
|
43
|
-
hash = JSON.parse(
|
|
43
|
+
hash = JSON.parse(File.read(f, :external_encoding => 'UTF-8',
|
|
44
|
+
:internal_encoding => 'UTF-8'), symbolize_names: true, encoding: 'UTF-8')
|
|
44
45
|
end
|
|
45
46
|
Model.new(hash)
|
|
46
47
|
end
|
|
@@ -30,6 +30,20 @@
|
|
|
30
30
|
# *******************************************************************************
|
|
31
31
|
|
|
32
32
|
module Honeybee
|
|
33
|
+
class FakeOptionalString
|
|
34
|
+
def initialize(str)
|
|
35
|
+
@str = str
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def empty?
|
|
39
|
+
false
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def get
|
|
43
|
+
@str
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
33
47
|
class ModelObject
|
|
34
48
|
# Base class from which all other objects in this module inherit.
|
|
35
49
|
# Attributes and methods of this class should be overwritten in each inheriting object.
|
|
@@ -43,6 +57,7 @@ module Honeybee
|
|
|
43
57
|
:universal_newline => true # Always break lines with \n
|
|
44
58
|
}
|
|
45
59
|
|
|
60
|
+
|
|
46
61
|
def method_missing(sym, *args)
|
|
47
62
|
name = sym.to_s
|
|
48
63
|
aname = name.sub('=', '')
|
|
@@ -64,7 +79,8 @@ module Honeybee
|
|
|
64
79
|
def self.read_from_disk(file)
|
|
65
80
|
hash = nil
|
|
66
81
|
File.open(File.join(file), 'r') do |f|
|
|
67
|
-
hash = JSON.parse(
|
|
82
|
+
hash = JSON.parse(File.read(f, :external_encoding => 'UTF-8',
|
|
83
|
+
:internal_encoding => 'UTF-8'), symbolize_names: true, encoding: 'UTF-8')
|
|
68
84
|
end
|
|
69
85
|
new(hash)
|
|
70
86
|
end
|
|
@@ -116,6 +132,21 @@ module Honeybee
|
|
|
116
132
|
encode_str.gsub(/[^.A-Za-z0-9_-]/, '_').gsub(' ', '_')
|
|
117
133
|
end
|
|
118
134
|
|
|
135
|
+
# Create methods to get and set display name
|
|
136
|
+
if !OpenStudio::Model::ModelObject.method_defined?(:displayName)
|
|
137
|
+
OpenStudio::Model::ModelObject.class_eval do
|
|
138
|
+
define_method(:displayName) do
|
|
139
|
+
result = additionalProperties.getFeatureAsString("DisplayName")
|
|
140
|
+
if !result.empty?
|
|
141
|
+
result = FakeOptionalString.new(result.get.force_encoding(Encoding::UTF_8))
|
|
142
|
+
end
|
|
143
|
+
result
|
|
144
|
+
end
|
|
145
|
+
define_method(:setDisplayName) do |value|
|
|
146
|
+
additionalProperties.setFeature("DisplayName", value)
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|
|
119
150
|
|
|
120
151
|
end # ModelObject
|
|
121
152
|
end # Honeybee
|
|
@@ -40,7 +40,8 @@ module Honeybee
|
|
|
40
40
|
def self.read_from_disk(file)
|
|
41
41
|
hash = nil
|
|
42
42
|
File.open(File.join(file), 'r') do |f|
|
|
43
|
-
hash = JSON.parse(
|
|
43
|
+
hash = JSON.parse(File.read(f, :external_encoding => 'UTF-8',
|
|
44
|
+
:internal_encoding => 'UTF-8'), symbolize_names: true, encoding: 'UTF-8')
|
|
44
45
|
end
|
|
45
46
|
|
|
46
47
|
SimulationParameter.new(hash)
|
|
@@ -91,13 +91,6 @@ class FromHoneybeeModelToGbxml < OpenStudio::Measure::ModelMeasure
|
|
|
91
91
|
os_model = honeybee_model.to_openstudio_model(model)
|
|
92
92
|
STDOUT.flush
|
|
93
93
|
|
|
94
|
-
# make sure the zone name is different from the space name to comply with gbXML
|
|
95
|
-
zones = os_model.getThermalZones()
|
|
96
|
-
zones.each do |zone|
|
|
97
|
-
zone_name = zone.name.to_s + '_Zone'
|
|
98
|
-
zone.setName(zone_name)
|
|
99
|
-
end
|
|
100
|
-
|
|
101
94
|
# convert the OpenStudio model into a gbXML Model
|
|
102
95
|
output_file_path = runner.getStringArgumentValue('output_file_path', user_arguments)
|
|
103
96
|
if output_file_path && !output_file_path.empty?
|
|
@@ -46,6 +46,9 @@ module Honeybee
|
|
|
46
46
|
os_construction = OpenStudio::Model::ConstructionAirBoundary.new(openstudio_model)
|
|
47
47
|
os_construction.setName(@hash[:identifier])
|
|
48
48
|
os_construction.setAirExchangeMethod('None')
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_construction.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
49
52
|
|
|
50
53
|
os_construction
|
|
51
54
|
end
|
|
@@ -46,6 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create construction and set identifier
|
|
47
47
|
os_construction = OpenStudio::Model::Construction.new(openstudio_model)
|
|
48
48
|
os_construction.setName(@hash[:identifier])
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_construction.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
49
52
|
|
|
50
53
|
# create material vector
|
|
51
54
|
os_materials = OpenStudio::Model::MaterialVector.new
|
|
@@ -46,6 +46,9 @@ module Honeybee
|
|
|
46
46
|
|
|
47
47
|
os_construction = OpenStudio::Model::Construction.new(openstudio_model)
|
|
48
48
|
os_construction.setName(@hash[:identifier])
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_construction.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
49
52
|
os_materials = OpenStudio::Model::MaterialVector.new
|
|
50
53
|
|
|
51
54
|
# create standard glazing if is specular is true
|
|
@@ -46,7 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create construction and set identifier
|
|
47
47
|
os_construction = OpenStudio::Model::Construction.new(openstudio_model)
|
|
48
48
|
os_construction.setName(@hash[:identifier])
|
|
49
|
-
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_construction.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
50
52
|
# create material vector
|
|
51
53
|
os_materials = OpenStudio::Model::MaterialVector.new
|
|
52
54
|
# loop through each layer and add to material vector
|
|
@@ -51,7 +51,6 @@ module Honeybee
|
|
|
51
51
|
shd_id = @hash[:window_construction][:identifier]
|
|
52
52
|
@hash[:window_construction][:identifier] = unshd_id
|
|
53
53
|
@hash[:identifier] = shd_id
|
|
54
|
-
|
|
55
54
|
# create the unshaded construction
|
|
56
55
|
unshd_constr_obj = WindowConstructionAbridged.new(@hash[:window_construction])
|
|
57
56
|
@construction = unshd_constr_obj.to_openstudio(openstudio_model)
|
|
@@ -59,7 +58,9 @@ module Honeybee
|
|
|
59
58
|
# create the shaded construction
|
|
60
59
|
@shade_construction = OpenStudio::Model::Construction.new(openstudio_model)
|
|
61
60
|
@shade_construction.setName(shd_id)
|
|
62
|
-
|
|
61
|
+
unless @hash[:display_name].nil?
|
|
62
|
+
@shade_construction.setDisplayName(@hash[:display_name])
|
|
63
|
+
end
|
|
63
64
|
# create the layers of the unshaded construction into which we will insert the shade
|
|
64
65
|
os_materials = []
|
|
65
66
|
if @hash.key?(:layers)
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
# *******************************************************************************
|
|
31
31
|
|
|
32
32
|
require 'honeybee/construction_set'
|
|
33
|
-
|
|
34
33
|
require 'to_openstudio/model_object'
|
|
35
34
|
|
|
36
35
|
module Honeybee
|
|
@@ -46,7 +45,9 @@ module Honeybee
|
|
|
46
45
|
# create the constructionset object
|
|
47
46
|
os_constr_set = OpenStudio::Model::DefaultConstructionSet.new(openstudio_model)
|
|
48
47
|
os_constr_set.setName(@hash[:identifier])
|
|
49
|
-
|
|
48
|
+
unless @hash[:display_name].nil?
|
|
49
|
+
os_constr_set.setDisplayName(@hash[:display_name])
|
|
50
|
+
end
|
|
50
51
|
int_surf_const = OpenStudio::Model::DefaultSurfaceConstructions.new(openstudio_model)
|
|
51
52
|
ext_surf_const = OpenStudio::Model::DefaultSurfaceConstructions.new(openstudio_model)
|
|
52
53
|
grnd_surf_const = OpenStudio::Model::DefaultSurfaceConstructions.new(openstudio_model)
|
|
@@ -114,6 +114,10 @@ module Honeybee
|
|
|
114
114
|
os_subsurface.setName(@hash[:identifier])
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
+
unless @hash[:display_name].nil?
|
|
118
|
+
os_subsurface.setDisplayName(@hash[:display_name])
|
|
119
|
+
end
|
|
120
|
+
|
|
117
121
|
# assign the construction if it exists
|
|
118
122
|
if @hash[:properties][:energy][:construction]
|
|
119
123
|
construction_identifier = @hash[:properties][:energy][:construction]
|
|
@@ -114,6 +114,10 @@ module Honeybee
|
|
|
114
114
|
os_subsurface.setName(@hash[:identifier])
|
|
115
115
|
end
|
|
116
116
|
|
|
117
|
+
unless @hash[:display_name].nil?
|
|
118
|
+
os_subsurface.setDisplayName(@hash[:display_name])
|
|
119
|
+
end
|
|
120
|
+
|
|
117
121
|
# assign the construction if it exists
|
|
118
122
|
if @hash[:properties][:energy][:construction]
|
|
119
123
|
construction_identifier = @hash[:properties][:energy][:construction]
|
|
@@ -60,6 +60,9 @@ module Honeybee
|
|
|
60
60
|
# create the openstudio surface and assign the type
|
|
61
61
|
os_surface = OpenStudio::Model::Surface.new(reordered_vertices, openstudio_model)
|
|
62
62
|
os_surface.setName(@hash[:identifier])
|
|
63
|
+
unless @hash[:display_name].nil?
|
|
64
|
+
os_surface.setDisplayName(@hash[:display_name])
|
|
65
|
+
end
|
|
63
66
|
os_surface.setSurfaceType(@hash[:face_type])
|
|
64
67
|
|
|
65
68
|
# assign the construction if it is present
|
|
@@ -39,7 +39,7 @@ module Honeybee
|
|
|
39
39
|
attr_reader :unique_space_type
|
|
40
40
|
|
|
41
41
|
def find_existing_openstudio_object(openstudio_model)
|
|
42
|
-
model_space = openstudio_model.getSpaceByName(@hash[:identifier])
|
|
42
|
+
model_space = openstudio_model.getSpaceByName(@hash[:identifier] + '_Space')
|
|
43
43
|
return model_space.get unless model_space.empty?
|
|
44
44
|
nil
|
|
45
45
|
end
|
|
@@ -75,7 +75,10 @@ module Honeybee
|
|
|
75
75
|
def to_openstudio(openstudio_model)
|
|
76
76
|
# create the space and thermal zone
|
|
77
77
|
os_space = OpenStudio::Model::Space.new(openstudio_model)
|
|
78
|
-
os_space.setName(@hash[:identifier])
|
|
78
|
+
os_space.setName(@hash[:identifier] + '_Space')
|
|
79
|
+
unless @hash[:display_name].nil?
|
|
80
|
+
os_space.setDisplayName(@hash[:display_name])
|
|
81
|
+
end
|
|
79
82
|
os_thermal_zone = OpenStudio::Model::ThermalZone.new(openstudio_model)
|
|
80
83
|
os_thermal_zone.setName(@hash[:identifier])
|
|
81
84
|
os_space.setThermalZone(os_thermal_zone)
|
|
@@ -59,7 +59,9 @@ module Honeybee
|
|
|
59
59
|
|
|
60
60
|
os_shading_surface = OpenStudio::Model::ShadingSurface.new(reordered_vertices, openstudio_model)
|
|
61
61
|
os_shading_surface.setName(@hash[:identifier])
|
|
62
|
-
|
|
62
|
+
unless @hash[:display_name].nil?
|
|
63
|
+
os_shading_surface.setDisplayName(@hash[:display_name])
|
|
64
|
+
end
|
|
63
65
|
# assign the construction if it exists
|
|
64
66
|
if @hash[:properties][:energy][:construction]
|
|
65
67
|
construction_identifier = @hash[:properties][:energy][:construction]
|
|
@@ -40,7 +40,9 @@ module Honeybee
|
|
|
40
40
|
# create the ideal air system and set the identifier
|
|
41
41
|
os_ideal_air = OpenStudio::Model::ZoneHVACIdealLoadsAirSystem.new(openstudio_model)
|
|
42
42
|
os_ideal_air.setName(@hash[:identifier])
|
|
43
|
-
|
|
43
|
+
unless @hash[:display_name].nil?
|
|
44
|
+
os_ideal_air.setDisplayName(@hash[:display_name])
|
|
45
|
+
end
|
|
44
46
|
# assign the economizer type
|
|
45
47
|
if @hash[:economizer_type]
|
|
46
48
|
os_ideal_air.setOutdoorAirEconomizerType(@hash[:economizer_type])
|
|
@@ -47,6 +47,9 @@ module Honeybee
|
|
|
47
47
|
os_electric_equip_def = OpenStudio::Model::ElectricEquipmentDefinition.new(openstudio_model)
|
|
48
48
|
os_electric_equip = OpenStudio::Model::ElectricEquipment.new(os_electric_equip_def)
|
|
49
49
|
os_electric_equip_def.setName(@hash[:identifier])
|
|
50
|
+
unless @hash[:display_name].nil?
|
|
51
|
+
os_electric_equip_def.setDisplayName(@hash[:display_name])
|
|
52
|
+
end
|
|
50
53
|
os_electric_equip.setName(@hash[:identifier])
|
|
51
54
|
|
|
52
55
|
# assign watts per area
|
|
@@ -48,6 +48,9 @@ module Honeybee
|
|
|
48
48
|
os_gas_equip_def = OpenStudio::Model::GasEquipmentDefinition.new(openstudio_model)
|
|
49
49
|
os_gas_equip = OpenStudio::Model::GasEquipment.new(os_gas_equip_def)
|
|
50
50
|
os_gas_equip_def.setName(@hash[:identifier])
|
|
51
|
+
unless @hash[:display_name].nil?
|
|
52
|
+
os_gas_equip_def.setDisplayName(@hash[:display_name])
|
|
53
|
+
end
|
|
51
54
|
os_gas_equip.setName(@hash[:identifier])
|
|
52
55
|
|
|
53
56
|
# assign watts per space floor area
|
|
@@ -47,7 +47,9 @@ module Honeybee
|
|
|
47
47
|
# create infiltration OpenStudio object and set identifier
|
|
48
48
|
os_infilt = OpenStudio::Model::SpaceInfiltrationDesignFlowRate.new(openstudio_model)
|
|
49
49
|
os_infilt.setName(@hash[:identifier])
|
|
50
|
-
|
|
50
|
+
unless @hash[:display_name].nil?
|
|
51
|
+
os_infilt.setDisplayName(@hash[:display_name])
|
|
52
|
+
end
|
|
51
53
|
# assign flow per surface
|
|
52
54
|
os_infilt.setFlowperExteriorSurfaceArea(@hash[:flow_per_exterior_area])
|
|
53
55
|
|
|
@@ -48,6 +48,9 @@ module Honeybee
|
|
|
48
48
|
os_lights_def = OpenStudio::Model::LightsDefinition.new(openstudio_model)
|
|
49
49
|
os_lights = OpenStudio::Model::Lights.new(os_lights_def)
|
|
50
50
|
os_lights_def.setName(@hash[:identifier])
|
|
51
|
+
unless @hash[:display_name].nil?
|
|
52
|
+
os_lights_def.setDisplayName(@hash[:display_name])
|
|
53
|
+
end
|
|
51
54
|
os_lights.setName(@hash[:identifier])
|
|
52
55
|
|
|
53
56
|
# assign watts per space floor area
|
|
@@ -48,6 +48,9 @@ module Honeybee
|
|
|
48
48
|
os_people_def = OpenStudio::Model::PeopleDefinition.new(openstudio_model)
|
|
49
49
|
os_people = OpenStudio::Model::People.new(os_people_def)
|
|
50
50
|
os_people_def.setName(@hash[:identifier])
|
|
51
|
+
unless @hash[:display_name].nil?
|
|
52
|
+
os_people_def.setDisplayName(@hash[:display_name])
|
|
53
|
+
end
|
|
51
54
|
os_people.setName(@hash[:identifier])
|
|
52
55
|
|
|
53
56
|
# assign people per space floor area
|
|
@@ -47,6 +47,9 @@ module Honeybee
|
|
|
47
47
|
os_other_equip_def = OpenStudio::Model::OtherEquipmentDefinition.new(openstudio_model)
|
|
48
48
|
os_other_equip = OpenStudio::Model::OtherEquipment.new(os_other_equip_def)
|
|
49
49
|
os_other_equip_def.setName(@hash[:identifier])
|
|
50
|
+
unless @hash[:display_name].nil?
|
|
51
|
+
os_other_equip_def.setDisplayName(@hash[:display_name])
|
|
52
|
+
end
|
|
50
53
|
os_other_equip.setName(@hash[:identifier])
|
|
51
54
|
|
|
52
55
|
# assign watts
|
|
@@ -234,7 +234,7 @@ module Honeybee
|
|
|
234
234
|
# create water use equipment + connection and set identifier
|
|
235
235
|
os_shw_def = OpenStudio::Model::WaterUseEquipmentDefinition.new(openstudio_model)
|
|
236
236
|
os_shw = OpenStudio::Model::WaterUseEquipment.new(os_shw_def)
|
|
237
|
-
unique_id = @hash[:identifier] + '..' + os_space.nameString
|
|
237
|
+
unique_id = @hash[:identifier] + '..' + os_space.nameString[0...-6]
|
|
238
238
|
os_shw_def.setName(unique_id)
|
|
239
239
|
os_shw.setName(unique_id)
|
|
240
240
|
|
|
@@ -46,6 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create ventilation openstudio object and set identifier
|
|
47
47
|
os_vent = OpenStudio::Model::DesignSpecificationOutdoorAir.new(openstudio_model)
|
|
48
48
|
os_vent.setName(@hash[:identifier])
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_vent.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
49
52
|
|
|
50
53
|
# assign air changes per hour if it exists
|
|
51
54
|
if @hash[:air_changes_per_hour]
|
|
@@ -46,6 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create standard opaque OpenStudio material
|
|
47
47
|
os_opaque_mat = OpenStudio::Model::StandardOpaqueMaterial.new(openstudio_model)
|
|
48
48
|
os_opaque_mat.setName(@hash[:identifier])
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_opaque_mat.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
49
52
|
os_opaque_mat.setThickness(@hash[:thickness])
|
|
50
53
|
os_opaque_mat.setConductivity(@hash[:conductivity])
|
|
51
54
|
os_opaque_mat.setDensity(@hash[:density])
|
|
@@ -47,7 +47,9 @@ module Honeybee
|
|
|
47
47
|
# create no mass material OpenStudio object and set identifier
|
|
48
48
|
os_nomass_mat = OpenStudio::Model::MasslessOpaqueMaterial.new(openstudio_model)
|
|
49
49
|
os_nomass_mat.setName(@hash[:identifier])
|
|
50
|
-
|
|
50
|
+
unless @hash[:display_name].nil?
|
|
51
|
+
os_nomass_mat.setDisplayName(@hash[:display_name])
|
|
52
|
+
end
|
|
51
53
|
# assign thermal resistance
|
|
52
54
|
os_nomass_mat.setThermalResistance(@hash[:r_value])
|
|
53
55
|
|
|
@@ -46,7 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create blind OpenStudio object
|
|
47
47
|
os_blind = OpenStudio::Model::Blind.new(openstudio_model)
|
|
48
48
|
os_blind.setName(@hash[:identifier])
|
|
49
|
-
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_blind.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
50
52
|
# assign slat orientation
|
|
51
53
|
if @hash[:slat_orientation]
|
|
52
54
|
os_blind.setSlatOrientation(@hash[:slat_orientation])
|
|
@@ -46,7 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create window gas OpenStudio object
|
|
47
47
|
os_window_gas = OpenStudio::Model::Gas.new(openstudio_model)
|
|
48
48
|
os_window_gas.setName(@hash[:identifier])
|
|
49
|
-
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_window_gas.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
50
52
|
# assign thickness
|
|
51
53
|
if @hash[:thickness]
|
|
52
54
|
os_window_gas.setThickness(@hash[:thickness])
|
|
@@ -46,6 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create window gas openstudio object
|
|
47
47
|
os_gas_custom = OpenStudio::Model::Gas.new(openstudio_model)
|
|
48
48
|
os_gas_custom.setName(@hash[:identifier])
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_gas_custom.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
49
52
|
os_gas_custom.setGasType('Custom')
|
|
50
53
|
os_gas_custom.setConductivityCoefficientA(@hash[:conductivity_coeff_a])
|
|
51
54
|
os_gas_custom.setViscosityCoefficientA(@hash[:viscosity_coeff_a])
|
|
@@ -46,7 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create the gas mixture
|
|
47
47
|
os_gas_mixture = OpenStudio::Model::GasMixture.new(openstudio_model)
|
|
48
48
|
os_gas_mixture.setName(@hash[:identifier])
|
|
49
|
-
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_gas_mixture.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
50
52
|
# set the thickness
|
|
51
53
|
if @hash[:thickness]
|
|
52
54
|
os_gas_mixture.setThickness(@hash[:thickness])
|
|
@@ -46,7 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create openstudio standard glazing object and set identifier
|
|
47
47
|
os_glazing = OpenStudio::Model::StandardGlazing.new(openstudio_model)
|
|
48
48
|
os_glazing.setName(@hash[:identifier])
|
|
49
|
-
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_glazing.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
50
52
|
# assign thickness
|
|
51
53
|
if @hash[:thickness]
|
|
52
54
|
os_glazing.setThickness(@hash[:thickness])
|
|
@@ -46,7 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create openstudio shade object
|
|
47
47
|
os_shade_mat = OpenStudio::Model::Shade.new(openstudio_model)
|
|
48
48
|
os_shade_mat.setName(@hash[:identifier])
|
|
49
|
-
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_shade_mat.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
50
52
|
# assign solar transmittance
|
|
51
53
|
if @hash[:solar_transmittance]
|
|
52
54
|
os_shade_mat.setSolarTransmittance(@hash[:solar_transmittance])
|
|
@@ -48,7 +48,9 @@ module Honeybee
|
|
|
48
48
|
os_simple_glazing.setName(@hash[:identifier])
|
|
49
49
|
os_simple_glazing.setUFactor(@hash[:u_factor])
|
|
50
50
|
os_simple_glazing.setSolarHeatGainCoefficient(@hash[:shgc])
|
|
51
|
-
|
|
51
|
+
unless @hash[:display_name].nil?
|
|
52
|
+
os_simple_glazing.setDisplayName(@hash[:display_name])
|
|
53
|
+
end
|
|
52
54
|
# assign visible transmittance
|
|
53
55
|
if @hash[:vt]
|
|
54
56
|
os_simple_glazing.setVisibleTransmittance(@hash[:vt])
|
data/lib/to_openstudio/model.rb
CHANGED
|
@@ -203,9 +203,6 @@ module Honeybee
|
|
|
203
203
|
puts 'Translating Context Shade Geometry'
|
|
204
204
|
end
|
|
205
205
|
create_orphaned_shades
|
|
206
|
-
create_orphaned_faces
|
|
207
|
-
create_orphaned_apertures
|
|
208
|
-
create_orphaned_doors
|
|
209
206
|
end
|
|
210
207
|
|
|
211
208
|
def create_materials(material_dicts, check_existing=false)
|
|
@@ -46,7 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create openstudio space type object
|
|
47
47
|
os_space_type = OpenStudio::Model::SpaceType.new(openstudio_model)
|
|
48
48
|
os_space_type.setName(@hash[:identifier])
|
|
49
|
-
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_space_type.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
50
52
|
# assign people
|
|
51
53
|
if @hash[:people]
|
|
52
54
|
people = PeopleAbridged.new(@hash[:people])
|
|
@@ -89,7 +89,9 @@ module Honeybee
|
|
|
89
89
|
# create the new schedule
|
|
90
90
|
os_fi_schedule = OpenStudio::Model::ScheduleFixedInterval.new(openstudio_model)
|
|
91
91
|
os_fi_schedule.setName(@hash[:identifier])
|
|
92
|
-
|
|
92
|
+
unless @hash[:display_name].nil?
|
|
93
|
+
os_fi_schedule.setDisplayName(@hash[:display_name])
|
|
94
|
+
end
|
|
93
95
|
# assign start date
|
|
94
96
|
os_fi_schedule.setStartMonth(start_month)
|
|
95
97
|
os_fi_schedule.setStartDay(start_day)
|
|
@@ -202,6 +204,9 @@ module Honeybee
|
|
|
202
204
|
rowsToSkip = 1
|
|
203
205
|
os_schedule_file = OpenStudio::Model::ScheduleFile.new(os_external_file, column, rowsToSkip)
|
|
204
206
|
os_schedule_file.setName(@hash[:identifier])
|
|
207
|
+
unless @hash[:display_name].nil?
|
|
208
|
+
os_schedule_file.setDisplayName(@hash[:display_name])
|
|
209
|
+
end
|
|
205
210
|
os_schedule_file.setInterpolatetoTimestep(interpolate)
|
|
206
211
|
os_schedule_file.setMinutesperItem(interval_length)
|
|
207
212
|
|
|
@@ -47,7 +47,9 @@ module Honeybee
|
|
|
47
47
|
# create openstudio schedule ruleset object
|
|
48
48
|
os_sch_ruleset = OpenStudio::Model::ScheduleRuleset.new(openstudio_model)
|
|
49
49
|
os_sch_ruleset.setName(@hash[:identifier])
|
|
50
|
-
|
|
50
|
+
unless @hash[:display_name].nil?
|
|
51
|
+
os_sch_ruleset.setDisplayName(@hash[:display_name])
|
|
52
|
+
end
|
|
51
53
|
# assign schedule type limit
|
|
52
54
|
sch_type_limit_obj = nil
|
|
53
55
|
if @hash[:schedule_type_limit]
|
|
@@ -65,6 +67,9 @@ module Honeybee
|
|
|
65
67
|
if day_schedule[:identifier] != def_day_id
|
|
66
68
|
day_schedule_new = OpenStudio::Model::ScheduleDay.new(openstudio_model)
|
|
67
69
|
day_schedule_new.setName(day_schedule[:identifier])
|
|
70
|
+
unless @hash[:display_name].nil?
|
|
71
|
+
day_schedule_new.setDisplayName(@hash[:display_name])
|
|
72
|
+
end
|
|
68
73
|
unless sch_type_limit_obj.nil?
|
|
69
74
|
day_schedule_new.setScheduleTypeLimits(sch_type_limit_obj)
|
|
70
75
|
end
|
|
@@ -46,7 +46,9 @@ module Honeybee
|
|
|
46
46
|
# create schedule type limits openstudio object
|
|
47
47
|
os_type_limit = OpenStudio::Model::ScheduleTypeLimits.new(openstudio_model)
|
|
48
48
|
os_type_limit.setName(@hash[:identifier])
|
|
49
|
-
|
|
49
|
+
unless @hash[:display_name].nil?
|
|
50
|
+
os_type_limit.setDisplayName(@hash[:display_name])
|
|
51
|
+
end
|
|
50
52
|
if @hash[:lower_limit] != nil and @hash[:lower_limit] != {:type => 'NoLimit'}
|
|
51
53
|
os_type_limit.setLowerLimitValue(@hash[:lower_limit])
|
|
52
54
|
end
|
|
@@ -145,13 +145,24 @@ module Honeybee
|
|
|
145
145
|
os_sizing_par.setCoolingSizingFactor(@hash[:sizing_parameter][:cooling_factor])
|
|
146
146
|
end
|
|
147
147
|
# set any design days
|
|
148
|
+
db_temps = []
|
|
148
149
|
if @hash[:sizing_parameter][:design_days]
|
|
149
150
|
@hash[:sizing_parameter][:design_days].each do |des_day|
|
|
150
151
|
des_day_object = DesignDay.new(des_day)
|
|
151
152
|
os_des_day = des_day_object.to_openstudio(@openstudio_model)
|
|
153
|
+
db_temps << des_day[:dry_bulb_condition][:dry_bulb_max]
|
|
152
154
|
end
|
|
153
155
|
end
|
|
154
156
|
end
|
|
157
|
+
# use the average of design day temperatures to set the water mains temperature
|
|
158
|
+
os_water_mains = @openstudio_model.getSiteWaterMainsTemperature
|
|
159
|
+
os_water_mains.setCalculationMethod('Correlation')
|
|
160
|
+
if db_temps.length > 0
|
|
161
|
+
os_water_mains.setAnnualAverageOutdoorAirTemperature((db_temps.max + db_temps.min) / 2)
|
|
162
|
+
else # just use some dummy values so that the simulation does not fail
|
|
163
|
+
os_water_mains.setAnnualAverageOutdoorAirTemperature(12)
|
|
164
|
+
end
|
|
165
|
+
os_water_mains.setMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures(4)
|
|
155
166
|
|
|
156
167
|
# set Outputs for the simulation
|
|
157
168
|
if @hash[:output]
|
|
@@ -238,9 +249,6 @@ module Honeybee
|
|
|
238
249
|
os_site.setTerrain(@hash[:terrain_type])
|
|
239
250
|
end
|
|
240
251
|
|
|
241
|
-
# ensure water mains temperatures are written
|
|
242
|
-
os_water_mains = @openstudio_model.getSiteWaterMainsTemperature
|
|
243
|
-
os_water_mains.setCalculationMethod('CorrelationFromWeatherFile')
|
|
244
252
|
end
|
|
245
253
|
|
|
246
254
|
end #SimulationParameter
|
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.28.0
|
|
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-12-02 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: bundler
|
|
@@ -117,28 +117,28 @@ dependencies:
|
|
|
117
117
|
requirements:
|
|
118
118
|
- - '='
|
|
119
119
|
- !ruby/object:Gem::Version
|
|
120
|
-
version: 0.
|
|
120
|
+
version: 0.5.1
|
|
121
121
|
type: :runtime
|
|
122
122
|
prerelease: false
|
|
123
123
|
version_requirements: !ruby/object:Gem::Requirement
|
|
124
124
|
requirements:
|
|
125
125
|
- - '='
|
|
126
126
|
- !ruby/object:Gem::Version
|
|
127
|
-
version: 0.
|
|
127
|
+
version: 0.5.1
|
|
128
128
|
- !ruby/object:Gem::Dependency
|
|
129
129
|
name: openstudio-standards
|
|
130
130
|
requirement: !ruby/object:Gem::Requirement
|
|
131
131
|
requirements:
|
|
132
132
|
- - "~>"
|
|
133
133
|
- !ruby/object:Gem::Version
|
|
134
|
-
version: 0.2.
|
|
134
|
+
version: 0.2.15
|
|
135
135
|
type: :runtime
|
|
136
136
|
prerelease: false
|
|
137
137
|
version_requirements: !ruby/object:Gem::Requirement
|
|
138
138
|
requirements:
|
|
139
139
|
- - "~>"
|
|
140
140
|
- !ruby/object:Gem::Version
|
|
141
|
-
version: 0.2.
|
|
141
|
+
version: 0.2.15
|
|
142
142
|
description: Library and measures for translating between Honeybee JSON schema and
|
|
143
143
|
OpenStudio Model schema (OSM).
|
|
144
144
|
email:
|