Skip to content

Commit

Permalink
Merge branch 'master' into AppendixG_Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
lymereJ authored Apr 4, 2024
2 parents 87a2b47 + 67f99df commit 29ca836
Show file tree
Hide file tree
Showing 136 changed files with 436,470 additions and 430,574 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/.idea
/netbeans
/.vscode
/.VSCodeCounter

# Developer installation
/.bundle/
Expand Down
3 changes: 1 addition & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ AllCops:
Exclude:
- 'data/**/*'
- 'test/**/*'
- 'lib/openstudio-standards/hvac_sizing/**/*'
- 'lib/openstudio-standards/btap/**/*'
- 'lib/openstudio-standards/standards/necb/**/*'
- 'lib/openstudio-standards/prototypes/common/do_not_edit_metaclasses.rb'
Expand All @@ -25,4 +24,4 @@ Metrics/BlockLength:
Max: 100

Naming/FileName:
Enabled: false
Enabled: false
2 changes: 1 addition & 1 deletion data/standards/manage_OpenStudio_Standards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def unique_properties(sheet_name)
when 'unitary_acs'
['template', 'cooling_type', 'heating_type', 'subcategory', 'minimum_capacity', 'maximum_capacity', 'start_date', 'end_date']
when 'water_heaters'
['template', 'fuel_type', 'minimum_capacity', 'maximum_capacity', 'start_date', 'end_date']
['template', 'equipment_type', 'fuel_type', 'minimum_capacity', 'maximum_capacity', 'minimum_storage', 'maximum_storage', 'minimum_capacity_per_storage', 'maximum_capacity_per_storage', 'draw_profile', 'start_date', 'end_date']
when 'elevators'
['template', 'building_type']
when 'refrigeration_system_lineup', 'refrigeration_system'
Expand Down
1,346 changes: 673 additions & 673 deletions data/standards/test_performance_expected_dd_results.csv

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion lib/openstudio-standards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module OpenstudioStandards

# Space Module
require_relative 'openstudio-standards/space/space'

# HVAC Module
require_relative 'openstudio-standards/hvac/cbecs_hvac'

Expand Down Expand Up @@ -347,6 +347,7 @@ module OpenstudioStandards
require_relative "#{stds}/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.FanVariableVolume"
require_relative "#{stds}/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.Space"
require_relative "#{stds}/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.ThermalZone"
require_relative "#{stds}/ashrae_90_1/ashrae_90_1_2019/ashrae_90_1_2019.WaterHeaterMixed"
# 90.1-PRM Common
require_relative "#{stds}/ashrae_90_1_prm/ashrae_90_1_prm"
require_relative "#{stds}/ashrae_90_1_prm/ashrae_90_1_prm.Model"
Expand Down
174 changes: 103 additions & 71 deletions lib/openstudio-standards/create_typical/create_typical.rb

Large diffs are not rendered by default.

61 changes: 30 additions & 31 deletions lib/openstudio-standards/geometry/create_bar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1187,43 +1187,42 @@ def self.bar_hash_setup_run(model, args, length, width, floor_height, center_of_
end

# @todo should be able to remove this fix after OpenStudio intersection issue is fixed. At that time turn the above message into an error with return false after it
if match_error
return true unless match_error

# identify z value of top and bottom story
bottom_story = nil
top_story = nil
new_spaces.each do |space|
story = space.buildingStory.get
nom_z = story.nominalZCoordinate.get
if bottom_story.nil?
bottom_story = nom_z
elsif bottom_story > nom_z
bottom_story = nom_z
end
if top_story.nil?
top_story = nom_z
elsif top_story < nom_z
top_story = nom_z
end
# identify z value of top and bottom story
bottom_story = nil
top_story = nil
new_spaces.each do |space|
story = space.buildingStory.get
nom_z = story.nominalZCoordinate.get
if bottom_story.nil?
bottom_story = nom_z
elsif bottom_story > nom_z
bottom_story = nom_z
end
if top_story.nil?
top_story = nom_z
elsif top_story < nom_z
top_story = nom_z
end
end

# change boundary condition and intersection as needed.
new_spaces.each do |space|
if space.buildingStory.get.nominalZCoordinate.get > bottom_story
# change floors
space.surfaces.each do |surface|
next if !(surface.surfaceType == 'Floor' && surface.outsideBoundaryCondition == 'Ground')
# change boundary condition and intersection as needed.
new_spaces.each do |space|
if space.buildingStory.get.nominalZCoordinate.get > bottom_story
# change floors
space.surfaces.each do |surface|
next if !(surface.surfaceType == 'Floor' && surface.outsideBoundaryCondition == 'Ground')

surface.setOutsideBoundaryCondition('Adiabatic')
end
surface.setOutsideBoundaryCondition('Adiabatic')
end
if space.buildingStory.get.nominalZCoordinate.get < top_story
# change ceilings
space.surfaces.each do |surface|
next if !(surface.surfaceType == 'RoofCeiling' && surface.outsideBoundaryCondition == 'Outdoors')
end
if space.buildingStory.get.nominalZCoordinate.get < top_story
# change ceilings
space.surfaces.each do |surface|
next if !(surface.surfaceType == 'RoofCeiling' && surface.outsideBoundaryCondition == 'Outdoors')

surface.setOutsideBoundaryCondition('Adiabatic')
end
surface.setOutsideBoundaryCondition('Adiabatic')
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ def model_add_cw_loop(model,
next unless dd.dayType == 'SummerDesignDay'
next unless dd.name.get.to_s.include?('WB=>MDB')


if condenser_water_loop.model.version < OpenStudio::VersionString.new('3.3.0')
if dd.humidityIndicatingType == 'Wetbulb'
summer_oat_wb_c = dd.humidityIndicatingConditionsAtMaximumDryBulb
Expand Down Expand Up @@ -5257,8 +5256,6 @@ def model_add_low_temp_radiant(model,
slab_oat_low: slab_oat_low,
slab_sp_at_oat_high: slab_sp_at_oat_high,
slab_oat_high: slab_oat_high)
else
# 'none'; use energyplus default controls
end
end
return radiant_loops
Expand Down
50 changes: 25 additions & 25 deletions lib/openstudio-standards/qaqc/create_results.rb
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ def self.make_qaqc_results_vector(skip_weekends = true,
date = date_time.date
day_of_week = date.dayOfWeek
# Convert the peak demand to kW
val_J_per_hr = val / int_len_hrs.value
val_kW = OpenStudio.convert(val_J_per_hr, 'J/h', 'kW').get
val_j_per_hr = val / int_len_hrs.value
val_kw = OpenStudio.convert(val_j_per_hr, 'J/h', 'kW').get

# puts("#{val_kW}kW; #{date}; #{time}; #{day_of_week.valueName}")
# puts("#{val_kw}kW; #{date}; #{time}; #{day_of_week.valueName}")

# Skip times outside of the correct months
next if date_time < start_date || date_time > end_date
Expand All @@ -436,7 +436,7 @@ def self.make_qaqc_results_vector(skip_weekends = true,
next if day_type == 8
end

# puts("VALID #{val_kW}kW; #{date}; #{time}; #{day_of_week.valueName}")
# puts("VALID #{val_kw}kW; #{date}; #{time}; #{day_of_week.valueName}")

# Check peak demand against this timestep
# and update if this timestep is higher.
Expand All @@ -445,11 +445,11 @@ def self.make_qaqc_results_vector(skip_weekends = true,
electricity_peak_demand_time = date_time
end
end
elec_peak_demand_timestep_J = OpenStudio::Quantity.new(electricity_peak_demand, joule_unit)
elec_peak_demand_timestep_j = OpenStudio::Quantity.new(electricity_peak_demand, joule_unit)
num_int = elec.values.size
int_len_hrs = OpenStudio::Quantity.new(hrs_sim / num_int, hrs_unit)
elec_peak_demand_hourly_J_per_hr = elec_peak_demand_timestep_J / int_len_hrs
electricity_peak_demand = OpenStudio.convert(elec_peak_demand_hourly_J_per_hr, kilowatt_unit).get.value
elec_peak_demand_hourly_j_per_hr = elec_peak_demand_timestep_j / int_len_hrs
electricity_peak_demand = OpenStudio.convert(elec_peak_demand_hourly_j_per_hr, kilowatt_unit).get.value
demand_elems << OpenStudio::Attribute.new('electricity_peak_demand', electricity_peak_demand, 'kW')
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.QAQC', "Peak Demand = #{electricity_peak_demand.round(2)}kW on #{electricity_peak_demand_time}")
else
Expand Down Expand Up @@ -490,7 +490,7 @@ def self.make_qaqc_results_vector(skip_weekends = true,
time = date_time.time
date = date_time.date

# puts("#{val_kW}kW; #{date}; #{time}; #{day_of_week.valueName}")
# puts("#{val_kw}kW; #{date}; #{time}; #{day_of_week.valueName}")

# Determine which TOU period this hour falls into
tou_period_assigned = false
Expand Down Expand Up @@ -580,10 +580,10 @@ def self.make_qaqc_results_vector(skip_weekends = true,
date = date_time.date
day_of_week = date.dayOfWeek
# Convert the peak demand to kW
val_J_per_hr = val / int_len_hrs.value
val_kW = OpenStudio.convert(val_J_per_hr, 'J/h', 'kW').get
val_j_per_hr = val / int_len_hrs.value
val_kw = OpenStudio.convert(val_j_per_hr, 'J/h', 'kW').get

# puts("#{val_kW}kW; #{date}; #{time}; #{day_of_week.valueName}")
# puts("#{val_kw}kW; #{date}; #{time}; #{day_of_week.valueName}")

# Skip times outside of the correct months
next if date_time < start_date || date_time > end_date
Expand All @@ -601,7 +601,7 @@ def self.make_qaqc_results_vector(skip_weekends = true,
next if day_type == 8
end

# puts("VALID #{val_kW}kW; #{date}; #{time}; #{day_of_week.valueName}")
# puts("VALID #{val_kw}kW; #{date}; #{time}; #{day_of_week.valueName}")

# Check peak demand against this timestep
# and update if this timestep is higher.
Expand All @@ -610,11 +610,11 @@ def self.make_qaqc_results_vector(skip_weekends = true,
ann_dist_clg_peak_demand_time = date_time
end
end
dist_clg_peak_demand_timestep_J = OpenStudio::Quantity.new(district_cooling_peak_demand, joule_unit)
dist_clg_peak_demand_timestep_j = OpenStudio::Quantity.new(district_cooling_peak_demand, joule_unit)
num_int = dist_clg.values.size
int_len_hrs = OpenStudio::Quantity.new(hrs_sim / num_int, hrs_unit)
dist_clg_peak_demand_hourly_J_per_hr = dist_clg_peak_demand_timestep_J / int_len_hrs
district_cooling_peak_demand = OpenStudio.convert(dist_clg_peak_demand_hourly_J_per_hr, kilowatt_unit).get.value
dist_clg_peak_demand_hourly_j_per_hr = dist_clg_peak_demand_timestep_j / int_len_hrs
district_cooling_peak_demand = OpenStudio.convert(dist_clg_peak_demand_hourly_j_per_hr, kilowatt_unit).get.value
demand_elems << OpenStudio::Attribute.new('district_cooling_peak_demand', district_cooling_peak_demand, 'kW')
OpenStudio.logFree(OpenStudio::Info, 'openstudio.standards.QAQC', "District Cooling Peak Demand = #{district_cooling_peak_demand.round(2)}kW on #{ann_dist_clg_peak_demand_time}")
else
Expand Down Expand Up @@ -649,7 +649,7 @@ def self.make_qaqc_results_vector(skip_weekends = true,
time = date_time.time
date = date_time.date

# puts("#{val_kW}kW; #{date}; #{time}; #{day_of_week.valueName}")
# puts("#{val_kw}kW; #{date}; #{time}; #{day_of_week.valueName}")

# Determine which TOU period this hour falls into
tou_period_assigned = false
Expand Down Expand Up @@ -809,8 +809,8 @@ def self.make_qaqc_results_vector(skip_weekends = true,
# Subtract off the already accounted for fuel types from the total
# to account for fuels on custom meters where the fuel type is not known.
prev_tot = 0.0
annual_utility_cost_map.each do |fuel, val|
prev_tot += val
annual_utility_cost_map.each do |fuel, value|
prev_tot += value
end
if total.is_initialized
other_val = total.get - prev_tot
Expand Down Expand Up @@ -909,10 +909,10 @@ def self.make_qaqc_results_vector(skip_weekends = true,
mon_energy_cons = 0.0
val = @sql.energyConsumptionByMonth(end_use_fuel_type, end_use_cat, month)
if val.is_initialized
monthly_consumption_J = OpenStudio::Quantity.new(val.get, joule_unit)
monthly_consumption_GJ = OpenStudio.convert(monthly_consumption_J, gigajoule_unit).get.value
mon_energy_cons = monthly_consumption_GJ
ann_energy_cons += monthly_consumption_GJ
monthly_consumption_j = OpenStudio::Quantity.new(val.get, joule_unit)
monthly_consumption_gj = OpenStudio.convert(monthly_consumption_j, gigajoule_unit).get.value
mon_energy_cons = monthly_consumption_gj
ann_energy_cons += monthly_consumption_gj
end
# record the monthly value
if end_use_fuel_type == OpenStudio::EndUseFuelType.new('Water')
Expand Down Expand Up @@ -948,12 +948,12 @@ def self.make_qaqc_results_vector(skip_weekends = true,
fuel_type_name = fuel_type_alias_map[end_use_fuel_type.value]
ann_peak_demand = 0.0
# in each end use, loop through months and get monthly enedy consumption
months.each_with_index do |month, i|
months.each_with_index do |month, month_index|
mon_peak_demand = 0.0
val = @sql.peakEnergyDemandByMonth(end_use_fuel_type, end_use_cat, month)
if val.is_initialized
mon_peak_demand_W = OpenStudio::Quantity.new(val.get, watt_unit)
mon_peak_demand = OpenStudio.convert(mon_peak_demand_W, kilowatt_unit).get.value
mon_peak_demand_w = OpenStudio::Quantity.new(val.get, watt_unit)
mon_peak_demand = OpenStudio.convert(mon_peak_demand_w, kilowatt_unit).get.value
end
# record the monthly value
fuel_type_elems << OpenStudio::Attribute.new('month', mon_peak_demand, 'kW')
Expand Down
19 changes: 7 additions & 12 deletions lib/openstudio-standards/qaqc/envelope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ def self.check_envelope_conductance(category, target_standard, min_pass_pct: 0.2
if data.nil?
puts "lookup for #{target_standard},#{intended_surface_type},#{standards_construction_type}"
check_elems << OpenStudio::Attribute.new('flag', "Didn't find construction for #{standards_construction_type} #{intended_surface_type} for #{space_type.name}.")
elsif intended_surface_type.include? 'ExteriorWall' || 'ExteriorFloor' || 'ExteriorDoor'
elsif ['ExteriorWall', 'ExteriorFloor', 'ExteriorDoor'].include? intended_surface_type
space_type_const_properties[intended_surface_type]['u_value'] = data['assembly_maximum_u_value']
space_type_const_properties[intended_surface_type]['reflectance'] = 0.30 # hard coded value
elsif intended_surface_type.include? 'ExteriorRoof'
elsif intended_surface_type == 'ExteriorRoof'
space_type_const_properties[intended_surface_type]['u_value'] = data['assembly_maximum_u_value']
space_type_const_properties[intended_surface_type]['reflectance'] = 0.55 # hard coded value
else
Expand Down Expand Up @@ -155,8 +155,6 @@ def self.check_envelope_conductance(category, target_standard, min_pass_pct: 0.2
when 'Floor'
intended_surface_type = 'ExteriorFloor'
end
else
# currently only used for surfaces with outdoor boundary condition
end
film_coefficients_r_value = std.film_coefficients_r_value(intended_surface_type, includes_int_film = true, includes_ext_film = true)
thermal_conductance = surface_detail[:construction].thermalConductance.get
Expand Down Expand Up @@ -229,8 +227,6 @@ def self.check_envelope_conductance(category, target_standard, min_pass_pct: 0.2
if boundary_condition.to_s == 'Outdoors'
# @todo add additional intended surface types
if surface_type.to_s == 'Door' then intended_surface_type = 'ExteriorDoor' end
else
# currently only used for surfaces with outdoor boundary condition
end
film_coefficients_r_value = std.film_coefficients_r_value(intended_surface_type, includes_int_film = true, includes_ext_film = true)

Expand Down Expand Up @@ -299,11 +295,11 @@ def self.check_envelope_conductance(category, target_standard, min_pass_pct: 0.2

unless missing_surface_constructions.empty?
check_elems << OpenStudio::Attribute.new('flag', "#{missing_surface_constructions.size} surfaces are missing constructions in #{space_type.name}. Spaces and can't be checked.")
end
end

unless missing_sub_surface_constructions.empty?
check_elems << OpenStudio::Attribute.new('flag', "#{missing_sub_surface_constructions.size} sub surfaces are missing constructions in #{space_type.name}. Spaces and can't be checked.")
end
end

surface_details.uniq.each do |surface_detail|
if surface_detail[:construction].thermalConductance.is_initialized
Expand All @@ -322,8 +318,7 @@ def self.check_envelope_conductance(category, target_standard, min_pass_pct: 0.2
when 'Floor'
intended_surface_type = 'ExteriorFloor'
standards_construction_type = 'Mass'
end
# currently only used for surfaces with outdoor boundary condition
end
end
film_coefficients_r_value = std.film_coefficients_r_value(intended_surface_type, includes_int_film = true, includes_ext_film = true)
thermal_conductance = surface_detail[:construction].thermalConductance.get
Expand All @@ -341,10 +336,10 @@ def self.check_envelope_conductance(category, target_standard, min_pass_pct: 0.2
if data.nil?
check_elems << OpenStudio::Attribute.new('flag', "Didn't find construction for #{standards_construction_type} #{intended_surface_type} for #{space.name}.")
next
elsif intended_surface_type.include? 'ExteriorWall' || 'ExteriorFloor' || 'ExteriorDoor'
elsif ['ExteriorWall', 'ExteriorFloor', 'ExteriorDoor'].include? intended_surface_type
assembly_maximum_u_value = data['assembly_maximum_u_value']
target_reflectance = 0.30
elsif intended_surface_type.include? 'ExteriorRoof'
elsif intended_surface_type == 'ExteriorRoof'
assembly_maximum_u_value = data['assembly_maximum_u_value']
target_reflectance = 0.55
else
Expand Down
Loading

0 comments on commit 29ca836

Please sign in to comment.