lib/openstudio-standards/qaqc/internal_loads.rb in openstudio-standards-0.5.0 vs lib/openstudio-standards/qaqc/internal_loads.rb in openstudio-standards-0.6.0.rc1
- old
+ new
@@ -149,11 +149,11 @@
if data.nil? || data.empty?
# skip if all spaces using this space type are plenums
all_spaces_plenums = true
space_type.spaces.each do |space|
- unless std.space_plenum?(space)
+ unless OpenstudioStandards::Space.space_plenum?(space)
all_spaces_plenums = false
next
end
end
@@ -308,11 +308,11 @@
end
end
# warn if there are spaces in model that don't use space type unless they appear to be plenums
@model.getSpaces.sort.each do |space|
- next if std.space_plenum?(space)
+ next if OpenstudioStandards::Space.space_plenum?(space)
if !space.spaceType.is_initialized
check_elems << OpenStudio::Attribute.new('flag', "#{space.name} doesn't have a space type assigned, can't validate internal loads.")
end
end
@@ -373,19 +373,19 @@
if data.nil? || data.empty?
# skip if all spaces using this space type are plenums
all_spaces_plenums = true
space_type.spaces.each do |space|
- unless std.space_plenum?(space)
+ unless OpenstudioStandards::Space.space_plenum?(space)
all_spaces_plenums = false
break
- end
+ end
end
unless all_spaces_plenums
check_elems << OpenStudio::Attribute.new('flag', "Unexpected standards type for #{space_type.name}, can't validate schedules.")
- end
+ end
next
end
# temp model to hold schedules to check
@@ -400,11 +400,11 @@
elsif !schedule_target.to_ScheduleRuleset.is_initialized
check_elems << OpenStudio::Attribute.new('flag', "Schedule named #{schedule_target.name} is a #{schedule_target.class}, not a ScheduleRuleset schedule.")
else
schedule_target = schedule_target.to_ScheduleRuleset.get
# loop through and test individual load instances
- expected_hours = std.schedule_ruleset_annual_equivalent_full_load_hrs(schedule_target)
+ expected_hours = OpenstudioStandards::Schedules.schedule_ruleset_get_equivalent_full_load_hours(schedule_target)
space_type.lights.each do |space_load_instance|
inst_sch_check = OpenstudioStandards::QAQC.space_load_instance_schedule_check(space_load_instance, expected_hours, std: std, min_pass_pct: min_pass_pct, max_pass_pct: max_pass_pct)
if inst_sch_check then check_elems << inst_sch_check end
end
@@ -420,12 +420,11 @@
elsif !schedule_target.to_ScheduleRuleset.is_initialized
check_elems << OpenStudio::Attribute.new('flag', "Schedule named #{schedule_target.name} is a #{schedule_target.class}, not a ScheduleRuleset schedule.")
else
schedule_target = schedule_target.to_ScheduleRuleset.get
# loop through and test individual load instances
- expected_hours = std.schedule_ruleset_annual_equivalent_full_load_hrs(schedule_target)
-
+ expected_hours = OpenstudioStandards::Schedules.schedule_ruleset_get_equivalent_full_load_hours(schedule_target)
space_type.electricEquipment.each do |space_load_instance|
inst_sch_check = OpenstudioStandards::QAQC.space_load_instance_schedule_check(space_load_instance, expected_hours, std: std, min_pass_pct: min_pass_pct, max_pass_pct: max_pass_pct)
if inst_sch_check then check_elems << inst_sch_check end
end
end
@@ -441,11 +440,11 @@
elsif !schedule_target.to_ScheduleRuleset.is_initialized
check_elems << OpenStudio::Attribute.new('flag', "Schedule named #{schedule_target.name} is a #{schedule_target.class}, not a ScheduleRuleset schedule.")
else
schedule_target = schedule_target.to_ScheduleRuleset.get
# loop through and test individual load instances
- expected_hours = std.schedule_ruleset_annual_equivalent_full_load_hrs(schedule_target)
+ expected_hours = OpenstudioStandards::Schedules.schedule_ruleset_get_equivalent_full_load_hours(schedule_target)
space_type.gasEquipment.each do |space_load_instance|
inst_sch_check = OpenstudioStandards::QAQC.space_load_instance_schedule_check(space_load_instance, expected_hours, std: std, min_pass_pct: min_pass_pct, max_pass_pct: max_pass_pct)
if inst_sch_check then check_elems << inst_sch_check end
end
end
@@ -460,11 +459,11 @@
elsif !schedule_target.to_ScheduleRuleset.is_initialized
check_elems << OpenStudio::Attribute.new('flag', "Schedule named #{schedule_target.name} is a #{schedule_target.class}, not a ScheduleRuleset schedule.")
else
schedule_target = schedule_target.to_ScheduleRuleset.get
# loop through and test individual load instances
- expected_hours = std.schedule_ruleset_annual_equivalent_full_load_hrs(schedule_target)
+ expected_hours = OpenstudioStandards::Schedules.schedule_ruleset_get_equivalent_full_load_hours(schedule_target)
space_type.people.each do |space_load_instance|
inst_sch_check = OpenstudioStandards::QAQC.space_load_instance_schedule_check(space_load_instance, expected_hours, std: std, min_pass_pct: min_pass_pct, max_pass_pct: max_pass_pct)
if inst_sch_check then check_elems << inst_sch_check end
end
@@ -494,11 +493,11 @@
# model load for space type where standards doesn't have one wont throw flag about mis-matched schedules
end
# warn if there are spaces in model that don't use space type unless they appear to be plenums
@model.getSpaces.sort.each do |space|
- next if std.space_plenum?(space)
+ next if OpenstudioStandards::Space.space_plenum?(space)
if !space.spaceType.is_initialized
check_elems << OpenStudio::Attribute.new('flag', "#{space.name} doesn't have a space type assigned, can't validate schedules.")
end
end
@@ -544,14 +543,11 @@
else
return OpenStudio::Attribute.new('flag', "#{space_load_instance.name} in #{space_type.name} doesn't have a schedule assigned.")
end
# get annual equiv for model schedule
- if schedule_inst.to_ScheduleRuleset.is_initialized
- inst_hrs = std.schedule_ruleset_annual_equivalent_full_load_hrs(schedule_inst.to_ScheduleRuleset.get)
- elsif schedule_inst.to_ScheduleConstant.is_initialized
- inst_hrs = std.schedule_constant_annual_equivalent_full_load_hrs(schedule_inst.to_ScheduleConstant.get)
- else
+ inst_hrs = OpenstudioStandards::Schedules.schedule_get_equivalent_full_load_hours(schedule_inst)
+ if inst_hrs.nil?
return OpenStudio::Attribute.new('flag', "#{schedule_inst.name} isn't a Ruleset or Constant schedule. Can't calculate annual equivalent full load hours.")
end
# check instance against target
if inst_hrs < expected_hours * (1.0 - min_pass_pct)