Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/NREL/OpenStudio-HPXML int…
Browse files Browse the repository at this point in the history
…o ducts_sizing_etc

# Conflicts:
#	resources/airflow.rb
#	tests/hvac_load_fracs/base-hvac-central-ac-only-1-speed-zero-cool.xml
#	tests/hvac_load_fracs/base-hvac-central-ac-only-2-speed-zero-cool.xml
#	tests/hvac_load_fracs/base-hvac-central-ac-only-var-speed-zero-cool.xml
#	tests/hvac_load_fracs/base-hvac-furnace-elec-only-zero-heat.xml
#	tests/hvac_load_fracs/base-hvac-furnace-gas-only-zero-heat.xml
#	tests/hvac_multiple/base-hvac-air-to-air-heat-pump-2-speed-x3.xml.skip
#	tests/hvac_multiple/base-hvac-furnace-gas-only-x3.xml.skip
#	tests/hvac_multiple/base-hvac-ground-to-air-heat-pump-x3.xml.skip
#	tests/hvac_multiple/base-hvac-mini-split-heat-pump-ducted-x3.xml.skip
#	tests/hvac_partial/base-hvac-air-to-air-heat-pump-1-speed-50percent.xml.skip
#	tests/hvac_partial/base-hvac-air-to-air-heat-pump-2-speed-50percent.xml.skip
#	tests/hvac_partial/base-hvac-air-to-air-heat-pump-var-speed-50percent.xml.skip
#	tests/hvac_partial/base-hvac-central-ac-only-1-speed-50percent.xml.skip
#	tests/hvac_partial/base-hvac-central-ac-only-2-speed-50percent.xml.skip
#	tests/hvac_partial/base-hvac-central-ac-only-var-speed-50percent.xml.skip
#	tests/hvac_partial/base-hvac-furnace-elec-only-50percent.xml.skip
#	tests/hvac_partial/base-hvac-furnace-gas-only-50percent.xml.skip
#	tests/hvac_partial/base-hvac-furnace-gas-room-ac-50percent.xml.skip
#	tests/hvac_partial/base-hvac-ground-to-air-heat-pump-50percent.xml.skip
#	tests/hvac_partial/base-hvac-mini-split-heat-pump-ducted-50percent.xml.skip
  • Loading branch information
shorowit committed May 21, 2019
2 parents 42c7746 + 5f3a26c commit ffbf3e0
Show file tree
Hide file tree
Showing 299 changed files with 112 additions and 1,439 deletions.
1 change: 0 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ end
def get_hpxml_file_climate_and_risk_zones_values(hpxml_file, climate_and_risk_zones_values)
if ['base.xml'].include? hpxml_file
climate_and_risk_zones_values = { :iecc2006 => "5B",
:iecc2012 => "5B",
:weather_station_id => "WeatherStation",
:weather_station_name => "Denver, CO",
:weather_station_wmo => "725650" }
Expand Down
5 changes: 0 additions & 5 deletions resources/EPvalidator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ def self.run_validator(hpxml_doc)
"/HPXML/Building/BuildingDetails/MiscLoads/PlugLoad[PlugLoadType='TV other']" => zero_or_one, # See [Television]
},

# [ClimateZone]
"/HPXML/Building/BuildingDetails/ClimateandRiskZones/ClimateZoneIECC" => {
"[ClimateZone='1A' or ClimateZone='1B' or ClimateZone='1C' or ClimateZone='2A' or ClimateZone='2B' or ClimateZone='2C' or ClimateZone='3A' or ClimateZone='3B' or ClimateZone='3C' or ClimateZone='4A' or ClimateZone='4B' or ClimateZone='4C' or ClimateZone='5A' or ClimateZone='5B' or ClimateZone='5C' or ClimateZone='6A' or ClimateZone='6B' or ClimateZone='6C' or ClimateZone='7' or ClimateZone='8']" => one,
},

# [WeatherStation]
"/HPXML/Building/BuildingDetails/ClimateandRiskZones/WeatherStation" => {
"SystemIdentifier" => one, # Required by HPXML schema
Expand Down
9 changes: 5 additions & 4 deletions resources/airflow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -886,13 +886,14 @@ def self.process_nat_vent(model, runner, nat_vent, tin_sensor, tout_sensor, pbar
temp_hourly_wked << ssn_schedule_wked
end

temp_sch = HourlyByMonthSchedule.new(model, runner, Constants.ObjectNameNaturalVentilation + " temp schedule", temp_hourly_wkdy, temp_hourly_wked, normalize_values = false)
temp_sch = HourlyByMonthSchedule.new(model, runner, Constants.ObjectNameNaturalVentilation + " temp schedule", temp_hourly_wkdy, temp_hourly_wked, normalize_values = false, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsTemperature)

wout_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, "Site Outdoor Air Humidity Ratio")
wout_sensor.setName("#{Constants.ObjectNameNaturalVentilation} wt s")

avail_sch = OpenStudio::Model::ScheduleRuleset.new(model)
avail_sch.setName(Constants.ObjectNameNaturalVentilation + " avail schedule")
Schedule.set_schedule_type_limits(model, avail_sch, Constants.ScheduleTypeLimitsOnOff)

day_endm = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]
day_startm = [0, 1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]
Expand Down Expand Up @@ -1518,20 +1519,20 @@ def self.create_infil_mech_vent_objects(model, runner, building, infil, mech_ven

range_array = [0.0] * 24
range_array[mech_vent.range_exhaust_hour - 1] = 1.0
range_hood_sch = HourlyByMonthSchedule.new(model, runner, Constants.ObjectNameMechanicalVentilation + " range exhaust schedule", [range_array] * 12, [range_array] * 12, normalize_values = false)
range_hood_sch = HourlyByMonthSchedule.new(model, runner, Constants.ObjectNameMechanicalVentilation + " range exhaust schedule", [range_array] * 12, [range_array] * 12, normalize_values = false, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsOnOff)
range_sch_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, "Schedule Value")
range_sch_sensor.setName("#{Constants.ObjectNameMechanicalVentilation} range sch s")
range_sch_sensor.setKeyName(range_hood_sch.schedule.name.to_s)

bathroom_array = [0.0] * 24
bathroom_array[mech_vent.bathroom_exhaust_hour - 1] = 1.0
bath_exhaust_sch = HourlyByMonthSchedule.new(model, runner, Constants.ObjectNameMechanicalVentilation + " bath exhaust schedule", [bathroom_array] * 12, [bathroom_array] * 12, normalize_values = false)
bath_exhaust_sch = HourlyByMonthSchedule.new(model, runner, Constants.ObjectNameMechanicalVentilation + " bath exhaust schedule", [bathroom_array] * 12, [bathroom_array] * 12, normalize_values = false, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsOnOff)
bath_sch_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, "Schedule Value")
bath_sch_sensor.setName("#{Constants.ObjectNameMechanicalVentilation} bath sch s")
bath_sch_sensor.setKeyName(bath_exhaust_sch.schedule.name.to_s)

if mech_vent.has_dryer and mech_vent.dryer_exhaust > 0
dryer_exhaust_sch = HotWaterSchedule.new(model, runner, Constants.ObjectNameMechanicalVentilation + " dryer exhaust schedule", Constants.ObjectNameMechanicalVentilation + " dryer exhaust temperature schedule", building.nbeds, mech_vent.dryer_exhaust_day_shift, "ClothesDryerExhaust", 0)
dryer_exhaust_sch = HotWaterSchedule.new(model, runner, Constants.ObjectNameMechanicalVentilation + " dryer exhaust schedule", Constants.ObjectNameMechanicalVentilation + " dryer exhaust temperature schedule", building.nbeds, mech_vent.dryer_exhaust_day_shift, "ClothesDryerExhaust", 0, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsFraction)
dryer_sch_sensor = OpenStudio::Model::EnergyManagementSystemSensor.new(model, "Schedule Value")
dryer_sch_sensor.setName("#{Constants.ObjectNameMechanicalVentilation} dryer sch s")
dryer_sch_sensor.setKeyName(dryer_exhaust_sch.schedule.name.to_s)
Expand Down
12 changes: 12 additions & 0 deletions resources/constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,18 @@ def self.RoofTypeHip
return 'hip'
end

def self.ScheduleTypeLimitsFraction
return 'Fractional'
end

def self.ScheduleTypeLimitsOnOff
return 'OnOff'
end

def self.ScheduleTypeLimitsTemperature
return 'Temperature'
end

def self.SeasonHeating
return 'Heating'
end
Expand Down
21 changes: 1 addition & 20 deletions resources/constructions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1163,8 +1163,6 @@ def self.get_default_frame_wall_ufactor(iecc_zone_2006)
return 0.060
elsif ["7", "8"].include? iecc_zone_2006
return 0.057
else
return nil
end
end

Expand Down Expand Up @@ -1268,8 +1266,6 @@ def self.get_default_floor_ufactor(iecc_zone_2006)
return 0.047
elsif ["4C", "5A", "5B", "5C", "6A", "6B", "6C", "7", "8"].include? iecc_zone_2006
return 0.033
else
return nil
end
end

Expand All @@ -1282,8 +1278,6 @@ def self.get_default_ceiling_ufactor(iecc_zone_2006)
return 0.030
elsif ["6A", "6B", "6C", "7", "8"].include? iecc_zone_2006
return 0.026
else
return nil
end
end

Expand All @@ -1294,8 +1288,6 @@ def self.get_default_basement_wall_ufactor(iecc_zone_2006)
return 0.360
elsif ["4A", "4B", "4C", "5A", "5B", "5C", "6A", "6B", "6C", "7", "8"].include? iecc_zone_2006
return 0.059
else
return nil
end
end

Expand All @@ -1308,8 +1300,6 @@ def self.get_default_slab_perimeter_rvalue_depth(iecc_zone_2006)
return 10.0, 2.0
elsif ["6A", "6B", "6C", "7", "8"].include? iecc_zone_2006
return 10.0, 4.0
else
return nil
end
end

Expand Down Expand Up @@ -1337,8 +1327,6 @@ def self.get_default_ufactor_shgc(iecc_zone_2006)
return 0.40, 0.40
elsif ["4C", "5A", "5B", "5C", "6A", "6B", "6C", "7", "8"].include? iecc_zone_2006
return 0.35, 0.40
else
return nil
end
end

Expand Down Expand Up @@ -1555,15 +1543,8 @@ def self.apply_window_skylight(runner, model, type, subsurfaces, constr_name, we
day_startm = [0, 1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]
day_endm = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365]

# WindowShadingSchedule
sched_type = OpenStudio::Model::ScheduleTypeLimits.new(model)
sched_type.setName("FRACTION")
sched_type.setLowerLimitValue(0)
sched_type.setUpperLimitValue(1)
sched_type.setNumericType("Continuous")

# Interior Shading Schedule
sch = MonthWeekdayWeekendSchedule.new(model, runner, "#{type} shading schedule", Array.new(24, 1), Array.new(24, 1), cooling_season)
sch = MonthWeekdayWeekendSchedule.new(model, runner, "#{type} shading schedule", Array.new(24, 1), Array.new(24, 1), cooling_season, mult_weekday = 1.0, mult_weekend = 1.0, normalize_values = true, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsFraction)
if not sch.validated?
return false
end
Expand Down
2 changes: 1 addition & 1 deletion resources/geometry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def self.process_occupants(model, runner, num_occ, occ_gain, sens_frac, lat_frac

if people_sch.nil?
# Create schedule
people_sch = MonthWeekdayWeekendSchedule.new(model, runner, Constants.ObjectNameOccupants + " schedule", weekday_sch, weekend_sch, monthly_sch)
people_sch = MonthWeekdayWeekendSchedule.new(model, runner, Constants.ObjectNameOccupants + " schedule", weekday_sch, weekend_sch, monthly_sch, mult_weekday = 1.0, mult_weekend = 1.0, normalize_values = true, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsFraction)
if not people_sch.validated?
return false
end
Expand Down
15 changes: 9 additions & 6 deletions resources/hotwater_appliances.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def self.apply(model, runner, weather, living_space,

# Schedules init
timestep_minutes = (60.0 / model.getTimestep.numberOfTimestepsPerHour).to_i
start_date = model.getYearDescription.makeDate(1, 1)
start_date = OpenStudio::Date.new(OpenStudio::MonthOfYear.new(1), 1, model.getYearDescription.assumedYear)
timestep_interval = OpenStudio::Time.new(0, 0, timestep_minutes)
timestep_day = OpenStudio::Time.new(0, 0, 60 * 24)
temp_sch_limits = model.getScheduleTypeLimitsByName("Temperature")
Expand Down Expand Up @@ -71,10 +71,12 @@ def self.apply(model, runner, weather, living_space,
end
end
end

sum_fractions_hw = fractions_hw.reduce(:+).to_f
time_series_hw = OpenStudio::TimeSeries.new(start_date, timestep_interval, OpenStudio::createVector(fractions_hw), "")
schedule_hw = OpenStudio::Model::ScheduleInterval.fromTimeSeries(time_series_hw, model).get
schedule_hw.setName("Hot Water Draw Profile")
Schedule.set_schedule_type_limits(model, schedule_hw, Constants.ScheduleTypeLimitsFraction)

# Create mixed water draw profile schedule
dwhr_eff_adj, dwhr_iFrac, dwhr_plc, dwhr_locF, dwhr_fixF = get_dwhr_factors(nbeds, dist_type, std_pipe_length, recirc_branch_length, dwhr_is_equal_flow, dwhr_facilities_connected, has_low_flow_fixtures)
Expand All @@ -91,6 +93,7 @@ def self.apply(model, runner, weather, living_space,
time_series_mw = OpenStudio::TimeSeries.new(start_date, timestep_interval, OpenStudio::createVector(fractions_mw), "")
schedule_mw = OpenStudio::Model::ScheduleInterval.fromTimeSeries(time_series_mw, model).get
schedule_mw.setName("Mixed Water Draw Profile")
Schedule.set_schedule_type_limits(model, schedule_mw, Constants.ScheduleTypeLimitsFraction)

# Replace mains water temperature schedule with water heater inlet temperature schedule.
# These are identical unless there is a DWHR.
Expand Down Expand Up @@ -119,7 +122,7 @@ def self.apply(model, runner, weather, living_space,
cd_name = Constants.ObjectNameClothesDryer
cd_weekday_sch = "0.010, 0.006, 0.004, 0.002, 0.004, 0.006, 0.016, 0.032, 0.048, 0.068, 0.078, 0.081, 0.074, 0.067, 0.057, 0.061, 0.055, 0.054, 0.051, 0.051, 0.052, 0.054, 0.044, 0.024"
cd_monthly_sch = "1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0"
cd_schedule = MonthWeekdayWeekendSchedule.new(model, runner, cd_name, cd_weekday_sch, cd_weekday_sch, cd_monthly_sch, 1.0, 1.0)
cd_schedule = MonthWeekdayWeekendSchedule.new(model, runner, cd_name, cd_weekday_sch, cd_weekday_sch, cd_monthly_sch, mult_weekday = 1.0, mult_weekend = 1.0, normalize_values = true, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsFraction)
cd_design_level_e = cd_schedule.calcDesignLevelFromDailykWh(cd_annual_kwh / 365.0)
cd_design_level_f = cd_schedule.calcDesignLevelFromDailyTherm(cd_annual_therm / 365.0)
add_electric_equipment(model, cd_name, cd_space, cd_design_level_e, cd_frac_sens, cd_frac_lat, cd_schedule.schedule)
Expand All @@ -144,7 +147,7 @@ def self.apply(model, runner, weather, living_space,
fridge_name = Constants.ObjectNameRefrigerator
fridge_weekday_sch = "0.040, 0.039, 0.038, 0.037, 0.036, 0.036, 0.038, 0.040, 0.041, 0.041, 0.040, 0.040, 0.042, 0.042, 0.042, 0.041, 0.044, 0.048, 0.050, 0.048, 0.047, 0.046, 0.044, 0.041"
fridge_monthly_sch = "0.837, 0.835, 1.084, 1.084, 1.084, 1.096, 1.096, 1.096, 1.096, 0.931, 0.925, 0.837"
fridge_schedule = MonthWeekdayWeekendSchedule.new(model, runner, fridge_name, fridge_weekday_sch, fridge_weekday_sch, fridge_monthly_sch, 1.0, 1.0)
fridge_schedule = MonthWeekdayWeekendSchedule.new(model, runner, fridge_name, fridge_weekday_sch, fridge_weekday_sch, fridge_monthly_sch, mult_weekday = 1.0, mult_weekend = 1.0, normalize_values = true, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsFraction)
fridge_design_level = fridge_schedule.calcDesignLevelFromDailykWh(fridge_annual_kwh / 365.0)
add_electric_equipment(model, fridge_name, fridge_space, fridge_design_level, 1.0, 0.0, fridge_schedule.schedule)
end
Expand All @@ -155,7 +158,7 @@ def self.apply(model, runner, weather, living_space,
cook_name = Constants.ObjectNameCookingRange
cook_weekday_sch = "0.007, 0.007, 0.004, 0.004, 0.007, 0.011, 0.025, 0.042, 0.046, 0.048, 0.042, 0.050, 0.057, 0.046, 0.057, 0.044, 0.092, 0.150, 0.117, 0.060, 0.035, 0.025, 0.016, 0.011"
cook_monthly_sch = "1.097, 1.097, 0.991, 0.987, 0.991, 0.890, 0.896, 0.896, 0.890, 1.085, 1.085, 1.097"
cook_schedule = MonthWeekdayWeekendSchedule.new(model, runner, cook_name, cook_weekday_sch, cook_weekday_sch, cook_monthly_sch, 1.0, 1.0)
cook_schedule = MonthWeekdayWeekendSchedule.new(model, runner, cook_name, cook_weekday_sch, cook_weekday_sch, cook_monthly_sch, mult_weekday = 1.0, mult_weekend = 1.0, normalize_values = true, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsFraction)
cook_design_level_e = cook_schedule.calcDesignLevelFromDailykWh(cook_annual_kwh / 365.0)
cook_design_level_f = cook_schedule.calcDesignLevelFromDailyTherm(cook_annual_therm / 365.0)
add_electric_equipment(model, cook_name, living_space, cook_design_level_e, cook_frac_sens, cook_frac_lat, cook_schedule.schedule)
Expand All @@ -172,7 +175,7 @@ def self.apply(model, runner, weather, living_space,
fx_peak_flow_gpm = fx_gpd / sum_fractions_hw / timestep_minutes * 365.0
fx_weekday_sch = "0.010, 0.006, 0.004, 0.002, 0.004, 0.006, 0.016, 0.032, 0.048, 0.068, 0.078, 0.081, 0.074, 0.067, 0.057, 0.061, 0.055, 0.054, 0.051, 0.051, 0.052, 0.054, 0.044, 0.024"
fx_monthly_sch = "1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0"
fx_schedule = MonthWeekdayWeekendSchedule.new(model, runner, fx_obj_name, fx_weekday_sch, fx_weekday_sch, fx_monthly_sch, 1.0, 1.0)
fx_schedule = MonthWeekdayWeekendSchedule.new(model, runner, fx_obj_name, fx_weekday_sch, fx_weekday_sch, fx_monthly_sch, mult_weekday = 1.0, mult_weekend = 1.0, normalize_values = true, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsFraction)
fx_design_level_sens = fx_schedule.calcDesignLevelFromDailykWh(UnitConversions.convert(fx_sens_btu, "Btu", "kWh") / 365.0)
fx_design_level_lat = fx_schedule.calcDesignLevelFromDailykWh(UnitConversions.convert(fx_lat_btu, "Btu", "kWh") / 365.0)
dhw_loop_fracs.each do |sys_id, dhw_load_frac|
Expand All @@ -196,7 +199,7 @@ def self.apply(model, runner, weather, living_space,
dist_pump_obj_name = Constants.ObjectNameHotWaterRecircPump
dist_pump_weekday_sch = "0.010, 0.006, 0.004, 0.002, 0.004, 0.006, 0.016, 0.032, 0.048, 0.068, 0.078, 0.081, 0.074, 0.067, 0.057, 0.061, 0.055, 0.054, 0.051, 0.051, 0.052, 0.054, 0.044, 0.024"
dist_pump_monthly_sch = "1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0"
dist_pump_schedule = MonthWeekdayWeekendSchedule.new(model, runner, dist_pump_obj_name, dist_pump_weekday_sch, dist_pump_weekday_sch, dist_pump_monthly_sch, 1.0, 1.0)
dist_pump_schedule = MonthWeekdayWeekendSchedule.new(model, runner, dist_pump_obj_name, dist_pump_weekday_sch, dist_pump_weekday_sch, dist_pump_monthly_sch, mult_weekday = 1.0, mult_weekend = 1.0, normalize_values = true, create_sch_object = true, schedule_type_limits_name = Constants.ScheduleTypeLimitsFraction)
dist_pump_design_level = dist_pump_schedule.calcDesignLevelFromDailykWh(dist_pump_annual_kwh / 365.0)
dhw_loop_fracs.each do |sys_id, dhw_load_frac|
dhw_loop = dhw_loops[sys_id]
Expand Down
Loading

0 comments on commit ffbf3e0

Please sign in to comment.