openstudio-standards 0.8.3 → 0.8.4

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.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/lib/openstudio-standards/btap/costing/README.md +502 -0
  3. data/lib/openstudio-standards/btap/costing/btap_costing.rb +473 -0
  4. data/lib/openstudio-standards/btap/costing/btap_measure_helper.rb +359 -0
  5. data/lib/openstudio-standards/btap/costing/btap_workflow.rb +117 -0
  6. data/lib/openstudio-standards/btap/costing/common_paths.rb +78 -0
  7. data/lib/openstudio-standards/btap/costing/common_resources/ConstructionProperties.csv +52 -0
  8. data/lib/openstudio-standards/btap/costing/common_resources/Constructions.csv +37 -0
  9. data/lib/openstudio-standards/btap/costing/common_resources/construction_sets.csv +1270 -0
  10. data/lib/openstudio-standards/btap/costing/common_resources/constructions_glazing.csv +61 -0
  11. data/lib/openstudio-standards/btap/costing/common_resources/constructions_opaque.csv +2256 -0
  12. data/lib/openstudio-standards/btap/costing/common_resources/costs.csv +1904 -0
  13. data/lib/openstudio-standards/btap/costing/common_resources/costs_local_factors.csv +2315 -0
  14. data/lib/openstudio-standards/btap/costing/common_resources/hvac_vent_ahu.csv +925 -0
  15. data/lib/openstudio-standards/btap/costing/common_resources/lighting.csv +364 -0
  16. data/lib/openstudio-standards/btap/costing/common_resources/lighting_sets.csv +2667 -0
  17. data/lib/openstudio-standards/btap/costing/common_resources/locations.csv +75 -0
  18. data/lib/openstudio-standards/btap/costing/common_resources/materials_glazing.csv +35 -0
  19. data/lib/openstudio-standards/btap/costing/common_resources/materials_hvac.csv +1699 -0
  20. data/lib/openstudio-standards/btap/costing/common_resources/materials_lighting.csv +267 -0
  21. data/lib/openstudio-standards/btap/costing/common_resources/materials_opaque.csv +164 -0
  22. data/lib/openstudio-standards/btap/costing/copy_test_results_files_to_expected_results.rb +11 -0
  23. data/lib/openstudio-standards/btap/costing/cost_building_from_file.rb +136 -0
  24. data/lib/openstudio-standards/btap/costing/costing_database_wrapper.rb +177 -0
  25. data/lib/openstudio-standards/btap/costing/daylighting_sensor_control_costing.rb +353 -0
  26. data/lib/openstudio-standards/btap/costing/dcv_costing.rb +314 -0
  27. data/lib/openstudio-standards/btap/costing/dummy.epw +8768 -0
  28. data/lib/openstudio-standards/btap/costing/dummy.osm +5320 -0
  29. data/lib/openstudio-standards/btap/costing/envelope_costing.rb +284 -0
  30. data/lib/openstudio-standards/btap/costing/heating_cooling_costing.rb +2584 -0
  31. data/lib/openstudio-standards/btap/costing/led_lighting_costing.rb +155 -0
  32. data/lib/openstudio-standards/btap/costing/lighting_costing.rb +209 -0
  33. data/lib/openstudio-standards/btap/costing/mech_sizing.json +502 -0
  34. data/lib/openstudio-standards/btap/costing/neb_end_use_prices.csv +42 -0
  35. data/lib/openstudio-standards/btap/costing/necb_2011_spacetype_info.csv +225 -0
  36. data/lib/openstudio-standards/btap/costing/necb_reference_runs.csv +28705 -0
  37. data/lib/openstudio-standards/btap/costing/nv_costing.rb +547 -0
  38. data/lib/openstudio-standards/btap/costing/parallel_tests.rb +92 -0
  39. data/lib/openstudio-standards/btap/costing/pv_ground_costing.rb +687 -0
  40. data/lib/openstudio-standards/btap/costing/shw_costing.rb +705 -0
  41. data/lib/openstudio-standards/btap/costing/test_list.txt +17 -0
  42. data/lib/openstudio-standards/btap/costing/test_run_all_test_locally.rb +26 -0
  43. data/lib/openstudio-standards/btap/costing/test_run_costing_tests.rb +80 -0
  44. data/lib/openstudio-standards/btap/costing/ventilation_costing.rb +2616 -0
  45. data/lib/openstudio-standards/constructions/modify.rb +2 -1
  46. data/lib/openstudio-standards/standards/Standards.Model.rb +39 -9
  47. data/lib/openstudio-standards/standards/ashrae_90_1_prm/ashrae_90_1_prm.Model.rb +2 -2
  48. data/lib/openstudio-standards/standards/ashrae_90_1_prm/userdata_csv/ashrae_90_1_prm.UserData.rb +6 -1
  49. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/btap_pre1980.rb +2 -27
  50. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_3_and_8_single_speed.rb +68 -27
  51. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_4.rb +64 -25
  52. data/lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_6.rb +9 -14
  53. data/lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb +46 -20
  54. data/lib/openstudio-standards/standards/necb/NECB2011/autozone.rb +635 -248
  55. data/lib/openstudio-standards/standards/necb/NECB2011/data/constants.json +43 -7
  56. data/lib/openstudio-standards/standards/necb/NECB2011/data/fuel_type_sets.json +7 -1
  57. data/lib/openstudio-standards/standards/necb/NECB2011/data/geometry/HighriseApartmentMult.osm +14272 -0
  58. data/lib/openstudio-standards/standards/necb/NECB2011/data/necb_2015_table_c1.json +1 -1
  59. data/lib/openstudio-standards/standards/necb/NECB2011/data/space_types.json +437 -437
  60. data/lib/openstudio-standards/standards/necb/NECB2011/data/systems.json +516 -0
  61. data/lib/openstudio-standards/standards/necb/NECB2011/data/systems_including_sys5.json +588 -0
  62. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_namer.rb +489 -0
  63. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_1_single_speed.rb +16 -6
  64. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_2_and_5.rb +48 -5
  65. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_3_and_8_multi_speed.rb +2 -2
  66. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_3_and_8_single_speed.rb +35 -27
  67. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_4.rb +34 -23
  68. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_system_6.rb +8 -6
  69. data/lib/openstudio-standards/standards/necb/NECB2011/hvac_systems.rb +42 -13
  70. data/lib/openstudio-standards/standards/necb/NECB2011/necb_2011.rb +214 -25
  71. data/lib/openstudio-standards/standards/necb/NECB2011/system_fuels.rb +61 -1
  72. data/lib/openstudio-standards/standards/necb/NECB2015/data/space_types.json +636 -636
  73. data/lib/openstudio-standards/standards/necb/NECB2015/data/unitary_acs.json +38 -38
  74. data/lib/openstudio-standards/standards/necb/NECB2015/hvac_systems.rb +15 -6
  75. data/lib/openstudio-standards/standards/necb/NECB2017/data/space_types.json +636 -636
  76. data/lib/openstudio-standards/standards/necb/NECB2020/data/chillers.json +71 -71
  77. data/lib/openstudio-standards/standards/necb/README.md +343 -0
  78. data/lib/openstudio-standards/standards/necb/common/btap_data.rb +190 -28
  79. data/lib/openstudio-standards/standards/necb/common/btap_datapoint.rb +14 -5
  80. data/lib/openstudio-standards/standards/necb/common/eccc_electric_grid_intensity_20250311.csv +14 -0
  81. data/lib/openstudio-standards/standards/necb/common/nir_gas_grid_intensity_20250311.csv +14 -0
  82. data/lib/openstudio-standards/standards/necb/common/system_types.yaml +0 -0
  83. data/lib/openstudio-standards/utilities/logging.rb +18 -14
  84. data/lib/openstudio-standards/version.rb +1 -1
  85. data/lib/openstudio-standards/weather/modify.rb +2 -2
  86. data/lib/openstudio-standards.rb +12 -0
  87. metadata +53 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92b7ab071a25cbd69d2f8edbe76b2b5c176945c975aa1e583ff7404747fdedf9
4
- data.tar.gz: 342bc436c6694b535dfb337875cb4d381606d354a6004aaf4311156af46291e4
3
+ metadata.gz: c9aafbf4b30a59bc5af608bddcaa4428b2a378a9aeed6f59929071d08f747d95
4
+ data.tar.gz: 7e96dfeda110766975ade49244eaa3f322d8b163f13e52bc0afbeadcfab9bdeb
5
5
  SHA512:
6
- metadata.gz: 42a94723d1248825c20c7615db861b8cd1ccf363798819997d15053fc779a1343ad03e1256b00a78a51aeae5d5162396704ae804ac992f2a160523af243806e1
7
- data.tar.gz: 5ef19cbf7e862f1ef9318b33fa488e58beb06167bb8b773937a8ac3e6afe0ed2575b41a4c407dce6e7a07ad2a424d696bb5521c12ae78ca9d02009c4e90f4fdf
6
+ metadata.gz: 2c7393cb9fcbbd924a77b2a6a00a1ce56f56097df0c1dcd1ee8258c16c0bade18bbfd7c57c0f936aef0119a3d2aae4f130ede064f73ef25414d9e019e625811c
7
+ data.tar.gz: 932426674887c455a43d4fed980b6f902ce9ead23fde67eb8cf6c678a2fd7b9b14973c64e342c9d5015ace6d3056e9bb86842868cab856f16b5de280dc013775
@@ -0,0 +1,502 @@
1
+ # BTAP Costing Framework
2
+
3
+ ## Overview
4
+
5
+ The BTAP Costing Framework is one of the most comprehensive building lifecycle cost analysis systems available, providing detailed economic analysis for all building systems with Canadian-specific regional cost variations. This framework enables complete building cost estimation from conceptual design through detailed analysis, with integration for energy conservation measure (ECM) cost-benefit analysis.
6
+
7
+ ## Architecture Overview
8
+
9
+ ### Core Components
10
+
11
+ 1. **Main Costing Engine** (`btap_costing.rb`) - Central cost calculation and regional interpolation
12
+ 2. **Database System** (`costing_database_wrapper.rb`) - Cost data management and validation
13
+ 3. **Component Costing Modules** (9 specialized modules) - Building system-specific cost calculations
14
+ 4. **Cost Database** (`common_resources/`) - Comprehensive Canadian cost data
15
+ 5. **Testing Framework** - Automated validation and regression testing
16
+ 6. **Workflow Integration** - OpenStudio measure and NECB standards integration
17
+
18
+ ### Data Flow Architecture
19
+
20
+ ```
21
+ Building Model → Component Analysis → Regional Cost Factors → Database Lookup → Cost Calculation → Results Aggregation
22
+ ```
23
+
24
+ ## Main Costing Engine
25
+
26
+ ### `btap_costing.rb` - Core System
27
+
28
+ #### BTAPCosting Class
29
+ **Primary costing engine with regional cost factor integration**
30
+
31
+ **Key Features:**
32
+ - **Regional Cost Interpolation**: Distance-based cost interpolation between Canadian cities
33
+ - **Database Generation**: Automated cost database creation for all Canadian locations
34
+ - **Cost Auditing**: Comprehensive cost validation and verification
35
+ - **Mechanical Integration**: Integration with mechanical system sizing data
36
+
37
+ **Core Methods:**
38
+
39
+ ##### Regional Cost Analysis
40
+ ```ruby
41
+ # Get cost factors for specific location
42
+ get_regional_cost_factors(location)
43
+
44
+ # Find closest cost database location
45
+ get_closest_cost_location(lat, lon)
46
+
47
+ # Distance-based interpolation between locations
48
+ interpolate(target_location, reference_locations, values)
49
+ ```
50
+
51
+ ##### Database Management
52
+ ```ruby
53
+ # Load complete cost database
54
+ load_database()
55
+
56
+ # Validate all cost data for consistency
57
+ validate_database()
58
+
59
+ # Generate regional cost databases
60
+ generate_construction_cost_database_for_all_cities()
61
+ ```
62
+
63
+ ##### Cost Calculation
64
+ ```ruby
65
+ # Add individual cost items to building total
66
+ add_costed_item(category, description, quantity, unit_cost, total_cost)
67
+
68
+ # Process list of cost items
69
+ cost_list_items(cost_item_array)
70
+ ```
71
+
72
+ #### SimpleLinearRegression Class
73
+ **Mathematical utility for cost interpolation calculations**
74
+
75
+ **Purpose**: Provides statistical interpolation for regional cost variations
76
+ **Usage**: Used internally by BTAPCosting for distance-based cost adjustments
77
+
78
+ ## Component Costing Modules
79
+
80
+ ### Building Systems Costing
81
+
82
+ #### 1. Envelope Costing (`envelope_costing.rb`)
83
+ **Building envelope component cost analysis**
84
+
85
+ **Components Covered:**
86
+ - **Exterior Walls**: All construction types and insulation levels
87
+ - **Roofs**: Flat and sloped roofs with various membrane and insulation systems
88
+ - **Foundations**: Basement walls, slab-on-grade, crawl spaces
89
+ - **Windows and Doors**: Various performance levels and frame types
90
+ - **Air Sealing**: Building envelope airtightness measures
91
+
92
+ **Integration Points:**
93
+ - Construction assembly performance requirements
94
+ - Regional material and labor cost variations
95
+ - Energy code compliance cost implications
96
+
97
+ #### 2. HVAC System Costing (`heating_cooling_costing.rb`)
98
+ **Complete HVAC equipment and system costing**
99
+
100
+ **Equipment Categories:**
101
+ - **Heating Equipment**: Boilers, furnaces, heat pumps, electric heating
102
+ - **Cooling Equipment**: Chillers, rooftop units, split systems, evaporative cooling
103
+ - **Distribution Systems**: Ductwork, piping, pumps, fans
104
+ - **Controls**: Thermostats, building automation, advanced controls
105
+ - **Specialized Systems**: Radiant systems, displacement ventilation
106
+
107
+ **Costing Methodology:**
108
+ - Equipment capacity-based costing with performance tier adjustments
109
+ - Installation complexity factors for different building types
110
+ - Regional labor rate variations
111
+ - Commissioning and testing cost inclusions
112
+
113
+ #### 3. Lighting System Costing (`lighting_costing.rb` & `led_lighting_costing.rb`)
114
+
115
+ ##### Traditional Lighting (`lighting_costing.rb`)
116
+ - **Fixture Costs**: All standard commercial fixture types
117
+ - **Control Systems**: Occupancy sensors, daylight dimming, time controls
118
+ - **Installation**: Electrical connections, mounting, commissioning
119
+
120
+ ##### LED Lighting Upgrades (`led_lighting_costing.rb`)
121
+ - **LED Conversion Costs**: Retrofit and new installation LED systems
122
+ - **Payback Analysis**: Energy savings vs. capital cost analysis
123
+ - **Control Integration**: Advanced LED controls and dimming systems
124
+ - **Maintenance Savings**: LED lifecycle cost advantages
125
+
126
+ #### 4. Ventilation System Costing (`ventilation_costing.rb`)
127
+ **Air handling and ventilation system economics**
128
+
129
+ **System Components:**
130
+ - **Air Handling Units**: Various sizes and efficiency levels
131
+ - **Ductwork Systems**: Supply, return, and exhaust ductwork
132
+ - **Filtration**: Standard and high-efficiency filtration systems
133
+ - **Ventilation Controls**: CO2 sensors, variable speed drives
134
+
135
+ #### 5. Service Hot Water Costing (`shw_costing.rb`)
136
+ **Complete service water heating system analysis**
137
+
138
+ **System Elements:**
139
+ - **Water Heaters**: Gas, electric, heat pump, solar thermal systems
140
+ - **Distribution Systems**: Piping, insulation, circulation pumps
141
+ - **Controls**: Temperature controls, circulation controls, timer systems
142
+ - **Efficiency Measures**: Heat recovery, high-efficiency equipment
143
+
144
+ #### 6. Advanced System Costing
145
+
146
+ ##### Demand Controlled Ventilation (`dcv_costing.rb`)
147
+ - **CO2 Sensors**: Cost and installation of occupancy-based ventilation controls
148
+ - **Control Systems**: Integration with building automation systems
149
+ - **Energy Savings**: Ventilation energy reduction economic analysis
150
+
151
+ ##### Daylighting Controls (`daylighting_sensor_control_costing.rb`)
152
+ - **Daylight Sensors**: Various sensor types and placement strategies
153
+ - **Dimming Controls**: Continuous and stepped dimming systems
154
+ - **Integration Costs**: Connection to lighting control systems
155
+
156
+ ##### Natural Ventilation (`nv_costing.rb`)
157
+ - **Operable Windows**: Automated and manual window systems
158
+ - **Control Systems**: Temperature and wind sensors, automated controls
159
+ - **Mixed-Mode Integration**: Natural and mechanical ventilation integration
160
+
161
+ ##### Ground-Mounted PV (`pv_ground_costing.rb`)
162
+ - **Solar Panels**: Various efficiency levels and mounting systems
163
+ - **Electrical Systems**: Inverters, electrical connections, grid integration
164
+ - **Installation**: Site preparation, mounting structures, commissioning
165
+
166
+ ## Cost Database System
167
+
168
+ ### Database Wrapper (`costing_database_wrapper.rb`)
169
+
170
+ #### CostingDatabase Class
171
+ **Central database management and validation system**
172
+
173
+ **Key Functionality:**
174
+ - **Database Loading**: Load cost data from CSV resources
175
+ - **Data Validation**: Comprehensive validation of all cost data
176
+ - **Database Access**: Thread-safe access to cost information
177
+ - **Schema Enforcement**: Ensure data structure consistency
178
+
179
+ **Critical Methods:**
180
+ ```ruby
181
+ # Load database from CSV resources
182
+ load_database_from_resources()
183
+
184
+ # Validate complete database for consistency
185
+ validate_database()
186
+
187
+ # Validate construction set definitions
188
+ validate_constructions_sets()
189
+
190
+ # Validate HVAC equipment data
191
+ validate_ahu_items_and_quantities()
192
+ ```
193
+
194
+ ### Cost Database Structure (`common_resources/`)
195
+
196
+ #### Core Cost Data
197
+ - **`costs.csv`**: Base construction and equipment costs
198
+ - **`costs_local_factors.csv`**: Regional cost adjustment factors for all Canadian provinces/territories
199
+ - **`locations.csv`**: Geographic coordinates and regional data for cost interpolation
200
+
201
+ #### Material Databases
202
+ - **`materials_opaque.csv`**: Insulation, structural, and finish materials
203
+ - **`materials_glazing.csv`**: Windows, glazing, and frame materials
204
+ - **`materials_lighting.csv`**: Lighting fixtures, lamps, and control equipment
205
+ - **`materials_hvac.csv`**: HVAC equipment, components, and installation materials
206
+
207
+ #### Construction and Assembly Data
208
+ - **`constructions_opaque.csv`**: Wall, roof, floor, and foundation assemblies
209
+ - **`constructions_glazing.csv`**: Window and door assembly definitions
210
+ - **`construction_sets.csv`**: Complete building envelope construction sets
211
+ - **`ConstructionProperties.csv`**: Thermal and physical properties with cost data
212
+ - **`Constructions.csv`**: Detailed construction assembly specifications
213
+
214
+ #### Equipment and System Data
215
+ - **`hvac_vent_ahu.csv`**: Air handling unit specifications, capacities, and costs
216
+ - **`lighting_sets.csv`**: Complete lighting system packages
217
+ - **`lighting.csv`**: Individual lighting fixture and component costs
218
+
219
+ ## Regional Cost System
220
+
221
+ ### Canadian Regional Integration
222
+
223
+ #### Provincial Cost Factors
224
+ **All Canadian provinces and territories included:**
225
+ - British Columbia, Alberta, Saskatchewan, Manitoba
226
+ - Ontario, Quebec, New Brunswick, Nova Scotia, Prince Edward Island
227
+ - Newfoundland and Labrador, Northwest Territories, Nunavut, Yukon
228
+
229
+ #### Cost Interpolation Methodology
230
+ 1. **Distance Calculation**: Great circle distance between project location and reference cities
231
+ 2. **Weight Calculation**: Inverse distance weighting for cost factor interpolation
232
+ 3. **Factor Application**: Apply interpolated factors to base costs
233
+ 4. **Validation**: Ensure interpolated costs fall within reasonable ranges
234
+
235
+ #### Regional Variations Captured
236
+ - **Labor Costs**: Regional labor rate differences
237
+ - **Material Costs**: Transportation and availability impacts
238
+ - **Market Conditions**: Regional construction market factors
239
+ - **Climate Adjustments**: Cold weather construction impacts
240
+
241
+ ## Testing and Validation Framework
242
+
243
+ ### Automated Testing System
244
+
245
+ #### Test Execution (`test_run_costing_tests.rb`)
246
+ **Main test runner for comprehensive costing validation**
247
+
248
+ **Testing Categories:**
249
+ - **Component Costing Tests**: Validate each building system costing module
250
+ - **Database Tests**: Ensure cost database integrity and completeness
251
+ - **Regional Factor Tests**: Validate cost interpolation across all Canadian locations
252
+ - **Integration Tests**: Test costing integration with building models
253
+
254
+ #### Parallel Testing (`parallel_tests.rb`)
255
+ **Large-scale test execution for comprehensive validation**
256
+
257
+ **Capabilities:**
258
+ - **Multi-Core Testing**: Parallel test execution for faster validation
259
+ - **Regression Testing**: Compare results against established baselines
260
+ - **Performance Testing**: Validate costing calculation performance
261
+ - **Coverage Analysis**: Ensure comprehensive test coverage
262
+
263
+ #### Test Management
264
+ - **`copy_test_results_files_to_expected_results.rb`**: Test result management and baseline updates
265
+ - **`test_run_all_test_locally.rb`**: Local development testing framework
266
+
267
+ ### Reference Data Validation
268
+
269
+ #### NECB Reference Buildings (`necb_reference_runs.csv`)
270
+ **Comprehensive cost validation using Canadian reference buildings**
271
+
272
+ **Validation Coverage:**
273
+ - All major Canadian building types
274
+ - Multiple climate zones
275
+ - Various building sizes and complexities
276
+ - Integration with NECB energy standards
277
+
278
+ #### Mechanical System Validation (`mech_sizing.json`)
279
+ **HVAC system sizing and costing validation data**
280
+
281
+ **Content:**
282
+ - Equipment capacity ranges and costs
283
+ - Installation complexity factors
284
+ - Regional installation cost variations
285
+ - Performance verification data
286
+
287
+ #### Utility Cost Integration (`neb_end_use_prices.csv`)
288
+ **Canadian utility rate integration for lifecycle cost analysis**
289
+
290
+ **Data Sources:**
291
+ - National Energy Board utility rate data
292
+ - Provincial utility rate structures
293
+ - Time-of-use pricing where applicable
294
+ - Regional rate variations
295
+
296
+ ## Workflow Integration
297
+
298
+ ### OpenStudio Measure Integration (`btap_measure_helper.rb`)
299
+
300
+ #### BTAPMeasureHelper Class
301
+ **Integration with OpenStudio measure framework**
302
+
303
+ **Key Features:**
304
+ - **Argument Validation**: Validate measure arguments for costing calculations
305
+ - **Hash Conversion**: Convert measure arguments to costing parameters
306
+ - **Type Validation**: Ensure argument types match costing requirements
307
+
308
+ #### BTAPMeasureTestHelper Class
309
+ **Testing framework for measure integration**
310
+
311
+ **Testing Capabilities:**
312
+ - **Argument Range Testing**: Validate argument ranges and defaults
313
+ - **Model Creation**: Create NECB prototype models for testing
314
+ - **Measure Execution**: Run measures with costing integration
315
+ - **Result Validation**: Validate costing results from measure execution
316
+
317
+ ### BTAP Workflow Integration (`btap_workflow.rb`)
318
+ **Integration with larger BTAP analysis workflows**
319
+
320
+ **Workflow Steps:**
321
+ 1. **Model Analysis**: Extract building characteristics for costing
322
+ 2. **Component Identification**: Identify all building systems and components
323
+ 3. **Regional Analysis**: Determine appropriate regional cost factors
324
+ 4. **Cost Calculation**: Calculate costs for all building systems
325
+ 5. **Results Integration**: Integrate costs with energy and performance analysis
326
+
327
+ ### File-Based Costing (`cost_building_from_file.rb`)
328
+ **Automated costing from building definition files**
329
+
330
+ **Capabilities:**
331
+ - **Batch Processing**: Cost multiple buildings from file definitions
332
+ - **Standardized Input**: Consistent building definition format
333
+ - **Automated Analysis**: Minimal user intervention required
334
+ - **Results Export**: Standardized costing result formats
335
+
336
+ ## Usage Patterns
337
+
338
+ ### Basic Costing Workflow
339
+
340
+ #### 1. Initialize Costing System
341
+ ```ruby
342
+ # Create costing object with database loading
343
+ costing = BTAPCosting.new
344
+ costing.load_database
345
+
346
+ # Validate database integrity
347
+ costing.validate_database
348
+ ```
349
+
350
+ #### 2. Determine Regional Factors
351
+ ```ruby
352
+ # Get regional cost factors for project location
353
+ location = "Toronto, ON"
354
+ cost_factors = costing.get_regional_cost_factors(location)
355
+
356
+ # Or use coordinates for precise interpolation
357
+ lat, lon = 43.7, -79.4
358
+ closest_location = costing.get_closest_cost_location(lat, lon)
359
+ ```
360
+
361
+ #### 3. Calculate Component Costs
362
+ ```ruby
363
+ # Example: Envelope costing
364
+ envelope_costs = calculate_envelope_costs(model, cost_factors)
365
+
366
+ # Example: HVAC system costing
367
+ hvac_costs = calculate_hvac_costs(model, cost_factors)
368
+
369
+ # Aggregate all system costs
370
+ total_cost = envelope_costs + hvac_costs + lighting_costs + ...
371
+ ```
372
+
373
+ ### Advanced Costing Analysis
374
+
375
+ #### 1. ECM Cost-Benefit Analysis
376
+ ```ruby
377
+ # Calculate baseline building cost
378
+ baseline_cost = calculate_total_building_cost(baseline_model, location)
379
+
380
+ # Calculate improved building cost
381
+ improved_cost = calculate_total_building_cost(improved_model, location)
382
+
383
+ # Determine incremental cost
384
+ ecm_cost = improved_cost - baseline_cost
385
+
386
+ # Calculate payback with energy savings
387
+ payback_period = ecm_cost / annual_energy_savings
388
+ ```
389
+
390
+ #### 2. Regional Cost Comparison
391
+ ```ruby
392
+ # Compare costs across multiple Canadian cities
393
+ cities = ["Vancouver, BC", "Calgary, AB", "Toronto, ON", "Montreal, QC"]
394
+ costs = {}
395
+
396
+ cities.each do |city|
397
+ cost_factors = costing.get_regional_cost_factors(city)
398
+ costs[city] = calculate_total_building_cost(model, cost_factors)
399
+ end
400
+ ```
401
+
402
+ #### 3. Parametric Cost Analysis
403
+ ```ruby
404
+ # Analyze cost impacts of different design parameters
405
+ insulation_levels = [RSI_2, RSI_3, RSI_4, RSI_5]
406
+ costs = []
407
+
408
+ insulation_levels.each do |r_value|
409
+ modified_model = adjust_envelope_insulation(model, r_value)
410
+ cost = calculate_envelope_costs(modified_model, cost_factors)
411
+ costs << {r_value: r_value, cost: cost}
412
+ end
413
+ ```
414
+
415
+ ## Integration with NECB Standards
416
+
417
+ ### Standards Compliance Costing
418
+ The costing framework fully integrates with NECB (National Energy Code for Buildings) requirements:
419
+
420
+ - **Baseline Compliance**: Cost of meeting minimum NECB requirements
421
+ - **Above-Code Measures**: Incremental costs for exceeding code requirements
422
+ - **System Selection**: Cost implications of different NECB-compliant HVAC systems
423
+ - **Regional Variations**: How NECB compliance costs vary across Canadian climate zones
424
+
425
+ ### Energy Conservation Measures (ECMs)
426
+ - **NECB ECM Library**: Pre-defined ECMs with established cost data
427
+ - **Custom ECM Analysis**: Tools for analyzing custom energy conservation measures
428
+ - **Lifecycle Cost Integration**: Complete economic analysis including energy savings
429
+
430
+ ## Development Guidelines
431
+
432
+ ### Adding New Component Costing
433
+
434
+ #### 1. Create Component Module
435
+ ```ruby
436
+ # Create new file: new_system_costing.rb
437
+ class NewSystemCosting
438
+ def self.calculate_costs(model, cost_factors, options = {})
439
+ # Implement costing logic
440
+ end
441
+ end
442
+ ```
443
+
444
+ #### 2. Add Cost Database Entries
445
+ - Update appropriate CSV files in `common_resources/`
446
+ - Add equipment/material specifications
447
+ - Include regional cost factors
448
+ - Validate database integrity
449
+
450
+ #### 3. Create Tests
451
+ - Add component-specific test cases
452
+ - Test regional cost variations
453
+ - Validate against known project costs
454
+ - Include in automated test suite
455
+
456
+ #### 4. Integration
457
+ - Integrate with main costing workflow
458
+ - Add to cost aggregation logic
459
+ - Update documentation
460
+ - Include in validation framework
461
+
462
+ ### Testing Requirements
463
+
464
+ #### 1. Component Tests
465
+ - Test each costing module independently
466
+ - Validate cost calculations against manual calculations
467
+ - Test regional factor applications
468
+ - Validate database lookups
469
+
470
+ #### 2. Integration Tests
471
+ - Test complete building costing workflows
472
+ - Validate cost aggregation logic
473
+ - Test integration with NECB standards
474
+ - Validate ECM cost calculations
475
+
476
+ #### 3. Regression Tests
477
+ - Maintain baseline cost results for reference buildings
478
+ - Detect unintended cost calculation changes
479
+ - Validate database updates don't break existing functionality
480
+ - Performance regression testing
481
+
482
+ ## Key Benefits for LLM Development
483
+
484
+ ### Clear System Understanding
485
+ - **Component Relationships**: Understand how 9 costing modules interact
486
+ - **Data Flow**: Clear path from building model to final costs
487
+ - **Regional Logic**: How Canadian cost variations are handled
488
+ - **Integration Points**: Where costing connects to NECB standards and BTAP workflow
489
+
490
+ ### Safe Modification Guidelines
491
+ - **Database Schema**: Understand CSV structure to prevent data corruption
492
+ - **Regional Factor Logic**: Critical cost interpolation algorithms
493
+ - **Testing Framework**: How to validate changes don't break existing functionality
494
+ - **API Boundaries**: Clear interfaces between costing modules
495
+
496
+ ### Established Patterns
497
+ - **Component Addition**: Template for adding new building system costing
498
+ - **Data Updates**: Process for updating cost databases safely
499
+ - **Validation Requirements**: What constitutes valid costing data
500
+ - **Error Handling**: How to handle missing data and edge cases
501
+
502
+ This comprehensive framework represents years of Canadian building cost analysis expertise and provides the foundation for sophisticated building economic analysis.