Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MF space types when building has no HVAC #1615

Merged
merged 17 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2745,12 +2745,29 @@ def get_space_temperature_schedule(model, location, spaces)
space_values = Geometry.get_temperature_scheduled_space_values(location)

if location == HPXML::LocationOtherHeatedSpace
# Create a sensor to get dynamic heating setpoint
htg_sch = spaces[HPXML::LocationConditionedSpace].thermalZone.get.thermostatSetpointDualSetpoint.get.heatingSetpointTemperatureSchedule.get
sensor_htg_spt = OpenStudio::Model::EnergyManagementSystemSensor.new(model, 'Schedule Value')
sensor_htg_spt.setName('htg_spt')
sensor_htg_spt.setKeyName(htg_sch.name.to_s)
space_values[:temp_min] = sensor_htg_spt.name.to_s
if spaces[HPXML::LocationConditionedSpace].thermalZone.get.thermostatSetpointDualSetpoint.is_initialized
# Create a sensor to get dynamic heating setpoint
htg_sch = spaces[HPXML::LocationConditionedSpace].thermalZone.get.thermostatSetpointDualSetpoint.get.heatingSetpointTemperatureSchedule.get
sensor_htg_spt = OpenStudio::Model::EnergyManagementSystemSensor.new(model, 'Schedule Value')
sensor_htg_spt.setName('htg_spt')
sensor_htg_spt.setKeyName(htg_sch.name.to_s)
space_values[:temp_min] = sensor_htg_spt.name.to_s
else
# No HVAC system; use the average of defaulted heating/cooling setpoints.
htg_weekday_setpoints, htg_weekend_setpoints = HVAC.get_default_heating_setpoint(HPXML::HVACControlTypeManual, @eri_version)
clg_weekday_setpoints, clg_weekend_setpoints = HVAC.get_default_cooling_setpoint(HPXML::HVACControlTypeManual, @eri_version)
if htg_weekday_setpoints.split(', ').uniq.size == 1 && htg_weekend_setpoints.split(', ').uniq.size == 1 && htg_weekday_setpoints.split(', ').uniq == htg_weekend_setpoints.split(', ').uniq
default_htg_sp = htg_weekend_setpoints.split(', ').uniq[0].to_f
else
fail 'Unexpected heating setpoints.'
end
if clg_weekday_setpoints.split(', ').uniq.size == 1 && clg_weekend_setpoints.split(', ').uniq.size == 1 && clg_weekday_setpoints.split(', ').uniq == clg_weekend_setpoints.split(', ').uniq
default_clg_sp = clg_weekend_setpoints.split(', ').uniq[0].to_f
else
fail 'Unexpected cooling setpoints.'
end
space_values[:temp_min] = (default_htg_sp + default_clg_sp) / 2.0 # avg-F
end
shorowit marked this conversation as resolved.
Show resolved Hide resolved
end

# Schedule type limits compatible
Expand Down
12 changes: 3 additions & 9 deletions HPXMLtoOpenStudio/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>hpxm_lto_openstudio</name>
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
<version_id>0ebec604-841f-48e1-b2e4-708f3e83616a</version_id>
<version_modified>2024-02-19T21:43:05Z</version_modified>
<version_id>714436d4-ea11-4e17-9a32-bffa7e9b8a79</version_id>
<version_modified>2024-02-19T22:48:11Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -142,7 +142,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>EFD8076F</checksum>
<checksum>BED20F66</checksum>
</file>
<file>
<filename>airflow.rb</filename>
Expand Down Expand Up @@ -576,12 +576,6 @@
<usage_type>resource</usage_type>
<checksum>87937B84</checksum>
</file>
<file>
<filename>in.schedules.csv</filename>
<filetype>csv</filetype>
<usage_type>test</usage_type>
<checksum>6244F711</checksum>
</file>
<file>
<filename>test_airflow.rb</filename>
<filetype>rb</filetype>
Expand Down
7 changes: 4 additions & 3 deletions tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,13 @@ def apply_hpxml_modification(hpxml_file, hpxml)
if ['base-bldgtype-mf-unit-adjacent-to-multifamily-buffer-space.xml',
'base-bldgtype-mf-unit-adjacent-to-non-freezing-space.xml',
'base-bldgtype-mf-unit-adjacent-to-other-heated-space.xml',
'base-bldgtype-mf-unit-adjacent-to-other-heated-space-hvac-none.xml',
'base-bldgtype-mf-unit-adjacent-to-other-housing-unit.xml'].include? hpxml_file
if hpxml_file == 'base-bldgtype-mf-unit-adjacent-to-multifamily-buffer-space.xml'
adjacent_to = HPXML::LocationOtherMultifamilyBufferSpace
elsif hpxml_file == 'base-bldgtype-mf-unit-adjacent-to-non-freezing-space.xml'
adjacent_to = HPXML::LocationOtherNonFreezingSpace
elsif hpxml_file == 'base-bldgtype-mf-unit-adjacent-to-other-heated-space.xml'
elsif hpxml_file == 'base-bldgtype-mf-unit-adjacent-to-other-heated-space.xml' || hpxml_file == 'base-bldgtype-mf-unit-adjacent-to-other-heated-space-hvac-none.xml'
adjacent_to = HPXML::LocationOtherHeatedSpace
elsif hpxml_file == 'base-bldgtype-mf-unit-adjacent-to-other-housing-unit.xml'
adjacent_to = HPXML::LocationOtherHousingUnit
Expand All @@ -398,8 +399,8 @@ def apply_hpxml_modification(hpxml_file, hpxml)
area: 20,
azimuth: 0,
r_value: 4.4)
hpxml_bldg.hvac_distributions[0].ducts[0].duct_location = adjacent_to
hpxml_bldg.hvac_distributions[0].ducts[1].duct_location = adjacent_to
hpxml_bldg.hvac_distributions[0].ducts[0].duct_location = adjacent_to if hpxml_bldg.hvac_distributions.size > 0
hpxml_bldg.hvac_distributions[0].ducts[1].duct_location = adjacent_to if hpxml_bldg.hvac_distributions.size > 0
hpxml_bldg.water_heating_systems[0].location = adjacent_to
hpxml_bldg.clothes_washers[0].location = adjacent_to
hpxml_bldg.clothes_dryers[0].location = adjacent_to
Expand Down
5 changes: 5 additions & 0 deletions workflow/hpxml_inputs.json
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,11 @@
"sample_files/base-bldgtype-mf-unit-adjacent-to-other-heated-space.xml": {
"parent_hpxml": "sample_files/base-bldgtype-mf-unit.xml"
},
"sample_files/base-bldgtype-mf-unit-adjacent-to-other-heated-space-hvac-none.xml": {
"parent_hpxml": "sample_files/base-bldgtype-mf-unit-adjacent-to-other-heated-space.xml",
shorowit marked this conversation as resolved.
Show resolved Hide resolved
"heating_system_type": "none",
"cooling_system_type": "none"
},
"sample_files/base-bldgtype-mf-unit-adjacent-to-other-housing-unit.xml": {
"parent_hpxml": "sample_files/base-bldgtype-mf-unit.xml"
},
Expand Down
Loading