Skip to content

Commit

Permalink
Simplify hvac_sizing.rb; no longer need to do azimuth-specific wall c…
Browse files Browse the repository at this point in the history
…alcs.
  • Loading branch information
shorowit committed Jul 17, 2024
1 parent 52116bb commit d7865a1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 49 deletions.
6 changes: 3 additions & 3 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>d0eb0b5c-df97-43e4-bd1e-bd190a7ec005</version_id>
<version_modified>2024-07-17T22:31:15Z</version_modified>
<version_id>89e00e9c-fcb6-44d2-828f-5e1cc365cc7d</version_id>
<version_modified>2024-07-17T23:48:54Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -387,7 +387,7 @@
<filename>hvac_sizing.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>F969A8C2</checksum>
<checksum>DCBC4530</checksum>
</file>
<file>
<filename>lighting.rb</filename>
Expand Down
82 changes: 36 additions & 46 deletions HPXMLtoOpenStudio/resources/hvac_sizing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ def self.init_loads(hpxml_bldg)
all_zone_loads[zone] = DesignLoadValues.new
zone.spaces.each do |space|
all_space_loads[space] = DesignLoadValues.new
space.additional_properties.total_exposed_wall_area = 0.0
space.additional_properties.total_exposed_wall_area = 0.0 # Wall area in contact with outdoor air
# Initialize Hourly Aggregate Fenestration Loads (AFL)
space.additional_properties.afl_hr_windows = [0.0] * 12 # Data saved for peak load
space.additional_properties.afl_hr_skylights = [0.0] * 12 # Data saved for peak load
Expand Down Expand Up @@ -1023,55 +1023,45 @@ def self.process_load_walls(mj, hpxml_bldg, all_zone_loads, all_space_loads)

ashrae_wall_group = get_ashrae_wall_group(wall)

if wall.azimuth.nil?
azimuths = [0.0, 90.0, 180.0, 270.0] # Assume 4 equal surfaces facing every direction
else
azimuths = [wall.azimuth]
end

htg_htm = 0.0
clg_htm = 0.0
azimuths.each do |_azimuth|
if wall.is_exterior
# Store exposed wall gross area for infiltration calculation
space.additional_properties.total_exposed_wall_area += wall.area / azimuths.size

# Adjust base Cooling Load Temperature Difference (CLTD)
# Assume absorptivity for light walls < 0.5, medium walls <= 0.75, dark walls > 0.75 (based on MJ8 Table 4B Notes)
if wall.solar_absorptance <= 0.5
color_multiplier = 0.65 # MJ8 Table 4B Notes, pg 348
elsif wall.solar_absorptance <= 0.75
color_multiplier = 0.83 # MJ8 Appendix 12, pg 519
else
color_multiplier = 1.0
end

# Base Cooling Load Temperature Differences (CLTD's) for dark colored sunlit and shaded walls
# with 95 degF outside temperature taken from MJ8 Figure A12-8 (intermediate wall groups were
# determined using linear interpolation). Shaded walls apply to partition walls only.
cltd_base_sun = { 'G' => 38.0, 'F-G' => 34.95, 'F' => 31.9, 'E-F' => 29.45, 'E' => 27.0, 'D-E' => 24.5, 'D' => 22.0, 'C-D' => 21.25, 'C' => 20.5, 'B-C' => 19.65, 'B' => 18.8 }
# cltd_base_shade = { 'G' => 25.0, 'F-G' => 22.5, 'F' => 20.0, 'E-F' => 18.45, 'E' => 16.9, 'D-E' => 15.45, 'D' => 14.0, 'C-D' => 13.55, 'C' => 13.1, 'B-C' => 12.85, 'B' => 12.6 }
if wall.is_exterior
# Store exposed wall gross area for infiltration calculation
space.additional_properties.total_exposed_wall_area += wall.area

# Adjust base Cooling Load Temperature Difference (CLTD)
# Assume absorptivity for light walls < 0.5, medium walls <= 0.75, dark walls > 0.75 (based on MJ8 Table 4B Notes)
if wall.solar_absorptance <= 0.5
color_multiplier = 0.65 # MJ8 Table 4B Notes, pg 348
elsif wall.solar_absorptance <= 0.75
color_multiplier = 0.83 # MJ8 Appendix 12, pg 519
else
color_multiplier = 1.0
end

# Non-directional exterior walls
cltd_base = cltd_base_sun
cltd = cltd_base[ashrae_wall_group] * color_multiplier
# Base Cooling Load Temperature Differences (CLTD's) for dark colored sunlit and shaded walls
# with 95 degF outside temperature taken from MJ8 Figure A12-8 (intermediate wall groups were
# determined using linear interpolation). Shaded walls apply to partition walls only.
cltd_base_sun = { 'G' => 38.0, 'F-G' => 34.95, 'F' => 31.9, 'E-F' => 29.45, 'E' => 27.0, 'D-E' => 24.5, 'D' => 22.0, 'C-D' => 21.25, 'C' => 20.5, 'B-C' => 19.65, 'B' => 18.8 }
# cltd_base_shade = { 'G' => 25.0, 'F-G' => 22.5, 'F' => 20.0, 'E-F' => 18.45, 'E' => 16.9, 'D-E' => 15.45, 'D' => 14.0, 'C-D' => 13.55, 'C' => 13.1, 'B-C' => 12.85, 'B' => 12.6 }

if mj.ctd >= 10.0
# Adjust base CLTD for different CTD or DR
cltd += (hpxml_bldg.header.manualj_cooling_design_temp - 95.0) + mj.daily_range_temp_adjust[mj.daily_range_num]
else
# Handling cases ctd < 10 is based on A12-18 in MJ8
cltd_corr = mj.ctd - 20.0 - mj.daily_range_temp_adjust[mj.daily_range_num]
cltd = [cltd + cltd_corr, 0.0].max # NOTE: The CLTD_Alt equation in A12-18 part 5 suggests CLTD - CLTD_corr, but A12-19 suggests it should be CLTD + CLTD_corr (where CLTD_corr is negative)
end
# Non-directional exterior walls
cltd_base = cltd_base_sun
cltd = cltd_base[ashrae_wall_group] * color_multiplier

clg_htm += (1.0 / wall.insulation_assembly_r_value) / azimuths.size * cltd
htg_htm += (1.0 / wall.insulation_assembly_r_value) / azimuths.size * mj.htd
else # Partition wall
adjacent_space = wall.exterior_adjacent_to
clg_htm += (1.0 / wall.insulation_assembly_r_value) / azimuths.size * (mj.cool_design_temps[adjacent_space] - mj.cool_setpoint)
htg_htm += (1.0 / wall.insulation_assembly_r_value) / azimuths.size * (mj.heat_setpoint - mj.heat_design_temps[adjacent_space])
if mj.ctd >= 10.0
# Adjust base CLTD for different CTD or DR
cltd += (hpxml_bldg.header.manualj_cooling_design_temp - 95.0) + mj.daily_range_temp_adjust[mj.daily_range_num]
else
# Handling cases ctd < 10 is based on A12-18 in MJ8
cltd_corr = mj.ctd - 20.0 - mj.daily_range_temp_adjust[mj.daily_range_num]
cltd = [cltd + cltd_corr, 0.0].max # NOTE: The CLTD_Alt equation in A12-18 part 5 suggests CLTD - CLTD_corr, but A12-19 suggests it should be CLTD + CLTD_corr (where CLTD_corr is negative)
end

clg_htm = (1.0 / wall.insulation_assembly_r_value) * cltd
htg_htm = (1.0 / wall.insulation_assembly_r_value) * mj.htd
else # Partition wall
adjacent_space = wall.exterior_adjacent_to
clg_htm = (1.0 / wall.insulation_assembly_r_value) * (mj.cool_design_temps[adjacent_space] - mj.cool_setpoint)
htg_htm = (1.0 / wall.insulation_assembly_r_value) * (mj.heat_setpoint - mj.heat_design_temps[adjacent_space])
end
clg_loads = clg_htm * wall.net_area
htg_loads = htg_htm * wall.net_area
Expand Down

0 comments on commit d7865a1

Please sign in to comment.