openstudio-standards 0.8.5 → 0.8.7
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/data/standards/test_performance_expected_dd_results.csv +90 -90
- data/lib/openstudio-standards/btap/activity.rb +858 -61
- data/lib/openstudio-standards/btap/attributes.rb +297 -103
- data/lib/openstudio-standards/btap/bridging.rb +1335 -593
- data/lib/openstudio-standards/btap/btap.rb +60 -181
- data/lib/openstudio-standards/btap/carbon/btap_carbon.rb +199 -142
- data/lib/openstudio-standards/btap/common/constructions.json +1275 -0
- data/lib/openstudio-standards/btap/common/costs.csv +1969 -0
- data/lib/openstudio-standards/btap/common/costs_local_factors.csv +2315 -0
- data/lib/openstudio-standards/btap/common/materials_glazing.csv +61 -0
- data/lib/openstudio-standards/btap/{common_resources → common}/materials_hvac.csv +1685 -1685
- data/lib/openstudio-standards/btap/{common_resources → common}/materials_lighting.csv +266 -266
- data/lib/openstudio-standards/btap/common/materials_opaque.csv +214 -0
- data/lib/openstudio-standards/btap/common/necb_building_types.csv +35 -0
- data/lib/openstudio-standards/btap/common/necb_space_types.csv +110 -0
- data/lib/openstudio-standards/btap/common/thermal_bridging.csv +73 -0
- data/lib/openstudio-standards/btap/costing/btap_costing.rb +346 -429
- data/lib/openstudio-standards/btap/costing/database.rb +104 -0
- data/lib/openstudio-standards/btap/costing/daylighting_sensor_control_costing.rb +356 -344
- data/lib/openstudio-standards/btap/costing/dcv_costing.rb +282 -296
- data/lib/openstudio-standards/btap/costing/envelope_costing.rb +179 -192
- data/lib/openstudio-standards/btap/costing/heating_cooling_costing.rb +2477 -2316
- data/lib/openstudio-standards/btap/costing/led_lighting_costing.rb +127 -142
- data/lib/openstudio-standards/btap/costing/lighting_costing.rb +216 -198
- data/lib/openstudio-standards/btap/costing/nv_costing.rb +522 -523
- data/lib/openstudio-standards/btap/costing/pv_ground_costing.rb +649 -649
- data/lib/openstudio-standards/btap/costing/shw_costing.rb +626 -625
- data/lib/openstudio-standards/btap/costing/thermal_bridging_costing.rb +72 -0
- data/lib/openstudio-standards/btap/costing/ventilation_costing.rb +2363 -2361
- data/lib/openstudio-standards/btap/deprecated.rb +1033 -0
- data/lib/openstudio-standards/btap/envelope.rb +313 -572
- data/lib/openstudio-standards/btap/fileio.rb +152 -1070
- data/lib/openstudio-standards/btap/geometry.rb +486 -766
- data/lib/openstudio-standards/btap/linear_regression.rb +130 -0
- data/lib/openstudio-standards/btap/paths.rb +46 -0
- data/lib/openstudio-standards/btap/qaqc/analysis.rb +163 -0
- data/lib/openstudio-standards/btap/qaqc/data.rb +2293 -0
- data/lib/openstudio-standards/btap/qaqc/datapoint.rb +641 -0
- data/lib/openstudio-standards/btap/schedules.rb +11 -611
- data/lib/openstudio-standards/btap/structure.rb +574 -189
- data/lib/openstudio-standards/constructions/materials/information.rb +1 -1
- data/lib/openstudio-standards/create_typical/create_typical.rb +1 -1
- data/lib/openstudio-standards/exterior_lighting/create.rb +135 -85
- data/lib/openstudio-standards/exterior_lighting/data/typical_exterior_lighting.json +20 -0
- data/lib/openstudio-standards/exterior_lighting/information.rb +23 -2
- data/lib/openstudio-standards/geometry/create.rb +7 -3
- data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.Model.rb +3 -2
- data/lib/openstudio-standards/prototypes/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.Model.rb +3 -2
- data/lib/openstudio-standards/prototypes/common/data/thermostat_schedule_lookup.json +84 -84
- data/lib/openstudio-standards/prototypes/common/objects/Prototype.hvac_systems.rb +4 -4
- data/lib/openstudio-standards/refrigeration/create_walkin.rb +45 -5
- data/lib/openstudio-standards/refrigeration/data/refrigerated_walkins.csv +75 -75
- data/lib/openstudio-standards/schedules/parametric.rb +6 -0
- data/lib/openstudio-standards/service_water_heating/create_typical.rb +10 -3
- data/lib/openstudio-standards/service_water_heating/create_water_heating_loop.rb +30 -14
- data/lib/openstudio-standards/service_water_heating/information.rb +4 -1
- data/lib/openstudio-standards/sql_file/unmet_hours.rb +2 -1
- data/lib/openstudio-standards/standards/Standards.CoilCoolingDXSingleSpeed.rb +3 -1
- data/lib/openstudio-standards/standards/Standards.CoilHeatingDXSingleSpeed.rb +3 -1
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.boilers.json +12 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2004/data/ashrae_90_1_2004.construction_properties.json +18432 -3072
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.boilers.json +26 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2007/data/ashrae_90_1_2007.construction_properties.json +8532 -1422
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.boilers.json +26 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2010/data/ashrae_90_1_2010.construction_properties.json +8532 -1422
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.boilers.json +16 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.computer_room_acs.json +30 -30
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2013/data/ashrae_90_1_2013.construction_properties.json +7560 -1260
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/ashrae_90_1_2016.PumpVariableSpeed.rb +1 -2
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/data/ashrae_90_1_2016.boilers.json +16 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2016/data/ashrae_90_1_2016.construction_properties.json +7560 -1260
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.AirLoopHVAC.rb +3 -3
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.PumpVariableSpeed.rb +1 -2
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.boilers.json +22 -0
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.construction_properties.json +7236 -1206
- data/lib/openstudio-standards/standards/ashrae_90_1/ashrae_90_1_2019/data/ashrae_90_1_2019.furnaces.json +223 -19
- data/lib/openstudio-standards/standards/ashrae_90_1/data/ashrae_90_1.schedules.json +37 -1
- data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm_2019/data/ashrae_90_1_prm_2019.boilers.json +3 -0
- data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm_2019/data/ashrae_90_1_prm_2019.construction_properties.json +6900 -1150
- data/lib/openstudio-standards/standards/cbes/data/cbes.schedules.json +1 -1
- data/lib/openstudio-standards/standards/deer/data/deer.schedules.json +1 -1
- data/lib/openstudio-standards/standards/necb/BTAP1980TO2010/data/surface_thermal_transmittance.json +76 -40
- data/lib/openstudio-standards/standards/necb/BTAPPRE1980/data/surface_thermal_transmittance.json +76 -40
- data/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb +6 -4
- data/lib/openstudio-standards/standards/necb/NECB2011/NECB2011_QAQC.json +2988 -0
- data/lib/openstudio-standards/standards/necb/NECB2011/autozone.rb +25 -3
- data/lib/openstudio-standards/standards/necb/NECB2011/building_envelope.rb +672 -534
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/Hospital.osm +1791 -1792
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LEEPMultiTower.osm +7 -1
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LEEPTownHouse.osm +7 -1
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LargeHotel.osm +5 -6
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/LargeOffice.osm +8 -9
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/NorthernEducation.osm +10 -4
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/NorthernHealthCare.osm +14 -15
- data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/Outpatient.osm +7 -1
- data/lib/openstudio-standards/standards/necb/NECB2011/data/surface_thermal_transmittance.json +76 -40
- data/lib/openstudio-standards/standards/necb/NECB2011/hvac_systems.rb +14 -6
- data/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb +542 -130
- data/lib/openstudio-standards/standards/necb/NECB2011/qaqc/necb_qaqc.rb +30 -63
- data/lib/openstudio-standards/standards/necb/NECB2011/service_water_heating.rb +7 -2
- data/lib/openstudio-standards/standards/necb/NECB2015/data/surface_thermal_transmittance.json +90 -0
- data/lib/openstudio-standards/standards/necb/NECB2015/necb_2015.rb +8 -6
- data/lib/openstudio-standards/standards/necb/NECB2017/data/surface_thermal_transmittance.json +76 -40
- data/lib/openstudio-standards/standards/necb/NECB2017/necb_2017.rb +2 -1
- data/lib/openstudio-standards/standards/necb/NECB2020/building_envelope.rb +0 -117
- data/lib/openstudio-standards/standards/necb/NECB2020/data/surface_thermal_transmittance.json +76 -45
- data/lib/openstudio-standards/standards/necb/NECB2020/necb_2020.rb +218 -0
- data/lib/openstudio-standards/standards/necb/common/construction_defaults.osm +12 -7
- data/lib/openstudio-standards/standards/standard.rb +1 -1
- data/lib/openstudio-standards/version.rb +1 -1
- data/lib/openstudio-standards.rb +9 -4
- metadata +59 -66
- data/data/inventory/thermal_bridging.csv +0 -90
- data/data/standards/OpenStudio_Standards-ashrae_90_1-ALL-comstock(space_types).xlsx +0 -0
- data/data/standards/openstudio_standards_duplicates_log.csv +0 -7962
- data/lib/openstudio-standards/btap/NECB_building_types.csv +0 -35
- data/lib/openstudio-standards/btap/NECB_space_types.csv +0 -109
- data/lib/openstudio-standards/btap/WeatherData1.json +0 -2110
- data/lib/openstudio-standards/btap/WeatherData1.xlsx +0 -0
- data/lib/openstudio-standards/btap/btap_result.rb +0 -1144
- data/lib/openstudio-standards/btap/btap_test_helper.rb +0 -86
- data/lib/openstudio-standards/btap/common_paths.rb +0 -81
- data/lib/openstudio-standards/btap/common_resources/ConstructionProperties.csv +0 -52
- data/lib/openstudio-standards/btap/common_resources/Constructions.csv +0 -37
- data/lib/openstudio-standards/btap/common_resources/construction_sets.csv +0 -1270
- data/lib/openstudio-standards/btap/common_resources/constructions_glazing.csv +0 -121
- data/lib/openstudio-standards/btap/common_resources/constructions_opaque.csv +0 -2256
- data/lib/openstudio-standards/btap/common_resources/costs.csv +0 -1897
- data/lib/openstudio-standards/btap/common_resources/costs_local_factors.csv +0 -2315
- data/lib/openstudio-standards/btap/common_resources/materials_glazing.csv +0 -35
- data/lib/openstudio-standards/btap/common_resources/materials_opaque.csv +0 -164
- data/lib/openstudio-standards/btap/costing/btap_measure_helper.rb +0 -359
- data/lib/openstudio-standards/btap/costing/btap_workflow.rb +0 -117
- data/lib/openstudio-standards/btap/costing/copy_test_results_files_to_expected_results.rb +0 -11
- data/lib/openstudio-standards/btap/costing/cost_building_from_file.rb +0 -136
- data/lib/openstudio-standards/btap/costing/costing_database_wrapper.rb +0 -173
- data/lib/openstudio-standards/btap/costing/dummy.epw +0 -8768
- data/lib/openstudio-standards/btap/costing/dummy.osm +0 -5320
- data/lib/openstudio-standards/btap/costing/neb_end_use_prices.csv +0 -42
- data/lib/openstudio-standards/btap/costing/necb_2011_spacetype_info.csv +0 -225
- data/lib/openstudio-standards/btap/costing/necb_reference_runs.csv +0 -28705
- data/lib/openstudio-standards/btap/costing/parallel_tests.rb +0 -92
- data/lib/openstudio-standards/btap/costing/test_list.txt +0 -15
- data/lib/openstudio-standards/btap/costing/test_run_all_test_locally.rb +0 -27
- data/lib/openstudio-standards/btap/costing/test_run_costing_tests.rb +0 -80
- data/lib/openstudio-standards/btap/necb_2011_spacetype_info.csv +0 -225
- data/lib/openstudio-standards/btap/utilities/Add_template_field_to_json.rb +0 -22
- data/lib/openstudio-standards/btap/utilities/convert_surfaces_to_adiabatic_necb_8426.rb +0 -204
- data/lib/openstudio-standards/btap/utilities/generate_space_types.rb +0 -8
- data/lib/openstudio-standards/btap/utilities/necb_to_epw_map.rb +0 -50
- data/lib/openstudio-standards/btap/utilities/os_sim_extract.rb +0 -48
- data/lib/openstudio-standards/btap/utilities/rename_surfaces.rb +0 -24
- data/lib/openstudio-standards/btap/utilities/round_surf_coords.rb +0 -32
- data/lib/openstudio-standards/btap/utilities/sched_create.rb +0 -145
- data/lib/openstudio-standards/btap/utilities/set_mult_to_adiabatic.rb +0 -53
- data/lib/openstudio-standards/btap/utilities/space_type.rb +0 -78
- data/lib/openstudio-standards/btap/utilities/weatherData1_xlsx_to_json.rb +0 -56
- data/lib/openstudio-standards/btap/vintagizer.rb +0 -161
- data/lib/openstudio-standards/btap/visualization.rb +0 -72
- data/lib/openstudio-standards/standards/necb/NECB2011/data/necb_2011_spacetype_info.csv +0 -225
- data/lib/openstudio-standards/standards/necb/common/btap_analysis.rb +0 -79
- data/lib/openstudio-standards/standards/necb/common/btap_data.rb +0 -2656
- data/lib/openstudio-standards/standards/necb/common/btap_datapoint.rb +0 -653
- data/lib/openstudio-standards/standards/necb/common/necb_reference_runs.csv +0 -28705
- data/lib/openstudio-standards/standards/necb/common/utility_pricing_2025-02-20.csv +0 -92
- /data/lib/openstudio-standards/btap/{common_resources → common}/carbon_frame.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/carbon_glazing.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/carbon_opaque.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/hvac_vent_ahu.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/lighting.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/lighting_sets.csv +0 -0
- /data/lib/openstudio-standards/btap/{common_resources → common}/locations.csv +0 -0
- /data/lib/openstudio-standards/btap/{costing → common}/mech_sizing.json +0 -0
|
@@ -1,209 +1,227 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
light_type = 'CFL'
|
|
1
|
+
module BTAP
|
|
2
|
+
class Costing
|
|
3
|
+
def cost_audit_lighting(model, prototype_creator)
|
|
4
|
+
|
|
5
|
+
# Store number of stories. Required for envelope costing logic.
|
|
6
|
+
num_of_above_ground_stories = model.getBuilding.standardsNumberOfAboveGroundStories.to_i
|
|
7
|
+
|
|
8
|
+
template_type = prototype_creator.template
|
|
9
|
+
totLgtCost = 0
|
|
10
|
+
|
|
11
|
+
# Calculate daylighting sensor control and lighting costing.
|
|
12
|
+
dsc_cost_total = cost_audit_daylighting_sensor_control(model: model, prototype_creator: prototype_creator)
|
|
13
|
+
led_cost_total = cost_audit_led_lighting(model: model, prototype_creator: prototype_creator)
|
|
14
|
+
totLgtCost += dsc_cost_total
|
|
15
|
+
|
|
16
|
+
# Create zonal report.
|
|
17
|
+
@costing_report["lighting"]["fixture_report"] = []
|
|
18
|
+
@costing_report["lighting"]["space_report"] = []
|
|
19
|
+
model.getThermalZonesSorted.each do |zone|
|
|
20
|
+
|
|
21
|
+
# Iterate through spaces.
|
|
22
|
+
spaceNum = 0 # Counting number of spaces for reporting.
|
|
23
|
+
zone.getSpacesSorted.each do |space|
|
|
24
|
+
|
|
25
|
+
spaceNum += 1
|
|
26
|
+
total_with_region = 0
|
|
27
|
+
|
|
28
|
+
# Get the SpaceType of the space. If it is not defined it, it will
|
|
29
|
+
# skip the spacetype.
|
|
30
|
+
if space.spaceType.empty? or space.spaceType.get.standardsSpaceType.empty? or space.spaceType.get.standardsBuildingType.empty?
|
|
31
|
+
raise ("standards Space type and building type is not defined for space:#{space.name.get}. Skipping this space for costing.")
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# Get space type standard names.
|
|
35
|
+
space_type = space.spaceType.get.standardsSpaceType
|
|
36
|
+
building_type = space.spaceType.get.standardsBuildingType
|
|
37
|
+
space_light = space.spaceType.get.lights
|
|
38
|
+
space_has_no_light = space_light.empty?
|
|
39
|
+
|
|
40
|
+
# Figure out what light_type is used in the building.
|
|
41
|
+
light_type = 'Nil'
|
|
42
|
+
if space_has_no_light == false
|
|
43
|
+
space.spaceType.get.lights.sort.each do |light|
|
|
44
|
+
space_lights_definition = light.lightsDefinition
|
|
45
|
+
space_lights_definition_name = space_lights_definition.name
|
|
46
|
+
|
|
47
|
+
# NOTE: NECB2020's lights default is LED.
|
|
48
|
+
if space_lights_definition_name.to_s.include?('LED lighting') or template_type == 'NECB2020'
|
|
49
|
+
light_type = 'LED'
|
|
50
|
+
else
|
|
51
|
+
light_type = 'CFL'
|
|
52
|
+
end
|
|
54
53
|
end
|
|
55
54
|
end
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
data['building_type'].to_s.downcase
|
|
63
|
-
data['space_type'].to_s.downcase
|
|
64
|
-
data['Type'].to_s.downcase
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
data['building_type'].to_s.downcase
|
|
70
|
-
data['space_type'].to_s.downcase
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
# Find Fixture type for this space ceiling height (ft)
|
|
83
|
-
fixtureType = 'Nil'
|
|
84
|
-
fixture_description = ""
|
|
85
|
-
if lighting_set.nil?
|
|
86
|
-
raise("Error: lighting_set empty for zone #{zone.name.to_s} and space type #{building_type} #{space_type.to_s}!")
|
|
87
|
-
else
|
|
88
|
-
if ceilHgt > 0 && ceilHgt < 7.88
|
|
89
|
-
fixtureType = lighting_set["Fixture_type_less_than_7.88ft_ht"]
|
|
90
|
-
elsif ceilHgt >= 7.88 && ceilHgt <= 15.75
|
|
91
|
-
fixtureType = lighting_set["Fixture_type_7.88_to_15.75ft_ht"]
|
|
92
|
-
elsif ceilHgt > 15.75
|
|
93
|
-
fixtureType = lighting_set["Fixture_type_greater_than_>15.75ft_ht"]
|
|
55
|
+
|
|
56
|
+
# Get standard lighting sets based on collected information
|
|
57
|
+
# (spacetype, no of stories, etc.).
|
|
58
|
+
if space_has_no_light == false
|
|
59
|
+
lighting_set = @costing_database['raw']['lighting_sets'].detect {|data|
|
|
60
|
+
data['template'].to_s.gsub(/\s*/, '') == template_type and
|
|
61
|
+
data['building_type'].to_s.downcase == building_type.to_s.downcase and
|
|
62
|
+
data['space_type'].to_s.downcase == space_type.to_s.downcase and
|
|
63
|
+
data['Type'].to_s.downcase == light_type.to_s.downcase
|
|
64
|
+
}
|
|
65
|
+
else
|
|
66
|
+
lighting_set = @costing_database['raw']['lighting_sets'].detect {|data|
|
|
67
|
+
data['template'].to_s.gsub(/\s*/, '') == template_type and
|
|
68
|
+
data['building_type'].to_s.downcase == building_type.to_s.downcase and
|
|
69
|
+
data['space_type'].to_s.downcase == space_type.to_s.downcase
|
|
70
|
+
}
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Determine average space height using space volume and floor area
|
|
74
|
+
# (convert to feet).
|
|
75
|
+
ceilHgt, flrArea = 0
|
|
76
|
+
if space.floorArea > 0
|
|
77
|
+
ceilHgt = space.volume / space.floorArea
|
|
78
|
+
ceilHgt = OpenStudio.convert(ceilHgt,"m","ft").get
|
|
79
|
+
flrArea = OpenStudio.convert(space.floorArea,"m^2","ft^2").get
|
|
94
80
|
end
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
lighting_type = @costing_database['raw']['lighting'].select {|lighting_layer_data|
|
|
102
|
-
lighting_layer_data['lighting_type_id'].to_s == fixtureType.to_s
|
|
103
|
-
}.first
|
|
104
|
-
|
|
105
|
-
# Scan through layer IDs in id_layers field to get API data from materials_lighting sheet
|
|
106
|
-
materials_lighting_database = @costing_database["raw"]["materials_lighting"]
|
|
107
|
-
|
|
108
|
-
layer_type_IDs = []
|
|
109
|
-
layer_type_mult = []
|
|
110
|
-
layer_MaterialCost = 0
|
|
111
|
-
layer_LabourCost = 0
|
|
112
|
-
|
|
113
|
-
if lighting_type["id_layers"].empty?
|
|
114
|
-
raise ("Lighting type layers list for lighting type ID #{fixtureType} is empty.")
|
|
81
|
+
|
|
82
|
+
# Find Fixture type for this space ceiling height (ft).
|
|
83
|
+
fixtureType = 'Nil'
|
|
84
|
+
fixture_description = ""
|
|
85
|
+
if lighting_set.nil?
|
|
86
|
+
raise("Error: lighting_set empty for zone #{zone.name.to_s} and space type #{building_type} #{space_type.to_s}!")
|
|
115
87
|
else
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
88
|
+
if ceilHgt > 0 && ceilHgt < 7.88
|
|
89
|
+
fixtureType = lighting_set["Fixture_type_less_than_7.88ft_ht"]
|
|
90
|
+
elsif ceilHgt >= 7.88 && ceilHgt <= 15.75
|
|
91
|
+
fixtureType = lighting_set["Fixture_type_7.88_to_15.75ft_ht"]
|
|
92
|
+
elsif ceilHgt > 15.75
|
|
93
|
+
fixtureType = lighting_set["Fixture_type_greater_than_>15.75ft_ht"]
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
# Costs are 0 for 'Nil' because no fixture type due to either zero
|
|
98
|
+
# floor area, zero ceiling height or a 'Nil' setting for fixture type
|
|
99
|
+
# in lighting_sets sheet ("- undefined -" space).
|
|
100
|
+
if fixtureType != 'Nil'
|
|
101
|
+
|
|
102
|
+
# Get lighting type sets based on fixtureType.
|
|
103
|
+
lighting_type = @costing_database['raw']['lighting'].select {|lighting_layer_data|
|
|
104
|
+
lighting_layer_data['lighting_type_id'].to_s == fixtureType.to_s
|
|
105
|
+
}.first
|
|
106
|
+
|
|
107
|
+
# Scan through layer IDs in id_layers field to get API data from materials_lighting sheet
|
|
108
|
+
materials_lighting_database = @costing_database["raw"]["materials_lighting"]
|
|
109
|
+
|
|
110
|
+
layer_type_IDs = []
|
|
111
|
+
layer_type_mult = []
|
|
112
|
+
layer_MaterialCost = 0
|
|
113
|
+
layer_LabourCost = 0
|
|
114
|
+
|
|
115
|
+
if lighting_type["id_layers"].empty?
|
|
116
|
+
raise ("Lighting type layers list for lighting type ID #{fixtureType} is empty.")
|
|
117
|
+
else
|
|
118
|
+
layer_type_IDs = lighting_type["id_layers"].split(/\s*,\s*/)
|
|
119
|
+
layer_type_mult = lighting_type["Id_layers_quantity_multipliers"].split(/\s*,\s*/)
|
|
120
|
+
lighting_layers = layer_type_IDs.zip(layer_type_mult).to_h
|
|
121
|
+
|
|
122
|
+
lighting_layers.each do |layer_id, layer_mult|
|
|
123
|
+
|
|
124
|
+
# NOTE: The column in `lighting.csv` labelled
|
|
125
|
+
# "lighting_type_id" is mislabelled and should really be
|
|
126
|
+
# "lighting_type_layer_id" but left it as-is (below).
|
|
127
|
+
lighting_material = materials_lighting_database.find do |data|
|
|
128
|
+
data["lighting_type_id"].to_s == layer_id.to_s
|
|
129
|
+
end
|
|
130
|
+
if lighting_material.nil?
|
|
131
|
+
puts "Lighting material error..could not find lighting material #{layer_id} in #{materials_lighting_database}"
|
|
133
132
|
raise
|
|
134
133
|
else
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
'
|
|
193
|
-
'
|
|
194
|
-
'floor_area_ft2' => (flrArea * space.multiplier).round(1),
|
|
195
|
-
'cost' => total_with_region.round(2),
|
|
196
|
-
'cost_per_ft2' => (total_with_region / (flrArea * space.multiplier)).round(2),
|
|
197
|
-
'spaces' => [space.name.get],
|
|
198
|
-
'number_of_spaces' => 1
|
|
134
|
+
costing_data = @costing_database['costs'].detect {|data| data['id'].to_s.upcase == lighting_material['id'].to_s.upcase}
|
|
135
|
+
if costing_data.nil?
|
|
136
|
+
puts "Lighting material id #{lighting_material['id']} not found in costing data. Skipping."
|
|
137
|
+
raise
|
|
138
|
+
else
|
|
139
|
+
|
|
140
|
+
# Get cost information from lookup.
|
|
141
|
+
material_cost =
|
|
142
|
+
costing_data['baseCosts']['materialOpCost'].to_f * layer_mult.to_f * flrArea * zone.multiplier
|
|
143
|
+
|
|
144
|
+
labour_cost =
|
|
145
|
+
costing_data['baseCosts']['laborOpCost'].to_f * layer_mult.to_f * flrArea * zone.multiplier
|
|
146
|
+
|
|
147
|
+
layer_MaterialCost += material_cost
|
|
148
|
+
layer_LabourCost += labour_cost
|
|
149
|
+
|
|
150
|
+
regional_material, regional_installation =
|
|
151
|
+
get_regional_cost_factors(@costing_report["province_state"],
|
|
152
|
+
@costing_report["city"],
|
|
153
|
+
lighting_material)
|
|
154
|
+
|
|
155
|
+
total_with_region =
|
|
156
|
+
layer_MaterialCost * regional_material / 100.0 + layer_LabourCost * regional_installation / 100.0
|
|
157
|
+
|
|
158
|
+
# Gather info for costed items output file.
|
|
159
|
+
tags = ['lighting','necb_default']
|
|
160
|
+
add_costed_item(material_id: costing_data['id'],
|
|
161
|
+
quantity: layer_mult.to_f * flrArea * zone.multiplier,
|
|
162
|
+
material_mult: costing_data['material_mult'].to_f,
|
|
163
|
+
labour_mult: costing_data['labour_mult'].to_f,
|
|
164
|
+
equip_mult: 1.0,
|
|
165
|
+
tags: tags)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
end # costing_data Nil check
|
|
169
|
+
end # lighting_material Nil check
|
|
170
|
+
end # lighting layer ids loop
|
|
171
|
+
|
|
172
|
+
totLgtCost += total_with_region
|
|
173
|
+
fixture_description = lighting_type["description"]
|
|
174
|
+
end # lighting layer ids check
|
|
175
|
+
end # fixtureType Nil check
|
|
176
|
+
|
|
177
|
+
zName = zone.name.to_s
|
|
178
|
+
|
|
179
|
+
# Create Lighting space report.
|
|
180
|
+
@costing_report["lighting"]["space_report"] << {
|
|
181
|
+
'space' => space.name.to_s,
|
|
182
|
+
'zone' => zone.name.to_s,
|
|
183
|
+
'building_type' =>space.spaceType.get.standardsBuildingType.to_s,
|
|
184
|
+
'space_type' => space.spaceType.get.standardsSpaceType.to_s,
|
|
185
|
+
'zone_multiplier' => space.multiplier,
|
|
186
|
+
'fixture_type' => fixtureType,
|
|
187
|
+
'fixture_desciption' => fixture_description,
|
|
188
|
+
'height_avg_ft' => ceilHgt.round(1),
|
|
189
|
+
'floor_area_ft2' => (flrArea * space.multiplier).round(1),
|
|
190
|
+
'cost' => total_with_region.round(2),
|
|
191
|
+
'cost_per_ft2' => (total_with_region / ( flrArea * space.multiplier )).round(2),
|
|
192
|
+
'note' => ""
|
|
199
193
|
}
|
|
200
|
-
end
|
|
201
|
-
end # Spaces loop
|
|
202
|
-
end # thermalzone loop
|
|
203
194
|
|
|
204
|
-
|
|
205
|
-
|
|
195
|
+
# Create Lighting Zonal report.
|
|
196
|
+
lighting_fixture_report = @costing_report["lighting"]["fixture_report"].detect {|fixture_report| fixture_report["fixture_type"] == fixtureType}
|
|
197
|
+
unless lighting_fixture_report.nil?
|
|
198
|
+
lighting_fixture_report['floor_area_ft2'] =
|
|
199
|
+
(lighting_fixture_report['floor_area_ft2'] + (flrArea * space.multiplier)).round(1)
|
|
200
|
+
|
|
201
|
+
lighting_fixture_report['cost'] = (lighting_fixture_report['cost'] + total_with_region).round(2)
|
|
202
|
+
lighting_fixture_report['cost_per_ft2'] =
|
|
203
|
+
(lighting_fixture_report['cost'] / lighting_fixture_report['floor_area_ft2']).round(2)
|
|
204
|
+
|
|
205
|
+
lighting_fixture_report['spaces'] << space.name.get
|
|
206
|
+
lighting_fixture_report['number_of_spaces'] = lighting_fixture_report['spaces'].size
|
|
207
|
+
else
|
|
208
|
+
@costing_report["lighting"]["fixture_report"] << {
|
|
209
|
+
'fixture_type' => fixtureType,
|
|
210
|
+
'fixture_description' => fixture_description,
|
|
211
|
+
'floor_area_ft2' => (flrArea * space.multiplier).round(1),
|
|
212
|
+
'cost' => total_with_region.round(2),
|
|
213
|
+
'cost_per_ft2' => (total_with_region / (flrArea * space.multiplier)).round(2),
|
|
214
|
+
'spaces' => [space.name.get],
|
|
215
|
+
'number_of_spaces' => 1
|
|
216
|
+
}
|
|
217
|
+
end
|
|
218
|
+
end # Spaces loop
|
|
219
|
+
end # thermalzone loop
|
|
220
|
+
|
|
221
|
+
@costing_report["lighting"]['total_lighting_cost'] = totLgtCost.round(2)
|
|
222
|
+
puts "\nLighting costing data successfully generated. Total lighting cost is $#{totLgtCost.round(2)}"
|
|
206
223
|
|
|
207
|
-
|
|
224
|
+
return totLgtCost
|
|
225
|
+
end
|
|
208
226
|
end
|
|
209
227
|
end
|