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

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:



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/openstudio-standards/btap/envelope.rb', line 29

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
      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
    BTAP::runner_register("Error", "default constructruction not defined", runner)
    return false
  end
  return true
end

.remove_all_envelope_information(model) ⇒ Object

This method removes all envelope information from model.

Parameters:

  • model (OpenStudio::Model::Model)

    A model object

Author:



53
54
55
56
57
58
59
60
61
62
63
# File 'lib/openstudio-standards/btap/envelope.rb', line 53

def self.remove_all_envelope_information(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