Class: BuildingSync::EnvelopeSystem

Inherits:
BuildingSystem show all
Defined in:
lib/buildingsync/model_articulation/envelope_system.rb

Overview

EnvelopeSystem class

Instance Method Summary collapse

Methods included from XmlGetSet

#get_prefix, #xget_attribute_for_element, #xget_element, #xget_id, #xget_idrefs, #xget_linked_premises, #xget_name, #xget_or_create, #xget_plurals_text_value, #xget_text, #xget_text_as_bool, #xget_text_as_date, #xget_text_as_dt, #xget_text_as_float, #xget_text_as_integer, #xset_or_create, #xset_text

Methods included from Helper

#help_calculate_hours, #help_convert, #help_count_number_of_days, #help_element_class_type_check, #help_get_attribute_value, #help_get_default_schedule_set, #help_get_duration, #help_get_end_time, #help_get_end_time_sat, #help_get_end_time_sun, #help_get_end_time_weekday, #help_get_or_create, #help_get_schedule_rule_set_from_schedule, #help_get_start_time, #help_get_start_time_sat, #help_get_start_time_sun, #help_get_start_time_weekday, #help_get_text_value, #help_get_text_value_as_bool, #help_get_text_value_as_date, #help_get_text_value_as_datetime, #help_get_text_value_as_float, #help_get_text_value_as_integer, #help_get_zone_name_list, #help_load_doc, #help_print_all_schedules, #help_print_schedule, #help_write_profile

Constructor Details

#initializeEnvelopeSystem

initialize



44
45
46
# File 'lib/buildingsync/model_articulation/envelope_system.rb', line 44

def initialize
  # code to initialize
end

Instance Method Details

#create(model, standard, primary_bldg_type, lookup_building_type, remove_objects) ⇒ Boolean

add internal loads from standard definitions

Parameters:

  • model (OpenStudio::Model)
  • standard (Standard)
  • primary_bldg_type (String)
  • lookup_building_type (String)
  • remove_objects (Boolean)

Returns:

  • (Boolean)


55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/buildingsync/model_articulation/envelope_system.rb', line 55

def create(model, standard, primary_bldg_type, lookup_building_type, remove_objects)
  # remove default construction sets
  if remove_objects
    model.getDefaultConstructionSets.each(&:remove)
  end

  # TODO: - allow building type and space type specific constructions set selection.
  if ['SmallHotel', 'LargeHotel', 'MidriseApartment', 'HighriseApartment'].include?(primary_bldg_type)
    is_residential = 'Yes'
  else
    is_residential = 'No'
  end
  climate_zone = standard.model_get_building_climate_zone_and_building_type(model)['climate_zone']
  OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.Facility.create_building_system', 'Could not find climate zone in the model. Verify that the climate zone is set in the BuildingSync File or can be derived from other inputs.') if climate_zone.nil?
  bldg_def_const_set = standard.model_add_construction_set(model, climate_zone, lookup_building_type, nil, is_residential)
  if bldg_def_const_set.is_initialized
    bldg_def_const_set = bldg_def_const_set.get
    if is_residential then bldg_def_const_set.setName("Res #{bldg_def_const_set.name}") end
    model.getBuilding.setDefaultConstructionSet(bldg_def_const_set)
    OpenStudio.logFree(OpenStudio::Info, 'BuildingSync.Facility.create_building_system', "Adding default construction set named #{bldg_def_const_set.name}")
    puts "Adding default construction set named #{bldg_def_const_set.name} in climate zone #{climate_zone}"
  else
    OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.Facility.create_building_system', "Could not create default construction set for the building type #{lookup_building_type} in climate zone #{climate_zone}.")
    return false
  end

  # address any adiabatic surfaces that don't have hard assigned constructions
  model.getSurfaces.each do |surface|
    next if surface.outsideBoundaryCondition != 'Adiabatic'
    next if surface.construction.is_initialized

    surface.setAdjacentSurface(surface)
    surface.setConstruction(surface.construction.get)
    surface.setOutsideBoundaryCondition('Adiabatic')
  end

  # Modify the infiltration rates
  if remove_objects
    model.getSpaceInfiltrationDesignFlowRates.each(&:remove)
  end
  standard.model_apply_infiltration_standard(model)
  standard.model_modify_infiltration_coefficients(model, primary_bldg_type, climate_zone)

  # set ground temperatures from DOE prototype buildings
  standard.model_add_ground_temperatures(model, primary_bldg_type, climate_zone)
end