lib/openstudio-standards/weather/Weather.Model.rb in openstudio-standards-0.2.9 vs lib/openstudio-standards/weather/Weather.Model.rb in openstudio-standards-0.2.10.rc1

- old
+ new

@@ -151,11 +151,11 @@ # Load in the ddy file based on convention that it is in # the same directory and has the same basename as the epw file. ddy_file = "#{File.join(File.dirname(weather_file), File.basename(weather_file, '.*'))}.ddy" if File.exist? ddy_file ddy_model = OpenStudio::EnergyPlus.loadAndTranslateIdf(ddy_file).get - ddy_model.getObjectsByType('OS:SizingPeriod:DesignDay'.to_IddObjectType).each do |d| + ddy_model.getObjectsByType('OS:SizingPeriod:DesignDay'.to_IddObjectType).sort.each do |d| # Import the 99.6% Heating and 0.4% Cooling design days ddy_list = /(Htg 99.6. Condns DB)|(Clg .4% Condns DB=>MWB)|(Clg 0.4% Condns DB=>MCWB)/ if d.name.get =~ ddy_list model.addObject(d.clone) OpenStudio::logFree(OpenStudio::Info, 'openstudio.weather.Model', "Added #{d.name} design day.") @@ -173,11 +173,11 @@ return success end def model_add_ground_temperatures(model, building_type, climate_zone) - ground_temp_vals = model_find_object(standards_data['ground_temperatures'], 'template' => template, 'climate_zone' => climate_zone, 'building_type' => building_type) + ground_temp_vals = standards_lookup_table_first(table_name: 'ground_temperatures', search_criteria: {'template' => template, 'climate_zone' => climate_zone, 'building_type' => building_type}) if ground_temp_vals && ground_temp_vals['jan'] ground_temp = model.getSiteGroundTemperatureBuildingSurface ground_temp.setJanuaryGroundTemperature(ground_temp_vals['jan']) ground_temp.setFebruaryGroundTemperature(ground_temp_vals['feb']) ground_temp.setMarchGroundTemperature(ground_temp_vals['mar']) @@ -730,6 +730,6 @@ FileUtils.cp(@ddy_filepath, "#{File.dirname(filename)}/#{File.basename(filename, '.epw')}.ddy") FileUtils.cp(@stat_filepath, "#{File.dirname(filename)}/#{File.basename(filename, '.epw')}.stat") end end # Environment end -end +end \ No newline at end of file