Module: BTAP::Resources::Envelope

Defined in:
lib/openstudio-standards/btap/envelope.rb

Overview

This module contains methods that relate to Materials, Constructions and Construction Sets

Defined Under Namespace

Modules: ConstructionSets, Constructions, Materials

Class Method Summary collapse

Class Method Details

.assign_interior_surface_construction_to_adiabatic_surfaces(model, runner = nil) ⇒ Object

This method assignes interior surface construction to adiabatic surfaces from model.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

Author:



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/openstudio-standards/btap/envelope.rb', line 70

def self.assign_interior_surface_construction_to_adiabatic_surfaces(model, runner = nil)
  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} " }
      BTAP::runner_register("Warning", "The following adiabatic surfaces have been assigned the construction #{wall_construction.name} : #{name}" , runner)
    end
  else
    BTAP::runner_register("Error", "default constructruction not defined",runner)
    return false
  end
  return true
end

.remove_all_constructions(model) ⇒ Object

This method removes all constructions from model.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

Author:



40
41
42
# File 'lib/openstudio-standards/btap/envelope.rb', line 40

def self.remove_all_constructions( model )
  model.getConstructions().each {|item| item.remove}
end

.remove_all_default_construction_sets(model) ⇒ Object

This method removes all default construction sets from model.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

Author:



61
62
63
64
# File 'lib/openstudio-standards/btap/envelope.rb', line 61

def self.remove_all_default_construction_sets( model )
  model.getDefaultConstructionSets().each { |item| item.remove }
  model.building.get.resetDefaultConstructionSet()
end

.remove_all_default_subsurface_constructions(model) ⇒ Object

This method removes all default subsurface constructions from model.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

Author:



54
55
56
# File 'lib/openstudio-standards/btap/envelope.rb', line 54

def self.remove_all_default_subsurface_constructions( model )
  model.getDefaultSubSurfaceConstructionss().each { |item| item.remove }
end

.remove_all_default_surface_constructions(model) ⇒ Object

This method removes all default surface constructions from model.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

Author:



47
48
49
# File 'lib/openstudio-standards/btap/envelope.rb', line 47

def self.remove_all_default_surface_constructions( model )
  model.getDefaultSurfaceConstructionss().each { |item| item.remove }
end

.remove_all_envelope_information(model) ⇒ Object

This method removes all envelope information from model.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

Author:



102
103
104
105
106
107
108
109
110
111
# File 'lib/openstudio-standards/btap/envelope.rb', line 102

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

.remove_all_materials(model) ⇒ Object

This method removes all materials from model.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

Author:



31
32
33
34
35
# File 'lib/openstudio-standards/btap/envelope.rb', line 31

def self.remove_all_materials( model )
  model.getMaterials().each  do |item|
    item.remove
  end unless model.getMaterials().empty?
end

.remove_all_thermal_mass_definitions(model) ⇒ Object

This method removes all thermal mass definitions from model.

Parameters:

  • model (OpenStudio::model::Model)

    A model object

Author:



94
95
96
97
# File 'lib/openstudio-standards/btap/envelope.rb', line 94

def self.remove_all_thermal_mass_definitions( model )
  model.getInternalMassDefinitions.sort.each { |item| item.remove }
  model.getInternalMasss.sort.each { |item| item.remove }
end

.set_all_surfaces_to_default_construction(model) ⇒ Object



114
115
116
# File 'lib/openstudio-standards/btap/envelope.rb', line 114

def self.set_all_surfaces_to_default_construction( model )
  model.getPlanarSurfaces.sort.each { |item| item.resetConstruction }
end