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

- old
+ new

@@ -15,57 +15,16 @@ # * You should have received a copy of the GNU Lesser General Public # * License along with this library; if not, write to the Free Software # * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # **********************************************************************/ - require "#{File.dirname(__FILE__)}/btap" module BTAP module Resources #Resources # This module contains methods that relate to Materials, Constructions and Construction Sets module Envelope #Resources::Envelope - - #This method removes all materials from model. - #@author phylroy.lopez@nrcan.gc.ca - #@param model [OpenStudio::Model::Model] A model object - def self.remove_all_materials(model) - model.getMaterials().each do |item| - item.remove - end unless model.getMaterials().empty? - end - - #This method removes all constructions from model. - #@author phylroy.lopez@nrcan.gc.ca - #@param model [OpenStudio::Model::Model] A model object - def self.remove_all_constructions(model) - model.getConstructions().each { |item| item.remove } - end - - #This method removes all default surface constructions from model. - #@author phylroy.lopez@nrcan.gc.ca - #@param model [OpenStudio::Model::Model] A model object - def self.remove_all_default_surface_constructions(model) - model.getDefaultSurfaceConstructionss().each { |item| item.remove } - end - - #This method removes all default subsurface constructions from model. - #@author phylroy.lopez@nrcan.gc.ca - #@param model [OpenStudio::Model::Model] A model object - def self.remove_all_default_subsurface_constructions(model) - model.getDefaultSubSurfaceConstructionss().each { |item| item.remove } - end - - #This method removes all default construction sets from model. - #@author phylroy.lopez@nrcan.gc.ca - #@param model [OpenStudio::Model::Model] A model object - def self.remove_all_default_construction_sets(model) - model.getDefaultConstructionSets().each { |item| item.remove } - model.building.get.resetDefaultConstructionSet() - end - - #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", runner) @@ -74,11 +33,11 @@ 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) + all_adiabatic_surfaces.each { |surface| surface.setConstruction(wall_construction) } names = "" all_adiabatic_surfaces.each { |surface| name = "#{names} , #{surface.name.to_s} " } BTAP::runner_register("Warning", "The following adiabatic surfaces have been assigned the construction #{wall_construction.name} : #{name}", runner) end else @@ -86,441 +45,68 @@ return false end return true end - #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.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 def self.remove_all_envelope_information(model) - BTAP::Resources::Envelope::remove_all_materials(model) - BTAP::Resources::Envelope::remove_all_default_construction_sets(model) - BTAP::Resources::Envelope::remove_all_default_subsurface_constructions(model) - BTAP::Resources::Envelope::remove_all_default_surface_constructions(model) - BTAP::Resources::Envelope::set_all_surfaces_to_default_construction(model) - BTAP::Resources::Envelope::remove_all_constructions(model) - BTAP::Resources::Envelope::remove_all_materials(model) - BTAP::Resources::Envelope::remove_all_thermal_mass_definitions(model) - end - - - def self.set_all_surfaces_to_default_construction(model) + model.getDefaultConstructionSets.each(&:remove) + model.building.get.resetDefaultConstructionSet + model.getDefaultSubSurfaceConstructionss.each(&:remove) + model.getDefaultSurfaceConstructionss.each(&:remove) model.getPlanarSurfaces.sort.each { |item| item.resetConstruction } + model.getConstructionBases.each(&:remove) + model.getMaterials.each(&:remove) + model.getInternalMassDefinitions(&:remove) + model.getInternalMasss(&:remove) end - - # This module contains Materials, Constructions and ConstructionSets - module Materials #Resources::Envelope::Materials - #This method gets conductance. - #@author phylroy.lopez@nrcan.gc.ca - #@param material [OpenStudio::Model::StandardOpaqueMaterial] - #@param temperature_c [Float] - #@return [Float] conductance - def self.get_conductance(material, temperature_c = 0.0) - conductance = nil - #this method is a wrapper around OS functions. No testing is required. - #Convert C to K - temperature_k = temperature_c + 273.0 - conductance = material.to_SimpleGlazing.get.uFactor unless material.to_SimpleGlazing.empty? - conductance = material.to_StandardGlazing.get.thermalConductance unless material.to_StandardGlazing.empty? - conductance = material.to_OpaqueMaterial.get.thermalConductance unless material.to_OpaqueMaterial.empty? - conductance = material.to_Shade.get.thermalConductance unless material.to_Shade.empty? - conductance = material.to_Screen.get.thermalConductance unless material.to_Screen.empty? - conductance = material.to_MasslessOpaqueMaterial.get.thermalConductance unless material.to_MasslessOpaqueMaterial.empty? - conductance = 1.0 / material.to_AirGap.get.thermalResistance unless material.to_AirGap.empty? - conductance = material.to_Gas.get.getThermalConductivity(temperature_k) unless material.to_Gas.empty? - conductance = material.to_GasMixture.get.getThermalConductance(temperature_k) unless material.to_GasMixture.empty? - conductance = material.to_RoofVegetation.get.thermalConductance unless material.to_RoofVegetation.empty? - conductance = material.to_RefractionExtinctionGlazing.get.thermalConductance unless material.to_RefractionExtinctionGlazing.empty? - conductance = 9999.9 unless material.to_Blind.empty? - raise ("Conductance for Material: #{material.name} could not be set.") if conductance == nil - return conductance - end - - - # This module contains methods to create opaque materials for Opaque constructions such as walls, roofs, floor and ceilings. - module Opaque #Resources::Envelope::Materials::Opaque - #Test Opaque Module - if __FILE__ == $0 - require 'test/unit' - class OpaqueTests < Test::Unit::TestCase - - #This method tests the creation of opaque materials. - #@author phylroy.lopez@nrcan.gc.ca - def test_create_opaque_material() - model = OpenStudio::Model::Model.new() - material = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model) - assert(!(material.to_StandardOpaqueMaterial.empty?)) - end - - #This method tests the creation of massless opaque materials. - #@author phylroy.lopez@nrcan.gc.ca - def test_create_massless_opaque_material() - model = OpenStudio::Model::Model.new() - material = BTAP::Resources::Envelope::Materials::Opaque::create_massless_opaque_material(model) - assert(!(material.to_MasslessOpaqueMaterial.empty?)) - end - - #This method tests the creation of air gap. - #@author phylroy.lopez@nrcan.gc.ca - def test_create_air_gap() - model = OpenStudio::Model::Model.new() - material = BTAP::Resources::Envelope::Materials::Opaque::create_air_gap(model) - assert(!(material.to_AirGap.empty?)) - end - end - end # End Test Opaque - - - # This method will create a OpenStudio::Model::StandardOpaqueMaterial material layer. - # BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material - # @author Phylroy A. Lopez <plopez@nrcan.gc.ca> - # @param model [OpenStudio::Model::Model] {http://openstudio.nrel.gov/latest-c-sdk-documentation/model} - # @param name [String] the name of the surface. - # @param thickness [Float] meters. - # @param conductivity [Float] W/m*K. - # @param density [Float] kg/m3 - # @param specific_heat [Float] J/kg*K - # @param roughness [String] valid values are = ["VeryRough", "Rough", "MediumRough","Smooth","MediumSmooth","VerySmooth"] - # @param thermal_absorptance [Float] range of 0 to 1.0 - # @param solar_absorptance [Float] range of 0 to 1.0 - # @param visible_absorptance [Float] range of 0 to 1.0 - # @return [OpenStudio::Model::StandardOpaqueMaterial] material {http://openstudio.nrel.gov/sites/openstudio.nrel.gov/files/nv_data/cpp_documentation_it/model/html/classopenstudio_1_1model_1_1_standard_opaque_material.html} - def self.create_opaque_material(model, - name = "opaque material", - thickness = 0.1, - conductivity = 0.1, - density = 0.1, - specific_heat = 100, - roughness = "Smooth", - thermal_absorptance = 0.9, - solar_absorptance = 0.7, - visible_absorptance = 0.7) - # make sure the roughness value is acceptable. - raise("Roughness Value \"#{roughness}\" is not a part of accepted values such as: #{OpenStudio::Model::StandardOpaqueMaterial::roughnessValues.join(",")}") unless OpenStudio::Model::StandardOpaqueMaterial::roughnessValues.include?(roughness) - # I was thinking of adding a suffix to the name to make it more descriptive, but this can be confusing. Keeping it here if I need it later. - # name = name + " " + "t=" + sprintf("%.3f", thickness) + "c=" + sprintf("%.3f", conductance) + "d=" + sprintf("%.3f", density) + "s=" + sprintf("%.3", specific_heat) - material = OpenStudio::Model::StandardOpaqueMaterial.new(model, roughness, thickness, conductivity, density, specific_heat) - material.setName(name) unless name == "" or name == nil - material.setThermalAbsorptance(thermal_absorptance) - material.setSolarAbsorptance(solar_absorptance) - material.setVisibleAbsorptance(visible_absorptance) - return material - end - - - # This method will create a new OpenStudio::Model::MasslessOpaqueMaterial material layer - # @author Phylroy A. Lopez Natural Resources Canada <plopez@nrcan.gc.ca> - # @param model [OpenStudio::Model::Model] {http://openstudio.nrel.gov/latest-c-sdk-documentation/model OpenStudio::Model::Model} - # @param name [String] the name of the surface. - # @param roughness [String] valid values are = ["VeryRough", "Rough", "MediumRough","Smooth","MediumSmooth","VerySmooth"] - # @param thermalResistance [Float] m*K/W - # @return [OpenStudio::Model::MasslessOpaqueMaterial] massless {http://openstudio.nrel.gov/sites/openstudio.nrel.gov/files/nv_data/cpp_documentation_it/model/html/classopenstudio_1_1model_1_1_massless_opaque_material.html OpenStudio::Model::MasslessOpaqueMaterial} - def self.create_massless_opaque_material(model, name = "massless opaque", roughness = "Smooth", thermalResistance = 0.1) - # make sure the roughness value is acceptable. - raise("Roughness Value \"#{roughness}\" is not a part of accepted values: #{OpenStudio::Model::StandardOpaqueMaterial::roughnessValues.join(",")}") unless OpenStudio::Model::StandardOpaqueMaterial::roughnessValues.include?(roughness) - massless = OpenStudio::Model::MasslessOpaqueMaterial.new(model, roughness, thermalResistance) - massless.setName(name) - return massless - end - - # This method will create a new OpenStudio::Model::AirGap material layer - # @author Phylroy A. Lopez <plopez@nrcan.gc.ca> - # @param model [OpenStudio::Model::Model] {http://openstudio.nrel.gov/latest-c-sdk-documentation/model OpenStudio::Model::Model} - # @param name [String] the name of the surface. - # @param resistance [Float] m2*K/W - # @return [OpenStudio::Model::AirGap] air - def self.create_air_gap(model, name = "air gap", resistance = 0.1) - air = OpenStudio::Model::AirGap.new(model, resistance) - air.setName(name) - return air - end - end - - - #This module contains methods to create materials for glazed construction such as windows, doors, and skylights. - module Fenestration #Resources::Envelope::Materials::Fenestration - - #Test Fenestration Module - if __FILE__ == $0 - require 'test/unit' - class FenestrationTests < Test::Unit::TestCase - #This method will test the creation of simple glazing - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - def test_create_simple_glazing() - model = OpenStudio::Model::Model.new() - material = BTAP::Resources::Envelope::Materials::Fenestration::create_simple_glazing(model) - assert(!(material.to_SimpleGlazing.empty?)) - end - - #This method will test the creation of standard glazing - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - def test_create_standard_glazing() - model = OpenStudio::Model::Model.new() - material = BTAP::Resources::Envelope::Materials::Fenestration::create_standard_glazing(model) - assert(!(material.to_StandardGlazing.empty?)) - end - - #This method will test the creation of simple gas - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - def test_create_gas() - model = OpenStudio::Model::Model.new() - material = BTAP::Resources::Envelope::Materials::Fenestration::create_gas(model) - assert(!(material.to_Gas.empty?)) - end - - #This method will test the creation of blind - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - def test_create_blind() - model = OpenStudio::Model::Model.new() - material = BTAP::Resources::Envelope::Materials::Fenestration::create_blind(model) - assert(!(material.to_Blind.empty?)) - end - - #This method will test the creation of screen - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - def test_create_screen() - model = OpenStudio::Model::Model.new() - material = BTAP::Resources::Envelope::Materials::Fenestration::create_screen(model) - assert(!(material.to_Screen.empty?)) - end - - #This method will test the creation of shade - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - def test_create_shade() - model = OpenStudio::Model::Model.new() - material = BTAP::Resources::Envelope::Materials::Fenestration::create_shade(model) - assert(!(material.to_Shade.empty?)) - end - - end - end # End Test Fenestration - - - # This method creates a OpenStudio::Model::SimpleGlazing material layer - # @author Phylroy A. Lopez <plopez@nrcan.gc.ca> - # @param model [OpenStudio::Model::Model] - # @param name [String] the name of the material. - # @param shgc [Float] solar heat gain coeff. - # @param ufactor [Float] W/m2*K - # @param thickness [Float] m - # @param visible_transmittance [Float] - # @return [OpenStudio::Model::SimpleGlazing] simpleglazing - def self.create_simple_glazing(model, name = "simple glazing test", shgc = 0.10, ufactor = 0.10, thickness = 0.005, visible_transmittance = 0.8) - simpleglazing = OpenStudio::Model::SimpleGlazing.new(model) - simpleglazing.setSolarHeatGainCoefficient(shgc) - simpleglazing.setUFactor(ufactor) - simpleglazing.setThickness(thickness) - simpleglazing.setVisibleTransmittance(visible_transmittance) - simpleglazing.setName(name) - return simpleglazing - end - - - # This method creates a OpenStudio::Model::StandardGlazing material layer - # @author Phylroy A. Lopez <plopez@nrcan.gc.ca> - # @param model [OpenStudio::Model::Model] - # @param name = "Standard Glazing Test", of the material. - # @param thickness [Float] m - # @param conductivity [Float] W/m*K - # @param solarTransmittanceatNormalIncidence [Float] - # @param frontSideSolarReflectanceatNormalIncidence [Float] - # @param backSideSolarReflectanceatNormalIncidence = [Float] - # @param visibleTransmittance [Float] - # @param frontSideVisibleReflectanceatNormalIncidence[Float] - # @param backSideVisibleReflectanceatNormalIncidence [Float] - # @param infraredTransmittanceatNormalIncidence [Float] - # @param frontSideInfraredHemisphericalEmissivity [Float] - # @param backSideInfraredHemisphericalEmissivity [Float] - # @return [OpenStudio::Model::StandardGlazing] stdglazing - def self.create_standard_glazing( - model, - name = "Standard Glazing Test", - thickness = 0.003, - conductivity = 0.9, - solarTransmittanceatNormalIncidence = 0.84, - frontSideSolarReflectanceatNormalIncidence = 0.075, - backSideSolarReflectanceatNormalIncidence = 0.075, - visibleTransmittance = 0.9, - frontSideVisibleReflectanceatNormalIncidence = 0.081, - backSideVisibleReflectanceatNormalIncidence = 0.081, - infraredTransmittanceatNormalIncidence = 0.0, - frontSideInfraredHemisphericalEmissivity = 0.84, - backSideInfraredHemisphericalEmissivity = 0.84, - opticalDataType = "SpectralAverage", - dirt_correction_factor = 1.0, - is_solar_diffusing = false - ) - raise("Roughness Value \"#{roughness}\" is not a part of accepted values: #{OpenStudio::Model::StandardGlazing::opticalDataTypeValues().join(",")}") unless OpenStudio::Model::StandardGlazing::opticalDataTypeValues().include?(opticalDataType) - stdglazing = OpenStudio::Model::StandardGlazing.new(model) - stdglazing.setThickness(thickness.to_f) - stdglazing.setSolarTransmittanceatNormalIncidence(solarTransmittanceatNormalIncidence.to_f) - stdglazing.setFrontSideSolarReflectanceatNormalIncidence(frontSideSolarReflectanceatNormalIncidence.to_f) - stdglazing.setBackSideSolarReflectanceatNormalIncidence(backSideSolarReflectanceatNormalIncidence.to_f) - stdglazing.setVisibleTransmittance(visibleTransmittance.to_f) - stdglazing.setFrontSideVisibleReflectanceatNormalIncidence(frontSideVisibleReflectanceatNormalIncidence.to_f) - stdglazing.setBackSideVisibleReflectanceatNormalIncidence(backSideVisibleReflectanceatNormalIncidence.to_f) - stdglazing.setInfraredTransmittanceatNormalIncidence(infraredTransmittanceatNormalIncidence.to_f) - stdglazing.setFrontSideInfraredHemisphericalEmissivity(frontSideInfraredHemisphericalEmissivity.to_f) - stdglazing.setBackSideInfraredHemisphericalEmissivity(backSideInfraredHemisphericalEmissivity.to_f) - stdglazing.setThermalConductivity(conductivity.to_f) - stdglazing.setName(name) - stdglazing.setOpticalDataType(opticalDataType) - stdglazing.setDirtCorrectionFactorforSolarandVisibleTransmittance(dirt_correction_factor) - stdglazing.setSolarDiffusing(is_solar_diffusing) - return stdglazing - end - - - #This method creates an gas material layer. gas_type can be "Air", "Argon","Krypton","Xenon",or "Custom" - # @author Phylroy A. Lopez <plopez@nrcan.gc.ca> - # @param model [OpenStudio::Model::Model] - # @param name [String] = "air test", of the material. - # @param gas_type [String] = "Air" - # @param thickness [Float] = 0.003 - # @return [OpenStudio::Model::Gas::validGasTypes] gas - def self.create_gas(model, name = "air test", gas_type = "Air", thickness = 0.003) - raise "gas_type #{gas_type} is not part of the allow values: #{OpenStudio::Model::Gas::validGasTypes()}" unless OpenStudio::Model::Gas::validGasTypes().include?(gas_type) - gas = OpenStudio::Model::Gas.new(model) - gas.setGasType(gas_type) - gas.setThickness(thickness) - gas.setName(name) - return gas - end - - - #This method will create a blind layer. - # @author Phylroy A. Lopez <plopez@nrcan.gc.ca> - # @param model [OpenStudio::Model::Model] - # @param name [String] = "blind test" - # @param slatWidth [Float] = 0.1 - # @param slatSeparation [Float] = 0.1 - # @param frontSideSlatBeamSolarReflectance [Float] = 0.1 - # @param backSideSlatBeamSolarReflectance [Float] = 0.1 - # @param frontSideSlatDiffuseSolarReflectance [Float] = 0.1 - # @param backSideSlatDiffuseSolarReflectance [Float] = 0.1 - # @param slatBeamVisibleTransmittance [Float] = 0.1 - # @return [OpenStudio::Model::Blind] blind - def self.create_blind(model, name = "blind test", slatWidth = 0.1, slatSeparation = 0.1, frontSideSlatBeamSolarReflectance = 0.1, backSideSlatBeamSolarReflectance = 0.1, frontSideSlatDiffuseSolarReflectance = 0.1, backSideSlatDiffuseSolarReflectance = 0.1, slatBeamVisibleTransmittance = 0.1) - blind = OpenStudio::Model::Blind.new(model, slatWidth, slatSeparation, frontSideSlatBeamSolarReflectance, backSideSlatBeamSolarReflectance, frontSideSlatDiffuseSolarReflectance, backSideSlatDiffuseSolarReflectance, slatBeamVisibleTransmittance) - blind.setName(name) - return blind - end - - - #This method will create a screen layer. - # @author Phylroy A. Lopez <plopez@nrcan.gc.ca> - # @param model [OpenStudio::Model::Model] - # @param name [String] = "screen test" - # @param diffuseSolarReflectance [Float] = 0.1 - # @param diffuseVisibleReflectance [Float] = 0.1 - # @param screenMaterialSpacing [Float] = 0.1 - # @param screenMaterialDiameter [Float] = 0.1 - # @return [OpenStudio::Model::Screen] screen - def self.create_screen(model, name = "screen test", diffuseSolarReflectance = 0.1, diffuseVisibleReflectance = 0.1, screenMaterialSpacing = 0.1, screenMaterialDiameter = 0.1) - screen = OpenStudio::Model::Screen.new(model, diffuseSolarReflectance, diffuseVisibleReflectance, screenMaterialSpacing, screenMaterialDiameter) - screen.setName(name) - return screen - end - - - #This method will create a shade layer. - # @author Phylroy A. Lopez <plopez@nrcan.gc.ca> - # @param model [OpenStudio::Model::Model] - # @param name [String] = "shade test" - # @param solarTransmittance [Float] = 0.1 - # @param solarReflectance [Float] = 0.1 - # @param visibleTransmittance [Float] = 0.1 - # @param visibleReflectance [Float] = 0.1 - # @param thermalHemisphericalEmissivity [Float] = 0.1 - # @param thermalTransmittance [Float] = 0.1 - # @param thickness [Float] = 0.1 - # @param conductivity [Float] = 0.1 - # @return [OpenStudio::Model::Shade.new] shade - def self.create_shade(model, name = "shade test", solarTransmittance = 0.1, solarReflectance = 0.1, visibleTransmittance = 0.1, visibleReflectance = 0.1, thermalHemisphericalEmissivity = 0.1, thermalTransmittance = 0.1, thickness = 0.1, conductivity = 0.1) - shade = OpenStudio::Model::Shade.new(model, solarTransmittance, solarReflectance, visibleTransmittance, visibleReflectance, thermalHemisphericalEmissivity, thermalTransmittance, thickness, conductivity) - shade.setName(name) - return shade - end - - - end #module Fenestration - - - end #module materials - - #This module contains methods dealing with the creation and modification of constructions. module Constructions #Resources::Envelope::Constructions - - #Test Constructions Module if __FILE__ == $0 require 'test/unit' class ConstructionsTests < Test::Unit::TestCase #This method sets up the model. #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> def setup @model = OpenStudio::Model::Model.new() #Create opaque layers from defaults - @insulation = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(@model, "insulation", 0.1, 0.001, 0.1, 0.1, "Smooth", 0.9, 0.7, 0.7) - @opaque = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(@model) - @air_gap = BTAP::Resources::Envelope::Materials::Opaque::create_air_gap(@model) - @massless = BTAP::Resources::Envelope::Materials::Opaque::create_massless_opaque_material(@model) + @insulation = OpenStudio::Model::StandardOpaqueMaterial.new(@model, 'Smooth', 0.1, 0.001, 0.1, 0.1) + @opaque = OpenStudio::Model::StandardOpaqueMaterial.new(@model, 'Smooth', 0.1, 0.1, 0.1, 100) + @massless = OpenStudio::Model::MasslessOpaqueMaterial.new(@model, 'Smooth', 0.1) #Create fenestration layer from defaults. - @simple = BTAP::Resources::Envelope::Materials::Fenestration::create_simple_glazing(@model) - @standard = BTAP::Resources::Envelope::Materials::Fenestration::create_standard_glazing(@model) - @gas = BTAP::Resources::Envelope::Materials::Fenestration::create_gas(@model) - @blind = BTAP::Resources::Envelope::Materials::Fenestration::create_blind(@model) - @screen = BTAP::Resources::Envelope::Materials::Fenestration::create_screen(@model) - @shade = BTAP::Resources::Envelope::Materials::Fenestration::create_shade(@model) - @opaque_construction = BTAP::Resources::Envelope::Constructions::create_construction(@model, "test construction", [@opaque, @air_gap, @insulation, @massless, @opaque], @insulation) - @fenestration_construction = BTAP::Resources::Envelope::Constructions::create_construction(@model, "test construction", [@simple, @standard], @gas) + @simple = OpenStudio::Model::SimpleGlazing.new(@model, 0.1, 0.1) + @simple.setThickness(0.005) + @simple.setVisibleTransmittance(0.8) + @standard = OpenStudio::Model::StandardGlazing.new(@model, 'SpectralAverage', 0.003) + @opaque_construction = BTAP::Resources::Envelope::Constructions::create_construction(@model, "test construction", [@opaque, @insulation, @massless, @opaque], @insulation) + @fenestration_construction = BTAP::Resources::Envelope::Constructions::create_construction(@model, "test construction", [@simple, @standard]) - array = [@opaque, "insulation", @air_gap] + array = [@opaque, "insulation"] BTAP::Common::validate_array(@model, array, "Material") - end #This method will create a test opaque construction. #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> def test_create_opaque_construction() - construction = BTAP::Resources::Envelope::Constructions::create_construction(@model, "test construction", [@opaque, @air_gap, @insulation, @massless, @opaque], @insulation) + construction = BTAP::Resources::Envelope::Constructions::create_construction(@model, "test construction", [@opaque, @insulation, @massless, @opaque], @insulation) #Check that the construction was created assert(!(construction.to_Construction.empty?)) #check that all layers were entered assert_equal(5, construction.layers.size) #check insulation was set. assert(construction.insulation().get == @insulation) end - #This method will test find and set insulation layer. - # @author Phylroy A. Lopez <plopez@nrcan.gc.ca> - def test_find_and_set_insulation_layer() - construction = BTAP::Resources::Envelope::Constructions::create_construction(@model, "test construction", [@opaque, @air_gap, @insulation, @massless, @opaque]) - - #check insulation was not set. - assert((construction.insulation().empty?)) - #now set it. - BTAP::Resources::Envelope::Constructions::find_and_set_insulation_layer(@model, [construction]) - #Now check that it found the insulation value. - assert(construction.insulation().get == @insulation) - end - #This method will test creation of fenestration construction. #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> def test_create_fenestration_construction() - construction = BTAP::Resources::Envelope::Constructions::create_construction(@model, "test construction", [@simple, @standard, @gas, @blind, @screen, @shade], @gas) + construction = BTAP::Resources::Envelope::Constructions::create_construction(@model, "test construction", [@simple, @standard]) assert_equal(6, construction.layers.size) assert(!(construction.to_Construction.empty?)) end #This method will create new construction based on exisiting. @@ -529,62 +115,15 @@ # opaque new_construction = BTAP::Resources::Envelope::Constructions::customize_opaque_construction(@model, @opaque_construction, 0.05) assert_in_delta(0.05, new_construction.thermalConductance.to_f, 0.00001) # fenestration new_construction = BTAP::Resources::Envelope::Constructions::customize_fenestration_construction(@model, @fenestration_construction, 0.5, nil, nil, 0.0) - assert_in_delta(0.5, Resources::Envelope::Constructions::get_conductance(new_construction).to_f, 0.00001) + assert_in_delta(0.5, OpenstudioStandards::Constructions.construction_get_conductance(new_construction).to_f, 0.00001) end end end # End Test Constructions - #This method will search through the layers and find the layer with the - #lowest conductance and set that as the insulation layer. Note: Concrete walls - #or slabs with no insulation layer but with a carper will see the carpet as the - #insulation layer. - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - #@param model [OpenStudio::Model::Model] - #@param constructions_array [BTAP::Common::validate_array] - #@return <String> insulating_layers - def self.find_and_set_insulation_layer(model, constructions_array) - constructions_array = BTAP::Common::validate_array(model, constructions_array, "Construction") - insulating_layers = Array.new() - constructions_array.each do |construction| - return_material = "" - #skip if already has an insulation layer set. - next unless construction.insulation.empty? - #set insulation layer. - #find insulation layer - min_conductance = 100.0 - #loop through Layers - construction.layers.each do |layer| - #try casting the layer to an OpaqueMaterial. - material = nil - material = layer.to_OpaqueMaterial.get unless layer.to_OpaqueMaterial.empty? - material = layer.to_FenestrationMaterial.get unless layer.to_FenestrationMaterial.empty? - #check if the cast was successful, then find the insulation layer. - unless nil == material - - if BTAP::Resources::Envelope::Materials::get_conductance(material) < min_conductance - #Keep track of the highest thermal resistance value. - min_conductance = BTAP::Resources::Envelope::Materials::get_conductance(material) - return_material = material - unless material.to_OpaqueMaterial.empty? - construction.setInsulation(material) - end - end - end - end - if construction.insulation.empty? and construction.isOpaque - raise ("construction #{construction.name.get.to_s} insulation layer could not be set!. This occurs when a insulation layer is duplicated in the construction.") - end - - insulating_layers << return_material - end - - return insulating_layers - end - #This method will create a new construction based on self and a new conductance value. #It will check to see if a similar construction has already been created by this method #if so it will return the existing construction. If you wish to keep some of the properties, enter the #string "default" instead of a numerical value. #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> @@ -610,18 +149,18 @@ # if so, return existing construction return existing_construction.get end #create a copy - new_construction = self.deep_copy(model, construction) + new_construction = OpenstudioStandards::Constructions.construction_deep_copy(construction) #Change Construction name in clone new_construction.setName(name_prefix) if conductance.kind_of?(Float) #re-find insulation layer - find_and_set_insulation_layer(model, new_construction) + OpenstudioStandards::Constructions.construction_find_and_set_insulation_layer(new_construction) #Determine how low the resistance can be set. Subtract exisiting insulation #Values from the total resistance to see how low we can go. minimum_resistance = (1 / new_construction.thermalConductance.to_f) - (1.0 / new_construction.insulation.get.thermalConductance.to_f) @@ -799,95 +338,10 @@ # If no, then return an unambiguous no. return -999 end end - #This model gets tsol - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - #@param model [OpenStudio::Model::Model] - #@param construction <String> - #@return [Float] tsol - def self.get_shgc(model, construction) - construction = BTAP::Common::validate_array(model, construction, "Construction").first - construction = OpenStudio::Model::getConstructionByName(model, construction.name.to_s).get - tsol = 1.0 - if construction.isFenestration - - construction.layers.each do |layer| - #check to see if it is a simple glazing. If so use the SHGC method. - tsol = tsol * layer.to_SimpleGlazing.get.solarHeatGainCoefficient unless layer.to_SimpleGlazing.empty? - #check to see if it is a standard glazing. If so use the solar transmittance method. - tsol = tsol * layer.to_StandardGlazing.get.solarTransmittance unless layer.to_StandardGlazing.empty? - end - end - return tsol - end - - #This model gets tvis - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - #@param model [OpenStudio::Model::Model] - #@param construction <String> - #@return [Float] tvis - def self.get_tvis(model, construction) - construction = BTAP::Common::validate_array(model, construction, "Construction").first - construction = OpenStudio::Model::getConstructionByName(model, construction.name.to_s).get - tvis = 1.0 - if construction.isFenestration - construction.layers.each do |layer| - #check to see if it is a simple glazing. If so use the SHGC method. - tvis = tvis * layer.to_SimpleGlazing.get.visibleTransmittance.get unless layer.to_SimpleGlazing.empty? || layer.to_SimpleGlazing.get.visibleTransmittance.empty? - #check to see if it is a standard glazing. If so use the solar transmittance method. - tvis = tvis * layer.to_StandardGlazing.get.visibleTransmittanceatNormalIncidence.get unless layer.to_StandardGlazing.empty? || layer.to_StandardGlazing.get.visibleTransmittanceatNormalIncidence.empty? - end - end - return tvis - end - - #this method will get the conductance (metric) of the construction. - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - #@param construction <String> - #@param at_temperature_c [Float] = 0.0 - #@return [Double] 1.0 - def self.get_conductance(construction, at_temperature_c = 0.0) - #if , by accidnet a construction base was passed...convert it to a construction object. - construction = OpenStudio::Model::getConstructionByName(construction.model, construction.name.to_s).get unless construction.to_ConstructionBase.empty? - total = 0.0 - construction.layers.each do |material| - - total = total + 1.0 / BTAP::Resources::Envelope::Materials::get_conductance(material, at_temperature_c) - end - return 1.0 / total - end - - #this method will get the rsi (metric) of the construction. - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - #@param construction <String> - #@param at_temperature_c [Float] = 0.0 - #@return [Double] 1.0 / self.get_conductance(construction, at_temperature_c - def self.get_rsi(construction, at_temperature_c = 0.0) - return 1.0 / self.get_conductance(construction, at_temperature_c) - end - - - #This will create a deep copy of the construction - #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> - #@param model [OpenStudio::Model::Model] - #@param construction <String> - #@return [String] new_construction - def self.deep_copy(model, construction) - construction = BTAP::Common::validate_array(model, construction, "Construction").first - new_construction = construction.clone.to_Construction.get - #interating through layers." - (0..new_construction.layers.length - 1).each do |layernumber| - #cloning material" - cloned_layer = new_construction.getLayer(layernumber).clone.to_Material.get - #"setting material to new construction." - new_construction.setLayer(layernumber, cloned_layer) - end - return new_construction - end - #This will create construction model #@author Phylroy A. Lopez <plopez@nrcan.gc.ca> #@param model [OpenStudio::Model::Model] #@param name <String> #@param materials <Material> @@ -928,13 +382,13 @@ at_temperature_c = 0.0) construction = OpenStudio::Model::getConstructionByName(model, construction.name.to_s).get raise ("This is not a fenestration!") unless construction.isFenestration #get equivilant values for tsol, tvis, and conductances. #TSol in this case is SHGC - solarTransmittanceatNormalIncidence = self.get_shgc(model, construction) if solarTransmittanceatNormalIncidence.nil? - visibleTransmittance = self.get_tvis(model, construction) if visibleTransmittance == nil - conductance = self.get_conductance(construction) if conductance == nil + solarTransmittanceatNormalIncidence = OpenstudioStandards::Constructions.construction_get_solar_transmittance(construction) if solarTransmittanceatNormalIncidence.nil? + visibleTransmittance = OpenstudioStandards::Constructions.construction_get_visible_transmittance(construction) if visibleTransmittance.nil? + conductance = OpenstudioStandards::Constructions.construction_get_conductance(construction) if conductance.nil? frontSideSolarReflectanceatNormalIncidence = 1.0 - solarTransmittanceatNormalIncidence backSideSolarReflectanceatNormalIncidence = 1.0 - solarTransmittanceatNormalIncidence frontSideVisibleReflectanceatNormalIncidence = 0.081000 backSideVisibleReflectanceatNormalIncidence = 0.081000 infraredTransmittanceatNormalIncidence = 0.0 @@ -997,15 +451,12 @@ new_materials_array << glazing new_materials_array.concat(shading_material_array) unless shading_material_array.empty? #puts new_materials_array.size return self.create_construction(construction.model, cons_name, new_materials_array) end - - end #module Constructions - #This module contains methods for creating ConstructionSets. module ConstructionSets #Resources::Envelope::ConstructionSets #Test Constructions Module if __FILE__ == $0 @@ -1015,34 +466,30 @@ #This method creates default surface constructions #@author phylroy.lopez@nrcan.gc.ca def test_create_default_surface_constructions() model = OpenStudio::Model::Model.new() #Create layers from defaults - insulation = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model) - opaque = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model) - air_gap = BTAP::Resources::Envelope::Materials::Opaque::create_air_gap(model) - massless = BTAP::Resources::Envelope::Materials::Opaque::create_massless_opaque_material(model) - construction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [opaque, air_gap, insulation, massless, opaque], insulation) + insulation = OpenStudio::Model::StandardOpaqueMaterial.new(model, 'Smooth', 0.1, 0.001, 0.1, 0.1) + opaque = OpenStudio::Model::StandardOpaqueMaterial.new(model, 'Smooth', 0.1, 0.1, 0.1, 100) + massless = OpenStudio::Model::MasslessOpaqueMaterial.new(model, 'Smooth', 0.1) + construction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [opaque, insulation, massless, opaque], insulation) walls_cons = floor_cons = roof_cons = construction construction_set = BTAP::Resources::Envelope::ConstructionSets::create_default_surface_constructions(model, "test construction set", walls_cons, floor_cons, roof_cons) #Check that the construction was created assert(!(construction_set.to_DefaultSurfaceConstructions.empty?)) end - #This method creates default subsurface constructions #@author phylroy.lopez@nrcan.gc.ca def test_create_default_subsurface_constructions() model = OpenStudio::Model::Model.new() #Create layers from defaults - simple = BTAP::Resources::Envelope::Materials::Fenestration::create_simple_glazing(model) - standard = BTAP::Resources::Envelope::Materials::Fenestration::create_standard_glazing(model) - gas = BTAP::Resources::Envelope::Materials::Fenestration::create_gas(model) - blind = BTAP::Resources::Envelope::Materials::Fenestration::create_blind(model) - screen = BTAP::Resources::Envelope::Materials::Fenestration::create_screen(model) - shade = BTAP::Resources::Envelope::Materials::Fenestration::create_shade(model) - fixedWindowConstruction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [simple, standard, gas, blind, screen, shade], gas) + simple = OpenStudio::Model::SimpleGlazing.new(model, 0.1, 0.1) + simple.setThickness(0.005) + simple.setVisibleTransmittance(0.8) + standard = OpenStudio::Model::StandardGlazing.new(model, 'SpectralAverage', 0.003) + fixedWindowConstruction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [simple, standard]) operableWindowConstruction = setDoorConstruction = setGlassDoorConstruction = overheadDoorConstruction = skylightConstruction = tubularDaylightDomeConstruction = tubularDaylightDiffuserConstruction = fixedWindowConstruction default_subsurface_constructions = BTAP::Resources::Envelope::ConstructionSets::create_subsurface_construction_set( model, fixedWindowConstruction, operableWindowConstruction, @@ -1053,33 +500,29 @@ tubularDaylightDomeConstruction, tubularDaylightDiffuserConstruction) assert(!(default_subsurface_constructions.to_DefaultSubSurfaceConstructions.empty?)) end - #This method creates default constructions #@author phylroy.lopez@nrcan.gc.ca def test_create_default_construction_set() model = OpenStudio::Model::Model.new() #Create layers from defaults - insulation = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model) - opaque = BTAP::Resources::Envelope::Materials::Opaque::create_opaque_material(model) - air_gap = BTAP::Resources::Envelope::Materials::Opaque::create_air_gap(model) - massless = BTAP::Resources::Envelope::Materials::Opaque::create_massless_opaque_material(model) - construction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [opaque, air_gap, insulation, massless, opaque], insulation) + insulation = OpenStudio::Model::StandardOpaqueMaterial.new(model, 'Smooth', 0.1, 0.001, 0.1, 0.1) + opaque = OpenStudio::Model::StandardOpaqueMaterial.new(model, 'Smooth', 0.1, 0.1, 0.1, 100) + massless = OpenStudio::Model::MasslessOpaqueMaterial.new(model, 'Smooth', 0.1) + construction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [opaque, insulation, massless, opaque], insulation) walls_cons = floor_cons = roof_cons = construction exterior_construction_set = BTAP::Resources::Envelope::ConstructionSets::create_default_surface_constructions(model, "test construction set", walls_cons, floor_cons, roof_cons) interior_construction_set = ground_construction_set = exterior_construction_set #Create layers from defaults - simple = BTAP::Resources::Envelope::Materials::Fenestration::create_simple_glazing(model) - standard = BTAP::Resources::Envelope::Materials::Fenestration::create_standard_glazing(model) - gas = BTAP::Resources::Envelope::Materials::Fenestration::create_gas(model) - blind = BTAP::Resources::Envelope::Materials::Fenestration::create_blind(model) - screen = BTAP::Resources::Envelope::Materials::Fenestration::create_screen(model) - shade = BTAP::Resources::Envelope::Materials::Fenestration::create_shade(model) - fixedWindowConstruction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [simple, standard, gas, blind, screen, shade], gas) + simple = OpenStudio::Model::SimpleGlazing.new(model, 0.1, 0.1) + simple.setThickness(0.005) + simple.setVisibleTransmittance(0.8) + standard = OpenStudio::Model::StandardGlazing.new(model, 'SpectralAverage', 0.003) + fixedWindowConstruction = BTAP::Resources::Envelope::Constructions::create_construction(model, "test construction", [simple, standard]) operableWindowConstruction = setDoorConstruction = setGlassDoorConstruction = overheadDoorConstruction = skylightConstruction = tubularDaylightDomeConstruction = tubularDaylightDiffuserConstruction = fixedWindowConstruction ext_subsurface_constructions = BTAP::Resources::Envelope::ConstructionSets::create_subsurface_construction_set( model, fixedWindowConstruction, operableWindowConstruction, @@ -1105,41 +548,39 @@ assert(!(construction_set.to_DefaultConstructionSet.empty?)) end end end - - #This method set the default construction set from an OSM library file and the construction set name. - #params construction_library_file [String] Path to osm file that contains the contruction set to be used. - #params construction_set_name [String] Name of the construction set to be used. + #This method set the default construction set from an OSM library file and the construction set name. + #params construction_library_file [String] Path to osm file that contains the contruction set to be used. + #params construction_set_name [String] Name of the construction set to be used. def self.set_construction_set_by_file(model, construction_library_file, construction_set_name, runner = nil) BTAP::runner_register("Info", "set_construction_set_by_file(#{construction_library_file}, #{construction_set_name})") #check if file exists unless File.exist?(construction_library_file) == true BTAP::runner_register("Error", "Could not find #{construction_library_file}", runner) return false end construction_set = BTAP::Resources::Envelope::ConstructionSets::get_construction_set_from_library(construction_library_file, construction_set_name) - #check if construction set name exists and can apply to the model. + #check if construction set name exists and can apply to the model. 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. + #sets all surfaces to use default constructions except adiabatic, where it does a hard assignment of the interior wall construction type. 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 - #This method customizes default surface construction and sets conductance #@author phylroy.lopez@nrcan.gc.ca #@param model [OpenStudio::Model::Model] #@param name [String] - #@param default_surface_construction_set <String> + #@param default_surface_construction_set <String> #@param ext_wall_cond [Float] = nil #@param ext_floor_cond [Float] = nil #@param ext_roof_cond [Float] = nil #@param ground_wall_cond [Float] = nil #@param ground_floor_cond [Float] = nil @@ -1244,11 +685,10 @@ ) raise ("Could not customize subsurface constructionset") unless default_surface_construction_set.setDefaultExteriorSubSurfaceConstructions(new_ext_subsurface_set) end - #This will remove all associated construction costs for each construction #type associated with the construction set. Unless the value is set to nil, in which case it will do nothing. #@author phylroy.lopez@nrcan.gc.ca #@param default_surface_construction_set <String> #@param ext_wall_cost [Float] = nil @@ -1299,11 +739,10 @@ ["skylight_cost_m3", skylight_cost, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.skylightConstruction.get], ["tubular_daylight_dome_cost_m3", tubular_daylight_dome_cost, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.tubularDaylightDomeConstruction.get], ["tubular_daylight_diffuser_cost_m3", tubular_daylight_diffuser_cost, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.tubularDaylightDiffuserConstruction.get] ] - #Assign cost to each construction. constructions_and_cost.each do |item| unless item[1].nil? item[2].removeLifeCycleCosts() raise("Could not remove LCC info from construction #{item[2]}") unless item[2].lifeCycleCosts.size == 0 @@ -1316,11 +755,10 @@ #create building total construction cost if needed. building = default_surface_construction_set.model.building.get BTAP::Resources::Economics::object_cost(building, "Builing Contruction Set Whole Building Capital Cost", total_building_construction_set_cost, "CostPerEach") end - #This will customize default subsurface construction conductances. #@author phylroy.lopez@nrcan.gc.ca #@param model [OpenStudio::Model::Model] #@param name [String] #@param subsurface_set [Array] @@ -1380,11 +818,10 @@ set.setTubularDaylightDomeConstruction(BTAP::Resources::Envelope::Constructions::customize_fenestration_construction(model, subsurface_set.tubularDaylightDomeConstruction.get, tubular_daylight_dome_conductance, tubular_daylight_dome_solar_trans, tubular_daylight_dome_vis_trans)) set.setTubularDaylightDiffuserConstruction(BTAP::Resources::Envelope::Constructions::customize_fenestration_construction(model, subsurface_set.tubularDaylightDiffuserConstruction.get, tubular_daylight_diffuser_conductance, tubular_daylight_diffuser_solar_trans, tubular_daylight_diffuser_vis_trans)) return set end - #This will customize default surface construction conductance. #@author phylroy.lopez@nrcan.gc.ca #@param model [OpenStudio::Model::Model] #@param name [String] = nil #@param default_surface_constructions [Float] = nil @@ -1400,11 +837,10 @@ set.setWallConstruction(Resources::Envelope::Constructions::customize_opaque_construction(model, default_surface_constructions.wallConstruction.get, wall_conductance)) unless wall_conductance.nil? set.setRoofCeilingConstruction(Resources::Envelope::Constructions::customize_opaque_construction(model, default_surface_constructions.roofCeilingConstruction.get, roof_conductance)) unless roof_conductance.nil? return set end - #This creates a new construction set of wall, floor and roof/ceiling objects. #@author phylroy.lopez@nrcan.gc.ca #@param model [OpenStudio::Model::Model] #@param name [String] = nil #@param wall [Float] = nil @@ -1473,11 +909,11 @@ #@return [Boolean] optional_construction_set def self.get_construction_set_from_library(construction_library_file, construction_set_name) #Load Contruction osm library. if File.exists?(construction_library_file) construction_lib = BTAP::FileIO::load_osm(construction_library_file) - #Get construction set.. + #Get construction set.. optional_construction_set = construction_lib.getDefaultConstructionSetByName(construction_set_name) if optional_construction_set.empty? raise("#{construction_set_name} does not exist in #{construction_library_file} library ") else return optional_construction_set.get @@ -1486,11 +922,10 @@ raise("Error : Construction Lib #{construction_library_file} does not exist!") end return false end - #This method creates a default construction set. A construction set for #exterior, interior,ground and subsurface must be created prior to populate #this object. #@author phylroy.lopez@nrcan.gc.ca #@param model [OpenStudio::Model::Model] @@ -1555,10 +990,10 @@ constructions_and_cost.each do |item| cost_item = OpenStudio::Model::getLifeCycleCostByName(default_surface_construction_set.model, "#{item[0]}_cost_m3") #ensure it exists cost = "NA" cost = cost_item.cost unless cost_item.empty? - rsi = BTAP::Resources::Envelope::Constructions::get_rsi(item[1]) + rsi = 1.0 / OpenstudioStandards::Constructions.construction_get_conductance(item[1]) table << "#{item[0]},#{rsi},#{cost}\n" end return table end end #module ConstructionSet \ No newline at end of file