Skip to content

Commit 4143ec9

Browse files
authored
Merge pull request #1707 from NREL/adp_bf_method_design_shr
Replace Hard-Coded Sensible Capacity Curves with ADP/BF
2 parents 623f63c + d315784 commit 4143ec9

File tree

15 files changed

+424
-375
lines changed

15 files changed

+424
-375
lines changed

BuildResidentialHPXML/measure.xml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<schema_version>3.1</schema_version>
44
<name>build_residential_hpxml</name>
55
<uid>a13a8983-2b01-4930-8af2-42030b6e4233</uid>
6-
<version_id>2439d1bf-b493-4236-97ab-badc6ee2b0c2</version_id>
7-
<version_modified>2024-09-18T23:10:07Z</version_modified>
6+
<version_id>7c042c03-f23f-43f8-aa9e-b7c404f70542</version_id>
7+
<version_modified>2024-09-20T20:24:59Z</version_modified>
88
<xml_checksum>2C38F48B</xml_checksum>
99
<class_name>BuildResidentialHPXML</class_name>
1010
<display_name>HPXML Builder</display_name>
@@ -7455,6 +7455,48 @@
74557455
<usage_type>resource</usage_type>
74567456
<checksum>F80359E3</checksum>
74577457
</file>
7458+
<file>
7459+
<filename>extra_files/base-mf.xml</filename>
7460+
<filetype>xml</filetype>
7461+
<usage_type>test</usage_type>
7462+
<checksum>06C3D0DD</checksum>
7463+
</file>
7464+
<file>
7465+
<filename>extra_files/base-mf2.xml</filename>
7466+
<filetype>xml</filetype>
7467+
<usage_type>test</usage_type>
7468+
<checksum>04582640</checksum>
7469+
</file>
7470+
<file>
7471+
<filename>extra_files/base-sfa.xml</filename>
7472+
<filetype>xml</filetype>
7473+
<usage_type>test</usage_type>
7474+
<checksum>16ED9F15</checksum>
7475+
</file>
7476+
<file>
7477+
<filename>extra_files/base-sfa2.xml</filename>
7478+
<filetype>xml</filetype>
7479+
<usage_type>test</usage_type>
7480+
<checksum>1B60C132</checksum>
7481+
</file>
7482+
<file>
7483+
<filename>extra_files/base-sfa3.xml</filename>
7484+
<filetype>xml</filetype>
7485+
<usage_type>test</usage_type>
7486+
<checksum>DD9CD517</checksum>
7487+
</file>
7488+
<file>
7489+
<filename>extra_files/base-sfd.xml</filename>
7490+
<filetype>xml</filetype>
7491+
<usage_type>test</usage_type>
7492+
<checksum>79463062</checksum>
7493+
</file>
7494+
<file>
7495+
<filename>extra_files/base-sfd2.xml</filename>
7496+
<filetype>xml</filetype>
7497+
<usage_type>test</usage_type>
7498+
<checksum>9FC7FBA9</checksum>
7499+
</file>
74587500
<file>
74597501
<filename>test_build_residential_hpxml.rb</filename>
74607502
<filetype>rb</filetype>

HPXMLtoOpenStudio/measure.rb

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ def run(model, runner, user_arguments)
128128

129129
# Create OpenStudio unit model(s)
130130
hpxml_osm_map = {}
131-
hpxml.buildings.each_with_index do |hpxml_bldg, i|
131+
hpxml.buildings.each do |hpxml_bldg|
132132
# Create the model for this single unit
133133
# If we're running a whole SFA/MF building, all the unit models will be merged later
134134
if hpxml.buildings.size > 1
135135
unit_model = OpenStudio::Model::Model.new
136-
create_unit_model(hpxml, hpxml_bldg, runner, unit_model, epw_path, weather, hpxml_sch_map[hpxml_bldg], i + 1)
136+
create_unit_model(hpxml, hpxml_bldg, runner, unit_model, epw_path, weather, hpxml_sch_map[hpxml_bldg])
137137
hpxml_osm_map[hpxml_bldg] = unit_model
138138
else
139-
create_unit_model(hpxml, hpxml_bldg, runner, model, epw_path, weather, hpxml_sch_map[hpxml_bldg], i + 1)
139+
create_unit_model(hpxml, hpxml_bldg, runner, model, epw_path, weather, hpxml_sch_map[hpxml_bldg])
140140
hpxml_osm_map[hpxml_bldg] = model
141141
end
142142
end
@@ -313,19 +313,9 @@ def process_defaults_schedules_emissions_files(runner, weather, hpxml, args)
313313
# @param epw_path [String] Path to the EPW weather file
314314
# @param weather [WeatherFile] Weather object containing EPW information
315315
# @param schedules_file [SchedulesFile] SchedulesFile wrapper class instance of detailed schedule files
316-
# @param unit_num [Integer] index number corresponding to an HPXML Building object
317316
# @return [nil]
318-
def create_unit_model(hpxml, hpxml_bldg, runner, model, epw_path, weather, schedules_file, unit_num)
319-
# Here we turn off OS error-checking so that any invalid values provided
320-
# to OS SDK methods are passed along to EnergyPlus and produce errors. If
321-
# we didn't go this, we'd end up with successful EnergyPlus simulations that
322-
# use the wrong (default) value unless we check the return value of *every*
323-
# OS SDK setter method to notice there was an invalid value provided.
324-
# See https://github.com/NREL/OpenStudio/pull/4505 for more background.
325-
model.setStrictnessLevel('None'.to_StrictnessLevel)
326-
327-
# Init
328-
init(hpxml_bldg, hpxml.header)
317+
def create_unit_model(hpxml, hpxml_bldg, runner, model, epw_path, weather, schedules_file)
318+
init(model, hpxml_bldg, hpxml.header)
329319
SimControls.apply(model, hpxml.header)
330320
Location.apply(model, weather, hpxml_bldg, hpxml.header, epw_path)
331321

@@ -347,7 +337,7 @@ def create_unit_model(hpxml, hpxml_bldg, runner, model, epw_path, weather, sched
347337
Geometry.apply_thermal_mass(model, spaces, hpxml_bldg, hpxml.header)
348338
Geometry.set_zone_volumes(spaces, hpxml_bldg, hpxml.header)
349339
Geometry.explode_surfaces(model, hpxml_bldg)
350-
Geometry.apply_building_unit(model, unit_num)
340+
Geometry.apply_building_unit(model, hpxml, hpxml_bldg)
351341

352342
# HVAC
353343
airloop_map = HVAC.apply_hvac_systems(runner, model, weather, spaces, hpxml_bldg, hpxml.header, schedules_file, hvac_days)
@@ -380,10 +370,19 @@ def create_unit_model(hpxml, hpxml_bldg, runner, model, epw_path, weather, sched
380370

381371
# Miscellaneous logic that needs to occur upfront.
382372
#
373+
# @param model [OpenStudio::Model::Model] OpenStudio Model object
383374
# @param hpxml_bldg [HPXML::Building] HPXML Building object representing an individual dwelling unit
384375
# @param hpxml_header [HPXML::Header] HPXML Header object (one per HPXML file)
385376
# @return [nil]
386-
def init(hpxml_bldg, hpxml_header)
377+
def init(model, hpxml_bldg, hpxml_header)
378+
# Here we turn off OS error-checking so that any invalid values provided
379+
# to OS SDK methods are passed along to EnergyPlus and produce errors. If
380+
# we didn't go this, we'd end up with successful EnergyPlus simulations that
381+
# use the wrong (default) value unless we check the return value of *every*
382+
# OS SDK setter method to notice there was an invalid value provided.
383+
# See https://github.com/NREL/OpenStudio/pull/4505 for more background.
384+
model.setStrictnessLevel('None'.to_StrictnessLevel)
385+
387386
# Store the fraction of windows operable before we collapse surfaces
388387
hpxml_bldg.additional_properties.initial_frac_windows_operable = hpxml_bldg.fraction_of_windows_operable()
389388

HPXMLtoOpenStudio/measure.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
<schema_version>3.1</schema_version>
44
<name>hpxm_lto_openstudio</name>
55
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
6-
<version_id>1650dfa9-50da-4856-b117-58dbffd75ff7</version_id>
7-
<version_modified>2024-09-19T22:24:22Z</version_modified>
6+
<version_id>3fa6e285-3db2-43a1-8e1c-66405c34438c</version_id>
7+
<version_modified>2024-09-20T20:36:31Z</version_modified>
88
<xml_checksum>D8922A73</xml_checksum>
99
<class_name>HPXMLtoOpenStudio</class_name>
1010
<display_name>HPXML to OpenStudio Translator</display_name>
@@ -183,7 +183,7 @@
183183
<filename>measure.rb</filename>
184184
<filetype>rb</filetype>
185185
<usage_type>script</usage_type>
186-
<checksum>1C013D19</checksum>
186+
<checksum>65C907FB</checksum>
187187
</file>
188188
<file>
189189
<filename>airflow.rb</filename>
@@ -339,7 +339,7 @@
339339
<filename>geometry.rb</filename>
340340
<filetype>rb</filetype>
341341
<usage_type>resource</usage_type>
342-
<checksum>095FE2B7</checksum>
342+
<checksum>1DE39C4E</checksum>
343343
</file>
344344
<file>
345345
<filename>hotwater_appliances.rb</filename>
@@ -387,13 +387,13 @@
387387
<filename>hvac.rb</filename>
388388
<filetype>rb</filetype>
389389
<usage_type>resource</usage_type>
390-
<checksum>E26C6DD2</checksum>
390+
<checksum>D60E72E2</checksum>
391391
</file>
392392
<file>
393393
<filename>hvac_sizing.rb</filename>
394394
<filetype>rb</filetype>
395395
<usage_type>resource</usage_type>
396-
<checksum>0998C39D</checksum>
396+
<checksum>9EE935C4</checksum>
397397
</file>
398398
<file>
399399
<filename>internal_gains.rb</filename>
@@ -459,7 +459,7 @@
459459
<filename>psychrometrics.rb</filename>
460460
<filetype>rb</filetype>
461461
<usage_type>resource</usage_type>
462-
<checksum>86A74352</checksum>
462+
<checksum>716C98E6</checksum>
463463
</file>
464464
<file>
465465
<filename>pv.rb</filename>

HPXMLtoOpenStudio/resources/geometry.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,10 +1993,13 @@ def self.create_or_get_space(model, spaces, location, hpxml_bldg)
19931993
# Store the HPXML Building object unit number for use in reporting measure.
19941994
#
19951995
# @param model [OpenStudio::Model::Model] OpenStudio Model object
1996-
# @param unit_number [Integer] index number corresponding to an HPXML Building object
1996+
# @param hpxml [HPXML] HPXML object
1997+
# @param hpxml_bldg [HPXML::Building] HPXML Building object representing an individual dwelling unit
19971998
# @return [nil]
1998-
def self.apply_building_unit(model, unit_num)
1999-
return if unit_num.nil?
1999+
def self.apply_building_unit(model, hpxml, hpxml_bldg)
2000+
return if hpxml.buildings.size == 1
2001+
2002+
unit_num = hpxml.buildings.index(hpxml_bldg) + 1
20002003

20012004
unit = OpenStudio::Model::BuildingUnit.new(model)
20022005
unit.additionalProperties.setFeature('unit_num', unit_num)

HPXMLtoOpenStudio/resources/hvac.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ module HVAC
55
AirSourceHeatRatedODB = 47.0 # degF, Rated outdoor drybulb for air-source systems, heating
66
AirSourceHeatRatedIDB = 70.0 # degF, Rated indoor drybulb for air-source systems, heating
77
AirSourceCoolRatedODB = 95.0 # degF, Rated outdoor drybulb for air-source systems, cooling
8+
AirSourceCoolRatedOWB = 75.0 # degF, Rated outdoor wetbulb for air-source systems, cooling
9+
AirSourceCoolRatedIDB = 80.0 # degF, Rated indoor drybulb for air-source systems, cooling
810
AirSourceCoolRatedIWB = 67.0 # degF, Rated indoor wetbulb for air-source systems, cooling
911
CrankcaseHeaterTemp = 50.0 # degF
1012

@@ -3634,7 +3636,7 @@ def self.set_cool_rated_shrs_gross(cooling_system)
36343636
clg_ap.cool_rated_shrs_gross = [cooling_system.cooling_shr] # We don't model the fan separately, so set gross == net
36353637
else
36363638
# rated shr gross and fan speed ratios
3637-
dB_rated = 80.0 # F
3639+
dB_rated = HVAC::AirSourceCoolRatedIDB
36383640
win = 0.01118470 # Humidity ratio corresponding to 80F dry bulb/67F wet bulb (from EnergyPlus)
36393641

36403642
if cooling_system.compressor_type == HPXML::HVACCompressorTypeSingleStage

0 commit comments

Comments
 (0)