honeybee-openstudio 2.30.6 → 2.30.7
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/honeybee-openstudio.gemspec +1 -1
 - data/lib/to_openstudio/simulation/parameter_model.rb +67 -0
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: dbe2c2581aae65bb58d4fc5b13efc1093de9302e9f41a8b21a8b3e35ad909d0a
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 1a08ed0e4ca2dccf145d961287b9ea2c60ea67034877957482a7c49318203a34
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: a534759f8a48c410354c6c53e131e21fe0c9ef17824a761d6f338bdcc07f7007f1cc79c16406492782e9d580a0eaa8bfdf5bb5e89924157d2f08fc80d62bad12
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a51dcad87234a081e63575fde99ea0a76a02a7a8d497a3d0a0e977af5ca5713b80db65b966489462f441ebc28575adc89082a86845cb5471d195f146da9c2fc4
         
     | 
    
        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.30. 
     | 
| 
      
 7 
     | 
    
         
            +
              spec.version       = '2.30.7'
         
     | 
| 
       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 
     | 
    
         | 
| 
         @@ -154,6 +154,7 @@ module Honeybee 
     | 
|
| 
       154 
154 
     | 
    
         
             
                      end
         
     | 
| 
       155 
155 
     | 
    
         
             
                    end
         
     | 
| 
       156 
156 
     | 
    
         
             
                  end
         
     | 
| 
      
 157 
     | 
    
         
            +
             
     | 
| 
       157 
158 
     | 
    
         
             
                  # use the average of design day temperatures to set the water mains temperature
         
     | 
| 
       158 
159 
     | 
    
         
             
                  os_water_mains = @openstudio_model.getSiteWaterMainsTemperature 
         
     | 
| 
       159 
160 
     | 
    
         
             
                  os_water_mains.setCalculationMethod('Correlation')
         
     | 
| 
         @@ -164,6 +165,62 @@ module Honeybee 
     | 
|
| 
       164 
165 
     | 
    
         
             
                  end
         
     | 
| 
       165 
166 
     | 
    
         
             
                  os_water_mains.setMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures(4)
         
     | 
| 
       166 
167 
     | 
    
         | 
| 
      
 168 
     | 
    
         
            +
                  # set the climate zone from design days assuming 0.4% extremes and normal distribution
         
     | 
| 
      
 169 
     | 
    
         
            +
                  climate_zone_objs = @openstudio_model.getClimateZones
         
     | 
| 
      
 170 
     | 
    
         
            +
                  ashrae_zones = climate_zone_objs.getClimateZones('ASHRAE')
         
     | 
| 
      
 171 
     | 
    
         
            +
                  if ashrae_zones.empty? && db_temps.length > 0
         
     | 
| 
      
 172 
     | 
    
         
            +
                    # generate temperatures according to a normal distribution
         
     | 
| 
      
 173 
     | 
    
         
            +
                    mean_temp = (db_temps.max + db_temps.min) / 2
         
     | 
| 
      
 174 
     | 
    
         
            +
                    dist_to_mean = db_temps.max - mean_temp
         
     | 
| 
      
 175 
     | 
    
         
            +
                    st_dev = dist_to_mean / 2.65
         
     | 
| 
      
 176 
     | 
    
         
            +
                    vals = []
         
     | 
| 
      
 177 
     | 
    
         
            +
                    for i in 0..4379
         
     | 
| 
      
 178 
     | 
    
         
            +
                      step_seed = i.to_f / 4380
         
     | 
| 
      
 179 
     | 
    
         
            +
                      add_val1, add_val2 = gaussian(mean_temp, st_dev, step_seed)
         
     | 
| 
      
 180 
     | 
    
         
            +
                      vals << add_val1
         
     | 
| 
      
 181 
     | 
    
         
            +
                      vals << add_val2
         
     | 
| 
      
 182 
     | 
    
         
            +
                    end
         
     | 
| 
      
 183 
     | 
    
         
            +
             
     | 
| 
      
 184 
     | 
    
         
            +
                    # compute the number of heating and cooling degree days
         
     | 
| 
      
 185 
     | 
    
         
            +
                    cooling_deg_days, heating_deg_days = 0, 0
         
     | 
| 
      
 186 
     | 
    
         
            +
                    vals.each do |temp|
         
     | 
| 
      
 187 
     | 
    
         
            +
                      if temp > 10
         
     | 
| 
      
 188 
     | 
    
         
            +
                        cdd = (temp - 10) / 24
         
     | 
| 
      
 189 
     | 
    
         
            +
                        cooling_deg_days += cdd
         
     | 
| 
      
 190 
     | 
    
         
            +
                      end
         
     | 
| 
      
 191 
     | 
    
         
            +
                      if temp < 18
         
     | 
| 
      
 192 
     | 
    
         
            +
                        hdd = (18 - temp) / 24
         
     | 
| 
      
 193 
     | 
    
         
            +
                        heating_deg_days += hdd
         
     | 
| 
      
 194 
     | 
    
         
            +
                      end
         
     | 
| 
      
 195 
     | 
    
         
            +
                    end
         
     | 
| 
      
 196 
     | 
    
         
            +
             
     | 
| 
      
 197 
     | 
    
         
            +
                    # determine the climate zone from the degree-day distribution
         
     | 
| 
      
 198 
     | 
    
         
            +
                    if cooling_deg_days > 5000
         
     | 
| 
      
 199 
     | 
    
         
            +
                      cz = '1'
         
     | 
| 
      
 200 
     | 
    
         
            +
                    elsif cooling_deg_days > 3500
         
     | 
| 
      
 201 
     | 
    
         
            +
                      cz = '2A'
         
     | 
| 
      
 202 
     | 
    
         
            +
                    elsif cooling_deg_days > 2500
         
     | 
| 
      
 203 
     | 
    
         
            +
                      cz = '3A'
         
     | 
| 
      
 204 
     | 
    
         
            +
                    elsif cooling_deg_days <= 2500 and heating_deg_days <= 2000
         
     | 
| 
      
 205 
     | 
    
         
            +
                      cz = '3C'
         
     | 
| 
      
 206 
     | 
    
         
            +
                    elsif cooling_deg_days <= 2500 and heating_deg_days <= 3000
         
     | 
| 
      
 207 
     | 
    
         
            +
                      cz = '4A'
         
     | 
| 
      
 208 
     | 
    
         
            +
                    elsif heating_deg_days <= 3000
         
     | 
| 
      
 209 
     | 
    
         
            +
                      cz = '4C'
         
     | 
| 
      
 210 
     | 
    
         
            +
                    elsif heating_deg_days <= 4000
         
     | 
| 
      
 211 
     | 
    
         
            +
                      cz = '5A'
         
     | 
| 
      
 212 
     | 
    
         
            +
                    elsif heating_deg_days <= 5000
         
     | 
| 
      
 213 
     | 
    
         
            +
                      cz = '6A'
         
     | 
| 
      
 214 
     | 
    
         
            +
                    elsif heating_deg_days <= 7000
         
     | 
| 
      
 215 
     | 
    
         
            +
                      cz = '7'
         
     | 
| 
      
 216 
     | 
    
         
            +
                    else
         
     | 
| 
      
 217 
     | 
    
         
            +
                        cz = '8'
         
     | 
| 
      
 218 
     | 
    
         
            +
                    end
         
     | 
| 
      
 219 
     | 
    
         
            +
             
     | 
| 
      
 220 
     | 
    
         
            +
                    # set the climate zone
         
     | 
| 
      
 221 
     | 
    
         
            +
                    climate_zone_objs.setClimateZone('ASHRAE', cz)
         
     | 
| 
      
 222 
     | 
    
         
            +
                  end
         
     | 
| 
      
 223 
     | 
    
         
            +
             
     | 
| 
       167 
224 
     | 
    
         
             
                  # set Outputs for the simulation
         
     | 
| 
       168 
225 
     | 
    
         
             
                  if @hash[:output]
         
     | 
| 
       169 
226 
     | 
    
         
             
                    if @hash[:output][:outputs]
         
     | 
| 
         @@ -251,5 +308,15 @@ module Honeybee 
     | 
|
| 
       251 
308 
     | 
    
         | 
| 
       252 
309 
     | 
    
         
             
                end
         
     | 
| 
       253 
310 
     | 
    
         | 
| 
      
 311 
     | 
    
         
            +
                def gaussian(mean, stddev, seed)
         
     | 
| 
      
 312 
     | 
    
         
            +
                  # generate a gaussian distribution of values
         
     | 
| 
      
 313 
     | 
    
         
            +
                  theta = 2 * Math::PI * seed
         
     | 
| 
      
 314 
     | 
    
         
            +
                  rho = Math.sqrt(-2 * Math.log(1 - seed))
         
     | 
| 
      
 315 
     | 
    
         
            +
                  scale = stddev * rho
         
     | 
| 
      
 316 
     | 
    
         
            +
                  x = mean + scale * Math.cos(theta)
         
     | 
| 
      
 317 
     | 
    
         
            +
                  y = mean + scale * Math.sin(theta)
         
     | 
| 
      
 318 
     | 
    
         
            +
                  return x, y
         
     | 
| 
      
 319 
     | 
    
         
            +
                end
         
     | 
| 
      
 320 
     | 
    
         
            +
             
     | 
| 
       254 
321 
     | 
    
         
             
              end #SimulationParameter
         
     | 
| 
       255 
322 
     | 
    
         
             
            end #Honeybee
         
     | 
    
        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.30. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.30.7
         
     | 
| 
       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: 2022-03- 
     | 
| 
      
 14 
     | 
    
         
            +
            date: 2022-03-12 00:00:00.000000000 Z
         
     | 
| 
       15 
15 
     | 
    
         
             
            dependencies:
         
     | 
| 
       16 
16 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       17 
17 
     | 
    
         
             
              name: bundler
         
     |