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,177 +1,234 @@
|
|
|
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
|
-
|
|
1
|
+
# BTAP Carbon
|
|
2
|
+
#
|
|
3
|
+
# Calculates embodied carbon emissions currently accounting only for building
|
|
4
|
+
# envelopes.
|
|
5
|
+
|
|
6
|
+
module BTAP
|
|
7
|
+
class Carbon
|
|
8
|
+
|
|
9
|
+
# @param attributes [BTAP::Attributes]
|
|
10
|
+
# @param standards_data [Hash] Required for window frame conversions.
|
|
11
|
+
def initialize(attributes:, standards_data:)
|
|
12
|
+
@carbon_database = {}
|
|
13
|
+
@costing_database = Database.instance
|
|
14
|
+
@attributes = attributes
|
|
15
|
+
@carbon_report = {}
|
|
16
|
+
@frame_m_to_kg = standards_data["constants"]["glazing_frame_m_to_kg"]
|
|
17
|
+
|
|
18
|
+
# Build the carbon database.
|
|
19
|
+
carbon_opaque = CSV.read(Paths::CARBON_OPAQUE_PATH)
|
|
20
|
+
@carbon_database["opaque"] = Array.new
|
|
21
|
+
|
|
22
|
+
1.upto carbon_opaque.length - 1 do |i|
|
|
23
|
+
row = carbon_opaque[i]
|
|
24
|
+
index = row.each
|
|
25
|
+
item = Hash.new
|
|
26
|
+
|
|
27
|
+
item["materials_opaque_id"] = index.next
|
|
28
|
+
item["description"] = index.next
|
|
29
|
+
item["type"] = index.next
|
|
30
|
+
item["quantity"] = index.next.to_f
|
|
31
|
+
item["per m2"] = index.next.to_f
|
|
32
|
+
item["Product Category"] = index.next
|
|
33
|
+
item["Embodied Carbon (A1-A5)"] = index.next.to_f
|
|
34
|
+
item["Embodied Carbon (A-C)"] = index.next.to_f
|
|
35
|
+
item["Environmental Product Declaration (EPD)"] = index.next
|
|
36
|
+
|
|
37
|
+
@carbon_database["opaque"] << item
|
|
38
|
+
end
|
|
31
39
|
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
carbon_glazing = CSV.read(Paths::CARBON_GLAZING_PATH)
|
|
41
|
+
@carbon_database["glazing"] = Array.new
|
|
34
42
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
1.upto carbon_glazing.length - 1 do |i|
|
|
44
|
+
row = carbon_glazing[i]
|
|
45
|
+
index = row.each
|
|
46
|
+
item = Hash.new
|
|
39
47
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
item["materials_glazing_id"] = index.next
|
|
49
|
+
item["description"] = index.next
|
|
50
|
+
item["per m2"] = index.next.to_f
|
|
51
|
+
item["Embodied Carbon (A1-A5)"] = index.next.to_f
|
|
52
|
+
item["Embodied Carbon (A-C)"] = index.next.to_f
|
|
53
|
+
item["Environmental Product Declaration (EPD)"] = index.next
|
|
46
54
|
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
@carbon_database["glazing"] << item
|
|
56
|
+
end
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
carbon_frame = CSV.read(Paths::CARBON_FRAME_PATH)
|
|
59
|
+
@carbon_database["frame"] = Array.new
|
|
52
60
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
1.upto carbon_frame.length - 1 do |i|
|
|
62
|
+
row = carbon_frame[i]
|
|
63
|
+
index = row.each
|
|
64
|
+
item = Hash.new
|
|
57
65
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
item["materials_glazing_id"] = index.next
|
|
67
|
+
item["description"] = index.next
|
|
68
|
+
item["per m2"] = index.next.to_f
|
|
69
|
+
item["Embodied Carbon (A1-A5)"] = index.next.to_f
|
|
70
|
+
item["Embodied Carbon (A-C)"] = index.next.to_f
|
|
71
|
+
item["Environmental Product Declaration (EPD)"] = index.next
|
|
64
72
|
|
|
65
|
-
|
|
73
|
+
@carbon_database["frame"] << item
|
|
74
|
+
end
|
|
66
75
|
end
|
|
67
|
-
end
|
|
68
76
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
@carbon_report["#{surface_type.underscore}_area_m2"] = 0.0
|
|
72
|
-
@carbon_report["#{surface_type.underscore}_carbon"] = 0.0
|
|
73
|
-
end
|
|
77
|
+
def audit_embodied_carbon
|
|
78
|
+
total_emissions = 0
|
|
74
79
|
|
|
75
|
-
@attributes.spaces.each do |space|
|
|
76
80
|
@attributes.surface_types.each do |surface_type|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
# Get the carbon emissions for each material in the space.
|
|
83
|
-
if surface.construction_hash.nil?
|
|
84
|
-
emissions = 0.0
|
|
85
|
-
else
|
|
86
|
-
emissions = get_carbon_emissions(surface.construction_hash, surface, surface_area)
|
|
87
|
-
construction = surface.construction_hash
|
|
88
|
-
end
|
|
81
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_area_m2"] = 0.0
|
|
82
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_carbon"] = 0.0
|
|
83
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_carbon_per_m2"] = 0.0
|
|
84
|
+
end
|
|
89
85
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
# Calculate emissions for all constructions found by BTAP Attributes.
|
|
87
|
+
@attributes.constructions.each_value do |construction|
|
|
88
|
+
construction["subsets"].each do |subset|
|
|
89
|
+
subset["carbon"] = emissions_from_construction(subset, construction["type"])
|
|
93
90
|
end
|
|
94
91
|
end
|
|
95
|
-
end
|
|
96
92
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
@attributes.surface_types.each do |surface_type|
|
|
100
|
-
total_emissions += @carbon_report["#{surface_type.underscore}_carbon"]
|
|
101
|
-
end
|
|
93
|
+
# Calculate window perimeter for frame calculations.
|
|
94
|
+
@attributes.compile_window_perimeter
|
|
102
95
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
96
|
+
@attributes.surface_types.each do |surface_type|
|
|
97
|
+
unless @attributes.surface_types_to_assembly_tallies[surface_type].empty?
|
|
98
|
+
@attributes.surface_types_to_assembly_tallies[surface_type].each_pair do |assembly_name, tallies|
|
|
99
|
+
total_area = tallies["area"]
|
|
100
|
+
construction = @attributes.constructions[assembly_name]
|
|
101
|
+
rsi = construction["rsi"]
|
|
102
|
+
surface_is_glazing = surface_type =~ /Window/
|
|
103
|
+
|
|
104
|
+
# Factor in window frame emissions if this is a glazing
|
|
105
|
+
# construction. Currently we only have data for fixed and operable
|
|
106
|
+
# windows.
|
|
107
|
+
if surface_is_glazing
|
|
108
|
+
carbon_range_array = construction["subsets"].map { |subset|
|
|
109
|
+
[subset["rsi"], subset["carbon"] + emissions_from_window_frame(subset, tallies["perimeter"])] }
|
|
110
|
+
else
|
|
111
|
+
carbon_range_array = construction["subsets"].map { |subset| [subset["rsi"], subset["carbon"]] }
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
emissions, _ = BTAP::LinearRegression.interpolate(x_y_array: carbon_range_array, x2: rsi)
|
|
115
|
+
|
|
116
|
+
# Calculate the carbon emissions for the surface type and append the
|
|
117
|
+
# result to the total emissions.
|
|
118
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_carbon"] = emissions
|
|
119
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_area_m2"] = total_area
|
|
120
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_carbon_per_m2"] = (
|
|
121
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_carbon"] /
|
|
122
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_area_m2"])
|
|
123
|
+
|
|
124
|
+
total_emissions += emissions * total_area
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
end
|
|
106
128
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
id_column = materials_file + "_id"
|
|
112
|
-
id_layers_column = "material_#{construction["type"]}_id_layers"
|
|
129
|
+
# Get the total emissions from all the surface types.
|
|
130
|
+
@attributes.surface_types.each do |surface_type|
|
|
131
|
+
total_emissions += @carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_carbon"]
|
|
132
|
+
end
|
|
113
133
|
|
|
114
|
-
|
|
134
|
+
# Add the embodied carbon tallied from TBD which tallies carbon emissions
|
|
135
|
+
# of items that aren't explicitly modeled
|
|
136
|
+
structure_carbon = @attributes.model.getBuilding.additionalProperties.getFeatureAsDouble("co2_structure").get
|
|
137
|
+
@carbon_report["structure_carbon"] = structure_carbon.round(2)
|
|
138
|
+
total_emissions += structure_carbon
|
|
139
|
+
|
|
140
|
+
# Factor in parapets likewise for costing in `envelope_costing.rb`.
|
|
141
|
+
if @attributes.use_tbd
|
|
142
|
+
wall_carbon_per_m2 = @carbon_report["exterior_wall_carbon_per_m2"]
|
|
143
|
+
parapet_carbon = @attributes.tbd_edge_tallies["parapet"].values.first * wall_carbon_per_m2
|
|
144
|
+
@carbon_report["parapet_carbon"] = parapet_carbon.round(2)
|
|
145
|
+
total_emissions += parapet_carbon
|
|
146
|
+
end
|
|
115
147
|
|
|
116
|
-
|
|
117
|
-
material_carbon = @carbon_database[construction["type"]].find { |row|
|
|
118
|
-
row[id_column] == material_id }["Embodied Carbon (A-C)"]
|
|
148
|
+
puts "Warning: Interpolation limits exceeded." if BTAP::LinearRegression.extrapolation_boundaries_exceeded?
|
|
119
149
|
|
|
120
|
-
|
|
121
|
-
|
|
150
|
+
# Round everything at the end.
|
|
151
|
+
@attributes.surface_types.each do |surface_type|
|
|
152
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_carbon"] = \
|
|
153
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_carbon"].round(2)
|
|
154
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_area_m2"] = \
|
|
155
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_area_m2"].round(2)
|
|
156
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_carbon_per_m2"] = \
|
|
157
|
+
@carbon_report["#{@attributes.surface_types_to_snake[surface_type]}_carbon_per_m2"].round(2)
|
|
122
158
|
end
|
|
123
159
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
160
|
+
puts "\nEmbodied carbon data successfully generated. Total embodied carbon emissions is " \
|
|
161
|
+
"#{total_emissions.to_f.round(2)} kg/m^2"
|
|
162
|
+
@carbon_report["total"] = total_emissions
|
|
163
|
+
return @carbon_report
|
|
164
|
+
end
|
|
128
165
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
166
|
+
# Retrieve the carbon emissions given a construction.
|
|
167
|
+
#
|
|
168
|
+
# @param construction [Hash]
|
|
169
|
+
# @param type [String] either "opaque" or "glazing"
|
|
170
|
+
# @return [Float]
|
|
171
|
+
def emissions_from_construction(construction, type)
|
|
172
|
+
total_emissions = 0.0
|
|
173
|
+
materials_file = "materials_#{type}"
|
|
174
|
+
id_column = materials_file + "_id"
|
|
175
|
+
|
|
176
|
+
construction["id_layers"].each do |material_id|
|
|
177
|
+
material_entry = get_material_entry(material_id, id_column, type)
|
|
178
|
+
next if material_entry.nil?
|
|
179
|
+
material_emissions = material_entry["Embodied Carbon (A-C)"]
|
|
180
|
+
total_emissions += material_emissions
|
|
181
|
+
end
|
|
135
182
|
|
|
136
|
-
|
|
137
|
-
|
|
183
|
+
return total_emissions
|
|
184
|
+
end
|
|
138
185
|
|
|
139
|
-
|
|
140
|
-
|
|
186
|
+
# Retrieve the carbon emissions for window frames. This requires its surface,
|
|
187
|
+
# its construction, and its perimeter.
|
|
188
|
+
#
|
|
189
|
+
# @param construction [Hash]
|
|
190
|
+
# @param Perimeter [Float]
|
|
191
|
+
# @return [Float]
|
|
192
|
+
def emissions_from_window_frame(construction, perimeter)
|
|
193
|
+
fenestration_type = construction["fenestration_type"]
|
|
194
|
+
|
|
195
|
+
# Skip skylights and doors since we don't have the data for them.
|
|
196
|
+
# Only consider fixed and operable windows.
|
|
197
|
+
if fenestration_type != "FixedWindow" and fenestration_type != "OperableWindow"
|
|
198
|
+
puts "Warning: #{construction["name"]} is not available for carbon calculation, returning zero."
|
|
199
|
+
return 0.0
|
|
200
|
+
end
|
|
141
201
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
202
|
+
frame_emissions = 0.0
|
|
203
|
+
frame_material = construction["frame_material"]
|
|
204
|
+
fenestration_number_of_panes = construction["fenestration_number_of_panes"]
|
|
145
205
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
construction_description = construction["description"].downcase
|
|
152
|
-
["vinyl-wood", "plastic", "aluminum"].each do |material|
|
|
153
|
-
if material in construction_component
|
|
154
|
-
frame_material = material
|
|
155
|
-
break
|
|
156
|
-
elsif material in construction_description
|
|
157
|
-
frame_material = material
|
|
158
|
-
break
|
|
159
|
-
end
|
|
160
|
-
end
|
|
206
|
+
construction["id_layers"].each do |material_id|
|
|
207
|
+
material_entry = get_material_entry(material_id, "materials_glazing_id", "frame")
|
|
208
|
+
next if material_entry.nil?
|
|
209
|
+
frame_emissions += material_entry["Embodied Carbon (A-C)"]
|
|
210
|
+
end
|
|
161
211
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
212
|
+
# Get the conversion factor for the window frame and add it to the total emissions.
|
|
213
|
+
conversion_factor = @frame_m_to_kg[frame_material][fenestration_type][fenestration_number_of_panes]
|
|
214
|
+
return frame_emissions * perimeter * conversion_factor
|
|
215
|
+
end
|
|
165
216
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
217
|
+
# Get a material entry from the carbon database.
|
|
218
|
+
#
|
|
219
|
+
# @param type [String] Name of the hash key.
|
|
220
|
+
def get_material_entry(id, id_column, materials_file)
|
|
221
|
+
material_entry = @carbon_database[materials_file].find { |row| row[id_column] == id }
|
|
222
|
+
|
|
223
|
+
if material_entry.nil?
|
|
224
|
+
# TODO: This will happen a lot because of the new thermal bridging entries
|
|
225
|
+
# as of nrcan_476. The carbon database needs to be updated. BTAP Carbon
|
|
226
|
+
# will not be very useful until then.
|
|
227
|
+
puts "Error: Could not find #{materials_file} material with ID #{id} in the carbon database. " \
|
|
228
|
+
"Skipping."
|
|
170
229
|
end
|
|
171
230
|
|
|
172
|
-
|
|
231
|
+
return material_entry
|
|
173
232
|
end
|
|
174
|
-
|
|
175
|
-
return total_emissions
|
|
176
233
|
end
|
|
177
234
|
end
|