lib/openstudio-standards/btap/envelope.rb in openstudio-standards-0.1.15 vs lib/openstudio-standards/btap/envelope.rb in openstudio-standards-0.2.0.rc1

- old
+ new

@@ -66,14 +66,16 @@ #This method assignes interior surface construction to adiabatic surfaces from model. #@author phylroy.lopez@nrcan.gc.ca #@param model [OpenStudio::model::Model] A model object def self.assign_interior_surface_construction_to_adiabatic_surfaces(model, runner = nil) - BTAP::runner_register("Info","assign_interior_surface_construction_to_adiabatic_surfaces(#{model},#{runner}", runner) + BTAP::runner_register("Info","assign_interior_surface_construction_to_adiabatic_surfaces", runner) unless model.building.get.defaultConstructionSet.empty? or model.building.get.defaultConstructionSet.get.defaultInteriorSurfaceConstructions.empty? or model.building.get.defaultConstructionSet.get.defaultInteriorSurfaceConstructions.get.wallConstruction.empty? #Give adiabatic surfaces a construction. Does not matter what. This is a bug in Openstudio that leave these surfaces unassigned by the default construction set. + all_adiabatic_surfaces = BTAP::Geometry::Surfaces::filter_by_boundary_condition(model.getSurfaces, "Adiabatic") + unless all_adiabatic_surfaces.empty? wall_construction = model.building.get.defaultConstructionSet.get.defaultInteriorSurfaceConstructions.get.wallConstruction.get BTAP::Geometry::Surfaces::set_surfaces_construction( all_adiabatic_surfaces, wall_construction) names = "" all_adiabatic_surfaces.each {|surface| name = "#{names} , #{surface.name.to_s} " } @@ -88,12 +90,12 @@ #This method removes all thermal mass definitions from model. #@author phylroy.lopez@nrcan.gc.ca #@param model [OpenStudio::model::Model] A model object def self.remove_all_thermal_mass_definitions( model ) - model.getInternalMassDefinitions.each { |item| item.remove } - model.getInternalMasss.each { |item| item.remove } + model.getInternalMassDefinitions.sort.each { |item| item.remove } + model.getInternalMasss.sort.each { |item| item.remove } end #This method removes all envelope information from model. #@author phylroy.lopez@nrcan.gc.ca #@param model [OpenStudio::model::Model] A model object @@ -108,11 +110,11 @@ BTAP::Resources::Envelope::remove_all_thermal_mass_definitions( model ) end def self.set_all_surfaces_to_default_construction( model ) - model.getPlanarSurfaces.each { |item| item.resetConstruction } + model.getPlanarSurfaces.sort.each { |item| item.resetConstruction } end # This module contains Materials, Constructions and ConstructionSets @@ -590,11 +592,11 @@ #Will convert from a string identifier to an object if required. construction = BTAP::Common::validate_array(model,construction,"Construction").first #If it is Opaque raise ("This construction is not opaque :#{construction.name}") unless (construction.isOpaque) minimum_resistance = 0 - name_prefix = "Customized opaque construction #{construction.handle()} to conductance of #{conductance}" + name_prefix = "Customized opaque construction #{construction.name} to conductance of #{conductance}" #Check to see if we already made one like this. existing_construction = OpenStudio::Model::getConstructionByName(construction.model,name_prefix) if not existing_construction.empty? # if so, return existing construction @@ -839,11 +841,11 @@ # ) #add the glazing and any shading materials to the array and create construction based on this. new_materials_array = Array.new() new_materials_array << glazing new_materials_array.concat(shading_material_array) unless shading_material_array.empty? - puts new_materials_array.size + #puts new_materials_array.size return self.create_construction(construction.model, cons_name, new_materials_array) end def self.create_default_construction(model, rsi) @@ -997,10 +999,10 @@ unless model.building.get.setDefaultConstructionSet( construction_set.clone( model ).to_DefaultConstructionSet.get ) BTAP::runner_register("Error", "Could not use default construction set #{construction_set_name} from #{construction_library_file} ", runner) return false end #sets all surfaces to use default constructions except adiabatic, where it does a hard assignment of the interior wall construction type. - model.getPlanarSurfaces.each { |item| item.resetConstruction } + model.getPlanarSurfaces.sort.each { |item| item.resetConstruction } #if the default construction set is defined..try to assign the interior wall to the adiabatic surfaces BTAP::Resources::Envelope::assign_interior_surface_construction_to_adiabatic_surfaces( model, runner) BTAP::runner_register("Info","set_construction_set_by_file(#{construction_library_file}, #{construction_set_name}) Completed Sucessfully.") return true end \ No newline at end of file