Module: BTAP::Resources::Envelope::ConstructionSets

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

Overview

This module contains methods for creating ConstructionSets.

Defined Under Namespace

Classes: ConstructionsSetTests

Class Method Summary collapse

Class Method Details

.create_default_construction_set(model, name, exterior_construction_set, interior_construction_set, ground_construction_set, subsurface_exterior_construction_set, subsurface_interior_construction_set) ⇒ Object

This method creates a default construction set. A construction set for exterior, interior,ground and subsurface must be created prior to populate this object.

Parameters:

  • model (OpenStudio::Model::Model)
  • name (String)
  • exterior_construction_set
  • interior_construction_set
  • ground_construction_set
  • subsurface_exterior_construction_set
  • subsurface_interior_construction_set

Returns:

  • (Object)

    set

Author:



939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
# File 'lib/openstudio-standards/btap/envelope.rb', line 939

def self.create_default_construction_set(
    model,
    name,
    exterior_construction_set,
    interior_construction_set,
    ground_construction_set,
    subsurface_exterior_construction_set,
    subsurface_interior_construction_set)
  exterior_construction_set = BTAP::Common::validate_array(model, exterior_construction_set, "DefaultSurfaceConstructions").first
  interior_construction_set = BTAP::Common::validate_array(model, interior_construction_set, "DefaultSurfaceConstructions").first
  ground_construction_set = BTAP::Common::validate_array(model, ground_construction_set, "DefaultSurfaceConstructions").first
  subsurface_exterior_construction_set = BTAP::Common::validate_array(model, subsurface_exterior_construction_set, "DefaultSubSurfaceConstructions").first
  subsurface_interior_construction_set = BTAP::Common::validate_array(model, subsurface_interior_construction_set, "DefaultSubSurfaceConstructions").first


  set = OpenStudio::Model::DefaultConstructionSet.new(model)
  set.setDefaultExteriorSurfaceConstructions(exterior_construction_set) unless exterior_construction_set.nil?
  set.setDefaultGroundContactSurfaceConstructions(ground_construction_set) unless ground_construction_set.nil?
  set.setDefaultInteriorSurfaceConstructions(interior_construction_set) unless interior_construction_set.nil?
  set.setDefaultExteriorSubSurfaceConstructions(subsurface_exterior_construction_set) unless subsurface_exterior_construction_set.nil?
  set.setDefaultInteriorSubSurfaceConstructions(subsurface_interior_construction_set) unless subsurface_interior_construction_set.nil?
  set.setName(name)
  return set
end

.create_default_surface_constructions(model, name, wall, floor, roof) ⇒ Object

This creates a new construction set of wall, floor and roof/ceiling objects.

Parameters:

  • model (OpenStudio::Model::Model)
  • name (String)

    nil

  • wall (Float)

    nil

  • floor (Float)

    nil

  • roof (Float)

    nil

Returns:

  • (Object)

    set

Author:



850
851
852
853
854
855
856
857
858
859
860
# File 'lib/openstudio-standards/btap/envelope.rb', line 850

def self.create_default_surface_constructions(model, name, wall, floor, roof)
  wall = BTAP::Common::validate_array(model, wall, "Construction").first
  floor = BTAP::Common::validate_array(model, floor, "Construction").first
  roof = BTAP::Common::validate_array(model, roof, "Construction").first
  set = OpenStudio::Model::DefaultSurfaceConstructions.new(model)
  set.setFloorConstruction(floor)
  set.setWallConstruction(wall)
  set.setRoofCeilingConstruction(roof)
  set.setName(name)
  return set
end

.create_subsurface_construction_set(model, fixedWindowConstruction, operableWindowConstruction, setDoorConstruction, setGlassDoorConstruction, overheadDoorConstruction, skylightConstruction, tubularDaylightDomeConstruction, tubularDaylightDiffuserConstruction) ⇒ Object

This method creates a subsurface construction set (windows, doors, skylights, etc)

Parameters:

  • model (OpenStudio::Model::Model)
  • fixedWindowConstruction (String)
  • operableWindowConstruction (String)
  • setDoorConstruction (String)
  • setGlassDoorConstruction (String)
  • overheadDoorConstruction (String)
  • skylightConstruction (String)
  • tubularDaylightDomeConstruction (String)
  • tubularDaylightDiffuserConstruction (String)

Returns:

  • (Object)

    set

Author:



874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
# File 'lib/openstudio-standards/btap/envelope.rb', line 874

def self.create_subsurface_construction_set(
    model,
    fixedWindowConstruction,
    operableWindowConstruction,
    setDoorConstruction,
    setGlassDoorConstruction,
    overheadDoorConstruction,
    skylightConstruction,
    tubularDaylightDomeConstruction,
    tubularDaylightDiffuserConstruction)
  fixedWindowConstruction = BTAP::Common::validate_array(model, fixedWindowConstruction, "Construction").first
  operableWindowConstruction = BTAP::Common::validate_array(model, operableWindowConstruction, "Construction").first
  setDoorConstruction = BTAP::Common::validate_array(model, setDoorConstruction, "Construction").first
  setGlassDoorConstruction = BTAP::Common::validate_array(model, setGlassDoorConstruction, "Construction").first
  overheadDoorConstruction = BTAP::Common::validate_array(model, overheadDoorConstruction, "Construction").first
  skylightConstruction = BTAP::Common::validate_array(model, skylightConstruction, "Construction").first
  tubularDaylightDomeConstruction = BTAP::Common::validate_array(model, tubularDaylightDomeConstruction, "Construction").first
  tubularDaylightDiffuserConstruction = BTAP::Common::validate_array(model, tubularDaylightDiffuserConstruction, "Construction").first

  set = OpenStudio::Model::DefaultSubSurfaceConstructions.new(model)
  set.setFixedWindowConstruction(fixedWindowConstruction) unless fixedWindowConstruction.nil?
  set.setOperableWindowConstruction(operableWindowConstruction) unless operableWindowConstruction.nil?
  set.setDoorConstruction(setDoorConstruction) unless setDoorConstruction.nil?
  set.setGlassDoorConstruction(setGlassDoorConstruction) unless setGlassDoorConstruction.nil?
  set.setOverheadDoorConstruction(overheadDoorConstruction) unless overheadDoorConstruction.nil?
  set.setSkylightConstruction(skylightConstruction) unless skylightConstruction.nil?
  set.setTubularDaylightDomeConstruction(tubularDaylightDomeConstruction) unless tubularDaylightDomeConstruction.nil?
  set.setTubularDaylightDiffuserConstruction(tubularDaylightDiffuserConstruction) unless tubularDaylightDiffuserConstruction.nil?
  return set
end

.customize_default_sub_surface_constructions_conductance(model:, name:, subsurface_set:, fixed_window_conductance: nil, fixed_wind_solar_trans: nil, fixed_wind_vis_trans: nil, operable_window_conductance: nil, operable_wind_solar_trans: nil, operable_wind_vis_trans: nil, door_construction_conductance: nil, glass_door_conductance: nil, glass_door_solar_trans: nil, glass_door_vis_trans: nil, overhead_door_conductance: nil, skylight_conductance: nil, skylight_solar_trans: nil, skylight_vis_trans: nil, tubular_daylight_dome_conductance: nil, tubular_daylight_dome_solar_trans: nil, tubular_daylight_dome_vis_trans: nil, tubular_daylight_diffuser_conductance: nil, tubular_daylight_diffuser_solar_trans: nil, tubular_daylight_diffuser_vis_trans: nil) ⇒ Object

This will customize default subsurface construction conductances.

Parameters:

  • model (OpenStudio::Model::Model)
  • name (String)
  • subsurface_set (Array)
  • fixed_window_conductance (Float) (defaults to: nil)

    nil

  • fixed_wind_solar_trans (Float) (defaults to: nil)

    nil

  • fixed_wind_vis_trans (Float) (defaults to: nil)

    nil

  • operable_window_conductance (Float) (defaults to: nil)

    nil

  • operable_wind_solar_trans (Float) (defaults to: nil)

    nil

  • operable_wind_vis_trans (Float) (defaults to: nil)

    nil

  • door_construction_conductance (Float) (defaults to: nil)

    nil

  • glass_door_conductance (Float) (defaults to: nil)

    nil

  • glass_door_solar_trans (Float) (defaults to: nil)

    nil

  • glass_door_vis_trans (Float) (defaults to: nil)

    nil

  • overhead_door_conductance (Float) (defaults to: nil)

    nil

  • skylight_conductance (Float) (defaults to: nil)

    nil

  • skylight_solar_trans (Float) (defaults to: nil)

    nil

  • skylight_vis_trans (Float) (defaults to: nil)

    nil

  • tubular_daylight_dome_conductance (Float) (defaults to: nil)

    nil

  • tubular_daylight_dome_solar_trans (Float) (defaults to: nil)

    nil

  • tubular_daylight_dome_vis_trans (Float) (defaults to: nil)

    nil

  • tubular_daylight_diffuser_conductance (Float) (defaults to: nil)

    nil

  • tubular_daylight_diffuser_solar_trans (Float) (defaults to: nil)

    nil

  • tubular_daylight_diffuser_vis_trans (Float) (defaults to: nil)

    nil

Returns:

  • (Object)

    set

Author:



786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
# File 'lib/openstudio-standards/btap/envelope.rb', line 786

def self.customize_default_sub_surface_constructions_conductance(
    model:,
    name:,
    subsurface_set:,
    fixed_window_conductance: nil,
    fixed_wind_solar_trans: nil,
    fixed_wind_vis_trans: nil,
    operable_window_conductance: nil,
    operable_wind_solar_trans: nil,
    operable_wind_vis_trans: nil,
    door_construction_conductance: nil,
    glass_door_conductance: nil,
    glass_door_solar_trans: nil,
    glass_door_vis_trans: nil,
    overhead_door_conductance: nil,
    skylight_conductance: nil,
    skylight_solar_trans: nil,
    skylight_vis_trans: nil,
    tubular_daylight_dome_conductance: nil,
    tubular_daylight_dome_solar_trans: nil,
    tubular_daylight_dome_vis_trans: nil,
    tubular_daylight_diffuser_conductance: nil,
    tubular_daylight_diffuser_solar_trans: nil, tubular_daylight_diffuser_vis_trans: nil
)
  set = OpenStudio::Model::DefaultSubSurfaceConstructions.new(model)
  set.setName(name)
  set.setFixedWindowConstruction(BTAP::Resources::Envelope::Constructions::customize_fenestration_construction(model, subsurface_set.fixedWindowConstruction.get, fixed_window_conductance, fixed_wind_solar_trans, fixed_wind_vis_trans))
  set.setOperableWindowConstruction(BTAP::Resources::Envelope::Constructions::customize_fenestration_construction(model, subsurface_set.operableWindowConstruction.get, operable_window_conductance, operable_wind_solar_trans, operable_wind_vis_trans))
  set.setDoorConstruction(BTAP::Resources::Envelope::Constructions::customize_opaque_construction(model, subsurface_set.doorConstruction.get, door_construction_conductance))
  set.setGlassDoorConstruction(BTAP::Resources::Envelope::Constructions::customize_fenestration_construction(model, subsurface_set.glassDoorConstruction.get, glass_door_conductance, glass_door_solar_trans, glass_door_vis_trans))
  set.setOverheadDoorConstruction(BTAP::Resources::Envelope::Constructions::customize_opaque_construction(model, subsurface_set.overheadDoorConstruction.get, overhead_door_conductance))
  set.setSkylightConstruction(BTAP::Resources::Envelope::Constructions::customize_fenestration_construction(model, subsurface_set.skylightConstruction.get, skylight_conductance, skylight_solar_trans, skylight_vis_trans))
  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

.customize_default_surface_construction_set!(model:, name:, default_surface_construction_set:, ext_wall_cond: nil, ext_floor_cond: nil, ext_roof_cond: nil, ground_wall_cond: nil, ground_floor_cond: nil, ground_roof_cond: nil, fixed_window_cond: nil, fixed_wind_solar_trans: nil, fixed_wind_vis_trans: nil, operable_wind_solar_trans: nil, operable_window_cond: nil, operable_wind_vis_trans: nil, glass_door_cond: nil, glass_door_solar_trans: nil, glass_door_vis_trans: nil, door_construction_cond: nil, overhead_door_cond: nil, skylight_cond: nil, skylight_solar_trans: nil, skylight_vis_trans: nil, tubular_daylight_dome_cond: nil, tubular_daylight_dome_solar_trans: nil, tubular_daylight_dome_vis_trans: nil, tubular_daylight_diffuser_cond: nil, tubular_daylight_diffuser_solar_trans: nil, tubular_daylight_diffuser_vis_trans: nil) ⇒ Object

This method customizes default surface construction and sets conductance

Parameters:

  • model (OpenStudio::Model::Model)
  • name (String)
  • default_surface_construction_set (String)
  • ext_wall_cond (Float) (defaults to: nil)

    nil

  • ext_floor_cond (Float) (defaults to: nil)

    nil

  • ext_roof_cond (Float) (defaults to: nil)

    nil

  • ground_wall_cond (Float) (defaults to: nil)

    nil

  • ground_floor_cond (Float) (defaults to: nil)

    nil

  • ground_roof_cond (Float) (defaults to: nil)

    nil

  • fixed_window_cond (Float) (defaults to: nil)

    nil

  • fixed_wind_solar_trans (Float) (defaults to: nil)

    nil

  • fixed_wind_vis_trans (Float) (defaults to: nil)

    nil

  • operable_window_cond (Float) (defaults to: nil)

    nil

  • operable_wind_solar_trans (Float) (defaults to: nil)

    nil

  • operable_wind_vis_trans (Float) (defaults to: nil)

    nil

  • door_construction_cond (Float) (defaults to: nil)

    nil

  • glass_door_cond (Float) (defaults to: nil)

    nil

  • glass_door_solar_trans (Float) (defaults to: nil)

    nil

  • glass_door_vis_trans (Float) (defaults to: nil)

    nil

  • overhead_door_cond (Float) (defaults to: nil)

    nil

  • skylight_cond (Float) (defaults to: nil)

    nil

  • skylight_solar_trans (Float) (defaults to: nil)

    nil

  • skylight_vis_trans (Float) (defaults to: nil)

    nil,

  • tubular_daylight_dome_cond (Float) (defaults to: nil)

    nil

  • tubular_daylight_dome_solar_trans (Float) (defaults to: nil)

    nil

  • tubular_daylight_dome_vis_trans (Float) (defaults to: nil)

    nil,

  • tubular_daylight_diffuser_cond (Float) (defaults to: nil)

    nil

  • tubular_daylight_diffuser_solar_trans (Float) (defaults to: nil)

    nil

  • tubular_daylight_diffuser_vis_trans (Float) (defaults to: nil)

    nil

Author:



608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
# File 'lib/openstudio-standards/btap/envelope.rb', line 608

def self.customize_default_surface_construction_set!(model:,
                                                     name:,
                                                     default_surface_construction_set:,
                                                     # ext surfaces
                                                     ext_wall_cond: nil,
                                                     ext_floor_cond: nil,
                                                     ext_roof_cond: nil,
                                                     # ground surfaces
                                                     ground_wall_cond: nil,
                                                     ground_floor_cond: nil,
                                                     ground_roof_cond: nil,
                                                     # fixed Windows
                                                     fixed_window_cond: nil,
                                                     fixed_wind_solar_trans: nil,
                                                     fixed_wind_vis_trans: nil,
                                                     # operable windows
                                                     operable_wind_solar_trans: nil,
                                                     operable_window_cond: nil,
                                                     operable_wind_vis_trans: nil,
                                                     # glass doors
                                                     glass_door_cond: nil,
                                                     glass_door_solar_trans: nil,
                                                     glass_door_vis_trans: nil,
                                                     # opaque doors
                                                     door_construction_cond: nil,
                                                     overhead_door_cond: nil,
                                                     # skylights
                                                     skylight_cond: nil,
                                                     skylight_solar_trans: nil,
                                                     skylight_vis_trans: nil,
                                                     # tubular daylight dome
                                                     tubular_daylight_dome_cond: nil,
                                                     tubular_daylight_dome_solar_trans: nil,
                                                     tubular_daylight_dome_vis_trans: nil,
                                                     # tubular daylight diffuser
                                                     tubular_daylight_diffuser_cond: nil,
                                                     tubular_daylight_diffuser_solar_trans: nil,
                                                     tubular_daylight_diffuser_vis_trans: nil
)

  #Change name if required.
  default_surface_construction_set.setName(name) unless name.nil?
  ext_surface_set = default_surface_construction_set.defaultExteriorSurfaceConstructions.get
  new_ext_surface_set = self.customize_default_surface_constructions_conductance(model, name, ext_surface_set, ext_wall_cond, ext_floor_cond, ext_roof_cond)
  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_conductance(model, name, ground_surface_set, ground_wall_cond, ground_floor_cond, ground_roof_cond)
  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_conductance(
      model: model,
      name: name,
      subsurface_set: ext_subsurface_set,
      fixed_window_conductance: fixed_window_cond,
      fixed_wind_vis_trans: fixed_wind_vis_trans,
      fixed_wind_solar_trans: fixed_wind_solar_trans,
      operable_window_conductance: operable_window_cond,
      operable_wind_solar_trans: operable_wind_solar_trans,
      operable_wind_vis_trans: operable_wind_vis_trans,
      glass_door_conductance: glass_door_cond,
      glass_door_solar_trans: glass_door_solar_trans,
      glass_door_vis_trans: glass_door_vis_trans,
      skylight_conductance: skylight_cond,
      skylight_solar_trans: skylight_solar_trans,
      skylight_vis_trans: skylight_vis_trans,
      tubular_daylight_dome_conductance: tubular_daylight_dome_cond,
      tubular_daylight_dome_solar_trans: tubular_daylight_dome_solar_trans,
      tubular_daylight_dome_vis_trans: tubular_daylight_dome_vis_trans,
      tubular_daylight_diffuser_conductance: tubular_daylight_diffuser_cond,
      tubular_daylight_diffuser_solar_trans: tubular_daylight_diffuser_solar_trans,
      tubular_daylight_diffuser_vis_trans: tubular_daylight_diffuser_vis_trans,
      door_construction_conductance: door_construction_cond,
      overhead_door_conductance: overhead_door_cond,
  )
  raise ("Could not customize subsurface constructionset") unless default_surface_construction_set.setDefaultExteriorSubSurfaceConstructions(new_ext_subsurface_set)

end

.customize_default_surface_construction_set_costs(default_surface_construction_set, ext_wall_cost = nil, ext_floor_cost = nil, ext_roof_cost = nil, ground_wall_cost = nil, ground_floor_cost = nil, ground_roof_cost = nil, fixed_window_cost = nil, operable_window_cost = nil, door_construction_cost = nil, glass_door_cost = nil, overhead_door_cost = nil, skylight_cost = nil, tubular_daylight_dome_cost = nil, tubular_daylight_diffuser_cost = nil, total_building_construction_set_cost = nil) ⇒ Object

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.

Parameters:

  • default_surface_construction_set (String)
  • ext_wall_cost (Float) (defaults to: nil)

    nil

  • ext_floor_cost (Float) (defaults to: nil)

    nil

  • ext_roof_cost (Float) (defaults to: nil)

    nil

  • ground_wall_cost (Float) (defaults to: nil)

    nil

  • ground_floor_cost (Float) (defaults to: nil)

    nil

  • ground_roof_cost (Float) (defaults to: nil)

    nil

  • fixed_window_cost (Float) (defaults to: nil)

    nil

  • operable_window_cost (Float) (defaults to: nil)

    nil

  • door_construction_cost (Float) (defaults to: nil)

    nil

  • glass_door_cost (Float) (defaults to: nil)

    nil

  • overhead_door_cost (Float) (defaults to: nil)

    nil

  • skylight_cost (Float) (defaults to: nil)

    nil

  • tubular_daylight_dome_cost (Float) (defaults to: nil)

    nil

  • tubular_daylight_diffuser_cost (Float) (defaults to: nil)

    nil

  • total_building_construction_set_cost (Float) (defaults to: nil)

    nil

Author:



709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
# File 'lib/openstudio-standards/btap/envelope.rb', line 709

def self.customize_default_surface_construction_set_costs(default_surface_construction_set,
                                                          ext_wall_cost = nil,
                                                          ext_floor_cost = nil,
                                                          ext_roof_cost = nil,
                                                          ground_wall_cost = nil,
                                                          ground_floor_cost = nil,
                                                          ground_roof_cost = nil,
                                                          fixed_window_cost = nil,
                                                          operable_window_cost = nil,
                                                          door_construction_cost = nil,
                                                          glass_door_cost = nil,
                                                          overhead_door_cost = nil,
                                                          skylight_cost = nil,
                                                          tubular_daylight_dome_cost = nil,
                                                          tubular_daylight_diffuser_cost = nil,
                                                          total_building_construction_set_cost = nil
)

  constructions_and_cost = [
      ["ext_wall_cost_m3", ext_wall_cost, default_surface_construction_set.defaultExteriorSurfaceConstructions.get.wallConstruction.get],
      ["ext_floor_cost_m3", ext_floor_cost, default_surface_construction_set.defaultExteriorSurfaceConstructions.get.floorConstruction.get],
      ["ext_roof_cost_m3", ext_roof_cost, default_surface_construction_set.defaultExteriorSurfaceConstructions.get.roofCeilingConstruction.get],
      ["ground_wall_cost_m3", ground_wall_cost, default_surface_construction_set.defaultGroundContactSurfaceConstructions.get.wallConstruction.get],
      ["ground_floor_cost_m3", ground_floor_cost, default_surface_construction_set.defaultGroundContactSurfaceConstructions.get.floorConstruction.get],
      ["ground_roof_cost_m3", ground_roof_cost, default_surface_construction_set.defaultGroundContactSurfaceConstructions.get.roofCeilingConstruction.get],
      ["fixed_window_cost_m3", fixed_window_cost, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.fixedWindowConstruction.get],
      ["operable_window_cost_m3", operable_window_cost, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.operableWindowConstruction.get],
      ["door_construction_cost_m3", door_construction_cost, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.doorConstruction.get],
      ["glass_door_cost_m3", glass_door_cost, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.glassDoorConstruction.get],
      ["overhead_door_cost_m3", overhead_door_cost, default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.overheadDoorConstruction.get],
      ["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
      construction_cost_object = OpenStudio::Model::LifeCycleCost.new(item[2])
      construction_cost_object.setName(item[0])
      construction_cost_object.setCost(item[1])
      construction_cost_object.setCostUnits("CostPerArea")
    end
  end
  #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

.customize_default_surface_constructions_conductance(model, name, default_surface_constructions, wall_conductance = nil, floor_conductance = nil, roof_conductance = nil) ⇒ Object

This will customize default surface construction conductance.

Parameters:

  • model (OpenStudio::Model::Model)
  • name (String)

    nil

  • default_surface_constructions (Float)

    nil

  • wall_conductance (Float) (defaults to: nil)

    nil

  • floor_conductance (Float) (defaults to: nil)

    nil

  • roof_conductance (Float) (defaults to: nil)

    nil

Returns:

  • (Object)

    set

Author:



832
833
834
835
836
837
838
839
840
# File 'lib/openstudio-standards/btap/envelope.rb', line 832

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?
  return set
end

.get_construction_set_from_library(construction_library_file, construction_set_name) ⇒ Boolean

This method gets construction set object from external library

Parameters:

  • construction_library_file (String)
  • construction_set_name (String)

Returns:

  • (Boolean)

    optional_construction_set

Author:



910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
# File 'lib/openstudio-standards/btap/envelope.rb', line 910

def self.get_construction_set_from_library(construction_library_file, construction_set_name)
  #Load Contruction osm library.
  if File.exist?(construction_library_file)
    construction_lib = BTAP::FileIO::load_osm(construction_library_file)
    #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
    end
  else
    raise("Error : Construction Lib #{construction_library_file} does not exist!")
  end
  return false
end

.get_construction_set_info(default_surface_construction_set) ⇒ String

This method creates a default construction set. A construction set for exterior, interior,ground and subsurface must be created prior to populate this object.

Parameters:

  • default_surface_construction_set (Object)

Returns:

Author:



970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
# File 'lib/openstudio-standards/btap/envelope.rb', line 970

def self.get_construction_set_info(default_surface_construction_set)
  #######################
  constructions_and_cost = [
      ["ext_wall", default_surface_construction_set.defaultExteriorSurfaceConstructions.get.wallConstruction.get],
      ["ext_floor", default_surface_construction_set.defaultExteriorSurfaceConstructions.get.floorConstruction.get],
      ["ext_roof", default_surface_construction_set.defaultExteriorSurfaceConstructions.get.roofCeilingConstruction.get],
      ["ground_wall", default_surface_construction_set.defaultGroundContactSurfaceConstructions.get.wallConstruction.get],
      ["ground_floor", default_surface_construction_set.defaultGroundContactSurfaceConstructions.get.floorConstruction.get],
      ["ground_roof", default_surface_construction_set.defaultGroundContactSurfaceConstructions.get.roofCeilingConstruction.get],
      ["fixed_window", default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.fixedWindowConstruction.get],
      ["operable_window", default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.operableWindowConstruction.get],
      ["door_construction", default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.doorConstruction.get],
      ["glass_door", default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.glassDoorConstruction.get],
      ["overhead_door", default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.overheadDoorConstruction.get],
      ["skylight", default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.skylightConstruction.get],
      ["tubular_daylight_dome", default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.tubularDaylightDomeConstruction.get],
      ["tubular_daylight_diffuser", default_surface_construction_set.defaultExteriorSubSurfaceConstructions.get.tubularDaylightDiffuserConstruction.get]
  ]
  default_surface_construction_set.name
  table = "construction,rsi,cost_m3\n"
  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 = 1.0 / OpenstudioStandards::Constructions.construction_get_conductance(item[1])
    table << "#{item[0]},#{rsi},#{cost}\n"
  end
  return table
end

.set_construction_set_by_file(model, construction_library_file, construction_set_name, runner = nil) ⇒ Object

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.



556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
# File 'lib/openstudio-standards/btap/envelope.rb', line 556

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.
  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.
  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