openstudio-standards 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/standards/OpenStudio_Standards.xlsx +0 -0
- data/data/standards/OpenStudio_Standards_boilers.json +62 -4
- data/data/standards/OpenStudio_Standards_chillers.json +778 -68
- data/data/standards/OpenStudio_Standards_construction_sets.json +52 -93
- data/data/standards/OpenStudio_Standards_curve_biquadratics.json +36 -36
- data/data/standards/OpenStudio_Standards_curve_quadratics.json +3 -3
- data/data/standards/OpenStudio_Standards_heat_pumps.json +840 -0
- data/data/standards/OpenStudio_Standards_heat_pumps_heating.json +352 -0
- data/data/standards/OpenStudio_Standards_heat_rejection.json +48 -0
- data/data/standards/OpenStudio_Standards_motors.json +270 -0
- data/data/standards/OpenStudio_Standards_space_types.json +10390 -2824
- data/data/standards/OpenStudio_Standards_unitary_acs.json +794 -18
- data/data/weather/USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.ddy +538 -0
- data/data/weather/USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.epw +8768 -0
- data/data/weather/USA_CO_Boulder-Broomfield-Jefferson.County.AP.724699_TMY3.stat +493 -0
- data/data/weather/USA_CO_Denver.Intl.AP.725650_TMY3.ddy +536 -0
- data/data/weather/USA_CO_Denver.Intl.AP.725650_TMY3.epw +8768 -0
- data/data/weather/USA_CO_Denver.Intl.AP.725650_TMY3.stat +554 -0
- data/data/weather/USA_CO_Fort.Collins.AWOS.724769_TMY3.ddy +536 -0
- data/data/weather/USA_CO_Fort.Collins.AWOS.724769_TMY3.epw +8768 -0
- data/data/weather/USA_CO_Fort.Collins.AWOS.724769_TMY3.stat +554 -0
- data/data/weather/envelope_info.csv +6 -0
- data/lib/openstudio-standards.rb +10 -11
- data/lib/openstudio-standards/btap/compliance.rb +251 -969
- data/lib/openstudio-standards/btap/envelope.rb +1 -1
- data/lib/openstudio-standards/btap/fileio.rb +37 -5
- data/lib/openstudio-standards/btap/geometry.rb +27 -17
- data/lib/openstudio-standards/btap/hvac.rb +80 -27
- data/lib/openstudio-standards/hvac_sizing/{HVACSizing.CoilHeatingDXMultiSpeed.rb → Siz.CoilHeatingDXMultiSpeed.rb} +0 -0
- data/lib/openstudio-standards/hvac_sizing/Siz.ControllerOutdoorAir.rb +30 -4
- data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerTwoSpeed.rb +61 -5
- data/lib/openstudio-standards/hvac_sizing/Siz.CoolingTowerVariableSpeed.rb +37 -7
- data/lib/openstudio-standards/hvac_sizing/Siz.DistrictCooling.rb +27 -0
- data/lib/openstudio-standards/hvac_sizing/Siz.DistrictHeating.rb +27 -0
- data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsConstantSpeed.rb +55 -0
- data/lib/openstudio-standards/hvac_sizing/Siz.HeaderedPumpsVariableSpeed.rb +55 -0
- data/lib/openstudio-standards/hvac_sizing/Siz.HeatingCoolingFuels.rb +51 -9
- data/lib/openstudio-standards/hvac_sizing/Siz.Model.rb +99 -17
- data/lib/openstudio-standards/hvac_sizing/Siz.PumpConstantSpeed.rb +1 -1
- data/lib/openstudio-standards/hvac_sizing/Siz.ThermalZone.rb +29 -6
- data/lib/openstudio-standards/hvac_sizing/Siz.WaterHeaterMixed.rb +16 -0
- data/lib/openstudio-standards/prototypes/Prototype.AirTerminalSingleDuctVAVReheat.rb +43 -48
- data/lib/openstudio-standards/prototypes/Prototype.ControllerWaterCoil.rb +5 -9
- data/lib/openstudio-standards/prototypes/Prototype.Fan.rb +68 -0
- data/lib/openstudio-standards/prototypes/Prototype.FanConstantVolume.rb +39 -43
- data/lib/openstudio-standards/prototypes/Prototype.FanOnOff.rb +49 -51
- data/lib/openstudio-standards/prototypes/Prototype.FanVariableVolume.rb +55 -61
- data/lib/openstudio-standards/prototypes/Prototype.FanZoneExhaust.rb +8 -10
- data/lib/openstudio-standards/prototypes/Prototype.HeatExchangerAirToAirSensibleAndLatent.rb +15 -20
- data/lib/openstudio-standards/prototypes/Prototype.Model.hvac.rb +330 -322
- data/lib/openstudio-standards/prototypes/Prototype.Model.rb +501 -446
- data/lib/openstudio-standards/prototypes/Prototype.Model.swh.rb +221 -230
- data/lib/openstudio-standards/prototypes/Prototype.add_objects.rb +0 -2
- data/lib/openstudio-standards/prototypes/Prototype.full_service_restaurant.rb +130 -137
- data/lib/openstudio-standards/prototypes/Prototype.high_rise_apartment.rb +374 -291
- data/lib/openstudio-standards/prototypes/Prototype.hospital.rb +146 -193
- data/lib/openstudio-standards/prototypes/Prototype.hvac_systems.rb +1315 -1113
- data/lib/openstudio-standards/prototypes/Prototype.large_hotel.rb +65 -88
- data/lib/openstudio-standards/prototypes/Prototype.large_office.rb +101 -156
- data/lib/openstudio-standards/prototypes/Prototype.medium_office.rb +46 -96
- data/lib/openstudio-standards/prototypes/Prototype.mid_rise_apartment.rb +113 -123
- data/lib/openstudio-standards/prototypes/Prototype.outpatient.rb +356 -345
- data/lib/openstudio-standards/prototypes/Prototype.primary_school.rb +48 -103
- data/lib/openstudio-standards/prototypes/Prototype.quick_service_restaurant.rb +115 -123
- data/lib/openstudio-standards/prototypes/Prototype.retail_standalone.rb +30 -39
- data/lib/openstudio-standards/prototypes/Prototype.retail_stripmall.rb +32 -45
- data/lib/openstudio-standards/prototypes/Prototype.secondary_school.rb +98 -258
- data/lib/openstudio-standards/prototypes/Prototype.small_hotel.rb +429 -474
- data/lib/openstudio-standards/prototypes/Prototype.small_office.rb +28 -36
- data/lib/openstudio-standards/prototypes/Prototype.strip_model.rb +7 -7
- data/lib/openstudio-standards/prototypes/Prototype.utilities.rb +172 -146
- data/lib/openstudio-standards/prototypes/Prototype.warehouse.rb +46 -53
- data/lib/openstudio-standards/standards/Standards.AirLoopHVAC.rb +885 -707
- data/lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctParallelPIUReheat.rb +48 -57
- data/lib/openstudio-standards/standards/Standards.AirTerminalSingleDuctVAVReheat.rb +24 -31
- data/lib/openstudio-standards/standards/Standards.BoilerHotWater.rb +80 -93
- data/lib/openstudio-standards/standards/Standards.BuildingStory.rb +69 -0
- data/lib/openstudio-standards/standards/Standards.ChillerElectricEIR.rb +60 -72
- data/lib/openstudio-standards/standards/Standards.CoilCoolingDXMultiSpeed.rb +104 -108
- data/lib/openstudio-standards/standards/Standards.CoilCoolingDXSingleSpeed.rb +190 -198
- data/lib/openstudio-standards/standards/Standards.CoilCoolingDXTwoSpeed.rb +134 -146
- data/lib/openstudio-standards/standards/Standards.CoilHeatingDXMultiSpeed.rb +56 -60
- data/lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb +151 -161
- data/lib/openstudio-standards/standards/Standards.CoilHeatingGasMultiStage.rb +30 -34
- data/lib/openstudio-standards/standards/Standards.Construction.rb +116 -132
- data/lib/openstudio-standards/standards/Standards.CoolingTower.rb +138 -0
- data/lib/openstudio-standards/standards/Standards.CoolingTowerSingleSpeed.rb +11 -0
- data/lib/openstudio-standards/standards/Standards.CoolingTowerTwoSpeed.rb +11 -0
- data/lib/openstudio-standards/standards/Standards.CoolingTowerVariableSpeed.rb +16 -0
- data/lib/openstudio-standards/standards/Standards.Fan.rb +190 -236
- data/lib/openstudio-standards/standards/Standards.FanConstantVolume.rb +0 -2
- data/lib/openstudio-standards/standards/Standards.FanOnOff.rb +0 -2
- data/lib/openstudio-standards/standards/Standards.FanVariableVolume.rb +168 -14
- data/lib/openstudio-standards/standards/Standards.FanZoneExhaust.rb +0 -2
- data/lib/openstudio-standards/standards/Standards.HeaderedPumpsConstantSpeed.rb +33 -0
- data/lib/openstudio-standards/standards/Standards.HeaderedPumpsVariableSpeed.rb +83 -0
- data/lib/openstudio-standards/standards/Standards.HeatExchangerSensLat.rb +22 -0
- data/lib/openstudio-standards/standards/Standards.Model.rb +2385 -1622
- data/lib/openstudio-standards/standards/Standards.PlanarSurface.rb +83 -35
- data/lib/openstudio-standards/standards/Standards.PlantLoop.rb +805 -395
- data/lib/openstudio-standards/standards/Standards.Pump.rb +139 -119
- data/lib/openstudio-standards/standards/Standards.PumpConstantSpeed.rb +0 -2
- data/lib/openstudio-standards/standards/Standards.PumpVariableSpeed.rb +16 -15
- data/lib/openstudio-standards/standards/Standards.ScheduleCompact.rb +35 -0
- data/lib/openstudio-standards/standards/Standards.ScheduleConstant.rb +7 -13
- data/lib/openstudio-standards/standards/Standards.ScheduleRuleset.rb +144 -59
- data/lib/openstudio-standards/standards/Standards.Space.rb +1509 -1326
- data/lib/openstudio-standards/standards/Standards.SpaceType.rb +254 -262
- data/lib/openstudio-standards/standards/Standards.SubSurface.rb +105 -105
- data/lib/openstudio-standards/standards/Standards.Surface.rb +27 -31
- data/lib/openstudio-standards/standards/Standards.ThermalZone.rb +882 -157
- data/lib/openstudio-standards/standards/Standards.WaterHeaterMixed.rb +179 -69
- data/lib/openstudio-standards/standards/Standards.ZoneHVACComponent.rb +75 -0
- data/lib/openstudio-standards/utilities/logging.rb +31 -38
- data/lib/openstudio-standards/utilities/simulation.rb +118 -82
- data/lib/openstudio-standards/version.rb +1 -1
- data/lib/openstudio-standards/weather/Weather.Model.rb +382 -390
- data/lib/openstudio-standards/weather/Weather.stat_file.rb +159 -78
- metadata +59 -6
@@ -1,77 +1,71 @@
|
|
1
1
|
|
2
2
|
# Reopen the OpenStudio class to add methods to apply standards to this object
|
3
3
|
class OpenStudio::Model::SpaceType
|
4
|
-
|
5
4
|
# Returns standards data for selected space type and template
|
6
5
|
#
|
7
6
|
# @param [string] target template for lookup
|
8
7
|
# @return [hash] hash of internal loads for different load types
|
9
8
|
def get_standards_data(template)
|
9
|
+
standards_building_type = if standardsBuildingType.is_initialized
|
10
|
+
standardsBuildingType.get
|
11
|
+
end
|
12
|
+
standards_space_type = if standardsSpaceType.is_initialized
|
13
|
+
standardsSpaceType.get
|
14
|
+
end
|
10
15
|
|
11
|
-
if self.standardsBuildingType.is_initialized
|
12
|
-
standards_building_type = self.standardsBuildingType.get
|
13
|
-
else
|
14
|
-
standards_building_type = nil
|
15
|
-
end
|
16
|
-
if self.standardsSpaceType.is_initialized
|
17
|
-
standards_space_type = self.standardsSpaceType.get
|
18
|
-
else
|
19
|
-
standards_space_type = nil
|
20
|
-
end
|
21
|
-
|
22
16
|
# populate search hash
|
23
17
|
search_criteria = {
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
'template' => template,
|
19
|
+
'building_type' => standards_building_type,
|
20
|
+
'space_type' => standards_space_type
|
27
21
|
}
|
28
22
|
|
29
23
|
# lookup space type properties
|
30
|
-
|
31
|
-
space_type_properties =
|
24
|
+
|
25
|
+
space_type_properties = model.find_object($os_standards['space_types'], search_criteria)
|
32
26
|
|
33
27
|
if space_type_properties.nil?
|
34
|
-
OpenStudio
|
28
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "Space type properties lookup failed: #{search_criteria}.")
|
35
29
|
space_type_properties = {}
|
36
30
|
end
|
37
|
-
|
38
|
-
return space_type_properties
|
39
31
|
|
32
|
+
return space_type_properties
|
40
33
|
end
|
41
|
-
|
34
|
+
|
42
35
|
# Sets the color for the space types as shown
|
43
36
|
# in the SketchUp plugin using render by space type.
|
44
37
|
#
|
45
38
|
# @param [string] target template for lookup
|
46
39
|
# @return [Bool] returns true if successful, false if not.
|
47
|
-
def
|
48
|
-
|
40
|
+
def apply_rendering_color(template)
|
49
41
|
# Get the standards data
|
50
|
-
space_type_properties =
|
51
|
-
|
52
|
-
|
42
|
+
space_type_properties = get_standards_data(template)
|
43
|
+
|
53
44
|
# Set the rendering color of the space type
|
54
45
|
rgb = space_type_properties['rgb']
|
46
|
+
if rgb.nil?
|
47
|
+
return false
|
48
|
+
end
|
49
|
+
|
55
50
|
rgb = rgb.split('_')
|
56
51
|
r = rgb[0].to_i
|
57
52
|
g = rgb[1].to_i
|
58
53
|
b = rgb[2].to_i
|
59
|
-
rendering_color = OpenStudio::Model::RenderingColor.new(
|
54
|
+
rendering_color = OpenStudio::Model::RenderingColor.new(model)
|
60
55
|
rendering_color.setRenderingRedValue(r)
|
61
56
|
rendering_color.setRenderingGreenValue(g)
|
62
57
|
rendering_color.setRenderingBlueValue(b)
|
63
|
-
|
58
|
+
setRenderingColor(rendering_color)
|
64
59
|
|
65
60
|
return true
|
66
|
-
|
67
61
|
end
|
68
|
-
|
62
|
+
|
69
63
|
# Sets the selected internal loads to standards-based or typical values.
|
70
64
|
# For each category that is selected get all load instances. Remove all
|
71
|
-
# but the first instance if multiple instances. Add a new instance/definition
|
65
|
+
# but the first instance if multiple instances. Add a new instance/definition
|
72
66
|
# if no instance exists. Modify the definition for the remaining instance
|
73
67
|
# to have the specified values. This method does not alter any
|
74
|
-
# loads directly assigned to spaces.
|
68
|
+
# loads directly assigned to spaces. This method skips plenums.
|
75
69
|
#
|
76
70
|
# @param set_people [Bool] if true, set the people density.
|
77
71
|
# Also, assign reasonable clothing, air velocity, and work efficiency inputs
|
@@ -82,154 +76,161 @@ class OpenStudio::Model::SpaceType
|
|
82
76
|
# @param set_gas_equipment [Bool] if true, set the gas equipment density
|
83
77
|
# @param set_ventilation [Bool] if true, set the ventilation rates (per-person and per-area)
|
84
78
|
# @param set_infiltration [Bool] if true, set the infiltration rates
|
85
|
-
# @return [Bool] returns true if successful, false if not
|
86
|
-
def
|
87
|
-
|
79
|
+
# @return [Bool] returns true if successful, false if not
|
80
|
+
def apply_internal_loads(template, set_people, set_lights, set_electric_equipment, set_gas_equipment, set_ventilation, set_infiltration)
|
81
|
+
# Skip plenums
|
82
|
+
# Check if the space type name
|
83
|
+
# contains the word plenum.
|
84
|
+
if name.get.to_s.downcase.include?('plenum')
|
85
|
+
return false
|
86
|
+
end
|
87
|
+
if standardsSpaceType.is_initialized
|
88
|
+
if standardsSpaceType.get.downcase.include?('plenum')
|
89
|
+
return false
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
88
93
|
# Get the standards data
|
89
|
-
space_type_properties =
|
94
|
+
space_type_properties = get_standards_data(template)
|
90
95
|
|
91
96
|
# Need to add a check, or it'll crash on space_type_properties['occupancy_per_area'].to_f below
|
92
97
|
if space_type_properties.nil?
|
93
|
-
OpenStudio
|
98
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} was not found in the standards data.")
|
94
99
|
return false
|
95
100
|
end
|
96
101
|
# People
|
97
102
|
people_have_info = false
|
98
103
|
occupancy_per_area = space_type_properties['occupancy_per_area'].to_f
|
99
|
-
people_have_info = true unless occupancy_per_area
|
104
|
+
people_have_info = true unless occupancy_per_area.zero?
|
100
105
|
|
101
106
|
if set_people && people_have_info
|
102
|
-
|
107
|
+
|
103
108
|
# Remove all but the first instance
|
104
|
-
instances =
|
105
|
-
if instances.size
|
109
|
+
instances = people.sort
|
110
|
+
if instances.size.zero?
|
106
111
|
# Create a new definition and instance
|
107
112
|
definition = OpenStudio::Model::PeopleDefinition.new(model)
|
108
|
-
definition.setName("#{
|
113
|
+
definition.setName("#{name} People Definition")
|
109
114
|
instance = OpenStudio::Model::People.new(definition)
|
110
|
-
instance.setName("#{
|
115
|
+
instance.setName("#{name} People")
|
111
116
|
instance.setSpaceType(self)
|
112
|
-
OpenStudio
|
117
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} had no people, one has been created.")
|
113
118
|
instances << instance
|
114
119
|
elsif instances.size > 1
|
115
|
-
|
116
|
-
next if i
|
117
|
-
|
118
|
-
|
119
|
-
instance.remove
|
120
|
+
instances.each_with_index do |inst, i|
|
121
|
+
next if i.zero?
|
122
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "Removed #{inst.name} from #{name}.")
|
123
|
+
inst.remove
|
120
124
|
end
|
121
125
|
end
|
122
|
-
|
126
|
+
|
123
127
|
# Modify the definition of the instance
|
124
|
-
instances.each do |
|
125
|
-
definition =
|
126
|
-
unless occupancy_per_area
|
127
|
-
definition.setPeopleperSpaceFloorArea(OpenStudio.convert(occupancy_per_area/1000,'people/ft^2','people/m^2').get)
|
128
|
-
OpenStudio
|
128
|
+
instances.each do |inst|
|
129
|
+
definition = inst.peopleDefinition
|
130
|
+
unless occupancy_per_area.zero?
|
131
|
+
definition.setPeopleperSpaceFloorArea(OpenStudio.convert(occupancy_per_area / 1000, 'people/ft^2', 'people/m^2').get)
|
132
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set occupancy to #{occupancy_per_area} people/1000 ft^2.")
|
129
133
|
end
|
130
|
-
|
134
|
+
|
131
135
|
# Clothing schedule for thermal comfort metrics
|
132
|
-
clothing_sch =
|
136
|
+
clothing_sch = model.getScheduleRulesetByName('Clothing Schedule')
|
133
137
|
if clothing_sch.is_initialized
|
134
138
|
clothing_sch = clothing_sch.get
|
135
139
|
else
|
136
|
-
clothing_sch = OpenStudio::Model::ScheduleRuleset.new(
|
137
|
-
clothing_sch.setName(
|
138
|
-
clothing_sch.defaultDaySchedule.setName(
|
139
|
-
clothing_sch.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), 1.0)
|
140
|
+
clothing_sch = OpenStudio::Model::ScheduleRuleset.new(model)
|
141
|
+
clothing_sch.setName('Clothing Schedule')
|
142
|
+
clothing_sch.defaultDaySchedule.setName('Clothing Schedule Default Winter Clothes')
|
143
|
+
clothing_sch.defaultDaySchedule.addValue(OpenStudio::Time.new(0, 24, 0, 0), 1.0)
|
140
144
|
sch_rule = OpenStudio::Model::ScheduleRule.new(clothing_sch)
|
141
|
-
sch_rule.daySchedule.setName(
|
142
|
-
sch_rule.daySchedule.addValue(OpenStudio::Time.new(0,24,0,0), 0.5)
|
145
|
+
sch_rule.daySchedule.setName('Clothing Schedule Summer Clothes')
|
146
|
+
sch_rule.daySchedule.addValue(OpenStudio::Time.new(0, 24, 0, 0), 0.5)
|
143
147
|
sch_rule.setStartDate(OpenStudio::Date.new(OpenStudio::MonthOfYear.new(5), 1))
|
144
148
|
sch_rule.setEndDate(OpenStudio::Date.new(OpenStudio::MonthOfYear.new(9), 30))
|
145
149
|
end
|
146
|
-
|
150
|
+
inst.setClothingInsulationSchedule(clothing_sch)
|
147
151
|
|
148
152
|
# Air velocity schedule for thermal comfort metrics
|
149
|
-
air_velo_sch =
|
153
|
+
air_velo_sch = model.getScheduleRulesetByName('Air Velocity Schedule')
|
150
154
|
if air_velo_sch.is_initialized
|
151
155
|
air_velo_sch = air_velo_sch.get
|
152
156
|
else
|
153
|
-
air_velo_sch = OpenStudio::Model::ScheduleRuleset.new(
|
154
|
-
air_velo_sch.setName(
|
155
|
-
air_velo_sch.defaultDaySchedule.setName(
|
156
|
-
air_velo_sch.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), 0.2)
|
157
|
+
air_velo_sch = OpenStudio::Model::ScheduleRuleset.new(model)
|
158
|
+
air_velo_sch.setName('Air Velocity Schedule')
|
159
|
+
air_velo_sch.defaultDaySchedule.setName('Air Velocity Schedule Default')
|
160
|
+
air_velo_sch.defaultDaySchedule.addValue(OpenStudio::Time.new(0, 24, 0, 0), 0.2)
|
157
161
|
end
|
158
|
-
|
162
|
+
inst.setAirVelocitySchedule(air_velo_sch)
|
159
163
|
|
160
164
|
# Work efficiency schedule for thermal comfort metrics
|
161
|
-
work_efficiency_sch =
|
165
|
+
work_efficiency_sch = model.getScheduleRulesetByName('Work Efficiency Schedule')
|
162
166
|
if work_efficiency_sch.is_initialized
|
163
167
|
work_efficiency_sch = work_efficiency_sch.get
|
164
168
|
else
|
165
|
-
work_efficiency_sch = OpenStudio::Model::ScheduleRuleset.new(
|
166
|
-
work_efficiency_sch.setName(
|
167
|
-
work_efficiency_sch.defaultDaySchedule.setName(
|
168
|
-
work_efficiency_sch.defaultDaySchedule.addValue(OpenStudio::Time.new(0,24,0,0), 0)
|
169
|
+
work_efficiency_sch = OpenStudio::Model::ScheduleRuleset.new(model)
|
170
|
+
work_efficiency_sch.setName('Work Efficiency Schedule')
|
171
|
+
work_efficiency_sch.defaultDaySchedule.setName('Work Efficiency Schedule Default')
|
172
|
+
work_efficiency_sch.defaultDaySchedule.addValue(OpenStudio::Time.new(0, 24, 0, 0), 0)
|
169
173
|
end
|
170
|
-
|
171
|
-
|
174
|
+
inst.setWorkEfficiencySchedule(work_efficiency_sch)
|
172
175
|
end
|
173
|
-
|
176
|
+
|
174
177
|
end
|
175
|
-
|
178
|
+
|
176
179
|
# Lights
|
177
180
|
lights_have_info = false
|
178
181
|
lighting_per_area = space_type_properties['lighting_per_area'].to_f
|
179
182
|
lighting_per_person = space_type_properties['lighting_per_person'].to_f
|
180
183
|
lights_frac_to_return_air = space_type_properties['lighting_fraction_to_return_air'].to_f
|
181
184
|
lights_frac_radiant = space_type_properties['lighting_fraction_radiant'].to_f
|
182
|
-
lights_frac_visible = space_type_properties['lighting_fraction_visible'].to_f
|
183
|
-
lights_have_info = true unless lighting_per_area
|
184
|
-
lights_have_info = true unless lighting_per_person
|
185
|
+
lights_frac_visible = space_type_properties['lighting_fraction_visible'].to_f
|
186
|
+
lights_have_info = true unless lighting_per_area.zero?
|
187
|
+
lights_have_info = true unless lighting_per_person.zero?
|
185
188
|
|
186
189
|
if set_lights && lights_have_info
|
187
190
|
|
188
191
|
# Remove all but the first instance
|
189
|
-
instances =
|
190
|
-
if instances.size
|
192
|
+
instances = lights.sort
|
193
|
+
if instances.size.zero?
|
191
194
|
definition = OpenStudio::Model::LightsDefinition.new(model)
|
192
|
-
definition.setName("#{
|
195
|
+
definition.setName("#{name} Lights Definition")
|
193
196
|
instance = OpenStudio::Model::Lights.new(definition)
|
194
|
-
instance.setName("#{
|
197
|
+
instance.setName("#{name} Lights")
|
195
198
|
instance.setSpaceType(self)
|
196
|
-
OpenStudio
|
199
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} had no lights, one has been created.")
|
197
200
|
instances << instance
|
198
201
|
elsif instances.size > 1
|
199
|
-
|
200
|
-
next if i
|
201
|
-
|
202
|
-
|
203
|
-
instance.remove
|
202
|
+
instances.each_with_index do |inst, i|
|
203
|
+
next if i.zero?
|
204
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "Removed #{inst.name} from #{name}.")
|
205
|
+
inst.remove
|
204
206
|
end
|
205
207
|
end
|
206
|
-
|
208
|
+
|
207
209
|
# Modify the definition of the instance
|
208
|
-
instances.each do |
|
209
|
-
definition =
|
210
|
-
unless
|
211
|
-
definition.setWattsperSpaceFloorArea(OpenStudio.convert(lighting_per_area.to_f,'W/ft^2','W/m^2').get)
|
212
|
-
OpenStudio
|
210
|
+
instances.each do |inst|
|
211
|
+
definition = inst.lightsDefinition
|
212
|
+
unless lighting_per_area.zero?
|
213
|
+
definition.setWattsperSpaceFloorArea(OpenStudio.convert(lighting_per_area.to_f, 'W/ft^2', 'W/m^2').get)
|
214
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set LPD to #{lighting_per_area} W/ft^2.")
|
213
215
|
end
|
214
|
-
unless lighting_per_person
|
215
|
-
definition.setWattsperPerson(OpenStudio.convert(lighting_per_person.to_f,'W/person','W/person').get)
|
216
|
-
OpenStudio
|
216
|
+
unless lighting_per_person.zero?
|
217
|
+
definition.setWattsperPerson(OpenStudio.convert(lighting_per_person.to_f, 'W/person', 'W/person').get)
|
218
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set lighting to #{lighting_per_person} W/person.")
|
217
219
|
end
|
218
|
-
unless lights_frac_to_return_air
|
220
|
+
unless lights_frac_to_return_air.zero?
|
219
221
|
definition.setReturnAirFraction(lights_frac_to_return_air)
|
220
222
|
end
|
221
|
-
unless lights_frac_radiant
|
223
|
+
unless lights_frac_radiant.zero?
|
222
224
|
definition.setFractionRadiant(lights_frac_radiant)
|
223
225
|
end
|
224
|
-
unless lights_frac_visible
|
226
|
+
unless lights_frac_visible.zero?
|
225
227
|
definition.setFractionVisible(lights_frac_visible)
|
226
|
-
end
|
227
|
-
|
228
|
+
end
|
228
229
|
end
|
229
|
-
|
230
|
+
|
230
231
|
# If additional lights are specified, add those too
|
231
232
|
additional_lighting_per_area = space_type_properties['additional_lighting_per_area'].to_f
|
232
|
-
unless additional_lighting_per_area
|
233
|
+
unless additional_lighting_per_area.zero?
|
233
234
|
# Create the lighting definition
|
234
235
|
additional_lights_def = OpenStudio::Model::LightsDefinition.new(model)
|
235
236
|
additional_lights_def.setName("#{name} Additional Lights Definition")
|
@@ -242,58 +243,57 @@ class OpenStudio::Model::SpaceType
|
|
242
243
|
additional_lights = OpenStudio::Model::Lights.new(additional_lights_def)
|
243
244
|
additional_lights.setName("#{name} Additional Lights")
|
244
245
|
additional_lights.setSpaceType(self)
|
245
|
-
end
|
246
|
+
end
|
246
247
|
|
247
248
|
end
|
248
|
-
|
249
|
+
|
249
250
|
# Electric Equipment
|
250
251
|
elec_equip_have_info = false
|
251
252
|
elec_equip_per_area = space_type_properties['electric_equipment_per_area'].to_f
|
252
253
|
elec_equip_frac_latent = space_type_properties['electric_equipment_fraction_latent'].to_f
|
253
254
|
elec_equip_frac_radiant = space_type_properties['electric_equipment_fraction_radiant'].to_f
|
254
255
|
elec_equip_frac_lost = space_type_properties['electric_equipment_fraction_lost'].to_f
|
255
|
-
elec_equip_have_info = true unless elec_equip_per_area
|
256
|
+
elec_equip_have_info = true unless elec_equip_per_area.zero?
|
256
257
|
|
257
258
|
if set_electric_equipment && elec_equip_have_info
|
258
|
-
|
259
|
+
|
259
260
|
# Remove all but the first instance
|
260
|
-
instances =
|
261
|
-
if instances.size
|
261
|
+
instances = electricEquipment.sort
|
262
|
+
if instances.size.zero?
|
262
263
|
definition = OpenStudio::Model::ElectricEquipmentDefinition.new(model)
|
263
|
-
definition.setName("#{
|
264
|
+
definition.setName("#{name} Elec Equip Definition")
|
264
265
|
instance = OpenStudio::Model::ElectricEquipment.new(definition)
|
265
|
-
instance.setName("#{
|
266
|
+
instance.setName("#{name} Elec Equip")
|
266
267
|
instance.setSpaceType(self)
|
267
|
-
OpenStudio
|
268
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} had no electric equipment, one has been created.")
|
268
269
|
instances << instance
|
269
270
|
elsif instances.size > 1
|
270
|
-
|
271
|
-
next if i
|
272
|
-
|
273
|
-
|
274
|
-
instance.remove
|
271
|
+
instances.each_with_index do |inst, i|
|
272
|
+
next if i.zero?
|
273
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "Removed #{inst.name} from #{name}.")
|
274
|
+
inst.remove
|
275
275
|
end
|
276
276
|
end
|
277
|
-
|
277
|
+
|
278
278
|
# Modify the definition of the instance
|
279
|
-
instances.each do |
|
280
|
-
definition =
|
281
|
-
unless elec_equip_per_area
|
282
|
-
definition.setWattsperSpaceFloorArea(OpenStudio.convert(elec_equip_per_area.to_f,'W/ft^2','W/m^2').get)
|
283
|
-
OpenStudio
|
279
|
+
instances.each do |inst|
|
280
|
+
definition = inst.electricEquipmentDefinition
|
281
|
+
unless elec_equip_per_area.zero?
|
282
|
+
definition.setWattsperSpaceFloorArea(OpenStudio.convert(elec_equip_per_area.to_f, 'W/ft^2', 'W/m^2').get)
|
283
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set electric EPD to #{elec_equip_per_area} W/ft^2.")
|
284
284
|
end
|
285
|
-
unless elec_equip_frac_latent
|
285
|
+
unless elec_equip_frac_latent.zero?
|
286
286
|
definition.setFractionLatent(elec_equip_frac_latent)
|
287
287
|
end
|
288
|
-
unless elec_equip_frac_radiant
|
288
|
+
unless elec_equip_frac_radiant.zero?
|
289
289
|
definition.setFractionRadiant(elec_equip_frac_radiant)
|
290
290
|
end
|
291
|
-
unless elec_equip_frac_lost
|
291
|
+
unless elec_equip_frac_lost.zero?
|
292
292
|
definition.setFractionLost(elec_equip_frac_lost)
|
293
293
|
end
|
294
294
|
end
|
295
|
-
|
296
|
-
end
|
295
|
+
|
296
|
+
end
|
297
297
|
|
298
298
|
# Gas Equipment
|
299
299
|
gas_equip_have_info = false
|
@@ -301,95 +301,94 @@ class OpenStudio::Model::SpaceType
|
|
301
301
|
gas_equip_frac_latent = space_type_properties['gas_equipment_fraction_latent'].to_f
|
302
302
|
gas_equip_frac_radiant = space_type_properties['gas_equipment_fraction_radiant'].to_f
|
303
303
|
gas_equip_frac_lost = space_type_properties['gas_equipment_fraction_lost'].to_f
|
304
|
-
gas_equip_have_info = true unless gas_equip_per_area
|
304
|
+
gas_equip_have_info = true unless gas_equip_per_area.zero?
|
305
305
|
|
306
306
|
if set_gas_equipment && gas_equip_have_info
|
307
|
-
|
307
|
+
|
308
308
|
# Remove all but the first instance
|
309
|
-
instances =
|
310
|
-
if instances.size
|
309
|
+
instances = gasEquipment.sort
|
310
|
+
if instances.size.zero?
|
311
311
|
definition = OpenStudio::Model::GasEquipmentDefinition.new(model)
|
312
|
-
definition.setName("#{
|
312
|
+
definition.setName("#{name} Gas Equip Definition")
|
313
313
|
instance = OpenStudio::Model::GasEquipment.new(definition)
|
314
|
-
instance.setName("#{
|
314
|
+
instance.setName("#{name} Gas Equip")
|
315
315
|
instance.setSpaceType(self)
|
316
|
-
OpenStudio
|
316
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} had no gas equipment, one has been created.")
|
317
317
|
instances << instance
|
318
318
|
elsif instances.size > 1
|
319
|
-
|
320
|
-
next if i
|
321
|
-
|
322
|
-
|
323
|
-
instance.remove
|
319
|
+
instances.each_with_index do |inst, i|
|
320
|
+
next if i.zero?
|
321
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "Removed #{inst.name} from #{name}.")
|
322
|
+
inst.remove
|
324
323
|
end
|
325
324
|
end
|
326
|
-
|
325
|
+
|
327
326
|
# Modify the definition of the instance
|
328
|
-
instances.each do |
|
329
|
-
definition =
|
330
|
-
unless gas_equip_per_area
|
331
|
-
definition.setWattsperSpaceFloorArea(OpenStudio.convert(gas_equip_per_area.to_f,'Btu/hr*ft^2','W/m^2').get)
|
332
|
-
OpenStudio
|
327
|
+
instances.each do |inst|
|
328
|
+
definition = inst.gasEquipmentDefinition
|
329
|
+
unless gas_equip_per_area.zero?
|
330
|
+
definition.setWattsperSpaceFloorArea(OpenStudio.convert(gas_equip_per_area.to_f, 'Btu/hr*ft^2', 'W/m^2').get)
|
331
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set gas EPD to #{elec_equip_per_area} Btu/hr*ft^2.")
|
333
332
|
end
|
334
|
-
unless gas_equip_frac_latent
|
333
|
+
unless gas_equip_frac_latent.zero?
|
335
334
|
definition.setFractionLatent(gas_equip_frac_latent)
|
336
335
|
end
|
337
|
-
unless gas_equip_frac_radiant
|
336
|
+
unless gas_equip_frac_radiant.zero?
|
338
337
|
definition.setFractionRadiant(gas_equip_frac_radiant)
|
339
338
|
end
|
340
|
-
unless gas_equip_frac_lost
|
339
|
+
unless gas_equip_frac_lost.zero?
|
341
340
|
definition.setFractionLost(gas_equip_frac_lost)
|
342
341
|
end
|
343
342
|
end
|
344
|
-
|
345
|
-
end
|
346
|
-
|
343
|
+
|
344
|
+
end
|
345
|
+
|
347
346
|
# Ventilation
|
348
347
|
ventilation_have_info = false
|
349
348
|
ventilation_per_area = space_type_properties['ventilation_per_area'].to_f
|
350
349
|
ventilation_per_person = space_type_properties['ventilation_per_person'].to_f
|
351
350
|
ventilation_ach = space_type_properties['ventilation_air_changes'].to_f
|
352
|
-
ventilation_have_info = true unless ventilation_per_area
|
353
|
-
ventilation_have_info = true unless ventilation_per_person
|
354
|
-
ventilation_have_info = true unless ventilation_ach
|
351
|
+
ventilation_have_info = true unless ventilation_per_area.zero?
|
352
|
+
ventilation_have_info = true unless ventilation_per_person.zero?
|
353
|
+
ventilation_have_info = true unless ventilation_ach.zero?
|
355
354
|
|
356
355
|
# Get the design OA or create a new one if none exists
|
357
|
-
ventilation =
|
356
|
+
ventilation = designSpecificationOutdoorAir
|
358
357
|
if ventilation.is_initialized
|
359
358
|
ventilation = ventilation.get
|
360
359
|
else
|
361
360
|
ventilation = OpenStudio::Model::DesignSpecificationOutdoorAir.new(model)
|
362
361
|
ventilation.setName("#{name} Ventilation")
|
363
|
-
|
364
|
-
OpenStudio
|
365
|
-
end
|
366
|
-
|
362
|
+
setDesignSpecificationOutdoorAir(ventilation)
|
363
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} had no ventilation specification, one has been created.")
|
364
|
+
end
|
365
|
+
|
367
366
|
if set_ventilation && ventilation_have_info
|
368
367
|
|
369
368
|
# Modify the ventilation properties
|
370
|
-
ventilation.setOutdoorAirMethod(
|
371
|
-
unless ventilation_per_area
|
372
|
-
ventilation.setOutdoorAirFlowperFloorArea(OpenStudio.convert(ventilation_per_area.to_f,'ft^3/min*ft^2','m^3/s*m^2').get)
|
373
|
-
OpenStudio
|
369
|
+
ventilation.setOutdoorAirMethod('Sum')
|
370
|
+
unless ventilation_per_area.zero?
|
371
|
+
ventilation.setOutdoorAirFlowperFloorArea(OpenStudio.convert(ventilation_per_area.to_f, 'ft^3/min*ft^2', 'm^3/s*m^2').get)
|
372
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set ventilation per area to #{ventilation_per_area} cfm/ft^2.")
|
374
373
|
end
|
375
|
-
unless ventilation_per_person
|
376
|
-
ventilation.setOutdoorAirFlowperPerson(OpenStudio.convert(ventilation_per_person.to_f,'ft^3/min*person','m^3/s*person').get)
|
377
|
-
OpenStudio
|
374
|
+
unless ventilation_per_person.zero?
|
375
|
+
ventilation.setOutdoorAirFlowperPerson(OpenStudio.convert(ventilation_per_person.to_f, 'ft^3/min*person', 'm^3/s*person').get)
|
376
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set ventilation per person to #{ventilation_per_person} cfm/person.")
|
378
377
|
end
|
379
|
-
unless ventilation_ach
|
378
|
+
unless ventilation_ach.zero?
|
380
379
|
ventilation.setOutdoorAirFlowAirChangesperHour(ventilation_ach)
|
381
|
-
OpenStudio
|
380
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set ventilation to #{ventilation_ach} ACH.")
|
382
381
|
end
|
383
|
-
|
382
|
+
|
384
383
|
elsif set_ventilation && !ventilation_have_info
|
385
|
-
|
386
|
-
# All space types must have a design spec OA
|
384
|
+
|
385
|
+
# All space types must have a design spec OA
|
387
386
|
# object for ventilation controls to work correctly,
|
388
387
|
# even if the values are all zero.
|
389
388
|
ventilation.setOutdoorAirFlowperFloorArea(0)
|
390
389
|
ventilation.setOutdoorAirFlowperPerson(0)
|
391
|
-
ventilation.setOutdoorAirFlowAirChangesperHour(0)
|
392
|
-
|
390
|
+
ventilation.setOutdoorAirFlowAirChangesperHour(0)
|
391
|
+
|
393
392
|
end
|
394
393
|
|
395
394
|
# Infiltration
|
@@ -397,53 +396,51 @@ class OpenStudio::Model::SpaceType
|
|
397
396
|
infiltration_per_area_ext = space_type_properties['infiltration_per_exterior_area'].to_f
|
398
397
|
infiltration_per_area_ext_wall = space_type_properties['infiltration_per_exterior_wall_area'].to_f
|
399
398
|
infiltration_ach = space_type_properties['infiltration_air_changes'].to_f
|
400
|
-
unless infiltration_per_area_ext
|
399
|
+
unless infiltration_per_area_ext.zero? && infiltration_per_area_ext_wall.zero? && infiltration_ach.zero?
|
401
400
|
infiltration_have_info = true
|
402
401
|
end
|
403
402
|
|
404
403
|
if set_infiltration && infiltration_have_info
|
405
|
-
|
404
|
+
|
406
405
|
# Remove all but the first instance
|
407
|
-
instances =
|
408
|
-
if instances.size
|
406
|
+
instances = spaceInfiltrationDesignFlowRates.sort
|
407
|
+
if instances.size.zero?
|
409
408
|
instance = OpenStudio::Model::SpaceInfiltrationDesignFlowRate.new(model)
|
410
|
-
instance.setName("#{
|
409
|
+
instance.setName("#{name} Infiltration")
|
411
410
|
instance.setSpaceType(self)
|
412
|
-
OpenStudio
|
411
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} had no infiltration objects, one has been created.")
|
413
412
|
instances << instance
|
414
413
|
elsif instances.size > 1
|
415
|
-
|
416
|
-
next if i
|
417
|
-
|
418
|
-
|
419
|
-
instance.remove
|
414
|
+
instances.each_with_index do |inst, i|
|
415
|
+
next if i.zero?
|
416
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "Removed #{inst.name} from #{name}.")
|
417
|
+
inst.remove
|
420
418
|
end
|
421
419
|
end
|
422
|
-
|
420
|
+
|
423
421
|
# Modify each instance
|
424
|
-
instances.each do |
|
425
|
-
unless infiltration_per_area_ext
|
426
|
-
|
427
|
-
OpenStudio
|
422
|
+
instances.each do |inst|
|
423
|
+
unless infiltration_per_area_ext.zero?
|
424
|
+
inst.setFlowperExteriorSurfaceArea(OpenStudio.convert(infiltration_per_area_ext.to_f, 'ft^3/min*ft^2', 'm^3/s*m^2').get)
|
425
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set infiltration to #{ventilation_ach} per ft^2 exterior surface area.")
|
428
426
|
end
|
429
|
-
unless infiltration_per_area_ext_wall
|
430
|
-
|
431
|
-
OpenStudio
|
427
|
+
unless infiltration_per_area_ext_wall.zero?
|
428
|
+
inst.setFlowperExteriorWallArea(OpenStudio.convert(infiltration_per_area_ext_wall.to_f, 'ft^3/min*ft^2', 'm^3/s*m^2').get)
|
429
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set infiltration to #{infiltration_per_area_ext_wall} per ft^2 exterior wall area.")
|
432
430
|
end
|
433
|
-
unless infiltration_ach
|
434
|
-
|
435
|
-
OpenStudio
|
431
|
+
unless infiltration_ach.zero?
|
432
|
+
inst.setAirChangesperHour(infiltration_ach)
|
433
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set infiltration to #{ventilation_ach} ACH.")
|
436
434
|
end
|
437
435
|
end
|
438
|
-
|
439
|
-
end
|
440
436
|
|
437
|
+
end
|
441
438
|
end
|
442
439
|
|
443
440
|
# Sets the schedules for the selected internal loads to typical schedules.
|
444
441
|
# Get the default schedule set for this space type if one exists or make
|
445
442
|
# one if none exists. For each category that is selected, add the typical
|
446
|
-
# schedule for this category to the default schedule set.
|
443
|
+
# schedule for this category to the default schedule set.
|
447
444
|
# This method does not alter any schedules of any internal loads that
|
448
445
|
# does not inherit from the default schedule set.
|
449
446
|
#
|
@@ -455,21 +452,20 @@ class OpenStudio::Model::SpaceType
|
|
455
452
|
# @param make_thermostat [Bool] if true, makes a thermostat for this space type from the
|
456
453
|
# schedules listed for the space type. This thermostat is not hooked to any zone by this method,
|
457
454
|
# but may be found and used later.
|
458
|
-
# @return [Bool] returns true if successful, false if not
|
459
|
-
def
|
460
|
-
|
455
|
+
# @return [Bool] returns true if successful, false if not
|
456
|
+
def apply_internal_load_schedules(template, set_people, set_lights, set_electric_equipment, set_gas_equipment, set_ventilation, set_infiltration, make_thermostat)
|
461
457
|
# Get the standards data
|
462
|
-
space_type_properties =
|
463
|
-
|
458
|
+
space_type_properties = get_standards_data(template)
|
459
|
+
|
464
460
|
# Get the default schedule set
|
465
461
|
# or create a new one if none exists.
|
466
462
|
default_sch_set = nil
|
467
|
-
if
|
468
|
-
default_sch_set =
|
463
|
+
if defaultScheduleSet.is_initialized
|
464
|
+
default_sch_set = defaultScheduleSet.get
|
469
465
|
else
|
470
466
|
default_sch_set = OpenStudio::Model::DefaultScheduleSet.new(model)
|
471
|
-
default_sch_set.setName("#{
|
472
|
-
|
467
|
+
default_sch_set.setName("#{name} Schedule Set")
|
468
|
+
setDefaultScheduleSet(default_sch_set)
|
473
469
|
end
|
474
470
|
|
475
471
|
# People
|
@@ -477,84 +473,83 @@ class OpenStudio::Model::SpaceType
|
|
477
473
|
occupancy_sch = space_type_properties['occupancy_schedule']
|
478
474
|
unless occupancy_sch.nil?
|
479
475
|
default_sch_set.setNumberofPeopleSchedule(model.add_schedule(occupancy_sch))
|
480
|
-
OpenStudio
|
476
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set occupancy schedule to #{occupancy_sch}.")
|
481
477
|
end
|
482
|
-
|
478
|
+
|
483
479
|
occupancy_activity_sch = space_type_properties['occupancy_activity_schedule']
|
484
480
|
unless occupancy_activity_sch.nil?
|
485
481
|
default_sch_set.setPeopleActivityLevelSchedule(model.add_schedule(occupancy_activity_sch))
|
486
|
-
OpenStudio
|
482
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set occupant activity schedule to #{occupancy_activity_sch}.")
|
487
483
|
end
|
488
|
-
|
484
|
+
|
489
485
|
end
|
490
|
-
|
486
|
+
|
491
487
|
# Lights
|
492
488
|
if set_lights
|
493
|
-
|
489
|
+
|
494
490
|
lighting_sch = space_type_properties['lighting_schedule']
|
495
491
|
unless lighting_sch.nil?
|
496
492
|
default_sch_set.setLightingSchedule(model.add_schedule(lighting_sch))
|
497
|
-
OpenStudio
|
498
|
-
end
|
493
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set lighting schedule to #{lighting_sch}.")
|
494
|
+
end
|
499
495
|
|
500
496
|
end
|
501
|
-
|
502
|
-
# Electric Equipment
|
497
|
+
|
498
|
+
# Electric Equipment
|
503
499
|
if set_electric_equipment
|
504
|
-
|
500
|
+
|
505
501
|
elec_equip_sch = space_type_properties['electric_equipment_schedule']
|
506
502
|
unless elec_equip_sch.nil?
|
507
503
|
default_sch_set.setElectricEquipmentSchedule(model.add_schedule(elec_equip_sch))
|
508
|
-
OpenStudio
|
509
|
-
end
|
510
|
-
|
504
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set electric equipment schedule to #{elec_equip_sch}.")
|
505
|
+
end
|
506
|
+
|
511
507
|
end
|
512
508
|
|
513
509
|
# Gas Equipment
|
514
510
|
if set_gas_equipment
|
515
|
-
|
511
|
+
|
516
512
|
gas_equip_sch = space_type_properties['gas_equipment_schedule']
|
517
513
|
unless gas_equip_sch.nil?
|
518
514
|
default_sch_set.setGasEquipmentSchedule(model.add_schedule(gas_equip_sch))
|
519
|
-
OpenStudio
|
515
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set gas equipment schedule to #{gas_equip_sch}.")
|
520
516
|
end
|
521
|
-
|
517
|
+
|
522
518
|
end
|
523
|
-
|
519
|
+
|
524
520
|
# Infiltration
|
525
521
|
if set_infiltration
|
526
|
-
|
522
|
+
|
527
523
|
infiltration_sch = space_type_properties['infiltration_schedule']
|
528
524
|
unless infiltration_sch.nil?
|
529
525
|
default_sch_set.setInfiltrationSchedule(model.add_schedule(infiltration_sch))
|
530
|
-
OpenStudio
|
531
|
-
end
|
532
|
-
|
526
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set infiltration schedule to #{infiltration_sch}.")
|
527
|
+
end
|
528
|
+
|
533
529
|
end
|
534
|
-
|
530
|
+
|
535
531
|
# Thermostat
|
536
532
|
if make_thermostat
|
537
|
-
|
533
|
+
|
538
534
|
thermostat = OpenStudio::Model::ThermostatSetpointDualSetpoint.new(model)
|
539
|
-
thermostat.setName("#{
|
535
|
+
thermostat.setName("#{name} Thermostat")
|
540
536
|
|
541
537
|
heating_setpoint_sch = space_type_properties['heating_setpoint_schedule']
|
542
538
|
unless heating_setpoint_sch.nil?
|
543
539
|
thermostat.setHeatingSetpointTemperatureSchedule(model.add_schedule(heating_setpoint_sch))
|
544
|
-
OpenStudio
|
540
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set heating setpoint schedule to #{heating_setpoint_sch}.")
|
545
541
|
end
|
546
542
|
|
547
543
|
cooling_setpoint_sch = space_type_properties['cooling_setpoint_schedule']
|
548
544
|
unless cooling_setpoint_sch.nil?
|
549
545
|
thermostat.setCoolingSetpointTemperatureSchedule(model.add_schedule(cooling_setpoint_sch))
|
550
|
-
OpenStudio
|
551
|
-
end
|
546
|
+
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.SpaceType', "#{name} set cooling setpoint schedule to #{cooling_setpoint_sch}.")
|
547
|
+
end
|
552
548
|
|
553
549
|
end
|
554
|
-
|
550
|
+
|
555
551
|
return true
|
556
|
-
|
557
|
-
end
|
552
|
+
end
|
558
553
|
|
559
554
|
# Returns standards data for selected construction
|
560
555
|
#
|
@@ -562,33 +557,30 @@ class OpenStudio::Model::SpaceType
|
|
562
557
|
# @param [string] intended_surface_type template for lookup
|
563
558
|
# @param [string] standards_construction_type template for lookup
|
564
559
|
# @return [hash] hash of construction properties
|
565
|
-
def get_construction_properties(template,intended_surface_type,standards_construction_type)
|
566
|
-
|
560
|
+
def get_construction_properties(template, intended_surface_type, standards_construction_type)
|
567
561
|
# get building_category value
|
568
|
-
if
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
562
|
+
building_category = if !get_standards_data(template).nil? && get_standards_data(template)['is_residential'] == 'Yes'
|
563
|
+
'Residential'
|
564
|
+
else
|
565
|
+
'Nonresidential'
|
566
|
+
end
|
573
567
|
|
574
568
|
# get climate_zone_set
|
575
|
-
climate_zone =
|
576
|
-
climate_zone_set =
|
569
|
+
climate_zone = model.get_building_climate_zone_and_building_type['climate_zone']
|
570
|
+
climate_zone_set = model.find_climate_zone_set(climate_zone, template)
|
577
571
|
|
578
572
|
# populate search hash
|
579
573
|
search_criteria = {
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
574
|
+
'template' => template,
|
575
|
+
'climate_zone_set' => climate_zone_set,
|
576
|
+
'intended_surface_type' => intended_surface_type,
|
577
|
+
'standards_construction_type' => standards_construction_type,
|
578
|
+
'building_category' => building_category
|
585
579
|
}
|
586
580
|
|
587
581
|
# switch to use this but update test in standards and measures to load this outside of the method
|
588
|
-
construction_properties =
|
582
|
+
construction_properties = model.find_object($os_standards['construction_properties'], search_criteria)
|
589
583
|
|
590
584
|
return construction_properties
|
591
|
-
|
592
|
-
end
|
593
|
-
|
585
|
+
end
|
594
586
|
end
|