Skip to content

Commit

Permalink
Map electric vehicle and charger OS-HPXML arguments to ResStock options
Browse files Browse the repository at this point in the history
  • Loading branch information
aspeake committed Sep 13, 2024
1 parent b17de1b commit be3b260
Show file tree
Hide file tree
Showing 8 changed files with 291 additions and 139 deletions.
151 changes: 107 additions & 44 deletions measures/ResStockArguments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3846,6 +3846,100 @@ The round trip efficiency of the lithium ion battery. If not provided, the OS-HP

<br/>

**Electric Vehicle: Present**

Whether there is an electric vehicle battery present.

- **Name:** ``ev_present``
- **Type:** ``Choice``

- **Required:** ``false``

- **Choices:** `auto`, `true`, `false`

<br/>

**Electric Vehicle: Usable Battery Capacity**

The usable capacity of the EV battery. If not provided, the OS-HPXML default is used.

- **Name:** ``ev_battery_usable_capacity``
- **Type:** ``String``

- **Required:** ``false``

<br/>

**Electric Vehicle: Energy Efficiency**

The efficiency of the EV. If not provided, the OS-HPXML default is used.

- **Name:** ``ev_energy_efficiency``
- **Type:** ``String``

- **Required:** ``false``

<br/>

**Electric Vehicle: Miles Traveled**

The annual miles traveled by the EV.

- **Name:** ``ev_miles_per_year``
- **Type:** ``String``

- **Required:** ``false``

<br/>

**Electric Vehicle: Fraction Charged at Home**

The fraction charging energy provided by the at-home charger.

- **Name:** ``ev_fraction_charged_home``
- **Type:** ``String``

- **Required:** ``false``

<br/>

**Electric Vehicle Charger: Present**

Whether there is an electric vehicle charger present.

- **Name:** ``ev_charger_present``
- **Type:** ``Choice``

- **Required:** ``false``

- **Choices:** `auto`, `true`, `false`

<br/>

**Electric Vehicle Charger: Rated Charger Power Output**

The rated power output of the EV charger. If not provided, the OS-HPXML default is used.

- **Name:** ``ev_charger_power``
- **Type:** ``String``

- **Required:** ``false``

<br/>

**Electric Vehicle Charger: Location**

The space type for the EV charger. If not provided, the OS-HPXML default is used.

- **Name:** ``ev_charger_location``
- **Type:** ``Choice``

- **Required:** ``false``

- **Choices:** `auto`, `garage`, `outside`

<br/>

**Lighting: Present**

Whether there is lighting energy use.
Expand Down Expand Up @@ -4799,39 +4893,6 @@ Multiplier on the well pump energy usage that can reflect, e.g., high/low usage

<br/>

**Misc Plug Loads: Vehicle Present**

Whether there is an electric vehicle.

- **Name:** ``misc_plug_loads_vehicle_present``
- **Type:** ``Boolean``

- **Required:** ``true``

<br/>

**Misc Plug Loads: Vehicle Annual kWh**

The annual energy consumption of the electric vehicle plug loads. If not provided, the OS-HPXML default (see <a href='https://openstudio-hpxml.readthedocs.io/en/v1.8.1/workflow_inputs.html#hpxml-plug-loads'>HPXML Plug Loads</a>) is used.

- **Name:** ``misc_plug_loads_vehicle_annual_kwh``
- **Type:** ``String``

- **Required:** ``false``

<br/>

**Misc Plug Loads: Vehicle Usage Multiplier**

Multiplier on the electric vehicle energy usage that can reflect, e.g., high/low usage occupants. If not provided, the OS-HPXML default (see <a href='https://openstudio-hpxml.readthedocs.io/en/v1.8.1/workflow_inputs.html#hpxml-plug-loads'>HPXML Plug Loads</a>) is used.

- **Name:** ``misc_plug_loads_vehicle_usage_multiplier``
- **Type:** ``String``

- **Required:** ``false``

<br/>

**Misc Fuel Loads: Grill Present**

Whether there is a fuel loads grill.
Expand Down Expand Up @@ -5370,17 +5431,6 @@ Additional multiplier on the well pump energy usage that can reflect, e.g., high

<br/>

**Plug Loads: Vehicle Usage Multiplier 2**

Additional multiplier on the electric vehicle energy usage that can reflect, e.g., high/low usage occupants.

- **Name:** ``misc_plug_loads_vehicle_2_usage_multiplier``
- **Type:** ``Double``

- **Required:** ``true``

<br/>

**Heating Setpoint: Weekday Temperature**

Specify the weekday heating setpoint temperature.
Expand Down Expand Up @@ -5699,6 +5749,19 @@ Whether the heat pump uses the existing system as backup.

<br/>

**Electric Vehicle: Average Miles Per Hour**

The average miles/hour driven by the vehicle.

- **Name:** ``ev_average_mph``
- **Type:** ``Double``

- **Units:** ``hours``

- **Required:** ``false``

<br/>




Expand Down
18 changes: 11 additions & 7 deletions measures/ResStockArguments/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,6 @@ def arguments(model)
arg.setDefaultValue(0.0)
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('misc_plug_loads_vehicle_2_usage_multiplier', true)
arg.setDisplayName('Plug Loads: Vehicle Usage Multiplier 2')
arg.setDescription('Additional multiplier on the electric vehicle energy usage that can reflect, e.g., high/low usage occupants.')
arg.setDefaultValue(0.0)
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('hvac_control_heating_weekday_setpoint_temp', true)
arg.setDisplayName('Heating Setpoint: Weekday Temperature')
arg.setDescription('Specify the weekday heating setpoint temperature.')
Expand Down Expand Up @@ -374,6 +368,12 @@ def arguments(model)
arg.setDescription('Whether the heat pump uses the existing system as backup.')
args << arg

arg = OpenStudio::Measure::OSArgument::makeDoubleArgument('ev_average_mph', false)
arg.setDisplayName('Electric Vehicle: Average Miles Per Hour')
arg.setDescription('The average miles/hour driven by the vehicle.')
arg.setUnits('hours')
args << arg

return args
end

Expand Down Expand Up @@ -465,7 +465,6 @@ def run(model, runner, user_arguments)
args[:misc_plug_loads_television_usage_multiplier] = args[:misc_plug_loads_television_usage_multiplier] * args[:misc_plug_loads_television_2_usage_multiplier]
args[:misc_plug_loads_other_usage_multiplier] = args[:misc_plug_loads_other_usage_multiplier] * args[:misc_plug_loads_other_2_usage_multiplier]
args[:misc_plug_loads_well_pump_usage_multiplier] = args[:misc_plug_loads_well_pump_usage_multiplier] * args[:misc_plug_loads_well_pump_2_usage_multiplier]
args[:misc_plug_loads_vehicle_usage_multiplier] = args[:misc_plug_loads_vehicle_usage_multiplier] * args[:misc_plug_loads_vehicle_2_usage_multiplier]

# Other
if args[:misc_plug_loads_other_annual_kwh] == Constants::Auto
Expand Down Expand Up @@ -742,6 +741,11 @@ def run(model, runner, user_arguments)
register_value(runner, arg_name.to_s, arg_value)
end

# Vehicle arguments
if (not args[:ev_miles_per_year].nil?) && (not args[:ev_average_mph].nil?)
args[:ev_hours_per_week] = args[:ev_miles_per_year] / args[:ev_average_mph]
end

return true
end

Expand Down
Loading

0 comments on commit be3b260

Please sign in to comment.