lib/openstudio-standards/btap/envelope.rb in openstudio-standards-0.1.3 vs lib/openstudio-standards/btap/envelope.rb in openstudio-standards-0.1.4
- old
+ new
@@ -188,11 +188,20 @@
# @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 = 0.1, roughness = "Smooth", thermal_absorptance = 0.9, solar_absorptance = 0.7, visible_absorptance = 0.7 )
+ def self.create_opaque_material( model,
+ name = "opaque material",
+ thickness = 0.1 ,
+ conductivity = 0.1 ,
+ density = 0.1,
+ specific_heat = 0.1,
+ 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 )
@@ -610,18 +619,18 @@
#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)
#Check if the requested resistance is smaller than the minimum
# resistance. If so, use the minimum resistance instead.
- if minimum_resistance > 1 / conductance
+ if minimum_resistance > ( 1 / conductance )
#tell user why we are defaulting and set the conductance of the
# construction.
raise ("could not set conductance of construction #{new_construction.name.to_s} to because existing layers make this impossible. Change the construction to allow for this conductance to be set." + (conductance).to_s + "setting to closest value possible value:" + (1.0 / minimum_resistance).to_s )
# new_construction.setConductance((1.0/minimum_resistance))
else
unless new_construction.setConductance(conductance)
- raise("could not set conductance of construction #{new_construction.name.to_s}")
+ raise("could not set conductance of construction #{new_construction.name.to_s}")
end
end
end
return new_construction
end
@@ -713,11 +722,11 @@
#This will create construction model
#@author Phylroy A. Lopez <plopez@nrcan.gc.ca>
#@param model [OpenStudio::Model::Model]
#@param name <String>
- #@param materials <String>
+ #@param materials <Material>
#@param insulationLayer = nil
#@return [String] construction
def self.create_construction(model, name, materials, insulationLayer = nil)
construction = OpenStudio::Model::Construction.new(model)
construction.setName( name)
@@ -833,10 +842,20 @@
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
+
+ def self.create_default_construction(model, rsi)
+
+ end
+
+ def self.create_default_fenestration(model, rsi)
+
+ end
+
+
end #module Constructions
#This module contains methods for creating ConstructionSets.
@@ -1038,10 +1057,11 @@
ext_surface_set = default_surface_construction_set.defaultExteriorSurfaceConstructions.get
new_ext_surface_set = self.customize_default_surface_constructions_rsi(model, name, ext_surface_set, ext_wall_rsi, ext_floor_rsi, ext_roof_rsi)
raise ("Could not customized exterior constructionset") unless default_surface_construction_set.setDefaultExteriorSurfaceConstructions(new_ext_surface_set)
ground_surface_set = default_surface_construction_set.defaultGroundContactSurfaceConstructions.get
+
new_ground_surface_set = self.customize_default_surface_constructions_rsi(model, name, ground_surface_set, ground_wall_rsi, ground_floor_rsi, ground_roof_rsi)
raise ("Could not customized ground constructionset") unless default_surface_construction_set.setDefaultGroundContactSurfaceConstructions(new_ground_surface_set)
ext_subsurface_set = default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get
new_ext_subsurface_set = self.customize_default_sub_surface_constructions_rsi(
@@ -1055,11 +1075,11 @@
overhead_door_rsi,
skylight_rsi, skylight_solar_trans, skylight_vis_trans,
tubular_daylight_dome_rsi, tubular_daylight_dome_solar_trans, tubular_daylight_dome_vis_trans,
tubular_daylight_diffuser_rsi, tubular_daylight_diffuser_solar_trans, tubular_daylight_diffuser_vis_trans
)
- raise ("Could not customized ground constructionset") unless default_surface_construction_set.setDefaultExteriorSubSurfaceConstructions(new_ext_subsurface_set)
+ 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.
@@ -1274,9 +1294,10 @@
#@param wall_conductance [Float] = nil
#@param floor_conductance [Float] = nil
#@param roof_conductance [Float] = nil
#@return [Object] set
def self.customize_default_surface_constructions_conductance(model,name,default_surface_constructions,wall_conductance = nil, floor_conductance = nil, roof_conductance = nil)
+
set = OpenStudio::Model::DefaultSurfaceConstructions.new(model)
set.setName( name)
set.setFloorConstruction(Resources::Envelope::Constructions::customize_opaque_construction(model, default_surface_constructions.floorConstruction.get, floor_conductance)) unless floor_conductance.nil?
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?
\ No newline at end of file