Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support auto_seasons arguments #975

Merged
merged 16 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Fixes
- Reduce housing characteristic file size by relaxing the six digit float format in the housing characteristics ([#877](https://github.com/NREL/resstock/pull/877))
- Fix minor bug in sampling probability calculation ([#934](https://github.com/NREL/resstock/pull/934))
- Rename sources subfolders so all tsv_makers can be imported as packages ([#959](https://github.com/NREL/resstock/pull/959))
- Fix heating and cooling auto-season inputs ([#975](https://github.com/NREL/resstock/pull/975))

## ResStock v2.5.0
###### February 9, 2022 - [Diff](https://github.com/NREL/OpenStudio-BuildStock/compare/v2.4.0...v2.5.0)
Expand Down
72 changes: 2 additions & 70 deletions measures/ResStockArguments/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -480,26 +480,12 @@ def run(model, runner, user_arguments)
args['hvac_control_cooling_weekend_setpoint'] = weekend_cooling_setpoints.join(', ')

# Seasons
if args['use_auto_heating_season'] || args['use_auto_cooling_season']
epw_path, cache_path = process_weather(args['weather_station_epw_filepath'], runner, model, '../in.xml')
weather, _epw_file = Location.apply_weather_file(model, runner, epw_path, cache_path)
heating_months, cooling_months = HVAC.get_default_heating_and_cooling_seasons(weather)
end

if args['use_auto_heating_season']
season_heating_begin_month, season_heating_begin_day_of_month, season_heating_end_month, season_heating_end_day_of_month = get_begin_and_end_dates_from_monthly_array(model, heating_months)
args['season_heating_begin_month'] = season_heating_begin_month
args['season_heating_begin_day_of_month'] = season_heating_begin_day_of_month
args['season_heating_end_month'] = season_heating_end_month
args['season_heating_end_day_of_month'] = season_heating_end_day_of_month
args['hvac_control_heating_season_period'] = HPXML::BuildingAmerica
end

if args['use_auto_cooling_season']
season_cooling_begin_month, season_cooling_begin_day_of_month, season_cooling_end_month, season_cooling_end_day_of_month = get_begin_and_end_dates_from_monthly_array(model, cooling_months)
args['season_cooling_begin_month'] = season_cooling_begin_month
args['season_cooling_begin_day_of_month'] = season_cooling_begin_day_of_month
args['season_cooling_end_month'] = season_cooling_end_month
args['season_cooling_end_day_of_month'] = season_cooling_end_day_of_month
args['hvac_control_cooling_season_period'] = HPXML::BuildingAmerica
end

# Flue or Chimney
Expand Down Expand Up @@ -750,60 +736,6 @@ def modify_setpoint_schedule(schedule, offset_magnitude, offset_schedule)
end
return schedule
end

def process_weather(weather_station_epw_filepath, runner, model, hpxml_path)
epw_path = weather_station_epw_filepath

if not File.exist? epw_path
test_epw_path = File.join(File.dirname(hpxml_path), epw_path)
epw_path = test_epw_path if File.exist? test_epw_path
end
if not File.exist? epw_path
test_epw_path = File.join(File.dirname(__FILE__), '..', 'weather', epw_path)
epw_path = test_epw_path if File.exist? test_epw_path
end
if not File.exist? epw_path
test_epw_path = File.join(File.dirname(__FILE__), '..', '..', 'weather', epw_path)
epw_path = test_epw_path if File.exist? test_epw_path
end
if not File.exist?(epw_path)
fail "'#{epw_path}' could not be found."
end

cache_path = epw_path.gsub('.epw', '-cache.csv')
if not File.exist?(cache_path)
# Process weather file to create cache .csv
runner.registerWarning("'#{cache_path}' could not be found; regenerating it.")
epw_file = OpenStudio::EpwFile.new(epw_path)
OpenStudio::Model::WeatherFile.setWeatherFile(model, epw_file)
weather = WeatherProcess.new(model, runner)
begin
File.open(cache_path, 'wb') do |file|
weather.dump_to_csv(file)
end
rescue SystemCallError
runner.registerWarning("#{cache_path} could not be written, skipping.")
end
end

return epw_path, cache_path
end

def get_begin_and_end_dates_from_monthly_array(model, months)
if months.include? 0
if months[0] == 1 && months[11] == 1 # Wrap around year
begin_month = 12 - months.reverse.index(0) + 1
end_month = months.index(0)
else
begin_month = months.index(1) + 1
end_month = 12 - months.reverse.index(1)
end
end
get_num_days_per_month = Schedule.get_num_days_per_month(model)
begin_day = 1
end_day = get_num_days_per_month[end_month - 1]
return begin_month, begin_day, end_month, end_day
end
end

# register the measure to be used by the application
Expand Down
174 changes: 165 additions & 9 deletions measures/ResStockArguments/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>res_stock_arguments</name>
<uid>c984bb9e-4ac4-4930-a399-9d23f8f6936a</uid>
<version_id>cd55d8a5-da3f-40cd-ae6c-c29c23d9a947</version_id>
<version_modified>20220610T212700Z</version_modified>
<version_id>91d39e63-cbf1-4a05-97d6-d8d5b8db7e03</version_id>
<version_modified>20220811T203130Z</version_modified>
<xml_checksum>2C38F48B</xml_checksum>
<class_name>ResStockArguments</class_name>
<display_name>ResStock Arguments</display_name>
Expand Down Expand Up @@ -1362,7 +1362,7 @@
<argument>
<name>cooling_system_cooling_efficiency_type</name>
<display_name>Cooling System: Efficiency Type</display_name>
<description>The efficiency type of the cooling system. System types central air conditioner and mini-split use SEER. System types room air conditioner and packaged terminal air conditioner use EER or CEER. Ignored for system type evaporative cooler.</description>
<description>The efficiency type of the cooling system. System types central air conditioner and mini-split use SEER or SEER2. System types room air conditioner and packaged terminal air conditioner use EER or CEER. Ignored for system type evaporative cooler.</description>
<type>Choice</type>
<required>true</required>
<model_dependent>false</model_dependent>
Expand All @@ -1372,6 +1372,10 @@
<value>SEER</value>
<display_name>SEER</display_name>
</choice>
<choice>
<value>SEER2</value>
<display_name>SEER2</display_name>
</choice>
<choice>
<value>EER</value>
<display_name>EER</display_name>
Expand All @@ -1387,7 +1391,6 @@
<display_name>Cooling System: Efficiency</display_name>
<description>The rated efficiency value of the cooling system. Ignored for evaporative cooler.</description>
<type>Double</type>
<units>SEER or EER or CEER</units>
<required>true</required>
<model_dependent>false</model_dependent>
<default_value>13</default_value>
Expand Down Expand Up @@ -1476,7 +1479,7 @@
<argument>
<name>heat_pump_heating_efficiency_type</name>
<display_name>Heat Pump: Heating Efficiency Type</display_name>
<description>The heating efficiency type of heat pump. System types air-to-air and mini-split use HSPF. System types ground-to-air and packaged terminal heat pump use COP.</description>
<description>The heating efficiency type of heat pump. System types air-to-air and mini-split use HSPF or HSPF2. System types ground-to-air and packaged terminal heat pump use COP.</description>
<type>Choice</type>
<required>true</required>
<model_dependent>false</model_dependent>
Expand All @@ -1486,6 +1489,10 @@
<value>HSPF</value>
<display_name>HSPF</display_name>
</choice>
<choice>
<value>HSPF2</value>
<display_name>HSPF2</display_name>
</choice>
<choice>
<value>COP</value>
<display_name>COP</display_name>
Expand All @@ -1497,15 +1504,14 @@
<display_name>Heat Pump: Heating Efficiency</display_name>
<description>The rated heating efficiency value of the heat pump.</description>
<type>Double</type>
<units>HSPF or COP</units>
<required>true</required>
<model_dependent>false</model_dependent>
<default_value>7.7</default_value>
</argument>
<argument>
<name>heat_pump_cooling_efficiency_type</name>
<display_name>Heat Pump: Cooling Efficiency Type</display_name>
<description>The cooling efficiency type of heat pump. System types air-to-air and mini-split use SEER. System types ground-to-air and packaged terminal heat pump use EER.</description>
<description>The cooling efficiency type of heat pump. System types air-to-air and mini-split use SEER or SEER2. System types ground-to-air and packaged terminal heat pump use EER.</description>
<type>Choice</type>
<required>true</required>
<model_dependent>false</model_dependent>
Expand All @@ -1515,6 +1521,10 @@
<value>SEER</value>
<display_name>SEER</display_name>
</choice>
<choice>
<value>SEER2</value>
<display_name>SEER2</display_name>
</choice>
<choice>
<value>EER</value>
<display_name>EER</display_name>
Expand All @@ -1530,7 +1540,6 @@
<display_name>Heat Pump: Cooling Efficiency</display_name>
<description>The rated cooling efficiency value of the heat pump.</description>
<type>Double</type>
<units>SEER or EER</units>
<required>true</required>
<model_dependent>false</model_dependent>
<default_value>13</default_value>
Expand Down Expand Up @@ -4332,6 +4341,153 @@
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_scenario_names</name>
<display_name>utility_bill_scenario_names</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_electricity_fixed_charges</name>
<display_name>utility_bill_electricity_fixed_charges</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_natural_gas_fixed_charges</name>
<display_name>utility_bill_natural_gas_fixed_charges</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_propane_fixed_charges</name>
<display_name>utility_bill_propane_fixed_charges</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_fuel_oil_fixed_charges</name>
<display_name>utility_bill_fuel_oil_fixed_charges</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_coal_fixed_charges</name>
<display_name>utility_bill_coal_fixed_charges</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_wood_fixed_charges</name>
<display_name>utility_bill_wood_fixed_charges</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_wood_pellets_fixed_charges</name>
<display_name>utility_bill_wood_pellets_fixed_charges</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_electricity_marginal_rates</name>
<display_name>utility_bill_electricity_marginal_rates</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_natural_gas_marginal_rates</name>
<display_name>utility_bill_natural_gas_marginal_rates</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_propane_marginal_rates</name>
<display_name>utility_bill_propane_marginal_rates</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_fuel_oil_marginal_rates</name>
<display_name>utility_bill_fuel_oil_marginal_rates</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_coal_marginal_rates</name>
<display_name>utility_bill_coal_marginal_rates</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_wood_marginal_rates</name>
<display_name>utility_bill_wood_marginal_rates</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_wood_pellets_marginal_rates</name>
<display_name>utility_bill_wood_pellets_marginal_rates</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_pv_compensation_types</name>
<display_name>utility_bill_pv_compensation_types</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_pv_net_metering_annual_excess_sellback_rate_types</name>
<display_name>utility_bill_pv_net_metering_annual_excess_sellback_rate_types</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_pv_net_metering_annual_excess_sellback_rates</name>
<display_name>utility_bill_pv_net_metering_annual_excess_sellback_rates</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_pv_feed_in_tariff_rates</name>
<display_name>utility_bill_pv_feed_in_tariff_rates</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_pv_monthly_grid_connection_fee_units</name>
<display_name>utility_bill_pv_monthly_grid_connection_fee_units</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>utility_bill_pv_monthly_grid_connection_fees</name>
<display_name>utility_bill_pv_monthly_grid_connection_fees</display_name>
<type>String</type>
<required>false</required>
<model_dependent>false</model_dependent>
</argument>
<argument>
<name>additional_properties</name>
<display_name>additional_properties</display_name>
Expand Down Expand Up @@ -4878,7 +5034,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>4A468004</checksum>
<checksum>2C43C131</checksum>
</file>
</files>
</measure>
19 changes: 13 additions & 6 deletions project_national/housing_characteristics/options_saturations.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12044,6 +12044,13 @@ Level,Parameter,Option,Saturation
10,Geometry Stories,15,0.00103517
10,Geometry Stories,20,0.00210734
10,Geometry Stories,21,0.00682112
10,HVAC Cooling Partial Space Conditioning,<10% Conditioned,0.00660867
10,HVAC Cooling Partial Space Conditioning,20% Conditioned,0.0746041
10,HVAC Cooling Partial Space Conditioning,40% Conditioned,0.0544195
10,HVAC Cooling Partial Space Conditioning,60% Conditioned,0.0633537
10,HVAC Cooling Partial Space Conditioning,80% Conditioned,0.0361732
10,HVAC Cooling Partial Space Conditioning,100% Conditioned,0.604353
10,HVAC Cooling Partial Space Conditioning,None,0.160487
11,Heating Setpoint Has Offset,Yes,0.505881
11,Heating Setpoint Has Offset,No,0.494119
11,Heating Setpoint,55F,0.121208
Expand All @@ -12058,12 +12065,12 @@ Level,Parameter,Option,Saturation
11,Heating Setpoint,76F,0.019438
11,Heating Setpoint,78F,0.0247652
11,Heating Setpoint,80F,0.0171024
11,Federal Poverty Level,0-100%,0.122161
11,Federal Poverty Level,100-150%,0.0880937
11,Federal Poverty Level,150-200%,0.083165
11,Federal Poverty Level,200-300%,0.160163
11,Federal Poverty Level,300-400%,0.133104
11,Federal Poverty Level,400%+,0.413313
11,Federal Poverty Level,0-100%,0.121833
11,Federal Poverty Level,100-150%,0.0880186
11,Federal Poverty Level,150-200%,0.0832055
11,Federal Poverty Level,200-300%,0.160325
11,Federal Poverty Level,300-400%,0.133195
11,Federal Poverty Level,400%+,0.413423
11,Geometry Building Level MF,Bottom,0.114484
11,Geometry Building Level MF,Middle,0.0597402
11,Geometry Building Level MF,None,0.736193
Expand Down
Loading