honeybee-openstudio 2.22.0 → 2.22.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/honeybee-openstudio.gemspec +4 -4
- data/lib/files/urbanopt_Gemfile +1 -1
- data/lib/from_openstudio/construction/air.rb +2 -2
- data/lib/from_openstudio/construction/opaque.rb +2 -2
- data/lib/from_openstudio/construction/shade.rb +1 -1
- data/lib/from_openstudio/construction/window.rb +2 -2
- data/lib/from_openstudio/construction_set.rb +14 -14
- data/lib/from_openstudio/geometry/aperture.rb +1 -1
- data/lib/from_openstudio/geometry/door.rb +1 -1
- data/lib/from_openstudio/geometry/face.rb +1 -1
- data/lib/from_openstudio/geometry/room.rb +1 -1
- data/lib/from_openstudio/geometry/shade.rb +1 -1
- data/lib/from_openstudio/material/opaque.rb +1 -1
- data/lib/from_openstudio/material/opaque_no_mass.rb +1 -1
- data/lib/from_openstudio/material/window_blind.rb +1 -1
- data/lib/from_openstudio/material/window_gas.rb +1 -1
- data/lib/from_openstudio/material/window_gas_custom.rb +1 -1
- data/lib/from_openstudio/material/window_gas_mixture.rb +1 -1
- data/lib/from_openstudio/material/window_glazing.rb +1 -1
- data/lib/from_openstudio/material/window_simpleglazsys.rb +1 -1
- data/lib/honeybee/model_object.rb +14 -1
- data/lib/to_openstudio/geometry/face.rb +1 -1
- data/lib/to_openstudio/geometry/room.rb +4 -2
- data/lib/to_openstudio/ventcool/opening.rb +51 -25
- metadata +8 -8
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f8767065c98f72114b89b1d16304efe93ca0003a357f647954b0beed6989b1ec
         | 
| 4 | 
            +
              data.tar.gz: 1ed4757de90face39cbc8309e45d5e1a872288bab0f9240da9a9d4b8db18dada
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: '0925da969e4768649654327dd2574ab5cd4caec284ae804c42ae7fb772e139aae63d852a52b1406fb81e1c6db0fa1658f170c29389614bf0e3cc4d4054a428d4'
         | 
| 7 | 
            +
              data.tar.gz: '091488d2fa18fa7f06452c43fea7d6559fdaa8591f04c9b5fa8732d65b0119e39aa789ba2c82ce806b5346aceabc44423ecd9c5d103d9f2cbb3d31e615f1e4d6'
         | 
    
        data/Gemfile
    CHANGED
    
    | @@ -7,7 +7,7 @@ gemspec | |
| 7 7 | 
             
            if File.exist?('../OpenStudio-extension-gem')  # local development copy
         | 
| 8 8 | 
             
              gem 'openstudio-extension', path: '../OpenStudio-extension-gem'
         | 
| 9 9 | 
             
            else  # get it from rubygems.org
         | 
| 10 | 
            -
              gem 'openstudio-extension', '0.4. | 
| 10 | 
            +
              gem 'openstudio-extension', '0.4.3'
         | 
| 11 11 | 
             
            end
         | 
| 12 12 |  | 
| 13 13 | 
             
            # coveralls gem is used to generate coverage reports through CI
         | 
    
        data/honeybee-openstudio.gemspec
    CHANGED
    
    | @@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) | |
| 4 4 |  | 
| 5 5 | 
             
            Gem::Specification.new do |spec|
         | 
| 6 6 | 
             
              spec.name          = 'honeybee-openstudio'
         | 
| 7 | 
            -
              spec.version       = '2.22. | 
| 7 | 
            +
              spec.version       = '2.22.4'
         | 
| 8 8 | 
             
              spec.authors       = ['Tanushree Charan', 'Dan Macumber', 'Chris Mackey', 'Mostapha Sadeghipour Roudsari']
         | 
| 9 9 | 
             
              spec.email         = ['tanushree.charan@nrel.gov', 'chris@ladybug.tools']
         | 
| 10 10 |  | 
| @@ -29,10 +29,10 @@ Gem::Specification.new do |spec| | |
| 29 29 | 
             
                spec.add_development_dependency "json-schema",    "~> 2.8.1"
         | 
| 30 30 | 
             
                spec.add_development_dependency "rake",           "~> 13.0"
         | 
| 31 31 | 
             
                spec.add_development_dependency "rspec",          "~> 3.9"
         | 
| 32 | 
            -
                spec.add_development_dependency "rubocop",        "~>  | 
| 32 | 
            +
                spec.add_development_dependency "rubocop",        "~> 1.15.0"
         | 
| 33 33 | 
             
              end
         | 
| 34 34 |  | 
| 35 35 | 
             
              spec.add_dependency 'json_pure'
         | 
| 36 | 
            -
              spec.add_dependency 'openstudio-extension', '0.4. | 
| 37 | 
            -
              spec.add_dependency 'openstudio-standards', '~> 0.2. | 
| 36 | 
            +
              spec.add_dependency 'openstudio-extension', '0.4.3'
         | 
| 37 | 
            +
              spec.add_dependency 'openstudio-standards', '~> 0.2.14'
         | 
| 38 38 | 
             
            end
         | 
    
        data/lib/files/urbanopt_Gemfile
    CHANGED
    
    
| @@ -40,11 +40,11 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'AirBoundaryConstructionAbridged'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = construction.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(construction.nameString)
         | 
| 44 44 | 
             
                    # check if boost optional object is empty
         | 
| 45 45 | 
             
                    unless construction.simpleMixingSchedule.empty?
         | 
| 46 46 | 
             
                      schedule = construction.simpleMixingSchedule.get
         | 
| 47 | 
            -
                      hash[:air_mixing_schedule] = schedule.nameString
         | 
| 47 | 
            +
                      hash[:air_mixing_schedule] = clean_name(schedule.nameString)
         | 
| 48 48 | 
             
                    end
         | 
| 49 49 | 
             
                    #TODO: Add air_mixing_per_area
         | 
| 50 50 |  | 
| @@ -40,12 +40,12 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'OpaqueConstructionAbridged'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = construction.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(construction.nameString)
         | 
| 44 44 | 
             
                    hash[:materials] = []
         | 
| 45 45 | 
             
                    # get construction layers
         | 
| 46 46 | 
             
                    layers = construction.layers
         | 
| 47 47 | 
             
                    layers.each do |layer|
         | 
| 48 | 
            -
                      name = layer.nameString
         | 
| 48 | 
            +
                      name = clean_name(layer.nameString)
         | 
| 49 49 | 
             
                      hash[:materials] << name
         | 
| 50 50 | 
             
                    end
         | 
| 51 51 |  | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'ShadeConstruction'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = construction.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(construction.nameString)
         | 
| 44 44 | 
             
                    # get outermost construction layers
         | 
| 45 45 | 
             
                    layer = construction.layers[0]
         | 
| 46 46 | 
             
                    if layer.to_StandardGlazing.is_initialized
         | 
| @@ -40,12 +40,12 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'WindowConstructionAbridged'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = construction.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(construction.nameString)
         | 
| 44 44 | 
             
                    hash[:materials] = []
         | 
| 45 45 | 
             
                    # get construction layers
         | 
| 46 46 | 
             
                    layers = construction.layers
         | 
| 47 47 | 
             
                    layers.each do |layer|
         | 
| 48 | 
            -
                      name = layer.nameString
         | 
| 48 | 
            +
                      name = clean_name(layer.nameString)
         | 
| 49 49 | 
             
                      hash[:materials] << name
         | 
| 50 50 | 
             
                    end
         | 
| 51 51 |  | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'ConstructionSetAbridged'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = construction_set.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(construction_set.nameString)
         | 
| 44 44 | 
             
                    hash[:wall_set] = {}
         | 
| 45 45 | 
             
                    hash[:floor_set] = {}
         | 
| 46 46 | 
             
                    hash[:aperture_set] = {}
         | 
| @@ -53,17 +53,17 @@ module Honeybee | |
| 53 53 | 
             
                      # get interior wall construction
         | 
| 54 54 | 
             
                      unless int_surf_construction.wallConstruction.empty?
         | 
| 55 55 | 
             
                        int_wall_const = int_surf_construction.wallConstruction.get
         | 
| 56 | 
            -
                        hash[:wall_set][:interior_construction] = int_wall_const.nameString
         | 
| 56 | 
            +
                        hash[:wall_set][:interior_construction] = clean_name(int_wall_const.nameString)
         | 
| 57 57 | 
             
                      end
         | 
| 58 58 | 
             
                      # get interior floor construction
         | 
| 59 59 | 
             
                      unless int_surf_construction.floorConstruction.empty?
         | 
| 60 60 | 
             
                        int_floor_const = int_surf_construction.floorConstruction.get
         | 
| 61 | 
            -
                        hash[:floor_set][:interior_construction] = int_floor_const.nameString
         | 
| 61 | 
            +
                        hash[:floor_set][:interior_construction] = clean_name(int_floor_const.nameString)
         | 
| 62 62 | 
             
                      end
         | 
| 63 63 | 
             
                      # get interior roofceiling construction
         | 
| 64 64 | 
             
                      unless int_surf_construction.roofCeilingConstruction.empty?
         | 
| 65 65 | 
             
                        int_roof_const = int_surf_construction.roofCeilingConstruction.get
         | 
| 66 | 
            -
                        hash[:roof_ceiling_set][:interior_construction] = int_roof_const.nameString
         | 
| 66 | 
            +
                        hash[:roof_ceiling_set][:interior_construction] = clean_name(int_roof_const.nameString)
         | 
| 67 67 | 
             
                      end
         | 
| 68 68 | 
             
                    end
         | 
| 69 69 |  | 
| @@ -72,17 +72,17 @@ module Honeybee | |
| 72 72 | 
             
                      int_subsurf_const = construction_set.defaultInteriorSubSurfaceConstructions.get
         | 
| 73 73 | 
             
                      unless int_subsurf_const.fixedWindowConstruction.empty?
         | 
| 74 74 | 
             
                        int_wind_const = int_subsurf_const.fixedWindowConstruction.get
         | 
| 75 | 
            -
                        hash[:aperture_set][:window_construction] = int_wind_const.nameString
         | 
| 75 | 
            +
                        hash[:aperture_set][:window_construction] = clean_name(int_wind_const.nameString)
         | 
| 76 76 | 
             
                      end
         | 
| 77 77 | 
             
                      # get interior door construction
         | 
| 78 78 | 
             
                      unless int_subsurf_const.doorConstruction.empty?
         | 
| 79 79 | 
             
                        int_door_const = int_subsurf_const.doorConstruction.get
         | 
| 80 | 
            -
                        hash[:door_set][:interior_construction] = int_door_const.nameString
         | 
| 80 | 
            +
                        hash[:door_set][:interior_construction] = clean_name(int_door_const.nameString)
         | 
| 81 81 | 
             
                      end
         | 
| 82 82 | 
             
                      # get interior glass door construction
         | 
| 83 83 | 
             
                      unless int_subsurf_const.glassDoorConstruction.empty?
         | 
| 84 84 | 
             
                        int_glass_door_const = int_subsurf_const.glassDoorConstruction.get
         | 
| 85 | 
            -
                        hash[:door_set][:interior_glass_construction] = int_glass_door_const.nameString
         | 
| 85 | 
            +
                        hash[:door_set][:interior_glass_construction] = clean_name(int_glass_door_const.nameString)
         | 
| 86 86 | 
             
                      end
         | 
| 87 87 | 
             
                    end
         | 
| 88 88 |  | 
| @@ -92,17 +92,17 @@ module Honeybee | |
| 92 92 | 
             
                      # get exterior wall construction
         | 
| 93 93 | 
             
                      unless ext_surf_const.wallConstruction.empty?
         | 
| 94 94 | 
             
                        ext_wall_const = ext_surf_const.wallConstruction.get
         | 
| 95 | 
            -
                        hash[:wall_set][:exterior_construction] = ext_wall_const.nameString
         | 
| 95 | 
            +
                        hash[:wall_set][:exterior_construction] = clean_name(ext_wall_const.nameString)
         | 
| 96 96 | 
             
                      end
         | 
| 97 97 | 
             
                      # get exterior floor construction
         | 
| 98 98 | 
             
                      unless ext_surf_const.floorConstruction.empty?
         | 
| 99 99 | 
             
                        ext_floor_const = ext_surf_const.floorConstruction.get
         | 
| 100 | 
            -
                        hash[:floor_set][:exterior_construction] = ext_floor_const.nameString
         | 
| 100 | 
            +
                        hash[:floor_set][:exterior_construction] = clean_name(ext_floor_const.nameString)
         | 
| 101 101 | 
             
                      end
         | 
| 102 102 | 
             
                      # get exterior roofceiling construction
         | 
| 103 103 | 
             
                      unless ext_surf_const.roofCeilingConstruction.empty?
         | 
| 104 104 | 
             
                        ext_roof_const = ext_surf_const.roofCeilingConstruction.get
         | 
| 105 | 
            -
                        hash[:roof_ceiling_set][:exterior_construction] = ext_roof_const.nameString
         | 
| 105 | 
            +
                        hash[:roof_ceiling_set][:exterior_construction] = clean_name(ext_roof_const.nameString)
         | 
| 106 106 | 
             
                      end
         | 
| 107 107 | 
             
                    end
         | 
| 108 108 |  | 
| @@ -112,22 +112,22 @@ module Honeybee | |
| 112 112 | 
             
                      # get exterior operable window construction
         | 
| 113 113 | 
             
                      unless ext_subsurf_const.operableWindowConstruction.empty?
         | 
| 114 114 | 
             
                        ext_wind_const = ext_subsurf_const.operableWindowConstruction.get
         | 
| 115 | 
            -
                        hash[:aperture_set][:operable_construction] = ext_wind_const.nameString
         | 
| 115 | 
            +
                        hash[:aperture_set][:operable_construction] = clean_name(ext_wind_const.nameString)
         | 
| 116 116 | 
             
                      end
         | 
| 117 117 | 
             
                      # get exterior skylight construction
         | 
| 118 118 | 
             
                      unless ext_subsurf_const.skylightConstruction.empty?
         | 
| 119 119 | 
             
                        ext_skylight_const = ext_subsurf_const.skylightConstruction.get
         | 
| 120 | 
            -
                        hash[:aperture_set][:skylight_construction] = ext_skylight_const.nameString
         | 
| 120 | 
            +
                        hash[:aperture_set][:skylight_construction] = clean_name(ext_skylight_const.nameString)
         | 
| 121 121 | 
             
                      end
         | 
| 122 122 | 
             
                      # get exterior door construction
         | 
| 123 123 | 
             
                      unless ext_subsurf_const.doorConstruction.empty?
         | 
| 124 124 | 
             
                        ext_door_const = ext_subsurf_const.doorConstruction.get
         | 
| 125 | 
            -
                        hash[:door_set][:exterior_construction] = ext_door_const.nameString
         | 
| 125 | 
            +
                        hash[:door_set][:exterior_construction] = clean_name(ext_door_const.nameString)
         | 
| 126 126 | 
             
                      end
         | 
| 127 127 | 
             
                      # get exterior overhead door construction
         | 
| 128 128 | 
             
                      unless ext_subsurf_const.overheadDoorConstruction.empty?
         | 
| 129 129 | 
             
                        ext_ovhd_door_const = ext_subsurf_const.overheadDoorConstruction.get
         | 
| 130 | 
            -
                        hash[:door_set][:overhead_construction] = ext_ovhd_door_const.nameString
         | 
| 130 | 
            +
                        hash[:door_set][:overhead_construction] = clean_name(ext_ovhd_door_const.nameString)
         | 
| 131 131 | 
             
                      end
         | 
| 132 132 | 
             
                    end
         | 
| 133 133 |  | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                  hash = {}
         | 
| 41 41 | 
             
                  hash[:type] = 'Aperture'
         | 
| 42 42 | 
             
                  hash[:identifier] = clean_identifier(sub_surface.nameString)
         | 
| 43 | 
            -
                  hash[:display_name] = sub_surface.nameString
         | 
| 43 | 
            +
                  hash[:display_name] = clean_name(sub_surface.nameString)
         | 
| 44 44 | 
             
                  hash[:user_data] = {handle: sub_surface.handle.to_s}
         | 
| 45 45 | 
             
                  hash[:properties] = properties_from_sub_surface(sub_surface)
         | 
| 46 46 | 
             
                  hash[:geometry] = geometry_from_sub_surface(sub_surface, site_transformation)
         | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                  hash = {}
         | 
| 41 41 | 
             
                  hash[:type] = 'Door'
         | 
| 42 42 | 
             
                  hash[:identifier] = clean_identifier(sub_surface.nameString)
         | 
| 43 | 
            -
                  hash[:display_name] = sub_surface.nameString
         | 
| 43 | 
            +
                  hash[:display_name] = clean_name(sub_surface.nameString)
         | 
| 44 44 | 
             
                  hash[:user_data] = {handle: sub_surface.handle.to_s}
         | 
| 45 45 | 
             
                  hash[:properties] = properties_from_sub_surface(sub_surface)
         | 
| 46 46 | 
             
                  hash[:geometry] = geometry_from_sub_surface(sub_surface, site_transformation)
         | 
| @@ -38,7 +38,7 @@ module Honeybee | |
| 38 38 | 
             
                  hash = {}
         | 
| 39 39 | 
             
                  hash[:type] = 'Face'
         | 
| 40 40 | 
             
                  hash[:identifier] = clean_identifier(surface.nameString)
         | 
| 41 | 
            -
                  hash[:display_name] = surface.nameString
         | 
| 41 | 
            +
                  hash[:display_name] = clean_name(surface.nameString)
         | 
| 42 42 | 
             
                  hash[:user_data] = {handle: surface.handle.to_s}
         | 
| 43 43 | 
             
                  hash[:properties] = properties_from_surface(surface)
         | 
| 44 44 | 
             
                  hash[:geometry] = geometry_from_surface(surface, site_transformation)
         | 
| @@ -38,7 +38,7 @@ module Honeybee | |
| 38 38 | 
             
                  hash = {}
         | 
| 39 39 | 
             
                  hash[:type] = 'Room'
         | 
| 40 40 | 
             
                  hash[:identifier] = clean_identifier(space.nameString)
         | 
| 41 | 
            -
                  hash[:display_name] = space.nameString
         | 
| 41 | 
            +
                  hash[:display_name] = clean_name(space.nameString)
         | 
| 42 42 | 
             
                  hash[:user_data] = {space: space.handle.to_s}
         | 
| 43 43 | 
             
                  hash[:properties] = properties_from_space(space)
         | 
| 44 44 |  | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                  hash = {}
         | 
| 41 41 | 
             
                  hash[:type] = 'Shade'
         | 
| 42 42 | 
             
                  hash[:identifier] = clean_identifier(shading_surface.nameString)
         | 
| 43 | 
            -
                  hash[:display_name] = shading_surface.nameString
         | 
| 43 | 
            +
                  hash[:display_name] = clean_name(shading_surface.nameString)
         | 
| 44 44 | 
             
                  hash[:user_data] = {handle: shading_surface.handle.to_s}
         | 
| 45 45 | 
             
                  hash[:properties] = properties_from_shading_surface(shading_surface)
         | 
| 46 46 | 
             
                  hash[:geometry] = geometry_from_shading_surface(shading_surface, site_transformation)
         | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'EnergyMaterial'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = material.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(material.nameString)
         | 
| 44 44 | 
             
                    hash[:thickness] = material.thickness
         | 
| 45 45 | 
             
                    hash[:conductivity] = material.conductivity
         | 
| 46 46 | 
             
                    hash[:density] = material.density
         | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'EnergyMaterialNoMass'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = material.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(material.nameString)
         | 
| 44 44 | 
             
                    hash[:r_value] = material.thermalResistance
         | 
| 45 45 |  | 
| 46 46 | 
             
                    if material.to_MasslessOpaqueMaterial.is_initialized
         | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'EnergyWindowMaterialBlind'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = material.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(material.nameString)
         | 
| 44 44 | 
             
                    hash[:slat_orientation] = material.slatOrientation
         | 
| 45 45 | 
             
                    hash[:slat_width] = material.slatWidth
         | 
| 46 46 | 
             
                    hash[:slat_separation] = material.slatSeparation
         | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'EnergyWindowMaterialGas'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = material.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(material.nameString)
         | 
| 44 44 | 
             
                    hash[:thickness] = material.thickness
         | 
| 45 45 | 
             
                    hash[:gas_type] = material.gasType
         | 
| 46 46 |  | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'EnergyWindowMaterialGasCustom'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = material.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(material.nameString)
         | 
| 44 44 | 
             
                    hash[:thickness] = material.thickness
         | 
| 45 45 | 
             
                    # check if boost optional object is empty
         | 
| 46 46 | 
             
                    unless material.customConductivityCoefficientA.empty?
         | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'EnergyWindowMaterialGasMixture'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = material.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(material.nameString)
         | 
| 44 44 | 
             
                    hash[:thickness] = material.thickness
         | 
| 45 45 | 
             
                    hash[:gas_types] = []
         | 
| 46 46 | 
             
                    hash[:gas_fractions] = []
         | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'EnergyWindowMaterialGlazing'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = material.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(material.nameString)
         | 
| 44 44 | 
             
                    hash[:thickness] = material.thickness
         | 
| 45 45 | 
             
                    hash[:solar_transmittance] = material.solarTransmittance
         | 
| 46 46 | 
             
                    # check if boost optional object is empty
         | 
| @@ -40,7 +40,7 @@ module Honeybee | |
| 40 40 | 
             
                    hash = {}
         | 
| 41 41 | 
             
                    hash[:type] = 'EnergyWindowMaterialSimpleGlazSys'
         | 
| 42 42 | 
             
                    # set hash values from OpenStudio Object
         | 
| 43 | 
            -
                    hash[:identifier] = material.nameString
         | 
| 43 | 
            +
                    hash[:identifier] = clean_name(material.nameString)
         | 
| 44 44 | 
             
                    hash[:u_factor] = material.uFactor
         | 
| 45 45 | 
             
                    hash[:shgc] = material.solarHeatGainCoefficient
         | 
| 46 46 | 
             
                    # check if boost optional object is empty
         | 
| @@ -36,6 +36,13 @@ module Honeybee | |
| 36 36 |  | 
| 37 37 | 
             
                attr_reader :errors, :warnings
         | 
| 38 38 |  | 
| 39 | 
            +
                @@encoding_options = {
         | 
| 40 | 
            +
                  :invalid           => :replace,  # Replace invalid byte sequences
         | 
| 41 | 
            +
                  :undef             => :replace,  # Replace anything not defined in ASCII
         | 
| 42 | 
            +
                  :replace           => '',        # Use a blank for those replacements
         | 
| 43 | 
            +
                  :universal_newline => true       # Always break lines with \n
         | 
| 44 | 
            +
                }
         | 
| 45 | 
            +
             | 
| 39 46 | 
             
                def method_missing(sym, *args)
         | 
| 40 47 | 
             
                  name = sym.to_s
         | 
| 41 48 | 
             
                  aname = name.sub('=', '')
         | 
| @@ -98,9 +105,15 @@ module Honeybee | |
| 98 105 | 
             
                  end
         | 
| 99 106 | 
             
                end
         | 
| 100 107 |  | 
| 108 | 
            +
                # remove illegal characters in identifier
         | 
| 109 | 
            +
                def self.clean_name(str)
         | 
| 110 | 
            +
                  ascii = str.encode(Encoding.find('ASCII'), @@encoding_options)
         | 
| 111 | 
            +
                end
         | 
| 112 | 
            +
             | 
| 101 113 | 
             
                # remove illegal characters in identifier
         | 
| 102 114 | 
             
                def self.clean_identifier(str)
         | 
| 103 | 
            -
                  str. | 
| 115 | 
            +
                  encode_str = str.encode(Encoding.find('ASCII'), @@encoding_options)
         | 
| 116 | 
            +
                  encode_str.gsub(/[^.A-Za-z0-9_-]/, '_').gsub(' ', '_')
         | 
| 104 117 | 
             
                end
         | 
| 105 118 |  | 
| 106 119 |  | 
| @@ -77,7 +77,7 @@ module Honeybee | |
| 77 77 |  | 
| 78 78 | 
             
                      # assign the flow exponent if it's specified
         | 
| 79 79 | 
             
                      if vent_crack[:flow_exponent]
         | 
| 80 | 
            -
                        os_crack. | 
| 80 | 
            +
                        os_crack.setAirMassFlowExponent(vent_crack[:flow_exponent])
         | 
| 81 81 | 
             
                      end
         | 
| 82 82 |  | 
| 83 83 | 
             
                      # if it's a Surface boundary condition ensure the neighbor is not written as a duplicate
         | 
| @@ -349,8 +349,10 @@ module Honeybee | |
| 349 349 | 
             
                        if sub_f.adjacentSubSurface.empty?  # not an interior window that's already in the AFN
         | 
| 350 350 | 
             
                          vent_open = VentilationOpening.new(opening)
         | 
| 351 351 | 
             
                          open_fac = vent_open.to_openstudio_afn(openstudio_model, sub_f)
         | 
| 352 | 
            -
                           | 
| 353 | 
            -
             | 
| 352 | 
            +
                          unless open_fac.nil?  # nil is used for horizontal exterior skylights
         | 
| 353 | 
            +
                            operable_subfs << sub_f
         | 
| 354 | 
            +
                            opening_factors << open_fac
         | 
| 355 | 
            +
                          end
         | 
| 354 356 | 
             
                        end
         | 
| 355 357 | 
             
                      end
         | 
| 356 358 | 
             
                    end
         | 
| @@ -128,43 +128,69 @@ module Honeybee | |
| 128 128 | 
             
                end
         | 
| 129 129 |  | 
| 130 130 | 
             
                def to_openstudio_afn(openstudio_model, parent)
         | 
| 131 | 
            -
                  #  | 
| 131 | 
            +
                  # get the tilt and BC of the parent so that we can use the correct AFN object
         | 
| 132 | 
            +
                  srf_tilt = parent.tilt.to_f * (180 / Math::PI)
         | 
| 133 | 
            +
                  srf_bc = parent.outsideBoundaryCondition.to_s
         | 
| 134 | 
            +
             | 
| 135 | 
            +
                  # process the flow_coefficient_closed and flow exponent
         | 
| 132 136 | 
             
                  if @hash[:flow_coefficient_closed] and @hash[:flow_coefficient_closed] != 0
         | 
| 133 137 | 
             
                    flow_coefficient = @hash[:flow_coefficient_closed]
         | 
| 134 138 | 
             
                  else
         | 
| 135 139 | 
             
                    flow_coefficient = 1.0e-09  # set it to a very small number
         | 
| 136 140 | 
             
                  end
         | 
| 137 | 
            -
             | 
| 138 | 
            -
                  # create the simple opening object for the Aperture or Door using default values
         | 
| 139 141 | 
             
                  flow_exponent = defaults[:flow_exponent_closed][:default].to_f
         | 
| 140 | 
            -
                  two_way_thresh = defaults[:two_way_threshold][:default].to_f
         | 
| 141 | 
            -
                  discharge_coeff = defaults[:discharge_coefficient][:default].to_f
         | 
| 142 | 
            -
                  os_opening = OpenStudio::Model::AirflowNetworkSimpleOpening.new(
         | 
| 143 | 
            -
                    openstudio_model, flow_coefficient, flow_exponent, two_way_thresh, discharge_coeff)
         | 
| 144 | 
            -
             | 
| 145 | 
            -
                  # assign the flow exponent when the opening is closed
         | 
| 146 | 
            -
                  if @hash[:flow_exponent_closed]
         | 
| 147 | 
            -
                    os_opening.setAirMassFlowExponentWhenOpeningisClosed(@hash[:flow_exponent_closed])
         | 
| 148 | 
            -
                  end
         | 
| 149 | 
            -
                  # assign the minimum difference for two-way flow
         | 
| 150 | 
            -
                  if @hash[:two_way_threshold]
         | 
| 151 | 
            -
                    os_opening.setMinimumDensityDifferenceforTwoWayFlow(@hash[:two_way_threshold])
         | 
| 152 | 
            -
                  end
         | 
| 153 | 
            -
                  # assign the discharge coefficient
         | 
| 154 | 
            -
                  if @hash[:discharge_coefficient]
         | 
| 155 | 
            -
                    os_opening.setDischargeCoefficient(@hash[:discharge_coefficient])
         | 
| 156 | 
            -
                  end
         | 
| 157 | 
            -
             | 
| 158 | 
            -
                  # create the AirflowNetworkSurface
         | 
| 159 | 
            -
                  os_afn_srf = parent.getAirflowNetworkSurface(os_opening)
         | 
| 160 142 |  | 
| 161 | 
            -
                  #  | 
| 143 | 
            +
                  # process the opening area
         | 
| 162 144 | 
             
                  if @hash[:fraction_area_operable]
         | 
| 163 145 | 
             
                    open_fac = @hash[:fraction_area_operable]
         | 
| 164 146 | 
             
                  else
         | 
| 165 147 | 
             
                    open_fac = defaults[:fraction_area_operable][:default]
         | 
| 166 148 | 
             
                  end
         | 
| 167 | 
            -
             | 
| 149 | 
            +
             | 
| 150 | 
            +
                  # create an opening obj
         | 
| 151 | 
            +
                  if srf_tilt < 10 || srf_tilt > 170
         | 
| 152 | 
            +
                    if srf_bc == 'Outdoors'
         | 
| 153 | 
            +
                      # create a crack object to represent an exterior in-operable horizontal skylight
         | 
| 154 | 
            +
                      open_fac = nil
         | 
| 155 | 
            +
                      os_opening = OpenStudio::Model::AirflowNetworkCrack.new(
         | 
| 156 | 
            +
                        openstudio_model, flow_coefficient, flow_exponent, $afn_reference_crack)
         | 
| 157 | 
            +
                    else
         | 
| 158 | 
            +
                      # create a HorizontalOpening object to represent the interior horizontal window
         | 
| 159 | 
            +
                      discharge_coeff = defaults[:discharge_coefficient][:default].to_f
         | 
| 160 | 
            +
                      if srf_tilt < 10
         | 
| 161 | 
            +
                        slope_ang = 90 - srf_tilt
         | 
| 162 | 
            +
                      else
         | 
| 163 | 
            +
                        slope_ang = 90 - (180 - srf_tilt)
         | 
| 164 | 
            +
                      end
         | 
| 165 | 
            +
                      os_opening = OpenStudio::Model::AirflowNetworkHorizontalOpening .new(
         | 
| 166 | 
            +
                        openstudio_model, flow_coefficient, flow_exponent, slope_ang, discharge_coeff)
         | 
| 167 | 
            +
                    end
         | 
| 168 | 
            +
                  else
         | 
| 169 | 
            +
                    # create the simple opening object for the Aperture or Door using default values
         | 
| 170 | 
            +
                    two_way_thresh = defaults[:two_way_threshold][:default].to_f
         | 
| 171 | 
            +
                    discharge_coeff = defaults[:discharge_coefficient][:default].to_f
         | 
| 172 | 
            +
                    os_opening = OpenStudio::Model::AirflowNetworkSimpleOpening.new(
         | 
| 173 | 
            +
                      openstudio_model, flow_coefficient, flow_exponent, two_way_thresh, discharge_coeff)
         | 
| 174 | 
            +
             | 
| 175 | 
            +
                    # assign the flow exponent when the opening is closed
         | 
| 176 | 
            +
                    if @hash[:flow_exponent_closed]
         | 
| 177 | 
            +
                      os_opening.setAirMassFlowExponentWhenOpeningisClosed(@hash[:flow_exponent_closed])
         | 
| 178 | 
            +
                    end
         | 
| 179 | 
            +
                    # assign the minimum difference for two-way flow
         | 
| 180 | 
            +
                    if @hash[:two_way_threshold]
         | 
| 181 | 
            +
                      os_opening.setMinimumDensityDifferenceforTwoWayFlow(@hash[:two_way_threshold])
         | 
| 182 | 
            +
                    end
         | 
| 183 | 
            +
                    # assign the discharge coefficient
         | 
| 184 | 
            +
                    if @hash[:discharge_coefficient]
         | 
| 185 | 
            +
                      os_opening.setDischargeCoefficient(@hash[:discharge_coefficient])
         | 
| 186 | 
            +
                    end
         | 
| 187 | 
            +
                  end
         | 
| 188 | 
            +
             | 
| 189 | 
            +
                  # create the AirflowNetworkSurface and assign the opening factor
         | 
| 190 | 
            +
                  os_afn_srf = parent.getAirflowNetworkSurface(os_opening)
         | 
| 191 | 
            +
                  unless open_fac.nil?
         | 
| 192 | 
            +
                    os_afn_srf.setWindowDoorOpeningFactorOrCrackFactor(open_fac)
         | 
| 193 | 
            +
                  end
         | 
| 168 194 |  | 
| 169 195 | 
             
                  open_fac
         | 
| 170 196 | 
             
                end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: honeybee-openstudio
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 2.22. | 
| 4 | 
            +
              version: 2.22.4
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Tanushree Charan
         | 
| @@ -11,7 +11,7 @@ authors: | |
| 11 11 | 
             
            autorequire: 
         | 
| 12 12 | 
             
            bindir: exe
         | 
| 13 13 | 
             
            cert_chain: []
         | 
| 14 | 
            -
            date: 2021- | 
| 14 | 
            +
            date: 2021-09-10 00:00:00.000000000 Z
         | 
| 15 15 | 
             
            dependencies:
         | 
| 16 16 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 17 17 | 
             
              name: bundler
         | 
| @@ -89,14 +89,14 @@ dependencies: | |
| 89 89 | 
             
                requirements:
         | 
| 90 90 | 
             
                - - "~>"
         | 
| 91 91 | 
             
                  - !ruby/object:Gem::Version
         | 
| 92 | 
            -
                    version:  | 
| 92 | 
            +
                    version: 1.15.0
         | 
| 93 93 | 
             
              type: :development
         | 
| 94 94 | 
             
              prerelease: false
         | 
| 95 95 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 96 96 | 
             
                requirements:
         | 
| 97 97 | 
             
                - - "~>"
         | 
| 98 98 | 
             
                  - !ruby/object:Gem::Version
         | 
| 99 | 
            -
                    version:  | 
| 99 | 
            +
                    version: 1.15.0
         | 
| 100 100 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 101 101 | 
             
              name: json_pure
         | 
| 102 102 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -117,28 +117,28 @@ dependencies: | |
| 117 117 | 
             
                requirements:
         | 
| 118 118 | 
             
                - - '='
         | 
| 119 119 | 
             
                  - !ruby/object:Gem::Version
         | 
| 120 | 
            -
                    version: 0.4. | 
| 120 | 
            +
                    version: 0.4.3
         | 
| 121 121 | 
             
              type: :runtime
         | 
| 122 122 | 
             
              prerelease: false
         | 
| 123 123 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 124 124 | 
             
                requirements:
         | 
| 125 125 | 
             
                - - '='
         | 
| 126 126 | 
             
                  - !ruby/object:Gem::Version
         | 
| 127 | 
            -
                    version: 0.4. | 
| 127 | 
            +
                    version: 0.4.3
         | 
| 128 128 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 129 129 | 
             
              name: openstudio-standards
         | 
| 130 130 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 131 131 | 
             
                requirements:
         | 
| 132 132 | 
             
                - - "~>"
         | 
| 133 133 | 
             
                  - !ruby/object:Gem::Version
         | 
| 134 | 
            -
                    version: 0.2. | 
| 134 | 
            +
                    version: 0.2.14
         | 
| 135 135 | 
             
              type: :runtime
         | 
| 136 136 | 
             
              prerelease: false
         | 
| 137 137 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 138 138 | 
             
                requirements:
         | 
| 139 139 | 
             
                - - "~>"
         | 
| 140 140 | 
             
                  - !ruby/object:Gem::Version
         | 
| 141 | 
            -
                    version: 0.2. | 
| 141 | 
            +
                    version: 0.2.14
         | 
| 142 142 | 
             
            description: Library and measures for translating between Honeybee JSON schema and
         | 
| 143 143 | 
             
              OpenStudio Model schema (OSM).
         | 
| 144 144 | 
             
            email:
         |