Skip to content

Commit 5cb5e9b

Browse files
authored
Merge pull request #1283 from NREL/nrcan_merge_master
Including changes to nrcan branch
2 parents 939ac45 + 308e0a3 commit 5cb5e9b

File tree

218 files changed

+1555365
-2045434
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+1555365
-2045434
lines changed

lib/openstudio-standards.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ module OpenstudioStandards
5555
# NECB2020 Code
5656
require_relative "#{stds}/necb/NECB2020/necb_2020"
5757
require_relative "#{stds}/necb/NECB2020/building_envelope"
58+
require_relative "#{stds}/necb/NECB2020/service_water_heating"
5859

5960
# BTAPPRE1980
6061
require_relative "#{stds}/necb/BTAPPRE1980/btap_pre1980"

lib/openstudio-standards/btap/btap_result.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ def self.perform_qaqc(model)
2020
" AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Electricity' AND RowName='Electricity:Facility'" +
2121
" AND ColumnName='Electricity Maximum Value' AND Units='W'")
2222
natural_gas_peak = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='EnergyMeters'" +
23-
" AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Gas' AND RowName='Gas:Facility'" +
24-
" AND ColumnName='Gas Maximum Value' AND Units='W'")
23+
" AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Natural Gas' AND RowName='NaturalGas:Facility'" +
24+
" AND ColumnName='Natural Gas Maximum Value' AND Units='W'")
2525

2626
# Create hash to store all the collected data.
2727
qaqc = {}

lib/openstudio-standards/btap/reporting.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ def self.old_get_annual_results_model_results(osm_file,sql_path)
215215
end
216216

217217
natural_gas_peak = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='EnergyMeters'" +
218-
" AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Gas' AND RowName='Gas:Facility'" +
219-
" AND ColumnName='Gas Maximum Value' AND Units='W'")
218+
" AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Natural Gas' AND RowName='NaturalGas:Facility'" +
219+
" AND ColumnName='Natural Gas Maximum Value' AND Units='W'")
220220
if natural_gas_peak.empty?
221221
natural_gas_peak = 0.0
222222
end

lib/openstudio-standards/btap/simmanager.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,8 +472,8 @@ def self.old_get_annual_results_model_results(osm_file,sql_path)
472472
end
473473

474474
natural_gas_peak = model.sqlFile().get().execAndReturnFirstDouble("SELECT Value FROM tabulardatawithstrings WHERE ReportName='EnergyMeters'" +
475-
" AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Gas' AND RowName='Gas:Facility'" +
476-
" AND ColumnName='Gas Maximum Value' AND Units='W'")
475+
" AND ReportForString='Entire Facility' AND TableName='Annual and Peak Values - Natural Gas' AND RowName='NaturalGas:Facility'" +
476+
" AND ColumnName='Natural Gas Maximum Value' AND Units='W'")
477477
if natural_gas_peak.empty?
478478
natural_gas_peak = 0.0
479479
end

lib/openstudio-standards/hvac_sizing/Siz.Model.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def getAutosizedValue(object, value_name, units)
281281

282282
result = OpenStudio::OptionalDouble.new
283283

284-
name = object.name.get.upcase
284+
name = object.name.get.upcase.strip
285285

286286
object_type = object.iddObject.type.valueDescription.gsub('OS:','')
287287

lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_3_and_8_single_speed.rb

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ def add_sys3and8_single_zone_packaged_rooftop_unit_with_baseboard_heating_single
3131
system_data[:CentralHeatingDesignSupplyAirHumidityRatio] = 0.0080
3232

3333
# System 3 Zone data
34-
system_data[:ZoneCoolingDesignSupplyAirTemperature] = 13.0
35-
system_data[:ZoneHeatingDesignSupplyAirTemperature] = 43.0
34+
system_data[:ZoneCoolingDesignSupplyAirTemperatureInputMethod] = 'TemperatureDifference'
35+
system_data[:ZoneCoolingDesignSupplyAirTemperatureDifference] = 11.0
36+
system_data[:ZoneHeatingDesignSupplyAirTemperatureInputMethod] = 'TemperatureDifference'
37+
system_data[:ZoneHeatingDesignSupplyAirTemperatureDifference] = 21.0
3638
system_data[:SetpointManagerSingleZoneReheatSupplyTempMin] = 13.0
3739
system_data[:SetpointManagerSingleZoneReheatSupplyTempMax] = 43.0
3840
system_data[:ZoneDXCoolingSizingFactor] = 1.0
@@ -52,8 +54,10 @@ def add_sys3and8_single_zone_packaged_rooftop_unit_with_baseboard_heating_single
5254
# Add Zone equipment
5355
zones.each do |zone| # Zone sizing temperature
5456
sizing_zone = zone.sizingZone
55-
sizing_zone.setZoneCoolingDesignSupplyAirTemperature(system_data[:ZoneCoolingDesignSupplyAirTemperature])
56-
sizing_zone.setZoneHeatingDesignSupplyAirTemperature(system_data[:ZoneHeatingDesignSupplyAirTemperature])
57+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneCoolingDesignSupplyAirTemperatureInputMethod])
58+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureDifference(system_data[:ZoneCoolingDesignSupplyAirTemperatureDifference])
59+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneHeatingDesignSupplyAirTemperatureInputMethod])
60+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureDifference(system_data[:ZoneHeatingDesignSupplyAirTemperatureDifference])
5761
sizing_zone.setZoneCoolingSizingFactor(system_data[:ZoneCoolingSizingFactor])
5862
sizing_zone.setZoneHeatingSizingFactor(system_data[:ZoneHeatingSizingFactor])
5963
add_sys3_and_8_zone_equip(air_loop,
@@ -108,8 +112,10 @@ def add_system_3_and_8_airloop(heating_coil_type, model, system_data, control_zo
108112

109113
# Zone sizing temperature
110114
sizing_zone = control_zone.sizingZone
111-
sizing_zone.setZoneCoolingDesignSupplyAirTemperature(system_data[:ZoneCoolingDesignSupplyAirTemperature])
112-
sizing_zone.setZoneHeatingDesignSupplyAirTemperature(system_data[:ZoneHeatingDesignSupplyAirTemperature])
115+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneCoolingDesignSupplyAirTemperatureInputMethod])
116+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureDifference(system_data[:ZoneCoolingDesignSupplyAirTemperatureDifference])
117+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneHeatingDesignSupplyAirTemperatureInputMethod])
118+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureDifference(system_data[:ZoneHeatingDesignSupplyAirTemperatureDifference])
113119
sizing_zone.setZoneCoolingSizingFactor(system_data[:ZoneCoolingSizingFactor])
114120
sizing_zone.setZoneHeatingSizingFactor(system_data[:ZoneHeatingSizingFactor])
115121

lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_4.rb

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ def add_sys4_single_zone_make_up_air_unit_with_baseboard_heating(model:,
3131
# zone
3232
system_data[:SetpointManagerSingleZoneReheatSupplyTempMax] = 43.0
3333
system_data[:SetpointManagerSingleZoneReheatSupplyTempMin] = 13.0
34-
system_data[:ZoneCoolingDesignSupplyAirTemperature] = 13.0
35-
system_data[:ZoneHeatingDesignSupplyAirTemperature] = 43.0
34+
system_data[:ZoneCoolingDesignSupplyAirTemperatureInputMethod] = 'TemperatureDifference'
35+
system_data[:ZoneCoolingDesignSupplyAirTemperatureDifference] = 11.0
36+
system_data[:ZoneHeatingDesignSupplyAirTemperatureInputMethod] = 'TemperatureDifference'
37+
system_data[:ZoneHeatingDesignSupplyAirTemperatureDifference] = 21.0
3638
system_data[:ZoneCoolingSizingFactor] = 1.1
3739
system_data[:ZoneHeatingSizingFactor] = 1.3
3840

@@ -66,8 +68,10 @@ def add_sys4_single_zone_make_up_air_unit_with_baseboard_heating(model:,
6668

6769
# Zone sizing temperature
6870
sizing_zone = control_zone.sizingZone
69-
sizing_zone.setZoneCoolingDesignSupplyAirTemperature(system_data[:ZoneCoolingDesignSupplyAirTemperature])
70-
sizing_zone.setZoneHeatingDesignSupplyAirTemperature(system_data[:ZoneHeatingDesignSupplyAirTemperature])
71+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneCoolingDesignSupplyAirTemperatureInputMethod])
72+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureDifference(system_data[:ZoneCoolingDesignSupplyAirTemperatureDifference])
73+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneHeatingDesignSupplyAirTemperatureInputMethod])
74+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureDifference(system_data[:ZoneHeatingDesignSupplyAirTemperatureDifference])
7175
sizing_zone.setZoneCoolingSizingFactor(system_data[:ZoneCoolingSizingFactor])
7276
sizing_zone.setZoneHeatingSizingFactor(system_data[:ZoneHeatingSizingFactor])
7377

@@ -134,8 +138,10 @@ def add_sys4_single_zone_make_up_air_unit_with_baseboard_heating(model:,
134138
exhaust_fan_name = 'Sys_4_zone_exhaust_fan'
135139
zones.each do |zone|
136140
sizing_zone = zone.sizingZone
137-
sizing_zone.setZoneCoolingDesignSupplyAirTemperature(system_data[:ZoneCoolingDesignSupplyAirTemperature])
138-
sizing_zone.setZoneHeatingDesignSupplyAirTemperature(system_data[:ZoneHeatingDesignSupplyAirTemperature])
141+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneCoolingDesignSupplyAirTemperatureInputMethod])
142+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureDifference(system_data[:ZoneCoolingDesignSupplyAirTemperatureDifference])
143+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneHeatingDesignSupplyAirTemperatureInputMethod])
144+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureDifference(system_data[:ZoneHeatingDesignSupplyAirTemperatureDifference])
139145
sizing_zone.setZoneCoolingSizingFactor(system_data[:ZoneCoolingSizingFactor])
140146
sizing_zone.setZoneHeatingSizingFactor(system_data[:ZoneHeatingSizingFactor])
141147
# Create a diffuser and attach the zone/diffuser pair to the air loop

lib/openstudio-standards/standards/necb/BTAPPRE1980/hvac_system_6.rb

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ def add_sys6_multi_zone_built_up_system_with_baseboard_heating(model:,
3434
# zone data
3535
system_data[:max_system_supply_air_temperature] = 43.0
3636
system_data[:min_system_supply_air_temperature] = 13.0
37-
system_data[:ZoneCoolingDesignSupplyAirTemperature] = 13.0
38-
system_data[:ZoneHeatingDesignSupplyAirTemperature] = 43.0
37+
system_data[:ZoneCoolingDesignSupplyAirTemperatureInputMethod] = 'TemperatureDifference'
38+
system_data[:ZoneCoolingDesignSupplyAirTemperatureDifference] = 11.0
39+
system_data[:ZoneHeatingDesignSupplyAirTemperatureInputMethod] = 'TemperatureDifference'
40+
system_data[:ZoneHeatingDesignSupplyAirTemperatureDifference] = 21.0
3941
system_data[:ZoneCoolingSizingFactor] = 1.1
4042
system_data[:ZoneHeatingSizingFactor] = 1.3
4143
system_data[:ZoneVAVMinFlowFactorPerFloorArea] = 0.002
@@ -115,8 +117,10 @@ def add_sys6_multi_zone_built_up_system_with_baseboard_heating(model:,
115117
(BTAP::Geometry::BuildingStoreys.get_zones_from_storey(story) & zones).each do |zone|
116118
# Zone sizing parameters
117119
sizing_zone = zone.sizingZone
118-
sizing_zone.setZoneCoolingDesignSupplyAirTemperature(system_data[:ZoneCoolingDesignSupplyAirTemperature])
119-
sizing_zone.setZoneHeatingDesignSupplyAirTemperature(system_data[:ZoneHeatingDesignSupplyAirTemperature])
120+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneCoolingDesignSupplyAirTemperatureInputMethod])
121+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureDifference(system_data[:ZoneCoolingDesignSupplyAirTemperatureDifference])
122+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneHeatingDesignSupplyAirTemperatureInputMethod])
123+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureDifference(system_data[:ZoneHeatingDesignSupplyAirTemperatureDifference])
120124
sizing_zone.setZoneCoolingSizingFactor(system_data[:ZoneCoolingSizingFactor])
121125
sizing_zone.setZoneHeatingSizingFactor(system_data[:ZoneHeatingSizingFactor])
122126

@@ -197,8 +201,10 @@ def new_add_sys6_multi_zone_built_up_system_with_baseboard_heating(
197201
# zone data
198202
system_6_data[:max_system_supply_air_temperature] = 43.0
199203
system_6_data[:min_system_supply_air_temperature] = 13.0
200-
system_6_data[:ZoneCoolingDesignSupplyAirTemperature] = 13.0
201-
system_6_data[:ZoneHeatingDesignSupplyAirTemperature] = 43.0
204+
system_6_data[:ZoneCoolingDesignSupplyAirTemperatureInputMethod] = 'TemperatureDifference'
205+
system_6_data[:ZoneCoolingDesignSupplyAirTemperatureDifference] = 11.0
206+
system_6_data[:ZoneHeatingDesignSupplyAirTemperatureInputMethod] = 'TemperatureDifference'
207+
system_6_data[:ZoneHeatingDesignSupplyAirTemperatureDifference] = 21.0
202208
system_6_data[:ZoneCoolingSizingFactor] = 1.1
203209
system_6_data[:ZoneHeatingSizingFactor] = 1.3
204210
system_6_data[:ZoneVAVMinFlowFactorPerFloorArea] = 0.002
@@ -285,8 +291,10 @@ def new_add_sys6_multi_zone_built_up_system_with_baseboard_heating(
285291
(BTAP::Geometry::BuildingStoreys.get_zones_from_storey(story) & zones).each do |zone|
286292
# Zone sizing parameters
287293
sizing_zone = zone.sizingZone
288-
sizing_zone.setZoneCoolingDesignSupplyAirTemperature(system_data[:ZoneCoolingDesignSupplyAirTemperature])
289-
sizing_zone.setZoneHeatingDesignSupplyAirTemperature(system_data[:ZoneHeatingDesignSupplyAirTemperature])
294+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneCoolingDesignSupplyAirTemperatureInputMethod])
295+
sizing_zone.setZoneCoolingDesignSupplyAirTemperatureDifference(system_data[:ZoneCoolingDesignSupplyAirTemperatureDifference])
296+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureInputMethod(system_data[:ZoneHeatingDesignSupplyAirTemperatureInputMethod])
297+
sizing_zone.setZoneHeatingDesignSupplyAirTemperatureDifference(system_data[:ZoneHeatingDesignSupplyAirTemperatureDifference])
290298
sizing_zone.setZoneCoolingSizingFactor(system_data[:ZoneCoolingSizingFactor])
291299
sizing_zone.setZoneHeatingSizingFactor(system_data[:ZoneHeatingSizingFactor])
292300

lib/openstudio-standards/standards/necb/ECMS/ecms.rb

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,42 +39,32 @@ def initialize
3939
@standards_data['curves'] = standards_data['tables']['curves']['table']
4040
end
4141

42-
def apply_system_ecm(model:, ecm_system_name: nil, template_standard:, runner: nil, primary_heating_fuel: nil)
42+
def apply_system_ecm(model:, ecm_system_name: nil, template_standard:, runner: nil, primary_heating_fuel: nil, ecm_system_zones_map_option: 'NECB_Default')
4343
# Do nothing if nil or other usual suspects.. covering all bases for now.
4444
return if ecm_system_name.nil? || ecm_system_name == 'none' || ecm_system_name == 'NECB_Default'
45+
ecm_system_zones_map_option = 'NECB_Default' if ecm_system_zones_map_option.nil? || ecm_system_zones_map_option == 'none'
4546

4647
ecm_std = Standard.build('ECMS')
4748
systems = model.getAirLoopHVACs
4849
map_system_to_zones, system_doas_flags = ecm_std.get_map_systems_to_zones(systems)
49-
zone_clg_eqpt_type = ecm_std.get_zone_clg_eqpt_type(model)
50-
# when the ecm is associated with adding a new HVAC system, then remove existing system components and loops
5150
ecm_add_method_name = "add_ecm_#{ecm_system_name.downcase}"
5251

5352
raise("the method #{ecm_add_method_name} does not exist in the ECM class. Please verify that this should be called.") unless ecm_std.respond_to? ecm_add_method_name
5453

54+
# when the ecm is associated with adding a new HVAC system, then remove existing system components and loops
5555
ecm_std.remove_all_zone_eqpt(systems)
5656
ecm_std.remove_air_loops(model)
5757
ecm_std.remove_hw_loops(model)
5858
ecm_std.remove_chw_loops(model)
5959
ecm_std.remove_cw_loops(model)
6060

61-
# Rather than go through every add_ecm class to add 'the primary_heating_fuel' argument I added this statement to
62-
# only include it when it is used (for now in the add_ecm_remove_airloops_add_zone_baseboards method).
63-
if ecm_add_method_name == 'add_ecm_remove_airloops_add_zone_baseboards'
64-
ecm_std.send(ecm_add_method_name,
65-
model: model,
66-
system_zones_map: map_system_to_zones,
67-
system_doas_flags: system_doas_flags,
68-
zone_clg_eqpt_type: zone_clg_eqpt_type,
69-
standard: template_standard,
70-
primary_heating_fuel: primary_heating_fuel)
71-
else
72-
ecm_std.send(ecm_add_method_name,
73-
model: model,
74-
system_zones_map: map_system_to_zones,
75-
system_doas_flags: system_doas_flags)
76-
end
77-
# ecm_std.add_ecm_hs09_ccashpsys(model:model,system_zones_map:,system_doas_flags:,zone_clg_eqpt_type: nil,standard:,baseboard_flag: true)
61+
ecm_std.send(ecm_add_method_name,
62+
model: model,
63+
system_zones_map: map_system_to_zones,
64+
system_doas_flags: system_doas_flags,
65+
ecm_system_zones_map_option: ecm_system_zones_map_option,
66+
standard: template_standard,
67+
heating_fuel: primary_heating_fuel)
7868
end
7969

8070
def apply_system_efficiencies_ecm(model:, ecm_system_name: nil)

0 commit comments

Comments
 (0)