lib/openstudio-standards/qaqc/envelope.rb in openstudio-standards-0.5.0 vs lib/openstudio-standards/qaqc/envelope.rb in openstudio-standards-0.6.0.rc1

- old
+ new

@@ -67,14 +67,14 @@ space_type_const_properties[intended_surface_type] = {} data = std.space_type_get_construction_properties(space_type, intended_surface_type, standards_construction_type) 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 space_type_const_properties[intended_surface_type]['u_value'] = data['assembly_maximum_u_value'] space_type_const_properties[intended_surface_type]['shgc'] = data['assembly_maximum_solar_heat_gain_coefficient'] @@ -153,14 +153,12 @@ when 'RoofCeiling' intended_surface_type = 'ExteriorRoof' 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) + film_coefficients_r_value = OpenstudioStandards::Constructions.film_coefficients_r_value(intended_surface_type, includes_int_film = true, includes_ext_film = true) thermal_conductance = surface_detail[:construction].thermalConductance.get r_value_with_film = 1 / thermal_conductance + film_coefficients_r_value source_units = 'm^2*K/W' target_units = 'ft^2*h*R/Btu' r_value_ip = OpenStudio.convert(r_value_with_film, source_units, target_units).get @@ -194,13 +192,14 @@ sub_surface_details.uniq.each do |sub_surface_detail| if sub_surface_detail[:surface_type] == 'FixedWindow' || sub_surface_detail[:surface_type] == 'OperableWindow' || sub_surface_detail[:surface_type] == 'Skylight' # check for non opaque sub surfaces source_units = 'W/m^2*K' target_units = 'Btu/ft^2*h*R' - u_factor_si = std.construction_calculated_u_factor(sub_surface_detail[:construction].to_LayeredConstruction.get.to_Construction.get) + surface_construction = sub_surface_detail[:construction].to_LayeredConstruction.get + u_factor_si = OpenstudioStandards::Constructions.construction_get_conductance(surface_construction) u_factor_ip = OpenStudio.convert(u_factor_si, source_units, target_units).get - shgc = std.construction_calculated_solar_heat_gain_coefficient(sub_surface_detail[:construction].to_LayeredConstruction.get.to_Construction.get) + shgc = OpenstudioStandards::Constructions.construction_get_solar_transmittance(surface_construction) # stop if didn't find values (0 or infinity) next if target_u_value_ip[sub_surface_detail[:surface_type]] == 0.0 next if target_u_value_ip[sub_surface_detail[:surface_type]] == Float::INFINITY @@ -227,14 +226,12 @@ surface_type = sub_surface_detail[:surface_type] intended_surface_type = '' 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) + film_coefficients_r_value = OpenstudioStandards::Constructions.film_coefficients_r_value(intended_surface_type, includes_int_film = true, includes_ext_film = true) thermal_conductance = sub_surface_detail[:construction].thermalConductance.get r_value_with_film = 1 / thermal_conductance + film_coefficients_r_value source_units = 'm^2*K/W' target_units = 'ft^2*h*R/Btu' @@ -297,15 +294,15 @@ end end 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 # don't use intended surface type of construction, look map based on surface type and boundary condition boundary_condition = surface_detail[:boundary_condition] @@ -320,14 +317,13 @@ intended_surface_type = 'ExteriorRoof' standards_construction_type = 'IEAD' 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) + film_coefficients_r_value = OpenstudioStandards::Constructions.film_coefficients_r_value(intended_surface_type, includes_int_film = true, includes_ext_film = true) thermal_conductance = surface_detail[:construction].thermalConductance.get r_value_with_film = 1 / thermal_conductance + film_coefficients_r_value source_units = 'm^2*K/W' target_units = 'ft^2*h*R/Btu' r_value_ip = OpenStudio.convert(r_value_with_film, source_units, target_units).get @@ -339,13 +335,13 @@ data = std.model_get_construction_properties(@model, intended_surface_type, standards_construction_type) 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 assembly_maximum_u_value = data['assembly_maximum_u_value'] assembly_maximum_solar_heat_gain_coefficient = data['assembly_maximum_solar_heat_gain_coefficient']