Skip to content

Commit

Permalink
Merge pull request #1721 from NREL/nrcan_master_merge
Browse files Browse the repository at this point in the history
Merge nrcan changes into master
  • Loading branch information
mdahlhausen authored Apr 7, 2024
2 parents 9391825 + 8ecee17 commit e7d43f4
Show file tree
Hide file tree
Showing 512 changed files with 1,797,715 additions and 1,727,531 deletions.
2,316 changes: 2,316 additions & 0 deletions data/weather/CAN_AB_Calgary.Intl.AP.718770_CWEC2016.ddy

Large diffs are not rendered by default.

8,768 changes: 8,768 additions & 0 deletions data/weather/CAN_AB_Calgary.Intl.AP.718770_CWEC2016.epw

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions data/weather/CAN_AB_Calgary.Intl.AP.718770_CWEC2016.stat

Large diffs are not rendered by default.

2,316 changes: 2,316 additions & 0 deletions data/weather/CAN_AB_Edmonton.Intl.AP.711230_CWEC2016.ddy

Large diffs are not rendered by default.

8,768 changes: 8,768 additions & 0 deletions data/weather/CAN_AB_Edmonton.Intl.AP.711230_CWEC2016.epw

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions data/weather/CAN_AB_Edmonton.Intl.AP.711230_CWEC2016.stat

Large diffs are not rendered by default.

2,316 changes: 2,316 additions & 0 deletions data/weather/CAN_BC_Vancouver.Intl.AP.718920_CWEC2016.ddy

Large diffs are not rendered by default.

8,768 changes: 8,768 additions & 0 deletions data/weather/CAN_BC_Vancouver.Intl.AP.718920_CWEC2016.epw

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions data/weather/CAN_BC_Vancouver.Intl.AP.718920_CWEC2016.stat

Large diffs are not rendered by default.

2,343 changes: 2,343 additions & 0 deletions data/weather/CAN_NS_Halifax.Dockyard.713280_CWEC2016.ddy

Large diffs are not rendered by default.

8,768 changes: 8,768 additions & 0 deletions data/weather/CAN_NS_Halifax.Dockyard.713280_CWEC2016.epw

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions data/weather/CAN_NS_Halifax.Dockyard.713280_CWEC2016.stat

Large diffs are not rendered by default.

2,316 changes: 2,316 additions & 0 deletions data/weather/CAN_ON_Toronto.Pearson.Intl.AP.716240_CWEC2016.ddy

Large diffs are not rendered by default.

8,768 changes: 8,768 additions & 0 deletions data/weather/CAN_ON_Toronto.Pearson.Intl.AP.716240_CWEC2016.epw

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions data/weather/CAN_ON_Toronto.Pearson.Intl.AP.716240_CWEC2016.stat

Large diffs are not rendered by default.

2,316 changes: 2,316 additions & 0 deletions data/weather/CAN_QC_Montreal-Trudeau.Intl.AP.716270_CWEC2016.ddy

Large diffs are not rendered by default.

8,768 changes: 8,768 additions & 0 deletions data/weather/CAN_QC_Montreal-Trudeau.Intl.AP.716270_CWEC2016.epw

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions data/weather/CAN_QC_Montreal-Trudeau.Intl.AP.716270_CWEC2016.stat

Large diffs are not rendered by default.

2,316 changes: 2,316 additions & 0 deletions data/weather/CAN_YT_Whitehorse.Intl.AP.719640_CWEC2016.ddy

Large diffs are not rendered by default.

8,768 changes: 8,768 additions & 0 deletions data/weather/CAN_YT_Whitehorse.Intl.AP.719640_CWEC2016.epw

Large diffs are not rendered by default.

687 changes: 687 additions & 0 deletions data/weather/CAN_YT_Whitehorse.Intl.AP.719640_CWEC2016.stat

Large diffs are not rendered by default.

26 changes: 12 additions & 14 deletions lib/openstudio-standards/schedules/parametric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,10 @@ def self.spaces_space_types_get_parametric_schedule_inputs(spaces_space_types, p
# @param hoo_var_method [String] accepts hours and fractional. Any other value value will result in hoo variables not being applied
# @return [Hash] parametric inputs hash of ScheduleRuleset => {floor: schedule floor, ceiling: schedule ceiling, target: load instance, hoo_inputs: hours_of_operation hash}
def self.schedule_ruleset_get_parametric_inputs(schedule_ruleset, space_load_instance, parametric_inputs, hours_of_operation,
ramp: true,
min_ramp_dur_hr: 2.0,
gather_data_only: false,
hoo_var_method: 'hours')
ramp: true,
min_ramp_dur_hr: 2.0,
gather_data_only: false,
hoo_var_method: 'hours')
if parametric_inputs.key?(schedule_ruleset)
if hours_of_operation != parametric_inputs[schedule_ruleset][:hoo_inputs] # don't warn if the hours of operation between old and new schedule are equivalent
# OpenStudio.logFree(OpenStudio::Warn, 'openstudio.standards.Parametric.Schedule', "#{space_load_instance.name} uses #{schedule_ruleset.name} but parametric inputs have already been setup based on hours of operation for #{parametric_inputs[schedule_ruleset][:target].name}.")
Expand Down Expand Up @@ -511,17 +511,17 @@ def self.schedule_ruleset_get_parametric_inputs(schedule_ruleset, space_load_ins
day_map = {}
sch_days.each do |day|
# find the hour of operation rule that contains the day number
hoo_keys = hours_of_operation.find { |_, val| val[:days_used].include?(day)}
unless hoo_keys.nil?
hoo_key = hoo_keys.first
day_map[day] = hoo_key
else
hoo_keys = hours_of_operation.find { |_, val| val[:days_used].include?(day) }
if hoo_keys.nil?
OpenStudio.logFree(OpenStudio::Error, 'openstudio.standards.Parametric.Schedule', "In #{__method__}, cannot find schedule #{schedule_days.key(sch_index).name.get} day #{day} in hour of operation profiles. Something went wrong.")
end

hoo_key = hoo_keys.first
day_map[day] = hoo_key
end
# group days with the same hour of operation index
grouped_days = Hash.new { |h, k| h[k] = [] }
day_map.each { |day, hoo_idx| grouped_days[hoo_idx] << day}
day_map.each { |day, hoo_idx| grouped_days[hoo_idx] << day }
# group by schedule rule index
sch_day_map[sch_index] = grouped_days
end
Expand All @@ -532,6 +532,7 @@ def self.schedule_ruleset_get_parametric_inputs(schedule_ruleset, space_load_ins
hoo_group.each do |hoo_index, day_group|
# skip common default days
next if sch_index == -1 && hoo_index == -1

# skip if rules already match
if (sch_ruleset_days_used[sch_index] - day_group).empty?
OpenStudio.logFree(OpenStudio::Debug, 'openstudio.standards.Parametric.Schedules', "in #{__method__}: #{schedule_ruleset.name} rule #{sch_index} already matches hours of operation rule #{hoo_index}; new rule won't be created.")
Expand All @@ -543,7 +544,7 @@ def self.schedule_ruleset_get_parametric_inputs(schedule_ruleset, space_load_ins
end
end
# new rules are created at top of list - cleanup old rules
schedule_ruleset.scheduleRules[new_rule_ct..-1].each( &:remove ) unless new_rule_ct == 0
schedule_ruleset.scheduleRules[new_rule_ct..-1].each(&:remove) unless new_rule_ct == 0

# re-collect new schedule rules
schedule_days = OpenstudioStandards::Schedules.schedule_ruleset_get_schedule_day_rule_indices(schedule_ruleset)
Expand All @@ -552,7 +553,6 @@ def self.schedule_ruleset_get_parametric_inputs(schedule_ruleset, space_load_ins

# step through profiles and add additional properties to describe profiles
schedule_days.each_with_index do |(schedule_day, current_rule_index), i|

hoo_target_index = nil

days_used = sch_ruleset_days_used[current_rule_index]
Expand Down Expand Up @@ -799,9 +799,7 @@ def self.schedule_ruleset_get_parametric_inputs(schedule_ruleset, space_load_ins
else
time = 'hoo_end + 0'
end

end

end

# populate string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def air_loop_hvac_demand_control_ventilation_limits(air_loop_hvac)
# This method is a copy of what is in Standards.AirLoopHVAC.rb and ensures
# ERVs will not prevent DCV from being applied to DEER models.
#
# @param air_loop_hvac [OpenStudio::Model::AirLoopHVAC] air loop
# @param air_loop_hvac [OpenStudio::Model::AirLoopHVAC] air loop
# return [Boolean] returns true if required, false if not
def air_loop_hvac_dcv_required_when_erv(air_loop_hvac)
dcv_required_when_erv_present = true
Expand Down
14 changes: 8 additions & 6 deletions lib/openstudio-standards/standards/necb/ECMS/hvac_systems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def get_storey_avg_clg_zcoords(model)
storey_cond = false
total_area = 0.0
sum = 0.0
raise("get_storey_avg_clg_zcoords: storey #{storey.name} has no spaces associated with it. Either delete the storey or " \
"assign spaces to it") if storey.spaces.empty?
storey.spaces.each do |space|
# Determine if any of the spaces/zones of the storey are conditioned? If yes then the floor is considered to be conditioned
if space.thermalZone.is_initialized
Expand Down Expand Up @@ -1865,10 +1867,10 @@ def add_ecm_hs14_cgshp_fancoils(model:,

# add output variables for district heating and cooling
model.getOutputVariables.each {|ivar| ivar.remove}
dist_htg_var = OpenStudio::Model::OutputVariable.new("District Heating Hot Water Rate",model)
dist_htg_var = OpenStudio::Model::OutputVariable.new("District Heating Water Rate",model)
dist_htg_var.setReportingFrequency("hourly")
dist_htg_var.setKeyValue("*")
dist_clg_var = OpenStudio::Model::OutputVariable.new("District Cooling Chilled Water Rate",model)
dist_clg_var = OpenStudio::Model::OutputVariable.new("District Cooling Water Rate",model)
dist_clg_var.setReportingFrequency("hourly")
dist_clg_var.setKeyValue("*")

Expand Down Expand Up @@ -1987,9 +1989,9 @@ def set_ghx_loop_district_cap(model)
case dist_htg_eqpts[0].iddObjectType.valueName.to_s
when 'OS_DistrictHeating'
dist_htg_eqpt = dist_htg_eqpts[0].to_DistrictHeating.get
when 'OS_DistrictHeatingWater'
when 'OS_DistrictHeating_Water'
dist_htg_eqpt = dist_htg_eqpts[0].to_DistrictHeatingWater.get
when 'OS_DistrictHeatingSteam'
when 'OS_DistrictHeating_Steam'
dist_htg_eqpt = dist_htg_eqpts[0].to_DistrictHeatingSteam.get
end
end
Expand All @@ -1998,7 +2000,7 @@ def set_ghx_loop_district_cap(model)
raise("set_cond_loop_district_cap: condenser loop doesn't have a district heating and district cooling objects") if dist_htg_eqpts.empty? || dist_clg_eqpts.empty?
# District Heating
sql_command = "SELECT ReportVariableDataDictionaryIndex FROM ReportVariableDataDictionary
WHERE VariableName='District Heating Hot Water Rate'"
WHERE VariableName='District Heating Water Rate'"
dhtg_index = model.sqlFile.get.execAndReturnFirstString(sql_command).get
raise("set_ghx_loop_district_cap: EnergyPlus sql results file has no data for district heating hot water rate") if dhtg_index.nil?
sql_command = "SELECT Value FROM ReportVariableWithTime
Expand All @@ -2009,7 +2011,7 @@ def set_ghx_loop_district_cap(model)
dist_htg_s = model.sqlFile.get.execAndReturnVectorOfString(sql_command).get
# District Cooling
sql_command = "SELECT ReportVariableDataDictionaryIndex FROM ReportVariableDataDictionary
WHERE VariableName='District Cooling Chilled Water Rate'"
WHERE VariableName='District Cooling Water Rate'"
dclg_index = model.sqlFile.get.execAndReturnFirstString(sql_command).get
raise("set_ghx_loop_district_cap: EnergyPlus sql results file has no data for district cooling chilled water rate") if dclg_index.nil?
sql_command = "SELECT Value FROM ReportVariableWithTime
Expand Down
Loading

0 comments on commit e7d43f4

Please sign in to comment.