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

Whole SFA/MF buildings: shared boilers, take 2 #1893

Open
wants to merge 6 commits into
base: whole_building_common_spaces
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
13 changes: 12 additions & 1 deletion HPXMLtoOpenStudio/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ def run(model, runner, user_arguments)
# Write updated HPXML object (w/ defaults) to file for inspection
XMLHelper.write_file(hpxml.to_doc, args[:hpxml_defaults_path])

# When modeling whole SFA/MF buildings, remove shared systems upfront
# from the HPXML object; handle them at the end once the full model
# has been created.
shared_systems_map = {}
if hpxml.header.whole_sfa_or_mf_building_sim
shared_systems_map = hpxml.delete_shared_systems_serving_multiple_dwelling_units()
end

# Create OpenStudio unit model(s)
hpxml_osm_map = {}
hpxml.buildings.each do |hpxml_bldg|
Expand All @@ -141,9 +149,12 @@ def run(model, runner, user_arguments)
end
end

# Merge unit models into final model
if hpxml.buildings.size > 1
# Merge unit models into final model
Model.merge_unit_models(model, hpxml_osm_map)

# Apply shared systems
HVAC.apply_shared_systems(runner, model, hpxml, hpxml_osm_map, shared_systems_map)
end

# Create EnergyPlus outputs
Expand Down
20 changes: 10 additions & 10 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>7cc0e0ea-e4a6-4c82-874c-5c674d12581a</version_id>
<version_modified>2024-11-27T17:39:00Z</version_modified>
<version_id>d4c275a9-8ec8-4ac1-8b41-c6e7acee61bb</version_id>
<version_modified>2024-11-27T23:57:31Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -183,7 +183,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>D7F18DFB</checksum>
<checksum>7A8113DC</checksum>
</file>
<file>
<filename>airflow.rb</filename>
Expand Down Expand Up @@ -327,7 +327,7 @@
<filename>defaults.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>9DDC450E</checksum>
<checksum>9E53CA52</checksum>
</file>
<file>
<filename>energyplus.rb</filename>
Expand Down Expand Up @@ -357,7 +357,7 @@
<filename>hpxml.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>CAA6C4DF</checksum>
<checksum>D2164BF2</checksum>
</file>
<file>
<filename>hpxml_schema/HPXML.xsd</filename>
Expand All @@ -375,7 +375,7 @@
<filename>hpxml_schematron/EPvalidator.xml</filename>
<filetype>xml</filetype>
<usage_type>resource</usage_type>
<checksum>A5F3FD24</checksum>
<checksum>171A79BF</checksum>
</file>
<file>
<filename>hpxml_schematron/iso-schematron.xsd</filename>
Expand All @@ -387,13 +387,13 @@
<filename>hvac.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>901BE48C</checksum>
<checksum>16573C00</checksum>
</file>
<file>
<filename>hvac_sizing.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>A12F1925</checksum>
<checksum>06FAB663</checksum>
</file>
<file>
<filename>internal_gains.rb</filename>
Expand Down Expand Up @@ -447,7 +447,7 @@
<filename>model.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>8CBF7564</checksum>
<checksum>20EF0A5D</checksum>
</file>
<file>
<filename>output.rb</filename>
Expand Down Expand Up @@ -627,7 +627,7 @@
<filename>waterheater.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>6D8EEB7D</checksum>
<checksum>FE4A4EF1</checksum>
</file>
<file>
<filename>weather.rb</filename>
Expand Down
43 changes: 40 additions & 3 deletions HPXMLtoOpenStudio/resources/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def self.apply(runner, hpxml, hpxml_bldg, weather, schedules_file: nil, convert_
apply_doors(hpxml_bldg)
apply_partition_wall_mass(hpxml_bldg)
apply_furniture_mass(hpxml_bldg)
apply_hvac(runner, hpxml_bldg, weather, convert_shared_systems, unit_num)
apply_hvac(runner, hpxml.header, hpxml_bldg, weather, convert_shared_systems, unit_num)
apply_hvac_control(hpxml_bldg, schedules_file, eri_version)
apply_hvac_distribution(hpxml_bldg)
apply_infiltration(hpxml_bldg)
Expand Down Expand Up @@ -237,6 +237,13 @@ def self.apply_header(hpxml_header, hpxml_bldg, weather)
unavailable_period.natvent_availability_isdefaulted = true
end
end

if hpxml_header.shared_boiler_operation.nil?
if hpxml_bldg.heating_systems.select { |htg| htg.heating_system_type == HPXML::HVACTypeBoiler && htg.is_shared_system_serving_multiple_dwelling_units }.size > 0
hpxml_header.shared_boiler_operation = HPXML::SharedBoilerOperationSequenced
hpxml_header.shared_boiler_operation_isdefaulted = true
end
end
end

# Assigns default values for omitted optional inputs in the HPXML::BuildingHeader object
Expand Down Expand Up @@ -1834,14 +1841,15 @@ def self.apply_furniture_mass(hpxml_bldg)
# HPXML::CoolingSystem, and HPXML::HeatPump objects
#
# @param runner [OpenStudio::Measure::OSRunner] Object typically used to display warnings
# @param hpxml_header [HPXML::Header] HPXML Header object (one per HPXML file)
# @param hpxml_bldg [HPXML::Building] HPXML Building object representing an individual dwelling unit
# @param weather [WeatherFile] Weather object containing EPW information
# @param convert_shared_systems [Boolean] Whether to convert shared systems to equivalent in-unit systems per ANSI 301
# @param unit_num [Integer] Dwelling unit number
# @return [nil]
def self.apply_hvac(runner, hpxml_bldg, weather, convert_shared_systems, unit_num)
def self.apply_hvac(runner, hpxml_header, hpxml_bldg, weather, convert_shared_systems, unit_num)
if convert_shared_systems
HVAC.apply_shared_systems(hpxml_bldg)
HVAC.convert_shared_systems_to_in_unit_systems(hpxml_bldg, hpxml_header)
end

# Convert negative values (e.g., -1) to nil as appropriate
Expand Down Expand Up @@ -2506,6 +2514,35 @@ def self.apply_hvac_control(hpxml_bldg, schedules_file, eri_version)
# @param hpxml_bldg [HPXML::Building] HPXML Building object representing an individual dwelling unit
# @return [nil]
def self.apply_hvac_distribution(hpxml_bldg)
# Hydronic distribution
hpxml_bldg.hvac_distributions.each do |hvac_distribution|
next unless hvac_distribution.hvac_systems.any? { |h| h.is_a?(HPXML::HeatingSystem) && h.heating_system_type == HPXML::HVACTypeBoiler }

# Supply/return loop temperatures
default_delta_t = 20.0 # deg-F
if hvac_distribution.hydronic_supply_temp.nil?
if not hvac_distribution.hydronic_return_temp.nil?
hvac_distribution.hydronic_supply_temp = hvac_distribution.hydronic_return_temp + default_delta_t # deg-F
else
hvac_distribution.hydronic_supply_temp = 180.0 # deg-F
end
hvac_distribution.hydronic_supply_temp_isdefaulted = true
end
if hvac_distribution.hydronic_return_temp.nil?
hvac_distribution.hydronic_return_temp = hvac_distribution.hydronic_supply_temp - default_delta_t # deg-F
hvac_distribution.hydronic_return_temp_isdefaulted = true
end
if hvac_distribution.hydronic_trvs.nil?
hvac_distribution.hydronic_trvs = true
hvac_distribution.hydronic_trvs_isdefaulted = true
end
if hvac_distribution.hydronic_variable_speed_pump.nil?
hvac_distribution.hydronic_variable_speed_pump = false
hvac_distribution.hydronic_variable_speed_pump_isdefaulted = true
end
end

# Air distribution
ncfl_ag = hpxml_bldg.building_construction.number_of_conditioned_floors_above_grade
ncfl = hpxml_bldg.building_construction.number_of_conditioned_floors

Expand Down
Loading
Loading