openstudio-extension 0.7.1 → 0.8.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/.gitignore +1 -0
- data/CHANGELOG.md +14 -0
- data/LICENSE.md +1 -1
- data/README.md +2 -0
- data/lib/openstudio/extension/runner.rb +12 -8
- data/lib/openstudio/extension/runner_config.rb +33 -6
- data/lib/openstudio/extension/version.rb +1 -1
- data/openstudio-extension.gemspec +6 -6
- metadata +15 -66
- data/lib/openstudio/extension/core/CreateResults.rb +0 -1033
- data/lib/openstudio/extension/core/check_air_sys_temps.rb +0 -160
- data/lib/openstudio/extension/core/check_calibration.rb +0 -125
- data/lib/openstudio/extension/core/check_cond_zns.rb +0 -54
- data/lib/openstudio/extension/core/check_domestic_hot_water.rb +0 -304
- data/lib/openstudio/extension/core/check_envelope_conductance.rb +0 -423
- data/lib/openstudio/extension/core/check_eui_by_end_use.rb +0 -132
- data/lib/openstudio/extension/core/check_eui_reasonableness.rb +0 -105
- data/lib/openstudio/extension/core/check_fan_pwr.rb +0 -68
- data/lib/openstudio/extension/core/check_internal_loads.rb +0 -363
- data/lib/openstudio/extension/core/check_mech_sys_capacity.rb +0 -196
- data/lib/openstudio/extension/core/check_mech_sys_efficiency.rb +0 -296
- data/lib/openstudio/extension/core/check_mech_sys_part_load_eff.rb +0 -434
- data/lib/openstudio/extension/core/check_mech_sys_type.rb +0 -109
- data/lib/openstudio/extension/core/check_part_loads.rb +0 -421
- data/lib/openstudio/extension/core/check_placeholder.rb +0 -45
- data/lib/openstudio/extension/core/check_plant_cap.rb +0 -93
- data/lib/openstudio/extension/core/check_plant_temps.rb +0 -129
- data/lib/openstudio/extension/core/check_plenum_loads.rb +0 -57
- data/lib/openstudio/extension/core/check_pump_pwr.rb +0 -78
- data/lib/openstudio/extension/core/check_sch_coord.rb +0 -211
- data/lib/openstudio/extension/core/check_schedules.rb +0 -281
- data/lib/openstudio/extension/core/check_simultaneous_heating_and_cooling.rb +0 -128
- data/lib/openstudio/extension/core/check_supply_air_and_thermostat_temp_difference.rb +0 -118
- data/lib/openstudio/extension/core/check_weather_files.rb +0 -102
- data/lib/openstudio/extension/core/deer_vintages.rb +0 -281
- data/lib/openstudio/extension/core/os_lib_aedg_measures.rb +0 -461
- data/lib/openstudio/extension/core/os_lib_constructions.rb +0 -353
- data/lib/openstudio/extension/core/os_lib_geometry.rb +0 -1169
- data/lib/openstudio/extension/core/os_lib_helper_methods.rb +0 -383
- data/lib/openstudio/extension/core/os_lib_hvac.rb +0 -2163
- data/lib/openstudio/extension/core/os_lib_lighting_and_equipment.rb +0 -184
- data/lib/openstudio/extension/core/os_lib_model_generation.rb +0 -3584
- data/lib/openstudio/extension/core/os_lib_model_simplification.rb +0 -1019
- data/lib/openstudio/extension/core/os_lib_outdoorair_and_infiltration.rb +0 -135
- data/lib/openstudio/extension/core/os_lib_reporting_qaqc.rb +0 -170
- data/lib/openstudio/extension/core/os_lib_schedules.rb +0 -933
@@ -1,184 +0,0 @@
|
|
1
|
-
# *******************************************************************************
|
2
|
-
# OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC.
|
3
|
-
# See also https://openstudio.net/license
|
4
|
-
# *******************************************************************************
|
5
|
-
|
6
|
-
require "#{File.dirname(__FILE__)}/os_lib_schedules"
|
7
|
-
|
8
|
-
# load OpenStudio measure libraries
|
9
|
-
module OsLib_LightingAndEquipment
|
10
|
-
include OsLib_Schedules
|
11
|
-
|
12
|
-
# return min ans max from array
|
13
|
-
def self.getExteriorLightsValue(model)
|
14
|
-
facility = model.getFacility
|
15
|
-
exterior_lights_power = 0
|
16
|
-
exterior_lights = facility.exteriorLights
|
17
|
-
exterior_lights.each do |exterior_light|
|
18
|
-
exterior_light_multiplier = exterior_light.multiplier
|
19
|
-
exterior_light_def = exterior_light.exteriorLightsDefinition
|
20
|
-
exterior_light_base_power = exterior_light_def.designLevel
|
21
|
-
exterior_lights_power += exterior_light_base_power * exterior_light_multiplier
|
22
|
-
end
|
23
|
-
|
24
|
-
result = { 'exterior_lighting_power' => exterior_lights_power, 'exterior_lights' => exterior_lights }
|
25
|
-
return result
|
26
|
-
end
|
27
|
-
|
28
|
-
# return min ans max from array
|
29
|
-
def self.removeAllExteriorLights(model, runner)
|
30
|
-
facility = model.getFacility
|
31
|
-
lightsRemoved = false
|
32
|
-
exterior_lights = facility.exteriorLights
|
33
|
-
exterior_lights.each do |exterior_light|
|
34
|
-
runner.registerInfo("Removed exterior light named #{exterior_light.name}.")
|
35
|
-
exterior_light.remove
|
36
|
-
lightsRemoved = true
|
37
|
-
end
|
38
|
-
|
39
|
-
result = lightsRemoved
|
40
|
-
return result
|
41
|
-
end
|
42
|
-
|
43
|
-
# return min ans max from array
|
44
|
-
def self.addExteriorLights(model, runner, options = {})
|
45
|
-
# set defaults to use if user inputs not passed in
|
46
|
-
defaults = {
|
47
|
-
'name' => 'Exterior Light',
|
48
|
-
'power' => 0,
|
49
|
-
'subCategory' => 'Exterior Lighting',
|
50
|
-
'controlOption' => 'AstronomicalClock',
|
51
|
-
'setbackStartTime' => 0,
|
52
|
-
'setbackEndTime' => 0,
|
53
|
-
'setbackFraction' => 0.25
|
54
|
-
}
|
55
|
-
|
56
|
-
# merge user inputs with defaults
|
57
|
-
options = defaults.merge(options)
|
58
|
-
|
59
|
-
ext_lights_def = OpenStudio::Model::ExteriorLightsDefinition.new(model)
|
60
|
-
ext_lights_def.setName("#{options['name']} Definition")
|
61
|
-
runner.registerInfo("Setting #{ext_lights_def.name} to a design power of #{options['power']} Watts")
|
62
|
-
ext_lights_def.setDesignLevel(options['power'])
|
63
|
-
|
64
|
-
# creating schedule type limits for the exterior lights schedule
|
65
|
-
ext_lights_sch_type_limits = OpenStudio::Model::ScheduleTypeLimits.new(model)
|
66
|
-
ext_lights_sch_type_limits.setName("#{options['name']} Fractional")
|
67
|
-
ext_lights_sch_type_limits.setLowerLimitValue(0)
|
68
|
-
ext_lights_sch_type_limits.setUpperLimitValue(1)
|
69
|
-
ext_lights_sch_type_limits.setNumericType('Continuous')
|
70
|
-
|
71
|
-
# prepare values for profile
|
72
|
-
if options['setbackStartTime'] == 24
|
73
|
-
profile = { options['setbackEndTime'] => options['setbackFraction'], 24.0 => 1.0 }
|
74
|
-
elsif options['setbackStartTime'] == 0
|
75
|
-
profile = { options['setbackEndTime'] => options['setbackFraction'], 24.0 => 1.0 }
|
76
|
-
elsif options['setbackStartTime'] > options['setbackEndTime']
|
77
|
-
profile = { options['setbackEndTime'] => options['setbackFraction'], options['setbackStartTime'] => 1.0, 24.0 => options['setbackFraction'] }
|
78
|
-
else
|
79
|
-
profile = { options['setbackStartTime'] => 1.0, options['setbackEndTime'] => options['setbackFraction'] }
|
80
|
-
end
|
81
|
-
|
82
|
-
# inputs
|
83
|
-
createSimpleSchedule_inputs = {
|
84
|
-
'name' => options['name'],
|
85
|
-
'winterTimeValuePairs' => profile,
|
86
|
-
'summerTimeValuePairs' => profile,
|
87
|
-
'defaultTimeValuePairs' => profile
|
88
|
-
}
|
89
|
-
|
90
|
-
# create a ruleset schedule with a basic profile
|
91
|
-
ext_lights_sch = OsLib_Schedules.createSimpleSchedule(model, createSimpleSchedule_inputs)
|
92
|
-
|
93
|
-
# creating exterior lights object
|
94
|
-
ext_lights = OpenStudio::Model::ExteriorLights.new(ext_lights_def, ext_lights_sch)
|
95
|
-
ext_lights.setName("#{options['power']} w Exterior Light")
|
96
|
-
ext_lights.setControlOption(options['controlOption'])
|
97
|
-
ext_lights.setEndUseSubcategory(options['subCategory'])
|
98
|
-
|
99
|
-
result = ext_lights
|
100
|
-
return result
|
101
|
-
end
|
102
|
-
|
103
|
-
# add daylight sensor
|
104
|
-
def self.addDaylightSensor(model, options = {})
|
105
|
-
# set defaults to use if user inputs not passed in
|
106
|
-
defaults = {
|
107
|
-
'name' => nil,
|
108
|
-
'space' => nil,
|
109
|
-
'position' => nil,
|
110
|
-
'phiRotationAroundZAxis' => nil,
|
111
|
-
'illuminanceSetpoint' => nil,
|
112
|
-
'lightingControlType' => '1', # 1 = Continuous
|
113
|
-
'minInputPowerFractionContinuous' => nil,
|
114
|
-
'minOutputPowerFractionContinuous' => nil,
|
115
|
-
'numberOfSteppedControlSteps' => nil
|
116
|
-
}
|
117
|
-
|
118
|
-
# merge user inputs with defaults
|
119
|
-
options = defaults.merge(options)
|
120
|
-
|
121
|
-
pri_light_sensor = OpenStudio::Model::DaylightingControl.new(model)
|
122
|
-
if !options['name'].nil? then pri_light_sensor.setName(options['name']) end
|
123
|
-
if !options['space'].nil? then pri_light_sensor.setSpace(options['space']) end
|
124
|
-
if !options['position'].nil? then pri_light_sensor.setPosition(options['position']) end
|
125
|
-
if !options['phiRotationAroundZAxis'].nil? then pri_light_sensor.setPhiRotationAroundZAxis(options['phiRotationAroundZAxis']) end
|
126
|
-
if !options['illuminanceSetpoint'].nil? then pri_light_sensor.setIlluminanceSetpoint(options['illuminanceSetpoint']) end
|
127
|
-
if !options['lightingControlType'].nil? then pri_light_sensor.setLightingControlType(options['lightingControlType']) end
|
128
|
-
|
129
|
-
result = pri_light_sensor
|
130
|
-
return result
|
131
|
-
end
|
132
|
-
|
133
|
-
# make hash of hard assigned schedules with lighting levels
|
134
|
-
def self.createHashOfInternalLoadWithHardAssignedSchedules(internalLoadArray)
|
135
|
-
hardAssignedScheduleHash = {}
|
136
|
-
internalLoadArray.each do |load|
|
137
|
-
if !load.isScheduleDefaulted
|
138
|
-
# add to schedule hash
|
139
|
-
if !load.schedule.empty?
|
140
|
-
if !(hardAssignedScheduleHash[load.schedule.get])
|
141
|
-
hardAssignedScheduleHash[load.schedule.get] = 1
|
142
|
-
else
|
143
|
-
hardAssignedScheduleHash[load.schedule.get] += 1 # this is to catch multiple objects instances using the same hard assigned schedule
|
144
|
-
end
|
145
|
-
end
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
result = hardAssignedScheduleHash
|
150
|
-
return result
|
151
|
-
end
|
152
|
-
|
153
|
-
# get value per area for electric equipment loads in space array.
|
154
|
-
def self.getEpdForSpaceArray(spaceArray)
|
155
|
-
floorArea = 0
|
156
|
-
electricEquipmentPower = 0
|
157
|
-
|
158
|
-
spaceArray.each do |space|
|
159
|
-
floorArea += space.floorArea * space.multiplier
|
160
|
-
electricEquipmentPower += space.electricEquipmentPower * space.multiplier
|
161
|
-
end
|
162
|
-
|
163
|
-
epd = electricEquipmentPower / floorArea
|
164
|
-
|
165
|
-
result = epd
|
166
|
-
return result
|
167
|
-
end
|
168
|
-
|
169
|
-
# get value per area for electric equipment loads in space array.
|
170
|
-
def self.getLpdForSpaceArray(spaceArray)
|
171
|
-
floorArea = 0
|
172
|
-
lightingPower = 0
|
173
|
-
|
174
|
-
spaceArray.each do |space|
|
175
|
-
floorArea += space.floorArea * space.multiplier
|
176
|
-
lightingPower += space.lightingPower * space.multiplier
|
177
|
-
end
|
178
|
-
|
179
|
-
lpd = lightingPower / floorArea
|
180
|
-
|
181
|
-
result = lpd
|
182
|
-
return result
|
183
|
-
end
|
184
|
-
end
|